@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
@@ -99,6 +99,65 @@
99
99
  "category": "interaction",
100
100
  "linkedEntity": "StockAdjustment",
101
101
  "emits": [
102
+ {
103
+ "event": "OPEN_ADJUSTMENT",
104
+ "payloadSchema": [
105
+ {
106
+ "name": "id",
107
+ "type": "string",
108
+ "required": true
109
+ },
110
+ {
111
+ "name": "row.id",
112
+ "type": "string",
113
+ "required": true
114
+ },
115
+ {
116
+ "name": "row.stockLevelId",
117
+ "type": "string",
118
+ "required": true
119
+ },
120
+ {
121
+ "name": "row.sku",
122
+ "type": "string"
123
+ },
124
+ {
125
+ "name": "row.warehouseId",
126
+ "type": "string"
127
+ },
128
+ {
129
+ "name": "row.warehouseName",
130
+ "type": "string"
131
+ },
132
+ {
133
+ "name": "row.quantityDelta",
134
+ "type": "number"
135
+ },
136
+ {
137
+ "name": "row.reason",
138
+ "type": "string"
139
+ },
140
+ {
141
+ "name": "row.adjustedBy",
142
+ "type": "string"
143
+ },
144
+ {
145
+ "name": "row.adjustedAt",
146
+ "type": "string"
147
+ },
148
+ {
149
+ "name": "row.notes",
150
+ "type": "string"
151
+ },
152
+ {
153
+ "name": "row.pendingId",
154
+ "type": "string"
155
+ }
156
+ ]
157
+ },
158
+ {
159
+ "event": "CLOSE_VIEW"
160
+ },
102
161
  {
103
162
  "event": "CREATE"
104
163
  },
@@ -160,8 +219,6 @@
160
219
  },
161
220
  {
162
221
  "event": "StockAdjustmentLoaded",
163
- "description": "Fired when the stock-adjustment collection finishes loading",
164
- "scope": "internal",
165
222
  "payloadSchema": [
166
223
  {
167
224
  "name": "data",
@@ -171,8 +228,6 @@
171
228
  },
172
229
  {
173
230
  "event": "StockAdjustmentLoadFailed",
174
- "description": "Fired when the stock-adjustment collection fails to load",
175
- "scope": "internal",
176
231
  "payloadSchema": [
177
232
  {
178
233
  "name": "error",
@@ -212,6 +267,9 @@
212
267
  {
213
268
  "name": "browsing"
214
269
  },
270
+ {
271
+ "name": "viewing_single"
272
+ },
215
273
  {
216
274
  "name": "error"
217
275
  }
@@ -245,13 +303,43 @@
245
303
  }
246
304
  ]
247
305
  },
306
+ {
307
+ "key": "OPEN_ADJUSTMENT",
308
+ "name": "Open Adjustment",
309
+ "payloadSchema": [
310
+ {
311
+ "name": "id",
312
+ "type": "string",
313
+ "required": true
314
+ },
315
+ {
316
+ "name": "row",
317
+ "type": "StockAdjustment"
318
+ }
319
+ ]
320
+ },
248
321
  {
249
322
  "key": "CREATE",
250
323
  "name": "Create"
251
324
  },
252
325
  {
253
326
  "key": "REQUEST_DELETE",
254
- "name": "Request Delete"
327
+ "name": "Request Delete",
328
+ "payloadSchema": [
329
+ {
330
+ "name": "id",
331
+ "type": "string",
332
+ "required": true
333
+ },
334
+ {
335
+ "name": "row",
336
+ "type": "StockAdjustment"
337
+ }
338
+ ]
339
+ },
340
+ {
341
+ "key": "CLOSE_VIEW",
342
+ "name": "Close View"
255
343
  }
256
344
  ],
257
345
  "transitions": [
@@ -274,20 +362,20 @@
274
362
  "render-ui",
275
363
  "main",
276
364
  {
277
- "gap": "md",
278
- "className": "py-12",
279
- "align": "center",
280
365
  "direction": "vertical",
281
366
  "type": "stack",
367
+ "align": "center",
368
+ "gap": "md",
369
+ "className": "py-12",
282
370
  "children": [
283
371
  {
284
372
  "type": "spinner"
285
373
  },
286
374
  {
287
- "variant": "caption",
288
- "color": "muted",
289
375
  "content": "Loading adjustments…",
290
- "type": "typography"
376
+ "type": "typography",
377
+ "color": "muted",
378
+ "variant": "caption"
291
379
  }
292
380
  ]
293
381
  }
@@ -303,120 +391,110 @@
303
391
  "render-ui",
304
392
  "main",
305
393
  {
306
- "gap": "lg",
394
+ "gap": "md",
307
395
  "direction": "vertical",
308
396
  "type": "stack",
309
397
  "children": [
310
398
  {
399
+ "type": "stack",
400
+ "gap": "sm",
401
+ "align": "center",
402
+ "direction": "horizontal",
311
403
  "children": [
312
404
  {
313
- "direction": "horizontal",
314
- "children": [
315
- {
316
- "type": "icon",
317
- "name": "sliders"
318
- },
319
- {
320
- "type": "typography",
321
- "content": "Stock Adjustments",
322
- "variant": "h2"
323
- }
324
- ],
325
- "type": "stack",
326
- "gap": "md"
405
+ "name": "sliders",
406
+ "type": "icon"
327
407
  },
328
408
  {
329
- "action": "CREATE",
330
- "variant": "primary",
331
- "label": "New Adjustment",
332
- "type": "button",
333
- "icon": "plus"
409
+ "type": "typography",
410
+ "content": "Stock Adjustments",
411
+ "variant": "h3"
334
412
  }
335
- ],
336
- "direction": "horizontal",
337
- "type": "stack",
338
- "justify": "between",
339
- "gap": "md"
413
+ ]
340
414
  },
341
415
  {
342
- "description": "or click to browse",
343
- "icon": "file-spreadsheet",
344
- "label": "Drop CSV here for bulk import",
345
- "maxFiles": 1.0,
346
- "accept": ".csv,text/csv",
347
- "type": "upload-drop-zone",
348
- "maxSize": 10485760.0,
349
- "action": "CREATE"
350
- },
351
- {
352
- "direction": "horizontal",
353
- "align": "center",
354
- "gap": "md",
416
+ "type": "simple-grid",
417
+ "cols": 4.0,
355
418
  "children": [
356
419
  {
357
- "variant": "caption",
358
- "content": "Quick quantity adjust",
359
- "color": "muted",
360
- "type": "typography"
420
+ "value": "@payload.data.length",
421
+ "icon": "sliders",
422
+ "label": "Total adjustments",
423
+ "type": "stat-display"
424
+ },
425
+ {
426
+ "value": "+184",
427
+ "label": "Net delta",
428
+ "type": "stat-display",
429
+ "icon": "trending-up"
430
+ },
431
+ {
432
+ "type": "stat-display",
433
+ "label": "This week",
434
+ "value": "26",
435
+ "icon": "calendar"
361
436
  },
362
437
  {
363
- "value": 0.0,
364
- "type": "number-stepper",
365
- "step": 1.0,
366
- "max": 100.0,
367
- "size": "md",
368
- "min": -100.0,
369
- "action": "CREATE"
438
+ "type": "stat-display",
439
+ "label": "Shrinkage flags",
440
+ "value": "4",
441
+ "icon": "alert-triangle"
370
442
  }
371
- ],
372
- "type": "stack"
443
+ ]
373
444
  },
374
445
  {
375
446
  "type": "divider"
376
447
  },
377
448
  {
449
+ "cols": 1.0,
450
+ "type": "data-grid",
451
+ "entity": "@payload.data",
452
+ "gap": "sm",
378
453
  "fields": [
379
454
  {
380
- "variant": "h4",
381
- "icon": "tag",
382
455
  "name": "sku",
456
+ "variant": "caption",
383
457
  "label": "SKU"
384
458
  },
385
459
  {
386
460
  "label": "Warehouse",
387
- "name": "warehouseName",
388
- "variant": "body"
461
+ "variant": "caption",
462
+ "name": "warehouseName"
389
463
  },
390
464
  {
391
- "label": "Delta",
392
465
  "name": "quantityDelta",
393
- "variant": "badge"
466
+ "variant": "caption",
467
+ "label": "Delta"
394
468
  },
395
469
  {
396
- "variant": "badge",
470
+ "label": "Reason",
397
471
  "name": "reason",
398
- "label": "Reason"
472
+ "variant": "badge"
399
473
  },
400
474
  {
401
- "label": "Adjusted At",
475
+ "variant": "caption",
402
476
  "name": "adjustedAt",
403
- "variant": "caption"
477
+ "label": "Adjusted At"
404
478
  },
405
479
  {
406
480
  "variant": "caption",
407
- "label": "Adjusted By",
481
+ "label": "By",
408
482
  "name": "adjustedBy"
409
483
  }
410
484
  ],
411
- "type": "data-grid",
412
485
  "itemActions": [
413
486
  {
414
- "event": "REQUEST_DELETE",
487
+ "icon": "arrow-right",
488
+ "event": "OPEN_ADJUSTMENT",
489
+ "variant": "primary",
490
+ "label": "Open"
491
+ },
492
+ {
415
493
  "label": "Delete",
494
+ "event": "REQUEST_DELETE",
416
495
  "variant": "danger"
417
496
  }
418
- ],
419
- "entity": "@payload.data"
497
+ ]
420
498
  }
421
499
  ]
422
500
  }
@@ -432,36 +510,253 @@
432
510
  "render-ui",
433
511
  "main",
434
512
  {
513
+ "type": "alert",
514
+ "message": "@payload.error",
515
+ "variant": "error"
516
+ }
517
+ ]
518
+ ]
519
+ },
520
+ {
521
+ "from": "browsing",
522
+ "to": "viewing_single",
523
+ "event": "OPEN_ADJUSTMENT",
524
+ "effects": [
525
+ [
526
+ "set",
527
+ "@entity.id",
528
+ "@payload.row.id"
529
+ ],
530
+ [
531
+ "set",
532
+ "@entity.stockLevelId",
533
+ "@payload.row.stockLevelId"
534
+ ],
535
+ [
536
+ "set",
537
+ "@entity.sku",
538
+ "@payload.row.sku"
539
+ ],
540
+ [
541
+ "set",
542
+ "@entity.warehouseId",
543
+ "@payload.row.warehouseId"
544
+ ],
545
+ [
546
+ "set",
547
+ "@entity.warehouseName",
548
+ "@payload.row.warehouseName"
549
+ ],
550
+ [
551
+ "set",
552
+ "@entity.quantityDelta",
553
+ "@payload.row.quantityDelta"
554
+ ],
555
+ [
556
+ "set",
557
+ "@entity.reason",
558
+ "@payload.row.reason"
559
+ ],
560
+ [
561
+ "set",
562
+ "@entity.adjustedBy",
563
+ "@payload.row.adjustedBy"
564
+ ],
565
+ [
566
+ "set",
567
+ "@entity.adjustedAt",
568
+ "@payload.row.adjustedAt"
569
+ ],
570
+ [
571
+ "set",
572
+ "@entity.notes",
573
+ "@payload.row.notes"
574
+ ],
575
+ [
576
+ "render-ui",
577
+ "main",
578
+ {
579
+ "type": "stack",
580
+ "direction": "vertical",
435
581
  "children": [
436
582
  {
437
- "color": "destructive",
438
- "type": "icon",
439
- "name": "alert-triangle"
583
+ "type": "stack",
584
+ "direction": "horizontal",
585
+ "gap": "sm",
586
+ "align": "center",
587
+ "children": [
588
+ {
589
+ "variant": "ghost",
590
+ "type": "button",
591
+ "label": "Back",
592
+ "action": "CLOSE_VIEW"
593
+ },
594
+ {
595
+ "name": "sliders",
596
+ "type": "icon"
597
+ },
598
+ {
599
+ "type": "typography",
600
+ "content": "@entity.sku",
601
+ "variant": "h3"
602
+ },
603
+ {
604
+ "type": "badge",
605
+ "label": "@entity.reason",
606
+ "variant": "primary"
607
+ }
608
+ ]
440
609
  },
441
610
  {
442
- "content": "Failed to load adjustments",
443
- "type": "typography",
444
- "variant": "h3"
611
+ "type": "divider"
445
612
  },
446
613
  {
447
- "color": "muted",
448
- "content": "@payload.error",
449
- "variant": "body",
450
- "type": "typography"
614
+ "type": "stack",
615
+ "gap": "sm",
616
+ "direction": "vertical",
617
+ "children": [
618
+ {
619
+ "direction": "horizontal",
620
+ "type": "stack",
621
+ "children": [
622
+ {
623
+ "variant": "caption",
624
+ "type": "typography",
625
+ "content": "Warehouse",
626
+ "color": "muted"
627
+ },
628
+ {
629
+ "variant": "body",
630
+ "type": "typography",
631
+ "content": "@entity.warehouseName"
632
+ }
633
+ ],
634
+ "gap": "md"
635
+ },
636
+ {
637
+ "direction": "horizontal",
638
+ "type": "stack",
639
+ "gap": "md",
640
+ "children": [
641
+ {
642
+ "content": "Adjusted by",
643
+ "color": "muted",
644
+ "type": "typography",
645
+ "variant": "caption"
646
+ },
647
+ {
648
+ "variant": "body",
649
+ "type": "typography",
650
+ "content": "@entity.adjustedBy"
651
+ }
652
+ ]
653
+ },
654
+ {
655
+ "type": "stack",
656
+ "gap": "md",
657
+ "direction": "horizontal",
658
+ "children": [
659
+ {
660
+ "color": "muted",
661
+ "content": "Notes",
662
+ "type": "typography",
663
+ "variant": "caption"
664
+ },
665
+ {
666
+ "type": "typography",
667
+ "content": "@entity.notes",
668
+ "variant": "body"
669
+ }
670
+ ]
671
+ }
672
+ ]
673
+ },
674
+ {
675
+ "type": "divider"
676
+ },
677
+ {
678
+ "cols": 3.0,
679
+ "type": "simple-grid",
680
+ "children": [
681
+ {
682
+ "type": "stat-display",
683
+ "label": "Delta",
684
+ "value": "@entity.quantityDelta",
685
+ "icon": "trending-up"
686
+ },
687
+ {
688
+ "icon": "calendar",
689
+ "value": "@entity.adjustedAt",
690
+ "type": "stat-display",
691
+ "label": "Adjusted at"
692
+ },
693
+ {
694
+ "type": "stat-display",
695
+ "label": "Reason",
696
+ "icon": "tag",
697
+ "value": "@entity.reason"
698
+ }
699
+ ]
451
700
  },
452
701
  {
453
- "icon": "rotate-ccw",
454
- "label": "Retry",
455
- "variant": "primary",
456
- "action": "INIT",
457
- "type": "button"
702
+ "gap": "sm",
703
+ "type": "stack",
704
+ "direction": "horizontal",
705
+ "align": "center",
706
+ "children": [
707
+ {
708
+ "label": "Delete",
709
+ "actionPayload": {
710
+ "row": "@entity",
711
+ "id": "@entity.id"
712
+ },
713
+ "action": "REQUEST_DELETE",
714
+ "variant": "danger",
715
+ "type": "button"
716
+ }
717
+ ]
458
718
  }
459
719
  ],
720
+ "gap": "md"
721
+ }
722
+ ]
723
+ ]
724
+ },
725
+ {
726
+ "from": "browsing",
727
+ "to": "loading",
728
+ "event": "CREATE",
729
+ "effects": [
730
+ [
731
+ "fetch",
732
+ "StockAdjustment",
733
+ {
734
+ "emit": {
735
+ "success": "StockAdjustmentLoaded",
736
+ "failure": "StockAdjustmentLoadFailed"
737
+ }
738
+ }
739
+ ],
740
+ [
741
+ "render-ui",
742
+ "main",
743
+ {
460
744
  "className": "py-12",
461
- "align": "center",
462
745
  "type": "stack",
463
746
  "gap": "md",
464
- "direction": "vertical"
747
+ "align": "center",
748
+ "direction": "vertical",
749
+ "children": [
750
+ {
751
+ "type": "spinner"
752
+ },
753
+ {
754
+ "content": "Opening new adjustment…",
755
+ "type": "typography",
756
+ "color": "muted",
757
+ "variant": "caption"
758
+ }
759
+ ]
465
760
  }
466
761
  ]
467
762
  ]
@@ -469,7 +764,51 @@
469
764
  {
470
765
  "from": "browsing",
471
766
  "to": "loading",
472
- "event": "INIT",
767
+ "event": "REQUEST_DELETE",
768
+ "effects": [
769
+ [
770
+ "set",
771
+ "@entity.id",
772
+ "@payload.id"
773
+ ],
774
+ [
775
+ "fetch",
776
+ "StockAdjustment",
777
+ {
778
+ "emit": {
779
+ "failure": "StockAdjustmentLoadFailed",
780
+ "success": "StockAdjustmentLoaded"
781
+ }
782
+ }
783
+ ],
784
+ [
785
+ "render-ui",
786
+ "main",
787
+ {
788
+ "align": "center",
789
+ "type": "stack",
790
+ "className": "py-12",
791
+ "direction": "vertical",
792
+ "gap": "md",
793
+ "children": [
794
+ {
795
+ "type": "spinner"
796
+ },
797
+ {
798
+ "variant": "caption",
799
+ "content": "Removing adjustment…",
800
+ "type": "typography",
801
+ "color": "muted"
802
+ }
803
+ ]
804
+ }
805
+ ]
806
+ ]
807
+ },
808
+ {
809
+ "from": "viewing_single",
810
+ "to": "loading",
811
+ "event": "CLOSE_VIEW",
473
812
  "effects": [
474
813
  [
475
814
  "fetch",
@@ -485,7 +824,66 @@
485
824
  "render-ui",
486
825
  "main",
487
826
  {
488
- "type": "spinner"
827
+ "children": [
828
+ {
829
+ "type": "spinner"
830
+ },
831
+ {
832
+ "content": "Loading adjustments…",
833
+ "type": "typography",
834
+ "color": "muted",
835
+ "variant": "caption"
836
+ }
837
+ ],
838
+ "gap": "md",
839
+ "align": "center",
840
+ "className": "py-12",
841
+ "direction": "vertical",
842
+ "type": "stack"
843
+ }
844
+ ]
845
+ ]
846
+ },
847
+ {
848
+ "from": "viewing_single",
849
+ "to": "loading",
850
+ "event": "REQUEST_DELETE",
851
+ "effects": [
852
+ [
853
+ "set",
854
+ "@entity.id",
855
+ "@payload.id"
856
+ ],
857
+ [
858
+ "fetch",
859
+ "StockAdjustment",
860
+ {
861
+ "emit": {
862
+ "success": "StockAdjustmentLoaded",
863
+ "failure": "StockAdjustmentLoadFailed"
864
+ }
865
+ }
866
+ ],
867
+ [
868
+ "render-ui",
869
+ "main",
870
+ {
871
+ "align": "center",
872
+ "className": "py-12",
873
+ "direction": "vertical",
874
+ "type": "stack",
875
+ "children": [
876
+ {
877
+ "type": "spinner"
878
+ },
879
+ {
880
+ "variant": "caption",
881
+ "content": "Removing adjustment…",
882
+ "type": "typography",
883
+ "color": "muted"
884
+ }
885
+ ],
886
+ "gap": "md"
489
887
  }
490
888
  ]
491
889
  ]
@@ -509,7 +907,8 @@
509
907
  "render-ui",
510
908
  "main",
511
909
  {
512
- "type": "spinner"
910
+ "type": "spinner",
911
+ "size": "sm"
513
912
  }
514
913
  ]
515
914
  ]
@@ -523,7 +922,6 @@
523
922
  "name": "StockAdjustmentCreate",
524
923
  "linkedEntity": "StockAdjustment",
525
924
  "config": {
526
- "mode": "create",
527
925
  "fields": [
528
926
  "sku",
529
927
  "warehouseId",
@@ -532,6 +930,7 @@
532
930
  "notes"
533
931
  ],
534
932
  "icon": "plus-circle",
933
+ "mode": "create",
535
934
  "title": "New Adjustment"
536
935
  },
537
936
  "events": {
@@ -553,14 +952,14 @@
553
952
  "name": "StockAdjustmentDelete",
554
953
  "linkedEntity": "StockAdjustment",
555
954
  "config": {
556
- "title": "Delete Adjustment",
557
- "alertMessage": "This action cannot be undone.",
558
955
  "icon": "alert-triangle",
956
+ "alertMessage": "This action cannot be undone.",
957
+ "title": "Delete Adjustment",
559
958
  "confirmLabel": "Delete"
560
959
  },
561
960
  "events": {
562
- "REQUEST": "DELETE",
563
- "CONFIRM": "CONFIRM_DELETE"
961
+ "CONFIRM": "CONFIRM_DELETE",
962
+ "REQUEST": "DELETE"
564
963
  },
565
964
  "listens": [
566
965
  {