eld120 / cs50_commerce

cleaning up cs50w repo
MIT License
0 stars 0 forks source link

Users should be charged for any bids when the auction concludes. #3

Open eld120 opened 2 years ago

eld120 commented 2 years ago

As a user I expect to pay for an auction only if I win the item as one would expect on any ecommerce site or in an auction house.

eld120 commented 2 years ago

This may require the addition of an additional field on the user model - 'user_credit'.

proposed user_credit would be a value to track bids across all listings but only tally up the user's highest bid for any single listing (rebids do not stack with previous bids on the same listing). This would allow the user's cash to remain untouched until the conclusion of a Listing assuming said user wins the listing. user_credit would also be reset/released for any bids that are not marked as "winning".

eld120 commented 2 years ago

updated logic at Listing "end":