@pax2pay/model-banking 0.1.670 → 0.1.672
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Account/Creatable.ts +3 -1
- package/Account/Details.ts +12 -11
- package/Account/Type.ts +1 -1
- package/Account/index.ts +15 -13
- package/Acquirer/index.ts +3 -3
- package/Amount.ts +2 -3
- package/Amounts.ts +4 -3
- package/Balance.ts +18 -12
- package/Balances.ts +4 -3
- package/Card/Creatable.ts +12 -15
- package/Card/Preset.ts +1 -1
- package/Card/Restriction/Merchant.ts +1 -1
- package/Card/Restriction/index.ts +3 -1
- package/Card/Scheme.ts +1 -1
- package/Card/index.ts +28 -26
- package/Merchant/index.ts +2 -2
- package/Operation/Change.ts +8 -6
- package/Operation/Changes.ts +1 -1
- package/Operation/Creatable.ts +10 -8
- package/Operation/Status.ts +1 -1
- package/Operation/index.ts +9 -7
- package/Organization/Changeable.ts +3 -4
- package/Organization/Contact/Address/{General.ts → Default.ts} +10 -9
- package/Organization/Contact/Address/GB.ts +9 -8
- package/Organization/Contact/Address/SE.ts +3 -6
- package/Organization/Contact/Address/index.ts +4 -3
- package/Organization/Contact/Addresses.ts +8 -6
- package/Organization/Contact/Creatable.ts +9 -7
- package/Organization/Contact/Name.ts +1 -1
- package/Organization/Contact/Phone.ts +3 -3
- package/Organization/Contact/index.ts +2 -2
- package/Organization/Creatable.ts +9 -15
- package/Organization/Risk.ts +1 -2
- package/Organization/index.ts +15 -13
- package/Rail/Address/index.ts +11 -10
- package/Rule/index.ts +1 -1
- package/Settlement/Amount.ts +3 -4
- package/Settlement/Creatable.ts +9 -7
- package/Settlement/Entry/Creatable.ts +3 -1
- package/Settlement/Entry/index.ts +1 -1
- package/Settlement/Status.ts +3 -5
- package/Settlement/Total.ts +8 -6
- package/Settlement/Totals.ts +4 -2
- package/Settlement/index.ts +10 -8
- package/Supplier/index.ts +1 -1
- package/Transaction/Creatable.ts +20 -16
- package/Transaction/Exchange.ts +8 -6
- package/Transaction/Incoming.ts +2 -2
- package/Transaction/Note.ts +11 -10
- package/Transaction/PreTransaction/Base.ts +2 -2
- package/Transaction/PreTransaction/Incoming.ts +2 -2
- package/Transaction/Status.ts +3 -1
- package/Transaction/index.ts +33 -31
- package/Treasury/Snapshot/Account.ts +2 -2
- package/Treasury/Snapshot/Check/Base.ts +1 -4
- package/Treasury/Snapshot/Check/Checks.ts +1 -1
- package/Treasury/Snapshot/Check/index.ts +11 -9
- package/Treasury/Snapshot/Emoney.ts +2 -2
- package/Treasury/Snapshot/funding.ts +2 -2
- package/Treasury/Snapshot/index.ts +19 -20
- package/Treasury/Transaction/Creatable.ts +2 -2
- package/Warning/Issue.ts +2 -2
- package/Warning/Settlement/NegativeAmount.ts +2 -2
- package/Warning/Snapshot/DeltaFiat.ts +2 -2
- package/Warning/Snapshot/MissingBuffer.ts +2 -2
- package/Warning/Snapshot/MissingEmoney.ts +2 -2
- package/Warning/Snapshot/MissingFiat.ts +2 -2
- package/Warning/Snapshot/MissingTransaction.ts +2 -2
- package/Warning/Snapshot/Overdraft.ts +2 -2
- package/Warning/Snapshot/Reconciliation.ts +2 -2
- package/Warning/Snapshot/StaleFiat.ts +2 -2
- package/dist/cjs/Account/Creatable.js +3 -1
- package/dist/cjs/Account/Creatable.js.map +1 -1
- package/dist/cjs/Account/Details.d.ts +2 -688
- package/dist/cjs/Account/Details.js +9 -8
- package/dist/cjs/Account/Details.js.map +1 -1
- package/dist/cjs/Account/Type.js +1 -1
- package/dist/cjs/Account/Type.js.map +1 -1
- package/dist/cjs/Account/index.d.ts +5 -701
- package/dist/cjs/Account/index.js +7 -6
- package/dist/cjs/Account/index.js.map +1 -1
- package/dist/cjs/Acquirer/index.d.ts +1 -7
- package/dist/cjs/Acquirer/index.js +1 -1
- package/dist/cjs/Acquirer/index.js.map +1 -1
- package/dist/cjs/Amount.d.ts +1 -181
- package/dist/cjs/Amount.js +1 -1
- package/dist/cjs/Amount.js.map +1 -1
- package/dist/cjs/Amounts.js +3 -1
- package/dist/cjs/Amounts.js.map +1 -1
- package/dist/cjs/Backup/Rule.d.ts +1 -1
- package/dist/cjs/Balance.d.ts +9 -14
- package/dist/cjs/Balance.js +25 -15
- package/dist/cjs/Balance.js.map +1 -1
- package/dist/cjs/Balances.d.ts +1 -192
- package/dist/cjs/Balances.js +3 -1
- package/dist/cjs/Balances.js.map +1 -1
- package/dist/cjs/Card/Changeable.d.ts +1 -181
- package/dist/cjs/Card/Creatable.d.ts +1 -407
- package/dist/cjs/Card/Creatable.js +4 -5
- package/dist/cjs/Card/Creatable.js.map +1 -1
- package/dist/cjs/Card/Expiry.d.ts +1 -1
- package/dist/cjs/Card/Operation/Card.d.ts +1 -181
- package/dist/cjs/Card/Operation/index.d.ts +1 -181
- package/dist/cjs/Card/Preset.js +1 -1
- package/dist/cjs/Card/Preset.js.map +1 -1
- package/dist/cjs/Card/Restriction/Merchant.js +1 -1
- package/dist/cjs/Card/Restriction/Merchant.js.map +1 -1
- package/dist/cjs/Card/Restriction/index.d.ts +1 -193
- package/dist/cjs/Card/Restriction/index.js +3 -1
- package/dist/cjs/Card/Restriction/index.js.map +1 -1
- package/dist/cjs/Card/Scheme.js +1 -1
- package/dist/cjs/Card/Scheme.js.map +1 -1
- package/dist/cjs/Card/index.d.ts +1 -811
- package/dist/cjs/Card/index.js +7 -5
- package/dist/cjs/Card/index.js.map +1 -1
- package/dist/cjs/Merchant/index.js +1 -2
- package/dist/cjs/Merchant/index.js.map +1 -1
- package/dist/cjs/Operation/Change.js +4 -2
- package/dist/cjs/Operation/Change.js.map +1 -1
- package/dist/cjs/Operation/Changes.js +1 -1
- package/dist/cjs/Operation/Changes.js.map +1 -1
- package/dist/cjs/Operation/Creatable.js +5 -3
- package/dist/cjs/Operation/Creatable.js.map +1 -1
- package/dist/cjs/Operation/Status.js +1 -1
- package/dist/cjs/Operation/Status.js.map +1 -1
- package/dist/cjs/Operation/index.js +4 -2
- package/dist/cjs/Operation/index.js.map +1 -1
- package/dist/cjs/Organization/Changeable.d.ts +4 -90
- package/dist/cjs/Organization/Changeable.js +3 -4
- package/dist/cjs/Organization/Changeable.js.map +1 -1
- package/dist/cjs/Organization/Contact/Address/{General.d.ts → Default.d.ts} +1 -8
- package/dist/cjs/Organization/Contact/Address/{General.js → Default.js} +5 -3
- package/dist/cjs/Organization/Contact/Address/Default.js.map +1 -0
- package/dist/cjs/Organization/Contact/Address/GB.d.ts +1 -7
- package/dist/cjs/Organization/Contact/Address/GB.js +4 -2
- package/dist/cjs/Organization/Contact/Address/GB.js.map +1 -1
- package/dist/cjs/Organization/Contact/Address/SE.d.ts +1 -6
- package/dist/cjs/Organization/Contact/Address/SE.js +3 -6
- package/dist/cjs/Organization/Contact/Address/SE.js.map +1 -1
- package/dist/cjs/Organization/Contact/Address/index.d.ts +3 -21
- package/dist/cjs/Organization/Contact/Address/index.js +5 -3
- package/dist/cjs/Organization/Contact/Address/index.js.map +1 -1
- package/dist/cjs/Organization/Contact/Addresses.d.ts +1 -78
- package/dist/cjs/Organization/Contact/Addresses.js +4 -2
- package/dist/cjs/Organization/Contact/Addresses.js.map +1 -1
- package/dist/cjs/Organization/Contact/Creatable.d.ts +4 -90
- package/dist/cjs/Organization/Contact/Creatable.js +5 -3
- package/dist/cjs/Organization/Contact/Creatable.js.map +1 -1
- package/dist/cjs/Organization/Contact/Name.d.ts +1 -4
- package/dist/cjs/Organization/Contact/Name.js.map +1 -1
- package/dist/cjs/Organization/Contact/Phone.d.ts +1 -4
- package/dist/cjs/Organization/Contact/Phone.js +1 -1
- package/dist/cjs/Organization/Contact/Phone.js.map +1 -1
- package/dist/cjs/Organization/Contact/index.d.ts +1 -93
- package/dist/cjs/Organization/Contact/index.js +1 -1
- package/dist/cjs/Organization/Contact/index.js.map +1 -1
- package/dist/cjs/Organization/Creatable.d.ts +2 -112
- package/dist/cjs/Organization/Creatable.js +4 -7
- package/dist/cjs/Organization/Creatable.js.map +1 -1
- package/dist/cjs/Organization/Risk.js +1 -1
- package/dist/cjs/Organization/Risk.js.map +1 -1
- package/dist/cjs/Organization/index.d.ts +1 -121
- package/dist/cjs/Organization/index.js +7 -5
- package/dist/cjs/Organization/index.js.map +1 -1
- package/dist/cjs/Rail/Address/Card.d.ts +2 -8
- package/dist/cjs/Rail/Address/index.d.ts +2 -8
- package/dist/cjs/Rail/Address/index.js +4 -2
- package/dist/cjs/Rail/Address/index.js.map +1 -1
- package/dist/cjs/Rule/index.d.ts +1 -1
- package/dist/cjs/Settlement/Amount.js +3 -4
- package/dist/cjs/Settlement/Amount.js.map +1 -1
- package/dist/cjs/Settlement/Creatable.js +4 -2
- package/dist/cjs/Settlement/Creatable.js.map +1 -1
- package/dist/cjs/Settlement/Entry/Creatable.d.ts +3 -554
- package/dist/cjs/Settlement/Entry/Creatable.js +3 -1
- package/dist/cjs/Settlement/Entry/Creatable.js.map +1 -1
- package/dist/cjs/Settlement/Entry/index.js +1 -1
- package/dist/cjs/Settlement/Entry/index.js.map +1 -1
- package/dist/cjs/Settlement/Status.js +3 -4
- package/dist/cjs/Settlement/Status.js.map +1 -1
- package/dist/cjs/Settlement/Total.js +4 -2
- package/dist/cjs/Settlement/Total.js.map +1 -1
- package/dist/cjs/Settlement/Totals.js +3 -1
- package/dist/cjs/Settlement/Totals.js.map +1 -1
- package/dist/cjs/Settlement/index.js +4 -2
- package/dist/cjs/Settlement/index.js.map +1 -1
- package/dist/cjs/Supplier/index.js +1 -1
- package/dist/cjs/Supplier/index.js.map +1 -1
- package/dist/cjs/Transaction/Amount/index.d.ts +1 -366
- package/dist/cjs/Transaction/Creatable.d.ts +6 -748
- package/dist/cjs/Transaction/Creatable.js +9 -5
- package/dist/cjs/Transaction/Creatable.js.map +1 -1
- package/dist/cjs/Transaction/Exchange.d.ts +1 -366
- package/dist/cjs/Transaction/Exchange.js +4 -2
- package/dist/cjs/Transaction/Exchange.js.map +1 -1
- package/dist/cjs/Transaction/Note.js +7 -6
- package/dist/cjs/Transaction/Note.js.map +1 -1
- package/dist/cjs/Transaction/PreTransaction/Authorization.d.ts +3 -374
- package/dist/cjs/Transaction/PreTransaction/Base.d.ts +3 -374
- package/dist/cjs/Transaction/PreTransaction/Base.js +1 -1
- package/dist/cjs/Transaction/PreTransaction/Base.js.map +1 -1
- package/dist/cjs/Transaction/PreTransaction/Incoming.d.ts +5 -382
- package/dist/cjs/Transaction/PreTransaction/Incoming.js +1 -1
- package/dist/cjs/Transaction/PreTransaction/Incoming.js.map +1 -1
- package/dist/cjs/Transaction/PreTransaction/Outgoing.d.ts +3 -374
- package/dist/cjs/Transaction/PreTransaction/index.d.ts +11 -1130
- package/dist/cjs/Transaction/Status.js +3 -1
- package/dist/cjs/Transaction/Status.js.map +1 -1
- package/dist/cjs/Transaction/index.d.ts +23 -1160
- package/dist/cjs/Transaction/index.js +9 -7
- package/dist/cjs/Transaction/index.js.map +1 -1
- package/dist/cjs/Treasury/Snapshot/Account.js +1 -1
- package/dist/cjs/Treasury/Snapshot/Account.js.map +1 -1
- package/dist/cjs/Treasury/Snapshot/Check/Base.js +1 -4
- package/dist/cjs/Treasury/Snapshot/Check/Base.js.map +1 -1
- package/dist/cjs/Treasury/Snapshot/Check/Checks.js +1 -1
- package/dist/cjs/Treasury/Snapshot/Check/Checks.js.map +1 -1
- package/dist/cjs/Treasury/Snapshot/Check/index.js +4 -2
- package/dist/cjs/Treasury/Snapshot/Check/index.js.map +1 -1
- package/dist/cjs/Treasury/Snapshot/Emoney.js +1 -1
- package/dist/cjs/Treasury/Snapshot/Emoney.js.map +1 -1
- package/dist/cjs/Treasury/Snapshot/funding.js +1 -1
- package/dist/cjs/Treasury/Snapshot/funding.js.map +1 -1
- package/dist/cjs/Treasury/Snapshot/index.js +6 -7
- package/dist/cjs/Treasury/Snapshot/index.js.map +1 -1
- package/dist/cjs/Treasury/Transaction/Creatable.d.ts +2 -8
- package/dist/cjs/Treasury/Transaction/Creatable.js +1 -1
- package/dist/cjs/Treasury/Transaction/Creatable.js.map +1 -1
- package/dist/cjs/Warning/Issue.js +1 -1
- package/dist/cjs/Warning/Issue.js.map +1 -1
- package/dist/cjs/Warning/Settlement/NegativeAmount.js +1 -1
- package/dist/cjs/Warning/Settlement/NegativeAmount.js.map +1 -1
- package/dist/cjs/Warning/Snapshot/DeltaFiat.js +1 -2
- package/dist/cjs/Warning/Snapshot/DeltaFiat.js.map +1 -1
- package/dist/cjs/Warning/Snapshot/MissingBuffer.js +1 -1
- package/dist/cjs/Warning/Snapshot/MissingBuffer.js.map +1 -1
- package/dist/cjs/Warning/Snapshot/MissingEmoney.js +1 -2
- package/dist/cjs/Warning/Snapshot/MissingEmoney.js.map +1 -1
- package/dist/cjs/Warning/Snapshot/MissingFiat.js +1 -2
- package/dist/cjs/Warning/Snapshot/MissingFiat.js.map +1 -1
- package/dist/cjs/Warning/Snapshot/MissingTransaction.js +1 -2
- package/dist/cjs/Warning/Snapshot/MissingTransaction.js.map +1 -1
- package/dist/cjs/Warning/Snapshot/Overdraft.js +1 -1
- package/dist/cjs/Warning/Snapshot/Overdraft.js.map +1 -1
- package/dist/cjs/Warning/Snapshot/Reconciliation.js +1 -2
- package/dist/cjs/Warning/Snapshot/Reconciliation.js.map +1 -1
- package/dist/cjs/Warning/Snapshot/StaleFiat.js +1 -1
- package/dist/cjs/Warning/Snapshot/StaleFiat.js.map +1 -1
- package/dist/cjs/policy/Mcc/Action.js +1 -1
- package/dist/cjs/policy/Mcc/Action.js.map +1 -1
- package/dist/cjs/policy/Mcc/Creatable.js +4 -2
- package/dist/cjs/policy/Mcc/Creatable.js.map +1 -1
- package/dist/cjs/policy/Mcc/Group.js +6 -8
- package/dist/cjs/policy/Mcc/Group.js.map +1 -1
- package/dist/cjs/policy/Mcc/Updatable.js +3 -1
- package/dist/cjs/policy/Mcc/Updatable.js.map +1 -1
- package/dist/cjs/policy/Mcc/index.js +4 -2
- package/dist/cjs/policy/Mcc/index.js.map +1 -1
- package/dist/cjs/zod.d.ts +664 -0
- package/dist/cjs/zod.js +4 -0
- package/dist/cjs/zod.js.map +1 -1
- package/dist/mjs/Account/Creatable.js +3 -1
- package/dist/mjs/Account/Creatable.js.map +1 -1
- package/dist/mjs/Account/Details.d.ts +2 -688
- package/dist/mjs/Account/Details.js +10 -9
- package/dist/mjs/Account/Details.js.map +1 -1
- package/dist/mjs/Account/Type.js +1 -1
- package/dist/mjs/Account/Type.js.map +1 -1
- package/dist/mjs/Account/index.d.ts +5 -701
- package/dist/mjs/Account/index.js +7 -6
- package/dist/mjs/Account/index.js.map +1 -1
- package/dist/mjs/Acquirer/index.d.ts +1 -7
- package/dist/mjs/Acquirer/index.js +2 -2
- package/dist/mjs/Acquirer/index.js.map +1 -1
- package/dist/mjs/Amount.d.ts +1 -181
- package/dist/mjs/Amount.js +2 -2
- package/dist/mjs/Amount.js.map +1 -1
- package/dist/mjs/Amounts.js +4 -2
- package/dist/mjs/Amounts.js.map +1 -1
- package/dist/mjs/Backup/Rule.d.ts +1 -1
- package/dist/mjs/Balance.d.ts +9 -14
- package/dist/mjs/Balance.js +15 -8
- package/dist/mjs/Balance.js.map +1 -1
- package/dist/mjs/Balances.d.ts +1 -192
- package/dist/mjs/Balances.js +4 -2
- package/dist/mjs/Balances.js.map +1 -1
- package/dist/mjs/Card/Changeable.d.ts +1 -181
- package/dist/mjs/Card/Creatable.d.ts +1 -407
- package/dist/mjs/Card/Creatable.js +4 -5
- package/dist/mjs/Card/Creatable.js.map +1 -1
- package/dist/mjs/Card/Expiry.d.ts +1 -1
- package/dist/mjs/Card/Operation/Card.d.ts +1 -181
- package/dist/mjs/Card/Operation/index.d.ts +1 -181
- package/dist/mjs/Card/Preset.js +1 -1
- package/dist/mjs/Card/Preset.js.map +1 -1
- package/dist/mjs/Card/Restriction/Merchant.js +1 -1
- package/dist/mjs/Card/Restriction/Merchant.js.map +1 -1
- package/dist/mjs/Card/Restriction/index.d.ts +1 -193
- package/dist/mjs/Card/Restriction/index.js +3 -1
- package/dist/mjs/Card/Restriction/index.js.map +1 -1
- package/dist/mjs/Card/Scheme.js +1 -1
- package/dist/mjs/Card/Scheme.js.map +1 -1
- package/dist/mjs/Card/index.d.ts +1 -811
- package/dist/mjs/Card/index.js +7 -5
- package/dist/mjs/Card/index.js.map +1 -1
- package/dist/mjs/Merchant/index.js +2 -3
- package/dist/mjs/Merchant/index.js.map +1 -1
- package/dist/mjs/Operation/Change.js +4 -2
- package/dist/mjs/Operation/Change.js.map +1 -1
- package/dist/mjs/Operation/Changes.js +1 -1
- package/dist/mjs/Operation/Changes.js.map +1 -1
- package/dist/mjs/Operation/Creatable.js +6 -4
- package/dist/mjs/Operation/Creatable.js.map +1 -1
- package/dist/mjs/Operation/Status.js +1 -1
- package/dist/mjs/Operation/Status.js.map +1 -1
- package/dist/mjs/Operation/index.js +4 -2
- package/dist/mjs/Operation/index.js.map +1 -1
- package/dist/mjs/Organization/Changeable.d.ts +4 -90
- package/dist/mjs/Organization/Changeable.js +3 -4
- package/dist/mjs/Organization/Changeable.js.map +1 -1
- package/dist/mjs/Organization/Contact/Address/{General.d.ts → Default.d.ts} +1 -8
- package/dist/mjs/Organization/Contact/Address/{General.js → Default.js} +5 -3
- package/dist/mjs/Organization/Contact/Address/Default.js.map +1 -0
- package/dist/mjs/Organization/Contact/Address/GB.d.ts +1 -7
- package/dist/mjs/Organization/Contact/Address/GB.js +4 -2
- package/dist/mjs/Organization/Contact/Address/GB.js.map +1 -1
- package/dist/mjs/Organization/Contact/Address/SE.d.ts +1 -6
- package/dist/mjs/Organization/Contact/Address/SE.js +3 -6
- package/dist/mjs/Organization/Contact/Address/SE.js.map +1 -1
- package/dist/mjs/Organization/Contact/Address/index.d.ts +3 -21
- package/dist/mjs/Organization/Contact/Address/index.js +4 -2
- package/dist/mjs/Organization/Contact/Address/index.js.map +1 -1
- package/dist/mjs/Organization/Contact/Addresses.d.ts +1 -78
- package/dist/mjs/Organization/Contact/Addresses.js +4 -2
- package/dist/mjs/Organization/Contact/Addresses.js.map +1 -1
- package/dist/mjs/Organization/Contact/Creatable.d.ts +4 -90
- package/dist/mjs/Organization/Contact/Creatable.js +5 -3
- package/dist/mjs/Organization/Contact/Creatable.js.map +1 -1
- package/dist/mjs/Organization/Contact/Name.d.ts +1 -4
- package/dist/mjs/Organization/Contact/Name.js.map +1 -1
- package/dist/mjs/Organization/Contact/Phone.d.ts +1 -4
- package/dist/mjs/Organization/Contact/Phone.js +2 -2
- package/dist/mjs/Organization/Contact/Phone.js.map +1 -1
- package/dist/mjs/Organization/Contact/index.d.ts +1 -93
- package/dist/mjs/Organization/Contact/index.js +1 -1
- package/dist/mjs/Organization/Contact/index.js.map +1 -1
- package/dist/mjs/Organization/Creatable.d.ts +2 -112
- package/dist/mjs/Organization/Creatable.js +4 -7
- package/dist/mjs/Organization/Creatable.js.map +1 -1
- package/dist/mjs/Organization/Risk.js +1 -1
- package/dist/mjs/Organization/Risk.js.map +1 -1
- package/dist/mjs/Organization/index.d.ts +1 -121
- package/dist/mjs/Organization/index.js +7 -5
- package/dist/mjs/Organization/index.js.map +1 -1
- package/dist/mjs/Rail/Address/Card.d.ts +2 -8
- package/dist/mjs/Rail/Address/index.d.ts +2 -8
- package/dist/mjs/Rail/Address/index.js +4 -2
- package/dist/mjs/Rail/Address/index.js.map +1 -1
- package/dist/mjs/Rule/index.d.ts +1 -1
- package/dist/mjs/Settlement/Amount.js +3 -4
- package/dist/mjs/Settlement/Amount.js.map +1 -1
- package/dist/mjs/Settlement/Creatable.js +4 -2
- package/dist/mjs/Settlement/Creatable.js.map +1 -1
- package/dist/mjs/Settlement/Entry/Creatable.d.ts +3 -554
- package/dist/mjs/Settlement/Entry/Creatable.js +3 -1
- package/dist/mjs/Settlement/Entry/Creatable.js.map +1 -1
- package/dist/mjs/Settlement/Entry/index.js +1 -1
- package/dist/mjs/Settlement/Entry/index.js.map +1 -1
- package/dist/mjs/Settlement/Status.js +3 -4
- package/dist/mjs/Settlement/Status.js.map +1 -1
- package/dist/mjs/Settlement/Total.js +4 -2
- package/dist/mjs/Settlement/Total.js.map +1 -1
- package/dist/mjs/Settlement/Totals.js +4 -2
- package/dist/mjs/Settlement/Totals.js.map +1 -1
- package/dist/mjs/Settlement/index.js +4 -2
- package/dist/mjs/Settlement/index.js.map +1 -1
- package/dist/mjs/Supplier/index.js +1 -1
- package/dist/mjs/Supplier/index.js.map +1 -1
- package/dist/mjs/Transaction/Amount/index.d.ts +1 -366
- package/dist/mjs/Transaction/Creatable.d.ts +6 -748
- package/dist/mjs/Transaction/Creatable.js +10 -6
- package/dist/mjs/Transaction/Creatable.js.map +1 -1
- package/dist/mjs/Transaction/Exchange.d.ts +1 -366
- package/dist/mjs/Transaction/Exchange.js +4 -2
- package/dist/mjs/Transaction/Exchange.js.map +1 -1
- package/dist/mjs/Transaction/Note.js +7 -6
- package/dist/mjs/Transaction/Note.js.map +1 -1
- package/dist/mjs/Transaction/PreTransaction/Authorization.d.ts +3 -374
- package/dist/mjs/Transaction/PreTransaction/Base.d.ts +3 -374
- package/dist/mjs/Transaction/PreTransaction/Base.js +2 -2
- package/dist/mjs/Transaction/PreTransaction/Base.js.map +1 -1
- package/dist/mjs/Transaction/PreTransaction/Incoming.d.ts +5 -382
- package/dist/mjs/Transaction/PreTransaction/Incoming.js +2 -2
- package/dist/mjs/Transaction/PreTransaction/Incoming.js.map +1 -1
- package/dist/mjs/Transaction/PreTransaction/Outgoing.d.ts +3 -374
- package/dist/mjs/Transaction/PreTransaction/index.d.ts +11 -1130
- package/dist/mjs/Transaction/Status.js +3 -1
- package/dist/mjs/Transaction/Status.js.map +1 -1
- package/dist/mjs/Transaction/index.d.ts +23 -1160
- package/dist/mjs/Transaction/index.js +10 -8
- package/dist/mjs/Transaction/index.js.map +1 -1
- package/dist/mjs/Treasury/Snapshot/Account.js +2 -2
- package/dist/mjs/Treasury/Snapshot/Account.js.map +1 -1
- package/dist/mjs/Treasury/Snapshot/Check/Base.js +1 -4
- package/dist/mjs/Treasury/Snapshot/Check/Base.js.map +1 -1
- package/dist/mjs/Treasury/Snapshot/Check/Checks.js +1 -1
- package/dist/mjs/Treasury/Snapshot/Check/Checks.js.map +1 -1
- package/dist/mjs/Treasury/Snapshot/Check/index.js +4 -2
- package/dist/mjs/Treasury/Snapshot/Check/index.js.map +1 -1
- package/dist/mjs/Treasury/Snapshot/Emoney.js +2 -2
- package/dist/mjs/Treasury/Snapshot/Emoney.js.map +1 -1
- package/dist/mjs/Treasury/Snapshot/funding.js +2 -2
- package/dist/mjs/Treasury/Snapshot/funding.js.map +1 -1
- package/dist/mjs/Treasury/Snapshot/index.js +7 -8
- package/dist/mjs/Treasury/Snapshot/index.js.map +1 -1
- package/dist/mjs/Treasury/Transaction/Creatable.d.ts +2 -8
- package/dist/mjs/Treasury/Transaction/Creatable.js +2 -2
- package/dist/mjs/Treasury/Transaction/Creatable.js.map +1 -1
- package/dist/mjs/Warning/Issue.js +2 -2
- package/dist/mjs/Warning/Issue.js.map +1 -1
- package/dist/mjs/Warning/Settlement/NegativeAmount.js +2 -2
- package/dist/mjs/Warning/Settlement/NegativeAmount.js.map +1 -1
- package/dist/mjs/Warning/Snapshot/DeltaFiat.js +2 -3
- package/dist/mjs/Warning/Snapshot/DeltaFiat.js.map +1 -1
- package/dist/mjs/Warning/Snapshot/MissingBuffer.js +2 -2
- package/dist/mjs/Warning/Snapshot/MissingBuffer.js.map +1 -1
- package/dist/mjs/Warning/Snapshot/MissingEmoney.js +2 -3
- package/dist/mjs/Warning/Snapshot/MissingEmoney.js.map +1 -1
- package/dist/mjs/Warning/Snapshot/MissingFiat.js +2 -3
- package/dist/mjs/Warning/Snapshot/MissingFiat.js.map +1 -1
- package/dist/mjs/Warning/Snapshot/MissingTransaction.js +2 -3
- package/dist/mjs/Warning/Snapshot/MissingTransaction.js.map +1 -1
- package/dist/mjs/Warning/Snapshot/Overdraft.js +2 -2
- package/dist/mjs/Warning/Snapshot/Overdraft.js.map +1 -1
- package/dist/mjs/Warning/Snapshot/Reconciliation.js +2 -3
- package/dist/mjs/Warning/Snapshot/Reconciliation.js.map +1 -1
- package/dist/mjs/Warning/Snapshot/StaleFiat.js +2 -2
- package/dist/mjs/Warning/Snapshot/StaleFiat.js.map +1 -1
- package/dist/mjs/policy/Mcc/Action.js +1 -1
- package/dist/mjs/policy/Mcc/Action.js.map +1 -1
- package/dist/mjs/policy/Mcc/Creatable.js +4 -2
- package/dist/mjs/policy/Mcc/Creatable.js.map +1 -1
- package/dist/mjs/policy/Mcc/Group.js +6 -8
- package/dist/mjs/policy/Mcc/Group.js.map +1 -1
- package/dist/mjs/policy/Mcc/Updatable.js +3 -1
- package/dist/mjs/policy/Mcc/Updatable.js.map +1 -1
- package/dist/mjs/policy/Mcc/index.js +4 -2
- package/dist/mjs/policy/Mcc/index.js.map +1 -1
- package/dist/mjs/zod.d.ts +664 -0
- package/dist/mjs/zod.js +4 -0
- package/dist/mjs/zod.js.map +1 -1
- package/package.json +1 -1
- package/policy/Mcc/Action.ts +1 -1
- package/policy/Mcc/Creatable.ts +10 -8
- package/policy/Mcc/Group.ts +6 -8
- package/policy/Mcc/Updatable.ts +3 -1
- package/policy/Mcc/index.ts +8 -6
- package/zod.ts +4 -0
- package/dist/cjs/Organization/Contact/Address/General.js.map +0 -1
- package/dist/mjs/Organization/Contact/Address/General.js.map +0 -1
|
@@ -19,11 +19,13 @@ export namespace Creatable {
|
|
|
19
19
|
phone: Phone.type,
|
|
20
20
|
owners: Name.type.array({ criteria: "minLength", value: 1 }),
|
|
21
21
|
})
|
|
22
|
-
export const typeZod = zod
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
export const typeZod = zod
|
|
23
|
+
.object({
|
|
24
|
+
address: Addresses.typeZod,
|
|
25
|
+
email: zod.string().regex(/^\S+@\S+\.\S+$/),
|
|
26
|
+
name: Name.typeZod,
|
|
27
|
+
phone: Phone.typeZod,
|
|
28
|
+
owners: Name.typeZod.array().min(1),
|
|
29
|
+
})
|
|
30
|
+
.meta({ id: "Organization.Contact.Creatable" })
|
|
29
31
|
}
|
|
@@ -7,5 +7,5 @@ export interface Name {
|
|
|
7
7
|
}
|
|
8
8
|
export namespace Name {
|
|
9
9
|
export const type = isly.object<Name>({ first: isly.string(), last: isly.string() })
|
|
10
|
-
export const typeZod = zod.object({ first: zod.string(), last: zod.string() })
|
|
10
|
+
export const typeZod: zod.ZodType<Name> = zod.object({ first: zod.string(), last: zod.string() })
|
|
11
11
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
2
|
import { isly } from "isly"
|
|
3
|
-
import { zod } from "../../zod"
|
|
3
|
+
import { zod, zodHelper } from "../../zod"
|
|
4
4
|
|
|
5
5
|
export interface Phone {
|
|
6
6
|
number: string
|
|
@@ -11,8 +11,8 @@ export namespace Phone {
|
|
|
11
11
|
number: isly.string(/^\d+$/),
|
|
12
12
|
code: isly.fromIs("CallingCode", isoly.CallingCode.is),
|
|
13
13
|
})
|
|
14
|
-
export const typeZod = zod.object({
|
|
14
|
+
export const typeZod: zod.ZodType<Phone> = zod.object({
|
|
15
15
|
number: zod.string().regex(/^\d+$/),
|
|
16
|
-
code:
|
|
16
|
+
code: zodHelper.callingCode,
|
|
17
17
|
})
|
|
18
18
|
}
|
|
@@ -26,11 +26,11 @@ export namespace Contact {
|
|
|
26
26
|
phone: Phone.type,
|
|
27
27
|
owners: Name.type.array().optional(),
|
|
28
28
|
})
|
|
29
|
-
export const typeZod = zod.object({
|
|
29
|
+
export const typeZod: zod.ZodType<Contact> = zod.object({
|
|
30
30
|
address: Addresses.typeZod,
|
|
31
31
|
email: zod.string().regex(/^\S+@\S+\.\S+$/),
|
|
32
32
|
name: Name.typeZod,
|
|
33
33
|
phone: Phone.typeZod,
|
|
34
|
-
owners:
|
|
34
|
+
owners: Name.typeZod.array().optional(),
|
|
35
35
|
})
|
|
36
36
|
}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { isly } from "isly"
|
|
2
|
-
import type { Rule } from "../Rule"
|
|
3
|
-
import { type as ruleType } from "../Rule/type"
|
|
4
2
|
import { zod } from "../zod"
|
|
5
3
|
import { Contact } from "./Contact"
|
|
6
4
|
import { Fx } from "./Fx"
|
|
@@ -10,9 +8,7 @@ export interface Creatable {
|
|
|
10
8
|
name: string
|
|
11
9
|
code: string
|
|
12
10
|
risk: Risk
|
|
13
|
-
rules?: Rule[]
|
|
14
11
|
contact?: Contact.Creatable
|
|
15
|
-
groups?: string[]
|
|
16
12
|
fx?: Fx
|
|
17
13
|
}
|
|
18
14
|
export namespace Creatable {
|
|
@@ -20,18 +16,16 @@ export namespace Creatable {
|
|
|
20
16
|
name: isly.string(),
|
|
21
17
|
code: isly.string(new RegExp(/^[A-Za-z0-9\-_]+$/)),
|
|
22
18
|
risk: Risk.type,
|
|
23
|
-
rules: ruleType.array().optional(),
|
|
24
19
|
contact: Contact.Creatable.type.optional(),
|
|
25
|
-
groups: isly.string().array().optional(),
|
|
26
20
|
fx: Fx.type.optional(),
|
|
27
21
|
})
|
|
28
|
-
export const typeZod = zod
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
22
|
+
export const typeZod: zod.ZodType<Creatable> = zod
|
|
23
|
+
.object({
|
|
24
|
+
name: zod.string(),
|
|
25
|
+
code: zod.string().regex(/^[A-Za-z0-9\-_]+$/),
|
|
26
|
+
risk: Risk.typeZod,
|
|
27
|
+
contact: Contact.Creatable.typeZod.optional(),
|
|
28
|
+
fx: Fx.typeZod.optional(),
|
|
29
|
+
})
|
|
30
|
+
.meta({ id: "Organization.Creatable" })
|
|
37
31
|
}
|
package/Organization/Risk.ts
CHANGED
|
@@ -2,9 +2,8 @@ import { isly } from "isly"
|
|
|
2
2
|
import { zod } from "../zod"
|
|
3
3
|
|
|
4
4
|
export type Risk = (typeof Risk.values)[number]
|
|
5
|
-
|
|
6
5
|
export namespace Risk {
|
|
7
6
|
export const values = ["low", "medium", "high", "prohibited"] as const
|
|
8
7
|
export const type = isly.string(values)
|
|
9
|
-
export const typeZod = zod.enum(values)
|
|
8
|
+
export const typeZod = zod.enum(values).meta({ id: "Organization.Risk" })
|
|
10
9
|
}
|
package/Organization/index.ts
CHANGED
|
@@ -40,19 +40,21 @@ export namespace Organization {
|
|
|
40
40
|
fx: OrganizationFx.type.optional(),
|
|
41
41
|
type: Type.type,
|
|
42
42
|
})
|
|
43
|
-
export const typeZod = zod
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
43
|
+
export const typeZod: zod.ZodType<Organization> = zod
|
|
44
|
+
.object({
|
|
45
|
+
name: zod.string(),
|
|
46
|
+
code: zod.string().regex(/^[A-Za-z0-9\-_]+$/),
|
|
47
|
+
realm: Realm.typeZod,
|
|
48
|
+
rules: zod.any().array(),
|
|
49
|
+
status: zod.enum(["active", "inactive"]),
|
|
50
|
+
risk: Organization.Risk.typeZod,
|
|
51
|
+
contact: Contact.typeZod.optional(),
|
|
52
|
+
groups: zod.string().array().optional(),
|
|
53
|
+
fx: OrganizationFx.typeZod.optional(),
|
|
54
|
+
type: Type.typeZod,
|
|
55
|
+
})
|
|
56
|
+
.meta({ id: "Organization" })
|
|
55
57
|
export function from(creatable: Creatable, realm: Realm): Organization {
|
|
56
|
-
return { ...creatable, realm, rules:
|
|
58
|
+
return { ...creatable, realm, rules: [], status: "active", type: "emoney" }
|
|
57
59
|
}
|
|
58
60
|
}
|
package/Rail/Address/index.ts
CHANGED
|
@@ -95,16 +95,17 @@ export namespace Address {
|
|
|
95
95
|
AddressScan.type,
|
|
96
96
|
AddressBic.type
|
|
97
97
|
)
|
|
98
|
-
export const typeZod = zod
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
98
|
+
export const typeZod = zod
|
|
99
|
+
.union([
|
|
100
|
+
AddressCard.typeZod,
|
|
101
|
+
AddressCard.Counterpart.typeZod,
|
|
102
|
+
AddressIban.typeZod,
|
|
103
|
+
AddressInternal.typeZod,
|
|
104
|
+
AddressPaxGiro.typeZod,
|
|
105
|
+
AddressScan.typeZod,
|
|
106
|
+
AddressBic.typeZod,
|
|
107
|
+
])
|
|
108
|
+
.meta({ id: "Rail.Address" })
|
|
108
109
|
export import PaxGiro = AddressPaxGiro
|
|
109
110
|
export import Iban = AddressIban
|
|
110
111
|
export import Scan = AddressScan
|
package/Rule/index.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { isly } from "isly"
|
|
|
2
2
|
import { State as RuleState } from "./State"
|
|
3
3
|
import { type as ruleType } from "./type"
|
|
4
4
|
|
|
5
|
-
export type Rule =
|
|
5
|
+
export type Rule = any
|
|
6
6
|
export namespace Rule {
|
|
7
7
|
export import State = RuleState
|
|
8
8
|
export type Kind = (typeof Kind.values)[number]
|
package/Settlement/Amount.ts
CHANGED
|
@@ -13,10 +13,9 @@ export namespace Amount {
|
|
|
13
13
|
net: isly.number(),
|
|
14
14
|
fee: isly.object<Amount["fee"]>({ other: isly.number() }),
|
|
15
15
|
})
|
|
16
|
-
export const typeZod: zod.ZodType<Amount> = zod
|
|
17
|
-
net: zod.number(),
|
|
18
|
-
|
|
19
|
-
})
|
|
16
|
+
export const typeZod: zod.ZodType<Amount> = zod
|
|
17
|
+
.object({ net: zod.number(), fee: zod.object({ other: zod.number() }) })
|
|
18
|
+
.meta({ id: "Settlement.Amount" })
|
|
20
19
|
export function sum(currency: isoly.Currency, amount: Amount | undefined): number {
|
|
21
20
|
return isoly.Currency.add(currency, amount?.net ?? 0, amount?.fee.other ?? 0)
|
|
22
21
|
}
|
package/Settlement/Creatable.ts
CHANGED
|
@@ -20,11 +20,13 @@ export namespace Creatable {
|
|
|
20
20
|
batch: Batch.type,
|
|
21
21
|
count: isly.number().optional(),
|
|
22
22
|
})
|
|
23
|
-
export const typeZod = zod
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
export const typeZod = zod
|
|
24
|
+
.object({
|
|
25
|
+
totals: Totals.typeZod,
|
|
26
|
+
processor: Card.Stack.typeZod,
|
|
27
|
+
references: zod.array(zod.string()).optional(),
|
|
28
|
+
batch: Batch.typeZod,
|
|
29
|
+
count: zod.number().optional(),
|
|
30
|
+
})
|
|
31
|
+
.meta({ id: "Settlement.Creatable" }) satisfies zod.ZodType<Creatable>
|
|
30
32
|
}
|
|
@@ -95,5 +95,7 @@ export namespace Creatable {
|
|
|
95
95
|
})
|
|
96
96
|
}
|
|
97
97
|
export const type = isly.union(Known.type, Unknown.type)
|
|
98
|
-
export const typeZod: zod.ZodType<Creatable> = zod
|
|
98
|
+
export const typeZod: zod.ZodType<Creatable> = zod
|
|
99
|
+
.union([Known.typeZod, Unknown.typeZod])
|
|
100
|
+
.meta({ id: "Settlement.Entry.Creatable" })
|
|
99
101
|
}
|
|
@@ -23,7 +23,7 @@ export namespace Entry {
|
|
|
23
23
|
export import Succeeded = EntrySucceeded
|
|
24
24
|
export import Summary = EntrySummary
|
|
25
25
|
export const type = entryType
|
|
26
|
-
export const typeZod = entryTypeZod
|
|
26
|
+
export const typeZod = entryTypeZod.meta({ id: "Settlement.Entry" })
|
|
27
27
|
export const from = fromCreatable
|
|
28
28
|
export function charge(
|
|
29
29
|
counterpart: Rail.Address.Card.Counterpart,
|
package/Settlement/Status.ts
CHANGED
|
@@ -5,7 +5,6 @@ export interface Status {
|
|
|
5
5
|
collected: Status.Values
|
|
6
6
|
settled: Status.Values
|
|
7
7
|
}
|
|
8
|
-
|
|
9
8
|
export namespace Status {
|
|
10
9
|
export const values = ["pending", "failed", "partial", "done"] as const
|
|
11
10
|
export type Values = (typeof values)[number]
|
|
@@ -13,8 +12,7 @@ export namespace Status {
|
|
|
13
12
|
collected: isly.string(values),
|
|
14
13
|
settled: isly.string(values),
|
|
15
14
|
})
|
|
16
|
-
export const typeZod: zod.ZodType<Status> = zod
|
|
17
|
-
collected: zod.enum(values),
|
|
18
|
-
|
|
19
|
-
})
|
|
15
|
+
export const typeZod: zod.ZodType<Status> = zod
|
|
16
|
+
.object({ collected: zod.enum(values), settled: zod.enum(values) })
|
|
17
|
+
.meta({ id: "Settlement.Status" })
|
|
20
18
|
}
|
package/Settlement/Total.ts
CHANGED
|
@@ -48,12 +48,14 @@ export namespace Total {
|
|
|
48
48
|
collected: Collected.type.optional(),
|
|
49
49
|
settled: Settled.optional(),
|
|
50
50
|
})
|
|
51
|
-
export const typeZod: zod.ZodType<Total> = zod
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
51
|
+
export const typeZod: zod.ZodType<Total> = zod
|
|
52
|
+
.object({
|
|
53
|
+
expected: Amount.typeZod,
|
|
54
|
+
outcome: Amount.typeZod.optional(),
|
|
55
|
+
collected: Collected.typeZod.optional(),
|
|
56
|
+
settled: SettledZod.optional(),
|
|
57
|
+
})
|
|
58
|
+
.meta({ id: "Settlement.Total" })
|
|
57
59
|
export function create(): Total {
|
|
58
60
|
return { expected: { net: 0, fee: { other: 0 } } }
|
|
59
61
|
}
|
package/Settlement/Totals.ts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
2
|
import { isly } from "isly"
|
|
3
|
-
import { zod } from "../zod"
|
|
3
|
+
import { zod, zodHelper } from "../zod"
|
|
4
4
|
import { Entry } from "./Entry"
|
|
5
5
|
import { Total } from "./Total"
|
|
6
6
|
|
|
7
7
|
export type Totals = Partial<Record<isoly.Currency, Total>>
|
|
8
8
|
export namespace Totals {
|
|
9
9
|
export const type = isly.record<isoly.Currency, Total>(isly.string(isoly.Currency.values), Total.type)
|
|
10
|
-
export const typeZod: zod.ZodType<Totals> = zod
|
|
10
|
+
export const typeZod: zod.ZodType<Totals> = zod
|
|
11
|
+
.partialRecord(zodHelper.currency, Total.typeZod)
|
|
12
|
+
.meta({ id: "Settlement.Totals" })
|
|
11
13
|
export function addEntry(totals: Totals, entry: Entry): Totals {
|
|
12
14
|
const result = { ...totals }
|
|
13
15
|
if (entry.status == "succeeded" && (entry.type == "capture" || entry.type == "refund")) {
|
package/Settlement/index.ts
CHANGED
|
@@ -75,12 +75,14 @@ export namespace Settlement {
|
|
|
75
75
|
entries: Settlement.Entry.Summary.type,
|
|
76
76
|
warnings: Settlement.Warning.type.array().optional(),
|
|
77
77
|
})
|
|
78
|
-
export const typeZod: zod.ZodType<Settlement> = SettlementCreatable.typeZod
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
78
|
+
export const typeZod: zod.ZodType<Settlement> = SettlementCreatable.typeZod
|
|
79
|
+
.extend({
|
|
80
|
+
id: zod.union([SettlementIdentifier.typeZod, zod.string()]),
|
|
81
|
+
by: zod.string().optional(),
|
|
82
|
+
created: zod.string().refine(isoly.DateTime.is),
|
|
83
|
+
status: Status.typeZod,
|
|
84
|
+
entries: Settlement.Entry.Summary.typeZod,
|
|
85
|
+
warnings: zod.array(Settlement.Warning.typeZod).optional(),
|
|
86
|
+
})
|
|
87
|
+
.meta({ id: "Settlement" })
|
|
86
88
|
}
|
package/Supplier/index.ts
CHANGED
|
@@ -7,7 +7,7 @@ export type Supplier = (typeof Supplier.names)[number]
|
|
|
7
7
|
export namespace Supplier {
|
|
8
8
|
export const names = ["paxgiro", "clearbank", "bankingcircle"] as const
|
|
9
9
|
export const type = isly.string<Supplier>(names)
|
|
10
|
-
export const typeZod = zod.enum(names)
|
|
10
|
+
export const typeZod = zod.enum(names).meta({ id: "Supplier" })
|
|
11
11
|
export const decommissioned = ["clearbank"] as const
|
|
12
12
|
export type Decommissioned = (typeof decommissioned)[number]
|
|
13
13
|
export function isDecommissioned(supplier: Supplier | any): supplier is Decommissioned {
|
package/Transaction/Creatable.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { isly } from "isly"
|
|
|
3
3
|
import { Account } from "../Account"
|
|
4
4
|
import { Preset } from "../Card/Preset"
|
|
5
5
|
import { Rail } from "../Rail"
|
|
6
|
-
import { zod } from "../zod"
|
|
6
|
+
import { zod, zodHelper } from "../zod"
|
|
7
7
|
import { Amount } from "./Amount"
|
|
8
8
|
import { Exchange } from "./Exchange"
|
|
9
9
|
|
|
@@ -25,14 +25,16 @@ export namespace Creatable {
|
|
|
25
25
|
exchange: Exchange.type.optional(),
|
|
26
26
|
reference: isly.object<{ reference?: string }>({ reference: isly.string().optional() }).optional(),
|
|
27
27
|
})
|
|
28
|
-
export const typeZod = zod
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
28
|
+
export const typeZod = zod
|
|
29
|
+
.object({
|
|
30
|
+
counterpart: Rail.Address.typeZod,
|
|
31
|
+
currency: zodHelper.currency,
|
|
32
|
+
amount: zod.number(),
|
|
33
|
+
description: zod.string(),
|
|
34
|
+
exchange: Exchange.typeZod.optional(),
|
|
35
|
+
reference: zod.object({ reference: zod.string().optional() }).optional(),
|
|
36
|
+
})
|
|
37
|
+
.meta({ id: "Transaction.Creatable" })
|
|
36
38
|
export interface CardTransaction extends Creatable {
|
|
37
39
|
account: Pick<Rail.Address.Card, "id" | "type">
|
|
38
40
|
accountId: string
|
|
@@ -48,13 +50,15 @@ export namespace Creatable {
|
|
|
48
50
|
reference: isly.object<{ reference: string }>({ reference: isly.string() }),
|
|
49
51
|
approvalCode: isly.string().optional(),
|
|
50
52
|
})
|
|
51
|
-
export const typeZod = Creatable.typeZod
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
53
|
+
export const typeZod = Creatable.typeZod
|
|
54
|
+
.extend({
|
|
55
|
+
account: Rail.Address.Card.typeZod.pick({ id: true, type: true }),
|
|
56
|
+
accountId: zod.string(),
|
|
57
|
+
counterpart: Rail.Address.Card.Counterpart.typeZod,
|
|
58
|
+
reference: zod.object({ reference: zod.string() }),
|
|
59
|
+
approvalCode: zod.string().optional(),
|
|
60
|
+
})
|
|
61
|
+
.meta({ id: "Transaction.Creatable.CardTransaction" })
|
|
58
62
|
export function charge(creatable: CardTransaction, preset: Preset, charges?: Account.Charge): Amount.Charge {
|
|
59
63
|
return Account.Charge.evaluate(
|
|
60
64
|
creatable.counterpart,
|
package/Transaction/Exchange.ts
CHANGED
|
@@ -15,10 +15,12 @@ export namespace Exchange {
|
|
|
15
15
|
from: Amount.type.optional(),
|
|
16
16
|
quote: isly.string().optional(),
|
|
17
17
|
})
|
|
18
|
-
export const typeZod = zod
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
export const typeZod: zod.ZodType<Exchange> = zod
|
|
19
|
+
.object({
|
|
20
|
+
rate: zod.number(),
|
|
21
|
+
to: Amount.typeZod.optional(),
|
|
22
|
+
from: Amount.typeZod.optional(),
|
|
23
|
+
quote: zod.string().optional(),
|
|
24
|
+
})
|
|
25
|
+
.meta({ id: "Transaction.Exchange" })
|
|
24
26
|
}
|
package/Transaction/Incoming.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
2
|
import { isly } from "isly"
|
|
3
3
|
import { Rail } from "../Rail"
|
|
4
|
-
import { zod } from "../zod"
|
|
4
|
+
import { zod, zodHelper } from "../zod"
|
|
5
5
|
import { Reference as TransactionReference } from "./Reference"
|
|
6
6
|
|
|
7
7
|
export interface Incoming {
|
|
@@ -28,7 +28,7 @@ export namespace Incoming {
|
|
|
28
28
|
export const typeZod = zod.object({
|
|
29
29
|
account: Rail.Address.typeZod,
|
|
30
30
|
counterpart: Rail.Address.typeZod,
|
|
31
|
-
currency:
|
|
31
|
+
currency: zodHelper.currency,
|
|
32
32
|
amount: zod.number(),
|
|
33
33
|
description: zod.string(),
|
|
34
34
|
posted: zod.string(),
|
package/Transaction/Note.ts
CHANGED
|
@@ -33,19 +33,20 @@ export namespace Note {
|
|
|
33
33
|
flags: isly.string().array().optional(),
|
|
34
34
|
rule: isly.any().optional(),
|
|
35
35
|
})
|
|
36
|
-
export const typeZod = zod
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
export const typeZod = zod
|
|
37
|
+
.object({
|
|
38
|
+
text: zod.string().optional(),
|
|
39
|
+
action: zod.enum(["approve", "reject"]).optional(),
|
|
40
|
+
flags: zod.array(zod.string()).optional(),
|
|
41
|
+
rule: zod.any().optional(),
|
|
42
|
+
})
|
|
43
|
+
.meta({ id: "Transaction.Note.Creatable" })
|
|
42
44
|
}
|
|
43
45
|
export const type = Creatable.type.extend<Note>({
|
|
44
46
|
author: isly.string(),
|
|
45
47
|
created: isly.string(),
|
|
46
48
|
})
|
|
47
|
-
export const typeZod = Creatable.typeZod
|
|
48
|
-
author: zod.string(),
|
|
49
|
-
|
|
50
|
-
})
|
|
49
|
+
export const typeZod = Creatable.typeZod
|
|
50
|
+
.extend({ author: zod.string(), created: zod.string().refine(isoly.DateTime.is) })
|
|
51
|
+
.meta({ id: "Transaction.Note" })
|
|
51
52
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
2
|
import { isly } from "isly"
|
|
3
3
|
import { Rail } from "../../Rail"
|
|
4
|
-
import { zod } from "../../zod"
|
|
4
|
+
import { zod, zodHelper } from "../../zod"
|
|
5
5
|
import { Exchange } from "../Exchange"
|
|
6
6
|
|
|
7
7
|
export interface Base {
|
|
@@ -24,7 +24,7 @@ export namespace Base {
|
|
|
24
24
|
export const typeZod = zod.object({
|
|
25
25
|
type: zod.enum(["outgoing", "incoming", "authorization"]),
|
|
26
26
|
counterpart: Rail.Address.typeZod,
|
|
27
|
-
currency:
|
|
27
|
+
currency: zodHelper.currency,
|
|
28
28
|
amount: zod.number(),
|
|
29
29
|
description: zod.string(),
|
|
30
30
|
exchange: Exchange.typeZod.optional(),
|
|
@@ -2,7 +2,7 @@ import { isoly } from "isoly"
|
|
|
2
2
|
import { isly } from "isly"
|
|
3
3
|
import { Rail } from "../../Rail"
|
|
4
4
|
import { Settlement } from "../../Settlement"
|
|
5
|
-
import { zod } from "../../zod"
|
|
5
|
+
import { zod, zodHelper } from "../../zod"
|
|
6
6
|
import { Reference as TransactionReference } from "../Reference"
|
|
7
7
|
import { Base } from "./Base"
|
|
8
8
|
|
|
@@ -30,7 +30,7 @@ export namespace Incoming {
|
|
|
30
30
|
export const typeZod = Base.typeZod.extend({
|
|
31
31
|
type: zod.literal("incoming"),
|
|
32
32
|
account: Rail.Address.typeZod,
|
|
33
|
-
currency:
|
|
33
|
+
currency: zodHelper.currency,
|
|
34
34
|
amount: zod.number(),
|
|
35
35
|
description: zod.string(),
|
|
36
36
|
posted: zod.string(),
|
package/Transaction/Status.ts
CHANGED
|
@@ -28,5 +28,7 @@ export namespace Status {
|
|
|
28
28
|
Success,
|
|
29
29
|
isly.tuple<[Fail, Status.Reason]>(Fail, Reason)
|
|
30
30
|
)
|
|
31
|
-
export const typeZod = zod
|
|
31
|
+
export const typeZod = zod
|
|
32
|
+
.union([zod.enum(successes), zod.tuple([zod.enum(failures), zod.enum(reasons)])])
|
|
33
|
+
.meta({ id: "Transaction.Status" })
|
|
32
34
|
}
|
package/Transaction/index.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { Rail } from "../Rail"
|
|
|
7
7
|
import { Report } from "../Report"
|
|
8
8
|
import type { Rule } from "../Rule"
|
|
9
9
|
import { Settlement } from "../Settlement"
|
|
10
|
-
import { zod } from "../zod"
|
|
10
|
+
import { zod, zodHelper } from "../zod"
|
|
11
11
|
import { Amount as TransactionAmount } from "./Amount"
|
|
12
12
|
import { Creatable as TransactionCreatable } from "./Creatable"
|
|
13
13
|
import { Exchange as TransactionExchange } from "./Exchange"
|
|
@@ -86,32 +86,34 @@ export namespace Transaction {
|
|
|
86
86
|
risk: isly.number().optional(),
|
|
87
87
|
state: isly.any().optional(),
|
|
88
88
|
})
|
|
89
|
-
export const typeZod = zod
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
89
|
+
export const typeZod = zod
|
|
90
|
+
.object({
|
|
91
|
+
counterpart: Rail.Address.typeZod,
|
|
92
|
+
currency: zodHelper.currency,
|
|
93
|
+
amount: Amount.typeZod,
|
|
94
|
+
description: zod.string(),
|
|
95
|
+
organization: zod.string(),
|
|
96
|
+
accountId: zod.string(),
|
|
97
|
+
accountName: zod.string().optional(),
|
|
98
|
+
account: Rail.Address.typeZod,
|
|
99
|
+
type: zod.enum(types).optional(),
|
|
100
|
+
direction: zod.enum(directions).optional(),
|
|
101
|
+
id: Identifier.typeZod,
|
|
102
|
+
reference: Reference.typeZod.optional(),
|
|
103
|
+
posted: zod.string().refine(isoly.DateTime.is),
|
|
104
|
+
transacted: zod.string().refine(isoly.DateTime.is).optional(),
|
|
105
|
+
by: zod.string().optional(),
|
|
106
|
+
balance: zod.object({ actual: zod.number(), available: zod.number(), reserved: zod.number() }),
|
|
107
|
+
operations: zod.array(Operation.typeZod).optional(),
|
|
108
|
+
status: Status.typeZod,
|
|
109
|
+
rail: Rail.typeZod.optional(),
|
|
110
|
+
flags: zod.array(zod.string()),
|
|
111
|
+
oldFlags: zod.array(zod.string()),
|
|
112
|
+
notes: zod.array(Note.typeZod),
|
|
113
|
+
risk: zod.number().optional(),
|
|
114
|
+
state: zod.any().optional(),
|
|
115
|
+
})
|
|
116
|
+
.meta({ id: "Transaction" })
|
|
115
117
|
export function amountFromOperations(transaction: Transaction, operations: Operation[]): Amount {
|
|
116
118
|
const changes = Operation.sum(operations)
|
|
117
119
|
const reserved = isoly.Currency.add(
|
|
@@ -413,9 +415,9 @@ export namespace Transaction {
|
|
|
413
415
|
account: Rail.Address.Card.type,
|
|
414
416
|
counterpart: Rail.Address.Card.Counterpart.type,
|
|
415
417
|
})
|
|
416
|
-
export const typeZod = Transaction.typeZod
|
|
417
|
-
account:
|
|
418
|
-
counterpart: Rail.Address.Card.Counterpart.typeZod
|
|
419
|
-
|
|
418
|
+
export const typeZod = Transaction.typeZod
|
|
419
|
+
.omit({ account: true, counterpart: true })
|
|
420
|
+
.extend({ account: Rail.Address.Card.typeZod, counterpart: Rail.Address.Card.Counterpart.typeZod })
|
|
421
|
+
.meta({ id: "Transaction.CardTransaction" })
|
|
420
422
|
}
|
|
421
423
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
2
|
import { isly } from "isly"
|
|
3
3
|
import { Warning } from "../../Warning"
|
|
4
|
-
import { zod } from "../../zod"
|
|
4
|
+
import { zod, zodHelper } from "../../zod"
|
|
5
5
|
import { Transaction } from "../Transaction"
|
|
6
6
|
|
|
7
7
|
export interface Account {
|
|
@@ -53,7 +53,7 @@ export namespace Account {
|
|
|
53
53
|
label: zod.string(),
|
|
54
54
|
reference: zod.string(),
|
|
55
55
|
description: zod.string().optional(),
|
|
56
|
-
currency:
|
|
56
|
+
currency: zodHelper.currency,
|
|
57
57
|
opening: Opening.typeZod.optional(),
|
|
58
58
|
closing: Closing.typeZod,
|
|
59
59
|
delta: Delta.typeZod,
|
|
@@ -7,8 +7,5 @@ export interface Base {
|
|
|
7
7
|
result: Result
|
|
8
8
|
}
|
|
9
9
|
export namespace Base {
|
|
10
|
-
export const typeZod = zod.object({
|
|
11
|
-
check: Checks.typeZod,
|
|
12
|
-
result: Result.typeZod,
|
|
13
|
-
}) satisfies zod.ZodType<Base>
|
|
10
|
+
export const typeZod = zod.object({ check: Checks.typeZod, result: Result.typeZod }) satisfies zod.ZodType<Base>
|
|
14
11
|
}
|