@hyperscale0/hsx 2.4.1 → 3.0.0
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/CHANGELOG.md +2 -408
- package/README.md +3 -92
- package/dist/src/ast.d.ts +99 -310
- package/dist/src/ast.d.ts.map +1 -1
- package/dist/src/ast.js +16 -69
- package/dist/src/ast.js.map +1 -1
- package/dist/src/cli.d.ts +6 -19
- package/dist/src/cli.d.ts.map +1 -1
- package/dist/src/cli.js +76 -315
- package/dist/src/cli.js.map +1 -1
- package/dist/src/compile.d.ts +23 -73
- package/dist/src/compile.d.ts.map +1 -1
- package/dist/src/compile.js +1113 -148
- package/dist/src/compile.js.map +1 -1
- package/dist/src/cost.d.ts +8 -77
- package/dist/src/cost.d.ts.map +1 -1
- package/dist/src/cost.js +13 -422
- package/dist/src/cost.js.map +1 -1
- package/dist/src/format.d.ts +8 -7
- package/dist/src/format.d.ts.map +1 -1
- package/dist/src/format.js +9 -175
- package/dist/src/format.js.map +1 -1
- package/dist/src/headers.d.ts +35 -0
- package/dist/src/headers.d.ts.map +1 -0
- package/dist/src/headers.js +108 -0
- package/dist/src/headers.js.map +1 -0
- package/dist/src/index.d.ts +6 -12
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +4 -9
- package/dist/src/index.js.map +1 -1
- package/dist/src/lex.d.ts +8 -28
- package/dist/src/lex.d.ts.map +1 -1
- package/dist/src/lex.js +88 -146
- package/dist/src/lex.js.map +1 -1
- package/dist/src/parse.d.ts +4 -17
- package/dist/src/parse.d.ts.map +1 -1
- package/dist/src/parse.js +402 -1040
- package/dist/src/parse.js.map +1 -1
- package/dist/src/std-bundle.d.ts.map +1 -1
- package/dist/src/std-bundle.js +12 -20
- package/dist/src/std-bundle.js.map +1 -1
- package/dist/src/std-library.d.ts +1 -1
- package/dist/src/std-library.d.ts.map +1 -1
- package/dist/src/std-library.js +1 -5
- package/dist/src/std-library.js.map +1 -1
- package/dist/src/tunables.d.ts +7 -0
- package/dist/src/tunables.d.ts.map +1 -0
- package/dist/src/tunables.js +26 -0
- package/dist/src/tunables.js.map +1 -0
- package/dist/src/version.d.ts +2 -4
- package/dist/src/version.d.ts.map +1 -1
- package/dist/src/version.js +2 -4
- package/dist/src/version.js.map +1 -1
- package/docs/README.md +179 -41
- package/docs/headers.md +44 -0
- package/examples/cost-table.json +99 -751
- package/examples/library.hsx +59 -0
- package/package.json +9 -17
- package/src/ast.ts +82 -441
- package/src/cli.ts +77 -362
- package/src/compile.ts +1535 -247
- package/src/cost.ts +28 -671
- package/src/format.ts +12 -256
- package/src/headers.ts +126 -0
- package/src/index.ts +7 -39
- package/src/lex.ts +99 -195
- package/src/parse.ts +403 -1209
- package/src/std-bundle.ts +12 -20
- package/src/std-library.ts +2 -7
- package/src/tunables.ts +31 -0
- package/src/version.ts +2 -5
- package/std/approvals.hsx +17 -0
- package/std/cards.hsx +63 -0
- package/std/collections.hsx +31 -0
- package/std/escrow.hsx +43 -0
- package/std/financing.hsx +372 -0
- package/std/insurance.hsx +59 -0
- package/std/lending.hsx +115 -0
- package/std/marketplace.hsx +24 -0
- package/std/money.hsx +195 -0
- package/std/savings.hsx +44 -0
- package/std/travel.hsx +98 -0
- package/std/wallet.hsx +41 -0
- package/dist/src/diagnostics.d.ts +0 -13
- package/dist/src/diagnostics.d.ts.map +0 -1
- package/dist/src/diagnostics.js +0 -587
- package/dist/src/diagnostics.js.map +0 -1
- package/dist/src/emit.d.ts +0 -51
- package/dist/src/emit.d.ts.map +0 -1
- package/dist/src/emit.js +0 -192
- package/dist/src/emit.js.map +0 -1
- package/dist/src/entry-overrides.d.ts +0 -58
- package/dist/src/entry-overrides.d.ts.map +0 -1
- package/dist/src/entry-overrides.js +0 -284
- package/dist/src/entry-overrides.js.map +0 -1
- package/dist/src/ir.d.ts +0 -73
- package/dist/src/ir.d.ts.map +0 -1
- package/dist/src/ir.js +0 -15
- package/dist/src/ir.js.map +0 -1
- package/dist/src/limits.d.ts +0 -23
- package/dist/src/limits.d.ts.map +0 -1
- package/dist/src/limits.js +0 -23
- package/dist/src/limits.js.map +0 -1
- package/dist/src/lsp/server.d.ts +0 -32
- package/dist/src/lsp/server.d.ts.map +0 -1
- package/dist/src/lsp/server.js +0 -391
- package/dist/src/lsp/server.js.map +0 -1
- package/dist/src/modules.d.ts +0 -38
- package/dist/src/modules.d.ts.map +0 -1
- package/dist/src/modules.js +0 -372
- package/dist/src/modules.js.map +0 -1
- package/dist/src/typecheck.d.ts +0 -8
- package/dist/src/typecheck.d.ts.map +0 -1
- package/dist/src/typecheck.js +0 -4160
- package/dist/src/typecheck.js.map +0 -1
- package/docs/guide/01-first-program.md +0 -24
- package/docs/guide/02-money.md +0 -25
- package/docs/guide/03-instruments.md +0 -93
- package/docs/guide/04-lifecycles.md +0 -40
- package/docs/guide/05-fees-and-splits.md +0 -45
- package/docs/guide/06-schedules.md +0 -26
- package/docs/guide/07-composition.md +0 -52
- package/docs/guide/08-writing-a-module.md +0 -85
- package/docs/guide/09-cost.md +0 -24
- package/docs/guide/10-diagnostics.md +0 -27
- package/docs/llms-full.txt +0 -3684
- package/docs/llms.txt +0 -44
- package/docs/piece-plans.md +0 -120
- package/docs/playground.md +0 -55
- package/docs/reference/cli.md +0 -36
- package/docs/reference/diagnostics.md +0 -901
- package/docs/reference/grammar.md +0 -38
- package/docs/reference/std/advance.md +0 -112
- package/docs/reference/std/cancellable_booking.md +0 -159
- package/docs/reference/std/captured_payment.md +0 -115
- package/docs/reference/std/conditional_disbursement.md +0 -101
- package/docs/reference/std/credit_facility.md +0 -108
- package/docs/reference/std/held_payment.md +0 -173
- package/docs/reference/std/instant_transfer.md +0 -97
- package/docs/reference/std/metered.md +0 -89
- package/docs/reference/std/pooled_split.md +0 -95
- package/docs/reference/std/premium_forward.md +0 -119
- package/docs/reference/std/reconciled_payout.md +0 -103
- package/docs/reference/std/rotating_pool.md +0 -130
- package/docs/reference/std/scheduled.md +0 -136
- package/docs/reference/std/security_deposit.md +0 -138
- package/docs/reference/std/settlement_batch.md +0 -123
- package/docs/reference/std/swap.md +0 -133
- package/docs/reference/std/threshold_pool.md +0 -138
- package/docs/reference/std/weighted_distribution.md +0 -135
- package/docs/reference/types.md +0 -61
- package/docs/reference/udl-output.md +0 -13
- package/examples/01-first-program/README.md +0 -45
- package/examples/01-first-program/tip-jar.hsx +0 -17
- package/examples/02-imports-and-modules/README.md +0 -96
- package/examples/02-imports-and-modules/photo-booth.hsx +0 -37
- package/examples/03-diagnostics/README.md +0 -68
- package/examples/03-diagnostics/corner-shop-fixed.hsx +0 -22
- package/examples/03-diagnostics/corner-shop.hsx +0 -19
- package/examples/04-complete-product/README.md +0 -84
- package/examples/04-complete-product/study-hall.hsx +0 -67
- package/examples/05-authored-instrument/README.md +0 -5
- package/examples/05-authored-instrument/payment.hsx +0 -37
- package/examples/05-watch-club/README.md +0 -6
- package/examples/05-watch-club/watch-club.hsx +0 -123
- package/examples/README.md +0 -48
- package/examples/advance/README.md +0 -3
- package/examples/advance/advance.hsx +0 -13
- package/examples/advance/advance.udl +0 -367
- package/examples/cancellable_booking/README.md +0 -3
- package/examples/cancellable_booking/cancellable_booking.hsx +0 -14
- package/examples/cancellable_booking/cancellable_booking.udl +0 -413
- package/examples/captured_payment/README.md +0 -3
- package/examples/captured_payment/captured_payment.hsx +0 -17
- package/examples/captured_payment/captured_payment.udl +0 -686
- package/examples/conditional_disbursement/README.md +0 -3
- package/examples/conditional_disbursement/conditional_disbursement.hsx +0 -15
- package/examples/conditional_disbursement/conditional_disbursement.udl +0 -418
- package/examples/credit_facility/README.md +0 -3
- package/examples/credit_facility/credit_facility.hsx +0 -24
- package/examples/credit_facility/credit_facility.udl +0 -1396
- package/examples/held_payment/README.md +0 -3
- package/examples/held_payment/held_payment.hsx +0 -13
- package/examples/held_payment/held_payment.udl +0 -569
- package/examples/instant_transfer/README.md +0 -3
- package/examples/instant_transfer/instant_transfer.hsx +0 -16
- package/examples/instant_transfer/instant_transfer.udl +0 -376
- package/examples/metered/README.md +0 -3
- package/examples/metered/metered.hsx +0 -13
- package/examples/metered/metered.udl +0 -253
- package/examples/pooled_split/README.md +0 -3
- package/examples/pooled_split/pooled_split.hsx +0 -15
- package/examples/pooled_split/pooled_split.udl +0 -432
- package/examples/premium_forward/README.md +0 -3
- package/examples/premium_forward/premium_forward.hsx +0 -19
- package/examples/premium_forward/premium_forward.udl +0 -604
- package/examples/reconciled_payout/README.md +0 -3
- package/examples/reconciled_payout/reconciled_payout.hsx +0 -13
- package/examples/reconciled_payout/reconciled_payout.udl +0 -312
- package/examples/rotating_pool/README.md +0 -3
- package/examples/rotating_pool/rotating_pool.hsx +0 -18
- package/examples/rotating_pool/rotating_pool.udl +0 -4370
- package/examples/scheduled/README.md +0 -3
- package/examples/scheduled/scheduled.hsx +0 -12
- package/examples/scheduled/scheduled.udl +0 -355
- package/examples/security_deposit/README.md +0 -3
- package/examples/security_deposit/security_deposit.hsx +0 -21
- package/examples/security_deposit/security_deposit.udl +0 -320
- package/examples/settlement_batch/README.md +0 -3
- package/examples/settlement_batch/settlement_batch.hsx +0 -19
- package/examples/settlement_batch/settlement_batch.udl +0 -757
- package/examples/swap/README.md +0 -3
- package/examples/swap/swap.hsx +0 -19
- package/examples/swap/swap.udl +0 -892
- package/examples/threshold_pool/README.md +0 -3
- package/examples/threshold_pool/threshold_pool.hsx +0 -16
- package/examples/threshold_pool/threshold_pool.udl +0 -680
- package/examples/weighted_distribution/README.md +0 -3
- package/examples/weighted_distribution/weighted_distribution.hsx +0 -20
- package/examples/weighted_distribution/weighted_distribution.udl +0 -348
- package/skills/hsx/SKILL.md +0 -449
- package/src/diagnostics.ts +0 -620
- package/src/emit.ts +0 -282
- package/src/entry-overrides.ts +0 -428
- package/src/ir.ts +0 -113
- package/src/limits.ts +0 -22
- package/src/lsp/server.ts +0 -460
- package/src/modules.ts +0 -452
- package/src/typecheck.ts +0 -5515
- package/std/SEMANTICS.md +0 -44
- package/std/money_flows/advance.hsx +0 -235
- package/std/money_flows/cancellable_booking.hsx +0 -402
- package/std/money_flows/captured_payment.hsx +0 -220
- package/std/money_flows/conditional_disbursement.hsx +0 -226
- package/std/money_flows/credit_facility.hsx +0 -214
- package/std/money_flows/held_payment.hsx +0 -812
- package/std/money_flows/index.hsx +0 -4
- package/std/money_flows/instant_transfer.hsx +0 -231
- package/std/money_flows/metered.hsx +0 -104
- package/std/money_flows/pooled_split.hsx +0 -109
- package/std/money_flows/premium_forward.hsx +0 -307
- package/std/money_flows/reconciled_payout.hsx +0 -119
- package/std/money_flows/rotating_pool.hsx +0 -305
- package/std/money_flows/scheduled.hsx +0 -599
- package/std/money_flows/security_deposit.hsx +0 -248
- package/std/money_flows/settlement_batch.hsx +0 -173
- package/std/money_flows/swap.hsx +0 -1192
- package/std/money_flows/threshold_pool.hsx +0 -307
- package/std/money_flows/weighted_distribution.hsx +0 -237
|
@@ -1,757 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"instruments": [
|
|
3
|
-
{
|
|
4
|
-
"actionOrder": [
|
|
5
|
-
"create",
|
|
6
|
-
"close",
|
|
7
|
-
"calculate",
|
|
8
|
-
"approve",
|
|
9
|
-
"instruct",
|
|
10
|
-
"acknowledge_payout",
|
|
11
|
-
"reconcile"
|
|
12
|
-
],
|
|
13
|
-
"actions": {
|
|
14
|
-
"acknowledge_payout": {
|
|
15
|
-
"agentDescription": "Record the beneficiary confirmation that the payout landed, with the reference kept in the receipt. The batch must already be instructed. Only the payout destination may call it. No money moves.",
|
|
16
|
-
"captureInput": {
|
|
17
|
-
"acknowledgementReference": "acknowledgementReference"
|
|
18
|
-
},
|
|
19
|
-
"effects": {
|
|
20
|
-
"decides": [
|
|
21
|
-
{
|
|
22
|
-
"signature": "decides.tenant_port",
|
|
23
|
-
"source": "port"
|
|
24
|
-
}
|
|
25
|
-
]
|
|
26
|
-
},
|
|
27
|
-
"input": {
|
|
28
|
-
"additionalProperties": false,
|
|
29
|
-
"properties": {
|
|
30
|
-
"acknowledgementReference": {
|
|
31
|
-
"description": "Required decision reference retained in the operation receipt",
|
|
32
|
-
"maxLength": 180,
|
|
33
|
-
"minLength": 1,
|
|
34
|
-
"type": "string"
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
"required": [
|
|
38
|
-
"acknowledgementReference"
|
|
39
|
-
],
|
|
40
|
-
"type": "object"
|
|
41
|
-
},
|
|
42
|
-
"moves": [],
|
|
43
|
-
"port": {
|
|
44
|
-
"allowedParties": [
|
|
45
|
-
"beneficiary"
|
|
46
|
-
]
|
|
47
|
-
},
|
|
48
|
-
"publicAction": "acknowledgePayoutBatch",
|
|
49
|
-
"steps": [],
|
|
50
|
-
"summary": "Record the tenant's payout acknowledgement in the receipt"
|
|
51
|
-
},
|
|
52
|
-
"approve": {
|
|
53
|
-
"agentDescription": "Sign off on the frozen net payable. The batch must already be calculated. Nothing is recomputed and no money moves. This is the gate instruct waits on.",
|
|
54
|
-
"moves": [],
|
|
55
|
-
"publicAction": "approveBatch",
|
|
56
|
-
"steps": [],
|
|
57
|
-
"summary": "Approve the frozen payable without recomputing it"
|
|
58
|
-
},
|
|
59
|
-
"calculate": {
|
|
60
|
-
"agentDescription": "Prove and freeze the one net payable from gross captures plus credit adjustments minus debit adjustments. The batch must be closed first. A zero or negative net is refused, so a batch in deficit never reaches a payout. No money moves.",
|
|
61
|
-
"moves": [],
|
|
62
|
-
"publicAction": "calculateBatch",
|
|
63
|
-
"signedSum": {
|
|
64
|
-
"amountRef": "netPayable",
|
|
65
|
-
"onNegative": "refuse",
|
|
66
|
-
"onZero": "refuse",
|
|
67
|
-
"sources": [
|
|
68
|
-
{
|
|
69
|
-
"amountField": "amount",
|
|
70
|
-
"instrumentId": "batch_capture_entry",
|
|
71
|
-
"refField": "batchId",
|
|
72
|
-
"sign": "add",
|
|
73
|
-
"statuses": [
|
|
74
|
-
"accrued"
|
|
75
|
-
],
|
|
76
|
-
"subtotalRef": "grossCaptureAmount"
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
"amountField": "amount",
|
|
80
|
-
"instrumentId": "batch_credit_adjustment",
|
|
81
|
-
"refField": "batchId",
|
|
82
|
-
"sign": "add",
|
|
83
|
-
"statuses": [
|
|
84
|
-
"applied"
|
|
85
|
-
],
|
|
86
|
-
"subtotalRef": "creditAdjustmentAmount"
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
"amountField": "amount",
|
|
90
|
-
"instrumentId": "batch_debit_adjustment",
|
|
91
|
-
"refField": "batchId",
|
|
92
|
-
"sign": "subtract",
|
|
93
|
-
"statuses": [
|
|
94
|
-
"applied"
|
|
95
|
-
],
|
|
96
|
-
"subtotalRef": "debitAdjustmentAmount"
|
|
97
|
-
}
|
|
98
|
-
]
|
|
99
|
-
},
|
|
100
|
-
"steps": [],
|
|
101
|
-
"summary": "Prove and freeze the one signed net payable amount"
|
|
102
|
-
},
|
|
103
|
-
"close": {
|
|
104
|
-
"due": {
|
|
105
|
-
"field": "closeAt"
|
|
106
|
-
},
|
|
107
|
-
"effects": {
|
|
108
|
-
"schedules": [
|
|
109
|
-
{
|
|
110
|
-
"signature": "schedules.due",
|
|
111
|
-
"source": "due"
|
|
112
|
-
}
|
|
113
|
-
]
|
|
114
|
-
},
|
|
115
|
-
"moves": [],
|
|
116
|
-
"steps": [],
|
|
117
|
-
"summary": "Freeze the batch and stop all new entries"
|
|
118
|
-
},
|
|
119
|
-
"create": {
|
|
120
|
-
"agentDescription": "Open a batch that capture entries and adjustments can accrue into. No money moves. The batch keeps taking entries until its close date freezes it.",
|
|
121
|
-
"moves": [],
|
|
122
|
-
"publicAction": "createBatch",
|
|
123
|
-
"steps": [],
|
|
124
|
-
"summary": "Open a batch"
|
|
125
|
-
},
|
|
126
|
-
"instruct": {
|
|
127
|
-
"agentDescription": "Create one external payout for the frozen net payable, drawn on the settlement account and sent to the stored beneficiary. The batch must be approved. This moves money off the platform and is idempotent, so a retry never pays twice.",
|
|
128
|
-
"effects": {
|
|
129
|
-
"moves": [
|
|
130
|
-
{
|
|
131
|
-
"signature": "moves.payout.external",
|
|
132
|
-
"source": "payout"
|
|
133
|
-
}
|
|
134
|
-
]
|
|
135
|
-
},
|
|
136
|
-
"moves": [],
|
|
137
|
-
"payout": {
|
|
138
|
-
"amount": "refs.netPayable",
|
|
139
|
-
"beneficiaryField": "payoutBeneficiaryId",
|
|
140
|
-
"beneficiaryPartyField": "payoutDestinationAccountId",
|
|
141
|
-
"capture": "payoutId",
|
|
142
|
-
"currencyField": "currency",
|
|
143
|
-
"sourceAccountField": "settlementAccountAccountId",
|
|
144
|
-
"speed": "standard"
|
|
145
|
-
},
|
|
146
|
-
"publicAction": "instructBatch",
|
|
147
|
-
"steps": [],
|
|
148
|
-
"summary": "Create one idempotent payout from the frozen net payable"
|
|
149
|
-
},
|
|
150
|
-
"reconcile": {
|
|
151
|
-
"due": {
|
|
152
|
-
"field": "closeAt",
|
|
153
|
-
"offset": "P30D"
|
|
154
|
-
},
|
|
155
|
-
"effects": {
|
|
156
|
-
"reads": [
|
|
157
|
-
{
|
|
158
|
-
"signature": "reads.reconcile",
|
|
159
|
-
"source": "reconcile[0]"
|
|
160
|
-
}
|
|
161
|
-
],
|
|
162
|
-
"schedules": [
|
|
163
|
-
{
|
|
164
|
-
"signature": "schedules.due",
|
|
165
|
-
"source": "due"
|
|
166
|
-
}
|
|
167
|
-
]
|
|
168
|
-
},
|
|
169
|
-
"moves": [],
|
|
170
|
-
"reconcile": [
|
|
171
|
-
{
|
|
172
|
-
"amount": "refs.netPayable",
|
|
173
|
-
"capture": "settlementEvidenceId",
|
|
174
|
-
"counterpartyRef": "payoutId",
|
|
175
|
-
"currencyField": "currency",
|
|
176
|
-
"direction": "debit",
|
|
177
|
-
"evidence": "statement_line",
|
|
178
|
-
"exception": {
|
|
179
|
-
"amountField": "amount",
|
|
180
|
-
"childInstrumentId": "batch_debit_adjustment",
|
|
181
|
-
"maxOpen": 1,
|
|
182
|
-
"reasonField": "adjustmentReference",
|
|
183
|
-
"refField": "batchId"
|
|
184
|
-
},
|
|
185
|
-
"match": {
|
|
186
|
-
"law": "exact"
|
|
187
|
-
},
|
|
188
|
-
"within": {
|
|
189
|
-
"offset": "P30D"
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
],
|
|
193
|
-
"steps": [],
|
|
194
|
-
"summary": "Match durable evidence that the payout settled"
|
|
195
|
-
}
|
|
196
|
-
},
|
|
197
|
-
"agentDescription": "Reach for settlement batch when many charges over a period roll up into one payout. Capture entries and adjustments accrue against an open batch, the batch freezes on its close date, calculate proves one signed net payable, and instruct sends a single external payout. Weighted distribution goes the other way, one amount out to many recipients.",
|
|
198
|
-
"description": "Immutable batch of capture lineage and signed adjustments that creates one payout",
|
|
199
|
-
"fields": {
|
|
200
|
-
"closeAt": {
|
|
201
|
-
"description": "Date the open batch freezes against later entries",
|
|
202
|
-
"format": "hyperscale-date-time",
|
|
203
|
-
"type": "string"
|
|
204
|
-
},
|
|
205
|
-
"currency": {
|
|
206
|
-
"description": "ISO 4217 currency code",
|
|
207
|
-
"maxLength": 3,
|
|
208
|
-
"minLength": 3,
|
|
209
|
-
"pattern": "^[A-Z]{3}$",
|
|
210
|
-
"type": "string"
|
|
211
|
-
},
|
|
212
|
-
"payoutBeneficiaryId": {
|
|
213
|
-
"description": "Beneficiary ID for the payout instruction",
|
|
214
|
-
"pattern": "^ben_(sandbox|live)_[a-z0-9]{8,64}$",
|
|
215
|
-
"type": "string"
|
|
216
|
-
},
|
|
217
|
-
"payoutDestinationAccountId": {
|
|
218
|
-
"description": "The payout destination account",
|
|
219
|
-
"pattern": "^acct_(sandbox|live)_[a-z0-9]{8,64}$",
|
|
220
|
-
"type": "string",
|
|
221
|
-
"x-hyperscale-reference-filter": {
|
|
222
|
-
"column": "role",
|
|
223
|
-
"values": [
|
|
224
|
-
"customer_balance"
|
|
225
|
-
]
|
|
226
|
-
}
|
|
227
|
-
},
|
|
228
|
-
"settlementAccountAccountId": {
|
|
229
|
-
"description": "The settlement account account",
|
|
230
|
-
"pattern": "^acct_(sandbox|live)_[a-z0-9]{8,64}$",
|
|
231
|
-
"type": "string",
|
|
232
|
-
"x-hyperscale-reference-filter": {
|
|
233
|
-
"column": "role",
|
|
234
|
-
"values": [
|
|
235
|
-
"customer_balance"
|
|
236
|
-
]
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
},
|
|
240
|
-
"id": "batch",
|
|
241
|
-
"idPrefix": "batc",
|
|
242
|
-
"lifecycle": {
|
|
243
|
-
"initial": "open",
|
|
244
|
-
"states": [
|
|
245
|
-
"open",
|
|
246
|
-
"closed",
|
|
247
|
-
"calculated",
|
|
248
|
-
"approved",
|
|
249
|
-
"instructed",
|
|
250
|
-
"acknowledged",
|
|
251
|
-
"reconciled"
|
|
252
|
-
],
|
|
253
|
-
"transitions": {
|
|
254
|
-
"acknowledge_payout": {
|
|
255
|
-
"from": [
|
|
256
|
-
"instructed"
|
|
257
|
-
],
|
|
258
|
-
"to": "acknowledged"
|
|
259
|
-
},
|
|
260
|
-
"approve": {
|
|
261
|
-
"from": [
|
|
262
|
-
"calculated"
|
|
263
|
-
],
|
|
264
|
-
"to": "approved"
|
|
265
|
-
},
|
|
266
|
-
"calculate": {
|
|
267
|
-
"from": [
|
|
268
|
-
"closed"
|
|
269
|
-
],
|
|
270
|
-
"to": "calculated"
|
|
271
|
-
},
|
|
272
|
-
"close": {
|
|
273
|
-
"from": [
|
|
274
|
-
"open"
|
|
275
|
-
],
|
|
276
|
-
"to": "closed"
|
|
277
|
-
},
|
|
278
|
-
"instruct": {
|
|
279
|
-
"from": [
|
|
280
|
-
"approved"
|
|
281
|
-
],
|
|
282
|
-
"to": "instructed"
|
|
283
|
-
},
|
|
284
|
-
"reconcile": {
|
|
285
|
-
"from": [
|
|
286
|
-
"instructed",
|
|
287
|
-
"acknowledged"
|
|
288
|
-
],
|
|
289
|
-
"to": "reconciled"
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
},
|
|
293
|
-
"parties": {
|
|
294
|
-
"beneficiary": "payoutDestinationAccountId",
|
|
295
|
-
"payer": "settlementAccountAccountId"
|
|
296
|
-
},
|
|
297
|
-
"required": [
|
|
298
|
-
"payoutDestinationAccountId",
|
|
299
|
-
"settlementAccountAccountId",
|
|
300
|
-
"closeAt",
|
|
301
|
-
"currency",
|
|
302
|
-
"payoutBeneficiaryId"
|
|
303
|
-
],
|
|
304
|
-
"summary": "Payout batch from settlement account to payout destination",
|
|
305
|
-
"templateBinding": {
|
|
306
|
-
"id": "settlement_batch",
|
|
307
|
-
"parameters": {}
|
|
308
|
-
},
|
|
309
|
-
"title": "Batch"
|
|
310
|
-
},
|
|
311
|
-
{
|
|
312
|
-
"actionOrder": [
|
|
313
|
-
"create",
|
|
314
|
-
"accrue"
|
|
315
|
-
],
|
|
316
|
-
"actions": {
|
|
317
|
-
"accrue": {
|
|
318
|
-
"agentDescription": "Count this capture toward the batch gross total. The entry must be created and its batch still open, because a closed batch admits nothing new. No money moves.",
|
|
319
|
-
"effects": {
|
|
320
|
-
"reads": [
|
|
321
|
-
{
|
|
322
|
-
"signature": "reads.requires_refs",
|
|
323
|
-
"source": "requiresRefs"
|
|
324
|
-
}
|
|
325
|
-
]
|
|
326
|
-
},
|
|
327
|
-
"moves": [],
|
|
328
|
-
"publicAction": "accrueBatchCaptureEntry",
|
|
329
|
-
"requiresRefs": [
|
|
330
|
-
{
|
|
331
|
-
"field": "batchId",
|
|
332
|
-
"match": {
|
|
333
|
-
"fields.currency": "fields.currency"
|
|
334
|
-
},
|
|
335
|
-
"statuses": [
|
|
336
|
-
"open"
|
|
337
|
-
]
|
|
338
|
-
}
|
|
339
|
-
],
|
|
340
|
-
"steps": [],
|
|
341
|
-
"summary": "Accrue the capture entry into the open batch"
|
|
342
|
-
},
|
|
343
|
-
"create": {
|
|
344
|
-
"agentDescription": "Record one capture with its source reference against an open batch. The batch must be open and share the currency. No money moves, and the entry counts toward the net payable only once it accrues.",
|
|
345
|
-
"effects": {
|
|
346
|
-
"reads": [
|
|
347
|
-
{
|
|
348
|
-
"signature": "reads.requires_refs",
|
|
349
|
-
"source": "requiresRefs"
|
|
350
|
-
}
|
|
351
|
-
]
|
|
352
|
-
},
|
|
353
|
-
"moves": [],
|
|
354
|
-
"publicAction": "createBatchCaptureEntry",
|
|
355
|
-
"requiresRefs": [
|
|
356
|
-
{
|
|
357
|
-
"field": "batchId",
|
|
358
|
-
"match": {
|
|
359
|
-
"fields.currency": "fields.currency"
|
|
360
|
-
},
|
|
361
|
-
"statuses": [
|
|
362
|
-
"open"
|
|
363
|
-
]
|
|
364
|
-
}
|
|
365
|
-
],
|
|
366
|
-
"steps": [],
|
|
367
|
-
"summary": "Create a capture lineage entry on an open batch"
|
|
368
|
-
}
|
|
369
|
-
},
|
|
370
|
-
"agentDescription": "One gross capture that belongs to an open batch. Record one per source capture so the net payable keeps its lineage back to the original charge.",
|
|
371
|
-
"description": "One gross capture entry linked to an open payout batch",
|
|
372
|
-
"fields": {
|
|
373
|
-
"amount": {
|
|
374
|
-
"description": "Gross captured amount in minor units",
|
|
375
|
-
"pattern": "^[1-9][0-9]{0,17}$",
|
|
376
|
-
"type": "string"
|
|
377
|
-
},
|
|
378
|
-
"batchId": {
|
|
379
|
-
"description": "Open batch this capture entry accrues into",
|
|
380
|
-
"pattern": "^batc_(sandbox|live)_[a-z0-9]{8,64}$",
|
|
381
|
-
"type": "string"
|
|
382
|
-
},
|
|
383
|
-
"captureReference": {
|
|
384
|
-
"description": "Immutable source capture reference",
|
|
385
|
-
"maxLength": 180,
|
|
386
|
-
"minLength": 1,
|
|
387
|
-
"type": "string"
|
|
388
|
-
},
|
|
389
|
-
"currency": {
|
|
390
|
-
"description": "ISO 4217 currency code",
|
|
391
|
-
"maxLength": 3,
|
|
392
|
-
"minLength": 3,
|
|
393
|
-
"pattern": "^[A-Z]{3}$",
|
|
394
|
-
"type": "string"
|
|
395
|
-
}
|
|
396
|
-
},
|
|
397
|
-
"id": "batch_capture_entry",
|
|
398
|
-
"idPrefix": "batcce",
|
|
399
|
-
"lifecycle": {
|
|
400
|
-
"initial": "created",
|
|
401
|
-
"states": [
|
|
402
|
-
"created",
|
|
403
|
-
"accrued"
|
|
404
|
-
],
|
|
405
|
-
"transitions": {
|
|
406
|
-
"accrue": {
|
|
407
|
-
"from": [
|
|
408
|
-
"created"
|
|
409
|
-
],
|
|
410
|
-
"to": "accrued"
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
},
|
|
414
|
-
"required": [
|
|
415
|
-
"amount",
|
|
416
|
-
"currency",
|
|
417
|
-
"batchId",
|
|
418
|
-
"captureReference"
|
|
419
|
-
],
|
|
420
|
-
"summary": "Gross capture lineage entry",
|
|
421
|
-
"title": "Batch Capture Entry"
|
|
422
|
-
},
|
|
423
|
-
{
|
|
424
|
-
"actionOrder": [
|
|
425
|
-
"create",
|
|
426
|
-
"adjust",
|
|
427
|
-
"correct"
|
|
428
|
-
],
|
|
429
|
-
"actions": {
|
|
430
|
-
"adjust": {
|
|
431
|
-
"agentDescription": "Apply the credit adjustment so calculate counts it. The adjustment must be created and its batch still open. No money moves. The effect shows up in the batch net payable.",
|
|
432
|
-
"effects": {
|
|
433
|
-
"reads": [
|
|
434
|
-
{
|
|
435
|
-
"signature": "reads.requires_refs",
|
|
436
|
-
"source": "requiresRefs"
|
|
437
|
-
}
|
|
438
|
-
]
|
|
439
|
-
},
|
|
440
|
-
"moves": [],
|
|
441
|
-
"publicAction": "adjustBatchCreditAdjustment",
|
|
442
|
-
"requiresRefs": [
|
|
443
|
-
{
|
|
444
|
-
"field": "batchId",
|
|
445
|
-
"match": {
|
|
446
|
-
"fields.currency": "fields.currency"
|
|
447
|
-
},
|
|
448
|
-
"statuses": [
|
|
449
|
-
"open"
|
|
450
|
-
]
|
|
451
|
-
}
|
|
452
|
-
],
|
|
453
|
-
"steps": [],
|
|
454
|
-
"summary": "Apply the credit adjustment to the open batch"
|
|
455
|
-
},
|
|
456
|
-
"correct": {
|
|
457
|
-
"agentDescription": "Apply this adjustment as a correction on the open batch it names. Use it when the batch carrying the original entry has already closed, because a closed batch never changes. The adjustment must be created and no money moves.",
|
|
458
|
-
"effects": {
|
|
459
|
-
"reads": [
|
|
460
|
-
{
|
|
461
|
-
"signature": "reads.requires_refs",
|
|
462
|
-
"source": "requiresRefs"
|
|
463
|
-
}
|
|
464
|
-
]
|
|
465
|
-
},
|
|
466
|
-
"moves": [],
|
|
467
|
-
"publicAction": "correctBatchCreditAdjustment",
|
|
468
|
-
"requiresRefs": [
|
|
469
|
-
{
|
|
470
|
-
"field": "batchId",
|
|
471
|
-
"match": {
|
|
472
|
-
"fields.currency": "fields.currency"
|
|
473
|
-
},
|
|
474
|
-
"statuses": [
|
|
475
|
-
"open"
|
|
476
|
-
]
|
|
477
|
-
}
|
|
478
|
-
],
|
|
479
|
-
"steps": [],
|
|
480
|
-
"summary": "Record a later correction on this open batch instead of changing the closed source batch"
|
|
481
|
-
},
|
|
482
|
-
"create": {
|
|
483
|
-
"agentDescription": "Record a credit adjustment on an open batch, naming the capture reference it corrects. The batch must be open and share the currency. No money moves, and the adjustment counts only once it is applied.",
|
|
484
|
-
"effects": {
|
|
485
|
-
"reads": [
|
|
486
|
-
{
|
|
487
|
-
"signature": "reads.requires_refs",
|
|
488
|
-
"source": "requiresRefs"
|
|
489
|
-
}
|
|
490
|
-
]
|
|
491
|
-
},
|
|
492
|
-
"moves": [],
|
|
493
|
-
"publicAction": "createBatchCreditAdjustment",
|
|
494
|
-
"requiresRefs": [
|
|
495
|
-
{
|
|
496
|
-
"field": "batchId",
|
|
497
|
-
"match": {
|
|
498
|
-
"fields.currency": "fields.currency"
|
|
499
|
-
},
|
|
500
|
-
"statuses": [
|
|
501
|
-
"open"
|
|
502
|
-
]
|
|
503
|
-
}
|
|
504
|
-
],
|
|
505
|
-
"steps": [],
|
|
506
|
-
"summary": "Create a credit adjustment on an open batch"
|
|
507
|
-
}
|
|
508
|
-
},
|
|
509
|
-
"agentDescription": "One credit adjustment against an open batch, carrying the capture reference it corrects. Credit adjustments add to the net payable and debit adjustments subtract from it, so a late correction lands on the current open batch instead of reopening a closed one.",
|
|
510
|
-
"description": "One credit adjustment linked to an open payout batch; closed batches stay unchanged",
|
|
511
|
-
"fields": {
|
|
512
|
-
"adjustmentReference": {
|
|
513
|
-
"description": "Immutable explicit adjustment reference",
|
|
514
|
-
"maxLength": 180,
|
|
515
|
-
"minLength": 1,
|
|
516
|
-
"type": "string"
|
|
517
|
-
},
|
|
518
|
-
"amount": {
|
|
519
|
-
"description": "Credit adjustment amount in minor units",
|
|
520
|
-
"pattern": "^[1-9][0-9]{0,17}$",
|
|
521
|
-
"type": "string"
|
|
522
|
-
},
|
|
523
|
-
"batchId": {
|
|
524
|
-
"description": "Open batch this adjustment applies to",
|
|
525
|
-
"pattern": "^batc_(sandbox|live)_[a-z0-9]{8,64}$",
|
|
526
|
-
"type": "string"
|
|
527
|
-
},
|
|
528
|
-
"captureReference": {
|
|
529
|
-
"description": "Original capture reference that this adjustment corrects",
|
|
530
|
-
"maxLength": 180,
|
|
531
|
-
"minLength": 1,
|
|
532
|
-
"type": "string"
|
|
533
|
-
},
|
|
534
|
-
"currency": {
|
|
535
|
-
"description": "ISO 4217 currency code",
|
|
536
|
-
"maxLength": 3,
|
|
537
|
-
"minLength": 3,
|
|
538
|
-
"pattern": "^[A-Z]{3}$",
|
|
539
|
-
"type": "string"
|
|
540
|
-
},
|
|
541
|
-
"feeReference": {
|
|
542
|
-
"description": "Optional fee entry reference",
|
|
543
|
-
"maxLength": 180,
|
|
544
|
-
"minLength": 1,
|
|
545
|
-
"type": "string"
|
|
546
|
-
},
|
|
547
|
-
"reversalReference": {
|
|
548
|
-
"description": "Optional externally decided reversal reference",
|
|
549
|
-
"maxLength": 180,
|
|
550
|
-
"minLength": 1,
|
|
551
|
-
"type": "string"
|
|
552
|
-
}
|
|
553
|
-
},
|
|
554
|
-
"id": "batch_credit_adjustment",
|
|
555
|
-
"idPrefix": "batcca",
|
|
556
|
-
"lifecycle": {
|
|
557
|
-
"initial": "created",
|
|
558
|
-
"states": [
|
|
559
|
-
"created",
|
|
560
|
-
"applied"
|
|
561
|
-
],
|
|
562
|
-
"transitions": {
|
|
563
|
-
"adjust": {
|
|
564
|
-
"from": [
|
|
565
|
-
"created"
|
|
566
|
-
],
|
|
567
|
-
"to": "applied"
|
|
568
|
-
},
|
|
569
|
-
"correct": {
|
|
570
|
-
"from": [
|
|
571
|
-
"created"
|
|
572
|
-
],
|
|
573
|
-
"to": "applied"
|
|
574
|
-
}
|
|
575
|
-
}
|
|
576
|
-
},
|
|
577
|
-
"required": [
|
|
578
|
-
"amount",
|
|
579
|
-
"currency",
|
|
580
|
-
"adjustmentReference",
|
|
581
|
-
"batchId",
|
|
582
|
-
"captureReference"
|
|
583
|
-
],
|
|
584
|
-
"summary": "Credit adjustment with capture lineage",
|
|
585
|
-
"title": "Batch Credit Adjustment"
|
|
586
|
-
},
|
|
587
|
-
{
|
|
588
|
-
"actionOrder": [
|
|
589
|
-
"create",
|
|
590
|
-
"adjust",
|
|
591
|
-
"correct"
|
|
592
|
-
],
|
|
593
|
-
"actions": {
|
|
594
|
-
"adjust": {
|
|
595
|
-
"agentDescription": "Apply the debit adjustment so calculate counts it. The adjustment must be created and its batch still open. No money moves. The effect shows up in the batch net payable.",
|
|
596
|
-
"effects": {
|
|
597
|
-
"reads": [
|
|
598
|
-
{
|
|
599
|
-
"signature": "reads.requires_refs",
|
|
600
|
-
"source": "requiresRefs"
|
|
601
|
-
}
|
|
602
|
-
]
|
|
603
|
-
},
|
|
604
|
-
"moves": [],
|
|
605
|
-
"publicAction": "adjustBatchDebitAdjustment",
|
|
606
|
-
"requiresRefs": [
|
|
607
|
-
{
|
|
608
|
-
"field": "batchId",
|
|
609
|
-
"match": {
|
|
610
|
-
"fields.currency": "fields.currency"
|
|
611
|
-
},
|
|
612
|
-
"statuses": [
|
|
613
|
-
"open"
|
|
614
|
-
]
|
|
615
|
-
}
|
|
616
|
-
],
|
|
617
|
-
"steps": [],
|
|
618
|
-
"summary": "Apply the debit adjustment to the open batch"
|
|
619
|
-
},
|
|
620
|
-
"correct": {
|
|
621
|
-
"agentDescription": "Apply this adjustment as a correction on the open batch it names. Use it when the batch carrying the original entry has already closed, because a closed batch never changes. The adjustment must be created and no money moves.",
|
|
622
|
-
"effects": {
|
|
623
|
-
"reads": [
|
|
624
|
-
{
|
|
625
|
-
"signature": "reads.requires_refs",
|
|
626
|
-
"source": "requiresRefs"
|
|
627
|
-
}
|
|
628
|
-
]
|
|
629
|
-
},
|
|
630
|
-
"moves": [],
|
|
631
|
-
"publicAction": "correctBatchDebitAdjustment",
|
|
632
|
-
"requiresRefs": [
|
|
633
|
-
{
|
|
634
|
-
"field": "batchId",
|
|
635
|
-
"match": {
|
|
636
|
-
"fields.currency": "fields.currency"
|
|
637
|
-
},
|
|
638
|
-
"statuses": [
|
|
639
|
-
"open"
|
|
640
|
-
]
|
|
641
|
-
}
|
|
642
|
-
],
|
|
643
|
-
"steps": [],
|
|
644
|
-
"summary": "Record a later correction on this open batch instead of changing the closed source batch"
|
|
645
|
-
},
|
|
646
|
-
"create": {
|
|
647
|
-
"agentDescription": "Record a debit adjustment on an open batch, naming the capture reference it corrects. The batch must be open and share the currency. No money moves, and the adjustment counts only once it is applied.",
|
|
648
|
-
"effects": {
|
|
649
|
-
"reads": [
|
|
650
|
-
{
|
|
651
|
-
"signature": "reads.requires_refs",
|
|
652
|
-
"source": "requiresRefs"
|
|
653
|
-
}
|
|
654
|
-
]
|
|
655
|
-
},
|
|
656
|
-
"moves": [],
|
|
657
|
-
"publicAction": "createBatchDebitAdjustment",
|
|
658
|
-
"requiresRefs": [
|
|
659
|
-
{
|
|
660
|
-
"field": "batchId",
|
|
661
|
-
"match": {
|
|
662
|
-
"fields.currency": "fields.currency"
|
|
663
|
-
},
|
|
664
|
-
"statuses": [
|
|
665
|
-
"open"
|
|
666
|
-
]
|
|
667
|
-
}
|
|
668
|
-
],
|
|
669
|
-
"steps": [],
|
|
670
|
-
"summary": "Create a debit adjustment on an open batch"
|
|
671
|
-
}
|
|
672
|
-
},
|
|
673
|
-
"agentDescription": "One debit adjustment against an open batch, carrying the capture reference it corrects. Credit adjustments add to the net payable and debit adjustments subtract from it, so a late correction lands on the current open batch instead of reopening a closed one.",
|
|
674
|
-
"description": "One debit adjustment linked to an open payout batch; closed batches stay unchanged",
|
|
675
|
-
"fields": {
|
|
676
|
-
"adjustmentReference": {
|
|
677
|
-
"description": "Immutable explicit adjustment reference",
|
|
678
|
-
"maxLength": 180,
|
|
679
|
-
"minLength": 1,
|
|
680
|
-
"type": "string"
|
|
681
|
-
},
|
|
682
|
-
"amount": {
|
|
683
|
-
"description": "Debit adjustment amount in minor units",
|
|
684
|
-
"pattern": "^[1-9][0-9]{0,17}$",
|
|
685
|
-
"type": "string"
|
|
686
|
-
},
|
|
687
|
-
"batchId": {
|
|
688
|
-
"description": "Open batch this adjustment applies to",
|
|
689
|
-
"pattern": "^batc_(sandbox|live)_[a-z0-9]{8,64}$",
|
|
690
|
-
"type": "string"
|
|
691
|
-
},
|
|
692
|
-
"captureReference": {
|
|
693
|
-
"description": "Original capture reference that this adjustment corrects",
|
|
694
|
-
"maxLength": 180,
|
|
695
|
-
"minLength": 1,
|
|
696
|
-
"type": "string"
|
|
697
|
-
},
|
|
698
|
-
"currency": {
|
|
699
|
-
"description": "ISO 4217 currency code",
|
|
700
|
-
"maxLength": 3,
|
|
701
|
-
"minLength": 3,
|
|
702
|
-
"pattern": "^[A-Z]{3}$",
|
|
703
|
-
"type": "string"
|
|
704
|
-
},
|
|
705
|
-
"feeReference": {
|
|
706
|
-
"description": "Optional fee entry reference",
|
|
707
|
-
"maxLength": 180,
|
|
708
|
-
"minLength": 1,
|
|
709
|
-
"type": "string"
|
|
710
|
-
},
|
|
711
|
-
"reversalReference": {
|
|
712
|
-
"description": "Optional externally decided reversal reference",
|
|
713
|
-
"maxLength": 180,
|
|
714
|
-
"minLength": 1,
|
|
715
|
-
"type": "string"
|
|
716
|
-
}
|
|
717
|
-
},
|
|
718
|
-
"id": "batch_debit_adjustment",
|
|
719
|
-
"idPrefix": "batcda",
|
|
720
|
-
"lifecycle": {
|
|
721
|
-
"initial": "created",
|
|
722
|
-
"states": [
|
|
723
|
-
"created",
|
|
724
|
-
"applied"
|
|
725
|
-
],
|
|
726
|
-
"transitions": {
|
|
727
|
-
"adjust": {
|
|
728
|
-
"from": [
|
|
729
|
-
"created"
|
|
730
|
-
],
|
|
731
|
-
"to": "applied"
|
|
732
|
-
},
|
|
733
|
-
"correct": {
|
|
734
|
-
"from": [
|
|
735
|
-
"created"
|
|
736
|
-
],
|
|
737
|
-
"to": "applied"
|
|
738
|
-
}
|
|
739
|
-
}
|
|
740
|
-
},
|
|
741
|
-
"required": [
|
|
742
|
-
"amount",
|
|
743
|
-
"currency",
|
|
744
|
-
"adjustmentReference",
|
|
745
|
-
"batchId",
|
|
746
|
-
"captureReference"
|
|
747
|
-
],
|
|
748
|
-
"summary": "Debit adjustment with capture lineage",
|
|
749
|
-
"title": "Batch Debit Adjustment"
|
|
750
|
-
}
|
|
751
|
-
],
|
|
752
|
-
"product": "settlement_batch_example",
|
|
753
|
-
"subjects": [],
|
|
754
|
-
"title": "Settlement batch example",
|
|
755
|
-
"udl": 1,
|
|
756
|
-
"version": 1
|
|
757
|
-
}
|