forked from erp-dev/erp
fix: docs
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user