@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-route-optimize",
3
3
  "version": "1.0.0",
4
- "description": "std-route-optimize — multi-stop route ordering for technician dispatch. Owns a Route entity (origin coords + ordered stops + totals); OPTIMIZE invokes the route-optimize service to reorder stops, then persists the updated row and emits RouteUpdated for downstream listeners.",
4
+ "description": "std-route-optimize — multi-stop route ordering for technician dispatch. Lists routes in `browsing`; opens detail in `viewing_single` with Optimize / Reset actions.",
5
5
  "orbitals": [
6
6
  {
7
7
  "name": "RouteOptimizeOrbital",
@@ -55,40 +55,13 @@
55
55
  "linkedEntity": "Route",
56
56
  "emits": [
57
57
  {
58
- "event": "OPTIMIZE",
58
+ "event": "OPEN_ROUTE",
59
59
  "payloadSchema": [
60
60
  {
61
- "name": "routeId",
61
+ "name": "id",
62
62
  "type": "string",
63
63
  "required": true
64
- }
65
- ]
66
- },
67
- {
68
- "event": "RouteLoaded",
69
- "payloadSchema": [
70
- {
71
- "name": "data",
72
- "type": "[Route]"
73
- }
74
- ]
75
- },
76
- {
77
- "event": "RouteLoadFailed",
78
- "payloadSchema": [
79
- {
80
- "name": "error",
81
- "type": "string"
82
64
  },
83
- {
84
- "name": "code",
85
- "type": "string"
86
- }
87
- ]
88
- },
89
- {
90
- "event": "RouteOptimized",
91
- "payloadSchema": [
92
65
  {
93
66
  "name": "row.id",
94
67
  "type": "string",
@@ -125,52 +98,46 @@
125
98
  ]
126
99
  },
127
100
  {
128
- "event": "RouteOptimizeFailed",
101
+ "event": "CLOSE_VIEW"
102
+ },
103
+ {
104
+ "event": "OPTIMIZE",
129
105
  "payloadSchema": [
130
106
  {
131
- "name": "error",
132
- "type": "string"
133
- },
134
- {
135
- "name": "code",
136
- "type": "string"
107
+ "name": "id",
108
+ "type": "string",
109
+ "required": true
137
110
  }
138
111
  ]
139
112
  },
140
113
  {
141
- "event": "RouteUpdated",
114
+ "event": "RESET_ROUTE",
142
115
  "payloadSchema": [
143
116
  {
144
- "name": "row.id",
117
+ "name": "id",
145
118
  "type": "string",
146
119
  "required": true
147
- },
148
- {
149
- "name": "row.technicianId",
150
- "type": "string"
151
- },
152
- {
153
- "name": "row.originLat",
154
- "type": "number"
155
- },
156
- {
157
- "name": "row.originLng",
158
- "type": "number"
159
- },
160
- {
161
- "name": "row.stops",
162
- "type": "[string]"
163
- },
120
+ }
121
+ ]
122
+ },
123
+ {
124
+ "event": "RouteLoaded",
125
+ "payloadSchema": [
164
126
  {
165
- "name": "row.totalDistanceKm",
166
- "type": "number"
167
- },
127
+ "name": "data",
128
+ "type": "[Route]"
129
+ }
130
+ ]
131
+ },
132
+ {
133
+ "event": "RouteLoadFailed",
134
+ "payloadSchema": [
168
135
  {
169
- "name": "row.totalDurationMinutes",
170
- "type": "number"
136
+ "name": "error",
137
+ "type": "string"
171
138
  },
172
139
  {
173
- "name": "row.optimizedAt",
140
+ "name": "code",
174
141
  "type": "string"
175
142
  }
176
143
  ]
@@ -186,7 +153,7 @@
186
153
  "name": "browsing"
187
154
  },
188
155
  {
189
- "name": "optimizing"
156
+ "name": "viewing_single"
190
157
  },
191
158
  {
192
159
  "name": "error"
@@ -222,20 +189,14 @@
222
189
  ]
223
190
  },
224
191
  {
225
- "key": "OPTIMIZE",
226
- "name": "Optimize",
192
+ "key": "OPEN_ROUTE",
193
+ "name": "Open Route",
227
194
  "payloadSchema": [
228
195
  {
229
- "name": "routeId",
196
+ "name": "id",
230
197
  "type": "string",
231
198
  "required": true
232
- }
233
- ]
234
- },
235
- {
236
- "key": "RouteUpdated",
237
- "name": "Route updated",
238
- "payloadSchema": [
199
+ },
239
200
  {
240
201
  "name": "row",
241
202
  "type": "Route"
@@ -243,28 +204,30 @@
243
204
  ]
244
205
  },
245
206
  {
246
- "key": "RouteOptimized",
247
- "name": "Route optimized",
207
+ "key": "OPTIMIZE",
208
+ "name": "Optimize",
248
209
  "payloadSchema": [
249
210
  {
250
- "name": "row",
251
- "type": "Route"
211
+ "name": "id",
212
+ "type": "string",
213
+ "required": true
252
214
  }
253
215
  ]
254
216
  },
255
217
  {
256
- "key": "RouteOptimizeFailed",
257
- "name": "Route optimize failed",
218
+ "key": "RESET_ROUTE",
219
+ "name": "Reset Route",
258
220
  "payloadSchema": [
259
221
  {
260
- "name": "error",
261
- "type": "string"
262
- },
263
- {
264
- "name": "code",
265
- "type": "string"
222
+ "name": "id",
223
+ "type": "string",
224
+ "required": true
266
225
  }
267
226
  ]
227
+ },
228
+ {
229
+ "key": "CLOSE_VIEW",
230
+ "name": "Close View"
268
231
  }
269
232
  ],
270
233
  "transitions": [
@@ -278,8 +241,8 @@
278
241
  "Route",
279
242
  {
280
243
  "emit": {
281
- "failure": "RouteLoadFailed",
282
- "success": "RouteLoaded"
244
+ "success": "RouteLoaded",
245
+ "failure": "RouteLoadFailed"
283
246
  }
284
247
  }
285
248
  ],
@@ -287,6 +250,10 @@
287
250
  "render-ui",
288
251
  "main",
289
252
  {
253
+ "align": "center",
254
+ "className": "py-12",
255
+ "gap": "md",
256
+ "direction": "vertical",
290
257
  "type": "stack",
291
258
  "children": [
292
259
  {
@@ -294,15 +261,11 @@
294
261
  },
295
262
  {
296
263
  "color": "muted",
264
+ "type": "typography",
297
265
  "content": "Loading routes…",
298
- "variant": "caption",
299
- "type": "typography"
266
+ "variant": "caption"
300
267
  }
301
- ],
302
- "direction": "vertical",
303
- "align": "center",
304
- "className": "py-12",
305
- "gap": "md"
268
+ ]
306
269
  }
307
270
  ]
308
271
  ]
@@ -316,71 +279,102 @@
316
279
  "render-ui",
317
280
  "main",
318
281
  {
282
+ "direction": "vertical",
319
283
  "type": "stack",
320
284
  "gap": "md",
321
285
  "children": [
322
286
  {
323
287
  "type": "stack",
288
+ "gap": "sm",
324
289
  "direction": "horizontal",
290
+ "align": "center",
325
291
  "children": [
326
292
  {
327
- "type": "icon",
328
- "name": "map"
293
+ "name": "map",
294
+ "type": "icon"
329
295
  },
330
296
  {
331
297
  "variant": "h3",
332
298
  "type": "typography",
333
299
  "content": "@config.title"
334
300
  }
301
+ ]
302
+ },
303
+ {
304
+ "cols": 4.0,
305
+ "children": [
306
+ {
307
+ "icon": "map",
308
+ "label": "Total routes",
309
+ "value": "@payload.data.length",
310
+ "type": "stat-display"
311
+ },
312
+ {
313
+ "value": "14",
314
+ "type": "stat-display",
315
+ "icon": "check-circle",
316
+ "label": "Optimized today"
317
+ },
318
+ {
319
+ "label": "Total distance",
320
+ "icon": "navigation",
321
+ "type": "stat-display",
322
+ "value": "1,284 km"
323
+ },
324
+ {
325
+ "value": "92 min",
326
+ "icon": "clock",
327
+ "label": "Avg duration",
328
+ "type": "stat-display"
329
+ }
335
330
  ],
336
- "gap": "sm"
331
+ "type": "simple-grid"
337
332
  },
338
333
  {
339
334
  "type": "divider"
340
335
  },
341
336
  {
342
- "itemActions": [
343
- {
344
- "variant": "primary",
345
- "icon": "route",
346
- "label": "Optimize",
347
- "event": "OPTIMIZE"
348
- }
349
- ],
350
- "gap": "sm",
351
337
  "entity": "@payload.data",
352
338
  "fields": [
353
339
  {
354
- "variant": "caption",
340
+ "label": "Technician",
355
341
  "name": "technicianId",
356
- "label": "Technician"
357
- },
358
- {
359
- "name": "stops",
360
- "label": "Stops",
361
342
  "variant": "caption"
362
343
  },
363
344
  {
364
- "variant": "caption",
365
345
  "name": "totalDistanceKm",
366
- "label": "Distance (km)"
346
+ "label": "Distance (km)",
347
+ "variant": "caption"
367
348
  },
368
349
  {
369
- "label": "Duration (min)",
350
+ "variant": "caption",
370
351
  "name": "totalDurationMinutes",
371
- "variant": "caption"
352
+ "label": "Duration (min)"
372
353
  },
373
354
  {
374
- "label": "Optimized",
375
355
  "variant": "caption",
376
- "name": "optimizedAt"
356
+ "name": "optimizedAt",
357
+ "label": "Optimized"
377
358
  }
378
359
  ],
360
+ "gap": "sm",
379
361
  "type": "data-grid",
380
- "cols": 1.0
362
+ "cols": 1.0,
363
+ "itemActions": [
364
+ {
365
+ "variant": "primary",
366
+ "label": "Open",
367
+ "event": "OPEN_ROUTE",
368
+ "icon": "arrow-right"
369
+ },
370
+ {
371
+ "label": "Optimize",
372
+ "event": "OPTIMIZE",
373
+ "variant": "danger"
374
+ }
375
+ ]
381
376
  }
382
- ],
383
- "direction": "vertical"
377
+ ]
384
378
  }
385
379
  ]
386
380
  ]
@@ -394,8 +388,8 @@
394
388
  "render-ui",
395
389
  "main",
396
390
  {
397
- "type": "alert",
398
391
  "message": "@payload.error",
392
+ "type": "alert",
399
393
  "variant": "error"
400
394
  }
401
395
  ]
@@ -403,25 +397,245 @@
403
397
  },
404
398
  {
405
399
  "from": "browsing",
406
- "to": "optimizing",
400
+ "to": "viewing_single",
401
+ "event": "OPEN_ROUTE",
402
+ "effects": [
403
+ [
404
+ "set",
405
+ "@entity.id",
406
+ "@payload.row.id"
407
+ ],
408
+ [
409
+ "set",
410
+ "@entity.technicianId",
411
+ "@payload.row.technicianId"
412
+ ],
413
+ [
414
+ "set",
415
+ "@entity.originLat",
416
+ "@payload.row.originLat"
417
+ ],
418
+ [
419
+ "set",
420
+ "@entity.originLng",
421
+ "@payload.row.originLng"
422
+ ],
423
+ [
424
+ "set",
425
+ "@entity.totalDistanceKm",
426
+ "@payload.row.totalDistanceKm"
427
+ ],
428
+ [
429
+ "set",
430
+ "@entity.totalDurationMinutes",
431
+ "@payload.row.totalDurationMinutes"
432
+ ],
433
+ [
434
+ "set",
435
+ "@entity.optimizedAt",
436
+ "@payload.row.optimizedAt"
437
+ ],
438
+ [
439
+ "render-ui",
440
+ "main",
441
+ {
442
+ "children": [
443
+ {
444
+ "align": "center",
445
+ "direction": "horizontal",
446
+ "type": "stack",
447
+ "children": [
448
+ {
449
+ "action": "CLOSE_VIEW",
450
+ "label": "Back",
451
+ "variant": "ghost",
452
+ "type": "button"
453
+ },
454
+ {
455
+ "type": "icon",
456
+ "name": "map"
457
+ },
458
+ {
459
+ "type": "typography",
460
+ "content": "@entity.technicianId",
461
+ "variant": "h3"
462
+ },
463
+ {
464
+ "type": "badge",
465
+ "label": "Optimized",
466
+ "variant": "success"
467
+ }
468
+ ],
469
+ "gap": "sm"
470
+ },
471
+ {
472
+ "type": "divider"
473
+ },
474
+ {
475
+ "type": "stack",
476
+ "children": [
477
+ {
478
+ "type": "stack",
479
+ "children": [
480
+ {
481
+ "color": "muted",
482
+ "type": "typography",
483
+ "content": "Origin lat",
484
+ "variant": "caption"
485
+ },
486
+ {
487
+ "type": "typography",
488
+ "content": "@entity.originLat",
489
+ "variant": "body"
490
+ }
491
+ ],
492
+ "direction": "horizontal",
493
+ "gap": "md"
494
+ },
495
+ {
496
+ "direction": "horizontal",
497
+ "children": [
498
+ {
499
+ "variant": "caption",
500
+ "type": "typography",
501
+ "content": "Origin lng",
502
+ "color": "muted"
503
+ },
504
+ {
505
+ "content": "@entity.originLng",
506
+ "type": "typography",
507
+ "variant": "body"
508
+ }
509
+ ],
510
+ "type": "stack",
511
+ "gap": "md"
512
+ }
513
+ ],
514
+ "gap": "sm",
515
+ "direction": "vertical"
516
+ },
517
+ {
518
+ "type": "divider"
519
+ },
520
+ {
521
+ "type": "simple-grid",
522
+ "children": [
523
+ {
524
+ "label": "Distance (km)",
525
+ "value": "@entity.totalDistanceKm",
526
+ "icon": "navigation",
527
+ "type": "stat-display"
528
+ },
529
+ {
530
+ "icon": "clock",
531
+ "type": "stat-display",
532
+ "label": "Duration (min)",
533
+ "value": "@entity.totalDurationMinutes"
534
+ },
535
+ {
536
+ "type": "stat-display",
537
+ "icon": "calendar",
538
+ "label": "Last optimized",
539
+ "value": "@entity.optimizedAt"
540
+ }
541
+ ],
542
+ "cols": 3.0
543
+ },
544
+ {
545
+ "direction": "horizontal",
546
+ "align": "center",
547
+ "type": "stack",
548
+ "gap": "sm",
549
+ "children": [
550
+ {
551
+ "action": "OPTIMIZE",
552
+ "type": "button",
553
+ "label": "Optimize",
554
+ "variant": "primary",
555
+ "actionPayload": {
556
+ "id": "@entity.id"
557
+ }
558
+ },
559
+ {
560
+ "variant": "danger",
561
+ "type": "button",
562
+ "action": "RESET_ROUTE",
563
+ "label": "Reset",
564
+ "actionPayload": {
565
+ "id": "@entity.id"
566
+ }
567
+ }
568
+ ]
569
+ }
570
+ ],
571
+ "gap": "md",
572
+ "direction": "vertical",
573
+ "type": "stack"
574
+ }
575
+ ]
576
+ ]
577
+ },
578
+ {
579
+ "from": "browsing",
580
+ "to": "loading",
407
581
  "event": "OPTIMIZE",
408
582
  "effects": [
409
583
  [
410
584
  "set",
411
585
  "@entity.id",
412
- "@payload.routeId"
586
+ "@payload.id"
413
587
  ],
414
588
  [
415
- "call-service",
416
- "route-optimize",
417
- "optimize",
589
+ "fetch",
590
+ "Route",
418
591
  {
419
- "routeId": "@entity.id"
420
- },
592
+ "emit": {
593
+ "failure": "RouteLoadFailed",
594
+ "success": "RouteLoaded"
595
+ }
596
+ }
597
+ ],
598
+ [
599
+ "render-ui",
600
+ "main",
601
+ {
602
+ "children": [
603
+ {
604
+ "type": "spinner"
605
+ },
606
+ {
607
+ "content": "Optimizing route…",
608
+ "type": "typography",
609
+ "variant": "caption",
610
+ "color": "muted"
611
+ }
612
+ ],
613
+ "type": "stack",
614
+ "gap": "md",
615
+ "direction": "vertical",
616
+ "align": "center",
617
+ "className": "py-12"
618
+ }
619
+ ]
620
+ ]
621
+ },
622
+ {
623
+ "from": "browsing",
624
+ "to": "loading",
625
+ "event": "RESET_ROUTE",
626
+ "effects": [
627
+ [
628
+ "set",
629
+ "@entity.id",
630
+ "@payload.id"
631
+ ],
632
+ [
633
+ "fetch",
634
+ "Route",
421
635
  {
422
636
  "emit": {
423
- "failure": "RouteOptimizeFailed",
424
- "success": "RouteOptimized"
637
+ "success": "RouteLoaded",
638
+ "failure": "RouteLoadFailed"
425
639
  }
426
640
  }
427
641
  ],
@@ -431,71 +645,147 @@
431
645
  {
432
646
  "className": "py-12",
433
647
  "align": "center",
434
- "gap": "md",
435
- "direction": "vertical",
436
- "type": "stack",
437
648
  "children": [
438
649
  {
439
650
  "type": "spinner"
440
651
  },
441
652
  {
653
+ "content": "Resetting route…",
654
+ "type": "typography",
442
655
  "variant": "caption",
443
- "content": "Optimizing route…",
444
- "color": "muted",
445
- "type": "typography"
656
+ "color": "muted"
446
657
  }
447
- ]
658
+ ],
659
+ "gap": "md",
660
+ "direction": "vertical",
661
+ "type": "stack"
448
662
  }
449
663
  ]
450
664
  ]
451
665
  },
452
666
  {
453
- "from": "browsing",
454
- "to": "browsing",
455
- "event": "RouteUpdated",
667
+ "from": "viewing_single",
668
+ "to": "loading",
669
+ "event": "CLOSE_VIEW",
456
670
  "effects": [
671
+ [
672
+ "fetch",
673
+ "Route",
674
+ {
675
+ "emit": {
676
+ "failure": "RouteLoadFailed",
677
+ "success": "RouteLoaded"
678
+ }
679
+ }
680
+ ],
457
681
  [
458
682
  "render-ui",
459
683
  "main",
460
684
  {
461
- "message": "Route updated",
462
- "type": "alert",
463
- "variant": "success"
685
+ "children": [
686
+ {
687
+ "type": "spinner"
688
+ },
689
+ {
690
+ "content": "Loading routes…",
691
+ "variant": "caption",
692
+ "color": "muted",
693
+ "type": "typography"
694
+ }
695
+ ],
696
+ "direction": "vertical",
697
+ "gap": "md",
698
+ "align": "center",
699
+ "type": "stack",
700
+ "className": "py-12"
464
701
  }
465
702
  ]
466
703
  ]
467
704
  },
468
705
  {
469
- "from": "optimizing",
470
- "to": "browsing",
471
- "event": "RouteOptimized",
706
+ "from": "viewing_single",
707
+ "to": "loading",
708
+ "event": "OPTIMIZE",
472
709
  "effects": [
473
710
  [
474
- "persist",
475
- "update",
711
+ "set",
712
+ "@entity.id",
713
+ "@payload.id"
714
+ ],
715
+ [
716
+ "fetch",
476
717
  "Route",
477
- "@payload.row",
478
718
  {
479
719
  "emit": {
480
- "failure": "RouteOptimizeFailed",
481
- "success": "RouteUpdated"
720
+ "success": "RouteLoaded",
721
+ "failure": "RouteLoadFailed"
482
722
  }
483
723
  }
724
+ ],
725
+ [
726
+ "render-ui",
727
+ "main",
728
+ {
729
+ "children": [
730
+ {
731
+ "type": "spinner"
732
+ },
733
+ {
734
+ "color": "muted",
735
+ "type": "typography",
736
+ "content": "Optimizing route…",
737
+ "variant": "caption"
738
+ }
739
+ ],
740
+ "direction": "vertical",
741
+ "gap": "md",
742
+ "align": "center",
743
+ "type": "stack",
744
+ "className": "py-12"
745
+ }
484
746
  ]
485
747
  ]
486
748
  },
487
749
  {
488
- "from": "optimizing",
489
- "to": "browsing",
490
- "event": "RouteOptimizeFailed",
750
+ "from": "viewing_single",
751
+ "to": "loading",
752
+ "event": "RESET_ROUTE",
491
753
  "effects": [
754
+ [
755
+ "set",
756
+ "@entity.id",
757
+ "@payload.id"
758
+ ],
759
+ [
760
+ "fetch",
761
+ "Route",
762
+ {
763
+ "emit": {
764
+ "failure": "RouteLoadFailed",
765
+ "success": "RouteLoaded"
766
+ }
767
+ }
768
+ ],
492
769
  [
493
770
  "render-ui",
494
771
  "main",
495
772
  {
496
- "variant": "error",
497
- "message": "@payload.error",
498
- "type": "alert"
773
+ "align": "center",
774
+ "type": "stack",
775
+ "className": "py-12",
776
+ "gap": "md",
777
+ "children": [
778
+ {
779
+ "type": "spinner"
780
+ },
781
+ {
782
+ "variant": "caption",
783
+ "color": "muted",
784
+ "content": "Resetting route…",
785
+ "type": "typography"
786
+ }
787
+ ],
788
+ "direction": "vertical"
499
789
  }
500
790
  ]
501
791
  ]