@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-technician-dispatch",
3
3
  "version": "1.0.0",
4
- "description": "std-technician-dispatch — dispatch board for field technicians. Owns a Technician entity (id, skills, availability, current assignment, last-known location) and a single trait that loads the roster, renders an Assign / SetUnavailable data-grid, and tracks accept / reject responses so a parent molecule can wire them to its WorkOrder.",
4
+ "description": "std-technician-dispatch — dispatch board for field technicians. Lists technicians in `browsing`; opens detail in `viewing_single` with Assign / Accept / Reject / Toggle Availability actions.",
5
5
  "orbitals": [
6
6
  {
7
7
  "name": "TechnicianDispatchOrbital",
@@ -60,6 +60,57 @@
60
60
  "category": "interaction",
61
61
  "linkedEntity": "Technician",
62
62
  "emits": [
63
+ {
64
+ "event": "OPEN_TECHNICIAN",
65
+ "payloadSchema": [
66
+ {
67
+ "name": "id",
68
+ "type": "string",
69
+ "required": true
70
+ },
71
+ {
72
+ "name": "row.id",
73
+ "type": "string",
74
+ "required": true
75
+ },
76
+ {
77
+ "name": "row.name",
78
+ "type": "string",
79
+ "required": true
80
+ },
81
+ {
82
+ "name": "row.phone",
83
+ "type": "string"
84
+ },
85
+ {
86
+ "name": "row.skills",
87
+ "type": "[string]"
88
+ },
89
+ {
90
+ "name": "row.available",
91
+ "type": "boolean"
92
+ },
93
+ {
94
+ "name": "row.currentOrderId",
95
+ "type": "string"
96
+ },
97
+ {
98
+ "name": "row.lat",
99
+ "type": "number"
100
+ },
101
+ {
102
+ "name": "row.lng",
103
+ "type": "number"
104
+ },
105
+ {
106
+ "name": "row.lastSeenAt",
107
+ "type": "string"
108
+ }
109
+ ]
110
+ },
111
+ {
112
+ "event": "CLOSE_VIEW"
113
+ },
63
114
  {
64
115
  "event": "ASSIGN",
65
116
  "payloadSchema": [
@@ -218,6 +269,9 @@
218
269
  {
219
270
  "name": "browsing"
220
271
  },
272
+ {
273
+ "name": "viewing_single"
274
+ },
221
275
  {
222
276
  "name": "error"
223
277
  }
@@ -251,6 +305,21 @@
251
305
  }
252
306
  ]
253
307
  },
308
+ {
309
+ "key": "OPEN_TECHNICIAN",
310
+ "name": "Open Technician",
311
+ "payloadSchema": [
312
+ {
313
+ "name": "id",
314
+ "type": "string",
315
+ "required": true
316
+ },
317
+ {
318
+ "name": "row",
319
+ "type": "Technician"
320
+ }
321
+ ]
322
+ },
254
323
  {
255
324
  "key": "ASSIGN",
256
325
  "name": "Assign",
@@ -350,6 +419,10 @@
350
419
  "required": true
351
420
  }
352
421
  ]
422
+ },
423
+ {
424
+ "key": "CLOSE_VIEW",
425
+ "name": "Close View"
353
426
  }
354
427
  ],
355
428
  "transitions": [
@@ -372,22 +445,22 @@
372
445
  "render-ui",
373
446
  "main",
374
447
  {
375
- "align": "center",
376
448
  "children": [
377
449
  {
378
450
  "type": "spinner"
379
451
  },
380
452
  {
381
- "variant": "caption",
382
- "color": "muted",
383
453
  "type": "typography",
384
- "content": "Loading technicians…"
454
+ "color": "muted",
455
+ "content": "Loading technicians…",
456
+ "variant": "caption"
385
457
  }
386
458
  ],
387
- "direction": "vertical",
388
459
  "type": "stack",
389
460
  "className": "py-12",
390
- "gap": "md"
461
+ "direction": "vertical",
462
+ "gap": "md",
463
+ "align": "center"
391
464
  }
392
465
  ]
393
466
  ]
@@ -401,77 +474,107 @@
401
474
  "render-ui",
402
475
  "main",
403
476
  {
404
- "type": "stack",
405
- "gap": "md",
406
477
  "children": [
407
478
  {
408
- "gap": "sm",
409
479
  "type": "stack",
410
480
  "direction": "horizontal",
481
+ "align": "center",
411
482
  "children": [
412
483
  {
413
- "type": "icon",
414
- "name": "hard-hat"
484
+ "name": "hard-hat",
485
+ "type": "icon"
415
486
  },
416
487
  {
417
488
  "type": "typography",
418
489
  "variant": "h3",
419
490
  "content": "@config.title"
420
491
  }
421
- ]
492
+ ],
493
+ "gap": "sm"
494
+ },
495
+ {
496
+ "cols": 4.0,
497
+ "children": [
498
+ {
499
+ "type": "stat-display",
500
+ "icon": "users",
501
+ "label": "Total technicians",
502
+ "value": "@payload.data.length"
503
+ },
504
+ {
505
+ "value": "18",
506
+ "icon": "check-circle",
507
+ "type": "stat-display",
508
+ "label": "Available now"
509
+ },
510
+ {
511
+ "icon": "navigation",
512
+ "label": "On assignment",
513
+ "value": "9",
514
+ "type": "stat-display"
515
+ },
516
+ {
517
+ "icon": "clock",
518
+ "type": "stat-display",
519
+ "label": "Avg response",
520
+ "value": "12m"
521
+ }
522
+ ],
523
+ "type": "simple-grid"
422
524
  },
423
525
  {
424
526
  "type": "divider"
425
527
  },
426
528
  {
427
- "entity": "@payload.data",
428
529
  "type": "data-grid",
429
- "gap": "sm",
530
+ "entity": "@payload.data",
531
+ "cols": 1.0,
430
532
  "fields": [
431
533
  {
432
- "variant": "body",
433
534
  "name": "name",
434
- "label": "Technician"
535
+ "label": "Technician",
536
+ "variant": "body"
435
537
  },
436
538
  {
437
- "name": "skills",
539
+ "label": "Skills",
438
540
  "variant": "caption",
439
- "label": "Skills"
541
+ "name": "skills"
440
542
  },
441
543
  {
442
- "label": "Available",
443
544
  "variant": "badge",
444
- "name": "available"
545
+ "name": "available",
546
+ "label": "Available"
445
547
  },
446
548
  {
549
+ "name": "currentOrderId",
447
550
  "variant": "caption",
448
- "label": "Current Order",
449
- "name": "currentOrderId"
551
+ "label": "Current Order"
450
552
  },
451
553
  {
554
+ "name": "lastSeenAt",
452
555
  "label": "Last Seen",
453
- "variant": "caption",
454
- "name": "lastSeenAt"
556
+ "variant": "caption"
455
557
  }
456
558
  ],
457
- "cols": 1.0,
559
+ "gap": "sm",
458
560
  "itemActions": [
459
561
  {
460
- "event": "ASSIGN",
461
- "variant": "primary",
462
- "label": "Assign",
463
- "icon": "user-plus"
562
+ "icon": "arrow-right",
563
+ "label": "Open",
564
+ "event": "OPEN_TECHNICIAN",
565
+ "variant": "primary"
464
566
  },
465
567
  {
466
- "icon": "user-minus",
467
- "label": "Set Unavailable",
468
- "variant": "secondary",
469
- "event": "TOGGLE_AVAILABLE"
568
+ "variant": "danger",
569
+ "event": "ASSIGN",
570
+ "label": "Assign"
470
571
  }
471
572
  ]
472
573
  }
473
574
  ],
474
- "direction": "vertical"
575
+ "gap": "md",
576
+ "direction": "vertical",
577
+ "type": "stack"
475
578
  }
476
579
  ]
477
580
  ]
@@ -485,44 +588,276 @@
485
588
  "render-ui",
486
589
  "main",
487
590
  {
591
+ "message": "@payload.error",
488
592
  "variant": "error",
489
- "type": "alert",
490
- "message": "@payload.error"
593
+ "type": "alert"
491
594
  }
492
595
  ]
493
596
  ]
494
597
  },
495
598
  {
496
599
  "from": "browsing",
497
- "to": "browsing",
498
- "event": "ASSIGN",
600
+ "to": "viewing_single",
601
+ "event": "OPEN_TECHNICIAN",
499
602
  "effects": [
500
603
  [
501
604
  "set",
502
605
  "@entity.id",
503
- "@payload.technicianId"
606
+ "@payload.row.id"
504
607
  ],
505
608
  [
506
609
  "set",
507
- "@entity.currentOrderId",
508
- "@payload.orderId"
610
+ "@entity.name",
611
+ "@payload.row.name"
612
+ ],
613
+ [
614
+ "set",
615
+ "@entity.phone",
616
+ "@payload.row.phone"
617
+ ],
618
+ [
619
+ "set",
620
+ "@entity.skills",
621
+ "@payload.row.skills"
509
622
  ],
510
623
  [
511
624
  "set",
512
625
  "@entity.available",
513
- false
626
+ "@payload.row.available"
514
627
  ],
515
628
  [
516
- "persist",
517
- "update",
629
+ "set",
630
+ "@entity.currentOrderId",
631
+ "@payload.row.currentOrderId"
632
+ ],
633
+ [
634
+ "set",
635
+ "@entity.lat",
636
+ "@payload.row.lat"
637
+ ],
638
+ [
639
+ "set",
640
+ "@entity.lng",
641
+ "@payload.row.lng"
642
+ ],
643
+ [
644
+ "set",
645
+ "@entity.lastSeenAt",
646
+ "@payload.row.lastSeenAt"
647
+ ],
648
+ [
649
+ "render-ui",
650
+ "main",
651
+ {
652
+ "type": "stack",
653
+ "direction": "vertical",
654
+ "children": [
655
+ {
656
+ "type": "stack",
657
+ "direction": "horizontal",
658
+ "children": [
659
+ {
660
+ "type": "button",
661
+ "label": "Back",
662
+ "variant": "ghost",
663
+ "action": "CLOSE_VIEW"
664
+ },
665
+ {
666
+ "type": "icon",
667
+ "name": "hard-hat"
668
+ },
669
+ {
670
+ "type": "typography",
671
+ "variant": "h3",
672
+ "content": "@entity.name"
673
+ },
674
+ {
675
+ "label": "@entity.lastSeenAt",
676
+ "variant": "primary",
677
+ "type": "badge"
678
+ }
679
+ ],
680
+ "align": "center",
681
+ "gap": "sm"
682
+ },
683
+ {
684
+ "type": "divider"
685
+ },
686
+ {
687
+ "direction": "vertical",
688
+ "children": [
689
+ {
690
+ "type": "stack",
691
+ "direction": "horizontal",
692
+ "gap": "md",
693
+ "children": [
694
+ {
695
+ "type": "typography",
696
+ "variant": "caption",
697
+ "color": "muted",
698
+ "content": "Phone"
699
+ },
700
+ {
701
+ "content": "@entity.phone",
702
+ "variant": "body",
703
+ "type": "typography"
704
+ }
705
+ ]
706
+ },
707
+ {
708
+ "gap": "md",
709
+ "direction": "horizontal",
710
+ "type": "stack",
711
+ "children": [
712
+ {
713
+ "type": "typography",
714
+ "content": "Current order",
715
+ "variant": "caption",
716
+ "color": "muted"
717
+ },
718
+ {
719
+ "variant": "body",
720
+ "content": "@entity.currentOrderId",
721
+ "type": "typography"
722
+ }
723
+ ]
724
+ },
725
+ {
726
+ "type": "stack",
727
+ "direction": "horizontal",
728
+ "children": [
729
+ {
730
+ "variant": "caption",
731
+ "color": "muted",
732
+ "content": "Last seen",
733
+ "type": "typography"
734
+ },
735
+ {
736
+ "type": "typography",
737
+ "content": "@entity.lastSeenAt",
738
+ "variant": "body"
739
+ }
740
+ ],
741
+ "gap": "md"
742
+ }
743
+ ],
744
+ "type": "stack",
745
+ "gap": "sm"
746
+ },
747
+ {
748
+ "type": "divider"
749
+ },
750
+ {
751
+ "type": "simple-grid",
752
+ "cols": 2.0,
753
+ "children": [
754
+ {
755
+ "label": "Latitude",
756
+ "value": "@entity.lat",
757
+ "type": "stat-display",
758
+ "icon": "map-pin"
759
+ },
760
+ {
761
+ "type": "stat-display",
762
+ "icon": "map-pin",
763
+ "label": "Longitude",
764
+ "value": "@entity.lng"
765
+ }
766
+ ]
767
+ },
768
+ {
769
+ "children": [
770
+ {
771
+ "variant": "primary",
772
+ "type": "button",
773
+ "action": "ASSIGN",
774
+ "actionPayload": {
775
+ "orderId": "@entity.currentOrderId",
776
+ "technicianId": "@entity.id"
777
+ },
778
+ "label": "Assign"
779
+ },
780
+ {
781
+ "actionPayload": {
782
+ "technicianId": "@entity.id"
783
+ },
784
+ "label": "Accept",
785
+ "variant": "secondary",
786
+ "type": "button",
787
+ "action": "ACCEPT"
788
+ },
789
+ {
790
+ "action": "REJECT",
791
+ "actionPayload": {
792
+ "technicianId": "@entity.id"
793
+ },
794
+ "type": "button",
795
+ "variant": "danger",
796
+ "label": "Reject"
797
+ },
798
+ {
799
+ "action": "TOGGLE_AVAILABLE",
800
+ "actionPayload": {
801
+ "technicianId": "@entity.id",
802
+ "available": false
803
+ },
804
+ "variant": "secondary",
805
+ "label": "Toggle Available",
806
+ "type": "button"
807
+ }
808
+ ],
809
+ "direction": "horizontal",
810
+ "align": "center",
811
+ "type": "stack",
812
+ "gap": "sm"
813
+ }
814
+ ],
815
+ "gap": "md"
816
+ }
817
+ ]
818
+ ]
819
+ },
820
+ {
821
+ "from": "browsing",
822
+ "to": "loading",
823
+ "event": "ASSIGN",
824
+ "effects": [
825
+ [
826
+ "set",
827
+ "@entity.id",
828
+ "@payload.technicianId"
829
+ ],
830
+ [
831
+ "fetch",
518
832
  "Technician",
519
- "@entity",
520
833
  {
521
834
  "emit": {
522
- "failure": "TechnicianUpdateFailed",
523
- "success": "TechnicianUpdated"
835
+ "success": "TechnicianLoaded",
836
+ "failure": "TechnicianLoadFailed"
524
837
  }
525
838
  }
839
+ ],
840
+ [
841
+ "render-ui",
842
+ "main",
843
+ {
844
+ "type": "stack",
845
+ "align": "center",
846
+ "direction": "vertical",
847
+ "className": "py-12",
848
+ "gap": "md",
849
+ "children": [
850
+ {
851
+ "type": "spinner"
852
+ },
853
+ {
854
+ "type": "typography",
855
+ "content": "Assigning technician…",
856
+ "color": "muted",
857
+ "variant": "caption"
858
+ }
859
+ ]
860
+ }
526
861
  ]
527
862
  ]
528
863
  },
@@ -542,7 +877,7 @@
542
877
  },
543
878
  {
544
879
  "from": "browsing",
545
- "to": "browsing",
880
+ "to": "loading",
546
881
  "event": "REJECT",
547
882
  "effects": [
548
883
  [
@@ -551,39 +886,49 @@
551
886
  "@payload.technicianId"
552
887
  ],
553
888
  [
554
- "set",
555
- "@entity.currentOrderId",
556
- ""
557
- ],
558
- [
559
- "set",
560
- "@entity.available",
561
- true
889
+ "emit",
890
+ "AssignmentRejected",
891
+ {
892
+ "technicianId": "@payload.technicianId"
893
+ }
562
894
  ],
563
895
  [
564
- "persist",
565
- "update",
896
+ "fetch",
566
897
  "Technician",
567
- "@entity",
568
898
  {
569
899
  "emit": {
570
- "failure": "TechnicianUpdateFailed",
571
- "success": "TechnicianUpdated"
900
+ "failure": "TechnicianLoadFailed",
901
+ "success": "TechnicianLoaded"
572
902
  }
573
903
  }
574
904
  ],
575
905
  [
576
- "emit",
577
- "AssignmentRejected",
906
+ "render-ui",
907
+ "main",
578
908
  {
579
- "technicianId": "@payload.technicianId"
909
+ "direction": "vertical",
910
+ "children": [
911
+ {
912
+ "type": "spinner"
913
+ },
914
+ {
915
+ "content": "Releasing technician…",
916
+ "type": "typography",
917
+ "color": "muted",
918
+ "variant": "caption"
919
+ }
920
+ ],
921
+ "type": "stack",
922
+ "align": "center",
923
+ "className": "py-12",
924
+ "gap": "md"
580
925
  }
581
926
  ]
582
927
  ]
583
928
  },
584
929
  {
585
930
  "from": "browsing",
586
- "to": "browsing",
931
+ "to": "loading",
587
932
  "event": "TOGGLE_AVAILABLE",
588
933
  "effects": [
589
934
  [
@@ -603,10 +948,32 @@
603
948
  "@entity",
604
949
  {
605
950
  "emit": {
606
- "success": "TechnicianUpdated",
607
- "failure": "TechnicianUpdateFailed"
951
+ "failure": "TechnicianUpdateFailed",
952
+ "success": "TechnicianUpdated"
608
953
  }
609
954
  }
955
+ ],
956
+ [
957
+ "render-ui",
958
+ "main",
959
+ {
960
+ "children": [
961
+ {
962
+ "type": "spinner"
963
+ },
964
+ {
965
+ "type": "typography",
966
+ "color": "muted",
967
+ "variant": "caption",
968
+ "content": "Updating availability…"
969
+ }
970
+ ],
971
+ "className": "py-12",
972
+ "align": "center",
973
+ "type": "stack",
974
+ "gap": "md",
975
+ "direction": "vertical"
976
+ }
610
977
  ]
611
978
  ]
612
979
  },
@@ -636,8 +1003,8 @@
636
1003
  "render-ui",
637
1004
  "main",
638
1005
  {
639
- "variant": "error",
640
1006
  "type": "alert",
1007
+ "variant": "error",
641
1008
  "message": "@payload.error"
642
1009
  }
643
1010
  ]
@@ -654,10 +1021,98 @@
654
1021
  "event": "AssignmentRejected"
655
1022
  },
656
1023
  {
657
- "from": "error",
1024
+ "from": "viewing_single",
658
1025
  "to": "loading",
659
- "event": "INIT",
1026
+ "event": "CLOSE_VIEW",
1027
+ "effects": [
1028
+ [
1029
+ "fetch",
1030
+ "Technician",
1031
+ {
1032
+ "emit": {
1033
+ "success": "TechnicianLoaded",
1034
+ "failure": "TechnicianLoadFailed"
1035
+ }
1036
+ }
1037
+ ],
1038
+ [
1039
+ "render-ui",
1040
+ "main",
1041
+ {
1042
+ "className": "py-12",
1043
+ "type": "stack",
1044
+ "direction": "vertical",
1045
+ "gap": "md",
1046
+ "align": "center",
1047
+ "children": [
1048
+ {
1049
+ "type": "spinner"
1050
+ },
1051
+ {
1052
+ "variant": "caption",
1053
+ "content": "Loading technicians…",
1054
+ "color": "muted",
1055
+ "type": "typography"
1056
+ }
1057
+ ]
1058
+ }
1059
+ ]
1060
+ ]
1061
+ },
1062
+ {
1063
+ "from": "viewing_single",
1064
+ "to": "loading",
1065
+ "event": "ASSIGN",
1066
+ "effects": [
1067
+ [
1068
+ "set",
1069
+ "@entity.id",
1070
+ "@payload.technicianId"
1071
+ ],
1072
+ [
1073
+ "fetch",
1074
+ "Technician",
1075
+ {
1076
+ "emit": {
1077
+ "success": "TechnicianLoaded",
1078
+ "failure": "TechnicianLoadFailed"
1079
+ }
1080
+ }
1081
+ ],
1082
+ [
1083
+ "render-ui",
1084
+ "main",
1085
+ {
1086
+ "className": "py-12",
1087
+ "gap": "md",
1088
+ "direction": "vertical",
1089
+ "type": "stack",
1090
+ "align": "center",
1091
+ "children": [
1092
+ {
1093
+ "type": "spinner"
1094
+ },
1095
+ {
1096
+ "variant": "caption",
1097
+ "content": "Assigning technician…",
1098
+ "type": "typography",
1099
+ "color": "muted"
1100
+ }
1101
+ ]
1102
+ }
1103
+ ]
1104
+ ]
1105
+ },
1106
+ {
1107
+ "from": "viewing_single",
1108
+ "to": "loading",
1109
+ "event": "ACCEPT",
660
1110
  "effects": [
1111
+ [
1112
+ "set",
1113
+ "@entity.id",
1114
+ "@payload.technicianId"
1115
+ ],
661
1116
  [
662
1117
  "fetch",
663
1118
  "Technician",
@@ -668,6 +1123,133 @@
668
1123
  }
669
1124
  }
670
1125
  ],
1126
+ [
1127
+ "render-ui",
1128
+ "main",
1129
+ {
1130
+ "type": "stack",
1131
+ "align": "center",
1132
+ "children": [
1133
+ {
1134
+ "type": "spinner"
1135
+ },
1136
+ {
1137
+ "variant": "caption",
1138
+ "type": "typography",
1139
+ "color": "muted",
1140
+ "content": "Confirming assignment…"
1141
+ }
1142
+ ],
1143
+ "gap": "md",
1144
+ "direction": "vertical",
1145
+ "className": "py-12"
1146
+ }
1147
+ ]
1148
+ ]
1149
+ },
1150
+ {
1151
+ "from": "viewing_single",
1152
+ "to": "loading",
1153
+ "event": "REJECT",
1154
+ "effects": [
1155
+ [
1156
+ "set",
1157
+ "@entity.id",
1158
+ "@payload.technicianId"
1159
+ ],
1160
+ [
1161
+ "fetch",
1162
+ "Technician",
1163
+ {
1164
+ "emit": {
1165
+ "failure": "TechnicianLoadFailed",
1166
+ "success": "TechnicianLoaded"
1167
+ }
1168
+ }
1169
+ ],
1170
+ [
1171
+ "render-ui",
1172
+ "main",
1173
+ {
1174
+ "direction": "vertical",
1175
+ "align": "center",
1176
+ "gap": "md",
1177
+ "className": "py-12",
1178
+ "children": [
1179
+ {
1180
+ "type": "spinner"
1181
+ },
1182
+ {
1183
+ "color": "muted",
1184
+ "variant": "caption",
1185
+ "type": "typography",
1186
+ "content": "Releasing technician…"
1187
+ }
1188
+ ],
1189
+ "type": "stack"
1190
+ }
1191
+ ]
1192
+ ]
1193
+ },
1194
+ {
1195
+ "from": "viewing_single",
1196
+ "to": "loading",
1197
+ "event": "TOGGLE_AVAILABLE",
1198
+ "effects": [
1199
+ [
1200
+ "set",
1201
+ "@entity.id",
1202
+ "@payload.technicianId"
1203
+ ],
1204
+ [
1205
+ "fetch",
1206
+ "Technician",
1207
+ {
1208
+ "emit": {
1209
+ "success": "TechnicianLoaded",
1210
+ "failure": "TechnicianLoadFailed"
1211
+ }
1212
+ }
1213
+ ],
1214
+ [
1215
+ "render-ui",
1216
+ "main",
1217
+ {
1218
+ "type": "stack",
1219
+ "children": [
1220
+ {
1221
+ "type": "spinner"
1222
+ },
1223
+ {
1224
+ "variant": "caption",
1225
+ "color": "muted",
1226
+ "type": "typography",
1227
+ "content": "Updating availability…"
1228
+ }
1229
+ ],
1230
+ "gap": "md",
1231
+ "align": "center",
1232
+ "className": "py-12",
1233
+ "direction": "vertical"
1234
+ }
1235
+ ]
1236
+ ]
1237
+ },
1238
+ {
1239
+ "from": "error",
1240
+ "to": "loading",
1241
+ "event": "INIT",
1242
+ "effects": [
1243
+ [
1244
+ "fetch",
1245
+ "Technician",
1246
+ {
1247
+ "emit": {
1248
+ "success": "TechnicianLoaded",
1249
+ "failure": "TechnicianLoadFailed"
1250
+ }
1251
+ }
1252
+ ],
671
1253
  [
672
1254
  "render-ui",
673
1255
  "main",