@almadar/std 14.26.0 → 14.28.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 (175) hide show
  1. package/behaviors/registry/app/atoms/std-applicant.orb +496 -42
  2. package/behaviors/registry/app/atoms/std-approval-chain.orb +106 -0
  3. package/behaviors/registry/app/atoms/std-approval-request.orb +433 -593
  4. package/behaviors/registry/app/atoms/std-campaign-goal.orb +438 -228
  5. package/behaviors/registry/app/atoms/std-change-order.orb +565 -307
  6. package/behaviors/registry/app/atoms/std-chart-of-accounts.orb +434 -97
  7. package/behaviors/registry/app/atoms/std-checkin.orb +434 -270
  8. package/behaviors/registry/app/atoms/std-class-roster.orb +495 -61
  9. package/behaviors/registry/app/atoms/std-class-session.orb +485 -104
  10. package/behaviors/registry/app/atoms/std-court-deadline.orb +519 -88
  11. package/behaviors/registry/app/atoms/std-customer-account.orb +577 -97
  12. package/behaviors/registry/app/atoms/std-donation-receipt.orb +498 -55
  13. package/behaviors/registry/app/atoms/std-donor.orb +445 -135
  14. package/behaviors/registry/app/atoms/std-drip-sequence.orb +445 -62
  15. package/behaviors/registry/app/atoms/std-driver.orb +465 -480
  16. package/behaviors/registry/app/atoms/std-dunning.orb +450 -512
  17. package/behaviors/registry/app/atoms/std-email-broadcast.orb +517 -64
  18. package/behaviors/registry/app/atoms/std-event.orb +465 -667
  19. package/behaviors/registry/app/atoms/std-health-score.orb +368 -371
  20. package/behaviors/registry/app/atoms/std-help-article.orb +373 -506
  21. package/behaviors/registry/app/atoms/std-help-category.orb +344 -359
  22. package/behaviors/registry/app/atoms/std-interview-slot.orb +490 -48
  23. package/behaviors/registry/app/atoms/std-invoice.orb +494 -291
  24. package/behaviors/registry/app/atoms/std-kitchen-display.orb +588 -96
  25. package/behaviors/registry/app/atoms/std-lease.orb +506 -190
  26. package/behaviors/registry/app/atoms/std-ledger-entry.orb +483 -154
  27. package/behaviors/registry/app/atoms/std-maintenance-request.orb +642 -192
  28. package/behaviors/registry/app/atoms/std-matter.orb +486 -318
  29. package/behaviors/registry/app/atoms/std-membership.orb +512 -102
  30. package/behaviors/registry/app/atoms/std-menu.orb +775 -183
  31. package/behaviors/registry/app/atoms/std-modifier-group.orb +522 -104
  32. package/behaviors/registry/app/atoms/std-multi-party-transaction.orb +130 -0
  33. package/behaviors/registry/app/atoms/std-nps-survey.orb +319 -327
  34. package/behaviors/registry/app/atoms/std-offer-letter.orb +497 -47
  35. package/behaviors/registry/app/atoms/std-payout-ledger.orb +378 -362
  36. package/behaviors/registry/app/atoms/std-pipeline.orb +139 -0
  37. package/behaviors/registry/app/atoms/std-question-bank.orb +379 -346
  38. package/behaviors/registry/app/atoms/std-receipt.orb +553 -44
  39. package/behaviors/registry/app/atoms/std-recurring-charge.orb +419 -832
  40. package/behaviors/registry/app/atoms/std-recurring-schedule.orb +94 -0
  41. package/behaviors/registry/app/atoms/std-renewal-risk.orb +370 -421
  42. package/behaviors/registry/app/atoms/std-rent-charge.orb +657 -55
  43. package/behaviors/registry/app/atoms/std-reorder-rule.orb +510 -59
  44. package/behaviors/registry/app/atoms/std-response-collector.orb +451 -144
  45. package/behaviors/registry/app/atoms/std-rfi.orb +502 -461
  46. package/behaviors/registry/app/atoms/std-route-optimize.orb +448 -158
  47. package/behaviors/registry/app/atoms/std-segment.orb +360 -98
  48. package/behaviors/registry/app/atoms/std-stock-level.orb +486 -103
  49. package/behaviors/registry/app/atoms/std-submittal.orb +538 -526
  50. package/behaviors/registry/app/atoms/std-table-map.orb +88 -51
  51. package/behaviors/registry/app/atoms/std-technician-dispatch.orb +653 -71
  52. package/behaviors/registry/app/atoms/std-telematics-event.orb +310 -215
  53. package/behaviors/registry/app/atoms/std-template-editor.orb +513 -90
  54. package/behaviors/registry/app/atoms/std-tenant.orb +525 -66
  55. package/behaviors/registry/app/atoms/std-ticket-tier.orb +472 -460
  56. package/behaviors/registry/app/atoms/std-time-entry.orb +354 -317
  57. package/behaviors/registry/app/atoms/std-timeline.orb +108 -0
  58. package/behaviors/registry/app/atoms/std-timesheet.orb +551 -284
  59. package/behaviors/registry/app/atoms/std-trial.orb +410 -317
  60. package/behaviors/registry/app/atoms/std-vehicle.orb +398 -563
  61. package/behaviors/registry/app/atoms/std-waitlist.orb +372 -283
  62. package/behaviors/registry/app/atoms/std-warehouse.orb +273 -214
  63. package/behaviors/registry/app/atoms/std-wizard-branching.orb +129 -0
  64. package/behaviors/registry/app/atoms/std-work-order.orb +628 -240
  65. package/behaviors/registry/app/molecules/std-applicant-form.orb +89 -83
  66. package/behaviors/registry/app/molecules/std-application.orb +178 -263
  67. package/behaviors/registry/app/molecules/std-broadcast-builder.orb +67 -176
  68. package/behaviors/registry/app/molecules/std-cart.orb +78 -72
  69. package/behaviors/registry/app/molecules/std-form-builder.orb +437 -176
  70. package/behaviors/registry/app/molecules/std-ledger-entry-form.orb +608 -89
  71. package/behaviors/registry/app/molecules/std-stock-adjustment.orb +501 -102
  72. package/behaviors/registry/app/molecules/std-vendor-onboarding.orb +383 -469
  73. package/behaviors/registry/core/atoms/std-billable-hour.orb +495 -91
  74. package/behaviors/registry/core/atoms/std-board.orb +1367 -0
  75. package/behaviors/registry/core/atoms/std-branching-logic.orb +271 -600
  76. package/behaviors/registry/core/atoms/std-event-log.orb +777 -0
  77. package/behaviors/registry/core/atoms/std-file-store.orb +534 -164
  78. package/behaviors/registry/core/atoms/std-gallery.orb +118 -101
  79. package/behaviors/registry/core/atoms/std-image-upload-multi.orb +87 -57
  80. package/behaviors/registry/core/atoms/std-multi-party-flow.orb +1313 -0
  81. package/behaviors/registry/core/atoms/std-page-tree.orb +342 -484
  82. package/behaviors/registry/core/atoms/std-recurrence.orb +937 -0
  83. package/behaviors/registry/core/atoms/std-rich-editor.orb +288 -416
  84. package/behaviors/registry/core/atoms/std-step-flow.orb +1155 -0
  85. package/behaviors/registry/core/atoms/std-version-history.orb +454 -430
  86. package/behaviors/registry/core/atoms/std-wizard.orb +1085 -0
  87. package/behaviors/registry/core/molecules/std-wizard-form.orb +222 -147
  88. package/dist/behaviors/registry/app/atoms/std-applicant.orb +496 -42
  89. package/dist/behaviors/registry/app/atoms/std-approval-chain.orb +106 -0
  90. package/dist/behaviors/registry/app/atoms/std-approval-request.orb +433 -593
  91. package/dist/behaviors/registry/app/atoms/std-campaign-goal.orb +438 -228
  92. package/dist/behaviors/registry/app/atoms/std-change-order.orb +565 -307
  93. package/dist/behaviors/registry/app/atoms/std-chart-of-accounts.orb +434 -97
  94. package/dist/behaviors/registry/app/atoms/std-checkin.orb +434 -270
  95. package/dist/behaviors/registry/app/atoms/std-class-roster.orb +495 -61
  96. package/dist/behaviors/registry/app/atoms/std-class-session.orb +485 -104
  97. package/dist/behaviors/registry/app/atoms/std-court-deadline.orb +519 -88
  98. package/dist/behaviors/registry/app/atoms/std-customer-account.orb +577 -97
  99. package/dist/behaviors/registry/app/atoms/std-donation-receipt.orb +498 -55
  100. package/dist/behaviors/registry/app/atoms/std-donor.orb +445 -135
  101. package/dist/behaviors/registry/app/atoms/std-drip-sequence.orb +445 -62
  102. package/dist/behaviors/registry/app/atoms/std-driver.orb +465 -480
  103. package/dist/behaviors/registry/app/atoms/std-dunning.orb +450 -512
  104. package/dist/behaviors/registry/app/atoms/std-email-broadcast.orb +517 -64
  105. package/dist/behaviors/registry/app/atoms/std-event.orb +465 -667
  106. package/dist/behaviors/registry/app/atoms/std-health-score.orb +368 -371
  107. package/dist/behaviors/registry/app/atoms/std-help-article.orb +373 -506
  108. package/dist/behaviors/registry/app/atoms/std-help-category.orb +344 -359
  109. package/dist/behaviors/registry/app/atoms/std-interview-slot.orb +490 -48
  110. package/dist/behaviors/registry/app/atoms/std-invoice.orb +494 -291
  111. package/dist/behaviors/registry/app/atoms/std-kitchen-display.orb +588 -96
  112. package/dist/behaviors/registry/app/atoms/std-lease.orb +506 -190
  113. package/dist/behaviors/registry/app/atoms/std-ledger-entry.orb +483 -154
  114. package/dist/behaviors/registry/app/atoms/std-maintenance-request.orb +642 -192
  115. package/dist/behaviors/registry/app/atoms/std-matter.orb +486 -318
  116. package/dist/behaviors/registry/app/atoms/std-membership.orb +512 -102
  117. package/dist/behaviors/registry/app/atoms/std-menu.orb +775 -183
  118. package/dist/behaviors/registry/app/atoms/std-modifier-group.orb +522 -104
  119. package/dist/behaviors/registry/app/atoms/std-multi-party-transaction.orb +130 -0
  120. package/dist/behaviors/registry/app/atoms/std-nps-survey.orb +319 -327
  121. package/dist/behaviors/registry/app/atoms/std-offer-letter.orb +497 -47
  122. package/dist/behaviors/registry/app/atoms/std-payout-ledger.orb +378 -362
  123. package/dist/behaviors/registry/app/atoms/std-pipeline.orb +139 -0
  124. package/dist/behaviors/registry/app/atoms/std-question-bank.orb +379 -346
  125. package/dist/behaviors/registry/app/atoms/std-receipt.orb +553 -44
  126. package/dist/behaviors/registry/app/atoms/std-recurring-charge.orb +419 -832
  127. package/dist/behaviors/registry/app/atoms/std-recurring-schedule.orb +94 -0
  128. package/dist/behaviors/registry/app/atoms/std-renewal-risk.orb +370 -421
  129. package/dist/behaviors/registry/app/atoms/std-rent-charge.orb +657 -55
  130. package/dist/behaviors/registry/app/atoms/std-reorder-rule.orb +510 -59
  131. package/dist/behaviors/registry/app/atoms/std-response-collector.orb +451 -144
  132. package/dist/behaviors/registry/app/atoms/std-rfi.orb +502 -461
  133. package/dist/behaviors/registry/app/atoms/std-route-optimize.orb +448 -158
  134. package/dist/behaviors/registry/app/atoms/std-segment.orb +360 -98
  135. package/dist/behaviors/registry/app/atoms/std-stock-level.orb +486 -103
  136. package/dist/behaviors/registry/app/atoms/std-submittal.orb +538 -526
  137. package/dist/behaviors/registry/app/atoms/std-table-map.orb +88 -51
  138. package/dist/behaviors/registry/app/atoms/std-technician-dispatch.orb +653 -71
  139. package/dist/behaviors/registry/app/atoms/std-telematics-event.orb +310 -215
  140. package/dist/behaviors/registry/app/atoms/std-template-editor.orb +513 -90
  141. package/dist/behaviors/registry/app/atoms/std-tenant.orb +525 -66
  142. package/dist/behaviors/registry/app/atoms/std-ticket-tier.orb +472 -460
  143. package/dist/behaviors/registry/app/atoms/std-time-entry.orb +354 -317
  144. package/dist/behaviors/registry/app/atoms/std-timeline.orb +108 -0
  145. package/dist/behaviors/registry/app/atoms/std-timesheet.orb +551 -284
  146. package/dist/behaviors/registry/app/atoms/std-trial.orb +410 -317
  147. package/dist/behaviors/registry/app/atoms/std-vehicle.orb +398 -563
  148. package/dist/behaviors/registry/app/atoms/std-waitlist.orb +372 -283
  149. package/dist/behaviors/registry/app/atoms/std-warehouse.orb +273 -214
  150. package/dist/behaviors/registry/app/atoms/std-wizard-branching.orb +129 -0
  151. package/dist/behaviors/registry/app/atoms/std-work-order.orb +628 -240
  152. package/dist/behaviors/registry/app/molecules/std-applicant-form.orb +89 -83
  153. package/dist/behaviors/registry/app/molecules/std-application.orb +178 -263
  154. package/dist/behaviors/registry/app/molecules/std-broadcast-builder.orb +67 -176
  155. package/dist/behaviors/registry/app/molecules/std-cart.orb +78 -72
  156. package/dist/behaviors/registry/app/molecules/std-form-builder.orb +437 -176
  157. package/dist/behaviors/registry/app/molecules/std-ledger-entry-form.orb +608 -89
  158. package/dist/behaviors/registry/app/molecules/std-stock-adjustment.orb +501 -102
  159. package/dist/behaviors/registry/app/molecules/std-vendor-onboarding.orb +383 -469
  160. package/dist/behaviors/registry/core/atoms/std-billable-hour.orb +495 -91
  161. package/dist/behaviors/registry/core/atoms/std-board.orb +1367 -0
  162. package/dist/behaviors/registry/core/atoms/std-branching-logic.orb +271 -600
  163. package/dist/behaviors/registry/core/atoms/std-event-log.orb +777 -0
  164. package/dist/behaviors/registry/core/atoms/std-file-store.orb +534 -164
  165. package/dist/behaviors/registry/core/atoms/std-gallery.orb +118 -101
  166. package/dist/behaviors/registry/core/atoms/std-image-upload-multi.orb +87 -57
  167. package/dist/behaviors/registry/core/atoms/std-multi-party-flow.orb +1313 -0
  168. package/dist/behaviors/registry/core/atoms/std-page-tree.orb +342 -484
  169. package/dist/behaviors/registry/core/atoms/std-recurrence.orb +937 -0
  170. package/dist/behaviors/registry/core/atoms/std-rich-editor.orb +288 -416
  171. package/dist/behaviors/registry/core/atoms/std-step-flow.orb +1155 -0
  172. package/dist/behaviors/registry/core/atoms/std-version-history.orb +454 -430
  173. package/dist/behaviors/registry/core/atoms/std-wizard.orb +1085 -0
  174. package/dist/behaviors/registry/core/molecules/std-wizard-form.orb +222 -147
  175. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "std-recurring-charge",
3
3
  "version": "1.0.0",
4
- "description": "std-recurring-charge — subscription cycle clock with retry policy and inline proration math. Owns a Subscription entity; CHARGE invokes the stripe-charge service, PRORATE adjusts amount inline by daysIntoPeriod, CANCEL flips status. Persists results back to the row and emits SubscriptionUpdated for downstream listeners.",
4
+ "description": "std-recurring-charge — subscription cycle clock. Lists subscriptions in `browsing`; opens detail in `viewing_single` with Charge / Cancel actions.",
5
5
  "orbitals": [
6
6
  {
7
7
  "name": "SubscriptionOrbital",
@@ -93,10 +93,10 @@
93
93
  "linkedEntity": "Subscription",
94
94
  "emits": [
95
95
  {
96
- "event": "CHARGE",
96
+ "event": "OPEN_SUBSCRIPTION",
97
97
  "payloadSchema": [
98
98
  {
99
- "name": "subscriptionId",
99
+ "name": "id",
100
100
  "type": "string",
101
101
  "required": true
102
102
  },
@@ -162,81 +162,15 @@
162
162
  ]
163
163
  },
164
164
  {
165
- "event": "PRORATE",
165
+ "event": "CLOSE_VIEW"
166
+ },
167
+ {
168
+ "event": "CHARGE",
166
169
  "payloadSchema": [
167
170
  {
168
- "name": "subscriptionId",
169
- "type": "string",
170
- "required": true
171
- },
172
- {
173
- "name": "newPlanId",
174
- "type": "string",
175
- "required": true
176
- },
177
- {
178
- "name": "daysIntoPeriod",
179
- "type": "number",
180
- "required": true
181
- },
182
- {
183
- "name": "row.id",
184
- "type": "string",
185
- "required": true
186
- },
187
- {
188
- "name": "row.customerId",
189
- "type": "string",
190
- "required": true
191
- },
192
- {
193
- "name": "row.planId",
171
+ "name": "id",
194
172
  "type": "string",
195
173
  "required": true
196
- },
197
- {
198
- "name": "row.status",
199
- "type": "string"
200
- },
201
- {
202
- "name": "row.amount",
203
- "type": "number"
204
- },
205
- {
206
- "name": "row.currency",
207
- "type": "string"
208
- },
209
- {
210
- "name": "row.interval",
211
- "type": "string"
212
- },
213
- {
214
- "name": "row.currentPeriodStart",
215
- "type": "string"
216
- },
217
- {
218
- "name": "row.currentPeriodEnd",
219
- "type": "string"
220
- },
221
- {
222
- "name": "row.nextBillingAt",
223
- "type": "string"
224
- },
225
- {
226
- "name": "row.attemptCount",
227
- "type": "number"
228
- },
229
- {
230
- "name": "row.lastChargeAt",
231
- "type": "string"
232
- },
233
- {
234
- "name": "row.cancelledAt",
235
- "type": "string"
236
- },
237
- {
238
- "name": "row.createdAt",
239
- "type": "string"
240
174
  }
241
175
  ]
242
176
  },
@@ -244,73 +178,9 @@
244
178
  "event": "CANCEL",
245
179
  "payloadSchema": [
246
180
  {
247
- "name": "subscriptionId",
248
- "type": "string",
249
- "required": true
250
- },
251
- {
252
- "name": "cancelledAt",
253
- "type": "string",
254
- "required": true
255
- },
256
- {
257
- "name": "row.id",
258
- "type": "string",
259
- "required": true
260
- },
261
- {
262
- "name": "row.customerId",
263
- "type": "string",
264
- "required": true
265
- },
266
- {
267
- "name": "row.planId",
181
+ "name": "id",
268
182
  "type": "string",
269
183
  "required": true
270
- },
271
- {
272
- "name": "row.status",
273
- "type": "string"
274
- },
275
- {
276
- "name": "row.amount",
277
- "type": "number"
278
- },
279
- {
280
- "name": "row.currency",
281
- "type": "string"
282
- },
283
- {
284
- "name": "row.interval",
285
- "type": "string"
286
- },
287
- {
288
- "name": "row.currentPeriodStart",
289
- "type": "string"
290
- },
291
- {
292
- "name": "row.currentPeriodEnd",
293
- "type": "string"
294
- },
295
- {
296
- "name": "row.nextBillingAt",
297
- "type": "string"
298
- },
299
- {
300
- "name": "row.attemptCount",
301
- "type": "number"
302
- },
303
- {
304
- "name": "row.lastChargeAt",
305
- "type": "string"
306
- },
307
- {
308
- "name": "row.cancelledAt",
309
- "type": "string"
310
- },
311
- {
312
- "name": "row.createdAt",
313
- "type": "string"
314
184
  }
315
185
  ]
316
186
  },
@@ -335,147 +205,6 @@
335
205
  "type": "string"
336
206
  }
337
207
  ]
338
- },
339
- {
340
- "event": "ChargeSucceeded",
341
- "payloadSchema": [
342
- {
343
- "name": "row.id",
344
- "type": "string",
345
- "required": true
346
- },
347
- {
348
- "name": "row.customerId",
349
- "type": "string",
350
- "required": true
351
- },
352
- {
353
- "name": "row.planId",
354
- "type": "string",
355
- "required": true
356
- },
357
- {
358
- "name": "row.status",
359
- "type": "string"
360
- },
361
- {
362
- "name": "row.amount",
363
- "type": "number"
364
- },
365
- {
366
- "name": "row.currency",
367
- "type": "string"
368
- },
369
- {
370
- "name": "row.interval",
371
- "type": "string"
372
- },
373
- {
374
- "name": "row.currentPeriodStart",
375
- "type": "string"
376
- },
377
- {
378
- "name": "row.currentPeriodEnd",
379
- "type": "string"
380
- },
381
- {
382
- "name": "row.nextBillingAt",
383
- "type": "string"
384
- },
385
- {
386
- "name": "row.attemptCount",
387
- "type": "number"
388
- },
389
- {
390
- "name": "row.lastChargeAt",
391
- "type": "string"
392
- },
393
- {
394
- "name": "row.cancelledAt",
395
- "type": "string"
396
- },
397
- {
398
- "name": "row.createdAt",
399
- "type": "string"
400
- }
401
- ]
402
- },
403
- {
404
- "event": "ChargeFailed",
405
- "payloadSchema": [
406
- {
407
- "name": "error",
408
- "type": "string"
409
- },
410
- {
411
- "name": "code",
412
- "type": "string"
413
- }
414
- ]
415
- },
416
- {
417
- "event": "SubscriptionUpdated",
418
- "payloadSchema": [
419
- {
420
- "name": "row.id",
421
- "type": "string",
422
- "required": true
423
- },
424
- {
425
- "name": "row.customerId",
426
- "type": "string",
427
- "required": true
428
- },
429
- {
430
- "name": "row.planId",
431
- "type": "string",
432
- "required": true
433
- },
434
- {
435
- "name": "row.status",
436
- "type": "string"
437
- },
438
- {
439
- "name": "row.amount",
440
- "type": "number"
441
- },
442
- {
443
- "name": "row.currency",
444
- "type": "string"
445
- },
446
- {
447
- "name": "row.interval",
448
- "type": "string"
449
- },
450
- {
451
- "name": "row.currentPeriodStart",
452
- "type": "string"
453
- },
454
- {
455
- "name": "row.currentPeriodEnd",
456
- "type": "string"
457
- },
458
- {
459
- "name": "row.nextBillingAt",
460
- "type": "string"
461
- },
462
- {
463
- "name": "row.attemptCount",
464
- "type": "number"
465
- },
466
- {
467
- "name": "row.lastChargeAt",
468
- "type": "string"
469
- },
470
- {
471
- "name": "row.cancelledAt",
472
- "type": "string"
473
- },
474
- {
475
- "name": "row.createdAt",
476
- "type": "string"
477
- }
478
- ]
479
208
  }
480
209
  ],
481
210
  "stateMachine": {
@@ -488,7 +217,7 @@
488
217
  "name": "browsing"
489
218
  },
490
219
  {
491
- "name": "charging"
220
+ "name": "viewing_single"
492
221
  },
493
222
  {
494
223
  "name": "error"
@@ -524,11 +253,11 @@
524
253
  ]
525
254
  },
526
255
  {
527
- "key": "CHARGE",
528
- "name": "Charge",
256
+ "key": "OPEN_SUBSCRIPTION",
257
+ "name": "Open Subscription",
529
258
  "payloadSchema": [
530
259
  {
531
- "name": "subscriptionId",
260
+ "name": "id",
532
261
  "type": "string",
533
262
  "required": true
534
263
  },
@@ -539,27 +268,13 @@
539
268
  ]
540
269
  },
541
270
  {
542
- "key": "PRORATE",
543
- "name": "Prorate",
271
+ "key": "CHARGE",
272
+ "name": "Charge",
544
273
  "payloadSchema": [
545
274
  {
546
- "name": "subscriptionId",
275
+ "name": "id",
547
276
  "type": "string",
548
277
  "required": true
549
- },
550
- {
551
- "name": "newPlanId",
552
- "type": "string",
553
- "required": true
554
- },
555
- {
556
- "name": "daysIntoPeriod",
557
- "type": "number",
558
- "required": true
559
- },
560
- {
561
- "name": "row",
562
- "type": "Subscription"
563
278
  }
564
279
  ]
565
280
  },
@@ -568,54 +283,15 @@
568
283
  "name": "Cancel",
569
284
  "payloadSchema": [
570
285
  {
571
- "name": "subscriptionId",
572
- "type": "string",
573
- "required": true
574
- },
575
- {
576
- "name": "cancelledAt",
286
+ "name": "id",
577
287
  "type": "string",
578
288
  "required": true
579
- },
580
- {
581
- "name": "row",
582
- "type": "Subscription"
583
- }
584
- ]
585
- },
586
- {
587
- "key": "SubscriptionUpdated",
588
- "name": "Subscription updated",
589
- "payloadSchema": [
590
- {
591
- "name": "row",
592
- "type": "Subscription"
593
- }
594
- ]
595
- },
596
- {
597
- "key": "ChargeSucceeded",
598
- "name": "Charge succeeded",
599
- "payloadSchema": [
600
- {
601
- "name": "row",
602
- "type": "Subscription"
603
289
  }
604
290
  ]
605
291
  },
606
292
  {
607
- "key": "ChargeFailed",
608
- "name": "Charge failed",
609
- "payloadSchema": [
610
- {
611
- "name": "error",
612
- "type": "string"
613
- },
614
- {
615
- "name": "code",
616
- "type": "string"
617
- }
618
- ]
293
+ "key": "CLOSE_VIEW",
294
+ "name": "Close View"
619
295
  }
620
296
  ],
621
297
  "transitions": [
@@ -629,8 +305,8 @@
629
305
  "Subscription",
630
306
  {
631
307
  "emit": {
632
- "failure": "SubscriptionLoadFailed",
633
- "success": "SubscriptionLoaded"
308
+ "success": "SubscriptionLoaded",
309
+ "failure": "SubscriptionLoadFailed"
634
310
  }
635
311
  }
636
312
  ],
@@ -638,20 +314,20 @@
638
314
  "render-ui",
639
315
  "main",
640
316
  {
641
- "type": "stack",
642
317
  "gap": "md",
318
+ "type": "stack",
319
+ "direction": "vertical",
643
320
  "align": "center",
644
321
  "className": "py-12",
645
- "direction": "vertical",
646
322
  "children": [
647
323
  {
648
324
  "type": "spinner"
649
325
  },
650
326
  {
651
- "variant": "caption",
652
327
  "type": "typography",
653
- "color": "muted",
654
- "content": "Loading subscriptions…"
328
+ "variant": "caption",
329
+ "content": "Loading subscriptions…",
330
+ "color": "muted"
655
331
  }
656
332
  ]
657
333
  }
@@ -667,25 +343,7 @@
667
343
  "render-ui",
668
344
  "main",
669
345
  {
670
- "gap": "md",
671
- "type": "stack",
672
346
  "children": [
673
- {
674
- "items": [
675
- {
676
- "href": "/billing",
677
- "label": "Billing"
678
- },
679
- {
680
- "href": "/plans",
681
- "label": "Plans"
682
- },
683
- {
684
- "label": "@config.title"
685
- }
686
- ],
687
- "type": "breadcrumb"
688
- },
689
347
  {
690
348
  "children": [
691
349
  {
@@ -694,116 +352,53 @@
694
352
  },
695
353
  {
696
354
  "variant": "h3",
697
- "type": "typography",
698
- "content": "@config.title"
355
+ "content": "@config.title",
356
+ "type": "typography"
699
357
  }
700
358
  ],
701
- "direction": "horizontal",
702
359
  "gap": "sm",
703
- "type": "stack"
704
- },
705
- {
706
- "type": "divider"
360
+ "type": "stack",
361
+ "direction": "horizontal",
362
+ "align": "center"
707
363
  },
708
364
  {
709
- "type": "pricing-grid",
710
- "plans": [
365
+ "cols": 4.0,
366
+ "type": "simple-grid",
367
+ "children": [
711
368
  {
712
- "name": "Starter",
713
- "description": "For solo accounts getting started",
714
- "features": [
715
- "Ten thousand events",
716
- "Email support",
717
- "One seat"
718
- ],
719
- "action": {
720
- "label": "Choose Starter",
721
- "href": "#"
722
- },
723
- "price": "$9"
369
+ "value": "@payload.data.length",
370
+ "label": "Total subscriptions",
371
+ "icon": "repeat",
372
+ "type": "stat-display"
724
373
  },
725
374
  {
726
- "description": "For growing teams who need headroom",
727
- "name": "Team",
728
- "features": [
729
- "Hundred thousand events",
730
- "Priority support",
731
- "Ten seats"
732
- ],
733
- "action": {
734
- "label": "Choose Team",
735
- "href": "#"
736
- },
737
- "price": "$29",
738
- "highlighted": true
375
+ "type": "stat-display",
376
+ "value": "248",
377
+ "label": "Active",
378
+ "icon": "check-circle"
739
379
  },
740
380
  {
741
- "name": "Scale",
742
- "features": [
743
- "One million events",
744
- "Round the clock support",
745
- "Unlimited seats"
746
- ],
747
- "action": {
748
- "label": "Choose Scale",
749
- "href": "#"
750
- },
751
- "description": "High-volume usage with SLA",
752
- "price": "$99"
753
- }
754
- ]
755
- },
756
- {
757
- "direction": "horizontal",
758
- "type": "stack",
759
- "align": "center",
760
- "gap": "md",
761
- "children": [
762
- {
763
- "max": 100.0,
764
- "variant": "linear",
765
- "type": "meter",
766
- "showValue": true,
767
- "label": "Usage this period",
768
- "min": 0.0,
769
- "unit": "%",
770
- "value": 68.0
381
+ "value": "$18,400",
382
+ "icon": "dollar-sign",
383
+ "label": "MRR",
384
+ "type": "stat-display"
771
385
  },
772
386
  {
773
- "variant": "segmented",
774
- "value": 4.0,
775
- "segments": 4.0,
776
- "max": 4.0,
777
- "label": "Retries",
778
- "type": "meter",
779
- "showValue": true,
780
- "min": 0.0
387
+ "value": "7",
388
+ "label": "Past due",
389
+ "type": "stat-display",
390
+ "icon": "alert-triangle"
781
391
  }
782
392
  ]
783
393
  },
784
394
  {
785
- "itemActions": [
786
- {
787
- "variant": "primary",
788
- "icon": "credit-card",
789
- "label": "Charge",
790
- "event": "CHARGE"
791
- },
792
- {
793
- "icon": "calculator",
794
- "event": "PRORATE",
795
- "label": "Prorate",
796
- "variant": "secondary"
797
- },
798
- {
799
- "label": "Cancel",
800
- "variant": "danger",
801
- "icon": "x",
802
- "event": "CANCEL"
803
- }
804
- ],
805
- "entity": "@payload.data",
395
+ "type": "divider"
396
+ },
397
+ {
806
398
  "type": "data-grid",
399
+ "gap": "sm",
400
+ "cols": 1.0,
401
+ "entity": "@payload.data",
807
402
  "fields": [
808
403
  {
809
404
  "name": "customerId",
@@ -812,23 +407,18 @@
812
407
  },
813
408
  {
814
409
  "label": "Plan",
815
- "variant": "caption",
816
- "name": "planId"
410
+ "name": "planId",
411
+ "variant": "caption"
817
412
  },
818
413
  {
819
414
  "variant": "badge",
820
- "name": "status",
821
- "label": "Status"
822
- },
823
- {
824
- "variant": "caption",
825
- "label": "Amount",
826
- "name": "amount"
415
+ "label": "Status",
416
+ "name": "status"
827
417
  },
828
418
  {
419
+ "name": "amount",
829
420
  "variant": "caption",
830
- "name": "currency",
831
- "label": "Currency"
421
+ "label": "Amount"
832
422
  },
833
423
  {
834
424
  "name": "interval",
@@ -836,366 +426,58 @@
836
426
  "variant": "badge"
837
427
  },
838
428
  {
839
- "variant": "caption",
840
429
  "label": "Next Bill",
430
+ "variant": "caption",
841
431
  "name": "nextBillingAt"
842
432
  },
843
433
  {
434
+ "name": "attemptCount",
844
435
  "label": "Retries",
845
- "variant": "caption",
846
- "name": "attemptCount"
436
+ "variant": "caption"
847
437
  }
848
438
  ],
849
- "cols": 1.0,
850
- "gap": "sm"
851
- }
852
- ],
853
- "direction": "vertical"
854
- }
855
- ]
856
- ]
857
- },
858
- {
859
- "from": "loading",
860
- "to": "error",
861
- "event": "SubscriptionLoadFailed",
862
- "effects": [
863
- [
864
- "render-ui",
865
- "main",
866
- {
867
- "message": "@payload.error",
868
- "variant": "error",
869
- "type": "alert"
870
- }
871
- ]
872
- ]
873
- },
874
- {
875
- "from": "browsing",
876
- "to": "charging",
877
- "event": "CHARGE",
878
- "effects": [
879
- [
880
- "set",
881
- "@entity.id",
882
- "@payload.subscriptionId"
883
- ],
884
- [
885
- "set",
886
- "@entity.customerId",
887
- "@payload.row.customerId"
888
- ],
889
- [
890
- "set",
891
- "@entity.planId",
892
- "@payload.row.planId"
893
- ],
894
- [
895
- "set",
896
- "@entity.status",
897
- "@payload.row.status"
898
- ],
899
- [
900
- "set",
901
- "@entity.amount",
902
- "@payload.row.amount"
903
- ],
904
- [
905
- "set",
906
- "@entity.currency",
907
- "@payload.row.currency"
908
- ],
909
- [
910
- "set",
911
- "@entity.interval",
912
- "@payload.row.interval"
913
- ],
914
- [
915
- "set",
916
- "@entity.currentPeriodStart",
917
- "@payload.row.currentPeriodStart"
918
- ],
919
- [
920
- "set",
921
- "@entity.currentPeriodEnd",
922
- "@payload.row.currentPeriodEnd"
923
- ],
924
- [
925
- "set",
926
- "@entity.nextBillingAt",
927
- "@payload.row.nextBillingAt"
928
- ],
929
- [
930
- "set",
931
- "@entity.attemptCount",
932
- "@payload.row.attemptCount"
933
- ],
934
- [
935
- "set",
936
- "@entity.lastChargeAt",
937
- "@payload.row.lastChargeAt"
938
- ],
939
- [
940
- "set",
941
- "@entity.cancelledAt",
942
- "@payload.row.cancelledAt"
943
- ],
944
- [
945
- "set",
946
- "@entity.createdAt",
947
- "@payload.row.createdAt"
948
- ],
949
- [
950
- "call-service",
951
- "stripe-charge",
952
- "charge",
953
- {
954
- "subscriptionId": "@payload.subscriptionId",
955
- "amount": "@entity.amount",
956
- "currency": "@entity.currency"
957
- },
958
- {
959
- "emit": {
960
- "success": "ChargeSucceeded",
961
- "failure": "ChargeFailed"
962
- }
963
- }
964
- ],
965
- [
966
- "render-ui",
967
- "main",
968
- {
969
- "align": "center",
970
- "children": [
971
- {
972
- "type": "spinner"
973
- },
974
- {
975
- "content": "Charging subscription…",
976
- "type": "typography",
977
- "variant": "caption",
978
- "color": "muted"
439
+ "itemActions": [
440
+ {
441
+ "event": "OPEN_SUBSCRIPTION",
442
+ "variant": "primary",
443
+ "label": "Open",
444
+ "icon": "arrow-right"
445
+ },
446
+ {
447
+ "event": "CANCEL",
448
+ "label": "Cancel",
449
+ "variant": "danger"
450
+ }
451
+ ]
979
452
  }
980
453
  ],
981
454
  "type": "stack",
982
- "className": "py-12",
983
- "gap": "md",
984
- "direction": "vertical"
985
- }
986
- ]
987
- ]
988
- },
989
- {
990
- "from": "browsing",
991
- "to": "browsing",
992
- "event": "PRORATE",
993
- "effects": [
994
- [
995
- "set",
996
- "@entity.id",
997
- "@payload.subscriptionId"
998
- ],
999
- [
1000
- "set",
1001
- "@entity.customerId",
1002
- "@payload.row.customerId"
1003
- ],
1004
- [
1005
- "set",
1006
- "@entity.planId",
1007
- "@payload.newPlanId"
1008
- ],
1009
- [
1010
- "set",
1011
- "@entity.status",
1012
- "@payload.row.status"
1013
- ],
1014
- [
1015
- "set",
1016
- "@entity.amount",
1017
- [
1018
- "*",
1019
- "@payload.row.amount",
1020
- [
1021
- "-",
1022
- 1.0,
1023
- [
1024
- "/",
1025
- "@payload.daysIntoPeriod",
1026
- 30.0
1027
- ]
1028
- ]
1029
- ]
1030
- ],
1031
- [
1032
- "set",
1033
- "@entity.currency",
1034
- "@payload.row.currency"
1035
- ],
1036
- [
1037
- "set",
1038
- "@entity.interval",
1039
- "@payload.row.interval"
1040
- ],
1041
- [
1042
- "set",
1043
- "@entity.currentPeriodStart",
1044
- "@payload.row.currentPeriodStart"
1045
- ],
1046
- [
1047
- "set",
1048
- "@entity.currentPeriodEnd",
1049
- "@payload.row.currentPeriodEnd"
1050
- ],
1051
- [
1052
- "set",
1053
- "@entity.nextBillingAt",
1054
- "@payload.row.nextBillingAt"
1055
- ],
1056
- [
1057
- "set",
1058
- "@entity.attemptCount",
1059
- "@payload.row.attemptCount"
1060
- ],
1061
- [
1062
- "set",
1063
- "@entity.lastChargeAt",
1064
- "@payload.row.lastChargeAt"
1065
- ],
1066
- [
1067
- "set",
1068
- "@entity.cancelledAt",
1069
- "@payload.row.cancelledAt"
1070
- ],
1071
- [
1072
- "set",
1073
- "@entity.createdAt",
1074
- "@payload.row.createdAt"
1075
- ],
1076
- [
1077
- "persist",
1078
- "update",
1079
- "Subscription",
1080
- "@entity",
1081
- {
1082
- "emit": {
1083
- "success": "SubscriptionUpdated",
1084
- "failure": "ChargeFailed"
1085
- }
1086
- }
1087
- ]
1088
- ]
1089
- },
1090
- {
1091
- "from": "browsing",
1092
- "to": "browsing",
1093
- "event": "CANCEL",
1094
- "effects": [
1095
- [
1096
- "set",
1097
- "@entity.id",
1098
- "@payload.subscriptionId"
1099
- ],
1100
- [
1101
- "set",
1102
- "@entity.customerId",
1103
- "@payload.row.customerId"
1104
- ],
1105
- [
1106
- "set",
1107
- "@entity.planId",
1108
- "@payload.row.planId"
1109
- ],
1110
- [
1111
- "set",
1112
- "@entity.status",
1113
- "cancelled"
1114
- ],
1115
- [
1116
- "set",
1117
- "@entity.amount",
1118
- "@payload.row.amount"
1119
- ],
1120
- [
1121
- "set",
1122
- "@entity.currency",
1123
- "@payload.row.currency"
1124
- ],
1125
- [
1126
- "set",
1127
- "@entity.interval",
1128
- "@payload.row.interval"
1129
- ],
1130
- [
1131
- "set",
1132
- "@entity.currentPeriodStart",
1133
- "@payload.row.currentPeriodStart"
1134
- ],
1135
- [
1136
- "set",
1137
- "@entity.currentPeriodEnd",
1138
- "@payload.row.currentPeriodEnd"
1139
- ],
1140
- [
1141
- "set",
1142
- "@entity.nextBillingAt",
1143
- "@payload.row.nextBillingAt"
1144
- ],
1145
- [
1146
- "set",
1147
- "@entity.attemptCount",
1148
- "@payload.row.attemptCount"
1149
- ],
1150
- [
1151
- "set",
1152
- "@entity.lastChargeAt",
1153
- "@payload.row.lastChargeAt"
1154
- ],
1155
- [
1156
- "set",
1157
- "@entity.cancelledAt",
1158
- "@payload.cancelledAt"
1159
- ],
1160
- [
1161
- "set",
1162
- "@entity.createdAt",
1163
- "@payload.row.createdAt"
1164
- ],
1165
- [
1166
- "persist",
1167
- "update",
1168
- "Subscription",
1169
- "@entity",
1170
- {
1171
- "emit": {
1172
- "success": "SubscriptionUpdated",
1173
- "failure": "ChargeFailed"
1174
- }
455
+ "direction": "vertical",
456
+ "gap": "md"
1175
457
  }
1176
458
  ]
1177
459
  ]
1178
460
  },
1179
- {
1180
- "from": "browsing",
1181
- "to": "browsing",
1182
- "event": "SubscriptionUpdated",
461
+ {
462
+ "from": "loading",
463
+ "to": "error",
464
+ "event": "SubscriptionLoadFailed",
1183
465
  "effects": [
1184
466
  [
1185
467
  "render-ui",
1186
468
  "main",
1187
469
  {
470
+ "variant": "error",
1188
471
  "type": "alert",
1189
- "variant": "success",
1190
- "message": "Subscription updated"
472
+ "message": "@payload.error"
1191
473
  }
1192
474
  ]
1193
475
  ]
1194
476
  },
1195
477
  {
1196
- "from": "charging",
1197
- "to": "loading",
1198
- "event": "ChargeSucceeded",
478
+ "from": "browsing",
479
+ "to": "viewing_single",
480
+ "event": "OPEN_SUBSCRIPTION",
1199
481
  "effects": [
1200
482
  [
1201
483
  "set",
@@ -1250,7 +532,7 @@
1250
532
  [
1251
533
  "set",
1252
534
  "@entity.attemptCount",
1253
- 0.0
535
+ "@payload.row.attemptCount"
1254
536
  ],
1255
537
  [
1256
538
  "set",
@@ -1268,17 +550,249 @@
1268
550
  "@payload.row.createdAt"
1269
551
  ],
1270
552
  [
1271
- "persist",
1272
- "update",
553
+ "render-ui",
554
+ "main",
555
+ {
556
+ "children": [
557
+ {
558
+ "children": [
559
+ {
560
+ "variant": "ghost",
561
+ "label": "Back",
562
+ "type": "button",
563
+ "action": "CLOSE_VIEW"
564
+ },
565
+ {
566
+ "name": "repeat",
567
+ "type": "icon"
568
+ },
569
+ {
570
+ "variant": "h3",
571
+ "type": "typography",
572
+ "content": "@entity.customerId"
573
+ },
574
+ {
575
+ "label": "@entity.status",
576
+ "variant": "default",
577
+ "type": "badge"
578
+ },
579
+ {
580
+ "variant": "primary",
581
+ "type": "badge",
582
+ "label": "@entity.interval"
583
+ }
584
+ ],
585
+ "gap": "sm",
586
+ "type": "stack",
587
+ "align": "center",
588
+ "direction": "horizontal"
589
+ },
590
+ {
591
+ "type": "divider"
592
+ },
593
+ {
594
+ "gap": "sm",
595
+ "children": [
596
+ {
597
+ "children": [
598
+ {
599
+ "variant": "caption",
600
+ "color": "muted",
601
+ "content": "Plan",
602
+ "type": "typography"
603
+ },
604
+ {
605
+ "type": "typography",
606
+ "content": "@entity.planId",
607
+ "variant": "body"
608
+ }
609
+ ],
610
+ "gap": "md",
611
+ "direction": "horizontal",
612
+ "type": "stack"
613
+ },
614
+ {
615
+ "type": "stack",
616
+ "children": [
617
+ {
618
+ "content": "Currency",
619
+ "color": "muted",
620
+ "type": "typography",
621
+ "variant": "caption"
622
+ },
623
+ {
624
+ "content": "@entity.currency",
625
+ "variant": "body",
626
+ "type": "typography"
627
+ }
628
+ ],
629
+ "gap": "md",
630
+ "direction": "horizontal"
631
+ }
632
+ ],
633
+ "type": "stack",
634
+ "direction": "vertical"
635
+ },
636
+ {
637
+ "type": "divider"
638
+ },
639
+ {
640
+ "type": "simple-grid",
641
+ "children": [
642
+ {
643
+ "type": "stat-display",
644
+ "icon": "dollar-sign",
645
+ "label": "Amount",
646
+ "value": "@entity.amount"
647
+ },
648
+ {
649
+ "label": "Retries",
650
+ "type": "stat-display",
651
+ "value": "@entity.attemptCount",
652
+ "icon": "rotate-cw"
653
+ },
654
+ {
655
+ "type": "stat-display",
656
+ "label": "Next bill",
657
+ "icon": "calendar",
658
+ "value": "@entity.nextBillingAt"
659
+ },
660
+ {
661
+ "label": "Last charge",
662
+ "value": "@entity.lastChargeAt",
663
+ "type": "stat-display",
664
+ "icon": "credit-card"
665
+ }
666
+ ],
667
+ "cols": 4.0
668
+ },
669
+ {
670
+ "type": "stack",
671
+ "gap": "sm",
672
+ "direction": "horizontal",
673
+ "align": "center",
674
+ "children": [
675
+ {
676
+ "action": "CHARGE",
677
+ "actionPayload": {
678
+ "id": "@entity.id"
679
+ },
680
+ "label": "Charge",
681
+ "type": "button",
682
+ "variant": "primary"
683
+ },
684
+ {
685
+ "type": "button",
686
+ "variant": "danger",
687
+ "action": "CANCEL",
688
+ "actionPayload": {
689
+ "id": "@entity.id"
690
+ },
691
+ "label": "Cancel"
692
+ }
693
+ ]
694
+ }
695
+ ],
696
+ "type": "stack",
697
+ "direction": "vertical",
698
+ "gap": "md"
699
+ }
700
+ ]
701
+ ]
702
+ },
703
+ {
704
+ "from": "browsing",
705
+ "to": "loading",
706
+ "event": "CHARGE",
707
+ "effects": [
708
+ [
709
+ "set",
710
+ "@entity.id",
711
+ "@payload.id"
712
+ ],
713
+ [
714
+ "fetch",
715
+ "Subscription",
716
+ {
717
+ "emit": {
718
+ "success": "SubscriptionLoaded",
719
+ "failure": "SubscriptionLoadFailed"
720
+ }
721
+ }
722
+ ],
723
+ [
724
+ "render-ui",
725
+ "main",
726
+ {
727
+ "children": [
728
+ {
729
+ "type": "spinner"
730
+ },
731
+ {
732
+ "variant": "caption",
733
+ "content": "Charging subscription…",
734
+ "color": "muted",
735
+ "type": "typography"
736
+ }
737
+ ],
738
+ "gap": "md",
739
+ "type": "stack",
740
+ "direction": "vertical",
741
+ "align": "center",
742
+ "className": "py-12"
743
+ }
744
+ ]
745
+ ]
746
+ },
747
+ {
748
+ "from": "browsing",
749
+ "to": "loading",
750
+ "event": "CANCEL",
751
+ "effects": [
752
+ [
753
+ "set",
754
+ "@entity.id",
755
+ "@payload.id"
756
+ ],
757
+ [
758
+ "fetch",
1273
759
  "Subscription",
1274
- "@entity",
1275
760
  {
1276
761
  "emit": {
1277
- "failure": "ChargeFailed",
1278
- "success": "SubscriptionUpdated"
762
+ "failure": "SubscriptionLoadFailed",
763
+ "success": "SubscriptionLoaded"
1279
764
  }
1280
765
  }
1281
766
  ],
767
+ [
768
+ "render-ui",
769
+ "main",
770
+ {
771
+ "gap": "md",
772
+ "direction": "vertical",
773
+ "align": "center",
774
+ "type": "stack",
775
+ "className": "py-12",
776
+ "children": [
777
+ {
778
+ "type": "spinner"
779
+ },
780
+ {
781
+ "color": "muted",
782
+ "type": "typography",
783
+ "variant": "caption",
784
+ "content": "Cancelling subscription…"
785
+ }
786
+ ]
787
+ }
788
+ ]
789
+ ]
790
+ },
791
+ {
792
+ "from": "viewing_single",
793
+ "to": "loading",
794
+ "event": "CLOSE_VIEW",
795
+ "effects": [
1282
796
  [
1283
797
  "fetch",
1284
798
  "Subscription",
@@ -1288,32 +802,48 @@
1288
802
  "success": "SubscriptionLoaded"
1289
803
  }
1290
804
  }
805
+ ],
806
+ [
807
+ "render-ui",
808
+ "main",
809
+ {
810
+ "children": [
811
+ {
812
+ "type": "spinner"
813
+ },
814
+ {
815
+ "color": "muted",
816
+ "type": "typography",
817
+ "content": "Loading subscriptions…",
818
+ "variant": "caption"
819
+ }
820
+ ],
821
+ "className": "py-12",
822
+ "gap": "md",
823
+ "type": "stack",
824
+ "direction": "vertical",
825
+ "align": "center"
826
+ }
1291
827
  ]
1292
828
  ]
1293
829
  },
1294
830
  {
1295
- "from": "charging",
1296
- "to": "browsing",
1297
- "event": "ChargeFailed",
831
+ "from": "viewing_single",
832
+ "to": "loading",
833
+ "event": "CHARGE",
1298
834
  "effects": [
1299
835
  [
1300
836
  "set",
1301
- "@entity.attemptCount",
1302
- [
1303
- "+",
1304
- "@entity.attemptCount",
1305
- 1.0
1306
- ]
837
+ "@entity.id",
838
+ "@payload.id"
1307
839
  ],
1308
840
  [
1309
- "persist",
1310
- "update",
841
+ "fetch",
1311
842
  "Subscription",
1312
- "@entity",
1313
843
  {
1314
844
  "emit": {
1315
- "failure": "ChargeFailed",
1316
- "success": "SubscriptionUpdated"
845
+ "success": "SubscriptionLoaded",
846
+ "failure": "SubscriptionLoadFailed"
1317
847
  }
1318
848
  }
1319
849
  ],
@@ -1321,9 +851,66 @@
1321
851
  "render-ui",
1322
852
  "main",
1323
853
  {
1324
- "type": "alert",
1325
- "message": "@payload.error",
1326
- "variant": "error"
854
+ "align": "center",
855
+ "children": [
856
+ {
857
+ "type": "spinner"
858
+ },
859
+ {
860
+ "color": "muted",
861
+ "type": "typography",
862
+ "content": "Charging subscription…",
863
+ "variant": "caption"
864
+ }
865
+ ],
866
+ "gap": "md",
867
+ "direction": "vertical",
868
+ "className": "py-12",
869
+ "type": "stack"
870
+ }
871
+ ]
872
+ ]
873
+ },
874
+ {
875
+ "from": "viewing_single",
876
+ "to": "loading",
877
+ "event": "CANCEL",
878
+ "effects": [
879
+ [
880
+ "set",
881
+ "@entity.id",
882
+ "@payload.id"
883
+ ],
884
+ [
885
+ "fetch",
886
+ "Subscription",
887
+ {
888
+ "emit": {
889
+ "failure": "SubscriptionLoadFailed",
890
+ "success": "SubscriptionLoaded"
891
+ }
892
+ }
893
+ ],
894
+ [
895
+ "render-ui",
896
+ "main",
897
+ {
898
+ "direction": "vertical",
899
+ "type": "stack",
900
+ "className": "py-12",
901
+ "align": "center",
902
+ "gap": "md",
903
+ "children": [
904
+ {
905
+ "type": "spinner"
906
+ },
907
+ {
908
+ "type": "typography",
909
+ "content": "Cancelling subscription…",
910
+ "variant": "caption",
911
+ "color": "muted"
912
+ }
913
+ ]
1327
914
  }
1328
915
  ]
1329
916
  ]
@@ -1338,8 +925,8 @@
1338
925
  "Subscription",
1339
926
  {
1340
927
  "emit": {
1341
- "success": "SubscriptionLoaded",
1342
- "failure": "SubscriptionLoadFailed"
928
+ "failure": "SubscriptionLoadFailed",
929
+ "success": "SubscriptionLoaded"
1343
930
  }
1344
931
  }
1345
932
  ],