@almadar/std 14.26.0 → 14.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/behaviors/registry/app/atoms/std-applicant.orb +496 -42
  2. package/behaviors/registry/app/atoms/std-approval-request.orb +433 -593
  3. package/behaviors/registry/app/atoms/std-campaign-goal.orb +438 -228
  4. package/behaviors/registry/app/atoms/std-change-order.orb +565 -307
  5. package/behaviors/registry/app/atoms/std-chart-of-accounts.orb +434 -97
  6. package/behaviors/registry/app/atoms/std-checkin.orb +434 -270
  7. package/behaviors/registry/app/atoms/std-class-roster.orb +495 -61
  8. package/behaviors/registry/app/atoms/std-class-session.orb +485 -104
  9. package/behaviors/registry/app/atoms/std-court-deadline.orb +519 -88
  10. package/behaviors/registry/app/atoms/std-customer-account.orb +577 -97
  11. package/behaviors/registry/app/atoms/std-donation-receipt.orb +498 -55
  12. package/behaviors/registry/app/atoms/std-donor.orb +445 -135
  13. package/behaviors/registry/app/atoms/std-drip-sequence.orb +445 -62
  14. package/behaviors/registry/app/atoms/std-driver.orb +465 -480
  15. package/behaviors/registry/app/atoms/std-dunning.orb +450 -512
  16. package/behaviors/registry/app/atoms/std-email-broadcast.orb +517 -64
  17. package/behaviors/registry/app/atoms/std-event.orb +465 -667
  18. package/behaviors/registry/app/atoms/std-health-score.orb +368 -371
  19. package/behaviors/registry/app/atoms/std-help-article.orb +373 -506
  20. package/behaviors/registry/app/atoms/std-help-category.orb +344 -359
  21. package/behaviors/registry/app/atoms/std-interview-slot.orb +490 -48
  22. package/behaviors/registry/app/atoms/std-invoice.orb +494 -291
  23. package/behaviors/registry/app/atoms/std-kitchen-display.orb +588 -96
  24. package/behaviors/registry/app/atoms/std-lease.orb +506 -190
  25. package/behaviors/registry/app/atoms/std-ledger-entry.orb +483 -154
  26. package/behaviors/registry/app/atoms/std-maintenance-request.orb +642 -192
  27. package/behaviors/registry/app/atoms/std-matter.orb +486 -318
  28. package/behaviors/registry/app/atoms/std-membership.orb +512 -102
  29. package/behaviors/registry/app/atoms/std-menu.orb +775 -183
  30. package/behaviors/registry/app/atoms/std-modifier-group.orb +522 -104
  31. package/behaviors/registry/app/atoms/std-nps-survey.orb +319 -327
  32. package/behaviors/registry/app/atoms/std-offer-letter.orb +497 -47
  33. package/behaviors/registry/app/atoms/std-payout-ledger.orb +378 -362
  34. package/behaviors/registry/app/atoms/std-question-bank.orb +379 -346
  35. package/behaviors/registry/app/atoms/std-receipt.orb +553 -44
  36. package/behaviors/registry/app/atoms/std-recurring-charge.orb +419 -832
  37. package/behaviors/registry/app/atoms/std-renewal-risk.orb +370 -421
  38. package/behaviors/registry/app/atoms/std-rent-charge.orb +657 -55
  39. package/behaviors/registry/app/atoms/std-reorder-rule.orb +510 -59
  40. package/behaviors/registry/app/atoms/std-response-collector.orb +451 -144
  41. package/behaviors/registry/app/atoms/std-rfi.orb +502 -461
  42. package/behaviors/registry/app/atoms/std-route-optimize.orb +448 -158
  43. package/behaviors/registry/app/atoms/std-segment.orb +360 -98
  44. package/behaviors/registry/app/atoms/std-stock-level.orb +486 -103
  45. package/behaviors/registry/app/atoms/std-submittal.orb +538 -526
  46. package/behaviors/registry/app/atoms/std-table-map.orb +88 -51
  47. package/behaviors/registry/app/atoms/std-technician-dispatch.orb +653 -71
  48. package/behaviors/registry/app/atoms/std-telematics-event.orb +310 -215
  49. package/behaviors/registry/app/atoms/std-template-editor.orb +513 -90
  50. package/behaviors/registry/app/atoms/std-tenant.orb +525 -66
  51. package/behaviors/registry/app/atoms/std-ticket-tier.orb +472 -460
  52. package/behaviors/registry/app/atoms/std-time-entry.orb +354 -317
  53. package/behaviors/registry/app/atoms/std-timesheet.orb +551 -284
  54. package/behaviors/registry/app/atoms/std-trial.orb +410 -317
  55. package/behaviors/registry/app/atoms/std-vehicle.orb +398 -563
  56. package/behaviors/registry/app/atoms/std-waitlist.orb +372 -283
  57. package/behaviors/registry/app/atoms/std-warehouse.orb +273 -214
  58. package/behaviors/registry/app/atoms/std-work-order.orb +628 -240
  59. package/behaviors/registry/app/molecules/std-applicant-form.orb +89 -83
  60. package/behaviors/registry/app/molecules/std-application.orb +178 -263
  61. package/behaviors/registry/app/molecules/std-broadcast-builder.orb +67 -176
  62. package/behaviors/registry/app/molecules/std-cart.orb +78 -72
  63. package/behaviors/registry/app/molecules/std-form-builder.orb +437 -176
  64. package/behaviors/registry/app/molecules/std-ledger-entry-form.orb +608 -89
  65. package/behaviors/registry/app/molecules/std-stock-adjustment.orb +501 -102
  66. package/behaviors/registry/app/molecules/std-vendor-onboarding.orb +383 -469
  67. package/behaviors/registry/core/atoms/std-billable-hour.orb +495 -91
  68. package/behaviors/registry/core/atoms/std-branching-logic.orb +271 -600
  69. package/behaviors/registry/core/atoms/std-file-store.orb +534 -164
  70. package/behaviors/registry/core/atoms/std-gallery.orb +118 -101
  71. package/behaviors/registry/core/atoms/std-image-upload-multi.orb +87 -57
  72. package/behaviors/registry/core/atoms/std-page-tree.orb +342 -484
  73. package/behaviors/registry/core/atoms/std-rich-editor.orb +288 -416
  74. package/behaviors/registry/core/atoms/std-version-history.orb +454 -430
  75. package/behaviors/registry/core/molecules/std-wizard-form.orb +222 -147
  76. package/dist/behaviors/registry/app/atoms/std-applicant.orb +496 -42
  77. package/dist/behaviors/registry/app/atoms/std-approval-request.orb +433 -593
  78. package/dist/behaviors/registry/app/atoms/std-campaign-goal.orb +438 -228
  79. package/dist/behaviors/registry/app/atoms/std-change-order.orb +565 -307
  80. package/dist/behaviors/registry/app/atoms/std-chart-of-accounts.orb +434 -97
  81. package/dist/behaviors/registry/app/atoms/std-checkin.orb +434 -270
  82. package/dist/behaviors/registry/app/atoms/std-class-roster.orb +495 -61
  83. package/dist/behaviors/registry/app/atoms/std-class-session.orb +485 -104
  84. package/dist/behaviors/registry/app/atoms/std-court-deadline.orb +519 -88
  85. package/dist/behaviors/registry/app/atoms/std-customer-account.orb +577 -97
  86. package/dist/behaviors/registry/app/atoms/std-donation-receipt.orb +498 -55
  87. package/dist/behaviors/registry/app/atoms/std-donor.orb +445 -135
  88. package/dist/behaviors/registry/app/atoms/std-drip-sequence.orb +445 -62
  89. package/dist/behaviors/registry/app/atoms/std-driver.orb +465 -480
  90. package/dist/behaviors/registry/app/atoms/std-dunning.orb +450 -512
  91. package/dist/behaviors/registry/app/atoms/std-email-broadcast.orb +517 -64
  92. package/dist/behaviors/registry/app/atoms/std-event.orb +465 -667
  93. package/dist/behaviors/registry/app/atoms/std-health-score.orb +368 -371
  94. package/dist/behaviors/registry/app/atoms/std-help-article.orb +373 -506
  95. package/dist/behaviors/registry/app/atoms/std-help-category.orb +344 -359
  96. package/dist/behaviors/registry/app/atoms/std-interview-slot.orb +490 -48
  97. package/dist/behaviors/registry/app/atoms/std-invoice.orb +494 -291
  98. package/dist/behaviors/registry/app/atoms/std-kitchen-display.orb +588 -96
  99. package/dist/behaviors/registry/app/atoms/std-lease.orb +506 -190
  100. package/dist/behaviors/registry/app/atoms/std-ledger-entry.orb +483 -154
  101. package/dist/behaviors/registry/app/atoms/std-maintenance-request.orb +642 -192
  102. package/dist/behaviors/registry/app/atoms/std-matter.orb +486 -318
  103. package/dist/behaviors/registry/app/atoms/std-membership.orb +512 -102
  104. package/dist/behaviors/registry/app/atoms/std-menu.orb +775 -183
  105. package/dist/behaviors/registry/app/atoms/std-modifier-group.orb +522 -104
  106. package/dist/behaviors/registry/app/atoms/std-nps-survey.orb +319 -327
  107. package/dist/behaviors/registry/app/atoms/std-offer-letter.orb +497 -47
  108. package/dist/behaviors/registry/app/atoms/std-payout-ledger.orb +378 -362
  109. package/dist/behaviors/registry/app/atoms/std-question-bank.orb +379 -346
  110. package/dist/behaviors/registry/app/atoms/std-receipt.orb +553 -44
  111. package/dist/behaviors/registry/app/atoms/std-recurring-charge.orb +419 -832
  112. package/dist/behaviors/registry/app/atoms/std-renewal-risk.orb +370 -421
  113. package/dist/behaviors/registry/app/atoms/std-rent-charge.orb +657 -55
  114. package/dist/behaviors/registry/app/atoms/std-reorder-rule.orb +510 -59
  115. package/dist/behaviors/registry/app/atoms/std-response-collector.orb +451 -144
  116. package/dist/behaviors/registry/app/atoms/std-rfi.orb +502 -461
  117. package/dist/behaviors/registry/app/atoms/std-route-optimize.orb +448 -158
  118. package/dist/behaviors/registry/app/atoms/std-segment.orb +360 -98
  119. package/dist/behaviors/registry/app/atoms/std-stock-level.orb +486 -103
  120. package/dist/behaviors/registry/app/atoms/std-submittal.orb +538 -526
  121. package/dist/behaviors/registry/app/atoms/std-table-map.orb +88 -51
  122. package/dist/behaviors/registry/app/atoms/std-technician-dispatch.orb +653 -71
  123. package/dist/behaviors/registry/app/atoms/std-telematics-event.orb +310 -215
  124. package/dist/behaviors/registry/app/atoms/std-template-editor.orb +513 -90
  125. package/dist/behaviors/registry/app/atoms/std-tenant.orb +525 -66
  126. package/dist/behaviors/registry/app/atoms/std-ticket-tier.orb +472 -460
  127. package/dist/behaviors/registry/app/atoms/std-time-entry.orb +354 -317
  128. package/dist/behaviors/registry/app/atoms/std-timesheet.orb +551 -284
  129. package/dist/behaviors/registry/app/atoms/std-trial.orb +410 -317
  130. package/dist/behaviors/registry/app/atoms/std-vehicle.orb +398 -563
  131. package/dist/behaviors/registry/app/atoms/std-waitlist.orb +372 -283
  132. package/dist/behaviors/registry/app/atoms/std-warehouse.orb +273 -214
  133. package/dist/behaviors/registry/app/atoms/std-work-order.orb +628 -240
  134. package/dist/behaviors/registry/app/molecules/std-applicant-form.orb +89 -83
  135. package/dist/behaviors/registry/app/molecules/std-application.orb +178 -263
  136. package/dist/behaviors/registry/app/molecules/std-broadcast-builder.orb +67 -176
  137. package/dist/behaviors/registry/app/molecules/std-cart.orb +78 -72
  138. package/dist/behaviors/registry/app/molecules/std-form-builder.orb +437 -176
  139. package/dist/behaviors/registry/app/molecules/std-ledger-entry-form.orb +608 -89
  140. package/dist/behaviors/registry/app/molecules/std-stock-adjustment.orb +501 -102
  141. package/dist/behaviors/registry/app/molecules/std-vendor-onboarding.orb +383 -469
  142. package/dist/behaviors/registry/core/atoms/std-billable-hour.orb +495 -91
  143. package/dist/behaviors/registry/core/atoms/std-branching-logic.orb +271 -600
  144. package/dist/behaviors/registry/core/atoms/std-file-store.orb +534 -164
  145. package/dist/behaviors/registry/core/atoms/std-gallery.orb +118 -101
  146. package/dist/behaviors/registry/core/atoms/std-image-upload-multi.orb +87 -57
  147. package/dist/behaviors/registry/core/atoms/std-page-tree.orb +342 -484
  148. package/dist/behaviors/registry/core/atoms/std-rich-editor.orb +288 -416
  149. package/dist/behaviors/registry/core/atoms/std-version-history.orb +454 -430
  150. package/dist/behaviors/registry/core/molecules/std-wizard-form.orb +222 -147
  151. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "std-reorder-rule",
3
3
  "version": "1.0.0",
4
- "description": "std-reorder-rule — automatic stock-replenishment rule for a SKU at a location. Owns a ReorderRule entity and a single manager trait that loads rules, renders them in a data-grid, and surfaces Enable / Disable actions per row.",
4
+ "description": "std-reorder-rule — automatic stock-replenishment rule per SKU/location. Lists rules in `browsing`; opens detail in `viewing_single` with Enable / Disable actions.",
5
5
  "orbitals": [
6
6
  {
7
7
  "name": "ReorderRuleOrbital",
@@ -58,6 +58,53 @@
58
58
  "category": "interaction",
59
59
  "linkedEntity": "ReorderRule",
60
60
  "emits": [
61
+ {
62
+ "event": "OPEN_RULE",
63
+ "payloadSchema": [
64
+ {
65
+ "name": "id",
66
+ "type": "string",
67
+ "required": true
68
+ },
69
+ {
70
+ "name": "row.id",
71
+ "type": "string",
72
+ "required": true
73
+ },
74
+ {
75
+ "name": "row.sku",
76
+ "type": "string",
77
+ "required": true
78
+ },
79
+ {
80
+ "name": "row.locationId",
81
+ "type": "string"
82
+ },
83
+ {
84
+ "name": "row.thresholdQty",
85
+ "type": "number"
86
+ },
87
+ {
88
+ "name": "row.reorderQty",
89
+ "type": "number"
90
+ },
91
+ {
92
+ "name": "row.vendor",
93
+ "type": "string"
94
+ },
95
+ {
96
+ "name": "row.leadTimeDays",
97
+ "type": "number"
98
+ },
99
+ {
100
+ "name": "row.isActive",
101
+ "type": "boolean"
102
+ }
103
+ ]
104
+ },
105
+ {
106
+ "event": "CLOSE_VIEW"
107
+ },
61
108
  {
62
109
  "event": "ENABLE_RULE",
63
110
  "payloadSchema": [
@@ -110,6 +157,9 @@
110
157
  {
111
158
  "name": "browsing"
112
159
  },
160
+ {
161
+ "name": "viewing_single"
162
+ },
113
163
  {
114
164
  "name": "error"
115
165
  }
@@ -143,6 +193,21 @@
143
193
  }
144
194
  ]
145
195
  },
196
+ {
197
+ "key": "OPEN_RULE",
198
+ "name": "Open Rule",
199
+ "payloadSchema": [
200
+ {
201
+ "name": "id",
202
+ "type": "string",
203
+ "required": true
204
+ },
205
+ {
206
+ "name": "row",
207
+ "type": "ReorderRule"
208
+ }
209
+ ]
210
+ },
146
211
  {
147
212
  "key": "ENABLE_RULE",
148
213
  "name": "Enable Rule",
@@ -164,6 +229,10 @@
164
229
  "required": true
165
230
  }
166
231
  ]
232
+ },
233
+ {
234
+ "key": "CLOSE_VIEW",
235
+ "name": "Close View"
167
236
  }
168
237
  ],
169
238
  "transitions": [
@@ -177,8 +246,8 @@
177
246
  "ReorderRule",
178
247
  {
179
248
  "emit": {
180
- "success": "ReorderRuleLoaded",
181
- "failure": "ReorderRuleLoadFailed"
249
+ "failure": "ReorderRuleLoadFailed",
250
+ "success": "ReorderRuleLoaded"
182
251
  }
183
252
  }
184
253
  ],
@@ -186,7 +255,6 @@
186
255
  "render-ui",
187
256
  "main",
188
257
  {
189
- "type": "stack",
190
258
  "children": [
191
259
  {
192
260
  "type": "spinner"
@@ -199,9 +267,10 @@
199
267
  }
200
268
  ],
201
269
  "gap": "md",
202
- "className": "py-12",
203
270
  "align": "center",
204
- "direction": "vertical"
271
+ "type": "stack",
272
+ "direction": "vertical",
273
+ "className": "py-12"
205
274
  }
206
275
  ]
207
276
  ]
@@ -215,88 +284,112 @@
215
284
  "render-ui",
216
285
  "main",
217
286
  {
218
- "gap": "md",
219
- "type": "stack",
220
287
  "direction": "vertical",
288
+ "gap": "md",
221
289
  "children": [
222
290
  {
223
- "type": "stack",
291
+ "align": "center",
224
292
  "children": [
225
293
  {
226
- "type": "icon",
227
- "name": "repeat"
294
+ "name": "repeat",
295
+ "type": "icon"
228
296
  },
229
297
  {
230
- "type": "typography",
231
298
  "content": "@config.title",
299
+ "type": "typography",
232
300
  "variant": "h3"
301
+ }
302
+ ],
303
+ "gap": "sm",
304
+ "type": "stack",
305
+ "direction": "horizontal"
306
+ },
307
+ {
308
+ "type": "simple-grid",
309
+ "cols": 4.0,
310
+ "children": [
311
+ {
312
+ "type": "stat-display",
313
+ "label": "Total rules",
314
+ "icon": "repeat",
315
+ "value": "@payload.data.length"
233
316
  },
234
317
  {
235
318
  "label": "Active",
236
- "type": "badge",
237
- "variant": "success"
319
+ "icon": "check-circle",
320
+ "value": "47",
321
+ "type": "stat-display"
322
+ },
323
+ {
324
+ "type": "stat-display",
325
+ "label": "Triggered today",
326
+ "value": "9",
327
+ "icon": "zap"
328
+ },
329
+ {
330
+ "icon": "clock",
331
+ "label": "Avg lead time",
332
+ "value": "6.4d",
333
+ "type": "stat-display"
238
334
  }
239
- ],
240
- "direction": "horizontal",
241
- "align": "center",
242
- "gap": "sm"
335
+ ]
243
336
  },
244
337
  {
245
338
  "type": "divider"
246
339
  },
247
340
  {
248
- "type": "data-grid",
249
- "cols": 1.0,
250
- "gap": "sm",
251
- "itemActions": [
252
- {
253
- "label": "Enable",
254
- "event": "ENABLE_RULE",
255
- "variant": "primary",
256
- "icon": "check"
257
- },
258
- {
259
- "label": "Disable",
260
- "icon": "x",
261
- "event": "DISABLE_RULE",
262
- "variant": "danger"
263
- }
264
- ],
265
- "entity": "@payload.data",
266
341
  "fields": [
267
342
  {
268
- "variant": "caption",
343
+ "label": "SKU",
269
344
  "name": "sku",
270
- "label": "SKU"
345
+ "variant": "caption"
271
346
  },
272
347
  {
348
+ "name": "locationId",
273
349
  "label": "Location",
274
- "variant": "caption",
275
- "name": "locationId"
350
+ "variant": "caption"
276
351
  },
277
352
  {
278
353
  "name": "thresholdQty",
279
- "variant": "caption",
280
- "label": "Threshold"
354
+ "label": "Threshold",
355
+ "variant": "caption"
281
356
  },
282
357
  {
283
- "label": "Reorder Qty",
284
358
  "variant": "caption",
285
- "name": "reorderQty"
359
+ "name": "reorderQty",
360
+ "label": "Reorder Qty"
286
361
  },
287
362
  {
288
- "variant": "caption",
289
363
  "name": "vendor",
364
+ "variant": "caption",
290
365
  "label": "Vendor"
291
366
  },
292
367
  {
293
- "label": "Active",
368
+ "name": "leadTimeDays",
294
369
  "variant": "caption",
295
- "name": "isActive"
370
+ "label": "Lead (d)"
296
371
  }
297
- ]
372
+ ],
373
+ "gap": "sm",
374
+ "type": "data-grid",
375
+ "entity": "@payload.data",
376
+ "itemActions": [
377
+ {
378
+ "label": "Open",
379
+ "icon": "arrow-right",
380
+ "variant": "primary",
381
+ "event": "OPEN_RULE"
382
+ },
383
+ {
384
+ "label": "Disable",
385
+ "event": "DISABLE_RULE",
386
+ "variant": "danger"
387
+ }
388
+ ],
389
+ "cols": 1.0
298
390
  }
299
- ]
391
+ ],
392
+ "type": "stack"
300
393
  }
301
394
  ]
302
395
  ]
@@ -310,16 +403,201 @@
310
403
  "render-ui",
311
404
  "main",
312
405
  {
313
- "type": "alert",
406
+ "variant": "error",
314
407
  "message": "@payload.error",
315
- "variant": "error"
408
+ "type": "alert"
316
409
  }
317
410
  ]
318
411
  ]
319
412
  },
320
413
  {
321
414
  "from": "browsing",
322
- "to": "browsing",
415
+ "to": "viewing_single",
416
+ "event": "OPEN_RULE",
417
+ "effects": [
418
+ [
419
+ "set",
420
+ "@entity.id",
421
+ "@payload.row.id"
422
+ ],
423
+ [
424
+ "set",
425
+ "@entity.sku",
426
+ "@payload.row.sku"
427
+ ],
428
+ [
429
+ "set",
430
+ "@entity.locationId",
431
+ "@payload.row.locationId"
432
+ ],
433
+ [
434
+ "set",
435
+ "@entity.thresholdQty",
436
+ "@payload.row.thresholdQty"
437
+ ],
438
+ [
439
+ "set",
440
+ "@entity.reorderQty",
441
+ "@payload.row.reorderQty"
442
+ ],
443
+ [
444
+ "set",
445
+ "@entity.vendor",
446
+ "@payload.row.vendor"
447
+ ],
448
+ [
449
+ "set",
450
+ "@entity.leadTimeDays",
451
+ "@payload.row.leadTimeDays"
452
+ ],
453
+ [
454
+ "set",
455
+ "@entity.isActive",
456
+ "@payload.row.isActive"
457
+ ],
458
+ [
459
+ "render-ui",
460
+ "main",
461
+ {
462
+ "gap": "md",
463
+ "type": "stack",
464
+ "direction": "vertical",
465
+ "children": [
466
+ {
467
+ "align": "center",
468
+ "direction": "horizontal",
469
+ "type": "stack",
470
+ "gap": "sm",
471
+ "children": [
472
+ {
473
+ "type": "button",
474
+ "variant": "ghost",
475
+ "label": "Back",
476
+ "action": "CLOSE_VIEW"
477
+ },
478
+ {
479
+ "name": "repeat",
480
+ "type": "icon"
481
+ },
482
+ {
483
+ "content": "@entity.sku",
484
+ "variant": "h3",
485
+ "type": "typography"
486
+ },
487
+ {
488
+ "type": "badge",
489
+ "label": "Active",
490
+ "variant": "success"
491
+ }
492
+ ]
493
+ },
494
+ {
495
+ "type": "divider"
496
+ },
497
+ {
498
+ "type": "stack",
499
+ "direction": "vertical",
500
+ "children": [
501
+ {
502
+ "children": [
503
+ {
504
+ "variant": "caption",
505
+ "color": "muted",
506
+ "content": "Location",
507
+ "type": "typography"
508
+ },
509
+ {
510
+ "variant": "body",
511
+ "content": "@entity.locationId",
512
+ "type": "typography"
513
+ }
514
+ ],
515
+ "type": "stack",
516
+ "gap": "md",
517
+ "direction": "horizontal"
518
+ },
519
+ {
520
+ "gap": "md",
521
+ "children": [
522
+ {
523
+ "type": "typography",
524
+ "color": "muted",
525
+ "content": "Vendor",
526
+ "variant": "caption"
527
+ },
528
+ {
529
+ "variant": "body",
530
+ "type": "typography",
531
+ "content": "@entity.vendor"
532
+ }
533
+ ],
534
+ "direction": "horizontal",
535
+ "type": "stack"
536
+ }
537
+ ],
538
+ "gap": "sm"
539
+ },
540
+ {
541
+ "type": "divider"
542
+ },
543
+ {
544
+ "cols": 3.0,
545
+ "children": [
546
+ {
547
+ "label": "Threshold",
548
+ "type": "stat-display",
549
+ "value": "@entity.thresholdQty",
550
+ "icon": "alert-triangle"
551
+ },
552
+ {
553
+ "label": "Reorder qty",
554
+ "type": "stat-display",
555
+ "icon": "package",
556
+ "value": "@entity.reorderQty"
557
+ },
558
+ {
559
+ "value": "@entity.leadTimeDays",
560
+ "type": "stat-display",
561
+ "icon": "clock",
562
+ "label": "Lead time (d)"
563
+ }
564
+ ],
565
+ "type": "simple-grid"
566
+ },
567
+ {
568
+ "type": "stack",
569
+ "gap": "sm",
570
+ "align": "center",
571
+ "direction": "horizontal",
572
+ "children": [
573
+ {
574
+ "action": "ENABLE_RULE",
575
+ "type": "button",
576
+ "label": "Enable",
577
+ "variant": "primary",
578
+ "actionPayload": {
579
+ "id": "@entity.id"
580
+ }
581
+ },
582
+ {
583
+ "label": "Disable",
584
+ "actionPayload": {
585
+ "id": "@entity.id"
586
+ },
587
+ "action": "DISABLE_RULE",
588
+ "type": "button",
589
+ "variant": "danger"
590
+ }
591
+ ]
592
+ }
593
+ ]
594
+ }
595
+ ]
596
+ ]
597
+ },
598
+ {
599
+ "from": "browsing",
600
+ "to": "loading",
323
601
  "event": "ENABLE_RULE",
324
602
  "effects": [
325
603
  [
@@ -327,20 +605,170 @@
327
605
  "@entity.id",
328
606
  "@payload.id"
329
607
  ],
608
+ [
609
+ "fetch",
610
+ "ReorderRule",
611
+ {
612
+ "emit": {
613
+ "success": "ReorderRuleLoaded",
614
+ "failure": "ReorderRuleLoadFailed"
615
+ }
616
+ }
617
+ ],
330
618
  [
331
619
  "render-ui",
332
620
  "main",
333
621
  {
334
- "message": "Reorder rule enabled",
335
- "type": "alert",
336
- "variant": "success"
622
+ "gap": "md",
623
+ "direction": "vertical",
624
+ "align": "center",
625
+ "type": "stack",
626
+ "className": "py-12",
627
+ "children": [
628
+ {
629
+ "type": "spinner"
630
+ },
631
+ {
632
+ "color": "muted",
633
+ "type": "typography",
634
+ "content": "Enabling rule…",
635
+ "variant": "caption"
636
+ }
637
+ ]
337
638
  }
338
639
  ]
339
640
  ]
340
641
  },
341
642
  {
342
643
  "from": "browsing",
343
- "to": "browsing",
644
+ "to": "loading",
645
+ "event": "DISABLE_RULE",
646
+ "effects": [
647
+ [
648
+ "set",
649
+ "@entity.id",
650
+ "@payload.id"
651
+ ],
652
+ [
653
+ "fetch",
654
+ "ReorderRule",
655
+ {
656
+ "emit": {
657
+ "failure": "ReorderRuleLoadFailed",
658
+ "success": "ReorderRuleLoaded"
659
+ }
660
+ }
661
+ ],
662
+ [
663
+ "render-ui",
664
+ "main",
665
+ {
666
+ "type": "stack",
667
+ "gap": "md",
668
+ "align": "center",
669
+ "direction": "vertical",
670
+ "className": "py-12",
671
+ "children": [
672
+ {
673
+ "type": "spinner"
674
+ },
675
+ {
676
+ "type": "typography",
677
+ "color": "muted",
678
+ "variant": "caption",
679
+ "content": "Disabling rule…"
680
+ }
681
+ ]
682
+ }
683
+ ]
684
+ ]
685
+ },
686
+ {
687
+ "from": "viewing_single",
688
+ "to": "loading",
689
+ "event": "CLOSE_VIEW",
690
+ "effects": [
691
+ [
692
+ "fetch",
693
+ "ReorderRule",
694
+ {
695
+ "emit": {
696
+ "success": "ReorderRuleLoaded",
697
+ "failure": "ReorderRuleLoadFailed"
698
+ }
699
+ }
700
+ ],
701
+ [
702
+ "render-ui",
703
+ "main",
704
+ {
705
+ "direction": "vertical",
706
+ "gap": "md",
707
+ "type": "stack",
708
+ "align": "center",
709
+ "className": "py-12",
710
+ "children": [
711
+ {
712
+ "type": "spinner"
713
+ },
714
+ {
715
+ "variant": "caption",
716
+ "content": "Loading reorder rules…",
717
+ "color": "muted",
718
+ "type": "typography"
719
+ }
720
+ ]
721
+ }
722
+ ]
723
+ ]
724
+ },
725
+ {
726
+ "from": "viewing_single",
727
+ "to": "loading",
728
+ "event": "ENABLE_RULE",
729
+ "effects": [
730
+ [
731
+ "set",
732
+ "@entity.id",
733
+ "@payload.id"
734
+ ],
735
+ [
736
+ "fetch",
737
+ "ReorderRule",
738
+ {
739
+ "emit": {
740
+ "failure": "ReorderRuleLoadFailed",
741
+ "success": "ReorderRuleLoaded"
742
+ }
743
+ }
744
+ ],
745
+ [
746
+ "render-ui",
747
+ "main",
748
+ {
749
+ "direction": "vertical",
750
+ "align": "center",
751
+ "className": "py-12",
752
+ "type": "stack",
753
+ "gap": "md",
754
+ "children": [
755
+ {
756
+ "type": "spinner"
757
+ },
758
+ {
759
+ "color": "muted",
760
+ "content": "Enabling rule…",
761
+ "type": "typography",
762
+ "variant": "caption"
763
+ }
764
+ ]
765
+ }
766
+ ]
767
+ ]
768
+ },
769
+ {
770
+ "from": "viewing_single",
771
+ "to": "loading",
344
772
  "event": "DISABLE_RULE",
345
773
  "effects": [
346
774
  [
@@ -348,13 +776,36 @@
348
776
  "@entity.id",
349
777
  "@payload.id"
350
778
  ],
779
+ [
780
+ "fetch",
781
+ "ReorderRule",
782
+ {
783
+ "emit": {
784
+ "failure": "ReorderRuleLoadFailed",
785
+ "success": "ReorderRuleLoaded"
786
+ }
787
+ }
788
+ ],
351
789
  [
352
790
  "render-ui",
353
791
  "main",
354
792
  {
355
- "message": "Reorder rule disabled",
356
- "type": "alert",
357
- "variant": "info"
793
+ "gap": "md",
794
+ "align": "center",
795
+ "className": "py-12",
796
+ "type": "stack",
797
+ "children": [
798
+ {
799
+ "type": "spinner"
800
+ },
801
+ {
802
+ "content": "Disabling rule…",
803
+ "type": "typography",
804
+ "variant": "caption",
805
+ "color": "muted"
806
+ }
807
+ ],
808
+ "direction": "vertical"
358
809
  }
359
810
  ]
360
811
  ]