# musfiqurr661/sqa-test-parking-system-testpart_v2 architecture

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

- Interactive diagram: https://gitdiagram.com/musfiqurr661/sqa-test-parking-system-testpart_v2
- Repository: https://github.com/musfiqurr661/sqa-test-parking-system-testpart_v2

## Overview

1. **Repository purpose**
   - This is not a production parking app; it is a Java codebase for a **unit-testing assignment** around a parking-slot booking domain with intentional defects.
   - The main “product” is the set of domain classes in `src/`, and the main deliverable is the JUnit 5 test suite in `test/`.

2. **Core domain model**
   - The architecture is centered on five business objects: `Vehicle`, `Wallet`, `ParkingSlot`, `Booking`, and `ParkingSystem`.
   - Two enums, `VehicleType` and `ParkingSlotType`, define the controlled categories used by the model.
   - A third enum, `BookingStatus`, likely captures booking lifecycle states.

3. **Object boundaries**
   - `Vehicle` represents the customer’s vehicle identity/classification.
   - `Wallet` represents stored balance and payment-related behavior.
   - `ParkingSlot` represents a physical parking resource with type and occupancy state.
   - `Booking` links a vehicle to a slot and tracks reservation status.
   - `ParkingSystem` is the orchestration layer that coordinates slots, bookings, and billing-like behavior.

4. **Expected data flow**
   - A typical flow is: create a `Vehicle` → check/allocate an appropriate `ParkingSlot` via `ParkingSystem` → create a `Booking` → update slot and booking status → potentially charge or deduct from `Wallet`.
   - The model is likely stateful: slot availability, booking status, and wallet balance are all mutable and interact through method calls.

5. **Service/orchestration boundary**
   - `ParkingSystem` is the main boundary between business rules and the rest of the application.
   - It likely owns the booking workflow: slot selection, validation of vehicle/slot compatibility, reservation, and release/cancellation logic.
   - If there are defects, they are likely to surface here because it aggregates the other entities.

6. **Supporting value types**
   - The enum classes define architectural constraints and reduce invalid states:
     - `VehicleType` constrains what kind of vehicles exist.
     - `ParkingSlotType` constrains slot categories.
     - `BookingStatus` constrains booking lifecycle transitions.
   - These types are important for diagrams because they represent shared rules used across multiple classes.

7. **Test architecture**
   - The `test/` directory mirrors the source model with one test file per class: `VehicleTest`, `WalletTest`, `ParkingSlotTest`, `BookingTest`, and `ParkingSystemTest`.
   - This indicates a class-by-class testing strategy rather than a single end-to-end suite.
   - The assignment explicitly asks for tests that both validate intended behavior and expose defects.

8. **Documentation/reporting layer**
   - `documentation.md` is referenced by the README as the source of assignment-specific details.
   - `samplereport.md` and the generated `*_unit_test_report.md` files are reporting artifacts, not runtime components.
   - These files matter as part of the deliverable process, but they do not participate in application execution.

9. **Static/global-state concern**
   - The README warns about order independence and static global state, which implies some classes may share mutable state across tests or instances.
   - For an architecture diagram, this means the system may not be purely stateless; there may be class-level state inside `ParkingSystem` or related classes that affects test isolation.

10. **Technology/runtime boundary**
   - The repository is a plain Java project with JUnit 5 tests.
   - There is no evidence of web, database, messaging, or external-service integration in the repository structure.
   - The architecture is therefore a local in-memory domain model plus tests.

11. **Likely responsibility separation**
   - `Vehicle`, `Wallet`, `ParkingSlot`, and `Booking` are domain entities/value objects.
   - `ParkingSystem` is the application/domain service that applies business rules.
   - The enums are shared constants that provide type safety and rule enforcement.

12. **What to show in an architecture diagram**
   - Show `ParkingSystem` at the center, connected to `Vehicle`, `ParkingSlot`, `Booking`, and `Wallet`.
   - Show `VehicleType`, `ParkingSlotType`, and `BookingStatus` as shared classifiers used by the entities.
   - Show `test/` as a separate boundary that depends on all source classes but does not feed back into them.
   - Show the documentation/report files as non-executable artifacts alongside the codebase.

13. **Main repository boundary**
   - The entire repository is self-contained: source code, tests, and assignment documentation all live in the same project.
   - The only meaningful dependency boundary is from tests to production classes; there are no external system integrations visible in the tree.

Main entry points: [`src/ParkingSystem.java`](https://github.com/musfiqurr661/sqa-test-parking-system-testpart_v2/blob/main/src/ParkingSystem.java) (ParkingSystem), [`src/Booking.java`](https://github.com/musfiqurr661/sqa-test-parking-system-testpart_v2/blob/main/src/Booking.java) (Booking), [`test/ParkingSystemTest.java`](https://github.com/musfiqurr661/sqa-test-parking-system-testpart_v2/blob/main/test/ParkingSystemTest.java) (ParkingSystemTest), [`src/ParkingSlot.java`](https://github.com/musfiqurr661/sqa-test-parking-system-testpart_v2/blob/main/src/ParkingSlot.java) (ParkingSlot)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_source["Source model"]
  node_parking_system["ParkingSystem<br/>orchestrator<br/>[ParkingSystem.java]"]
  node_booking["Booking<br/>domain entity<br/>[Booking.java]"]
  node_parking_slot["ParkingSlot<br/>domain entity<br/>[ParkingSlot.java]"]
  node_vehicle["Vehicle<br/>domain entity<br/>[Vehicle.java]"]
  node_wallet[("Wallet<br/>domain entity<br/>[Wallet.java]")]
  node_vehicle_type{{"VehicleType<br/>enum<br/>[VehicleType.java]"}}
  node_slot_type{{"SlotType<br/>enum"}}
  node_booking_status{{"BookingStatus<br/>enum<br/>[BookingStatus.java]"}}
end

subgraph group_tests["Test suite"]
  node_vehicle_test["VehicleTest<br/>JUnit 5 test<br/>[VehicleTest.java]"]
  node_wallet_test["WalletTest<br/>JUnit 5 test<br/>[WalletTest.java]"]
  node_slot_test["ParkingSlotTest<br/>JUnit 5 test"]
  node_booking_test["BookingTest<br/>JUnit 5 test<br/>[BookingTest.java]"]
  node_system_test["ParkingSystemTest<br/>JUnit 5 test"]
end

subgraph group_docs["Docs & reports"]
  node_readme["README<br/>project guide<br/>[README.md]"]
  node_documentation["documentation<br/>assignment notes<br/>[documentation.md]"]
  node_sample_report["sample report<br/>report artifact<br/>[samplereport.md]"]
end

node_parking_system -->|"uses"| node_vehicle
node_parking_system -->|"allocates"| node_parking_slot
node_parking_system -->|"creates"| node_booking
node_parking_system -->|"charges"| node_wallet
node_booking -->|"links"| node_vehicle
node_booking -->|"reserves"| node_parking_slot
node_vehicle -->|"classifies"| node_vehicle_type
node_parking_slot -->|"classifies"| node_slot_type
node_booking -->|"tracks"| node_booking_status
node_parking_system -->|"validates"| node_vehicle_type
node_parking_system -->|"validates"| node_slot_type
node_parking_system -->|"transitions"| node_booking_status
node_vehicle_test -->|"tests"| node_vehicle
node_wallet_test -->|"tests"| node_wallet
node_slot_test -->|"tests"| node_parking_slot
node_booking_test -->|"tests"| node_booking
node_system_test -->|"tests"| node_parking_system
node_system_test -->|"covers"| node_vehicle
node_system_test -->|"covers"| node_parking_slot
node_system_test -->|"covers"| node_booking
node_system_test -->|"covers"| node_wallet
node_readme -->|"references"| node_documentation
node_documentation -.->|"guides"| node_sample_report

click node_parking_system "https://github.com/musfiqurr661/sqa-test-parking-system-testpart_v2/blob/main/src/ParkingSystem.java"
click node_booking "https://github.com/musfiqurr661/sqa-test-parking-system-testpart_v2/blob/main/src/Booking.java"
click node_parking_slot "https://github.com/musfiqurr661/sqa-test-parking-system-testpart_v2/blob/main/src/ParkingSlot.java"
click node_vehicle "https://github.com/musfiqurr661/sqa-test-parking-system-testpart_v2/blob/main/src/Vehicle.java"
click node_wallet "https://github.com/musfiqurr661/sqa-test-parking-system-testpart_v2/blob/main/src/Wallet.java"
click node_vehicle_type "https://github.com/musfiqurr661/sqa-test-parking-system-testpart_v2/blob/main/src/VehicleType.java"
click node_slot_type "https://github.com/musfiqurr661/sqa-test-parking-system-testpart_v2/blob/main/src/ParkingSlotType.java"
click node_booking_status "https://github.com/musfiqurr661/sqa-test-parking-system-testpart_v2/blob/main/src/BookingStatus.java"
click node_vehicle_test "https://github.com/musfiqurr661/sqa-test-parking-system-testpart_v2/blob/main/test/VehicleTest.java"
click node_wallet_test "https://github.com/musfiqurr661/sqa-test-parking-system-testpart_v2/blob/main/test/WalletTest.java"
click node_slot_test "https://github.com/musfiqurr661/sqa-test-parking-system-testpart_v2/blob/main/test/ParkingSlotTest.java"
click node_booking_test "https://github.com/musfiqurr661/sqa-test-parking-system-testpart_v2/blob/main/test/BookingTest.java"
click node_system_test "https://github.com/musfiqurr661/sqa-test-parking-system-testpart_v2/blob/main/test/ParkingSystemTest.java"
click node_readme "https://github.com/musfiqurr661/sqa-test-parking-system-testpart_v2/blob/main/README.md"
click node_documentation "https://github.com/musfiqurr661/sqa-test-parking-system-testpart_v2/blob/main/documentation.md"
click node_sample_report "https://github.com/musfiqurr661/sqa-test-parking-system-testpart_v2/blob/main/samplereport.md"

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_parking_system,node_booking,node_parking_slot,node_vehicle,node_wallet,node_vehicle_type,node_slot_type,node_booking_status toneBlue
class node_vehicle_test,node_wallet_test,node_slot_test,node_booking_test,node_system_test toneAmber
class node_readme,node_documentation,node_sample_report toneMint
```

## Components

### Source model

Core in-memory parking domain and orchestration layer.

- [ParkingSystem](https://github.com/musfiqurr661/sqa-test-parking-system-testpart_v2/blob/main/src/ParkingSystem.java): orchestrator · Coordinates slot allocation, booking flow, and domain rules. · `src/ParkingSystem.java`
- [Booking](https://github.com/musfiqurr661/sqa-test-parking-system-testpart_v2/blob/main/src/Booking.java): domain entity · Links a vehicle to a parking slot and tracks reservation state. · `src/Booking.java`
- [ParkingSlot](https://github.com/musfiqurr661/sqa-test-parking-system-testpart_v2/blob/main/src/ParkingSlot.java): domain entity · Represents an individual slot and its occupancy state. · `src/ParkingSlot.java`
- [Vehicle](https://github.com/musfiqurr661/sqa-test-parking-system-testpart_v2/blob/main/src/Vehicle.java): domain entity · Represents the booked vehicle and its classification. · `src/Vehicle.java`
- [Wallet](https://github.com/musfiqurr661/sqa-test-parking-system-testpart_v2/blob/main/src/Wallet.java): domain entity · Stores balance and supports payment-like behavior. · `src/Wallet.java`
- [VehicleType](https://github.com/musfiqurr661/sqa-test-parking-system-testpart_v2/blob/main/src/VehicleType.java): enum · Controlled set of vehicle categories used by the model. · `src/VehicleType.java`
- [SlotType](https://github.com/musfiqurr661/sqa-test-parking-system-testpart_v2/blob/main/src/ParkingSlotType.java): enum · Controlled set of parking slot categories. · `src/ParkingSlotType.java`
- [BookingStatus](https://github.com/musfiqurr661/sqa-test-parking-system-testpart_v2/blob/main/src/BookingStatus.java): enum · Controlled set of booking lifecycle states. · `src/BookingStatus.java`

### Test suite

JUnit 5 class-by-class tests for the domain model.

- [VehicleTest](https://github.com/musfiqurr661/sqa-test-parking-system-testpart_v2/blob/main/test/VehicleTest.java): JUnit 5 test · Unit tests for vehicle behavior and classification. · `test/VehicleTest.java`
- [WalletTest](https://github.com/musfiqurr661/sqa-test-parking-system-testpart_v2/blob/main/test/WalletTest.java): JUnit 5 test · Unit tests for wallet balance and payment behavior. · `test/WalletTest.java`
- [ParkingSlotTest](https://github.com/musfiqurr661/sqa-test-parking-system-testpart_v2/blob/main/test/ParkingSlotTest.java): JUnit 5 test · Unit tests for slot state and compatibility rules. · `test/ParkingSlotTest.java`
- [BookingTest](https://github.com/musfiqurr661/sqa-test-parking-system-testpart_v2/blob/main/test/BookingTest.java): JUnit 5 test · Unit tests for booking state transitions and linkage. · `test/BookingTest.java`
- [ParkingSystemTest](https://github.com/musfiqurr661/sqa-test-parking-system-testpart_v2/blob/main/test/ParkingSystemTest.java): JUnit 5 test · Integration-style unit tests for orchestration and workflow. · `test/ParkingSystemTest.java`

### Docs & reports

Assignment guidance and generated reporting artifacts.

- [README](https://github.com/musfiqurr661/sqa-test-parking-system-testpart_v2/blob/main/README.md): project guide · Top-level assignment and project guidance. · `README.md`
- [documentation](https://github.com/musfiqurr661/sqa-test-parking-system-testpart_v2/blob/main/documentation.md): assignment notes · Assignment-specific notes referenced by the README. · `documentation.md`
- [sample report](https://github.com/musfiqurr661/sqa-test-parking-system-testpart_v2/blob/main/samplereport.md): report artifact · Example reporting output for the assignment. · `samplereport.md`

## Connections

- ParkingSystem → Vehicle: uses · Accepts vehicle data to drive booking decisions.
- ParkingSystem → ParkingSlot: allocates · Selects and updates parking slots during booking.
- ParkingSystem → Booking: creates · Orchestrates booking creation and lifecycle changes.
- ParkingSystem → Wallet: charges · Coordinates payment or balance deduction behavior.
- Booking → Vehicle: links · Associates a booking with a specific vehicle.
- Booking → ParkingSlot: reserves · Connects the booking to a slot reservation.
- Vehicle → VehicleType: classifies · Uses vehicle type to constrain behavior.
- ParkingSlot → SlotType: classifies · Uses slot type to constrain compatibility.
- Booking → BookingStatus: tracks · Stores the lifecycle state of a booking.
- ParkingSystem → VehicleType: validates · Checks vehicle type rules during allocation.
- ParkingSystem → SlotType: validates · Checks slot type rules during allocation.
- ParkingSystem → BookingStatus: transitions · Applies booking state changes across the workflow.
- VehicleTest → Vehicle: tests · Verifies vehicle behavior.
- WalletTest → Wallet: tests · Verifies wallet behavior.
- ParkingSlotTest → ParkingSlot: tests · Verifies slot behavior.
- BookingTest → Booking: tests · Verifies booking behavior.
- ParkingSystemTest → ParkingSystem: tests · Verifies end-to-end system workflow.
- ParkingSystemTest → Vehicle: covers · Uses vehicle inputs in system scenarios.
- ParkingSystemTest → ParkingSlot: covers · Exercises slot allocation scenarios.
- ParkingSystemTest → Booking: covers · Exercises booking lifecycle scenarios.
- ParkingSystemTest → Wallet: covers · Exercises payment-related scenarios.
- README → documentation: references · README points to documentation for assignment details.
- documentation → sample report: guides · Documentation relates to reporting/output artifacts.
