P
P
pefiaysli2020-02-06 21:34:07
Database design
pefiaysli, 2020-02-06 21:34:07

How to make a purchase of a limited quantity item?

How are tasks such as "purchasing a movie ticket", "purchasing goods", etc. solved? where is the quantity limit?
Interested in how to make it so that while one person confirms his purchase, and there is only one product left, the other buyer is not ahead of him?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Armenian Radio, 2020-02-06
@gbg

Through transactions .
https://habr.com/en/post/317884/

K
Karpion, 2020-02-07
@Karpion

Describe the scenario in more detail - what the person has already followed before confirming the purchase.
As I understand it - when a person picks up a product in the basket, you need to remove this product from the warehouse; then no one can intercept it. There is a problem here - if a person took the goods into the basket, turned off his computer and went on vacation; those. the cart must be timed out.
But perhaps someone sees the goods in the warehouse, wants to take them to their basket - oh, but they have already taken them.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question