@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
@@ -90,10 +90,10 @@
90
90
  "linkedEntity": "InvoiceRecord",
91
91
  "emits": [
92
92
  {
93
- "event": "VIEW",
93
+ "event": "OPEN_INVOICE",
94
94
  "payloadSchema": [
95
95
  {
96
- "name": "invoiceId",
96
+ "name": "id",
97
97
  "type": "string",
98
98
  "required": true
99
99
  },
@@ -158,6 +158,9 @@
158
158
  }
159
159
  ]
160
160
  },
161
+ {
162
+ "event": "CLOSE_VIEW"
163
+ },
161
164
  {
162
165
  "event": "SEND",
163
166
  "payloadSchema": [
@@ -390,7 +393,7 @@
390
393
  "name": "browsing"
391
394
  },
392
395
  {
393
- "name": "viewing"
396
+ "name": "viewing_single"
394
397
  },
395
398
  {
396
399
  "name": "error"
@@ -426,11 +429,11 @@
426
429
  ]
427
430
  },
428
431
  {
429
- "key": "VIEW",
430
- "name": "View",
432
+ "key": "OPEN_INVOICE",
433
+ "name": "Open Invoice",
431
434
  "payloadSchema": [
432
435
  {
433
- "name": "invoiceId",
436
+ "name": "id",
434
437
  "type": "string",
435
438
  "required": true
436
439
  },
@@ -440,28 +443,6 @@
440
443
  }
441
444
  ]
442
445
  },
443
- {
444
- "key": "SEND",
445
- "name": "Send",
446
- "payloadSchema": [
447
- {
448
- "name": "invoiceId",
449
- "type": "string",
450
- "required": true
451
- }
452
- ]
453
- },
454
- {
455
- "key": "MARK_PAID",
456
- "name": "Mark Paid",
457
- "payloadSchema": [
458
- {
459
- "name": "invoiceId",
460
- "type": "string",
461
- "required": true
462
- }
463
- ]
464
- },
465
446
  {
466
447
  "key": "VOID",
467
448
  "name": "Void",
@@ -473,22 +454,6 @@
473
454
  }
474
455
  ]
475
456
  },
476
- {
477
- "key": "REFUND",
478
- "name": "Refund",
479
- "payloadSchema": [
480
- {
481
- "name": "invoiceId",
482
- "type": "string",
483
- "required": true
484
- },
485
- {
486
- "name": "amount",
487
- "type": "number",
488
- "required": true
489
- }
490
- ]
491
- },
492
457
  {
493
458
  "key": "InvoiceUpdated",
494
459
  "name": "Invoice updated",
@@ -536,6 +501,48 @@
536
501
  "type": "string"
537
502
  }
538
503
  ]
504
+ },
505
+ {
506
+ "key": "CLOSE_VIEW",
507
+ "name": "Close View"
508
+ },
509
+ {
510
+ "key": "SEND",
511
+ "name": "Send",
512
+ "payloadSchema": [
513
+ {
514
+ "name": "invoiceId",
515
+ "type": "string",
516
+ "required": true
517
+ }
518
+ ]
519
+ },
520
+ {
521
+ "key": "MARK_PAID",
522
+ "name": "Mark Paid",
523
+ "payloadSchema": [
524
+ {
525
+ "name": "invoiceId",
526
+ "type": "string",
527
+ "required": true
528
+ }
529
+ ]
530
+ },
531
+ {
532
+ "key": "REFUND",
533
+ "name": "Refund",
534
+ "payloadSchema": [
535
+ {
536
+ "name": "invoiceId",
537
+ "type": "string",
538
+ "required": true
539
+ },
540
+ {
541
+ "name": "amount",
542
+ "type": "number",
543
+ "required": true
544
+ }
545
+ ]
539
546
  }
540
547
  ],
541
548
  "transitions": [
@@ -558,10 +565,6 @@
558
565
  "render-ui",
559
566
  "main",
560
567
  {
561
- "type": "stack",
562
- "direction": "vertical",
563
- "align": "center",
564
- "gap": "md",
565
568
  "className": "py-12",
566
569
  "children": [
567
570
  {
@@ -573,7 +576,11 @@
573
576
  "type": "typography",
574
577
  "color": "muted"
575
578
  }
576
- ]
579
+ ],
580
+ "direction": "vertical",
581
+ "align": "center",
582
+ "type": "stack",
583
+ "gap": "md"
577
584
  }
578
585
  ]
579
586
  ]
@@ -588,9 +595,9 @@
588
595
  "main",
589
596
  {
590
597
  "type": "stack",
591
- "direction": "vertical",
592
598
  "children": [
593
599
  {
600
+ "type": "stack",
594
601
  "direction": "horizontal",
595
602
  "children": [
596
603
  {
@@ -599,88 +606,101 @@
599
606
  },
600
607
  {
601
608
  "content": "@config.title",
602
- "type": "typography",
603
- "variant": "h3"
609
+ "variant": "h3",
610
+ "type": "typography"
604
611
  }
605
612
  ],
606
613
  "gap": "sm",
607
- "type": "stack"
608
- },
609
- {
610
- "type": "divider"
614
+ "align": "center"
611
615
  },
612
616
  {
613
- "fields": [
617
+ "children": [
614
618
  {
615
- "variant": "caption",
616
- "name": "invoiceNumber",
617
- "label": "Invoice #"
619
+ "value": "@payload.data.length",
620
+ "type": "stat-display",
621
+ "label": "Total invoices",
622
+ "icon": "receipt"
618
623
  },
619
624
  {
620
- "label": "Customer",
621
- "name": "customerId",
622
- "variant": "caption"
625
+ "label": "Outstanding",
626
+ "value": "$28,400",
627
+ "icon": "alert-triangle",
628
+ "type": "stat-display"
623
629
  },
624
630
  {
625
- "name": "status",
626
- "label": "Status",
627
- "variant": "badge"
631
+ "value": "$112,800",
632
+ "icon": "dollar-sign",
633
+ "type": "stat-display",
634
+ "label": "Paid this month"
628
635
  },
629
636
  {
630
- "variant": "caption",
631
- "name": "total",
632
- "label": "Total"
633
- },
637
+ "icon": "clock",
638
+ "label": "Overdue",
639
+ "value": "9",
640
+ "type": "stat-display"
641
+ }
642
+ ],
643
+ "cols": 4.0,
644
+ "type": "simple-grid"
645
+ },
646
+ {
647
+ "type": "divider"
648
+ },
649
+ {
650
+ "cols": 1.0,
651
+ "type": "data-grid",
652
+ "itemActions": [
634
653
  {
635
- "label": "Currency",
636
- "name": "currency",
637
- "variant": "badge"
654
+ "variant": "primary",
655
+ "label": "Open",
656
+ "icon": "arrow-right",
657
+ "event": "OPEN_INVOICE"
638
658
  },
639
659
  {
640
- "variant": "caption",
641
- "name": "dueAt",
642
- "label": "Due"
660
+ "variant": "danger",
661
+ "event": "VOID",
662
+ "icon": "x",
663
+ "label": "Void"
643
664
  }
644
665
  ],
645
- "itemActions": [
666
+ "fields": [
646
667
  {
647
- "label": "View",
648
- "event": "VIEW",
649
- "icon": "eye",
650
- "variant": "secondary"
668
+ "label": "Invoice #",
669
+ "name": "invoiceNumber",
670
+ "variant": "caption"
651
671
  },
652
672
  {
653
- "label": "Send",
654
- "icon": "send",
655
- "event": "SEND",
656
- "variant": "primary"
673
+ "label": "Customer",
674
+ "variant": "caption",
675
+ "name": "customerId"
657
676
  },
658
677
  {
659
- "variant": "primary",
660
- "icon": "check",
661
- "event": "MARK_PAID",
662
- "label": "Mark Paid"
678
+ "variant": "badge",
679
+ "name": "status",
680
+ "label": "Status"
663
681
  },
664
682
  {
665
- "event": "VOID",
666
- "icon": "x",
667
- "variant": "danger",
668
- "label": "Void"
683
+ "label": "Total",
684
+ "name": "total",
685
+ "variant": "caption"
669
686
  },
670
687
  {
671
- "label": "Refund",
672
- "icon": "rotate-ccw",
673
- "event": "REFUND",
674
- "variant": "danger"
688
+ "label": "Currency",
689
+ "variant": "badge",
690
+ "name": "currency"
691
+ },
692
+ {
693
+ "name": "dueAt",
694
+ "label": "Due",
695
+ "variant": "caption"
675
696
  }
676
697
  ],
677
698
  "entity": "@payload.data",
678
- "gap": "sm",
679
- "cols": 1.0,
680
- "type": "data-grid"
699
+ "gap": "sm"
681
700
  }
682
701
  ],
683
- "gap": "md"
702
+ "gap": "md",
703
+ "direction": "vertical"
684
704
  }
685
705
  ]
686
706
  ]
@@ -695,32 +715,57 @@
695
715
  "main",
696
716
  {
697
717
  "message": "@payload.error",
698
- "type": "alert",
699
- "variant": "error"
718
+ "variant": "error",
719
+ "type": "alert"
700
720
  }
701
721
  ]
702
722
  ]
703
723
  },
704
724
  {
705
725
  "from": "browsing",
706
- "to": "viewing",
707
- "event": "VIEW",
726
+ "to": "viewing_single",
727
+ "event": "OPEN_INVOICE",
708
728
  "effects": [
709
729
  [
710
730
  "set",
711
731
  "@entity.id",
712
- "@payload.invoiceId"
732
+ "@payload.row.id"
713
733
  ],
714
734
  [
715
735
  "set",
716
736
  "@entity.invoiceNumber",
717
737
  "@payload.row.invoiceNumber"
718
738
  ],
739
+ [
740
+ "set",
741
+ "@entity.customerId",
742
+ "@payload.row.customerId"
743
+ ],
719
744
  [
720
745
  "set",
721
746
  "@entity.status",
722
747
  "@payload.row.status"
723
748
  ],
749
+ [
750
+ "set",
751
+ "@entity.currency",
752
+ "@payload.row.currency"
753
+ ],
754
+ [
755
+ "set",
756
+ "@entity.subtotal",
757
+ "@payload.row.subtotal"
758
+ ],
759
+ [
760
+ "set",
761
+ "@entity.tax",
762
+ "@payload.row.tax"
763
+ ],
764
+ [
765
+ "set",
766
+ "@entity.total",
767
+ "@payload.row.total"
768
+ ],
724
769
  [
725
770
  "set",
726
771
  "@entity.issuedAt",
@@ -733,13 +778,8 @@
733
778
  ],
734
779
  [
735
780
  "set",
736
- "@entity.customerId",
737
- "@payload.row.customerId"
738
- ],
739
- [
740
- "set",
741
- "@entity.currency",
742
- "@payload.row.currency"
781
+ "@entity.paidAt",
782
+ "@payload.row.paidAt"
743
783
  ],
744
784
  [
745
785
  "set",
@@ -750,156 +790,189 @@
750
790
  "render-ui",
751
791
  "main",
752
792
  {
753
- "gap": "md",
793
+ "type": "stack",
754
794
  "children": [
755
795
  {
756
- "gap": "sm",
757
- "direction": "horizontal",
758
796
  "children": [
759
797
  {
760
- "name": "receipt",
761
- "type": "icon"
798
+ "variant": "ghost",
799
+ "type": "button",
800
+ "action": "CLOSE_VIEW",
801
+ "label": "Back"
802
+ },
803
+ {
804
+ "type": "icon",
805
+ "name": "receipt"
762
806
  },
763
807
  {
764
808
  "type": "typography",
765
- "variant": "h3",
766
- "content": "@entity.invoiceNumber"
809
+ "content": "@entity.invoiceNumber",
810
+ "variant": "h3"
767
811
  },
768
812
  {
769
813
  "label": "@entity.status",
770
814
  "type": "badge",
771
- "variant": "secondary"
815
+ "variant": "default"
772
816
  }
773
817
  ],
818
+ "gap": "sm",
819
+ "align": "center",
820
+ "direction": "horizontal",
774
821
  "type": "stack"
775
822
  },
776
823
  {
777
824
  "type": "divider"
778
825
  },
779
826
  {
780
- "direction": "horizontal",
781
- "gap": "lg",
782
- "type": "stack",
783
827
  "children": [
784
828
  {
829
+ "gap": "md",
830
+ "direction": "horizontal",
785
831
  "children": [
786
832
  {
787
- "type": "typography",
788
- "content": "Issued",
789
833
  "variant": "caption",
834
+ "content": "Customer",
835
+ "type": "typography",
790
836
  "color": "muted"
791
837
  },
792
838
  {
793
- "content": "@entity.issuedAt",
794
839
  "type": "typography",
795
- "variant": "body2"
840
+ "variant": "body",
841
+ "content": "@entity.customerId"
796
842
  }
797
843
  ],
798
- "type": "stack",
799
- "direction": "vertical",
800
- "gap": "xs"
844
+ "type": "stack"
801
845
  },
802
846
  {
803
- "gap": "xs",
804
847
  "type": "stack",
805
- "direction": "vertical",
848
+ "gap": "md",
849
+ "direction": "horizontal",
806
850
  "children": [
807
851
  {
808
- "type": "typography",
809
- "color": "muted",
852
+ "content": "Currency",
810
853
  "variant": "caption",
811
- "content": "Due"
854
+ "type": "typography",
855
+ "color": "muted"
812
856
  },
813
857
  {
814
858
  "type": "typography",
815
- "content": "@entity.dueAt",
816
- "variant": "body2"
859
+ "content": "@entity.currency",
860
+ "variant": "body"
817
861
  }
818
862
  ]
819
863
  },
820
864
  {
821
- "direction": "vertical",
865
+ "gap": "md",
866
+ "type": "stack",
822
867
  "children": [
823
868
  {
824
- "type": "typography",
825
869
  "variant": "caption",
826
870
  "color": "muted",
827
- "content": "Currency"
871
+ "type": "typography",
872
+ "content": "Notes"
828
873
  },
829
874
  {
830
- "variant": "body2",
875
+ "content": "@entity.notes",
831
876
  "type": "typography",
832
- "content": "@entity.currency"
877
+ "variant": "body"
833
878
  }
834
879
  ],
835
- "type": "stack",
836
- "gap": "xs"
880
+ "direction": "horizontal"
837
881
  }
838
- ]
882
+ ],
883
+ "type": "stack",
884
+ "direction": "vertical",
885
+ "gap": "sm"
839
886
  },
840
887
  {
841
888
  "type": "divider"
842
889
  },
843
890
  {
844
- "color": "muted",
845
- "type": "typography",
846
- "content": "@entity.notes",
847
- "variant": "body2"
891
+ "type": "simple-grid",
892
+ "cols": 4.0,
893
+ "children": [
894
+ {
895
+ "label": "Subtotal",
896
+ "value": "@entity.subtotal",
897
+ "type": "stat-display",
898
+ "icon": "dollar-sign"
899
+ },
900
+ {
901
+ "icon": "percent",
902
+ "type": "stat-display",
903
+ "value": "@entity.tax",
904
+ "label": "Tax"
905
+ },
906
+ {
907
+ "icon": "dollar-sign",
908
+ "type": "stat-display",
909
+ "value": "@entity.total",
910
+ "label": "Total"
911
+ },
912
+ {
913
+ "label": "Due",
914
+ "value": "@entity.dueAt",
915
+ "icon": "calendar",
916
+ "type": "stat-display"
917
+ }
918
+ ]
848
919
  },
849
920
  {
850
- "type": "stack",
921
+ "direction": "horizontal",
851
922
  "gap": "sm",
852
- "justify": "end",
923
+ "align": "center",
924
+ "type": "stack",
853
925
  "children": [
854
926
  {
927
+ "variant": "primary",
855
928
  "type": "button",
856
- "icon": "send",
857
- "label": "Send",
858
929
  "action": "SEND",
859
- "variant": "primary"
930
+ "label": "Send",
931
+ "actionPayload": {
932
+ "invoiceId": "@entity.id"
933
+ }
860
934
  },
861
935
  {
862
- "icon": "check",
863
936
  "label": "Mark Paid",
937
+ "actionPayload": {
938
+ "invoiceId": "@entity.id"
939
+ },
864
940
  "type": "button",
865
- "action": "MARK_PAID",
866
- "variant": "primary"
941
+ "variant": "primary",
942
+ "action": "MARK_PAID"
867
943
  },
868
944
  {
869
- "label": "Void",
870
- "variant": "danger",
871
- "icon": "x",
945
+ "type": "button",
946
+ "actionPayload": {
947
+ "invoiceId": "@entity.id"
948
+ },
872
949
  "action": "VOID",
873
- "type": "button"
950
+ "variant": "danger",
951
+ "label": "Void"
874
952
  },
875
953
  {
954
+ "action": "REFUND",
955
+ "actionPayload": {
956
+ "amount": 0.0,
957
+ "invoiceId": "@entity.id"
958
+ },
876
959
  "label": "Refund",
877
- "type": "button",
878
- "icon": "rotate-ccw",
879
960
  "variant": "danger",
880
- "action": "REFUND"
881
- },
882
- {
883
- "variant": "secondary",
884
- "icon": "arrow-left",
885
- "label": "Back",
886
- "action": "INIT",
887
961
  "type": "button"
888
962
  }
889
- ],
890
- "direction": "horizontal"
963
+ ]
891
964
  }
892
965
  ],
893
- "type": "stack",
894
- "direction": "vertical"
966
+ "direction": "vertical",
967
+ "gap": "md"
895
968
  }
896
969
  ]
897
970
  ]
898
971
  },
899
972
  {
900
973
  "from": "browsing",
901
- "to": "browsing",
902
- "event": "SEND",
974
+ "to": "loading",
975
+ "event": "VOID",
903
976
  "effects": [
904
977
  [
905
978
  "set",
@@ -909,12 +982,7 @@
909
982
  [
910
983
  "set",
911
984
  "@entity.status",
912
- "sent"
913
- ],
914
- [
915
- "set",
916
- "@entity.issuedAt",
917
- "now"
985
+ "void"
918
986
  ],
919
987
  [
920
988
  "persist",
@@ -923,85 +991,47 @@
923
991
  "@entity",
924
992
  {
925
993
  "emit": {
926
- "failure": "InvoiceUpdateFailed",
927
- "success": "InvoiceUpdated"
928
- }
929
- }
930
- ],
931
- [
932
- "call-service",
933
- "email",
934
- "send",
935
- {
936
- "invoiceId": "@payload.invoiceId"
937
- },
938
- {
939
- "emit": {
940
- "failure": "InvoiceUpdateFailed",
941
- "success": "InvoiceUpdated"
994
+ "success": "InvoiceUpdated",
995
+ "failure": "InvoiceUpdateFailed"
942
996
  }
943
997
  }
944
- ]
945
- ]
946
- },
947
- {
948
- "from": "browsing",
949
- "to": "browsing",
950
- "event": "MARK_PAID",
951
- "effects": [
952
- [
953
- "set",
954
- "@entity.id",
955
- "@payload.invoiceId"
956
- ],
957
- [
958
- "set",
959
- "@entity.status",
960
- "paid"
961
998
  ],
962
999
  [
963
- "set",
964
- "@entity.paidAt",
965
- "now"
966
- ],
967
- [
968
- "persist",
969
- "update",
970
- "InvoiceRecord",
971
- "@entity",
1000
+ "render-ui",
1001
+ "main",
972
1002
  {
973
- "emit": {
974
- "failure": "InvoiceUpdateFailed",
975
- "success": "InvoiceUpdated"
976
- }
1003
+ "gap": "md",
1004
+ "type": "stack",
1005
+ "align": "center",
1006
+ "children": [
1007
+ {
1008
+ "type": "spinner"
1009
+ },
1010
+ {
1011
+ "content": "Voiding invoice…",
1012
+ "variant": "caption",
1013
+ "type": "typography",
1014
+ "color": "muted"
1015
+ }
1016
+ ],
1017
+ "direction": "vertical",
1018
+ "className": "py-12"
977
1019
  }
978
1020
  ]
979
1021
  ]
980
1022
  },
981
1023
  {
982
1024
  "from": "browsing",
983
- "to": "browsing",
984
- "event": "VOID",
1025
+ "to": "loading",
1026
+ "event": "InvoiceUpdated",
985
1027
  "effects": [
986
1028
  [
987
- "set",
988
- "@entity.id",
989
- "@payload.invoiceId"
990
- ],
991
- [
992
- "set",
993
- "@entity.status",
994
- "void"
995
- ],
996
- [
997
- "persist",
998
- "update",
1029
+ "fetch",
999
1030
  "InvoiceRecord",
1000
- "@entity",
1001
1031
  {
1002
1032
  "emit": {
1003
- "success": "InvoiceUpdated",
1004
- "failure": "InvoiceUpdateFailed"
1033
+ "failure": "InvoiceLoadFailed",
1034
+ "success": "InvoiceLoaded"
1005
1035
  }
1006
1036
  }
1007
1037
  ]
@@ -1010,26 +1040,15 @@
1010
1040
  {
1011
1041
  "from": "browsing",
1012
1042
  "to": "browsing",
1013
- "event": "REFUND",
1043
+ "event": "InvoiceUpdateFailed",
1014
1044
  "effects": [
1015
1045
  [
1016
- "set",
1017
- "@entity.id",
1018
- "@payload.invoiceId"
1019
- ],
1020
- [
1021
- "call-service",
1022
- "stripe",
1023
- "refund",
1024
- {
1025
- "invoiceId": "@payload.invoiceId",
1026
- "amount": "@payload.amount"
1027
- },
1046
+ "render-ui",
1047
+ "main",
1028
1048
  {
1029
- "emit": {
1030
- "success": "InvoiceRefunded",
1031
- "failure": "InvoiceRefundFailed"
1032
- }
1049
+ "variant": "error",
1050
+ "type": "alert",
1051
+ "message": "@payload.error"
1033
1052
  }
1034
1053
  ]
1035
1054
  ]
@@ -1037,7 +1056,7 @@
1037
1056
  {
1038
1057
  "from": "browsing",
1039
1058
  "to": "loading",
1040
- "event": "InvoiceUpdated",
1059
+ "event": "InvoiceRefunded",
1041
1060
  "effects": [
1042
1061
  [
1043
1062
  "fetch",
@@ -1054,23 +1073,23 @@
1054
1073
  {
1055
1074
  "from": "browsing",
1056
1075
  "to": "browsing",
1057
- "event": "InvoiceUpdateFailed",
1076
+ "event": "InvoiceRefundFailed",
1058
1077
  "effects": [
1059
1078
  [
1060
1079
  "render-ui",
1061
1080
  "main",
1062
1081
  {
1082
+ "variant": "error",
1063
1083
  "message": "@payload.error",
1064
- "type": "alert",
1065
- "variant": "error"
1084
+ "type": "alert"
1066
1085
  }
1067
1086
  ]
1068
1087
  ]
1069
1088
  },
1070
1089
  {
1071
- "from": "browsing",
1090
+ "from": "viewing_single",
1072
1091
  "to": "loading",
1073
- "event": "InvoiceRefunded",
1092
+ "event": "CLOSE_VIEW",
1074
1093
  "effects": [
1075
1094
  [
1076
1095
  "fetch",
@@ -1081,56 +1100,240 @@
1081
1100
  "success": "InvoiceLoaded"
1082
1101
  }
1083
1102
  }
1103
+ ],
1104
+ [
1105
+ "render-ui",
1106
+ "main",
1107
+ {
1108
+ "className": "py-12",
1109
+ "gap": "md",
1110
+ "type": "stack",
1111
+ "direction": "vertical",
1112
+ "align": "center",
1113
+ "children": [
1114
+ {
1115
+ "type": "spinner"
1116
+ },
1117
+ {
1118
+ "content": "Loading invoices…",
1119
+ "type": "typography",
1120
+ "variant": "caption",
1121
+ "color": "muted"
1122
+ }
1123
+ ]
1124
+ }
1084
1125
  ]
1085
1126
  ]
1086
1127
  },
1087
1128
  {
1088
- "from": "browsing",
1089
- "to": "browsing",
1090
- "event": "InvoiceRefundFailed",
1129
+ "from": "viewing_single",
1130
+ "to": "loading",
1131
+ "event": "SEND",
1091
1132
  "effects": [
1133
+ [
1134
+ "set",
1135
+ "@entity.id",
1136
+ "@payload.invoiceId"
1137
+ ],
1138
+ [
1139
+ "set",
1140
+ "@entity.status",
1141
+ "sent"
1142
+ ],
1143
+ [
1144
+ "set",
1145
+ "@entity.issuedAt",
1146
+ "now"
1147
+ ],
1148
+ [
1149
+ "persist",
1150
+ "update",
1151
+ "InvoiceRecord",
1152
+ "@entity",
1153
+ {
1154
+ "emit": {
1155
+ "failure": "InvoiceUpdateFailed",
1156
+ "success": "InvoiceUpdated"
1157
+ }
1158
+ }
1159
+ ],
1092
1160
  [
1093
1161
  "render-ui",
1094
1162
  "main",
1095
1163
  {
1096
- "variant": "error",
1097
- "message": "@payload.error",
1098
- "type": "alert"
1164
+ "direction": "vertical",
1165
+ "gap": "md",
1166
+ "align": "center",
1167
+ "type": "stack",
1168
+ "className": "py-12",
1169
+ "children": [
1170
+ {
1171
+ "type": "spinner"
1172
+ },
1173
+ {
1174
+ "type": "typography",
1175
+ "content": "Sending invoice…",
1176
+ "variant": "caption",
1177
+ "color": "muted"
1178
+ }
1179
+ ]
1099
1180
  }
1100
1181
  ]
1101
1182
  ]
1102
1183
  },
1103
1184
  {
1104
- "from": "viewing",
1185
+ "from": "viewing_single",
1105
1186
  "to": "loading",
1106
- "event": "INIT",
1187
+ "event": "MARK_PAID",
1107
1188
  "effects": [
1108
1189
  [
1109
- "fetch",
1190
+ "set",
1191
+ "@entity.id",
1192
+ "@payload.invoiceId"
1193
+ ],
1194
+ [
1195
+ "set",
1196
+ "@entity.status",
1197
+ "paid"
1198
+ ],
1199
+ [
1200
+ "set",
1201
+ "@entity.paidAt",
1202
+ "now"
1203
+ ],
1204
+ [
1205
+ "persist",
1206
+ "update",
1110
1207
  "InvoiceRecord",
1208
+ "@entity",
1111
1209
  {
1112
1210
  "emit": {
1113
- "success": "InvoiceLoaded",
1114
- "failure": "InvoiceLoadFailed"
1211
+ "success": "InvoiceUpdated",
1212
+ "failure": "InvoiceUpdateFailed"
1115
1213
  }
1116
1214
  }
1215
+ ],
1216
+ [
1217
+ "render-ui",
1218
+ "main",
1219
+ {
1220
+ "type": "stack",
1221
+ "align": "center",
1222
+ "direction": "vertical",
1223
+ "className": "py-12",
1224
+ "children": [
1225
+ {
1226
+ "type": "spinner"
1227
+ },
1228
+ {
1229
+ "color": "muted",
1230
+ "type": "typography",
1231
+ "variant": "caption",
1232
+ "content": "Marking invoice paid…"
1233
+ }
1234
+ ],
1235
+ "gap": "md"
1236
+ }
1117
1237
  ]
1118
1238
  ]
1119
1239
  },
1120
1240
  {
1121
- "from": "viewing",
1241
+ "from": "viewing_single",
1122
1242
  "to": "loading",
1123
- "event": "InvoiceUpdated",
1243
+ "event": "VOID",
1124
1244
  "effects": [
1125
1245
  [
1126
- "fetch",
1246
+ "set",
1247
+ "@entity.id",
1248
+ "@payload.invoiceId"
1249
+ ],
1250
+ [
1251
+ "set",
1252
+ "@entity.status",
1253
+ "void"
1254
+ ],
1255
+ [
1256
+ "persist",
1257
+ "update",
1127
1258
  "InvoiceRecord",
1259
+ "@entity",
1128
1260
  {
1129
1261
  "emit": {
1130
- "success": "InvoiceLoaded",
1131
- "failure": "InvoiceLoadFailed"
1262
+ "failure": "InvoiceUpdateFailed",
1263
+ "success": "InvoiceUpdated"
1264
+ }
1265
+ }
1266
+ ],
1267
+ [
1268
+ "render-ui",
1269
+ "main",
1270
+ {
1271
+ "gap": "md",
1272
+ "children": [
1273
+ {
1274
+ "type": "spinner"
1275
+ },
1276
+ {
1277
+ "variant": "caption",
1278
+ "type": "typography",
1279
+ "color": "muted",
1280
+ "content": "Voiding invoice…"
1281
+ }
1282
+ ],
1283
+ "direction": "vertical",
1284
+ "className": "py-12",
1285
+ "align": "center",
1286
+ "type": "stack"
1287
+ }
1288
+ ]
1289
+ ]
1290
+ },
1291
+ {
1292
+ "from": "viewing_single",
1293
+ "to": "loading",
1294
+ "event": "REFUND",
1295
+ "effects": [
1296
+ [
1297
+ "set",
1298
+ "@entity.id",
1299
+ "@payload.invoiceId"
1300
+ ],
1301
+ [
1302
+ "call-service",
1303
+ "stripe",
1304
+ "refund",
1305
+ {
1306
+ "amount": "@payload.amount",
1307
+ "invoiceId": "@payload.invoiceId"
1308
+ },
1309
+ {
1310
+ "emit": {
1311
+ "success": "InvoiceRefunded",
1312
+ "failure": "InvoiceRefundFailed"
1132
1313
  }
1133
1314
  }
1315
+ ],
1316
+ [
1317
+ "render-ui",
1318
+ "main",
1319
+ {
1320
+ "align": "center",
1321
+ "className": "py-12",
1322
+ "direction": "vertical",
1323
+ "children": [
1324
+ {
1325
+ "type": "spinner"
1326
+ },
1327
+ {
1328
+ "content": "Refunding invoice…",
1329
+ "variant": "caption",
1330
+ "type": "typography",
1331
+ "color": "muted"
1332
+ }
1333
+ ],
1334
+ "type": "stack",
1335
+ "gap": "md"
1336
+ }
1134
1337
  ]
1135
1338
  ]
1136
1339
  },
@@ -1153,8 +1356,8 @@
1153
1356
  "render-ui",
1154
1357
  "main",
1155
1358
  {
1156
- "type": "spinner",
1157
- "size": "sm"
1359
+ "size": "sm",
1360
+ "type": "spinner"
1158
1361
  }
1159
1362
  ]
1160
1363
  ]
@@ -1162,13 +1365,13 @@
1162
1365
  ]
1163
1366
  },
1164
1367
  "config": {
1165
- "title": {
1166
- "type": "string",
1167
- "default": "Invoices"
1168
- },
1169
1368
  "refundTiersJson": {
1170
1369
  "type": "string",
1171
1370
  "default": "[]"
1371
+ },
1372
+ "title": {
1373
+ "type": "string",
1374
+ "default": "Invoices"
1172
1375
  }
1173
1376
  },
1174
1377
  "scope": "collection"