forked from manojapr/Rydeu-Coding-Task
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreadme
49 lines (38 loc) · 869 Bytes
/
readme
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
Backend:
Build a greenfield app using NodeJS with pricing api.
Build a pricing module and rest api for fronend to find available pricing for different vehicles for different city.
organization has many pricing based on city and vehicle type.
this pricing is mostly on distane basis but first 10 km has fix price. then every km cost 2 EUR for mini van and 1 EUR for sedan per km.
return both vehicles of that city for that organization pricing
Api request body:
{
city: berlin
organization_id: 002
total_hours: 8
}
API response body:
[
{
vehicle_type: minivan
total_price: 200
},
{
vehicle_type: sedan
total_price: 150
}
]
relations:
organization has many pricings. Pricing row has one vehicle.
Organization:
id:
name:
Vehicle:
id:
type:
description:
Pricing:
id:
organization_id:
vehicle_id:
city:
total_amount_per_hour: