@almadar/std 14.26.0 → 14.27.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 (151) hide show
  1. package/behaviors/registry/app/atoms/std-applicant.orb +496 -42
  2. package/behaviors/registry/app/atoms/std-approval-request.orb +433 -593
  3. package/behaviors/registry/app/atoms/std-campaign-goal.orb +438 -228
  4. package/behaviors/registry/app/atoms/std-change-order.orb +565 -307
  5. package/behaviors/registry/app/atoms/std-chart-of-accounts.orb +434 -97
  6. package/behaviors/registry/app/atoms/std-checkin.orb +434 -270
  7. package/behaviors/registry/app/atoms/std-class-roster.orb +495 -61
  8. package/behaviors/registry/app/atoms/std-class-session.orb +485 -104
  9. package/behaviors/registry/app/atoms/std-court-deadline.orb +519 -88
  10. package/behaviors/registry/app/atoms/std-customer-account.orb +577 -97
  11. package/behaviors/registry/app/atoms/std-donation-receipt.orb +498 -55
  12. package/behaviors/registry/app/atoms/std-donor.orb +445 -135
  13. package/behaviors/registry/app/atoms/std-drip-sequence.orb +445 -62
  14. package/behaviors/registry/app/atoms/std-driver.orb +465 -480
  15. package/behaviors/registry/app/atoms/std-dunning.orb +450 -512
  16. package/behaviors/registry/app/atoms/std-email-broadcast.orb +517 -64
  17. package/behaviors/registry/app/atoms/std-event.orb +465 -667
  18. package/behaviors/registry/app/atoms/std-health-score.orb +368 -371
  19. package/behaviors/registry/app/atoms/std-help-article.orb +373 -506
  20. package/behaviors/registry/app/atoms/std-help-category.orb +344 -359
  21. package/behaviors/registry/app/atoms/std-interview-slot.orb +490 -48
  22. package/behaviors/registry/app/atoms/std-invoice.orb +494 -291
  23. package/behaviors/registry/app/atoms/std-kitchen-display.orb +588 -96
  24. package/behaviors/registry/app/atoms/std-lease.orb +506 -190
  25. package/behaviors/registry/app/atoms/std-ledger-entry.orb +483 -154
  26. package/behaviors/registry/app/atoms/std-maintenance-request.orb +642 -192
  27. package/behaviors/registry/app/atoms/std-matter.orb +486 -318
  28. package/behaviors/registry/app/atoms/std-membership.orb +512 -102
  29. package/behaviors/registry/app/atoms/std-menu.orb +775 -183
  30. package/behaviors/registry/app/atoms/std-modifier-group.orb +522 -104
  31. package/behaviors/registry/app/atoms/std-nps-survey.orb +319 -327
  32. package/behaviors/registry/app/atoms/std-offer-letter.orb +497 -47
  33. package/behaviors/registry/app/atoms/std-payout-ledger.orb +378 -362
  34. package/behaviors/registry/app/atoms/std-question-bank.orb +379 -346
  35. package/behaviors/registry/app/atoms/std-receipt.orb +553 -44
  36. package/behaviors/registry/app/atoms/std-recurring-charge.orb +419 -832
  37. package/behaviors/registry/app/atoms/std-renewal-risk.orb +370 -421
  38. package/behaviors/registry/app/atoms/std-rent-charge.orb +657 -55
  39. package/behaviors/registry/app/atoms/std-reorder-rule.orb +510 -59
  40. package/behaviors/registry/app/atoms/std-response-collector.orb +451 -144
  41. package/behaviors/registry/app/atoms/std-rfi.orb +502 -461
  42. package/behaviors/registry/app/atoms/std-route-optimize.orb +448 -158
  43. package/behaviors/registry/app/atoms/std-segment.orb +360 -98
  44. package/behaviors/registry/app/atoms/std-stock-level.orb +486 -103
  45. package/behaviors/registry/app/atoms/std-submittal.orb +538 -526
  46. package/behaviors/registry/app/atoms/std-table-map.orb +88 -51
  47. package/behaviors/registry/app/atoms/std-technician-dispatch.orb +653 -71
  48. package/behaviors/registry/app/atoms/std-telematics-event.orb +310 -215
  49. package/behaviors/registry/app/atoms/std-template-editor.orb +513 -90
  50. package/behaviors/registry/app/atoms/std-tenant.orb +525 -66
  51. package/behaviors/registry/app/atoms/std-ticket-tier.orb +472 -460
  52. package/behaviors/registry/app/atoms/std-time-entry.orb +354 -317
  53. package/behaviors/registry/app/atoms/std-timesheet.orb +551 -284
  54. package/behaviors/registry/app/atoms/std-trial.orb +410 -317
  55. package/behaviors/registry/app/atoms/std-vehicle.orb +398 -563
  56. package/behaviors/registry/app/atoms/std-waitlist.orb +372 -283
  57. package/behaviors/registry/app/atoms/std-warehouse.orb +273 -214
  58. package/behaviors/registry/app/atoms/std-work-order.orb +628 -240
  59. package/behaviors/registry/app/molecules/std-applicant-form.orb +89 -83
  60. package/behaviors/registry/app/molecules/std-application.orb +178 -263
  61. package/behaviors/registry/app/molecules/std-broadcast-builder.orb +67 -176
  62. package/behaviors/registry/app/molecules/std-cart.orb +78 -72
  63. package/behaviors/registry/app/molecules/std-form-builder.orb +437 -176
  64. package/behaviors/registry/app/molecules/std-ledger-entry-form.orb +608 -89
  65. package/behaviors/registry/app/molecules/std-stock-adjustment.orb +501 -102
  66. package/behaviors/registry/app/molecules/std-vendor-onboarding.orb +383 -469
  67. package/behaviors/registry/core/atoms/std-billable-hour.orb +495 -91
  68. package/behaviors/registry/core/atoms/std-branching-logic.orb +271 -600
  69. package/behaviors/registry/core/atoms/std-file-store.orb +534 -164
  70. package/behaviors/registry/core/atoms/std-gallery.orb +118 -101
  71. package/behaviors/registry/core/atoms/std-image-upload-multi.orb +87 -57
  72. package/behaviors/registry/core/atoms/std-page-tree.orb +342 -484
  73. package/behaviors/registry/core/atoms/std-rich-editor.orb +288 -416
  74. package/behaviors/registry/core/atoms/std-version-history.orb +454 -430
  75. package/behaviors/registry/core/molecules/std-wizard-form.orb +222 -147
  76. package/dist/behaviors/registry/app/atoms/std-applicant.orb +496 -42
  77. package/dist/behaviors/registry/app/atoms/std-approval-request.orb +433 -593
  78. package/dist/behaviors/registry/app/atoms/std-campaign-goal.orb +438 -228
  79. package/dist/behaviors/registry/app/atoms/std-change-order.orb +565 -307
  80. package/dist/behaviors/registry/app/atoms/std-chart-of-accounts.orb +434 -97
  81. package/dist/behaviors/registry/app/atoms/std-checkin.orb +434 -270
  82. package/dist/behaviors/registry/app/atoms/std-class-roster.orb +495 -61
  83. package/dist/behaviors/registry/app/atoms/std-class-session.orb +485 -104
  84. package/dist/behaviors/registry/app/atoms/std-court-deadline.orb +519 -88
  85. package/dist/behaviors/registry/app/atoms/std-customer-account.orb +577 -97
  86. package/dist/behaviors/registry/app/atoms/std-donation-receipt.orb +498 -55
  87. package/dist/behaviors/registry/app/atoms/std-donor.orb +445 -135
  88. package/dist/behaviors/registry/app/atoms/std-drip-sequence.orb +445 -62
  89. package/dist/behaviors/registry/app/atoms/std-driver.orb +465 -480
  90. package/dist/behaviors/registry/app/atoms/std-dunning.orb +450 -512
  91. package/dist/behaviors/registry/app/atoms/std-email-broadcast.orb +517 -64
  92. package/dist/behaviors/registry/app/atoms/std-event.orb +465 -667
  93. package/dist/behaviors/registry/app/atoms/std-health-score.orb +368 -371
  94. package/dist/behaviors/registry/app/atoms/std-help-article.orb +373 -506
  95. package/dist/behaviors/registry/app/atoms/std-help-category.orb +344 -359
  96. package/dist/behaviors/registry/app/atoms/std-interview-slot.orb +490 -48
  97. package/dist/behaviors/registry/app/atoms/std-invoice.orb +494 -291
  98. package/dist/behaviors/registry/app/atoms/std-kitchen-display.orb +588 -96
  99. package/dist/behaviors/registry/app/atoms/std-lease.orb +506 -190
  100. package/dist/behaviors/registry/app/atoms/std-ledger-entry.orb +483 -154
  101. package/dist/behaviors/registry/app/atoms/std-maintenance-request.orb +642 -192
  102. package/dist/behaviors/registry/app/atoms/std-matter.orb +486 -318
  103. package/dist/behaviors/registry/app/atoms/std-membership.orb +512 -102
  104. package/dist/behaviors/registry/app/atoms/std-menu.orb +775 -183
  105. package/dist/behaviors/registry/app/atoms/std-modifier-group.orb +522 -104
  106. package/dist/behaviors/registry/app/atoms/std-nps-survey.orb +319 -327
  107. package/dist/behaviors/registry/app/atoms/std-offer-letter.orb +497 -47
  108. package/dist/behaviors/registry/app/atoms/std-payout-ledger.orb +378 -362
  109. package/dist/behaviors/registry/app/atoms/std-question-bank.orb +379 -346
  110. package/dist/behaviors/registry/app/atoms/std-receipt.orb +553 -44
  111. package/dist/behaviors/registry/app/atoms/std-recurring-charge.orb +419 -832
  112. package/dist/behaviors/registry/app/atoms/std-renewal-risk.orb +370 -421
  113. package/dist/behaviors/registry/app/atoms/std-rent-charge.orb +657 -55
  114. package/dist/behaviors/registry/app/atoms/std-reorder-rule.orb +510 -59
  115. package/dist/behaviors/registry/app/atoms/std-response-collector.orb +451 -144
  116. package/dist/behaviors/registry/app/atoms/std-rfi.orb +502 -461
  117. package/dist/behaviors/registry/app/atoms/std-route-optimize.orb +448 -158
  118. package/dist/behaviors/registry/app/atoms/std-segment.orb +360 -98
  119. package/dist/behaviors/registry/app/atoms/std-stock-level.orb +486 -103
  120. package/dist/behaviors/registry/app/atoms/std-submittal.orb +538 -526
  121. package/dist/behaviors/registry/app/atoms/std-table-map.orb +88 -51
  122. package/dist/behaviors/registry/app/atoms/std-technician-dispatch.orb +653 -71
  123. package/dist/behaviors/registry/app/atoms/std-telematics-event.orb +310 -215
  124. package/dist/behaviors/registry/app/atoms/std-template-editor.orb +513 -90
  125. package/dist/behaviors/registry/app/atoms/std-tenant.orb +525 -66
  126. package/dist/behaviors/registry/app/atoms/std-ticket-tier.orb +472 -460
  127. package/dist/behaviors/registry/app/atoms/std-time-entry.orb +354 -317
  128. package/dist/behaviors/registry/app/atoms/std-timesheet.orb +551 -284
  129. package/dist/behaviors/registry/app/atoms/std-trial.orb +410 -317
  130. package/dist/behaviors/registry/app/atoms/std-vehicle.orb +398 -563
  131. package/dist/behaviors/registry/app/atoms/std-waitlist.orb +372 -283
  132. package/dist/behaviors/registry/app/atoms/std-warehouse.orb +273 -214
  133. package/dist/behaviors/registry/app/atoms/std-work-order.orb +628 -240
  134. package/dist/behaviors/registry/app/molecules/std-applicant-form.orb +89 -83
  135. package/dist/behaviors/registry/app/molecules/std-application.orb +178 -263
  136. package/dist/behaviors/registry/app/molecules/std-broadcast-builder.orb +67 -176
  137. package/dist/behaviors/registry/app/molecules/std-cart.orb +78 -72
  138. package/dist/behaviors/registry/app/molecules/std-form-builder.orb +437 -176
  139. package/dist/behaviors/registry/app/molecules/std-ledger-entry-form.orb +608 -89
  140. package/dist/behaviors/registry/app/molecules/std-stock-adjustment.orb +501 -102
  141. package/dist/behaviors/registry/app/molecules/std-vendor-onboarding.orb +383 -469
  142. package/dist/behaviors/registry/core/atoms/std-billable-hour.orb +495 -91
  143. package/dist/behaviors/registry/core/atoms/std-branching-logic.orb +271 -600
  144. package/dist/behaviors/registry/core/atoms/std-file-store.orb +534 -164
  145. package/dist/behaviors/registry/core/atoms/std-gallery.orb +118 -101
  146. package/dist/behaviors/registry/core/atoms/std-image-upload-multi.orb +87 -57
  147. package/dist/behaviors/registry/core/atoms/std-page-tree.orb +342 -484
  148. package/dist/behaviors/registry/core/atoms/std-rich-editor.orb +288 -416
  149. package/dist/behaviors/registry/core/atoms/std-version-history.orb +454 -430
  150. package/dist/behaviors/registry/core/molecules/std-wizard-form.orb +222 -147
  151. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "std-receipt",
3
3
  "version": "1.0.0",
4
- "description": "std-receipt — receipt primitive. Proof of completed transaction (retail purchase or charitable donation). Browses receipts in a data-grid with Email / Reprint actions.",
4
+ "description": "std-receipt — receipt primitive. Lists receipts in `browsing`; opens detail in `viewing_single` with Email / Reprint actions.",
5
5
  "orbitals": [
6
6
  {
7
7
  "name": "ReceiptOrbital",
@@ -84,6 +84,69 @@
84
84
  "category": "interaction",
85
85
  "linkedEntity": "Receipt",
86
86
  "emits": [
87
+ {
88
+ "event": "OPEN_RECEIPT",
89
+ "payloadSchema": [
90
+ {
91
+ "name": "id",
92
+ "type": "string",
93
+ "required": true
94
+ },
95
+ {
96
+ "name": "row.id",
97
+ "type": "string",
98
+ "required": true
99
+ },
100
+ {
101
+ "name": "row.receiptNumber",
102
+ "type": "string",
103
+ "required": true
104
+ },
105
+ {
106
+ "name": "row.recipientName",
107
+ "type": "string"
108
+ },
109
+ {
110
+ "name": "row.recipientEmail",
111
+ "type": "string"
112
+ },
113
+ {
114
+ "name": "row.transactionId",
115
+ "type": "string"
116
+ },
117
+ {
118
+ "name": "row.transactionType",
119
+ "type": "string"
120
+ },
121
+ {
122
+ "name": "row.subtotal",
123
+ "type": "number"
124
+ },
125
+ {
126
+ "name": "row.tax",
127
+ "type": "number"
128
+ },
129
+ {
130
+ "name": "row.total",
131
+ "type": "number"
132
+ },
133
+ {
134
+ "name": "row.lineItemsJson",
135
+ "type": "string"
136
+ },
137
+ {
138
+ "name": "row.issuedAt",
139
+ "type": "string"
140
+ },
141
+ {
142
+ "name": "row.isEmailed",
143
+ "type": "boolean"
144
+ }
145
+ ]
146
+ },
147
+ {
148
+ "event": "CLOSE_VIEW"
149
+ },
87
150
  {
88
151
  "event": "EMAIL_RECEIPT",
89
152
  "payloadSchema": [
@@ -136,6 +199,9 @@
136
199
  {
137
200
  "name": "browsing"
138
201
  },
202
+ {
203
+ "name": "viewing_single"
204
+ },
139
205
  {
140
206
  "name": "error"
141
207
  }
@@ -169,6 +235,21 @@
169
235
  }
170
236
  ]
171
237
  },
238
+ {
239
+ "key": "OPEN_RECEIPT",
240
+ "name": "Open Receipt",
241
+ "payloadSchema": [
242
+ {
243
+ "name": "id",
244
+ "type": "string",
245
+ "required": true
246
+ },
247
+ {
248
+ "name": "row",
249
+ "type": "Receipt"
250
+ }
251
+ ]
252
+ },
172
253
  {
173
254
  "key": "EMAIL_RECEIPT",
174
255
  "name": "Email Receipt",
@@ -190,6 +271,10 @@
190
271
  "required": true
191
272
  }
192
273
  ]
274
+ },
275
+ {
276
+ "key": "CLOSE_VIEW",
277
+ "name": "Close View"
193
278
  }
194
279
  ],
195
280
  "transitions": [
@@ -203,8 +288,8 @@
203
288
  "Receipt",
204
289
  {
205
290
  "emit": {
206
- "failure": "ReceiptLoadFailed",
207
- "success": "ReceiptLoaded"
291
+ "success": "ReceiptLoaded",
292
+ "failure": "ReceiptLoadFailed"
208
293
  }
209
294
  }
210
295
  ],
@@ -212,20 +297,20 @@
212
297
  "render-ui",
213
298
  "main",
214
299
  {
215
- "direction": "vertical",
216
- "align": "center",
217
- "type": "stack",
218
300
  "children": [
219
301
  {
220
302
  "type": "spinner"
221
303
  },
222
304
  {
223
305
  "color": "muted",
224
- "variant": "caption",
225
306
  "type": "typography",
307
+ "variant": "caption",
226
308
  "content": "Loading receipts…"
227
309
  }
228
310
  ],
311
+ "align": "center",
312
+ "type": "stack",
313
+ "direction": "vertical",
229
314
  "gap": "md",
230
315
  "className": "py-12"
231
316
  }
@@ -243,10 +328,12 @@
243
328
  {
244
329
  "children": [
245
330
  {
331
+ "align": "center",
332
+ "gap": "sm",
246
333
  "children": [
247
334
  {
248
- "type": "icon",
249
- "name": "receipt"
335
+ "name": "receipt",
336
+ "type": "icon"
250
337
  },
251
338
  {
252
339
  "type": "typography",
@@ -254,9 +341,38 @@
254
341
  "variant": "h3"
255
342
  }
256
343
  ],
257
- "gap": "sm",
258
- "direction": "horizontal",
259
- "type": "stack"
344
+ "type": "stack",
345
+ "direction": "horizontal"
346
+ },
347
+ {
348
+ "cols": 4.0,
349
+ "children": [
350
+ {
351
+ "type": "stat-display",
352
+ "icon": "receipt",
353
+ "label": "Total receipts",
354
+ "value": "@payload.data.length"
355
+ },
356
+ {
357
+ "label": "Issued today",
358
+ "value": "23",
359
+ "type": "stat-display",
360
+ "icon": "calendar"
361
+ },
362
+ {
363
+ "value": "$12,840",
364
+ "icon": "dollar-sign",
365
+ "type": "stat-display",
366
+ "label": "Revenue"
367
+ },
368
+ {
369
+ "value": "92%",
370
+ "type": "stat-display",
371
+ "label": "Emailed",
372
+ "icon": "mail"
373
+ }
374
+ ],
375
+ "type": "simple-grid"
260
376
  },
261
377
  {
262
378
  "type": "divider"
@@ -264,56 +380,52 @@
264
380
  {
265
381
  "itemActions": [
266
382
  {
267
- "label": "Email",
383
+ "event": "OPEN_RECEIPT",
384
+ "label": "Open",
268
385
  "variant": "primary",
269
- "event": "EMAIL_RECEIPT"
386
+ "icon": "arrow-right"
270
387
  },
271
388
  {
272
- "variant": "ghost",
273
389
  "label": "Reprint",
274
- "event": "REPRINT_RECEIPT"
390
+ "event": "REPRINT_RECEIPT",
391
+ "variant": "danger"
275
392
  }
276
393
  ],
394
+ "entity": "@payload.data",
395
+ "type": "data-grid",
396
+ "cols": 1.0,
397
+ "gap": "sm",
277
398
  "fields": [
278
399
  {
400
+ "label": "Receipt #",
279
401
  "variant": "caption",
280
- "name": "receiptNumber",
281
- "label": "Receipt #"
402
+ "name": "receiptNumber"
282
403
  },
283
404
  {
284
- "label": "Recipient",
285
405
  "variant": "caption",
286
- "name": "recipientName"
406
+ "name": "recipientName",
407
+ "label": "Recipient"
287
408
  },
288
409
  {
289
- "label": "Type",
290
410
  "variant": "badge",
291
- "name": "transactionType"
411
+ "name": "transactionType",
412
+ "label": "Type"
292
413
  },
293
414
  {
294
- "label": "Total",
295
415
  "variant": "caption",
416
+ "label": "Total",
296
417
  "name": "total"
297
418
  },
298
419
  {
299
- "variant": "caption",
300
420
  "name": "issuedAt",
421
+ "variant": "caption",
301
422
  "label": "Issued"
302
- },
303
- {
304
- "name": "isEmailed",
305
- "variant": "badge",
306
- "label": "Emailed"
307
423
  }
308
- ],
309
- "entity": "@payload.data",
310
- "type": "data-grid",
311
- "gap": "sm",
312
- "cols": 1.0
424
+ ]
313
425
  }
314
426
  ],
315
- "direction": "vertical",
316
427
  "type": "stack",
428
+ "direction": "vertical",
317
429
  "gap": "md"
318
430
  }
319
431
  ]
@@ -328,8 +440,8 @@
328
440
  "render-ui",
329
441
  "main",
330
442
  {
331
- "type": "alert",
332
443
  "variant": "error",
444
+ "type": "alert",
333
445
  "message": "@payload.error"
334
446
  }
335
447
  ]
@@ -337,7 +449,231 @@
337
449
  },
338
450
  {
339
451
  "from": "browsing",
340
- "to": "browsing",
452
+ "to": "viewing_single",
453
+ "event": "OPEN_RECEIPT",
454
+ "effects": [
455
+ [
456
+ "set",
457
+ "@entity.id",
458
+ "@payload.row.id"
459
+ ],
460
+ [
461
+ "set",
462
+ "@entity.receiptNumber",
463
+ "@payload.row.receiptNumber"
464
+ ],
465
+ [
466
+ "set",
467
+ "@entity.recipientName",
468
+ "@payload.row.recipientName"
469
+ ],
470
+ [
471
+ "set",
472
+ "@entity.recipientEmail",
473
+ "@payload.row.recipientEmail"
474
+ ],
475
+ [
476
+ "set",
477
+ "@entity.transactionId",
478
+ "@payload.row.transactionId"
479
+ ],
480
+ [
481
+ "set",
482
+ "@entity.transactionType",
483
+ "@payload.row.transactionType"
484
+ ],
485
+ [
486
+ "set",
487
+ "@entity.subtotal",
488
+ "@payload.row.subtotal"
489
+ ],
490
+ [
491
+ "set",
492
+ "@entity.tax",
493
+ "@payload.row.tax"
494
+ ],
495
+ [
496
+ "set",
497
+ "@entity.total",
498
+ "@payload.row.total"
499
+ ],
500
+ [
501
+ "set",
502
+ "@entity.lineItemsJson",
503
+ "@payload.row.lineItemsJson"
504
+ ],
505
+ [
506
+ "set",
507
+ "@entity.issuedAt",
508
+ "@payload.row.issuedAt"
509
+ ],
510
+ [
511
+ "render-ui",
512
+ "main",
513
+ {
514
+ "direction": "vertical",
515
+ "type": "stack",
516
+ "children": [
517
+ {
518
+ "gap": "sm",
519
+ "type": "stack",
520
+ "direction": "horizontal",
521
+ "align": "center",
522
+ "children": [
523
+ {
524
+ "variant": "ghost",
525
+ "type": "button",
526
+ "action": "CLOSE_VIEW",
527
+ "label": "Back"
528
+ },
529
+ {
530
+ "type": "icon",
531
+ "name": "receipt"
532
+ },
533
+ {
534
+ "variant": "h3",
535
+ "type": "typography",
536
+ "content": "@entity.receiptNumber"
537
+ },
538
+ {
539
+ "variant": "default",
540
+ "type": "badge",
541
+ "label": "@entity.transactionType"
542
+ }
543
+ ]
544
+ },
545
+ {
546
+ "type": "divider"
547
+ },
548
+ {
549
+ "children": [
550
+ {
551
+ "gap": "md",
552
+ "type": "stack",
553
+ "children": [
554
+ {
555
+ "content": "Recipient",
556
+ "variant": "caption",
557
+ "color": "muted",
558
+ "type": "typography"
559
+ },
560
+ {
561
+ "type": "typography",
562
+ "variant": "body",
563
+ "content": "@entity.recipientName"
564
+ }
565
+ ],
566
+ "direction": "horizontal"
567
+ },
568
+ {
569
+ "direction": "horizontal",
570
+ "type": "stack",
571
+ "children": [
572
+ {
573
+ "content": "Email",
574
+ "type": "typography",
575
+ "color": "muted",
576
+ "variant": "caption"
577
+ },
578
+ {
579
+ "content": "@entity.recipientEmail",
580
+ "variant": "body",
581
+ "type": "typography"
582
+ }
583
+ ],
584
+ "gap": "md"
585
+ },
586
+ {
587
+ "type": "stack",
588
+ "gap": "md",
589
+ "children": [
590
+ {
591
+ "variant": "caption",
592
+ "type": "typography",
593
+ "color": "muted",
594
+ "content": "Transaction"
595
+ },
596
+ {
597
+ "content": "@entity.transactionId",
598
+ "variant": "body",
599
+ "type": "typography"
600
+ }
601
+ ],
602
+ "direction": "horizontal"
603
+ }
604
+ ],
605
+ "gap": "sm",
606
+ "type": "stack",
607
+ "direction": "vertical"
608
+ },
609
+ {
610
+ "type": "divider"
611
+ },
612
+ {
613
+ "type": "simple-grid",
614
+ "cols": 4.0,
615
+ "children": [
616
+ {
617
+ "type": "stat-display",
618
+ "label": "Subtotal",
619
+ "value": "@entity.subtotal",
620
+ "icon": "dollar-sign"
621
+ },
622
+ {
623
+ "type": "stat-display",
624
+ "icon": "percent",
625
+ "value": "@entity.tax",
626
+ "label": "Tax"
627
+ },
628
+ {
629
+ "label": "Total",
630
+ "icon": "dollar-sign",
631
+ "value": "@entity.total",
632
+ "type": "stat-display"
633
+ },
634
+ {
635
+ "value": "@entity.issuedAt",
636
+ "icon": "calendar",
637
+ "type": "stat-display",
638
+ "label": "Issued"
639
+ }
640
+ ]
641
+ },
642
+ {
643
+ "direction": "horizontal",
644
+ "type": "stack",
645
+ "align": "center",
646
+ "children": [
647
+ {
648
+ "actionPayload": {
649
+ "id": "@entity.id"
650
+ },
651
+ "variant": "primary",
652
+ "type": "button",
653
+ "action": "EMAIL_RECEIPT",
654
+ "label": "Email"
655
+ },
656
+ {
657
+ "type": "button",
658
+ "action": "REPRINT_RECEIPT",
659
+ "variant": "secondary",
660
+ "label": "Reprint",
661
+ "actionPayload": {
662
+ "id": "@entity.id"
663
+ }
664
+ }
665
+ ],
666
+ "gap": "sm"
667
+ }
668
+ ],
669
+ "gap": "md"
670
+ }
671
+ ]
672
+ ]
673
+ },
674
+ {
675
+ "from": "browsing",
676
+ "to": "loading",
341
677
  "event": "EMAIL_RECEIPT",
342
678
  "effects": [
343
679
  [
@@ -345,20 +681,43 @@
345
681
  "@entity.id",
346
682
  "@payload.id"
347
683
  ],
684
+ [
685
+ "fetch",
686
+ "Receipt",
687
+ {
688
+ "emit": {
689
+ "failure": "ReceiptLoadFailed",
690
+ "success": "ReceiptLoaded"
691
+ }
692
+ }
693
+ ],
348
694
  [
349
695
  "render-ui",
350
696
  "main",
351
697
  {
352
- "type": "alert",
353
- "message": "Receipt emailed",
354
- "variant": "success"
698
+ "className": "py-12",
699
+ "gap": "md",
700
+ "type": "stack",
701
+ "align": "center",
702
+ "children": [
703
+ {
704
+ "type": "spinner"
705
+ },
706
+ {
707
+ "type": "typography",
708
+ "variant": "caption",
709
+ "content": "Emailing receipt…",
710
+ "color": "muted"
711
+ }
712
+ ],
713
+ "direction": "vertical"
355
714
  }
356
715
  ]
357
716
  ]
358
717
  },
359
718
  {
360
719
  "from": "browsing",
361
- "to": "browsing",
720
+ "to": "loading",
362
721
  "event": "REPRINT_RECEIPT",
363
722
  "effects": [
364
723
  [
@@ -366,13 +725,163 @@
366
725
  "@entity.id",
367
726
  "@payload.id"
368
727
  ],
728
+ [
729
+ "fetch",
730
+ "Receipt",
731
+ {
732
+ "emit": {
733
+ "success": "ReceiptLoaded",
734
+ "failure": "ReceiptLoadFailed"
735
+ }
736
+ }
737
+ ],
369
738
  [
370
739
  "render-ui",
371
740
  "main",
372
741
  {
373
- "variant": "info",
374
- "message": "Receipt reprinted",
375
- "type": "alert"
742
+ "gap": "md",
743
+ "direction": "vertical",
744
+ "children": [
745
+ {
746
+ "type": "spinner"
747
+ },
748
+ {
749
+ "variant": "caption",
750
+ "content": "Reprinting receipt…",
751
+ "color": "muted",
752
+ "type": "typography"
753
+ }
754
+ ],
755
+ "align": "center",
756
+ "className": "py-12",
757
+ "type": "stack"
758
+ }
759
+ ]
760
+ ]
761
+ },
762
+ {
763
+ "from": "viewing_single",
764
+ "to": "loading",
765
+ "event": "CLOSE_VIEW",
766
+ "effects": [
767
+ [
768
+ "fetch",
769
+ "Receipt",
770
+ {
771
+ "emit": {
772
+ "success": "ReceiptLoaded",
773
+ "failure": "ReceiptLoadFailed"
774
+ }
775
+ }
776
+ ],
777
+ [
778
+ "render-ui",
779
+ "main",
780
+ {
781
+ "type": "stack",
782
+ "children": [
783
+ {
784
+ "type": "spinner"
785
+ },
786
+ {
787
+ "type": "typography",
788
+ "content": "Loading receipts…",
789
+ "variant": "caption",
790
+ "color": "muted"
791
+ }
792
+ ],
793
+ "className": "py-12",
794
+ "gap": "md",
795
+ "direction": "vertical",
796
+ "align": "center"
797
+ }
798
+ ]
799
+ ]
800
+ },
801
+ {
802
+ "from": "viewing_single",
803
+ "to": "loading",
804
+ "event": "EMAIL_RECEIPT",
805
+ "effects": [
806
+ [
807
+ "set",
808
+ "@entity.id",
809
+ "@payload.id"
810
+ ],
811
+ [
812
+ "fetch",
813
+ "Receipt",
814
+ {
815
+ "emit": {
816
+ "success": "ReceiptLoaded",
817
+ "failure": "ReceiptLoadFailed"
818
+ }
819
+ }
820
+ ],
821
+ [
822
+ "render-ui",
823
+ "main",
824
+ {
825
+ "type": "stack",
826
+ "direction": "vertical",
827
+ "align": "center",
828
+ "children": [
829
+ {
830
+ "type": "spinner"
831
+ },
832
+ {
833
+ "color": "muted",
834
+ "content": "Emailing receipt…",
835
+ "variant": "caption",
836
+ "type": "typography"
837
+ }
838
+ ],
839
+ "className": "py-12",
840
+ "gap": "md"
841
+ }
842
+ ]
843
+ ]
844
+ },
845
+ {
846
+ "from": "viewing_single",
847
+ "to": "loading",
848
+ "event": "REPRINT_RECEIPT",
849
+ "effects": [
850
+ [
851
+ "set",
852
+ "@entity.id",
853
+ "@payload.id"
854
+ ],
855
+ [
856
+ "fetch",
857
+ "Receipt",
858
+ {
859
+ "emit": {
860
+ "failure": "ReceiptLoadFailed",
861
+ "success": "ReceiptLoaded"
862
+ }
863
+ }
864
+ ],
865
+ [
866
+ "render-ui",
867
+ "main",
868
+ {
869
+ "className": "py-12",
870
+ "type": "stack",
871
+ "align": "center",
872
+ "direction": "vertical",
873
+ "children": [
874
+ {
875
+ "type": "spinner"
876
+ },
877
+ {
878
+ "content": "Reprinting receipt…",
879
+ "type": "typography",
880
+ "variant": "caption",
881
+ "color": "muted"
882
+ }
883
+ ],
884
+ "gap": "md"
376
885
  }
377
886
  ]
378
887
  ]