db:
model parking:{
status: reserved | free | taken
reservedFrom?: Date
reservedUntil?: Date
paidAt?: Date
leftAt?:Date
carId:String
}
GET /parkings - shows all parkings details
POST /reserve/parking/{parkingId} body:{ reservedFrom: Date, reservedUntil: Date} - used for reserving a parking lot
POST /pay/parking/{parkingId} body:{ carId:string; cardDetails:JSON } - used for paying a parking lot
POST /park/parking/{parkingId}?is_parking={is_parking}&leaving_at={leaving_at} - used for parking/leaving parking earlier
POST /parking/{parkingId}/status/{status} - used by admins to reset the status of a parking in case of no show
reserving, parking, leaving parking, updating parking status flow:
payment flow:
Deep dive into 2-3 key components. Explain how they work, how they scale, discuss tradeoffs, capacity, and any relevant algorithms or data structures.