-
Notifications
You must be signed in to change notification settings - Fork 0
/
Oppgavetekst.txt
30 lines (28 loc) · 2.03 KB
/
Oppgavetekst.txt
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
python manage.py
In this exercise you will have to implement WebAPIs for a car rental company. In this exercise
you may consider that customers rent cars for non-deterministic time. For simplicity you do
not need to consider the date/time of rental. For example, if a car #1 is available, it can be
rented to a customer John. If car #1 is booked for John, it cannot be booked by any other
customer. Again, if John has booked a car, he cannot book any other car. If John returns car
#1, he is allowed to rent other cars.
Following functionalities must be implemented.
- Create, Read, Update and Delete ‘Cars' with basic information e.g., make, model, year, lo-
cation, status (i.e., available, booked, rented, damaged)
- Create, Read, Update and Delete ‘Customer’ with basic information e.g., name, age, ad-
dress.
- Create, Read, Update and Delete ‘Employee’ with basic information e.g., name, address,
branch.
- Implement an endpoint ‘order-car’ where a customer-id, car-id is passed as parameters.
The system must check that the customer with customer-id has not booked other cars. The
system changes the status of the car with car-id from ‘available’ to ‘booked’.
- Implement an endpoint ‘cancel-order-car’ where a customer-id, car-id is passed as para-
meters. The system must check that the customer with customer-id has booked for the car.
If the customer has booked the car, the car becomes available.
- Implement an endpoint ‘rent-car’ where a customer-id, car-id is passed as parameters. The
system must check that the customer with customer-id has a booking for the car. The car’s
status is changed from ‘booked’ to ‘rented’.
- Implement an endpoint ‘return-car’ where a customer-id, car-id is passed as parameters.
Car’s status (e.g., ok or damaged) during the return will also be passed. The system must
check that the customer with customer-id has rented the car. The car’s status is changed
from ‘booked’ to ‘available’ or ‘damaged’.
- Use postman to check the functionality of your implementation.