---
Money commons. Represents currency amounts as minor units paired with
ISO-4217 currency codes.
---
commons commerce.money

type CurrencyCode = String where Matches("[A-Z]{3}")

---
A monetary amount paired with its currency.
---
type Money = {
  minorUnits: Int where NonNegative,
  currency:   CurrencyCode,
}

type MoneyError = enum {
  CurrencyMismatch,
  InsufficientFunds,
}
