-
Responsible: assign the workload equally between the two employees in a way that favours profit.
-
Parking rate: Small cars - $25,large vehicles - $35
-
Fuel rate: Every car with 10% or less fuel, will be refueled to maximum capacity - $1.75/litre
-
Commission rate: Employee A - 11%, Employee B - 15%
Two solutions on Parking Service System, one focuses on front end, another one is implemented with Deno, which is a new experiment on this powerful backend framework.
- Parking Service dashboard: React, Typescript
- Parking Service CLI: Deno, Typescript
- Replaced
.reducer()
method with higher-order functionArray.map()
ingetAllCarsBillStatement
.Array.reducer()
is for reduction usage. While it is a very powerful method, it's not always the easiest to read or grasp at a glance. An saying:the simplest code is written sequentially
.
- Replaced
for loop
withArray.map()
incarServiceAssigner
. - Parking Service CLI - Enable the ability to log the argument data (cars, employees) and save as local data in JSON format. Note: Command updated.
- Play around with it
- Click to check the demo
- Optionally change the
cars.json
||employees.json
inpublic
file. Runyarn start
- TODO:
- Responsive design.
- Enable edit feature on
cars
andemployees
. - Dynamic car list instead a fixed array.