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,21 @@
# Spec delta: currency
## ADDED Requirements
### Requirement: Currency registry
The system SHALL maintain a currencies table: ISO code, localized name, symbol, exponent (minor units), enabled flag, and `rate_to_base` (NUMERIC). Exactly one currency is the base.
#### Scenario: seeded currencies
- **WHEN** migrations finish
- **THEN** USD exists as base with rate 1, and CNY/EUR/JPY exist with positive rates
### Requirement: Amount conversion
`GET /api/currencies/convert` SHALL convert integer minor units between enabled currencies via base rates, rounding half-up to the target exponent.
#### Scenario: USD to JPY
- **WHEN** converting 1000 minor USD (=$10.00) to JPY with rate 150
- **THEN** the result is 1500 minor JPY (¥1500), an integer
#### Scenario: disabled currency rejected
- **WHEN** converting to a disabled or unknown currency
- **THEN** the API returns 400