@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-customer-account",
3
3
  "version": "1.0.0",
4
- "description": "Retail customer profile primitive with purchase history reference, store credit, and loyalty points.",
4
+ "description": "std-customer-account — retail customer profile primitive with loyalty points, store credit, and spend history. Lists customers in `browsing`; opens detail in `viewing_single` with Grant Points / Issue Credit / Ban actions.",
5
5
  "orbitals": [
6
6
  {
7
7
  "name": "CustomerAccountOrbital",
@@ -73,6 +73,61 @@
73
73
  "category": "interaction",
74
74
  "linkedEntity": "CustomerAccount",
75
75
  "emits": [
76
+ {
77
+ "event": "OPEN_CUSTOMER",
78
+ "payloadSchema": [
79
+ {
80
+ "name": "id",
81
+ "type": "string",
82
+ "required": true
83
+ },
84
+ {
85
+ "name": "row.id",
86
+ "type": "string",
87
+ "required": true
88
+ },
89
+ {
90
+ "name": "row.name",
91
+ "type": "string",
92
+ "required": true
93
+ },
94
+ {
95
+ "name": "row.email",
96
+ "type": "string"
97
+ },
98
+ {
99
+ "name": "row.phone",
100
+ "type": "string"
101
+ },
102
+ {
103
+ "name": "row.loyaltyPoints",
104
+ "type": "number"
105
+ },
106
+ {
107
+ "name": "row.storeCreditAmount",
108
+ "type": "number"
109
+ },
110
+ {
111
+ "name": "row.totalSpent",
112
+ "type": "number"
113
+ },
114
+ {
115
+ "name": "row.joinedAt",
116
+ "type": "string"
117
+ },
118
+ {
119
+ "name": "row.lastVisitAt",
120
+ "type": "string"
121
+ },
122
+ {
123
+ "name": "row.status",
124
+ "type": "string"
125
+ }
126
+ ]
127
+ },
128
+ {
129
+ "event": "CLOSE_VIEW"
130
+ },
76
131
  {
77
132
  "event": "GRANT_POINTS",
78
133
  "payloadSchema": [
@@ -93,6 +148,16 @@
93
148
  }
94
149
  ]
95
150
  },
151
+ {
152
+ "event": "BAN_CUSTOMER",
153
+ "payloadSchema": [
154
+ {
155
+ "name": "id",
156
+ "type": "string",
157
+ "required": true
158
+ }
159
+ ]
160
+ },
96
161
  {
97
162
  "event": "CustomerAccountLoaded",
98
163
  "payloadSchema": [
@@ -125,6 +190,9 @@
125
190
  {
126
191
  "name": "browsing"
127
192
  },
193
+ {
194
+ "name": "viewing_single"
195
+ },
128
196
  {
129
197
  "name": "error"
130
198
  }
@@ -158,6 +226,36 @@
158
226
  }
159
227
  ]
160
228
  },
229
+ {
230
+ "key": "OPEN_CUSTOMER",
231
+ "name": "Open Customer",
232
+ "payloadSchema": [
233
+ {
234
+ "name": "id",
235
+ "type": "string",
236
+ "required": true
237
+ },
238
+ {
239
+ "name": "row",
240
+ "type": "CustomerAccount"
241
+ }
242
+ ]
243
+ },
244
+ {
245
+ "key": "BAN_CUSTOMER",
246
+ "name": "Ban Customer",
247
+ "payloadSchema": [
248
+ {
249
+ "name": "id",
250
+ "type": "string",
251
+ "required": true
252
+ }
253
+ ]
254
+ },
255
+ {
256
+ "key": "CLOSE_VIEW",
257
+ "name": "Close View"
258
+ },
161
259
  {
162
260
  "key": "GRANT_POINTS",
163
261
  "name": "Grant Points",
@@ -201,7 +299,22 @@
201
299
  "render-ui",
202
300
  "main",
203
301
  {
204
- "type": "spinner"
302
+ "align": "center",
303
+ "gap": "md",
304
+ "children": [
305
+ {
306
+ "type": "spinner"
307
+ },
308
+ {
309
+ "variant": "caption",
310
+ "type": "typography",
311
+ "color": "muted",
312
+ "content": "Loading customers…"
313
+ }
314
+ ],
315
+ "type": "stack",
316
+ "className": "py-12",
317
+ "direction": "vertical"
205
318
  }
206
319
  ]
207
320
  ]
@@ -215,91 +328,86 @@
215
328
  "render-ui",
216
329
  "main",
217
330
  {
218
- "type": "stack",
219
331
  "direction": "vertical",
220
332
  "children": [
221
333
  {
222
- "type": "media-gallery",
223
- "items": [
334
+ "gap": "sm",
335
+ "align": "center",
336
+ "children": [
224
337
  {
225
- "src": "https://picsum.photos/seed/receipt1/400/300",
226
- "alt": "Receipt #1024",
227
- "id": "r1"
338
+ "name": "users",
339
+ "type": "icon"
228
340
  },
229
341
  {
230
- "id": "r2",
231
- "src": "https://picsum.photos/seed/receipt2/400/300",
232
- "alt": "Receipt #1025"
342
+ "content": "@config.title",
343
+ "type": "typography",
344
+ "variant": "h3"
345
+ }
346
+ ],
347
+ "direction": "horizontal",
348
+ "type": "stack"
349
+ },
350
+ {
351
+ "children": [
352
+ {
353
+ "type": "stat-display",
354
+ "value": "@payload.data.length",
355
+ "label": "Total customers",
356
+ "icon": "users"
357
+ },
358
+ {
359
+ "value": "1,284",
360
+ "icon": "check-circle",
361
+ "label": "Active",
362
+ "type": "stat-display"
233
363
  },
234
364
  {
235
- "id": "r3",
236
- "src": "https://picsum.photos/seed/receipt3/400/300",
237
- "alt": "Receipt #1026"
365
+ "type": "stat-display",
366
+ "value": "76%",
367
+ "icon": "award",
368
+ "label": "Loyalty members"
238
369
  },
239
370
  {
240
- "id": "r4",
241
- "alt": "Receipt #1027",
242
- "src": "https://picsum.photos/seed/receipt4/400/300"
371
+ "label": "Avg lifetime value",
372
+ "type": "stat-display",
373
+ "icon": "dollar-sign",
374
+ "value": "$412"
243
375
  }
244
- ]
376
+ ],
377
+ "type": "simple-grid",
378
+ "cols": 4.0
245
379
  },
246
380
  {
247
- "height": "h-48",
248
- "type": "flip-card",
249
- "back": {
250
- "direction": "vertical",
251
- "children": [
252
- {
253
- "type": "typography",
254
- "content": "2,450 points",
255
- "variant": "h4"
256
- },
257
- {
258
- "variant": "body",
259
- "type": "typography",
260
- "content": "Next reward at 3,000 points"
261
- }
262
- ],
263
- "type": "stack",
264
- "gap": "sm",
265
- "align": "center"
266
- },
267
- "front": {
268
- "children": [
269
- {
270
- "name": "award",
271
- "type": "icon"
272
- },
273
- {
274
- "type": "typography",
275
- "variant": "h4",
276
- "content": "Loyalty Tier: Gold"
277
- },
278
- {
279
- "content": "Tap to view points",
280
- "color": "muted",
281
- "type": "typography",
282
- "variant": "caption"
283
- }
284
- ],
285
- "type": "stack",
286
- "direction": "vertical",
287
- "gap": "sm",
288
- "align": "center"
289
- }
381
+ "type": "divider"
290
382
  },
291
383
  {
384
+ "itemActions": [
385
+ {
386
+ "event": "OPEN_CUSTOMER",
387
+ "label": "Open",
388
+ "variant": "primary",
389
+ "icon": "arrow-right"
390
+ },
391
+ {
392
+ "variant": "danger",
393
+ "event": "BAN_CUSTOMER",
394
+ "label": "Ban"
395
+ }
396
+ ],
397
+ "cols": 1.0,
292
398
  "type": "data-grid",
399
+ "entity": "@payload.data",
400
+ "gap": "sm",
293
401
  "fields": [
294
402
  {
403
+ "variant": "caption",
295
404
  "name": "name",
296
- "variant": "h4",
297
405
  "label": "Name"
298
406
  },
299
407
  {
300
- "name": "email",
301
408
  "label": "Email",
302
- "variant": "body"
409
+ "variant": "caption",
410
+ "name": "email"
303
411
  },
304
412
  {
305
413
  "variant": "caption",
@@ -307,60 +415,341 @@
307
415
  "label": "Phone"
308
416
  },
309
417
  {
418
+ "variant": "caption",
310
419
  "name": "loyaltyPoints",
311
- "label": "Points",
312
- "variant": "caption"
420
+ "label": "Points"
313
421
  },
314
422
  {
315
- "name": "totalSpent",
316
423
  "variant": "caption",
317
- "label": "Total Spent"
424
+ "label": "Total Spent",
425
+ "name": "totalSpent"
318
426
  },
319
427
  {
428
+ "name": "status",
320
429
  "label": "Status",
321
- "variant": "badge",
322
- "name": "status"
430
+ "variant": "badge"
323
431
  }
324
- ],
325
- "itemActions": [
432
+ ]
433
+ }
434
+ ],
435
+ "gap": "md",
436
+ "type": "stack"
437
+ }
438
+ ]
439
+ ]
440
+ },
441
+ {
442
+ "from": "loading",
443
+ "to": "error",
444
+ "event": "CustomerAccountLoadFailed",
445
+ "effects": [
446
+ [
447
+ "render-ui",
448
+ "main",
449
+ {
450
+ "variant": "error",
451
+ "type": "alert",
452
+ "message": "@payload.error"
453
+ }
454
+ ]
455
+ ]
456
+ },
457
+ {
458
+ "from": "browsing",
459
+ "to": "viewing_single",
460
+ "event": "OPEN_CUSTOMER",
461
+ "effects": [
462
+ [
463
+ "set",
464
+ "@entity.id",
465
+ "@payload.row.id"
466
+ ],
467
+ [
468
+ "set",
469
+ "@entity.name",
470
+ "@payload.row.name"
471
+ ],
472
+ [
473
+ "set",
474
+ "@entity.email",
475
+ "@payload.row.email"
476
+ ],
477
+ [
478
+ "set",
479
+ "@entity.phone",
480
+ "@payload.row.phone"
481
+ ],
482
+ [
483
+ "set",
484
+ "@entity.loyaltyPoints",
485
+ "@payload.row.loyaltyPoints"
486
+ ],
487
+ [
488
+ "set",
489
+ "@entity.storeCreditAmount",
490
+ "@payload.row.storeCreditAmount"
491
+ ],
492
+ [
493
+ "set",
494
+ "@entity.totalSpent",
495
+ "@payload.row.totalSpent"
496
+ ],
497
+ [
498
+ "set",
499
+ "@entity.joinedAt",
500
+ "@payload.row.joinedAt"
501
+ ],
502
+ [
503
+ "set",
504
+ "@entity.lastVisitAt",
505
+ "@payload.row.lastVisitAt"
506
+ ],
507
+ [
508
+ "set",
509
+ "@entity.status",
510
+ "@payload.row.status"
511
+ ],
512
+ [
513
+ "render-ui",
514
+ "main",
515
+ {
516
+ "gap": "md",
517
+ "type": "stack",
518
+ "direction": "vertical",
519
+ "children": [
520
+ {
521
+ "gap": "sm",
522
+ "direction": "horizontal",
523
+ "type": "stack",
524
+ "align": "center",
525
+ "children": [
526
+ {
527
+ "variant": "ghost",
528
+ "type": "button",
529
+ "action": "CLOSE_VIEW",
530
+ "label": "Back"
531
+ },
532
+ {
533
+ "type": "icon",
534
+ "name": "user"
535
+ },
536
+ {
537
+ "variant": "h3",
538
+ "content": "@entity.name",
539
+ "type": "typography"
540
+ },
326
541
  {
327
542
  "variant": "primary",
328
- "event": "GRANT_POINTS",
329
- "label": "Add Points"
543
+ "type": "badge",
544
+ "label": "@entity.status"
545
+ }
546
+ ]
547
+ },
548
+ {
549
+ "type": "divider"
550
+ },
551
+ {
552
+ "type": "stack",
553
+ "direction": "vertical",
554
+ "gap": "sm",
555
+ "children": [
556
+ {
557
+ "direction": "horizontal",
558
+ "children": [
559
+ {
560
+ "color": "muted",
561
+ "content": "Email",
562
+ "variant": "caption",
563
+ "type": "typography"
564
+ },
565
+ {
566
+ "content": "@entity.email",
567
+ "variant": "body",
568
+ "type": "typography"
569
+ }
570
+ ],
571
+ "type": "stack",
572
+ "gap": "md"
330
573
  },
331
574
  {
332
- "event": "GRANT_CREDIT",
333
- "variant": "ghost",
334
- "label": "Issue Credit"
575
+ "gap": "md",
576
+ "direction": "horizontal",
577
+ "type": "stack",
578
+ "children": [
579
+ {
580
+ "color": "muted",
581
+ "variant": "caption",
582
+ "type": "typography",
583
+ "content": "Phone"
584
+ },
585
+ {
586
+ "variant": "body",
587
+ "type": "typography",
588
+ "content": "@entity.phone"
589
+ }
590
+ ]
591
+ }
592
+ ]
593
+ },
594
+ {
595
+ "type": "divider"
596
+ },
597
+ {
598
+ "type": "simple-grid",
599
+ "cols": 4.0,
600
+ "children": [
601
+ {
602
+ "value": "@entity.loyaltyPoints",
603
+ "label": "Loyalty points",
604
+ "type": "stat-display",
605
+ "icon": "award"
606
+ },
607
+ {
608
+ "icon": "credit-card",
609
+ "value": "@entity.storeCreditAmount",
610
+ "type": "stat-display",
611
+ "label": "Store credit"
612
+ },
613
+ {
614
+ "icon": "dollar-sign",
615
+ "type": "stat-display",
616
+ "value": "@entity.totalSpent",
617
+ "label": "Total spent"
618
+ },
619
+ {
620
+ "type": "stat-display",
621
+ "value": "@entity.lastVisitAt",
622
+ "label": "Last visit",
623
+ "icon": "calendar"
624
+ }
625
+ ]
626
+ },
627
+ {
628
+ "direction": "horizontal",
629
+ "type": "stack",
630
+ "children": [
631
+ {
632
+ "action": "GRANT_POINTS",
633
+ "actionPayload": {
634
+ "id": "@entity.id"
635
+ },
636
+ "type": "button",
637
+ "variant": "primary",
638
+ "label": "Grant Points"
639
+ },
640
+ {
641
+ "action": "GRANT_CREDIT",
642
+ "type": "button",
643
+ "label": "Issue Credit",
644
+ "variant": "secondary",
645
+ "actionPayload": {
646
+ "id": "@entity.id"
647
+ }
648
+ },
649
+ {
650
+ "actionPayload": {
651
+ "id": "@entity.id"
652
+ },
653
+ "type": "button",
654
+ "variant": "danger",
655
+ "action": "BAN_CUSTOMER",
656
+ "label": "Ban"
335
657
  }
336
658
  ],
337
- "entity": "@payload.data"
659
+ "align": "center",
660
+ "gap": "sm"
661
+ }
662
+ ]
663
+ }
664
+ ]
665
+ ]
666
+ },
667
+ {
668
+ "from": "browsing",
669
+ "to": "loading",
670
+ "event": "BAN_CUSTOMER",
671
+ "effects": [
672
+ [
673
+ "set",
674
+ "@entity.id",
675
+ "@payload.id"
676
+ ],
677
+ [
678
+ "fetch",
679
+ "CustomerAccount",
680
+ {
681
+ "emit": {
682
+ "failure": "CustomerAccountLoadFailed",
683
+ "success": "CustomerAccountLoaded"
684
+ }
685
+ }
686
+ ],
687
+ [
688
+ "render-ui",
689
+ "main",
690
+ {
691
+ "children": [
692
+ {
693
+ "type": "spinner"
694
+ },
695
+ {
696
+ "content": "Banning customer…",
697
+ "type": "typography",
698
+ "variant": "caption",
699
+ "color": "muted"
338
700
  }
339
701
  ],
702
+ "direction": "vertical",
703
+ "type": "stack",
704
+ "align": "center",
705
+ "className": "py-12",
340
706
  "gap": "md"
341
707
  }
342
708
  ]
343
709
  ]
344
710
  },
345
711
  {
346
- "from": "loading",
347
- "to": "error",
348
- "event": "CustomerAccountLoadFailed",
712
+ "from": "viewing_single",
713
+ "to": "loading",
714
+ "event": "CLOSE_VIEW",
349
715
  "effects": [
716
+ [
717
+ "fetch",
718
+ "CustomerAccount",
719
+ {
720
+ "emit": {
721
+ "success": "CustomerAccountLoaded",
722
+ "failure": "CustomerAccountLoadFailed"
723
+ }
724
+ }
725
+ ],
350
726
  [
351
727
  "render-ui",
352
728
  "main",
353
729
  {
354
- "message": "@payload.error",
355
- "type": "alert",
356
- "variant": "error"
730
+ "type": "stack",
731
+ "className": "py-12",
732
+ "gap": "md",
733
+ "direction": "vertical",
734
+ "children": [
735
+ {
736
+ "type": "spinner"
737
+ },
738
+ {
739
+ "color": "muted",
740
+ "type": "typography",
741
+ "content": "Loading customers…",
742
+ "variant": "caption"
743
+ }
744
+ ],
745
+ "align": "center"
357
746
  }
358
747
  ]
359
748
  ]
360
749
  },
361
750
  {
362
- "from": "browsing",
363
- "to": "browsing",
751
+ "from": "viewing_single",
752
+ "to": "loading",
364
753
  "event": "GRANT_POINTS",
365
754
  "effects": [
366
755
  [
@@ -368,20 +757,43 @@
368
757
  "@entity.id",
369
758
  "@payload.id"
370
759
  ],
760
+ [
761
+ "fetch",
762
+ "CustomerAccount",
763
+ {
764
+ "emit": {
765
+ "failure": "CustomerAccountLoadFailed",
766
+ "success": "CustomerAccountLoaded"
767
+ }
768
+ }
769
+ ],
371
770
  [
372
771
  "render-ui",
373
772
  "main",
374
773
  {
375
- "message": "Points granted",
376
- "type": "alert",
377
- "variant": "success"
774
+ "gap": "md",
775
+ "direction": "vertical",
776
+ "align": "center",
777
+ "className": "py-12",
778
+ "type": "stack",
779
+ "children": [
780
+ {
781
+ "type": "spinner"
782
+ },
783
+ {
784
+ "variant": "caption",
785
+ "color": "muted",
786
+ "content": "Granting points…",
787
+ "type": "typography"
788
+ }
789
+ ]
378
790
  }
379
791
  ]
380
792
  ]
381
793
  },
382
794
  {
383
- "from": "browsing",
384
- "to": "browsing",
795
+ "from": "viewing_single",
796
+ "to": "loading",
385
797
  "event": "GRANT_CREDIT",
386
798
  "effects": [
387
799
  [
@@ -389,13 +801,80 @@
389
801
  "@entity.id",
390
802
  "@payload.id"
391
803
  ],
804
+ [
805
+ "fetch",
806
+ "CustomerAccount",
807
+ {
808
+ "emit": {
809
+ "failure": "CustomerAccountLoadFailed",
810
+ "success": "CustomerAccountLoaded"
811
+ }
812
+ }
813
+ ],
814
+ [
815
+ "render-ui",
816
+ "main",
817
+ {
818
+ "align": "center",
819
+ "direction": "vertical",
820
+ "gap": "md",
821
+ "className": "py-12",
822
+ "type": "stack",
823
+ "children": [
824
+ {
825
+ "type": "spinner"
826
+ },
827
+ {
828
+ "color": "muted",
829
+ "content": "Issuing store credit…",
830
+ "type": "typography",
831
+ "variant": "caption"
832
+ }
833
+ ]
834
+ }
835
+ ]
836
+ ]
837
+ },
838
+ {
839
+ "from": "viewing_single",
840
+ "to": "loading",
841
+ "event": "BAN_CUSTOMER",
842
+ "effects": [
843
+ [
844
+ "set",
845
+ "@entity.id",
846
+ "@payload.id"
847
+ ],
848
+ [
849
+ "fetch",
850
+ "CustomerAccount",
851
+ {
852
+ "emit": {
853
+ "failure": "CustomerAccountLoadFailed",
854
+ "success": "CustomerAccountLoaded"
855
+ }
856
+ }
857
+ ],
392
858
  [
393
859
  "render-ui",
394
860
  "main",
395
861
  {
396
- "type": "alert",
397
- "message": "Store credit issued",
398
- "variant": "success"
862
+ "type": "stack",
863
+ "align": "center",
864
+ "className": "py-12",
865
+ "gap": "md",
866
+ "children": [
867
+ {
868
+ "type": "spinner"
869
+ },
870
+ {
871
+ "color": "muted",
872
+ "content": "Banning customer…",
873
+ "variant": "caption",
874
+ "type": "typography"
875
+ }
876
+ ],
877
+ "direction": "vertical"
399
878
  }
400
879
  ]
401
880
  ]
@@ -410,8 +889,8 @@
410
889
  "CustomerAccount",
411
890
  {
412
891
  "emit": {
413
- "success": "CustomerAccountLoaded",
414
- "failure": "CustomerAccountLoadFailed"
892
+ "failure": "CustomerAccountLoadFailed",
893
+ "success": "CustomerAccountLoaded"
415
894
  }
416
895
  }
417
896
  ],
@@ -419,7 +898,8 @@
419
898
  "render-ui",
420
899
  "main",
421
900
  {
422
- "type": "spinner"
901
+ "type": "spinner",
902
+ "size": "sm"
423
903
  }
424
904
  ]
425
905
  ]