← All articles

AI app guides

Build an inventory request app that understands reserved stock

Distinguish items on the shelf, items promised to someone and items actually issued.

Zocri · 2 min read · Sources checked

Define three quantities

PostgreSQL documents row locks that prevent conflicting updates to selected records until the current transaction ends. That is one implementation tool for protecting shared stock. Your brief should first explain the business meaning of on-hand, reserved and available quantities. If ten units are on the shelf and three are promised, decide whether the customer should see seven available units.

Write when a reservation begins and ends. A submitted inquiry may not deserve stock until an owner approves it. Alternatively, an accepted request may reserve stock immediately. Choose the rule before designing counters, because every displayed quantity depends on that decision.

Make reservation ownership visible

Each reservation should belong to a specific request, person and item. Include the quantity and any expiry time the business uses. The owner needs to find why stock is unavailable, not merely see a number that cannot be explained by the list of open requests.

Decide how partial fulfillment works. If a customer asks for five units and only three are available, the app might refuse, offer three or create a backorder. These are separate policies. Do not have the interface promise five while staff later discover that two were never reserved.

Treat issuing and cancellation as changes

When stock is issued, update the reservation and the on-hand balance according to one defined transition. A cancelled request should release its remaining reservation. Record corrections with a reason so staff can distinguish a real return from an adjustment made to fix a mistaken quantity.

Ask for a safe outcome when two people request the final unit at once. The business requirement is that confirmed allocations cannot exceed available stock. The implementation may use locks, constraints or another appropriate mechanism, but the visible result must explain which request succeeded and what the other can do.

Reconcile the app with the shelf

Test a complete sequence using sample stock: receive units, reserve some, issue part, cancel the remainder and record a return. Compare the final counters with a manually calculated expectation. Include a repeated click and two simultaneous requests before accepting the reservation behavior.

Give staff a regular reconciliation view showing stock movements and unresolved reservations. Keep physical counts as explicit observations that can differ from the app. An inventory tool becomes useful when people can investigate a discrepancy and make an accountable correction, rather than treating every displayed balance as unquestionable truth.

Put it into practice.

Open Zocri →