Build a platform to duplicate the concept of Limited Time Deals.
A limited-time deal implies that a seller will put up an item on sale for a limited time period, say, 2 hours, and will keep a maximum limit on the number of items that would be sold as part of that deal. Users cannot buy the deal if the deal time is over Users cannot buy if the maximum allowed deal has already been bought by other users. One user cannot buy more than one item as part of the deal.
The task is to create APIs to enable the following operations
- Create a deal with the price and number of items to be sold as part of the deal
- End a deal
- Update a deal to increase the number of items or end time
- Claim a deal
- Optimise for scale
- Add exception handling
FastAPI , Python3