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

@@ -73,3 +73,16 @@ The API first scopes order lookup by `request.user.employee.merchant`. The servi
## Audit Notes
`red_flush_id` is written to the source order, related `BalanceChangeRecord` rows, and related `StockChangeRecord` rows when inventory is involved. Existing `offset_to`/`offset_id` relationships remain the precise reverse-link mechanism for balance and stock records.
## Test Coverage
The dedicated regression suite is:
```bash
python manage.py test business.tests.test_red_flush_services api_v1.tests.BusinessRedFlushAPITestCase --settings=flower.settings_test
```
Coverage expectations:
- Service tests cover all six order types, balance reversal, inventory reversal, duplicate blocking, merchant isolation, missing balance/stock records, transaction rollback, and external payment/receipt rejection.
- API tests cover all six endpoints, required `reason`, employee permission rejection, merchant-scoped 404, non-approved orders, duplicate red flush, external payment/receipt rejection, stock-validation error mapping, and sampled balance/stock side effects.