nus-cs2113-AY2223S1 / pe-dev-response

0 stars 0 forks source link

User does not gain if item is borrowed for 0 days #168

Open nus-pe-bot opened 2 years ago

nus-pe-bot commented 2 years ago

image.png

User's item is borrowed for 0 days

seems that the borrowing is coded to be start of the day and

items are only considered returned at the end of the day

and this technically should still result in a gain for user because other users cannot borrow the item on this day then he is essentially losing money when other people can borrow his item for 0 days every day and it actually makes the item unavailable


[original: nus-cs2113-AY2223S1/pe-interim#178] [original labels: type.FeatureFlaw severity.Medium]

bdthanh commented 2 years ago

Team's Response

Thanks for raising your issue!

Because the price for item is the price per day, if the transaction's duration is 0 day --> The total money transacted for this transaction is 0 * PricePerDay = 0$. 0 day is less than 24h. If you want to handle the case, in which lender want to have some profit when lending his/her item for less than 24h, then this case is out of scope for our app for this version v2.1.

We currently only support to calculate the total money transacted by this simple equation: MoneyTransacted = Duration * PricePerDay.

Note: The manager still can modify the money transacted manually in the storage and wait until we support the case above in Upcycle.

Duplicate status (if any):

--