# 1. Inventory Reservation Strategy

Date: 2026-08-27

## Status

Accepted

## Context

plateau sells luxury, scarce items (like aged Oud). When a customer begins checkout, the order starts in `Pending Payment`. If stock is not decremented immediately, overselling can occur. However, if stock is decremented immediately and the customer abandons the cart without paying, that scarce inventory is locked indefinitely.

## Decision

We will eagerly decrement `stockQuantity` at the moment of order creation (transition to `Pending Payment`). To prevent indefinite locks, a background task (e.g., cron job) will sweep for stale `Pending Payment` orders (e.g., older than 60 minutes), transition them to `Cancelled`, and restore the `stockQuantity`.

## Consequences

- Prevents overselling of scarce inventory.
- Requires implementing and maintaining a background job for stock releasing.
