# hyu-2005/quanlychothuexe_uneti02_ti17a2hn architecture

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

- Interactive diagram: https://gitdiagram.com/hyu-2005/quanlychothuexe_uneti02_ti17a2hn
- Repository: https://github.com/hyu-2005/quanlychothuexe_uneti02_ti17a2hn

## Overview

This is an ASP.NET Core car-rental management application. Customers search available vehicles and create rental bookings; staff manage booking approval, vehicle handover and return, payments, fleet/catalog data, accounts, and reporting. The sampled availability service checks vehicle status, booking overlaps, and effective rental prices; booking, payment, and reporting controllers/services use the shared EF Core context. The graph preserves the documented-by-tree rental stages, but their implementation links are limited where controller source was not sampled; no README was provided.

Main entry points: [`QuanLyChoThueXe_UNETI02_TI17A2HN/Data/AppDbContext.cs`](https://github.com/hyu-2005/quanlychothuexe_uneti02_ti17a2hn/blob/master/QuanLyChoThueXe_UNETI02_TI17A2HN/Data/AppDbContext.cs) (Rental database), [`QuanLyChoThueXe_UNETI02_TI17A2HN/Services/Implementations/XeTrongService.cs`](https://github.com/hyu-2005/quanlychothuexe_uneti02_ti17a2hn/blob/master/QuanLyChoThueXe_UNETI02_TI17A2HN/Services/Implementations/XeTrongService.cs) (Availability search), [`QuanLyChoThueXe_UNETI02_TI17A2HN/Models/Constants`](https://github.com/hyu-2005/quanlychothuexe_uneti02_ti17a2hn/tree/master/QuanLyChoThueXe_UNETI02_TI17A2HN/Models/Constants) (Domain statuses), [`QuanLyChoThueXe_UNETI02_TI17A2HN/Controllers/DatXeController.cs`](https://github.com/hyu-2005/quanlychothuexe_uneti02_ti17a2hn/blob/master/QuanLyChoThueXe_UNETI02_TI17A2HN/Controllers/DatXeController.cs) (Booking workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_rental["Rental lifecycle"]
  node_booking["Booking workflow<br/>[DatXeController.cs]"]
  node_availability["Availability search<br/>[XeTrongService.cs]"]
  node_schedule["Schedule conflicts"]
  node_handover["Vehicle handover"]
  node_return["Vehicle return<br/>[TraXeController.cs]"]
  node_payments["Payments"]
end

subgraph group_fleet["Fleet and pricing"]
  node_catalog["Fleet catalog<br/>[XeController.cs]"]
  node_brands["Vehicle makes"]
  node_vehicletypes["Vehicle types"]
  node_rentalrates["Rental rates"]
end

subgraph group_operations["Operations"]
  node_accounts["Accounts and sessions"]
  node_customers["Customer records"]
  node_reporting["Statistics and reports<br/>[ThongKeService.cs]"]
end

subgraph group_foundation["Application foundation"]
  node_domain["Rental domain records"]
  node_statuses["Domain statuses"]
  node_database[("Rental database<br/>[AppDbContext.cs]")]
  node_appstartup["Service startup<br/>[Program.cs]"]
end

node_customer(("Customer"))
node_staff(("Staff"))

node_customer -->|"submits bookings"| node_booking
node_customer -->|"searches vehicles"| node_availability
node_staff -->|"records handover"| node_handover
node_staff -->|"records return"| node_return
node_staff -->|"handles payments"| node_payments
node_staff -->|"manages fleet"| node_catalog
node_booking -->|"reads and writes"| node_database
node_booking -->|"queries availability"| node_availability
node_booking -->|"checks conflicts"| node_schedule
node_availability -->|"queries fleet and bookings"| node_database
node_availability -->|"filters statuses"| node_statuses
node_schedule -->|"checks bookings"| node_database
node_schedule -->|"filters statuses"| node_statuses
node_payments -->|"reads and writes"| node_database
node_payments -->|"uses rental records"| node_domain
node_payments -->|"uses role and status values"| node_statuses
node_catalog -->|"reads and writes"| node_database
node_vehicletypes -->|"reads and writes"| node_database
node_rentalrates -->|"reads and writes"| node_database
node_reporting -->|"aggregates rental data"| node_database
node_reporting -->|"groups by status"| node_statuses
node_database -->|"maps entities"| node_domain
node_appstartup -->|"configures context"| node_database
node_appstartup -->|"registers service"| node_availability
node_appstartup -->|"registers service"| node_schedule
node_domain -->|"booking uses status constants"| node_statuses

click node_booking "https://github.com/hyu-2005/quanlychothuexe_uneti02_ti17a2hn/blob/master/QuanLyChoThueXe_UNETI02_TI17A2HN/Controllers/DatXeController.cs"
click node_availability "https://github.com/hyu-2005/quanlychothuexe_uneti02_ti17a2hn/blob/master/QuanLyChoThueXe_UNETI02_TI17A2HN/Services/Implementations/XeTrongService.cs"
click node_schedule "https://github.com/hyu-2005/quanlychothuexe_uneti02_ti17a2hn/blob/master/QuanLyChoThueXe_UNETI02_TI17A2HN/Services/Implementations/TrungLichService.cs"
click node_handover "https://github.com/hyu-2005/quanlychothuexe_uneti02_ti17a2hn/blob/master/QuanLyChoThueXe_UNETI02_TI17A2HN/Controllers/BanGiaoXeController.cs"
click node_return "https://github.com/hyu-2005/quanlychothuexe_uneti02_ti17a2hn/blob/master/QuanLyChoThueXe_UNETI02_TI17A2HN/Controllers/TraXeController.cs"
click node_payments "https://github.com/hyu-2005/quanlychothuexe_uneti02_ti17a2hn/blob/master/QuanLyChoThueXe_UNETI02_TI17A2HN/Controllers/ThanhToanController.cs"
click node_catalog "https://github.com/hyu-2005/quanlychothuexe_uneti02_ti17a2hn/blob/master/QuanLyChoThueXe_UNETI02_TI17A2HN/Controllers/XeController.cs"
click node_brands "https://github.com/hyu-2005/quanlychothuexe_uneti02_ti17a2hn/blob/master/QuanLyChoThueXe_UNETI02_TI17A2HN/Controllers/HangXeController.cs"
click node_vehicletypes "https://github.com/hyu-2005/quanlychothuexe_uneti02_ti17a2hn/blob/master/QuanLyChoThueXe_UNETI02_TI17A2HN/Controllers/LoaiXeController.cs"
click node_rentalrates "https://github.com/hyu-2005/quanlychothuexe_uneti02_ti17a2hn/blob/master/QuanLyChoThueXe_UNETI02_TI17A2HN/Controllers/BangGiaThueController.cs"
click node_accounts "https://github.com/hyu-2005/quanlychothuexe_uneti02_ti17a2hn/blob/master/QuanLyChoThueXe_UNETI02_TI17A2HN/Controllers/TaiKhoanController.cs"
click node_customers "https://github.com/hyu-2005/quanlychothuexe_uneti02_ti17a2hn/blob/master/QuanLyChoThueXe_UNETI02_TI17A2HN/Controllers/KhachHangController.cs"
click node_reporting "https://github.com/hyu-2005/quanlychothuexe_uneti02_ti17a2hn/blob/master/QuanLyChoThueXe_UNETI02_TI17A2HN/Services/Implementations/ThongKeService.cs"
click node_domain "https://github.com/hyu-2005/quanlychothuexe_uneti02_ti17a2hn/tree/master/QuanLyChoThueXe_UNETI02_TI17A2HN/Models/Entities"
click node_statuses "https://github.com/hyu-2005/quanlychothuexe_uneti02_ti17a2hn/tree/master/QuanLyChoThueXe_UNETI02_TI17A2HN/Models/Constants"
click node_database "https://github.com/hyu-2005/quanlychothuexe_uneti02_ti17a2hn/blob/master/QuanLyChoThueXe_UNETI02_TI17A2HN/Data/AppDbContext.cs"
click node_appstartup "https://github.com/hyu-2005/quanlychothuexe_uneti02_ti17a2hn/blob/master/QuanLyChoThueXe_UNETI02_TI17A2HN/Program.cs"

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_booking,node_availability,node_schedule,node_handover,node_return,node_payments toneBlue
class node_catalog,node_brands,node_vehicletypes,node_rentalrates toneAmber
class node_accounts,node_customers,node_reporting toneMint
class node_domain,node_statuses,node_database,node_appstartup toneRose
class node_customer,node_staff toneIndigo
```

## Components

### Rental lifecycle

- [Booking workflow](https://github.com/hyu-2005/quanlychothuexe_uneti02_ti17a2hn/blob/master/QuanLyChoThueXe_UNETI02_TI17A2HN/Controllers/DatXeController.cs): `QuanLyChoThueXe_UNETI02_TI17A2HN/Controllers/DatXeController.cs`
- [Availability search](https://github.com/hyu-2005/quanlychothuexe_uneti02_ti17a2hn/blob/master/QuanLyChoThueXe_UNETI02_TI17A2HN/Services/Implementations/XeTrongService.cs): `QuanLyChoThueXe_UNETI02_TI17A2HN/Services/Implementations/XeTrongService.cs`
- [Schedule conflicts](https://github.com/hyu-2005/quanlychothuexe_uneti02_ti17a2hn/blob/master/QuanLyChoThueXe_UNETI02_TI17A2HN/Services/Implementations/TrungLichService.cs): `QuanLyChoThueXe_UNETI02_TI17A2HN/Services/Implementations/TrungLichService.cs`
- [Vehicle handover](https://github.com/hyu-2005/quanlychothuexe_uneti02_ti17a2hn/blob/master/QuanLyChoThueXe_UNETI02_TI17A2HN/Controllers/BanGiaoXeController.cs): `QuanLyChoThueXe_UNETI02_TI17A2HN/Controllers/BanGiaoXeController.cs`
- [Vehicle return](https://github.com/hyu-2005/quanlychothuexe_uneti02_ti17a2hn/blob/master/QuanLyChoThueXe_UNETI02_TI17A2HN/Controllers/TraXeController.cs): `QuanLyChoThueXe_UNETI02_TI17A2HN/Controllers/TraXeController.cs`
- [Payments](https://github.com/hyu-2005/quanlychothuexe_uneti02_ti17a2hn/blob/master/QuanLyChoThueXe_UNETI02_TI17A2HN/Controllers/ThanhToanController.cs): `QuanLyChoThueXe_UNETI02_TI17A2HN/Controllers/ThanhToanController.cs`

### Fleet and pricing

- [Fleet catalog](https://github.com/hyu-2005/quanlychothuexe_uneti02_ti17a2hn/blob/master/QuanLyChoThueXe_UNETI02_TI17A2HN/Controllers/XeController.cs): `QuanLyChoThueXe_UNETI02_TI17A2HN/Controllers/XeController.cs`
- [Vehicle makes](https://github.com/hyu-2005/quanlychothuexe_uneti02_ti17a2hn/blob/master/QuanLyChoThueXe_UNETI02_TI17A2HN/Controllers/HangXeController.cs): `QuanLyChoThueXe_UNETI02_TI17A2HN/Controllers/HangXeController.cs`
- [Vehicle types](https://github.com/hyu-2005/quanlychothuexe_uneti02_ti17a2hn/blob/master/QuanLyChoThueXe_UNETI02_TI17A2HN/Controllers/LoaiXeController.cs): `QuanLyChoThueXe_UNETI02_TI17A2HN/Controllers/LoaiXeController.cs`
- [Rental rates](https://github.com/hyu-2005/quanlychothuexe_uneti02_ti17a2hn/blob/master/QuanLyChoThueXe_UNETI02_TI17A2HN/Controllers/BangGiaThueController.cs): `QuanLyChoThueXe_UNETI02_TI17A2HN/Controllers/BangGiaThueController.cs`

### Operations

- [Accounts and sessions](https://github.com/hyu-2005/quanlychothuexe_uneti02_ti17a2hn/blob/master/QuanLyChoThueXe_UNETI02_TI17A2HN/Controllers/TaiKhoanController.cs): `QuanLyChoThueXe_UNETI02_TI17A2HN/Controllers/TaiKhoanController.cs`
- [Customer records](https://github.com/hyu-2005/quanlychothuexe_uneti02_ti17a2hn/blob/master/QuanLyChoThueXe_UNETI02_TI17A2HN/Controllers/KhachHangController.cs): `QuanLyChoThueXe_UNETI02_TI17A2HN/Controllers/KhachHangController.cs`
- [Statistics and reports](https://github.com/hyu-2005/quanlychothuexe_uneti02_ti17a2hn/blob/master/QuanLyChoThueXe_UNETI02_TI17A2HN/Services/Implementations/ThongKeService.cs): `QuanLyChoThueXe_UNETI02_TI17A2HN/Services/Implementations/ThongKeService.cs`

### Application foundation

- [Rental domain records](https://github.com/hyu-2005/quanlychothuexe_uneti02_ti17a2hn/tree/master/QuanLyChoThueXe_UNETI02_TI17A2HN/Models/Entities): `QuanLyChoThueXe_UNETI02_TI17A2HN/Models/Entities`
- [Domain statuses](https://github.com/hyu-2005/quanlychothuexe_uneti02_ti17a2hn/tree/master/QuanLyChoThueXe_UNETI02_TI17A2HN/Models/Constants): `QuanLyChoThueXe_UNETI02_TI17A2HN/Models/Constants`
- [Rental database](https://github.com/hyu-2005/quanlychothuexe_uneti02_ti17a2hn/blob/master/QuanLyChoThueXe_UNETI02_TI17A2HN/Data/AppDbContext.cs): `QuanLyChoThueXe_UNETI02_TI17A2HN/Data/AppDbContext.cs`
- [Service startup](https://github.com/hyu-2005/quanlychothuexe_uneti02_ti17a2hn/blob/master/QuanLyChoThueXe_UNETI02_TI17A2HN/Program.cs): `QuanLyChoThueXe_UNETI02_TI17A2HN/Program.cs`

### Other components

- **Customer**
- **Staff**

## Connections

- Customer → Booking workflow: submits bookings
- Customer → Availability search: searches vehicles
- Staff → Vehicle handover: records handover
- Staff → Vehicle return: records return
- Staff → Payments: handles payments
- Staff → Fleet catalog: manages fleet
- Booking workflow → Rental database: reads and writes (evidence: `QuanLyChoThueXe_UNETI02_TI17A2HN/Controllers/DatXeController.cs`)
- Booking workflow → Availability search: queries availability (evidence: `QuanLyChoThueXe_UNETI02_TI17A2HN/Controllers/DatXeController.cs`)
- Booking workflow → Schedule conflicts: checks conflicts (evidence: `QuanLyChoThueXe_UNETI02_TI17A2HN/Controllers/DatXeController.cs`)
- Availability search → Rental database: queries fleet and bookings (evidence: `QuanLyChoThueXe_UNETI02_TI17A2HN/Services/Implementations/XeTrongService.cs`)
- Availability search → Domain statuses: filters statuses (evidence: `QuanLyChoThueXe_UNETI02_TI17A2HN/Services/Implementations/XeTrongService.cs`)
- Schedule conflicts → Rental database: checks bookings (evidence: `QuanLyChoThueXe_UNETI02_TI17A2HN/Services/Implementations/TrungLichService.cs`)
- Schedule conflicts → Domain statuses: filters statuses (evidence: `QuanLyChoThueXe_UNETI02_TI17A2HN/Services/Implementations/TrungLichService.cs`)
- Payments → Rental database: reads and writes (evidence: `QuanLyChoThueXe_UNETI02_TI17A2HN/Controllers/ThanhToanController.cs`)
- Payments → Rental domain records: uses rental records (evidence: `QuanLyChoThueXe_UNETI02_TI17A2HN/Controllers/ThanhToanController.cs`)
- Payments → Domain statuses: uses role and status values (evidence: `QuanLyChoThueXe_UNETI02_TI17A2HN/Controllers/ThanhToanController.cs`)
- Fleet catalog → Rental database: reads and writes (evidence: `QuanLyChoThueXe_UNETI02_TI17A2HN/Controllers/XeController.cs`)
- Vehicle types → Rental database: reads and writes (evidence: `QuanLyChoThueXe_UNETI02_TI17A2HN/Controllers/LoaiXeController.cs`)
- Rental rates → Rental database: reads and writes (evidence: `QuanLyChoThueXe_UNETI02_TI17A2HN/Controllers/BangGiaThueController.cs`)
- Statistics and reports → Rental database: aggregates rental data (evidence: `QuanLyChoThueXe_UNETI02_TI17A2HN/Services/Implementations/ThongKeService.cs`)
- Statistics and reports → Domain statuses: groups by status (evidence: `QuanLyChoThueXe_UNETI02_TI17A2HN/Services/Implementations/ThongKeService.cs`)
- Rental database → Rental domain records: maps entities (evidence: `QuanLyChoThueXe_UNETI02_TI17A2HN/Data/AppDbContext.cs`)
- Service startup → Rental database: configures context (evidence: `QuanLyChoThueXe_UNETI02_TI17A2HN/Program.cs`)
- Service startup → Availability search: registers service (evidence: `QuanLyChoThueXe_UNETI02_TI17A2HN/Program.cs`)
- Service startup → Schedule conflicts: registers service (evidence: `QuanLyChoThueXe_UNETI02_TI17A2HN/Program.cs`)
- Rental domain records → Domain statuses: booking uses status constants (evidence: `QuanLyChoThueXe_UNETI02_TI17A2HN/Models/Entities/DatXe.cs`)
