Description
Implement CurrencyCode as a ValueObject in the finance module.
Spec: ISO 4217 alpha-3 (EUR, USD, CZK…)
Implementation checklist
Implementation detail
Input / Output
|
Type |
Alias |
| Input |
String |
CurrencyCodeInput |
| Output |
String |
CurrencyCodeOutput |
Normalization
Trim, convert to uppercase.
Validation
- Exactly 3 ASCII letters.
- Must be a known ISO 4217 alphabetic code (embed a static lookup table of all ~170 active currency codes, similar to the
calling_code map in PhoneNumber).
Extra methods
None beyond the trait.
References
Description
Implement
CurrencyCodeas aValueObjectin thefinancemodule.Spec: ISO 4217 alpha-3 (EUR, USD, CZK…)
Implementation checklist
src/finance/currencycode.rsValueObjecttrait#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]src/finance/mod.rsandprelude# ExampleblockROADMAP.mdfrom ⬜ to ✅Implementation detail
Input / Output
StringCurrencyCodeInputStringCurrencyCodeOutputNormalization
Trim, convert to uppercase.
Validation
calling_codemap inPhoneNumber).Extra methods
None beyond the trait.
References