Money
A monetary amount and the currency in which it is denominated.
| Property | Type | Required | Description |
|---|---|---|---|
| amount | decimalString | Yes | The amount of money |
| currency | string | Yes | The ISO 4217 currency code in which the amount is denominated |
Formats
Section titled “Formats”A JSON example of this model.
{ "amount": "-50.50", "currency": "USD"}The JSON Schema for this model.
$schema: https://json-schema.org/draft/2020-12/schema$id: Money.yamltype: objectproperties: amount: $ref: decimalString.yaml description: The amount of money currency: type: string description: The ISO 4217 currency code in which the amount is denominatedrequired: - amount - currencyunevaluatedProperties: not: {}examples: - amount: "-50.50" currency: USD - amount: "5000" currency: EUR - amount: "10000.50" currency: USDdescription: A monetary amount and the currency in which it's denominatedThe TypeSpec code for this model.
model Money { /** The amount of money */ amount: decimalString;
/** The ISO 4217 currency code in which the amount is denominated */ currency: string;}The Python code for this model.
class Money(CommonGrantsBaseModel): """Represents a monetary amount in a specific currency."""
amount: DecimalString = Field( ..., description="The amount of money", examples=["1000000", "500.00", "-100.50"], ) currency: str = Field( ..., description="The ISO 4217 currency code (e.g., 'USD', 'EUR')", examples=["USD", "EUR", "GBP", "JPY"], )The TypeScript code for this model.
export const MoneySchema = z.object({ /** The amount of money */ amount: DecimalStringSchema,
/** The ISO 4217 currency code */ currency: z.string(),});Changelog
Section titled “Changelog”| Version | Changes | Schema |
|---|---|---|
| 0.1.0 |
| Money.yaml |