1
0
forked from erp-dev/erp

fix: docs

This commit is contained in:
2026-06-13 11:44:15 +08:00
parent 0bcaa2db44
commit 9a1c92febf
10 changed files with 195 additions and 57 deletions

View File

@@ -596,35 +596,18 @@ Warehouses can operate in different modes:
}
```
### 8. Stock Change Offset (Red Flush Placeholder)
### 8. Stock Change Offset 与业务红冲
- **URL**: `POST /api/v1/stock-change/<id>/offset/`
- **Description**: 面向未来的库存红冲入口。当前仅提供占位实现,用于锁定最终接口形态;实际红冲逻辑尚未上线,因此调用会返回 `501 Not Implemented`,方便前端或上游业务在流程编排中预留节点。
- **Request**:
```json
{
"reason": "审批错误,需要冲销",
"items": [
{
"product_id": 1,
"quantities": ["50.00"]
}
],
"request_id": "po-123-offset",
"extra_meta": {
"source": "purchase_order",
"operator": "warehouse_admin"
}
}
```
- **Response当前占位行为**:
```json
{
"error": "stock_offset_not_ready",
"message": "库存红冲功能尚未实现",
"record_id": 25
}
```
`POST /api/v1/stock-change/<id>/offset/` 已在上文“库存红冲Stock Change Offset”说明。业务单据红冲会通过 `business` service 调用同一库存对冲能力,并把同一个 `red_flush_id` 写入原库存记录和反向库存记录。
面向前端或业务系统的正式业务红冲入口请优先使用 `business` 单据 API例如
- `POST /api/v1/purchase-orders/<id>/red-flush/`
- `POST /api/v1/sales-orders/<id>/red-flush/`
- `POST /api/v1/purchase-return-orders/<id>/red-flush/`
- `POST /api/v1/sales-return-orders/<id>/red-flush/`
完整业务 API 见 `docs/2026-06-12_business_red_flush_api.md`。
## Examples