feat(18-01): add the cabana money field (task 1)
- type: money on fields.yaml with currency or currencyFrom, scale (2..4, default 4) and max; boot fails naming the field on two sources, none, a bad scale or max, a column that is not a string or a Scanner/Valuer, or a currencyFrom that is not a string column - a save answers 422 money.invalid, money.too_precise or money.too_large on the field and fills the accepted decimal string unchanged; the same check runs on controller, settings and relation child saves - backend::lang money.* phrases in en and pl - admin SPA: money.ts (parseMoneyInput, trimMoneyDisplay, formatMoney over Intl with the string itself), MoneyField.vue with the currency suffix, blur validation and the read-only box, preview through the control, the field scope on PreviewView; regenerated OpenAPI and TS types, rebuilt modules/boardwalk/dist - acme.payments fixture with TestMoneyFieldCompile and the Docker TestMoneyFieldSmoke; forms.md Money section and cabana README
This commit is contained in:
@@ -1310,6 +1310,14 @@
|
||||
"context": {
|
||||
"$ref": "#/components/schemas/cabana.fieldContext"
|
||||
},
|
||||
"currency": {
|
||||
"description": "Currency is the ISO 4217 code a `type: money` field shows as its\nsuffix; exactly one of Currency and CurrencyFrom is set.",
|
||||
"type": "string"
|
||||
},
|
||||
"currencyFrom": {
|
||||
"description": "CurrencyFrom names the sibling column of the model whose value is the\nmoney field's currency code; the admin follows that field's value.",
|
||||
"type": "string"
|
||||
},
|
||||
"default": {
|
||||
"$ref": "#/components/schemas/cabana.jsonScalar"
|
||||
},
|
||||
@@ -1375,6 +1383,10 @@
|
||||
"label": {
|
||||
"type": "string"
|
||||
},
|
||||
"max": {
|
||||
"description": "Max is a money field's column ceiling as a decimal string; a value\nabove it in absolute magnitude is a 422 money.too_large.",
|
||||
"type": "string"
|
||||
},
|
||||
"maxDate": {
|
||||
"type": "string"
|
||||
},
|
||||
@@ -1459,6 +1471,10 @@
|
||||
"required": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"scale": {
|
||||
"description": "Scale is the most fraction digits a money value may carry, 2 to 4\n(default 4). A value with more digits is refused, never rounded.",
|
||||
"type": "integer"
|
||||
},
|
||||
"size": {
|
||||
"type": "string"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user