feat: backend MVP (auth/rbac, catalog, orders, fulfillment, invoices) + specs + scaffolds

This commit is contained in:
Chengdong Zhang
2026-09-17 12:43:22 +08:00
commit dc9fd31c5e
96 changed files with 17550 additions and 0 deletions
@@ -0,0 +1,17 @@
# Tasks: fulfillment-invoices
## 1. Schema
- [ ] Migration: shipments, shipment_items, invoices; status enums; shipment_no/invoice_no sequences
## 2. Shipments
- [ ] POST /api/shop/orders/{id}/shipments (qty validation vs unshipped remainder)
- [ ] POST /api/shop/shipments/{id}/ship; order status propagation (fulfilling/shipped)
- [ ] GET /api/shipments (customer), POST /api/shipments/{id}/confirm-delivered → order completed when done
- [ ] GET /api/shop/shipments
## 3. Invoices
- [ ] POST /api/orders/{id}/invoice (one open invoice per order; amount = order total)
- [ ] GET /api/invoices (customer), GET /api/shop/invoices, POST /api/shop/invoices/{id}/issue
## 4. Tests
- [ ] cargo test: partial shipment qty math, order status propagation, duplicate invoice rejected, issue flow