Возвраты
Вертикаль возвратов уже добавлена в foundation: partial/full return against source sale, return window validation, late-return privileged path, inventory restocking, cash refund reversal, idempotency и audit evidence.
Guardrails
- return must reference committed source sale
- requested qty cannot exceed sold minus already returned
- late return requires elevated role/permission + comment
- cash refund checks active shift cash context
What is next
- search sale by receipt / phone / date
- refund receipt artifact
- oversight notifications for late returns
- report wiring for return reasons and rates
API example
POST /v1/returns
Headers:
x-telegram-id: 100000003
x-location-id: <location-id>
Body:
{
"sourceSaleId": "<sale-id>",
"locationId": "<location-id>",
"shiftId": "<active-shift-id>",
"refundMethod": "cash",
"idempotencyKey": "return-20260324-0001",
"lines": [
{ "saleLineId": "<sale-line-id>", "quantity": 1 }
],
"note": "Клиент вернул товар в течение стандартного окна"
}