Parking Lot is a typical place in a mall or airport or hospital, where people come to park their vehicles. They are issued a ticket for a spot at this place. Once they are done with their work, they pay the bill and exit the parking lot with their vehicle.
We dont want just entities for this. We want to build an entire software system thats takes hard coded input. Persist data in memory.
Q) Is it an open parking lot or a closed parking lot with multiple floors?
There are multiple floors.
Q) Are there different kind of vehicles like Four/Two wheelers?
Yes.
Q) Are we allowing multiple two wheelers to be parked in the same spot?
No, only one vehicle can be parked at one spot. Also, each spot has a dedicated set of vehicles that can be parked there.
Q) Does it have multiple entry and exit gates?
Yes.
Q) Do we want to have dynamic ticket pricing?
Yes, the system should allow to easily change how fees are calculated depending upon type of vehicle, time of stay or both.
Q) We will be assigning the spot via a ticket to the incoming vehicle at the time of entry itself and releasing that spot when it leaves through the exit gate. Does that make sense?
Yeah. There will be an operator that does this.
Q) How are we assigning the parking spot? Do we want to have multiple ways of do this?
Yes, keep it flexible.
Q) Operator will calculate the bill amount at the exit time. Right?
Yes.
Q) Are there multiple mode of payments like Online/Cash/Pass?
Our system supports online and offline payment only. No Pass.
- ID
- Floors (list of ParkingFloor)
- Gates (list of Gate)
- Capacity
- ID
- GateNumber
- Status
- CurrentOperator (person who is assigned to the Gate)
- Type
- ENTRY/EXIT
- OPEN/CLOSED
- ID
- FloorNumber
- ParkingSpots (list of ParkingSpot)
- ID
- Number
- SupportedTypesofVehicle (list of VehicleType)
- Status
- Vehicle
- ParkingFloor
- CAR/BIKE/SUV/OTHERS
- FILLED/EMPTY/BLOCKED
- ID
- VehicleNumber
- Type
- ID
- Name
- EmpID
- ID
- ParkingSpot
- EntryTime
- Vehicle
- Gate
- Operator (person who generated the Ticket)
- ID
- ExitTime
- Ticket
- Operator (person who issued the Bill)
- Amount
- Status
- Gate
- OnlinePaymentLink
- Payments (list of Payment)
- ID
- Mode
- Amount
- Status
- RefID
- Bill = Time
- ONLINE/OFFLINE
- SUCCESSFULL/FAILED
- PAID/UNPAID
-
It is a human Parking Lot system. There is an operator which makes sure that vehicle is parked at right place. Ticket generation and bill generation is also done by the operator currently at the gate.
-
We are supporting partial payments in which a bill can be paid through multiple payments of different modes.
-
ParkingSpot has a many to one (m:1) relationship with ParkingFloor. So, we can store this relationship in ParkingSpot class directly. But in cases when the realtionship is (m:m) and that said relationship has attributes, we use a relationship class.
-
For every class representing entities, create a separate table.
-
Use the primitive attributes of these classes as columns in the correspnding table.
-
For non primitive attributes, find the cardinality of the relationship and represent it in the required table.
-
For every enum, use a separate table.
ID |
Capacity |
---|---|
xx | xx |
ID |
FloorNo |
LotID |
---|---|---|
xx | xx | xx |
ID |
GateNo |
LotID |
CurrentOperatorID |
GateStatusID |
GateTypeID |
---|---|---|---|---|---|
xx | xx | xx | xx | xx | xx |
ID |
SpotNo |
parkingFloorID |
ParkingStatusID |
VehicleID |
---|---|---|---|---|
xx | xx | xx | xx | xx |
ID |
VehicleNo |
VehicleTypeID |
---|---|---|
xx | xx | xx |
ID |
Name |
EmpID |
---|---|---|
xx | xx | xx |
ID |
EntryTime |
GateID |
VehicleID |
OperatorID |
ParkingSpotID |
---|---|---|---|---|---|
xx | xx | xx | xx | xx | xx |
ID |
ExitTime |
Amount |
OnlinePaymentLink |
TicketID |
GateID |
OperatorID |
BillStatusID |
---|---|---|---|---|---|---|---|
xx | xx | xx | xx | xx | xx | xx | xx |
ID |
Amount |
RefID |
Time |
BillID |
PaymentModeID |
PaymentStatusID |
---|---|---|---|---|---|---|
xx | xx | xx | xx | xx | xx | xx |
ID |
Value |
---|---|
xx | xx |
ID |
Value |
---|---|
xx | xx |
ID |
Value |
---|---|
xx | xx |
ID |
Value |
---|---|
xx | xx |
ID |
Value |
---|---|
xx | xx |
ID |
Value |
---|---|
xx | xx |
ID |
Value |
---|---|
xx | xx |
python3 application.py