User should be able to park at a space of their choice and pay based on the number of hours.
There should be different sized lots to handle differently sized cars.
Payment system should track the number of hours remaining for each lot.
System to display the number of available lots
User can reserve parking slot
Efficient entry and exit
Notify users when their parking session expires
Allow disability or permit parking
Scalability to more traffic and more lots
500 total lots. Maximum 10 cars enter or exit per minute
pay(slot_number, plate_number, hours)
reserve(slot_number)
enter(slot_number, plate_number)
exit(slot_number, plate_number)
Lot
Parking lot
The parking lot will consist of two systems: one parking system which updates the lot database about incoming and outgoing vehicles, and their occupancy statuses. One payment system that writes to the lot table about how long the user can park at the location. It also stores the banking details and contact information of the customer to the payment table
flowchart TD
B["client"];
D["rate limiting system"];
n0[("lot table")];
n2["payment system"];
n3["parking system"];
n5[("payment table")];
n6["scanner"];
messaging["messaging system"];
n8["management"];
n9[("historical messages")];
B --> D;
D --> n2;
D --> n3;
n3 --> n0;
n2 --> n5;
n2 --> n0;
n3 --> n6;
n3 --> messaging;
messaging --> n9;
messaging -->|"notify"| n8;
n2 --> messaging;
messaging --> B;
enter: writes plate number and occupancy status to the lot table. Decrement available lot by 1. If lot is full, return an error message.
exit: remove plate number and resets occupancy status
reserve: sets the parked until param of the lot ID
pay: sets the parked until param of the lot ID. Writes banking information and contact point to the payment table
sequenceDiagram participant User participant PaymentAPI participant ParkingLotSystem User->>PaymentAPI: Reserve Parking Slot PaymentAPI-->>User: Payment Confirmation User->>ParkingLotSystem: Update Lot ID ParkingLotSystem-->>ParkingLotSystem: Set occupied to true ParkingLotSystem-->>ParkingLotSystem: Set booked_until value ParkingLotSystem-->>ParkingLotSystem: Set plate_number ParkingLotSystem-->>ParkingLotSystem: Set parked_until value ParkingLotSystem-->>ParkingLotSystem: Decrease available lots by 1 User->>ParkingLotSystem: Enter Lot ID ParkingLotSystem-->>ParkingLotSystem: Record plate_number ParkingLotSystem-->>ParkingLotSystem: Set occupied to true User->>ParkingLotSystem: Exit Lot ID ParkingLotSystem-->>ParkingLotSystem: Clear plate_number ParkingLotSystem-->>ParkingLotSystem: Set occupied to false ParkingLotSystem-->>ParkingLotSystem: Increase available lots by 1
enter(lot_id):
user will first be subjected to rate limiting system which limits the number of cars entered to under 10 per minute. Upon parking, a scanner will automatically record the plate_id and the size of the vehicle, which will be written to the lot table. The system may recognize that another vehicle have reserved the lot, or that the size of the vehicle does not match the size of the lot, in which case the messaging system will automatically send a notification to the parking manager about (plate_id, lot_id, size, parking_time, violation_type). Those messages will be stored to the historical messages database
Payment failure
User violations, for example parking in a location where others have booked
User exiting the lot but blocks the entry/exit
Bad driver occupies multiple lots
Traffic higher than the proposed rate limit
Notification system failure
Allow alternative payment methods