# ybmprod/coh-pms architecture

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

- Interactive diagram: https://gitdiagram.com/ybmprod/coh-pms
- Repository: https://github.com/ybmprod/coh-pms

## Overview

COH-PMS is a municipal venue-hire and property-management web application. Customers browse venues, check availability and pricing, request bookings, submit payments, and receive receipts; staff manage venues, users, pricing rules, booking decisions, payment verification, and reports. The documented MVC-Service architecture routes requests through a single PHP entry point, with services applying domain logic and models accessing MySQL. The graph preserves the documented capability areas; some links rely on README architecture statements or SOURCE INDEX references because their implementation excerpts were not provided.

Main entry points: [`app/core/Router.php`](https://github.com/ybmprod/coh-pms/blob/main/app/core/Router.php) (Query router), [`app/services/BookingService.php`](https://github.com/ybmprod/coh-pms/blob/main/app/services/BookingService.php) (Booking lifecycle), [`app/controllers/BookingController.php`](https://github.com/ybmprod/coh-pms/blob/main/app/controllers/BookingController.php) (Booking requests), [`app/services/PricingService.php`](https://github.com/ybmprod/coh-pms/blob/main/app/services/PricingService.php) (Price calculation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Web entry"]
  node_front["Front controller<br/>[index.php]"]
  node_router["Query router<br/>[Router.php]"]
  node_base["Controller guards<br/>[Controller.php]"]
end

subgraph group_accounts["Accounts and administration"]
  node_auth["Authentication<br/>[AuthController.php]"]
  node_users["User administration<br/>[UserController.php]"]
  node_user_model["User records<br/>[User.php]"]
end

subgraph group_operations["Venue and bookings"]
  node_venue_admin["Venue management"]
  node_venue_model["Venue records<br/>[Venue.php]"]
  node_pricing_admin["Pricing rules"]
  node_pricing_service["Price calculation<br/>[PricingService.php]"]
  node_pricing_model["Pricing records<br/>[PricingRule.php]"]
  node_booking["Booking requests"]
  node_availability["Availability checks"]
  node_booking_service["Booking lifecycle<br/>[BookingService.php]"]
  node_booking_model["Booking records<br/>[Booking.php]"]
  node_customer_views["Customer portal views"]
end

subgraph group_finance["Payments and reporting"]
  node_payment["Payment verification"]
  node_payment_service["Payment processing<br/>[PaymentService.php]"]
  node_payment_model["Payment records<br/>[Payment.php]"]
  node_reports["Reports and dashboard"]
  node_dashboard["Staff dashboard"]
  node_report_service["Report calculations<br/>[ReportService.php]"]
  node_report_model["Report queries<br/>[Report.php]"]
  node_staff_views["Staff console views"]
end

subgraph group_data["Persistence"]
  node_database[("MySQL database")]
end

node_visitor(("Customer or staff"))

node_visitor -->|"requests"| node_front
node_front -->|"dispatches"| node_router
node_router -->|"routes to"| node_auth
node_router -->|"routes to"| node_booking
node_router -->|"routes to"| node_venue_admin
node_router -->|"routes to"| node_payment
node_router -->|"routes to"| node_reports
node_router -->|"routes to"| node_dashboard
node_auth -->|"authenticates"| node_user_model
node_base -->|"checks account"| node_user_model
node_users -->|"manages"| node_user_model
node_venue_admin -->|"manages"| node_venue_model
node_pricing_admin -->|"manages"| node_pricing_model
node_booking -->|"creates or changes"| node_booking_service
node_booking -->|"checks slots"| node_availability
node_booking -->|"calculates price"| node_pricing_service
node_booking -.->|"renders"| node_customer_views
node_booking_service -->|"updates"| node_booking_model
node_booking_service -->|"checks availability"| node_availability
node_booking_service -->|"calculates charge"| node_pricing_service
node_booking_service -->|"locks venue"| node_venue_model
node_availability -->|"checks conflicts"| node_booking_model
node_availability -->|"reads venue"| node_venue_model
node_pricing_service -->|"reads price"| node_venue_model
node_pricing_service -->|"loads rules"| node_pricing_model
node_pricing_service -->|"uses booking context"| node_booking_model
node_payment -->|"verifies payment"| node_payment_service
node_payment_service -->|"records status"| node_payment_model
node_payment_service -->|"checks booking"| node_booking_model
node_payment_service -->|"confirms booking"| node_booking_service
node_reports -->|"builds reports"| node_report_service
node_dashboard -->|"loads summary"| node_report_service
node_report_service -->|"queries metrics"| node_report_model
node_reports -.->|"renders"| node_staff_views
node_user_model -->|"reads and writes"| node_database
node_venue_model -->|"reads and writes"| node_database
node_booking_model -->|"reads and writes"| node_database
node_payment_model -->|"reads and writes"| node_database
node_pricing_model -->|"queries records"| node_database
node_report_model -->|"queries reports"| node_database

click node_front "https://github.com/ybmprod/coh-pms/blob/main/public/index.php"
click node_router "https://github.com/ybmprod/coh-pms/blob/main/app/core/Router.php"
click node_base "https://github.com/ybmprod/coh-pms/blob/main/app/core/Controller.php"
click node_auth "https://github.com/ybmprod/coh-pms/blob/main/app/controllers/AuthController.php"
click node_users "https://github.com/ybmprod/coh-pms/blob/main/app/controllers/UserController.php"
click node_user_model "https://github.com/ybmprod/coh-pms/blob/main/app/models/User.php"
click node_venue_admin "https://github.com/ybmprod/coh-pms/blob/main/app/controllers/VenueController.php"
click node_venue_model "https://github.com/ybmprod/coh-pms/blob/main/app/models/Venue.php"
click node_pricing_admin "https://github.com/ybmprod/coh-pms/blob/main/app/controllers/PricingruleController.php"
click node_pricing_service "https://github.com/ybmprod/coh-pms/blob/main/app/services/PricingService.php"
click node_pricing_model "https://github.com/ybmprod/coh-pms/blob/main/app/models/PricingRule.php"
click node_booking "https://github.com/ybmprod/coh-pms/blob/main/app/controllers/BookingController.php"
click node_availability "https://github.com/ybmprod/coh-pms/blob/main/app/services/AvailabilityService.php"
click node_booking_service "https://github.com/ybmprod/coh-pms/blob/main/app/services/BookingService.php"
click node_booking_model "https://github.com/ybmprod/coh-pms/blob/main/app/models/Booking.php"
click node_payment "https://github.com/ybmprod/coh-pms/blob/main/app/controllers/PaymentController.php"
click node_payment_service "https://github.com/ybmprod/coh-pms/blob/main/app/services/PaymentService.php"
click node_payment_model "https://github.com/ybmprod/coh-pms/blob/main/app/models/Payment.php"
click node_reports "https://github.com/ybmprod/coh-pms/blob/main/app/controllers/ReportController.php"
click node_dashboard "https://github.com/ybmprod/coh-pms/blob/main/app/controllers/DashboardController.php"
click node_report_service "https://github.com/ybmprod/coh-pms/blob/main/app/services/ReportService.php"
click node_report_model "https://github.com/ybmprod/coh-pms/blob/main/app/models/Report.php"
click node_customer_views "https://github.com/ybmprod/coh-pms/tree/main/views/customer"
click node_staff_views "https://github.com/ybmprod/coh-pms/tree/main/views/staff"

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_front,node_router,node_base toneBlue
class node_auth,node_users,node_user_model toneAmber
class node_venue_admin,node_venue_model,node_pricing_admin,node_pricing_service,node_pricing_model,node_booking,node_availability,node_booking_service,node_booking_model,node_customer_views toneMint
class node_payment,node_payment_service,node_payment_model,node_reports,node_dashboard,node_report_service,node_report_model,node_staff_views toneRose
class node_database,node_visitor toneIndigo
```

## Components

### Web entry

- [Front controller](https://github.com/ybmprod/coh-pms/blob/main/public/index.php): `public/index.php`
- [Query router](https://github.com/ybmprod/coh-pms/blob/main/app/core/Router.php): `app/core/Router.php`
- [Controller guards](https://github.com/ybmprod/coh-pms/blob/main/app/core/Controller.php): `app/core/Controller.php`

### Accounts and administration

- [Authentication](https://github.com/ybmprod/coh-pms/blob/main/app/controllers/AuthController.php): `app/controllers/AuthController.php`
- [User administration](https://github.com/ybmprod/coh-pms/blob/main/app/controllers/UserController.php): `app/controllers/UserController.php`
- [User records](https://github.com/ybmprod/coh-pms/blob/main/app/models/User.php): `app/models/User.php`

### Venue and bookings

- [Venue management](https://github.com/ybmprod/coh-pms/blob/main/app/controllers/VenueController.php): `app/controllers/VenueController.php`
- [Venue records](https://github.com/ybmprod/coh-pms/blob/main/app/models/Venue.php): `app/models/Venue.php`
- [Pricing rules](https://github.com/ybmprod/coh-pms/blob/main/app/controllers/PricingruleController.php): `app/controllers/PricingruleController.php`
- [Price calculation](https://github.com/ybmprod/coh-pms/blob/main/app/services/PricingService.php): `app/services/PricingService.php`
- [Pricing records](https://github.com/ybmprod/coh-pms/blob/main/app/models/PricingRule.php): `app/models/PricingRule.php`
- [Booking requests](https://github.com/ybmprod/coh-pms/blob/main/app/controllers/BookingController.php): `app/controllers/BookingController.php`
- [Availability checks](https://github.com/ybmprod/coh-pms/blob/main/app/services/AvailabilityService.php): `app/services/AvailabilityService.php`
- [Booking lifecycle](https://github.com/ybmprod/coh-pms/blob/main/app/services/BookingService.php): `app/services/BookingService.php`
- [Booking records](https://github.com/ybmprod/coh-pms/blob/main/app/models/Booking.php): `app/models/Booking.php`
- [Customer portal views](https://github.com/ybmprod/coh-pms/tree/main/views/customer): `views/customer`

### Payments and reporting

- [Payment verification](https://github.com/ybmprod/coh-pms/blob/main/app/controllers/PaymentController.php): `app/controllers/PaymentController.php`
- [Payment processing](https://github.com/ybmprod/coh-pms/blob/main/app/services/PaymentService.php): `app/services/PaymentService.php`
- [Payment records](https://github.com/ybmprod/coh-pms/blob/main/app/models/Payment.php): `app/models/Payment.php`
- [Reports and dashboard](https://github.com/ybmprod/coh-pms/blob/main/app/controllers/ReportController.php): `app/controllers/ReportController.php`
- [Staff dashboard](https://github.com/ybmprod/coh-pms/blob/main/app/controllers/DashboardController.php): `app/controllers/DashboardController.php`
- [Report calculations](https://github.com/ybmprod/coh-pms/blob/main/app/services/ReportService.php): `app/services/ReportService.php`
- [Report queries](https://github.com/ybmprod/coh-pms/blob/main/app/models/Report.php): `app/models/Report.php`
- [Staff console views](https://github.com/ybmprod/coh-pms/tree/main/views/staff): `views/staff`

### Persistence

- **MySQL database**

### Other components

- **Customer or staff**

## Connections

- Customer or staff → Front controller: requests (evidence: `README.md`)
- Front controller → Query router: dispatches (evidence: `public/index.php`)
- Query router → Authentication: routes to (evidence: `README.md`)
- Query router → Booking requests: routes to (evidence: `README.md`)
- Query router → Venue management: routes to (evidence: `README.md`)
- Query router → Payment verification: routes to (evidence: `README.md`)
- Query router → Reports and dashboard: routes to (evidence: `README.md`)
- Query router → Staff dashboard: routes to (evidence: `README.md`)
- Authentication → User records: authenticates (evidence: `app/controllers/AuthController.php`)
- Controller guards → User records: checks account (evidence: `app/core/Controller.php`)
- User administration → User records: manages (evidence: `app/controllers/UserController.php`)
- Venue management → Venue records: manages (evidence: `app/controllers/VenueController.php`)
- Pricing rules → Pricing records: manages (evidence: `app/controllers/PricingruleController.php`)
- Booking requests → Booking lifecycle: creates or changes (evidence: `app/controllers/BookingController.php`)
- Booking requests → Availability checks: checks slots (evidence: `app/controllers/BookingController.php`)
- Booking requests → Price calculation: calculates price (evidence: `app/controllers/BookingController.php`)
- Booking requests → Customer portal views: renders (evidence: `README.md`)
- Booking lifecycle → Booking records: updates (evidence: `app/services/BookingService.php`)
- Booking lifecycle → Availability checks: checks availability (evidence: `app/services/BookingService.php`)
- Booking lifecycle → Price calculation: calculates charge (evidence: `app/services/BookingService.php`)
- Booking lifecycle → Venue records: locks venue (evidence: `app/services/BookingService.php`)
- Availability checks → Booking records: checks conflicts (evidence: `app/services/AvailabilityService.php`)
- Availability checks → Venue records: reads venue (evidence: `app/services/AvailabilityService.php`)
- Price calculation → Venue records: reads price (evidence: `app/services/PricingService.php`)
- Price calculation → Pricing records: loads rules (evidence: `app/services/PricingService.php`)
- Price calculation → Booking records: uses booking context (evidence: `app/services/PricingService.php`)
- Payment verification → Payment processing: verifies payment (evidence: `app/controllers/PaymentController.php`)
- Payment processing → Payment records: records status (evidence: `app/services/PaymentService.php`)
- Payment processing → Booking records: checks booking (evidence: `app/services/PaymentService.php`)
- Payment processing → Booking lifecycle: confirms booking (evidence: `app/services/PaymentService.php`)
- Reports and dashboard → Report calculations: builds reports (evidence: `app/controllers/ReportController.php`)
- Staff dashboard → Report calculations: loads summary (evidence: `app/controllers/DashboardController.php`)
- Report calculations → Report queries: queries metrics (evidence: `app/services/ReportService.php`)
- Reports and dashboard → Staff console views: renders (evidence: `README.md`)
- User records → MySQL database: reads and writes (evidence: `app/models/User.php`)
- Venue records → MySQL database: reads and writes (evidence: `app/models/Venue.php`)
- Booking records → MySQL database: reads and writes (evidence: `app/models/Booking.php`)
- Payment records → MySQL database: reads and writes (evidence: `app/models/Payment.php`)
- Pricing records → MySQL database: queries records (evidence: `README.md`)
- Report queries → MySQL database: queries reports (evidence: `README.md`)
