feat: three nuxt frontends, demo seed, rounding + money-exponent + rate-cast fixes, archived specs

This commit is contained in:
Chengdong Zhang
2026-09-17 13:34:38 +08:00
parent dc9fd31c5e
commit 653f13161a
85 changed files with 4327 additions and 106 deletions
+23
View File
@@ -0,0 +1,23 @@
# currency Specification
## Purpose
TBD - created by archiving change catalog-i18n-currency. Update Purpose after archive.
## 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