# daniellankry/python_car_rental_oop architecture

> Architecture diagram of the GitHub repository daniellankry/python_car_rental_oop, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/daniellankry/python_car_rental_oop
- Repository: https://github.com/daniellankry/python_car_rental_oop

## Overview

This is a small domain-model library for car rentals, not a complete booking application: it defines customers, vehicles, rental lifecycle and pricing, plus repository contracts and in-memory implementations. The principal modeled workflow is a reserved rental starting (which rents its vehicle), then completing (which returns it); callers supply and persist the domain objects through repositories. Source evidence covers these internal calls and pricing, but there is no application service, user interface, or production persistence workflow in the supplied tree.

Main entry points: [`car-rental/src/car_rental/entities.py`](https://github.com/daniellankry/python_car_rental_oop/blob/main/car-rental/src/car_rental/entities.py) (Rental lifecycle), [`car-rental/src/car_rental/repositories.py`](https://github.com/daniellankry/python_car_rental_oop/blob/main/car-rental/src/car_rental/repositories.py) (Repository contracts), [`car-rental/src/car_rental/rental_status.py`](https://github.com/daniellankry/python_car_rental_oop/blob/main/car-rental/src/car_rental/rental_status.py) (Rental statuses), [`car-rental/src/car_rental/vehicle_status.py`](https://github.com/daniellankry/python_car_rental_oop/blob/main/car-rental/src/car_rental/vehicle_status.py) (Vehicle statuses)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_domain["Rental domain"]
  node_rental["Rental lifecycle<br/>[entities.py]"]
  node_vehicle["Vehicle state<br/>[entities.py]"]
  node_customer["Customer record<br/>[entities.py]"]
  node_rental_status["Rental statuses<br/>[rental_status.py]"]
  node_vehicle_status["Vehicle statuses<br/>[vehicle_status.py]"]
end

subgraph group_pricing["Pricing"]
  node_pricing_strategy["Pricing strategies<br/>[pricing.py]"]
end

subgraph group_storage["Repository storage"]
  node_repositories["Repository contracts<br/>[repositories.py]"]
  node_vehicle_repository[("Vehicle repository<br/>[repositories.py]")]
  node_rental_repository[("Rental repository<br/>[repositories.py]")]
  node_customer_repository[("Customer repository<br/>[repositories.py]")]
end

node_caller(("Library caller"))

node_caller -->|"creates and operates"| node_rental
node_rental -->|"rents or returns"| node_vehicle
node_rental -->|"uses states"| node_rental_status
node_vehicle -->|"uses states"| node_vehicle_status
node_rental -->|"calculates total"| node_pricing_strategy
node_repositories -->|"defines contract"| node_vehicle_repository
node_repositories -->|"defines contract"| node_rental_repository
node_repositories -->|"defines contract"| node_customer_repository
node_caller -->|"stores vehicles"| node_vehicle_repository
node_caller -->|"stores rentals"| node_rental_repository
node_caller -->|"stores customers"| node_customer_repository

click node_rental "https://github.com/daniellankry/python_car_rental_oop/blob/main/car-rental/src/car_rental/entities.py"
click node_vehicle "https://github.com/daniellankry/python_car_rental_oop/blob/main/car-rental/src/car_rental/entities.py"
click node_customer "https://github.com/daniellankry/python_car_rental_oop/blob/main/car-rental/src/car_rental/entities.py"
click node_rental_status "https://github.com/daniellankry/python_car_rental_oop/blob/main/car-rental/src/car_rental/rental_status.py"
click node_vehicle_status "https://github.com/daniellankry/python_car_rental_oop/blob/main/car-rental/src/car_rental/vehicle_status.py"
click node_pricing_strategy "https://github.com/daniellankry/python_car_rental_oop/blob/main/car-rental/src/car_rental/pricing.py"
click node_repositories "https://github.com/daniellankry/python_car_rental_oop/blob/main/car-rental/src/car_rental/repositories.py"
click node_vehicle_repository "https://github.com/daniellankry/python_car_rental_oop/blob/main/car-rental/src/car_rental/repositories.py"
click node_rental_repository "https://github.com/daniellankry/python_car_rental_oop/blob/main/car-rental/src/car_rental/repositories.py"
click node_customer_repository "https://github.com/daniellankry/python_car_rental_oop/blob/main/car-rental/src/car_rental/repositories.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_rental,node_vehicle,node_customer,node_rental_status,node_vehicle_status toneBlue
class node_pricing_strategy toneAmber
class node_repositories,node_vehicle_repository,node_rental_repository,node_customer_repository toneMint
class node_caller toneIndigo
```

## Components

### Rental domain

- [Rental lifecycle](https://github.com/daniellankry/python_car_rental_oop/blob/main/car-rental/src/car_rental/entities.py): `car-rental/src/car_rental/entities.py`
- [Vehicle state](https://github.com/daniellankry/python_car_rental_oop/blob/main/car-rental/src/car_rental/entities.py): `car-rental/src/car_rental/entities.py`
- [Customer record](https://github.com/daniellankry/python_car_rental_oop/blob/main/car-rental/src/car_rental/entities.py): `car-rental/src/car_rental/entities.py`
- [Rental statuses](https://github.com/daniellankry/python_car_rental_oop/blob/main/car-rental/src/car_rental/rental_status.py): `car-rental/src/car_rental/rental_status.py`
- [Vehicle statuses](https://github.com/daniellankry/python_car_rental_oop/blob/main/car-rental/src/car_rental/vehicle_status.py): `car-rental/src/car_rental/vehicle_status.py`

### Pricing

- [Pricing strategies](https://github.com/daniellankry/python_car_rental_oop/blob/main/car-rental/src/car_rental/pricing.py): `car-rental/src/car_rental/pricing.py`

### Repository storage

- [Repository contracts](https://github.com/daniellankry/python_car_rental_oop/blob/main/car-rental/src/car_rental/repositories.py): `car-rental/src/car_rental/repositories.py`
- [Vehicle repository](https://github.com/daniellankry/python_car_rental_oop/blob/main/car-rental/src/car_rental/repositories.py): `car-rental/src/car_rental/repositories.py`
- [Rental repository](https://github.com/daniellankry/python_car_rental_oop/blob/main/car-rental/src/car_rental/repositories.py): `car-rental/src/car_rental/repositories.py`
- [Customer repository](https://github.com/daniellankry/python_car_rental_oop/blob/main/car-rental/src/car_rental/repositories.py): `car-rental/src/car_rental/repositories.py`

### Other components

- **Library caller**

## Connections

- Library caller → Rental lifecycle: creates and operates (evidence: `car-rental/src/car_rental/entities.py`)
- Rental lifecycle → Vehicle state: rents or returns (evidence: `car-rental/src/car_rental/entities.py`)
- Rental lifecycle → Rental statuses: uses states (evidence: `car-rental/src/car_rental/entities.py`)
- Vehicle state → Vehicle statuses: uses states (evidence: `car-rental/src/car_rental/entities.py`)
- Rental lifecycle → Pricing strategies: calculates total (evidence: `car-rental/src/car_rental/entities.py`)
- Repository contracts → Vehicle repository: defines contract (evidence: `car-rental/src/car_rental/repositories.py`)
- Repository contracts → Rental repository: defines contract (evidence: `car-rental/src/car_rental/repositories.py`)
- Repository contracts → Customer repository: defines contract (evidence: `car-rental/src/car_rental/repositories.py`)
- Library caller → Vehicle repository: stores vehicles (evidence: `car-rental/src/car_rental/repositories.py`)
- Library caller → Rental repository: stores rentals (evidence: `car-rental/src/car_rental/repositories.py`)
- Library caller → Customer repository: stores customers (evidence: `car-rental/src/car_rental/repositories.py`)
