@fleetless/contracts 9.2.0-next.1 → 10.1.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.
Files changed (37) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/artifacts/openapi.json +18609 -10341
  3. package/artifacts/routes.json +96 -16
  4. package/artifacts/schema/billing-change-response.schema.json +1527 -1727
  5. package/artifacts/schema/billing-decision-amounts.schema.json +244 -0
  6. package/artifacts/schema/billing-decision-display-request.schema.json +24 -0
  7. package/artifacts/schema/billing-decision-display-response.schema.json +3130 -0
  8. package/artifacts/schema/billing-decision-period.schema.json +550 -0
  9. package/artifacts/schema/billing-decision-snapshot.schema.json +3103 -0
  10. package/artifacts/schema/checkout-request.schema.json +3 -4
  11. package/artifacts/schema/checkout-response.schema.json +492 -402
  12. package/artifacts/schema/confirmation-proof.schema.json +6 -0
  13. package/artifacts/schema/plan-change-decision-lookup-query.schema.json +16 -0
  14. package/artifacts/schema/plan-change-decision-status-response.schema.json +543 -0
  15. package/artifacts/schema/plan-change-prepare-request.schema.json +84 -0
  16. package/artifacts/schema/plan-change-prepare-response.schema.json +3162 -0
  17. package/artifacts/schema/plan-change-request.schema.json +177 -65
  18. package/artifacts/schema/purchase-conflict-details.schema.json +94 -0
  19. package/artifacts/schema/purchase-intent-accepted-without-payment.schema.json +95 -0
  20. package/artifacts/schema/purchase-intent-confirm-request.schema.json +146 -33
  21. package/artifacts/schema/purchase-intent-draft.schema.json +449 -0
  22. package/artifacts/schema/purchase-intent-payment-started.schema.json +184 -0
  23. package/artifacts/schema/purchase-intent-response.schema.json +1235 -168
  24. package/dist/billing.d.ts +5665 -210
  25. package/dist/billing.js +224 -29
  26. package/dist/confirmation-proof.d.ts +5 -0
  27. package/dist/confirmation-proof.js +6 -0
  28. package/dist/iana-time-zones.d.ts +2 -0
  29. package/dist/iana-time-zones.js +426 -0
  30. package/dist/index.d.ts +5 -4
  31. package/dist/index.js +3 -2
  32. package/dist/plans.d.ts +125 -1
  33. package/dist/plans.js +19 -1
  34. package/dist/purchase-operation-key.d.ts +4 -0
  35. package/dist/purchase-operation-key.js +4 -0
  36. package/dist/routes.js +42 -21
  37. package/package.json +3 -1
@@ -0,0 +1,449 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "oneOf": [
4
+ {
5
+ "type": "object",
6
+ "properties": {
7
+ "intent_id": {
8
+ "type": "string",
9
+ "format": "uuid",
10
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
11
+ "description": "Opaque persisted purchase intent identity."
12
+ },
13
+ "operation_key": {
14
+ "type": "string",
15
+ "format": "uuid",
16
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
17
+ "description": "Client-generated UUID persisted before the start request. Unique per org and reused only for identical input."
18
+ },
19
+ "operation": {
20
+ "type": "string",
21
+ "enum": [
22
+ "checkout",
23
+ "paid_change",
24
+ "invoice_payment",
25
+ "payment_method_invoice"
26
+ ]
27
+ },
28
+ "invoice_id": {
29
+ "description": "The due charge or issued invoice, for invoice-paying operations.",
30
+ "type": "string",
31
+ "format": "uuid",
32
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
33
+ },
34
+ "state": {
35
+ "type": "string",
36
+ "const": "awaiting_vies"
37
+ },
38
+ "reason": {
39
+ "type": "string",
40
+ "enum": [
41
+ "vies_unavailable",
42
+ "vies_unverified",
43
+ "vies_identifier_missing"
44
+ ]
45
+ },
46
+ "next_attempt_at": {
47
+ "type": "string",
48
+ "format": "date-time",
49
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
50
+ }
51
+ },
52
+ "required": [
53
+ "intent_id",
54
+ "operation_key",
55
+ "operation",
56
+ "state",
57
+ "reason",
58
+ "next_attempt_at"
59
+ ],
60
+ "additionalProperties": false
61
+ },
62
+ {
63
+ "type": "object",
64
+ "properties": {
65
+ "intent_id": {
66
+ "type": "string",
67
+ "format": "uuid",
68
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
69
+ "description": "Opaque persisted purchase intent identity."
70
+ },
71
+ "operation_key": {
72
+ "type": "string",
73
+ "format": "uuid",
74
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
75
+ "description": "Client-generated UUID persisted before the start request. Unique per org and reused only for identical input."
76
+ },
77
+ "operation": {
78
+ "type": "string",
79
+ "enum": [
80
+ "checkout",
81
+ "paid_change",
82
+ "invoice_payment",
83
+ "payment_method_invoice"
84
+ ]
85
+ },
86
+ "invoice_id": {
87
+ "description": "The due charge or issued invoice, for invoice-paying operations.",
88
+ "type": "string",
89
+ "format": "uuid",
90
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
91
+ },
92
+ "quote_revision": {
93
+ "type": "string",
94
+ "minLength": 1,
95
+ "maxLength": 200,
96
+ "description": "Opaque revision of the displayed quote; echo it when confirming."
97
+ },
98
+ "buyer_fingerprint": {
99
+ "type": "string",
100
+ "minLength": 1,
101
+ "maxLength": 200,
102
+ "description": "Opaque revision of buyer details and email policy; never full VIES evidence."
103
+ },
104
+ "state": {
105
+ "type": "string",
106
+ "const": "eligible"
107
+ },
108
+ "quote": {
109
+ "type": "object",
110
+ "properties": {
111
+ "currency": {
112
+ "type": "string",
113
+ "const": "eur",
114
+ "description": "Every new quote is in EUR."
115
+ },
116
+ "net_cents": {
117
+ "type": "integer",
118
+ "minimum": 0,
119
+ "maximum": 9007199254740991,
120
+ "description": "Current charge excluding VAT, in cents."
121
+ },
122
+ "vat_cents": {
123
+ "type": "integer",
124
+ "minimum": 0,
125
+ "maximum": 9007199254740991,
126
+ "description": "VAT on the current charge, in cents."
127
+ },
128
+ "gross_cents": {
129
+ "type": "integer",
130
+ "minimum": 0,
131
+ "maximum": 9007199254740991,
132
+ "description": "Total to confirm, including VAT, in cents."
133
+ },
134
+ "rate_percent": {
135
+ "type": "integer",
136
+ "minimum": 0,
137
+ "maximum": 100,
138
+ "description": "VAT rate in whole percent."
139
+ }
140
+ },
141
+ "required": [
142
+ "currency",
143
+ "net_cents",
144
+ "vat_cents",
145
+ "gross_cents",
146
+ "rate_percent"
147
+ ],
148
+ "additionalProperties": false
149
+ }
150
+ },
151
+ "required": [
152
+ "intent_id",
153
+ "operation_key",
154
+ "operation",
155
+ "quote_revision",
156
+ "buyer_fingerprint",
157
+ "state",
158
+ "quote"
159
+ ],
160
+ "additionalProperties": false
161
+ },
162
+ {
163
+ "type": "object",
164
+ "properties": {
165
+ "intent_id": {
166
+ "type": "string",
167
+ "format": "uuid",
168
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
169
+ "description": "Opaque persisted purchase intent identity."
170
+ },
171
+ "operation_key": {
172
+ "type": "string",
173
+ "format": "uuid",
174
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
175
+ "description": "Client-generated UUID persisted before the start request. Unique per org and reused only for identical input."
176
+ },
177
+ "operation": {
178
+ "type": "string",
179
+ "enum": [
180
+ "checkout",
181
+ "paid_change",
182
+ "invoice_payment",
183
+ "payment_method_invoice",
184
+ "mandate_setup"
185
+ ]
186
+ },
187
+ "invoice_id": {
188
+ "description": "The due charge or issued invoice, for invoice-paying operations.",
189
+ "type": "string",
190
+ "format": "uuid",
191
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
192
+ },
193
+ "state": {
194
+ "type": "string",
195
+ "const": "held"
196
+ },
197
+ "reason": {
198
+ "type": "string",
199
+ "enum": [
200
+ "legacy_usd_invoice",
201
+ "legacy_payer_unresolved",
202
+ "mandate_policy_unresolved",
203
+ "lexware_contact_pending",
204
+ "lexware_contact_changed",
205
+ "issuer_cutover_in_progress",
206
+ "lexware_issuance_paused"
207
+ ]
208
+ },
209
+ "original_amount": {
210
+ "description": "Recorded balance of a held invoice; not a new quote or authorization.",
211
+ "type": "object",
212
+ "properties": {
213
+ "currency": {
214
+ "type": "string",
215
+ "enum": [
216
+ "eur",
217
+ "usd"
218
+ ]
219
+ },
220
+ "gross_cents": {
221
+ "type": "integer",
222
+ "minimum": 0,
223
+ "maximum": 9007199254740991
224
+ }
225
+ },
226
+ "required": [
227
+ "currency",
228
+ "gross_cents"
229
+ ],
230
+ "additionalProperties": false
231
+ }
232
+ },
233
+ "required": [
234
+ "intent_id",
235
+ "operation_key",
236
+ "operation",
237
+ "state",
238
+ "reason"
239
+ ],
240
+ "additionalProperties": false
241
+ },
242
+ {
243
+ "type": "object",
244
+ "properties": {
245
+ "intent_id": {
246
+ "type": "string",
247
+ "format": "uuid",
248
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
249
+ "description": "Opaque persisted purchase intent identity."
250
+ },
251
+ "operation_key": {
252
+ "type": "string",
253
+ "format": "uuid",
254
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
255
+ "description": "Client-generated UUID persisted before the start request. Unique per org and reused only for identical input."
256
+ },
257
+ "operation": {
258
+ "type": "string",
259
+ "enum": [
260
+ "checkout",
261
+ "paid_change",
262
+ "invoice_payment",
263
+ "payment_method_invoice"
264
+ ]
265
+ },
266
+ "invoice_id": {
267
+ "description": "The due charge or issued invoice, for invoice-paying operations.",
268
+ "type": "string",
269
+ "format": "uuid",
270
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
271
+ },
272
+ "state": {
273
+ "type": "string",
274
+ "const": "invalid_vat_id"
275
+ },
276
+ "field": {
277
+ "type": "string",
278
+ "const": "billing.vat_id"
279
+ },
280
+ "rule": {
281
+ "type": "string",
282
+ "const": "vat_id_invalid"
283
+ }
284
+ },
285
+ "required": [
286
+ "intent_id",
287
+ "operation_key",
288
+ "operation",
289
+ "state",
290
+ "field",
291
+ "rule"
292
+ ],
293
+ "additionalProperties": false
294
+ },
295
+ {
296
+ "type": "object",
297
+ "properties": {
298
+ "intent_id": {
299
+ "type": "string",
300
+ "format": "uuid",
301
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
302
+ "description": "Opaque persisted purchase intent identity."
303
+ },
304
+ "operation_key": {
305
+ "type": "string",
306
+ "format": "uuid",
307
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
308
+ "description": "Client-generated UUID persisted before the start request. Unique per org and reused only for identical input."
309
+ },
310
+ "operation": {
311
+ "type": "string",
312
+ "enum": [
313
+ "checkout",
314
+ "paid_change",
315
+ "invoice_payment",
316
+ "payment_method_invoice"
317
+ ]
318
+ },
319
+ "invoice_id": {
320
+ "description": "The due charge or issued invoice, for invoice-paying operations.",
321
+ "type": "string",
322
+ "format": "uuid",
323
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
324
+ },
325
+ "state": {
326
+ "type": "string",
327
+ "const": "refused"
328
+ },
329
+ "field": {
330
+ "type": "string",
331
+ "minLength": 1
332
+ },
333
+ "rule": {
334
+ "type": "string",
335
+ "enum": [
336
+ "company_required",
337
+ "vat_id_required",
338
+ "vat_id_invalid",
339
+ "tax_id_required",
340
+ "us_state_required",
341
+ "public_email_domain",
342
+ "invoice_not_open"
343
+ ]
344
+ }
345
+ },
346
+ "required": [
347
+ "intent_id",
348
+ "operation_key",
349
+ "operation",
350
+ "state",
351
+ "field",
352
+ "rule"
353
+ ],
354
+ "additionalProperties": false
355
+ }
356
+ ],
357
+ "allOf": [
358
+ {
359
+ "if": {
360
+ "properties": {
361
+ "operation": {
362
+ "enum": [
363
+ "invoice_payment",
364
+ "payment_method_invoice"
365
+ ]
366
+ }
367
+ },
368
+ "required": [
369
+ "operation"
370
+ ]
371
+ },
372
+ "then": {
373
+ "required": [
374
+ "invoice_id"
375
+ ]
376
+ }
377
+ },
378
+ {
379
+ "if": {
380
+ "properties": {
381
+ "operation": {
382
+ "const": "mandate_setup"
383
+ }
384
+ },
385
+ "required": [
386
+ "operation"
387
+ ]
388
+ },
389
+ "then": {
390
+ "properties": {
391
+ "state": {
392
+ "const": "held"
393
+ },
394
+ "reason": {
395
+ "const": "mandate_policy_unresolved"
396
+ }
397
+ },
398
+ "required": [
399
+ "reason"
400
+ ]
401
+ }
402
+ },
403
+ {
404
+ "if": {
405
+ "properties": {
406
+ "reason": {
407
+ "const": "mandate_policy_unresolved"
408
+ }
409
+ },
410
+ "required": [
411
+ "reason"
412
+ ]
413
+ },
414
+ "then": {
415
+ "properties": {
416
+ "operation": {
417
+ "const": "mandate_setup"
418
+ }
419
+ }
420
+ }
421
+ },
422
+ {
423
+ "if": {
424
+ "properties": {
425
+ "payment": {
426
+ "properties": {
427
+ "kind": {
428
+ "const": "mandate"
429
+ }
430
+ },
431
+ "required": [
432
+ "kind"
433
+ ]
434
+ }
435
+ },
436
+ "required": [
437
+ "payment"
438
+ ]
439
+ },
440
+ "then": {
441
+ "properties": {
442
+ "operation": {
443
+ "const": "paid_change"
444
+ }
445
+ }
446
+ }
447
+ }
448
+ ]
449
+ }
@@ -0,0 +1,184 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "intent_id": {
6
+ "type": "string",
7
+ "format": "uuid",
8
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
9
+ "description": "Opaque persisted purchase intent identity."
10
+ },
11
+ "operation_key": {
12
+ "type": "string",
13
+ "format": "uuid",
14
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
15
+ "description": "Client-generated UUID persisted before the start request. Unique per org and reused only for identical input."
16
+ },
17
+ "operation": {
18
+ "type": "string",
19
+ "enum": [
20
+ "checkout",
21
+ "paid_change",
22
+ "invoice_payment",
23
+ "payment_method_invoice"
24
+ ]
25
+ },
26
+ "invoice_id": {
27
+ "description": "The due charge or issued invoice, for invoice-paying operations.",
28
+ "type": "string",
29
+ "format": "uuid",
30
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
31
+ },
32
+ "state": {
33
+ "type": "string",
34
+ "const": "payment_started"
35
+ },
36
+ "payment_id": {
37
+ "type": "string",
38
+ "format": "uuid",
39
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
40
+ },
41
+ "payment": {
42
+ "oneOf": [
43
+ {
44
+ "type": "object",
45
+ "properties": {
46
+ "kind": {
47
+ "type": "string",
48
+ "const": "hosted"
49
+ },
50
+ "checkout_id": {
51
+ "type": "string",
52
+ "format": "uuid",
53
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
54
+ },
55
+ "checkout_url": {
56
+ "type": "string",
57
+ "format": "uri"
58
+ }
59
+ },
60
+ "required": [
61
+ "kind",
62
+ "checkout_id",
63
+ "checkout_url"
64
+ ],
65
+ "additionalProperties": false
66
+ },
67
+ {
68
+ "type": "object",
69
+ "properties": {
70
+ "kind": {
71
+ "type": "string",
72
+ "const": "mandate"
73
+ }
74
+ },
75
+ "required": [
76
+ "kind"
77
+ ],
78
+ "additionalProperties": false
79
+ }
80
+ ]
81
+ }
82
+ },
83
+ "required": [
84
+ "intent_id",
85
+ "operation_key",
86
+ "operation",
87
+ "state",
88
+ "payment_id",
89
+ "payment"
90
+ ],
91
+ "additionalProperties": false,
92
+ "allOf": [
93
+ {
94
+ "if": {
95
+ "properties": {
96
+ "operation": {
97
+ "enum": [
98
+ "invoice_payment",
99
+ "payment_method_invoice"
100
+ ]
101
+ }
102
+ },
103
+ "required": [
104
+ "operation"
105
+ ]
106
+ },
107
+ "then": {
108
+ "required": [
109
+ "invoice_id"
110
+ ]
111
+ }
112
+ },
113
+ {
114
+ "if": {
115
+ "properties": {
116
+ "operation": {
117
+ "const": "mandate_setup"
118
+ }
119
+ },
120
+ "required": [
121
+ "operation"
122
+ ]
123
+ },
124
+ "then": {
125
+ "properties": {
126
+ "state": {
127
+ "const": "held"
128
+ },
129
+ "reason": {
130
+ "const": "mandate_policy_unresolved"
131
+ }
132
+ },
133
+ "required": [
134
+ "reason"
135
+ ]
136
+ }
137
+ },
138
+ {
139
+ "if": {
140
+ "properties": {
141
+ "reason": {
142
+ "const": "mandate_policy_unresolved"
143
+ }
144
+ },
145
+ "required": [
146
+ "reason"
147
+ ]
148
+ },
149
+ "then": {
150
+ "properties": {
151
+ "operation": {
152
+ "const": "mandate_setup"
153
+ }
154
+ }
155
+ }
156
+ },
157
+ {
158
+ "if": {
159
+ "properties": {
160
+ "payment": {
161
+ "properties": {
162
+ "kind": {
163
+ "const": "mandate"
164
+ }
165
+ },
166
+ "required": [
167
+ "kind"
168
+ ]
169
+ }
170
+ },
171
+ "required": [
172
+ "payment"
173
+ ]
174
+ },
175
+ "then": {
176
+ "properties": {
177
+ "operation": {
178
+ "const": "paid_change"
179
+ }
180
+ }
181
+ }
182
+ }
183
+ ]
184
+ }