Heap.Currency
Declares a string field consisting of three uppercase Latin letters - the currency code.
No additional validation is performed to ensure that this is indeed a currency code, but it is assumed that this field contains values corresponding to the ISO 4217 standard, which is supported in the Money type.
Usage / Signature
import { Heap } from '@app/heap'
Heap.Currency(options)
Arguments
-
<b id="options">options</b>:
{
default, maxLength}
An object with additional optional parameters for the field.- <b id="default">default</b>:
string
The default value for this field. For more information on how default values work, see Guide / Heap / Default Values
- <b id="default">default</b>:
Return Value
A JSON schema for a string field.
Examples
Preferred customer currency with a default value of USD
const Customers = Heap.Table('customers', {
preferredCurrency: Heap.Currency({ default: 'USD' }),
})