End rental
Closed this issue · 1 comments
Gimly-Caspar commented
if user wishes to end rental, user application checks that rental status of bike is started, sends request to VLS to close the lock and looks for status update that lock is closed.
- Userapp_read_Rental-status (BikeID;Started)
- UserApp_Send_request-close-lock (BikeID;UserID)
- UserApp_Read_lockstatus(BikeID;Closed)
Rental costs are calculated – (rental end - rental start) * rental costs
– substracted from deposit, and remaining deposit is returned from BikeID to UserID:
Rental payment: reimburse deposit - rental costs; (rental end - rental start) * rental costs
- UserApp_Read_rental costs (BikeID)
- UserApp_Read_timestamp-rental-start (BikeID)
- UserApp_Read_timestamp-lockstatus (BikeID;Closed)
- UserApp_Send_DepositAmount (BikeID) - RentalCosts(BikeID) * RentalTime (time-lock-closed - time-rental-start)
Rental status of BikeID is updated
- UserApp_Send_Update rental status (BikeID;UserID;Ended)
bartwr commented
Returning a bike & end rental is implemented. For an overview of the working functionality, see #18 (comment)