@almadar/std 3.1.0 → 3.1.1

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 (176) hide show
  1. package/dist/behaviors/exports/atoms/std-async.orb +420 -0
  2. package/dist/behaviors/exports/atoms/std-browse.orb +173 -0
  3. package/dist/behaviors/exports/atoms/std-cache-aside.orb +881 -0
  4. package/dist/behaviors/exports/atoms/std-circuit-breaker.orb +501 -0
  5. package/dist/behaviors/exports/atoms/std-collision.orb +616 -0
  6. package/dist/behaviors/exports/atoms/std-combat-log.orb +145 -0
  7. package/dist/behaviors/exports/atoms/std-combat.orb +410 -0
  8. package/dist/behaviors/exports/atoms/std-confirmation.orb +282 -0
  9. package/dist/behaviors/exports/atoms/std-dialogue-box.orb +238 -0
  10. package/dist/behaviors/exports/atoms/std-display.orb +842 -0
  11. package/dist/behaviors/exports/atoms/std-drawer.orb +316 -0
  12. package/dist/behaviors/exports/atoms/std-filter.orb +442 -0
  13. package/dist/behaviors/exports/atoms/std-game-audio.orb +113 -0
  14. package/dist/behaviors/exports/atoms/std-game-canvas-2d.orb +135 -0
  15. package/dist/behaviors/exports/atoms/std-game-canvas-3d.orb +224 -0
  16. package/dist/behaviors/exports/atoms/std-game-hud.orb +151 -0
  17. package/dist/behaviors/exports/atoms/std-game-menu.orb +211 -0
  18. package/dist/behaviors/exports/atoms/std-game-over-screen.orb +195 -0
  19. package/dist/behaviors/exports/atoms/std-gameflow.orb +318 -0
  20. package/dist/behaviors/exports/atoms/std-input.orb +629 -0
  21. package/dist/behaviors/exports/atoms/std-inventory-panel.orb +255 -0
  22. package/dist/behaviors/exports/atoms/std-isometric-canvas.orb +631 -0
  23. package/dist/behaviors/exports/atoms/std-loading.orb +511 -0
  24. package/dist/behaviors/exports/atoms/std-modal.orb +270 -0
  25. package/dist/behaviors/exports/atoms/std-movement.orb +1037 -0
  26. package/dist/behaviors/exports/atoms/std-notification.orb +418 -0
  27. package/dist/behaviors/exports/atoms/std-overworld.orb +483 -0
  28. package/dist/behaviors/exports/atoms/std-pagination.orb +331 -0
  29. package/dist/behaviors/exports/atoms/std-physics2d.orb +419 -0
  30. package/dist/behaviors/exports/atoms/std-platformer-canvas.orb +257 -0
  31. package/dist/behaviors/exports/atoms/std-quest.orb +980 -0
  32. package/dist/behaviors/exports/atoms/std-rate-limiter.orb +638 -0
  33. package/dist/behaviors/exports/atoms/std-score-board.orb +238 -0
  34. package/dist/behaviors/exports/atoms/std-score.orb +466 -0
  35. package/dist/behaviors/exports/atoms/std-search.orb +373 -0
  36. package/dist/behaviors/exports/atoms/std-selection.orb +759 -0
  37. package/dist/behaviors/exports/atoms/std-simulation-canvas.orb +183 -0
  38. package/dist/behaviors/exports/atoms/std-sort.orb +578 -0
  39. package/dist/behaviors/exports/atoms/std-sprite.orb +156 -0
  40. package/dist/behaviors/exports/atoms/std-tabs.orb +274 -0
  41. package/dist/behaviors/exports/atoms/std-timer.orb +1030 -0
  42. package/dist/behaviors/exports/atoms/std-undo.orb +694 -0
  43. package/dist/behaviors/exports/atoms/std-wizard.orb +666 -0
  44. package/dist/behaviors/exports/molecules/std-builder-game.orb +183 -0
  45. package/dist/behaviors/exports/molecules/std-cart.orb +591 -0
  46. package/dist/behaviors/exports/molecules/std-classifier-game.orb +183 -0
  47. package/dist/behaviors/exports/molecules/std-debugger-game.orb +183 -0
  48. package/dist/behaviors/exports/molecules/std-detail.orb +589 -0
  49. package/dist/behaviors/exports/molecules/std-event-handler-game.orb +183 -0
  50. package/dist/behaviors/exports/molecules/std-geospatial.orb +649 -0
  51. package/dist/behaviors/exports/molecules/std-inventory.orb +853 -0
  52. package/dist/behaviors/exports/molecules/std-list.orb +954 -0
  53. package/dist/behaviors/exports/molecules/std-messaging.orb +585 -0
  54. package/dist/behaviors/exports/molecules/std-negotiator-game.orb +183 -0
  55. package/dist/behaviors/exports/molecules/std-platformer-game.orb +496 -0
  56. package/dist/behaviors/exports/molecules/std-puzzle-game.orb +527 -0
  57. package/dist/behaviors/exports/molecules/std-sequencer-game.orb +183 -0
  58. package/dist/behaviors/exports/molecules/std-simulator-game.orb +183 -0
  59. package/dist/behaviors/exports/molecules/std-turn-based-battle.orb +443 -0
  60. package/dist/behaviors/exports/organisms/std-api-gateway.orb +2296 -0
  61. package/dist/behaviors/exports/organisms/std-arcade-game.orb +833 -0
  62. package/dist/behaviors/exports/organisms/std-booking-system.orb +3977 -0
  63. package/dist/behaviors/exports/organisms/std-cicd-pipeline.orb +2214 -0
  64. package/dist/behaviors/exports/organisms/std-cms.orb +2644 -0
  65. package/dist/behaviors/exports/organisms/std-coding-academy.orb +1394 -0
  66. package/dist/behaviors/exports/organisms/std-crm.orb +3541 -0
  67. package/dist/behaviors/exports/organisms/std-devops-dashboard.orb +3134 -0
  68. package/dist/behaviors/exports/organisms/std-ecommerce.orb +3743 -0
  69. package/dist/behaviors/exports/organisms/std-finance-tracker.orb +2385 -0
  70. package/dist/behaviors/exports/organisms/std-healthcare.orb +4679 -0
  71. package/dist/behaviors/exports/organisms/std-helpdesk.orb +2564 -0
  72. package/dist/behaviors/exports/organisms/std-hr-portal.orb +4029 -0
  73. package/dist/behaviors/exports/organisms/std-iot-dashboard.orb +2297 -0
  74. package/dist/behaviors/exports/organisms/std-lms.orb +2854 -0
  75. package/dist/behaviors/exports/organisms/std-logic-training.orb +598 -0
  76. package/dist/behaviors/exports/organisms/std-platformer-app.orb +1569 -0
  77. package/dist/behaviors/exports/organisms/std-project-manager.orb +3021 -0
  78. package/dist/behaviors/exports/organisms/std-puzzle-app.orb +743 -0
  79. package/dist/behaviors/exports/organisms/std-realtime-chat.orb +2380 -0
  80. package/dist/behaviors/exports/organisms/std-rpg-game.orb +2804 -0
  81. package/dist/behaviors/exports/organisms/std-social-feed.orb +1221 -0
  82. package/dist/behaviors/exports/organisms/std-stem-lab.orb +1210 -0
  83. package/dist/behaviors/exports/organisms/std-strategy-game.orb +1761 -0
  84. package/dist/behaviors/exports/organisms/std-trading-dashboard.orb +2217 -0
  85. package/dist/behaviors/exports-reader.d.ts +2 -0
  86. package/dist/behaviors/exports-reader.js +5 -3
  87. package/dist/behaviors/exports-reader.js.map +1 -1
  88. package/dist/behaviors/index.js +5 -3
  89. package/dist/behaviors/index.js.map +1 -1
  90. package/dist/exports/atoms/std-async.orb +420 -0
  91. package/dist/exports/atoms/std-browse.orb +173 -0
  92. package/dist/exports/atoms/std-cache-aside.orb +881 -0
  93. package/dist/exports/atoms/std-circuit-breaker.orb +501 -0
  94. package/dist/exports/atoms/std-collision.orb +616 -0
  95. package/dist/exports/atoms/std-combat-log.orb +145 -0
  96. package/dist/exports/atoms/std-combat.orb +410 -0
  97. package/dist/exports/atoms/std-confirmation.orb +282 -0
  98. package/dist/exports/atoms/std-dialogue-box.orb +238 -0
  99. package/dist/exports/atoms/std-display.orb +842 -0
  100. package/dist/exports/atoms/std-drawer.orb +316 -0
  101. package/dist/exports/atoms/std-filter.orb +442 -0
  102. package/dist/exports/atoms/std-game-audio.orb +113 -0
  103. package/dist/exports/atoms/std-game-canvas-2d.orb +135 -0
  104. package/dist/exports/atoms/std-game-canvas-3d.orb +224 -0
  105. package/dist/exports/atoms/std-game-hud.orb +151 -0
  106. package/dist/exports/atoms/std-game-menu.orb +211 -0
  107. package/dist/exports/atoms/std-game-over-screen.orb +195 -0
  108. package/dist/exports/atoms/std-gameflow.orb +318 -0
  109. package/dist/exports/atoms/std-input.orb +629 -0
  110. package/dist/exports/atoms/std-inventory-panel.orb +255 -0
  111. package/dist/exports/atoms/std-isometric-canvas.orb +631 -0
  112. package/dist/exports/atoms/std-loading.orb +511 -0
  113. package/dist/exports/atoms/std-modal.orb +270 -0
  114. package/dist/exports/atoms/std-movement.orb +1037 -0
  115. package/dist/exports/atoms/std-notification.orb +418 -0
  116. package/dist/exports/atoms/std-overworld.orb +483 -0
  117. package/dist/exports/atoms/std-pagination.orb +331 -0
  118. package/dist/exports/atoms/std-physics2d.orb +419 -0
  119. package/dist/exports/atoms/std-platformer-canvas.orb +257 -0
  120. package/dist/exports/atoms/std-quest.orb +980 -0
  121. package/dist/exports/atoms/std-rate-limiter.orb +638 -0
  122. package/dist/exports/atoms/std-score-board.orb +238 -0
  123. package/dist/exports/atoms/std-score.orb +466 -0
  124. package/dist/exports/atoms/std-search.orb +373 -0
  125. package/dist/exports/atoms/std-selection.orb +759 -0
  126. package/dist/exports/atoms/std-simulation-canvas.orb +183 -0
  127. package/dist/exports/atoms/std-sort.orb +578 -0
  128. package/dist/exports/atoms/std-sprite.orb +156 -0
  129. package/dist/exports/atoms/std-tabs.orb +274 -0
  130. package/dist/exports/atoms/std-timer.orb +1030 -0
  131. package/dist/exports/atoms/std-undo.orb +694 -0
  132. package/dist/exports/atoms/std-wizard.orb +666 -0
  133. package/dist/exports/molecules/std-builder-game.orb +183 -0
  134. package/dist/exports/molecules/std-cart.orb +591 -0
  135. package/dist/exports/molecules/std-classifier-game.orb +183 -0
  136. package/dist/exports/molecules/std-debugger-game.orb +183 -0
  137. package/dist/exports/molecules/std-detail.orb +589 -0
  138. package/dist/exports/molecules/std-event-handler-game.orb +183 -0
  139. package/dist/exports/molecules/std-geospatial.orb +649 -0
  140. package/dist/exports/molecules/std-inventory.orb +853 -0
  141. package/dist/exports/molecules/std-list.orb +954 -0
  142. package/dist/exports/molecules/std-messaging.orb +585 -0
  143. package/dist/exports/molecules/std-negotiator-game.orb +183 -0
  144. package/dist/exports/molecules/std-platformer-game.orb +496 -0
  145. package/dist/exports/molecules/std-puzzle-game.orb +527 -0
  146. package/dist/exports/molecules/std-sequencer-game.orb +183 -0
  147. package/dist/exports/molecules/std-simulator-game.orb +183 -0
  148. package/dist/exports/molecules/std-turn-based-battle.orb +443 -0
  149. package/dist/exports/organisms/std-api-gateway.orb +2296 -0
  150. package/dist/exports/organisms/std-arcade-game.orb +833 -0
  151. package/dist/exports/organisms/std-booking-system.orb +3977 -0
  152. package/dist/exports/organisms/std-cicd-pipeline.orb +2214 -0
  153. package/dist/exports/organisms/std-cms.orb +2644 -0
  154. package/dist/exports/organisms/std-coding-academy.orb +1394 -0
  155. package/dist/exports/organisms/std-crm.orb +3541 -0
  156. package/dist/exports/organisms/std-devops-dashboard.orb +3134 -0
  157. package/dist/exports/organisms/std-ecommerce.orb +3743 -0
  158. package/dist/exports/organisms/std-finance-tracker.orb +2385 -0
  159. package/dist/exports/organisms/std-healthcare.orb +4679 -0
  160. package/dist/exports/organisms/std-helpdesk.orb +2564 -0
  161. package/dist/exports/organisms/std-hr-portal.orb +4029 -0
  162. package/dist/exports/organisms/std-iot-dashboard.orb +2297 -0
  163. package/dist/exports/organisms/std-lms.orb +2854 -0
  164. package/dist/exports/organisms/std-logic-training.orb +598 -0
  165. package/dist/exports/organisms/std-platformer-app.orb +1569 -0
  166. package/dist/exports/organisms/std-project-manager.orb +3021 -0
  167. package/dist/exports/organisms/std-puzzle-app.orb +743 -0
  168. package/dist/exports/organisms/std-realtime-chat.orb +2380 -0
  169. package/dist/exports/organisms/std-rpg-game.orb +2804 -0
  170. package/dist/exports/organisms/std-social-feed.orb +1221 -0
  171. package/dist/exports/organisms/std-stem-lab.orb +1210 -0
  172. package/dist/exports/organisms/std-strategy-game.orb +1761 -0
  173. package/dist/exports/organisms/std-trading-dashboard.orb +2217 -0
  174. package/dist/index.js +5 -3
  175. package/dist/index.js.map +1 -1
  176. package/package.json +1 -1
@@ -0,0 +1,3743 @@
1
+ {
2
+ "name": "EcommerceApp",
3
+ "version": "1.0.0",
4
+ "orbitals": [
5
+ {
6
+ "name": "ProductOrbital",
7
+ "entity": {
8
+ "name": "Product",
9
+ "persistence": "runtime",
10
+ "fields": [
11
+ {
12
+ "name": "id",
13
+ "type": "string",
14
+ "required": true
15
+ },
16
+ {
17
+ "name": "name",
18
+ "type": "string",
19
+ "required": true
20
+ },
21
+ {
22
+ "name": "description",
23
+ "type": "string"
24
+ },
25
+ {
26
+ "name": "price",
27
+ "type": "number",
28
+ "required": true
29
+ },
30
+ {
31
+ "name": "category",
32
+ "type": "string"
33
+ },
34
+ {
35
+ "name": "sku",
36
+ "type": "string"
37
+ },
38
+ {
39
+ "name": "inStock",
40
+ "type": "boolean",
41
+ "default": true
42
+ }
43
+ ]
44
+ },
45
+ "traits": [
46
+ {
47
+ "name": "ProductBrowse",
48
+ "linkedEntity": "Product",
49
+ "category": "interaction",
50
+ "listens": [
51
+ {
52
+ "event": "PRODUCT_CREATED",
53
+ "triggers": "PRODUCT_CREATED"
54
+ },
55
+ {
56
+ "event": "PRODUCT_UPDATED",
57
+ "triggers": "PRODUCT_UPDATED"
58
+ }
59
+ ],
60
+ "stateMachine": {
61
+ "states": [
62
+ {
63
+ "name": "browsing",
64
+ "isInitial": true
65
+ },
66
+ {
67
+ "name": "deleting"
68
+ }
69
+ ],
70
+ "events": [
71
+ {
72
+ "key": "INIT",
73
+ "name": "Initialize"
74
+ },
75
+ {
76
+ "key": "CREATE",
77
+ "name": "CREATE"
78
+ },
79
+ {
80
+ "key": "VIEW",
81
+ "name": "VIEW",
82
+ "payload": [
83
+ {
84
+ "name": "id",
85
+ "type": "string",
86
+ "required": true
87
+ }
88
+ ]
89
+ },
90
+ {
91
+ "key": "EDIT",
92
+ "name": "EDIT",
93
+ "payload": [
94
+ {
95
+ "name": "id",
96
+ "type": "string",
97
+ "required": true
98
+ }
99
+ ]
100
+ },
101
+ {
102
+ "key": "DELETE",
103
+ "name": "DELETE",
104
+ "payload": [
105
+ {
106
+ "name": "id",
107
+ "type": "string",
108
+ "required": true
109
+ }
110
+ ]
111
+ },
112
+ {
113
+ "key": "PRODUCT_CREATED",
114
+ "name": "PRODUCT_CREATED",
115
+ "payload": [
116
+ {
117
+ "name": "data",
118
+ "type": "object",
119
+ "required": true
120
+ }
121
+ ]
122
+ },
123
+ {
124
+ "key": "PRODUCT_UPDATED",
125
+ "name": "PRODUCT_UPDATED",
126
+ "payload": [
127
+ {
128
+ "name": "data",
129
+ "type": "object",
130
+ "required": true
131
+ }
132
+ ]
133
+ },
134
+ {
135
+ "key": "CONFIRM_DELETE",
136
+ "name": "Confirm Delete"
137
+ },
138
+ {
139
+ "key": "CANCEL",
140
+ "name": "Cancel"
141
+ },
142
+ {
143
+ "key": "CLOSE",
144
+ "name": "Close"
145
+ }
146
+ ],
147
+ "transitions": [
148
+ {
149
+ "from": "browsing",
150
+ "to": "browsing",
151
+ "event": "INIT",
152
+ "effects": [
153
+ [
154
+ "fetch",
155
+ "Product"
156
+ ],
157
+ [
158
+ "render-ui",
159
+ "main",
160
+ {
161
+ "type": "stack",
162
+ "direction": "vertical",
163
+ "gap": "lg",
164
+ "children": [
165
+ {
166
+ "type": "stack",
167
+ "direction": "horizontal",
168
+ "gap": "md",
169
+ "justify": "space-between",
170
+ "children": [
171
+ {
172
+ "type": "stack",
173
+ "direction": "horizontal",
174
+ "gap": "sm",
175
+ "align": "center",
176
+ "children": [
177
+ {
178
+ "type": "icon",
179
+ "name": "package",
180
+ "size": "lg"
181
+ },
182
+ {
183
+ "type": "typography",
184
+ "content": "Products",
185
+ "variant": "h2"
186
+ }
187
+ ]
188
+ },
189
+ {
190
+ "type": "stack",
191
+ "direction": "horizontal",
192
+ "gap": "sm",
193
+ "children": [
194
+ {
195
+ "type": "button",
196
+ "label": "Create Product",
197
+ "event": "CREATE",
198
+ "variant": "primary",
199
+ "icon": "plus"
200
+ }
201
+ ]
202
+ }
203
+ ]
204
+ },
205
+ {
206
+ "type": "divider"
207
+ },
208
+ {
209
+ "type": "data-grid",
210
+ "entity": "Product",
211
+ "emptyIcon": "inbox",
212
+ "emptyTitle": "No products yet",
213
+ "emptyDescription": "Create your first product to get started.",
214
+ "itemActions": [
215
+ {
216
+ "label": "View",
217
+ "event": "VIEW"
218
+ },
219
+ {
220
+ "label": "Edit",
221
+ "event": "EDIT"
222
+ },
223
+ {
224
+ "label": "Delete",
225
+ "event": "DELETE",
226
+ "variant": "danger"
227
+ }
228
+ ],
229
+ "className": "transition-shadow hover:shadow-md cursor-pointer",
230
+ "children": [
231
+ {
232
+ "type": "stack",
233
+ "direction": "vertical",
234
+ "gap": "sm",
235
+ "children": [
236
+ {
237
+ "type": "stack",
238
+ "direction": "horizontal",
239
+ "justify": "space-between",
240
+ "align": "center",
241
+ "children": [
242
+ {
243
+ "type": "stack",
244
+ "direction": "horizontal",
245
+ "gap": "sm",
246
+ "align": "center",
247
+ "children": [
248
+ {
249
+ "type": "icon",
250
+ "name": "package",
251
+ "size": "sm"
252
+ },
253
+ {
254
+ "type": "typography",
255
+ "variant": "h4",
256
+ "content": "@entity.name"
257
+ }
258
+ ]
259
+ },
260
+ {
261
+ "type": "badge",
262
+ "label": "@entity.description"
263
+ }
264
+ ]
265
+ },
266
+ {
267
+ "type": "typography",
268
+ "variant": "caption",
269
+ "color": "muted",
270
+ "content": "@entity.price"
271
+ }
272
+ ]
273
+ }
274
+ ]
275
+ }
276
+ ]
277
+ }
278
+ ]
279
+ ]
280
+ },
281
+ {
282
+ "from": "browsing",
283
+ "to": "browsing",
284
+ "event": "PRODUCT_CREATED",
285
+ "effects": [
286
+ [
287
+ "fetch",
288
+ "Product"
289
+ ]
290
+ ]
291
+ },
292
+ {
293
+ "from": "browsing",
294
+ "to": "browsing",
295
+ "event": "PRODUCT_UPDATED",
296
+ "effects": [
297
+ [
298
+ "fetch",
299
+ "Product"
300
+ ]
301
+ ]
302
+ },
303
+ {
304
+ "from": "browsing",
305
+ "to": "deleting",
306
+ "event": "DELETE",
307
+ "effects": [
308
+ [
309
+ "fetch",
310
+ "Product",
311
+ "@payload.id"
312
+ ],
313
+ [
314
+ "render-ui",
315
+ "modal",
316
+ {
317
+ "type": "stack",
318
+ "direction": "vertical",
319
+ "gap": "md",
320
+ "children": [
321
+ {
322
+ "type": "stack",
323
+ "direction": "horizontal",
324
+ "gap": "sm",
325
+ "children": [
326
+ {
327
+ "type": "icon",
328
+ "name": "trash-2",
329
+ "size": "md"
330
+ },
331
+ {
332
+ "type": "typography",
333
+ "content": "Delete Product",
334
+ "variant": "h3"
335
+ }
336
+ ]
337
+ },
338
+ {
339
+ "type": "divider"
340
+ },
341
+ {
342
+ "type": "typography",
343
+ "content": "Are you sure you want to delete this product?",
344
+ "variant": "body"
345
+ },
346
+ {
347
+ "type": "stack",
348
+ "direction": "horizontal",
349
+ "gap": "sm",
350
+ "justify": "end",
351
+ "children": [
352
+ {
353
+ "type": "button",
354
+ "label": "Cancel",
355
+ "event": "CANCEL",
356
+ "variant": "ghost"
357
+ },
358
+ {
359
+ "type": "button",
360
+ "label": "Delete",
361
+ "event": "CONFIRM_DELETE",
362
+ "variant": "danger",
363
+ "icon": "trash"
364
+ }
365
+ ]
366
+ }
367
+ ]
368
+ }
369
+ ]
370
+ ]
371
+ },
372
+ {
373
+ "from": "deleting",
374
+ "to": "browsing",
375
+ "event": "CONFIRM_DELETE",
376
+ "effects": [
377
+ [
378
+ "persist",
379
+ "delete",
380
+ "Product",
381
+ "@entity.id"
382
+ ],
383
+ [
384
+ "render-ui",
385
+ "modal",
386
+ null
387
+ ],
388
+ [
389
+ "fetch",
390
+ "Product"
391
+ ],
392
+ [
393
+ "notify",
394
+ "Product deleted successfully"
395
+ ]
396
+ ]
397
+ },
398
+ {
399
+ "from": "deleting",
400
+ "to": "browsing",
401
+ "event": "CANCEL",
402
+ "effects": [
403
+ [
404
+ "render-ui",
405
+ "modal",
406
+ null
407
+ ]
408
+ ]
409
+ },
410
+ {
411
+ "from": "deleting",
412
+ "to": "browsing",
413
+ "event": "CLOSE",
414
+ "effects": [
415
+ [
416
+ "render-ui",
417
+ "modal",
418
+ null
419
+ ]
420
+ ]
421
+ }
422
+ ]
423
+ },
424
+ "emits": [
425
+ {
426
+ "event": "ADD_TO_CART",
427
+ "payload": [
428
+ {
429
+ "name": "id",
430
+ "type": "string",
431
+ "required": true
432
+ }
433
+ ],
434
+ "scope": "external"
435
+ }
436
+ ]
437
+ },
438
+ {
439
+ "name": "ProductCreate",
440
+ "linkedEntity": "Product",
441
+ "category": "interaction",
442
+ "emits": [
443
+ {
444
+ "event": "PRODUCT_CREATED"
445
+ }
446
+ ],
447
+ "stateMachine": {
448
+ "states": [
449
+ {
450
+ "name": "closed",
451
+ "isInitial": true
452
+ },
453
+ {
454
+ "name": "open"
455
+ }
456
+ ],
457
+ "events": [
458
+ {
459
+ "key": "INIT",
460
+ "name": "Initialize"
461
+ },
462
+ {
463
+ "key": "CREATE",
464
+ "name": "Open"
465
+ },
466
+ {
467
+ "key": "CLOSE",
468
+ "name": "Close"
469
+ },
470
+ {
471
+ "key": "SAVE",
472
+ "name": "Save",
473
+ "payload": [
474
+ {
475
+ "name": "data",
476
+ "type": "object",
477
+ "required": true
478
+ }
479
+ ]
480
+ }
481
+ ],
482
+ "transitions": [
483
+ {
484
+ "from": "closed",
485
+ "to": "closed",
486
+ "event": "INIT",
487
+ "effects": [
488
+ [
489
+ "fetch",
490
+ "Product"
491
+ ]
492
+ ]
493
+ },
494
+ {
495
+ "from": "closed",
496
+ "to": "open",
497
+ "event": "CREATE",
498
+ "effects": [
499
+ [
500
+ "fetch",
501
+ "Product"
502
+ ],
503
+ [
504
+ "render-ui",
505
+ "modal",
506
+ {
507
+ "type": "stack",
508
+ "direction": "vertical",
509
+ "gap": "md",
510
+ "children": [
511
+ {
512
+ "type": "stack",
513
+ "direction": "horizontal",
514
+ "gap": "sm",
515
+ "children": [
516
+ {
517
+ "type": "icon",
518
+ "name": "plus-circle",
519
+ "size": "md"
520
+ },
521
+ {
522
+ "type": "typography",
523
+ "content": "Create Product",
524
+ "variant": "h3"
525
+ }
526
+ ]
527
+ },
528
+ {
529
+ "type": "divider"
530
+ },
531
+ {
532
+ "type": "form-section",
533
+ "entity": "Product",
534
+ "mode": "create",
535
+ "submitEvent": "SAVE",
536
+ "cancelEvent": "CLOSE",
537
+ "fields": [
538
+ "name",
539
+ "description",
540
+ "price",
541
+ "category",
542
+ "sku",
543
+ "inStock"
544
+ ]
545
+ }
546
+ ]
547
+ }
548
+ ]
549
+ ]
550
+ },
551
+ {
552
+ "from": "open",
553
+ "to": "closed",
554
+ "event": "CLOSE",
555
+ "effects": [
556
+ [
557
+ "render-ui",
558
+ "modal",
559
+ null
560
+ ]
561
+ ]
562
+ },
563
+ {
564
+ "from": "open",
565
+ "to": "closed",
566
+ "event": "SAVE",
567
+ "effects": [
568
+ [
569
+ "persist",
570
+ "create",
571
+ "Product",
572
+ "@payload.data"
573
+ ],
574
+ [
575
+ "fetch",
576
+ "Product"
577
+ ],
578
+ [
579
+ "render-ui",
580
+ "modal",
581
+ null
582
+ ],
583
+ [
584
+ "emit",
585
+ "PRODUCT_CREATED"
586
+ ],
587
+ [
588
+ "notify",
589
+ "Product created successfully"
590
+ ]
591
+ ]
592
+ }
593
+ ]
594
+ }
595
+ },
596
+ {
597
+ "name": "ProductEdit",
598
+ "linkedEntity": "Product",
599
+ "category": "interaction",
600
+ "emits": [
601
+ {
602
+ "event": "PRODUCT_UPDATED"
603
+ }
604
+ ],
605
+ "stateMachine": {
606
+ "states": [
607
+ {
608
+ "name": "closed",
609
+ "isInitial": true
610
+ },
611
+ {
612
+ "name": "open"
613
+ }
614
+ ],
615
+ "events": [
616
+ {
617
+ "key": "INIT",
618
+ "name": "Initialize"
619
+ },
620
+ {
621
+ "key": "EDIT",
622
+ "name": "Open",
623
+ "payload": [
624
+ {
625
+ "name": "id",
626
+ "type": "string",
627
+ "required": true
628
+ }
629
+ ]
630
+ },
631
+ {
632
+ "key": "CLOSE",
633
+ "name": "Close"
634
+ },
635
+ {
636
+ "key": "SAVE",
637
+ "name": "Save",
638
+ "payload": [
639
+ {
640
+ "name": "data",
641
+ "type": "object",
642
+ "required": true
643
+ }
644
+ ]
645
+ }
646
+ ],
647
+ "transitions": [
648
+ {
649
+ "from": "closed",
650
+ "to": "closed",
651
+ "event": "INIT",
652
+ "effects": [
653
+ [
654
+ "fetch",
655
+ "Product"
656
+ ]
657
+ ]
658
+ },
659
+ {
660
+ "from": "closed",
661
+ "to": "open",
662
+ "event": "EDIT",
663
+ "effects": [
664
+ [
665
+ "fetch",
666
+ "Product",
667
+ "@payload.id"
668
+ ],
669
+ [
670
+ "render-ui",
671
+ "modal",
672
+ {
673
+ "type": "stack",
674
+ "direction": "vertical",
675
+ "gap": "md",
676
+ "children": [
677
+ {
678
+ "type": "stack",
679
+ "direction": "horizontal",
680
+ "gap": "sm",
681
+ "children": [
682
+ {
683
+ "type": "icon",
684
+ "name": "edit",
685
+ "size": "md"
686
+ },
687
+ {
688
+ "type": "typography",
689
+ "content": "Edit Product",
690
+ "variant": "h3"
691
+ }
692
+ ]
693
+ },
694
+ {
695
+ "type": "divider"
696
+ },
697
+ {
698
+ "type": "form-section",
699
+ "entity": "Product",
700
+ "mode": "edit",
701
+ "submitEvent": "SAVE",
702
+ "cancelEvent": "CLOSE",
703
+ "fields": [
704
+ "name",
705
+ "description",
706
+ "price",
707
+ "category",
708
+ "sku",
709
+ "inStock"
710
+ ]
711
+ }
712
+ ]
713
+ }
714
+ ]
715
+ ]
716
+ },
717
+ {
718
+ "from": "open",
719
+ "to": "closed",
720
+ "event": "CLOSE",
721
+ "effects": [
722
+ [
723
+ "render-ui",
724
+ "modal",
725
+ null
726
+ ]
727
+ ]
728
+ },
729
+ {
730
+ "from": "open",
731
+ "to": "closed",
732
+ "event": "SAVE",
733
+ "effects": [
734
+ [
735
+ "persist",
736
+ "update",
737
+ "Product",
738
+ "@payload.data"
739
+ ],
740
+ [
741
+ "fetch",
742
+ "Product"
743
+ ],
744
+ [
745
+ "render-ui",
746
+ "modal",
747
+ null
748
+ ],
749
+ [
750
+ "emit",
751
+ "PRODUCT_UPDATED"
752
+ ],
753
+ [
754
+ "notify",
755
+ "Product updated successfully"
756
+ ]
757
+ ]
758
+ }
759
+ ]
760
+ }
761
+ },
762
+ {
763
+ "name": "ProductView",
764
+ "linkedEntity": "Product",
765
+ "category": "interaction",
766
+ "stateMachine": {
767
+ "states": [
768
+ {
769
+ "name": "closed",
770
+ "isInitial": true
771
+ },
772
+ {
773
+ "name": "open"
774
+ }
775
+ ],
776
+ "events": [
777
+ {
778
+ "key": "INIT",
779
+ "name": "Initialize"
780
+ },
781
+ {
782
+ "key": "VIEW",
783
+ "name": "Open",
784
+ "payload": [
785
+ {
786
+ "name": "id",
787
+ "type": "string",
788
+ "required": true
789
+ }
790
+ ]
791
+ },
792
+ {
793
+ "key": "CLOSE",
794
+ "name": "Close"
795
+ }
796
+ ],
797
+ "transitions": [
798
+ {
799
+ "from": "closed",
800
+ "to": "closed",
801
+ "event": "INIT",
802
+ "effects": [
803
+ [
804
+ "fetch",
805
+ "Product"
806
+ ]
807
+ ]
808
+ },
809
+ {
810
+ "from": "closed",
811
+ "to": "open",
812
+ "event": "VIEW",
813
+ "effects": [
814
+ [
815
+ "fetch",
816
+ "Product",
817
+ "@payload.id"
818
+ ],
819
+ [
820
+ "render-ui",
821
+ "modal",
822
+ {
823
+ "type": "stack",
824
+ "direction": "vertical",
825
+ "gap": "md",
826
+ "children": [
827
+ {
828
+ "type": "stack",
829
+ "direction": "horizontal",
830
+ "gap": "sm",
831
+ "align": "center",
832
+ "children": [
833
+ {
834
+ "type": "icon",
835
+ "name": "eye",
836
+ "size": "md"
837
+ },
838
+ {
839
+ "type": "typography",
840
+ "variant": "h3",
841
+ "content": "@entity.name"
842
+ }
843
+ ]
844
+ },
845
+ {
846
+ "type": "divider"
847
+ },
848
+ {
849
+ "type": "stack",
850
+ "direction": "horizontal",
851
+ "gap": "md",
852
+ "children": [
853
+ {
854
+ "type": "typography",
855
+ "variant": "caption",
856
+ "content": "Name"
857
+ },
858
+ {
859
+ "type": "typography",
860
+ "variant": "body",
861
+ "content": "@entity.name"
862
+ }
863
+ ]
864
+ },
865
+ {
866
+ "type": "stack",
867
+ "direction": "horizontal",
868
+ "gap": "md",
869
+ "children": [
870
+ {
871
+ "type": "typography",
872
+ "variant": "caption",
873
+ "content": "Description"
874
+ },
875
+ {
876
+ "type": "typography",
877
+ "variant": "body",
878
+ "content": "@entity.description"
879
+ }
880
+ ]
881
+ },
882
+ {
883
+ "type": "stack",
884
+ "direction": "horizontal",
885
+ "gap": "md",
886
+ "children": [
887
+ {
888
+ "type": "typography",
889
+ "variant": "caption",
890
+ "content": "Price"
891
+ },
892
+ {
893
+ "type": "typography",
894
+ "variant": "body",
895
+ "content": "@entity.price"
896
+ }
897
+ ]
898
+ },
899
+ {
900
+ "type": "stack",
901
+ "direction": "horizontal",
902
+ "gap": "md",
903
+ "children": [
904
+ {
905
+ "type": "typography",
906
+ "variant": "caption",
907
+ "content": "Category"
908
+ },
909
+ {
910
+ "type": "typography",
911
+ "variant": "body",
912
+ "content": "@entity.category"
913
+ }
914
+ ]
915
+ },
916
+ {
917
+ "type": "stack",
918
+ "direction": "horizontal",
919
+ "gap": "md",
920
+ "children": [
921
+ {
922
+ "type": "typography",
923
+ "variant": "caption",
924
+ "content": "Sku"
925
+ },
926
+ {
927
+ "type": "typography",
928
+ "variant": "body",
929
+ "content": "@entity.sku"
930
+ }
931
+ ]
932
+ },
933
+ {
934
+ "type": "stack",
935
+ "direction": "horizontal",
936
+ "gap": "md",
937
+ "children": [
938
+ {
939
+ "type": "typography",
940
+ "variant": "caption",
941
+ "content": "InStock"
942
+ },
943
+ {
944
+ "type": "typography",
945
+ "variant": "body",
946
+ "content": "@entity.inStock"
947
+ }
948
+ ]
949
+ },
950
+ {
951
+ "type": "divider"
952
+ },
953
+ {
954
+ "type": "stack",
955
+ "direction": "horizontal",
956
+ "gap": "sm",
957
+ "justify": "end",
958
+ "children": [
959
+ {
960
+ "type": "button",
961
+ "label": "Edit",
962
+ "event": "EDIT",
963
+ "variant": "primary",
964
+ "icon": "edit"
965
+ },
966
+ {
967
+ "type": "button",
968
+ "label": "Close",
969
+ "event": "CLOSE",
970
+ "variant": "ghost"
971
+ }
972
+ ]
973
+ }
974
+ ]
975
+ }
976
+ ]
977
+ ]
978
+ },
979
+ {
980
+ "from": "open",
981
+ "to": "closed",
982
+ "event": "CLOSE",
983
+ "effects": [
984
+ [
985
+ "render-ui",
986
+ "modal",
987
+ null
988
+ ]
989
+ ]
990
+ }
991
+ ]
992
+ }
993
+ }
994
+ ],
995
+ "pages": [
996
+ {
997
+ "name": "ProductsPage",
998
+ "path": "/products",
999
+ "isInitial": true,
1000
+ "traits": [
1001
+ {
1002
+ "ref": "ProductBrowse"
1003
+ },
1004
+ {
1005
+ "ref": "ProductCreate"
1006
+ },
1007
+ {
1008
+ "ref": "ProductEdit"
1009
+ },
1010
+ {
1011
+ "ref": "ProductView"
1012
+ }
1013
+ ]
1014
+ }
1015
+ ]
1016
+ },
1017
+ {
1018
+ "name": "CartItemOrbital",
1019
+ "entity": {
1020
+ "name": "CartItem",
1021
+ "persistence": "runtime",
1022
+ "fields": [
1023
+ {
1024
+ "name": "id",
1025
+ "type": "string",
1026
+ "required": true
1027
+ },
1028
+ {
1029
+ "name": "productName",
1030
+ "type": "string",
1031
+ "required": true
1032
+ },
1033
+ {
1034
+ "name": "quantity",
1035
+ "type": "number",
1036
+ "required": true,
1037
+ "default": 1
1038
+ },
1039
+ {
1040
+ "name": "unitPrice",
1041
+ "type": "number",
1042
+ "required": true
1043
+ },
1044
+ {
1045
+ "name": "totalPrice",
1046
+ "type": "number"
1047
+ }
1048
+ ]
1049
+ },
1050
+ "traits": [
1051
+ {
1052
+ "name": "CartItemCartBrowse",
1053
+ "linkedEntity": "CartItem",
1054
+ "category": "interaction",
1055
+ "stateMachine": {
1056
+ "states": [
1057
+ {
1058
+ "name": "browsing",
1059
+ "isInitial": true
1060
+ },
1061
+ {
1062
+ "name": "checkout"
1063
+ }
1064
+ ],
1065
+ "events": [
1066
+ {
1067
+ "key": "INIT",
1068
+ "name": "Initialize"
1069
+ },
1070
+ {
1071
+ "key": "ADD_ITEM",
1072
+ "name": "Add Item"
1073
+ },
1074
+ {
1075
+ "key": "SAVE",
1076
+ "name": "Save",
1077
+ "payload": [
1078
+ {
1079
+ "name": "data",
1080
+ "type": "object",
1081
+ "required": true
1082
+ }
1083
+ ]
1084
+ },
1085
+ {
1086
+ "key": "REMOVE_ITEM",
1087
+ "name": "Remove Item",
1088
+ "payload": [
1089
+ {
1090
+ "name": "id",
1091
+ "type": "string",
1092
+ "required": true
1093
+ }
1094
+ ]
1095
+ },
1096
+ {
1097
+ "key": "PROCEED_CHECKOUT",
1098
+ "name": "Proceed to Checkout"
1099
+ },
1100
+ {
1101
+ "key": "BACK_TO_CART",
1102
+ "name": "Back to Cart"
1103
+ },
1104
+ {
1105
+ "key": "CONFIRM_ORDER",
1106
+ "name": "Confirm Order"
1107
+ }
1108
+ ],
1109
+ "transitions": [
1110
+ {
1111
+ "from": "browsing",
1112
+ "to": "browsing",
1113
+ "event": "INIT",
1114
+ "effects": [
1115
+ [
1116
+ "fetch",
1117
+ "CartItem"
1118
+ ],
1119
+ [
1120
+ "render-ui",
1121
+ "main",
1122
+ {
1123
+ "type": "stack",
1124
+ "direction": "vertical",
1125
+ "gap": "lg",
1126
+ "children": [
1127
+ {
1128
+ "type": "stack",
1129
+ "direction": "horizontal",
1130
+ "gap": "md",
1131
+ "justify": "space-between",
1132
+ "children": [
1133
+ {
1134
+ "type": "stack",
1135
+ "direction": "horizontal",
1136
+ "gap": "md",
1137
+ "children": [
1138
+ {
1139
+ "type": "icon",
1140
+ "name": "shopping-cart",
1141
+ "size": "lg"
1142
+ },
1143
+ {
1144
+ "type": "typography",
1145
+ "content": "Shopping Cart",
1146
+ "variant": "h2"
1147
+ }
1148
+ ]
1149
+ },
1150
+ {
1151
+ "type": "button",
1152
+ "label": "Add Item",
1153
+ "event": "ADD_ITEM",
1154
+ "variant": "primary",
1155
+ "icon": "plus"
1156
+ }
1157
+ ]
1158
+ },
1159
+ {
1160
+ "type": "divider"
1161
+ },
1162
+ {
1163
+ "type": "data-grid",
1164
+ "entity": "CartItem",
1165
+ "emptyIcon": "inbox",
1166
+ "emptyTitle": "Your cart is empty",
1167
+ "emptyDescription": "Add items to get started.",
1168
+ "itemActions": [
1169
+ {
1170
+ "label": "Remove",
1171
+ "event": "REMOVE_ITEM",
1172
+ "variant": "danger"
1173
+ }
1174
+ ],
1175
+ "children": [
1176
+ {
1177
+ "type": "stack",
1178
+ "direction": "vertical",
1179
+ "gap": "sm",
1180
+ "children": [
1181
+ {
1182
+ "type": "stack",
1183
+ "direction": "horizontal",
1184
+ "justify": "space-between",
1185
+ "align": "center",
1186
+ "children": [
1187
+ {
1188
+ "type": "stack",
1189
+ "direction": "horizontal",
1190
+ "gap": "sm",
1191
+ "align": "center",
1192
+ "children": [
1193
+ {
1194
+ "type": "icon",
1195
+ "name": "shopping-cart",
1196
+ "size": "sm"
1197
+ },
1198
+ {
1199
+ "type": "typography",
1200
+ "variant": "h4",
1201
+ "content": "@entity.productName"
1202
+ }
1203
+ ]
1204
+ },
1205
+ {
1206
+ "type": "badge",
1207
+ "label": "@entity.quantity"
1208
+ }
1209
+ ]
1210
+ },
1211
+ {
1212
+ "type": "typography",
1213
+ "variant": "caption",
1214
+ "content": "@entity.unitPrice"
1215
+ }
1216
+ ]
1217
+ }
1218
+ ]
1219
+ },
1220
+ {
1221
+ "type": "button",
1222
+ "label": "Proceed to Checkout",
1223
+ "event": "PROCEED_CHECKOUT",
1224
+ "variant": "primary",
1225
+ "icon": "arrow-right"
1226
+ }
1227
+ ]
1228
+ }
1229
+ ]
1230
+ ]
1231
+ },
1232
+ {
1233
+ "from": "browsing",
1234
+ "to": "browsing",
1235
+ "event": "SAVE",
1236
+ "effects": [
1237
+ [
1238
+ "fetch",
1239
+ "CartItem"
1240
+ ]
1241
+ ]
1242
+ },
1243
+ {
1244
+ "from": "browsing",
1245
+ "to": "browsing",
1246
+ "event": "REMOVE_ITEM",
1247
+ "effects": [
1248
+ [
1249
+ "persist",
1250
+ "delete",
1251
+ "CartItem",
1252
+ "@payload.id"
1253
+ ],
1254
+ [
1255
+ "fetch",
1256
+ "CartItem"
1257
+ ],
1258
+ [
1259
+ "notify",
1260
+ "CartItem deleted successfully"
1261
+ ]
1262
+ ]
1263
+ },
1264
+ {
1265
+ "from": "browsing",
1266
+ "to": "checkout",
1267
+ "event": "PROCEED_CHECKOUT",
1268
+ "effects": [
1269
+ [
1270
+ "fetch",
1271
+ "CartItem"
1272
+ ],
1273
+ [
1274
+ "render-ui",
1275
+ "main",
1276
+ {
1277
+ "type": "stack",
1278
+ "direction": "vertical",
1279
+ "gap": "lg",
1280
+ "children": [
1281
+ {
1282
+ "type": "stack",
1283
+ "direction": "horizontal",
1284
+ "gap": "sm",
1285
+ "children": [
1286
+ {
1287
+ "type": "icon",
1288
+ "name": "clipboard",
1289
+ "size": "lg"
1290
+ },
1291
+ {
1292
+ "type": "typography",
1293
+ "content": "Checkout",
1294
+ "variant": "h2"
1295
+ }
1296
+ ]
1297
+ },
1298
+ {
1299
+ "type": "divider"
1300
+ },
1301
+ {
1302
+ "type": "data-grid",
1303
+ "entity": "CartItem",
1304
+ "emptyIcon": "inbox",
1305
+ "emptyTitle": "Your cart is empty",
1306
+ "emptyDescription": "Add items to get started.",
1307
+ "itemActions": [
1308
+ {
1309
+ "label": "Remove",
1310
+ "event": "REMOVE_ITEM",
1311
+ "variant": "danger"
1312
+ }
1313
+ ],
1314
+ "children": [
1315
+ {
1316
+ "type": "stack",
1317
+ "direction": "vertical",
1318
+ "gap": "sm",
1319
+ "children": [
1320
+ {
1321
+ "type": "stack",
1322
+ "direction": "horizontal",
1323
+ "justify": "space-between",
1324
+ "align": "center",
1325
+ "children": [
1326
+ {
1327
+ "type": "stack",
1328
+ "direction": "horizontal",
1329
+ "gap": "sm",
1330
+ "align": "center",
1331
+ "children": [
1332
+ {
1333
+ "type": "icon",
1334
+ "name": "shopping-cart",
1335
+ "size": "sm"
1336
+ },
1337
+ {
1338
+ "type": "typography",
1339
+ "variant": "h4",
1340
+ "content": "@entity.productName"
1341
+ }
1342
+ ]
1343
+ },
1344
+ {
1345
+ "type": "badge",
1346
+ "label": "@entity.quantity"
1347
+ }
1348
+ ]
1349
+ },
1350
+ {
1351
+ "type": "typography",
1352
+ "variant": "caption",
1353
+ "content": "@entity.unitPrice"
1354
+ }
1355
+ ]
1356
+ }
1357
+ ]
1358
+ },
1359
+ {
1360
+ "type": "stack",
1361
+ "direction": "horizontal",
1362
+ "gap": "sm",
1363
+ "justify": "end",
1364
+ "children": [
1365
+ {
1366
+ "type": "button",
1367
+ "label": "Back to Cart",
1368
+ "event": "BACK_TO_CART",
1369
+ "variant": "ghost",
1370
+ "icon": "arrow-left"
1371
+ },
1372
+ {
1373
+ "type": "button",
1374
+ "label": "Confirm Order",
1375
+ "event": "CONFIRM_ORDER",
1376
+ "variant": "primary",
1377
+ "icon": "check"
1378
+ }
1379
+ ]
1380
+ }
1381
+ ]
1382
+ }
1383
+ ]
1384
+ ]
1385
+ },
1386
+ {
1387
+ "from": "checkout",
1388
+ "to": "browsing",
1389
+ "event": "BACK_TO_CART",
1390
+ "effects": [
1391
+ [
1392
+ "fetch",
1393
+ "CartItem"
1394
+ ]
1395
+ ]
1396
+ },
1397
+ {
1398
+ "from": "checkout",
1399
+ "to": "browsing",
1400
+ "event": "CONFIRM_ORDER",
1401
+ "effects": [
1402
+ [
1403
+ "fetch",
1404
+ "CartItem"
1405
+ ],
1406
+ [
1407
+ "render-ui",
1408
+ "main",
1409
+ {
1410
+ "type": "stack",
1411
+ "direction": "vertical",
1412
+ "gap": "lg",
1413
+ "align": "center",
1414
+ "children": [
1415
+ {
1416
+ "type": "icon",
1417
+ "name": "check-circle",
1418
+ "size": "lg"
1419
+ },
1420
+ {
1421
+ "type": "typography",
1422
+ "content": "Order Confirmed",
1423
+ "variant": "h2"
1424
+ },
1425
+ {
1426
+ "type": "typography",
1427
+ "content": "Your order has been placed successfully.",
1428
+ "variant": "body"
1429
+ },
1430
+ {
1431
+ "type": "button",
1432
+ "label": "Continue Shopping",
1433
+ "event": "INIT",
1434
+ "variant": "primary"
1435
+ }
1436
+ ]
1437
+ }
1438
+ ]
1439
+ ]
1440
+ }
1441
+ ]
1442
+ },
1443
+ "listens": [
1444
+ {
1445
+ "event": "ADD_TO_CART",
1446
+ "triggers": "INIT",
1447
+ "scope": "external"
1448
+ }
1449
+ ],
1450
+ "emits": [
1451
+ {
1452
+ "event": "CHECKOUT_STARTED",
1453
+ "payload": [
1454
+ {
1455
+ "name": "id",
1456
+ "type": "string",
1457
+ "required": true
1458
+ }
1459
+ ],
1460
+ "scope": "external"
1461
+ }
1462
+ ]
1463
+ },
1464
+ {
1465
+ "name": "CartItemAddItem",
1466
+ "linkedEntity": "CartItem",
1467
+ "category": "interaction",
1468
+ "stateMachine": {
1469
+ "states": [
1470
+ {
1471
+ "name": "closed",
1472
+ "isInitial": true
1473
+ },
1474
+ {
1475
+ "name": "open"
1476
+ }
1477
+ ],
1478
+ "events": [
1479
+ {
1480
+ "key": "INIT",
1481
+ "name": "Initialize"
1482
+ },
1483
+ {
1484
+ "key": "ADD_ITEM",
1485
+ "name": "Open"
1486
+ },
1487
+ {
1488
+ "key": "CLOSE",
1489
+ "name": "Close"
1490
+ },
1491
+ {
1492
+ "key": "SAVE",
1493
+ "name": "Save",
1494
+ "payload": [
1495
+ {
1496
+ "name": "data",
1497
+ "type": "object",
1498
+ "required": true
1499
+ }
1500
+ ]
1501
+ }
1502
+ ],
1503
+ "transitions": [
1504
+ {
1505
+ "from": "closed",
1506
+ "to": "closed",
1507
+ "event": "INIT",
1508
+ "effects": [
1509
+ [
1510
+ "fetch",
1511
+ "CartItem"
1512
+ ]
1513
+ ]
1514
+ },
1515
+ {
1516
+ "from": "closed",
1517
+ "to": "open",
1518
+ "event": "ADD_ITEM",
1519
+ "effects": [
1520
+ [
1521
+ "fetch",
1522
+ "CartItem"
1523
+ ],
1524
+ [
1525
+ "render-ui",
1526
+ "modal",
1527
+ {
1528
+ "type": "stack",
1529
+ "direction": "vertical",
1530
+ "gap": "md",
1531
+ "children": [
1532
+ {
1533
+ "type": "stack",
1534
+ "direction": "horizontal",
1535
+ "gap": "sm",
1536
+ "children": [
1537
+ {
1538
+ "type": "icon",
1539
+ "name": "plus-circle",
1540
+ "size": "md"
1541
+ },
1542
+ {
1543
+ "type": "typography",
1544
+ "content": "Add Item",
1545
+ "variant": "h3"
1546
+ }
1547
+ ]
1548
+ },
1549
+ {
1550
+ "type": "divider"
1551
+ },
1552
+ {
1553
+ "type": "form-section",
1554
+ "entity": "CartItem",
1555
+ "mode": "create",
1556
+ "submitEvent": "SAVE",
1557
+ "cancelEvent": "CLOSE",
1558
+ "fields": [
1559
+ "productName",
1560
+ "quantity",
1561
+ "unitPrice",
1562
+ "totalPrice"
1563
+ ]
1564
+ }
1565
+ ]
1566
+ }
1567
+ ]
1568
+ ]
1569
+ },
1570
+ {
1571
+ "from": "open",
1572
+ "to": "closed",
1573
+ "event": "CLOSE",
1574
+ "effects": [
1575
+ [
1576
+ "render-ui",
1577
+ "modal",
1578
+ null
1579
+ ]
1580
+ ]
1581
+ },
1582
+ {
1583
+ "from": "open",
1584
+ "to": "closed",
1585
+ "event": "SAVE",
1586
+ "effects": [
1587
+ [
1588
+ "persist",
1589
+ "create",
1590
+ "CartItem",
1591
+ "@payload.data"
1592
+ ],
1593
+ [
1594
+ "fetch",
1595
+ "CartItem"
1596
+ ],
1597
+ [
1598
+ "render-ui",
1599
+ "modal",
1600
+ null
1601
+ ],
1602
+ [
1603
+ "notify",
1604
+ "CartItem created successfully"
1605
+ ]
1606
+ ]
1607
+ }
1608
+ ]
1609
+ }
1610
+ }
1611
+ ],
1612
+ "pages": [
1613
+ {
1614
+ "name": "CartPage",
1615
+ "path": "/cart",
1616
+ "traits": [
1617
+ {
1618
+ "ref": "CartItemCartBrowse"
1619
+ },
1620
+ {
1621
+ "ref": "CartItemAddItem"
1622
+ }
1623
+ ]
1624
+ }
1625
+ ]
1626
+ },
1627
+ {
1628
+ "name": "CheckoutOrbital",
1629
+ "entity": {
1630
+ "name": "Checkout",
1631
+ "persistence": "runtime",
1632
+ "fields": [
1633
+ {
1634
+ "name": "id",
1635
+ "type": "string",
1636
+ "required": true
1637
+ },
1638
+ {
1639
+ "name": "customerName",
1640
+ "type": "string",
1641
+ "required": true
1642
+ },
1643
+ {
1644
+ "name": "email",
1645
+ "type": "string",
1646
+ "required": true
1647
+ },
1648
+ {
1649
+ "name": "shippingAddress",
1650
+ "type": "string",
1651
+ "required": true
1652
+ },
1653
+ {
1654
+ "name": "paymentMethod",
1655
+ "type": "string",
1656
+ "required": true
1657
+ },
1658
+ {
1659
+ "name": "orderTotal",
1660
+ "type": "number"
1661
+ },
1662
+ {
1663
+ "name": "status",
1664
+ "type": "string",
1665
+ "default": "pending"
1666
+ }
1667
+ ]
1668
+ },
1669
+ "traits": [
1670
+ {
1671
+ "name": "CheckoutWizard",
1672
+ "linkedEntity": "Checkout",
1673
+ "category": "interaction",
1674
+ "stateMachine": {
1675
+ "states": [
1676
+ {
1677
+ "name": "step1",
1678
+ "isInitial": true
1679
+ },
1680
+ {
1681
+ "name": "step2"
1682
+ },
1683
+ {
1684
+ "name": "step3"
1685
+ },
1686
+ {
1687
+ "name": "review"
1688
+ },
1689
+ {
1690
+ "name": "complete"
1691
+ }
1692
+ ],
1693
+ "events": [
1694
+ {
1695
+ "key": "INIT",
1696
+ "name": "Initialize"
1697
+ },
1698
+ {
1699
+ "key": "NEXT",
1700
+ "name": "Next Step",
1701
+ "payload": [
1702
+ {
1703
+ "name": "data",
1704
+ "type": "object",
1705
+ "required": true
1706
+ }
1707
+ ]
1708
+ },
1709
+ {
1710
+ "key": "PREV",
1711
+ "name": "Previous Step"
1712
+ },
1713
+ {
1714
+ "key": "COMPLETE",
1715
+ "name": "Complete Wizard",
1716
+ "payload": [
1717
+ {
1718
+ "name": "data",
1719
+ "type": "object",
1720
+ "required": true
1721
+ }
1722
+ ]
1723
+ },
1724
+ {
1725
+ "key": "RESTART",
1726
+ "name": "Restart Wizard"
1727
+ }
1728
+ ],
1729
+ "transitions": [
1730
+ {
1731
+ "from": "step1",
1732
+ "to": "step1",
1733
+ "event": "INIT",
1734
+ "effects": [
1735
+ [
1736
+ "fetch",
1737
+ "Checkout"
1738
+ ],
1739
+ [
1740
+ "render-ui",
1741
+ "main",
1742
+ {
1743
+ "type": "stack",
1744
+ "direction": "vertical",
1745
+ "gap": "lg",
1746
+ "children": [
1747
+ {
1748
+ "type": "stack",
1749
+ "direction": "horizontal",
1750
+ "gap": "sm",
1751
+ "align": "center",
1752
+ "children": [
1753
+ {
1754
+ "type": "icon",
1755
+ "name": "credit-card",
1756
+ "size": "lg"
1757
+ },
1758
+ {
1759
+ "type": "typography",
1760
+ "content": "Checkout",
1761
+ "variant": "h2"
1762
+ }
1763
+ ]
1764
+ },
1765
+ {
1766
+ "type": "badge",
1767
+ "label": "Step 1 of 3"
1768
+ },
1769
+ {
1770
+ "type": "wizard-progress",
1771
+ "steps": [
1772
+ "Customer Info",
1773
+ "Shipping",
1774
+ "Payment"
1775
+ ],
1776
+ "currentStep": 0
1777
+ },
1778
+ {
1779
+ "type": "divider"
1780
+ },
1781
+ {
1782
+ "type": "typography",
1783
+ "content": "Customer Info",
1784
+ "variant": "h3"
1785
+ },
1786
+ {
1787
+ "type": "form-section",
1788
+ "entity": "Checkout",
1789
+ "mode": "create",
1790
+ "submitEvent": "NEXT",
1791
+ "cancelEvent": "INIT",
1792
+ "fields": [
1793
+ "customerName",
1794
+ "email"
1795
+ ]
1796
+ },
1797
+ {
1798
+ "type": "stack",
1799
+ "direction": "horizontal",
1800
+ "gap": "sm",
1801
+ "justify": "end",
1802
+ "children": [
1803
+ {
1804
+ "type": "button",
1805
+ "label": "Next",
1806
+ "event": "NEXT",
1807
+ "variant": "primary",
1808
+ "icon": "arrow-right"
1809
+ }
1810
+ ]
1811
+ }
1812
+ ]
1813
+ }
1814
+ ]
1815
+ ]
1816
+ },
1817
+ {
1818
+ "from": "step1",
1819
+ "to": "step2",
1820
+ "event": "NEXT",
1821
+ "effects": [
1822
+ [
1823
+ "fetch",
1824
+ "Checkout"
1825
+ ],
1826
+ [
1827
+ "render-ui",
1828
+ "main",
1829
+ {
1830
+ "type": "stack",
1831
+ "direction": "vertical",
1832
+ "gap": "lg",
1833
+ "children": [
1834
+ {
1835
+ "type": "stack",
1836
+ "direction": "horizontal",
1837
+ "gap": "sm",
1838
+ "align": "center",
1839
+ "children": [
1840
+ {
1841
+ "type": "icon",
1842
+ "name": "credit-card",
1843
+ "size": "lg"
1844
+ },
1845
+ {
1846
+ "type": "typography",
1847
+ "content": "Checkout",
1848
+ "variant": "h2"
1849
+ }
1850
+ ]
1851
+ },
1852
+ {
1853
+ "type": "badge",
1854
+ "label": "Step 2 of 3"
1855
+ },
1856
+ {
1857
+ "type": "wizard-progress",
1858
+ "steps": [
1859
+ "Customer Info",
1860
+ "Shipping",
1861
+ "Payment"
1862
+ ],
1863
+ "currentStep": 1
1864
+ },
1865
+ {
1866
+ "type": "divider"
1867
+ },
1868
+ {
1869
+ "type": "typography",
1870
+ "content": "Shipping",
1871
+ "variant": "h3"
1872
+ },
1873
+ {
1874
+ "type": "form-section",
1875
+ "entity": "Checkout",
1876
+ "mode": "create",
1877
+ "submitEvent": "NEXT",
1878
+ "cancelEvent": "PREV",
1879
+ "fields": [
1880
+ "shippingAddress"
1881
+ ]
1882
+ },
1883
+ {
1884
+ "type": "stack",
1885
+ "direction": "horizontal",
1886
+ "gap": "sm",
1887
+ "justify": "end",
1888
+ "children": [
1889
+ {
1890
+ "type": "button",
1891
+ "label": "Back",
1892
+ "event": "PREV",
1893
+ "variant": "ghost",
1894
+ "icon": "arrow-left"
1895
+ },
1896
+ {
1897
+ "type": "button",
1898
+ "label": "Next",
1899
+ "event": "NEXT",
1900
+ "variant": "primary",
1901
+ "icon": "arrow-right"
1902
+ }
1903
+ ]
1904
+ }
1905
+ ]
1906
+ }
1907
+ ]
1908
+ ]
1909
+ },
1910
+ {
1911
+ "from": "step2",
1912
+ "to": "step3",
1913
+ "event": "NEXT",
1914
+ "effects": [
1915
+ [
1916
+ "fetch",
1917
+ "Checkout"
1918
+ ],
1919
+ [
1920
+ "render-ui",
1921
+ "main",
1922
+ {
1923
+ "type": "stack",
1924
+ "direction": "vertical",
1925
+ "gap": "lg",
1926
+ "children": [
1927
+ {
1928
+ "type": "stack",
1929
+ "direction": "horizontal",
1930
+ "gap": "sm",
1931
+ "align": "center",
1932
+ "children": [
1933
+ {
1934
+ "type": "icon",
1935
+ "name": "credit-card",
1936
+ "size": "lg"
1937
+ },
1938
+ {
1939
+ "type": "typography",
1940
+ "content": "Checkout",
1941
+ "variant": "h2"
1942
+ }
1943
+ ]
1944
+ },
1945
+ {
1946
+ "type": "badge",
1947
+ "label": "Step 3 of 3"
1948
+ },
1949
+ {
1950
+ "type": "wizard-progress",
1951
+ "steps": [
1952
+ "Customer Info",
1953
+ "Shipping",
1954
+ "Payment"
1955
+ ],
1956
+ "currentStep": 2
1957
+ },
1958
+ {
1959
+ "type": "divider"
1960
+ },
1961
+ {
1962
+ "type": "typography",
1963
+ "content": "Payment",
1964
+ "variant": "h3"
1965
+ },
1966
+ {
1967
+ "type": "form-section",
1968
+ "entity": "Checkout",
1969
+ "mode": "create",
1970
+ "submitEvent": "NEXT",
1971
+ "cancelEvent": "PREV",
1972
+ "fields": [
1973
+ "paymentMethod"
1974
+ ]
1975
+ },
1976
+ {
1977
+ "type": "stack",
1978
+ "direction": "horizontal",
1979
+ "gap": "sm",
1980
+ "justify": "end",
1981
+ "children": [
1982
+ {
1983
+ "type": "button",
1984
+ "label": "Back",
1985
+ "event": "PREV",
1986
+ "variant": "ghost",
1987
+ "icon": "arrow-left"
1988
+ },
1989
+ {
1990
+ "type": "button",
1991
+ "label": "Next",
1992
+ "event": "NEXT",
1993
+ "variant": "primary",
1994
+ "icon": "arrow-right"
1995
+ }
1996
+ ]
1997
+ }
1998
+ ]
1999
+ }
2000
+ ]
2001
+ ]
2002
+ },
2003
+ {
2004
+ "from": "step3",
2005
+ "to": "review",
2006
+ "event": "NEXT",
2007
+ "effects": [
2008
+ [
2009
+ "fetch",
2010
+ "Checkout"
2011
+ ],
2012
+ [
2013
+ "render-ui",
2014
+ "main",
2015
+ {
2016
+ "type": "stack",
2017
+ "direction": "vertical",
2018
+ "gap": "lg",
2019
+ "children": [
2020
+ {
2021
+ "type": "stack",
2022
+ "direction": "horizontal",
2023
+ "gap": "sm",
2024
+ "align": "center",
2025
+ "children": [
2026
+ {
2027
+ "type": "icon",
2028
+ "name": "credit-card",
2029
+ "size": "lg"
2030
+ },
2031
+ {
2032
+ "type": "typography",
2033
+ "content": "Checkout",
2034
+ "variant": "h2"
2035
+ }
2036
+ ]
2037
+ },
2038
+ {
2039
+ "type": "badge",
2040
+ "label": "Review"
2041
+ },
2042
+ {
2043
+ "type": "wizard-progress",
2044
+ "steps": [
2045
+ "Customer Info",
2046
+ "Shipping",
2047
+ "Payment"
2048
+ ],
2049
+ "currentStep": 3
2050
+ },
2051
+ {
2052
+ "type": "divider"
2053
+ },
2054
+ {
2055
+ "type": "data-list",
2056
+ "entity": "Checkout",
2057
+ "children": [
2058
+ {
2059
+ "type": "stack",
2060
+ "direction": "vertical",
2061
+ "gap": "sm",
2062
+ "children": [
2063
+ {
2064
+ "type": "stack",
2065
+ "direction": "horizontal",
2066
+ "gap": "md",
2067
+ "justify": "space-between",
2068
+ "children": [
2069
+ {
2070
+ "type": "typography",
2071
+ "variant": "caption",
2072
+ "content": "CustomerName"
2073
+ },
2074
+ {
2075
+ "type": "typography",
2076
+ "variant": "body",
2077
+ "content": "@entity.customerName"
2078
+ }
2079
+ ]
2080
+ },
2081
+ {
2082
+ "type": "stack",
2083
+ "direction": "horizontal",
2084
+ "gap": "md",
2085
+ "justify": "space-between",
2086
+ "children": [
2087
+ {
2088
+ "type": "typography",
2089
+ "variant": "caption",
2090
+ "content": "Email"
2091
+ },
2092
+ {
2093
+ "type": "typography",
2094
+ "variant": "body",
2095
+ "content": "@entity.email"
2096
+ }
2097
+ ]
2098
+ },
2099
+ {
2100
+ "type": "stack",
2101
+ "direction": "horizontal",
2102
+ "gap": "md",
2103
+ "justify": "space-between",
2104
+ "children": [
2105
+ {
2106
+ "type": "typography",
2107
+ "variant": "caption",
2108
+ "content": "ShippingAddress"
2109
+ },
2110
+ {
2111
+ "type": "typography",
2112
+ "variant": "body",
2113
+ "content": "@entity.shippingAddress"
2114
+ }
2115
+ ]
2116
+ },
2117
+ {
2118
+ "type": "stack",
2119
+ "direction": "horizontal",
2120
+ "gap": "md",
2121
+ "justify": "space-between",
2122
+ "children": [
2123
+ {
2124
+ "type": "typography",
2125
+ "variant": "caption",
2126
+ "content": "PaymentMethod"
2127
+ },
2128
+ {
2129
+ "type": "typography",
2130
+ "variant": "body",
2131
+ "content": "@entity.paymentMethod"
2132
+ }
2133
+ ]
2134
+ },
2135
+ {
2136
+ "type": "stack",
2137
+ "direction": "horizontal",
2138
+ "gap": "md",
2139
+ "justify": "space-between",
2140
+ "children": [
2141
+ {
2142
+ "type": "typography",
2143
+ "variant": "caption",
2144
+ "content": "OrderTotal"
2145
+ },
2146
+ {
2147
+ "type": "typography",
2148
+ "variant": "body",
2149
+ "content": "@entity.orderTotal"
2150
+ }
2151
+ ]
2152
+ },
2153
+ {
2154
+ "type": "stack",
2155
+ "direction": "horizontal",
2156
+ "gap": "md",
2157
+ "justify": "space-between",
2158
+ "children": [
2159
+ {
2160
+ "type": "typography",
2161
+ "variant": "caption",
2162
+ "content": "Status"
2163
+ },
2164
+ {
2165
+ "type": "typography",
2166
+ "variant": "body",
2167
+ "content": "@entity.status"
2168
+ }
2169
+ ]
2170
+ }
2171
+ ]
2172
+ }
2173
+ ]
2174
+ },
2175
+ {
2176
+ "type": "stack",
2177
+ "direction": "horizontal",
2178
+ "gap": "sm",
2179
+ "justify": "end",
2180
+ "children": [
2181
+ {
2182
+ "type": "button",
2183
+ "label": "Back",
2184
+ "event": "PREV",
2185
+ "variant": "ghost",
2186
+ "icon": "arrow-left"
2187
+ },
2188
+ {
2189
+ "type": "button",
2190
+ "label": "Place Order",
2191
+ "event": "COMPLETE",
2192
+ "variant": "primary",
2193
+ "icon": "check"
2194
+ }
2195
+ ]
2196
+ }
2197
+ ]
2198
+ }
2199
+ ]
2200
+ ]
2201
+ },
2202
+ {
2203
+ "from": "step2",
2204
+ "to": "step1",
2205
+ "event": "PREV",
2206
+ "effects": [
2207
+ [
2208
+ "fetch",
2209
+ "Checkout"
2210
+ ],
2211
+ [
2212
+ "render-ui",
2213
+ "main",
2214
+ {
2215
+ "type": "stack",
2216
+ "direction": "vertical",
2217
+ "gap": "lg",
2218
+ "children": [
2219
+ {
2220
+ "type": "stack",
2221
+ "direction": "horizontal",
2222
+ "gap": "sm",
2223
+ "align": "center",
2224
+ "children": [
2225
+ {
2226
+ "type": "icon",
2227
+ "name": "credit-card",
2228
+ "size": "lg"
2229
+ },
2230
+ {
2231
+ "type": "typography",
2232
+ "content": "Checkout",
2233
+ "variant": "h2"
2234
+ }
2235
+ ]
2236
+ },
2237
+ {
2238
+ "type": "badge",
2239
+ "label": "Step 1 of 3"
2240
+ },
2241
+ {
2242
+ "type": "wizard-progress",
2243
+ "steps": [
2244
+ "Customer Info",
2245
+ "Shipping",
2246
+ "Payment"
2247
+ ],
2248
+ "currentStep": 0
2249
+ },
2250
+ {
2251
+ "type": "divider"
2252
+ },
2253
+ {
2254
+ "type": "typography",
2255
+ "content": "Customer Info",
2256
+ "variant": "h3"
2257
+ },
2258
+ {
2259
+ "type": "form-section",
2260
+ "entity": "Checkout",
2261
+ "mode": "create",
2262
+ "submitEvent": "NEXT",
2263
+ "cancelEvent": "INIT",
2264
+ "fields": [
2265
+ "customerName",
2266
+ "email"
2267
+ ]
2268
+ },
2269
+ {
2270
+ "type": "stack",
2271
+ "direction": "horizontal",
2272
+ "gap": "sm",
2273
+ "justify": "end",
2274
+ "children": [
2275
+ {
2276
+ "type": "button",
2277
+ "label": "Next",
2278
+ "event": "NEXT",
2279
+ "variant": "primary",
2280
+ "icon": "arrow-right"
2281
+ }
2282
+ ]
2283
+ }
2284
+ ]
2285
+ }
2286
+ ]
2287
+ ]
2288
+ },
2289
+ {
2290
+ "from": "step3",
2291
+ "to": "step2",
2292
+ "event": "PREV",
2293
+ "effects": [
2294
+ [
2295
+ "fetch",
2296
+ "Checkout"
2297
+ ],
2298
+ [
2299
+ "render-ui",
2300
+ "main",
2301
+ {
2302
+ "type": "stack",
2303
+ "direction": "vertical",
2304
+ "gap": "lg",
2305
+ "children": [
2306
+ {
2307
+ "type": "stack",
2308
+ "direction": "horizontal",
2309
+ "gap": "sm",
2310
+ "align": "center",
2311
+ "children": [
2312
+ {
2313
+ "type": "icon",
2314
+ "name": "credit-card",
2315
+ "size": "lg"
2316
+ },
2317
+ {
2318
+ "type": "typography",
2319
+ "content": "Checkout",
2320
+ "variant": "h2"
2321
+ }
2322
+ ]
2323
+ },
2324
+ {
2325
+ "type": "badge",
2326
+ "label": "Step 2 of 3"
2327
+ },
2328
+ {
2329
+ "type": "wizard-progress",
2330
+ "steps": [
2331
+ "Customer Info",
2332
+ "Shipping",
2333
+ "Payment"
2334
+ ],
2335
+ "currentStep": 1
2336
+ },
2337
+ {
2338
+ "type": "divider"
2339
+ },
2340
+ {
2341
+ "type": "typography",
2342
+ "content": "Shipping",
2343
+ "variant": "h3"
2344
+ },
2345
+ {
2346
+ "type": "form-section",
2347
+ "entity": "Checkout",
2348
+ "mode": "create",
2349
+ "submitEvent": "NEXT",
2350
+ "cancelEvent": "PREV",
2351
+ "fields": [
2352
+ "shippingAddress"
2353
+ ]
2354
+ },
2355
+ {
2356
+ "type": "stack",
2357
+ "direction": "horizontal",
2358
+ "gap": "sm",
2359
+ "justify": "end",
2360
+ "children": [
2361
+ {
2362
+ "type": "button",
2363
+ "label": "Back",
2364
+ "event": "PREV",
2365
+ "variant": "ghost",
2366
+ "icon": "arrow-left"
2367
+ },
2368
+ {
2369
+ "type": "button",
2370
+ "label": "Next",
2371
+ "event": "NEXT",
2372
+ "variant": "primary",
2373
+ "icon": "arrow-right"
2374
+ }
2375
+ ]
2376
+ }
2377
+ ]
2378
+ }
2379
+ ]
2380
+ ]
2381
+ },
2382
+ {
2383
+ "from": "review",
2384
+ "to": "step3",
2385
+ "event": "PREV",
2386
+ "effects": [
2387
+ [
2388
+ "fetch",
2389
+ "Checkout"
2390
+ ],
2391
+ [
2392
+ "render-ui",
2393
+ "main",
2394
+ {
2395
+ "type": "stack",
2396
+ "direction": "vertical",
2397
+ "gap": "lg",
2398
+ "children": [
2399
+ {
2400
+ "type": "stack",
2401
+ "direction": "horizontal",
2402
+ "gap": "sm",
2403
+ "align": "center",
2404
+ "children": [
2405
+ {
2406
+ "type": "icon",
2407
+ "name": "credit-card",
2408
+ "size": "lg"
2409
+ },
2410
+ {
2411
+ "type": "typography",
2412
+ "content": "Checkout",
2413
+ "variant": "h2"
2414
+ }
2415
+ ]
2416
+ },
2417
+ {
2418
+ "type": "badge",
2419
+ "label": "Step 3 of 3"
2420
+ },
2421
+ {
2422
+ "type": "wizard-progress",
2423
+ "steps": [
2424
+ "Customer Info",
2425
+ "Shipping",
2426
+ "Payment"
2427
+ ],
2428
+ "currentStep": 2
2429
+ },
2430
+ {
2431
+ "type": "divider"
2432
+ },
2433
+ {
2434
+ "type": "typography",
2435
+ "content": "Payment",
2436
+ "variant": "h3"
2437
+ },
2438
+ {
2439
+ "type": "form-section",
2440
+ "entity": "Checkout",
2441
+ "mode": "create",
2442
+ "submitEvent": "NEXT",
2443
+ "cancelEvent": "PREV",
2444
+ "fields": [
2445
+ "paymentMethod"
2446
+ ]
2447
+ },
2448
+ {
2449
+ "type": "stack",
2450
+ "direction": "horizontal",
2451
+ "gap": "sm",
2452
+ "justify": "end",
2453
+ "children": [
2454
+ {
2455
+ "type": "button",
2456
+ "label": "Back",
2457
+ "event": "PREV",
2458
+ "variant": "ghost",
2459
+ "icon": "arrow-left"
2460
+ },
2461
+ {
2462
+ "type": "button",
2463
+ "label": "Next",
2464
+ "event": "NEXT",
2465
+ "variant": "primary",
2466
+ "icon": "arrow-right"
2467
+ }
2468
+ ]
2469
+ }
2470
+ ]
2471
+ }
2472
+ ]
2473
+ ]
2474
+ },
2475
+ {
2476
+ "from": "review",
2477
+ "to": "complete",
2478
+ "event": "COMPLETE",
2479
+ "effects": [
2480
+ [
2481
+ "persist",
2482
+ "create",
2483
+ "Checkout",
2484
+ "@payload.data"
2485
+ ],
2486
+ [
2487
+ "notify",
2488
+ "success",
2489
+ "Checkout created successfully"
2490
+ ],
2491
+ [
2492
+ "render-ui",
2493
+ "main",
2494
+ {
2495
+ "type": "stack",
2496
+ "direction": "vertical",
2497
+ "gap": "lg",
2498
+ "align": "center",
2499
+ "children": [
2500
+ {
2501
+ "type": "icon",
2502
+ "name": "check-circle",
2503
+ "size": "lg"
2504
+ },
2505
+ {
2506
+ "type": "typography",
2507
+ "content": "Order Placed",
2508
+ "variant": "h2"
2509
+ },
2510
+ {
2511
+ "type": "typography",
2512
+ "content": "Your order has been placed successfully.",
2513
+ "variant": "body"
2514
+ },
2515
+ {
2516
+ "type": "button",
2517
+ "label": "Start New",
2518
+ "event": "RESTART",
2519
+ "variant": "primary",
2520
+ "icon": "refresh-cw"
2521
+ }
2522
+ ]
2523
+ }
2524
+ ]
2525
+ ]
2526
+ },
2527
+ {
2528
+ "from": "complete",
2529
+ "to": "step1",
2530
+ "event": "RESTART",
2531
+ "effects": [
2532
+ [
2533
+ "fetch",
2534
+ "Checkout"
2535
+ ],
2536
+ [
2537
+ "render-ui",
2538
+ "main",
2539
+ {
2540
+ "type": "stack",
2541
+ "direction": "vertical",
2542
+ "gap": "lg",
2543
+ "children": [
2544
+ {
2545
+ "type": "stack",
2546
+ "direction": "horizontal",
2547
+ "gap": "sm",
2548
+ "align": "center",
2549
+ "children": [
2550
+ {
2551
+ "type": "icon",
2552
+ "name": "credit-card",
2553
+ "size": "lg"
2554
+ },
2555
+ {
2556
+ "type": "typography",
2557
+ "content": "Checkout",
2558
+ "variant": "h2"
2559
+ }
2560
+ ]
2561
+ },
2562
+ {
2563
+ "type": "badge",
2564
+ "label": "Step 1 of 3"
2565
+ },
2566
+ {
2567
+ "type": "wizard-progress",
2568
+ "steps": [
2569
+ "Customer Info",
2570
+ "Shipping",
2571
+ "Payment"
2572
+ ],
2573
+ "currentStep": 0
2574
+ },
2575
+ {
2576
+ "type": "divider"
2577
+ },
2578
+ {
2579
+ "type": "typography",
2580
+ "content": "Customer Info",
2581
+ "variant": "h3"
2582
+ },
2583
+ {
2584
+ "type": "form-section",
2585
+ "entity": "Checkout",
2586
+ "mode": "create",
2587
+ "submitEvent": "NEXT",
2588
+ "cancelEvent": "INIT",
2589
+ "fields": [
2590
+ "customerName",
2591
+ "email"
2592
+ ]
2593
+ },
2594
+ {
2595
+ "type": "stack",
2596
+ "direction": "horizontal",
2597
+ "gap": "sm",
2598
+ "justify": "end",
2599
+ "children": [
2600
+ {
2601
+ "type": "button",
2602
+ "label": "Next",
2603
+ "event": "NEXT",
2604
+ "variant": "primary",
2605
+ "icon": "arrow-right"
2606
+ }
2607
+ ]
2608
+ }
2609
+ ]
2610
+ }
2611
+ ]
2612
+ ]
2613
+ },
2614
+ {
2615
+ "from": "complete",
2616
+ "to": "step1",
2617
+ "event": "INIT",
2618
+ "effects": [
2619
+ [
2620
+ "fetch",
2621
+ "Checkout"
2622
+ ],
2623
+ [
2624
+ "render-ui",
2625
+ "main",
2626
+ {
2627
+ "type": "stack",
2628
+ "direction": "vertical",
2629
+ "gap": "lg",
2630
+ "children": [
2631
+ {
2632
+ "type": "stack",
2633
+ "direction": "horizontal",
2634
+ "gap": "sm",
2635
+ "align": "center",
2636
+ "children": [
2637
+ {
2638
+ "type": "icon",
2639
+ "name": "credit-card",
2640
+ "size": "lg"
2641
+ },
2642
+ {
2643
+ "type": "typography",
2644
+ "content": "Checkout",
2645
+ "variant": "h2"
2646
+ }
2647
+ ]
2648
+ },
2649
+ {
2650
+ "type": "badge",
2651
+ "label": "Step 1 of 3"
2652
+ },
2653
+ {
2654
+ "type": "wizard-progress",
2655
+ "steps": [
2656
+ "Customer Info",
2657
+ "Shipping",
2658
+ "Payment"
2659
+ ],
2660
+ "currentStep": 0
2661
+ },
2662
+ {
2663
+ "type": "divider"
2664
+ },
2665
+ {
2666
+ "type": "typography",
2667
+ "content": "Customer Info",
2668
+ "variant": "h3"
2669
+ },
2670
+ {
2671
+ "type": "form-section",
2672
+ "entity": "Checkout",
2673
+ "mode": "create",
2674
+ "submitEvent": "NEXT",
2675
+ "cancelEvent": "INIT",
2676
+ "fields": [
2677
+ "customerName",
2678
+ "email"
2679
+ ]
2680
+ },
2681
+ {
2682
+ "type": "stack",
2683
+ "direction": "horizontal",
2684
+ "gap": "sm",
2685
+ "justify": "end",
2686
+ "children": [
2687
+ {
2688
+ "type": "button",
2689
+ "label": "Next",
2690
+ "event": "NEXT",
2691
+ "variant": "primary",
2692
+ "icon": "arrow-right"
2693
+ }
2694
+ ]
2695
+ }
2696
+ ]
2697
+ }
2698
+ ]
2699
+ ]
2700
+ }
2701
+ ]
2702
+ },
2703
+ "listens": [
2704
+ {
2705
+ "event": "CHECKOUT_STARTED",
2706
+ "triggers": "INIT",
2707
+ "scope": "external"
2708
+ }
2709
+ ],
2710
+ "emits": [
2711
+ {
2712
+ "event": "ORDER_PLACED",
2713
+ "payload": [
2714
+ {
2715
+ "name": "id",
2716
+ "type": "string",
2717
+ "required": true
2718
+ }
2719
+ ],
2720
+ "scope": "external"
2721
+ }
2722
+ ]
2723
+ }
2724
+ ],
2725
+ "pages": [
2726
+ {
2727
+ "name": "CheckoutPage",
2728
+ "path": "/checkout",
2729
+ "traits": [
2730
+ {
2731
+ "ref": "CheckoutWizard"
2732
+ }
2733
+ ]
2734
+ }
2735
+ ]
2736
+ },
2737
+ {
2738
+ "name": "OrderRecordOrbital",
2739
+ "entity": {
2740
+ "name": "OrderRecord",
2741
+ "persistence": "runtime",
2742
+ "fields": [
2743
+ {
2744
+ "name": "id",
2745
+ "type": "string",
2746
+ "required": true
2747
+ },
2748
+ {
2749
+ "name": "customerName",
2750
+ "type": "string",
2751
+ "required": true
2752
+ },
2753
+ {
2754
+ "name": "email",
2755
+ "type": "string",
2756
+ "required": true
2757
+ },
2758
+ {
2759
+ "name": "shippingAddress",
2760
+ "type": "string",
2761
+ "required": true
2762
+ },
2763
+ {
2764
+ "name": "paymentMethod",
2765
+ "type": "string",
2766
+ "required": true
2767
+ },
2768
+ {
2769
+ "name": "orderTotal",
2770
+ "type": "number"
2771
+ },
2772
+ {
2773
+ "name": "status",
2774
+ "type": "string",
2775
+ "default": "pending"
2776
+ }
2777
+ ]
2778
+ },
2779
+ "traits": [
2780
+ {
2781
+ "name": "OrderRecordBrowse",
2782
+ "linkedEntity": "OrderRecord",
2783
+ "category": "interaction",
2784
+ "listens": [
2785
+ {
2786
+ "event": "ORDER_RECORD_CREATED",
2787
+ "triggers": "ORDER_RECORD_CREATED"
2788
+ },
2789
+ {
2790
+ "event": "ORDER_RECORD_UPDATED",
2791
+ "triggers": "ORDER_RECORD_UPDATED"
2792
+ },
2793
+ {
2794
+ "event": "ORDER_PLACED",
2795
+ "triggers": "INIT",
2796
+ "scope": "external"
2797
+ }
2798
+ ],
2799
+ "stateMachine": {
2800
+ "states": [
2801
+ {
2802
+ "name": "browsing",
2803
+ "isInitial": true
2804
+ },
2805
+ {
2806
+ "name": "deleting"
2807
+ }
2808
+ ],
2809
+ "events": [
2810
+ {
2811
+ "key": "INIT",
2812
+ "name": "Initialize"
2813
+ },
2814
+ {
2815
+ "key": "CREATE",
2816
+ "name": "CREATE"
2817
+ },
2818
+ {
2819
+ "key": "VIEW",
2820
+ "name": "VIEW",
2821
+ "payload": [
2822
+ {
2823
+ "name": "id",
2824
+ "type": "string",
2825
+ "required": true
2826
+ }
2827
+ ]
2828
+ },
2829
+ {
2830
+ "key": "EDIT",
2831
+ "name": "EDIT",
2832
+ "payload": [
2833
+ {
2834
+ "name": "id",
2835
+ "type": "string",
2836
+ "required": true
2837
+ }
2838
+ ]
2839
+ },
2840
+ {
2841
+ "key": "DELETE",
2842
+ "name": "DELETE",
2843
+ "payload": [
2844
+ {
2845
+ "name": "id",
2846
+ "type": "string",
2847
+ "required": true
2848
+ }
2849
+ ]
2850
+ },
2851
+ {
2852
+ "key": "ORDER_RECORD_CREATED",
2853
+ "name": "ORDER_RECORD_CREATED",
2854
+ "payload": [
2855
+ {
2856
+ "name": "data",
2857
+ "type": "object",
2858
+ "required": true
2859
+ }
2860
+ ]
2861
+ },
2862
+ {
2863
+ "key": "ORDER_RECORD_UPDATED",
2864
+ "name": "ORDER_RECORD_UPDATED",
2865
+ "payload": [
2866
+ {
2867
+ "name": "data",
2868
+ "type": "object",
2869
+ "required": true
2870
+ }
2871
+ ]
2872
+ },
2873
+ {
2874
+ "key": "CONFIRM_DELETE",
2875
+ "name": "Confirm Delete"
2876
+ },
2877
+ {
2878
+ "key": "CANCEL",
2879
+ "name": "Cancel"
2880
+ },
2881
+ {
2882
+ "key": "CLOSE",
2883
+ "name": "Close"
2884
+ }
2885
+ ],
2886
+ "transitions": [
2887
+ {
2888
+ "from": "browsing",
2889
+ "to": "browsing",
2890
+ "event": "INIT",
2891
+ "effects": [
2892
+ [
2893
+ "fetch",
2894
+ "OrderRecord"
2895
+ ],
2896
+ [
2897
+ "render-ui",
2898
+ "main",
2899
+ {
2900
+ "type": "stack",
2901
+ "direction": "vertical",
2902
+ "gap": "lg",
2903
+ "children": [
2904
+ {
2905
+ "type": "stack",
2906
+ "direction": "horizontal",
2907
+ "gap": "md",
2908
+ "justify": "space-between",
2909
+ "children": [
2910
+ {
2911
+ "type": "stack",
2912
+ "direction": "horizontal",
2913
+ "gap": "sm",
2914
+ "align": "center",
2915
+ "children": [
2916
+ {
2917
+ "type": "icon",
2918
+ "name": "clipboard-list",
2919
+ "size": "lg"
2920
+ },
2921
+ {
2922
+ "type": "typography",
2923
+ "content": "Order History",
2924
+ "variant": "h2"
2925
+ }
2926
+ ]
2927
+ },
2928
+ {
2929
+ "type": "stack",
2930
+ "direction": "horizontal",
2931
+ "gap": "sm",
2932
+ "children": [
2933
+ {
2934
+ "type": "button",
2935
+ "label": "Create OrderRecord",
2936
+ "event": "CREATE",
2937
+ "variant": "primary",
2938
+ "icon": "plus"
2939
+ }
2940
+ ]
2941
+ }
2942
+ ]
2943
+ },
2944
+ {
2945
+ "type": "divider"
2946
+ },
2947
+ {
2948
+ "type": "data-grid",
2949
+ "entity": "OrderRecord",
2950
+ "emptyIcon": "inbox",
2951
+ "emptyTitle": "No orderrecords yet",
2952
+ "emptyDescription": "Create your first orderrecord to get started.",
2953
+ "itemActions": [
2954
+ {
2955
+ "label": "View",
2956
+ "event": "VIEW"
2957
+ },
2958
+ {
2959
+ "label": "Edit",
2960
+ "event": "EDIT"
2961
+ },
2962
+ {
2963
+ "label": "Delete",
2964
+ "event": "DELETE",
2965
+ "variant": "danger"
2966
+ }
2967
+ ],
2968
+ "className": "transition-shadow hover:shadow-md cursor-pointer",
2969
+ "children": [
2970
+ {
2971
+ "type": "stack",
2972
+ "direction": "vertical",
2973
+ "gap": "sm",
2974
+ "children": [
2975
+ {
2976
+ "type": "stack",
2977
+ "direction": "horizontal",
2978
+ "justify": "space-between",
2979
+ "align": "center",
2980
+ "children": [
2981
+ {
2982
+ "type": "stack",
2983
+ "direction": "horizontal",
2984
+ "gap": "sm",
2985
+ "align": "center",
2986
+ "children": [
2987
+ {
2988
+ "type": "icon",
2989
+ "name": "clipboard-list",
2990
+ "size": "sm"
2991
+ },
2992
+ {
2993
+ "type": "typography",
2994
+ "variant": "h4",
2995
+ "content": "@entity.customerName"
2996
+ }
2997
+ ]
2998
+ },
2999
+ {
3000
+ "type": "badge",
3001
+ "label": "@entity.email"
3002
+ }
3003
+ ]
3004
+ },
3005
+ {
3006
+ "type": "typography",
3007
+ "variant": "caption",
3008
+ "color": "muted",
3009
+ "content": "@entity.shippingAddress"
3010
+ }
3011
+ ]
3012
+ }
3013
+ ]
3014
+ }
3015
+ ]
3016
+ }
3017
+ ]
3018
+ ]
3019
+ },
3020
+ {
3021
+ "from": "browsing",
3022
+ "to": "browsing",
3023
+ "event": "ORDER_RECORD_CREATED",
3024
+ "effects": [
3025
+ [
3026
+ "fetch",
3027
+ "OrderRecord"
3028
+ ]
3029
+ ]
3030
+ },
3031
+ {
3032
+ "from": "browsing",
3033
+ "to": "browsing",
3034
+ "event": "ORDER_RECORD_UPDATED",
3035
+ "effects": [
3036
+ [
3037
+ "fetch",
3038
+ "OrderRecord"
3039
+ ]
3040
+ ]
3041
+ },
3042
+ {
3043
+ "from": "browsing",
3044
+ "to": "deleting",
3045
+ "event": "DELETE",
3046
+ "effects": [
3047
+ [
3048
+ "fetch",
3049
+ "OrderRecord",
3050
+ "@payload.id"
3051
+ ],
3052
+ [
3053
+ "render-ui",
3054
+ "modal",
3055
+ {
3056
+ "type": "stack",
3057
+ "direction": "vertical",
3058
+ "gap": "md",
3059
+ "children": [
3060
+ {
3061
+ "type": "stack",
3062
+ "direction": "horizontal",
3063
+ "gap": "sm",
3064
+ "children": [
3065
+ {
3066
+ "type": "icon",
3067
+ "name": "trash-2",
3068
+ "size": "md"
3069
+ },
3070
+ {
3071
+ "type": "typography",
3072
+ "content": "Delete OrderRecord",
3073
+ "variant": "h3"
3074
+ }
3075
+ ]
3076
+ },
3077
+ {
3078
+ "type": "divider"
3079
+ },
3080
+ {
3081
+ "type": "typography",
3082
+ "content": "Are you sure you want to delete this orderrecord?",
3083
+ "variant": "body"
3084
+ },
3085
+ {
3086
+ "type": "stack",
3087
+ "direction": "horizontal",
3088
+ "gap": "sm",
3089
+ "justify": "end",
3090
+ "children": [
3091
+ {
3092
+ "type": "button",
3093
+ "label": "Cancel",
3094
+ "event": "CANCEL",
3095
+ "variant": "ghost"
3096
+ },
3097
+ {
3098
+ "type": "button",
3099
+ "label": "Delete",
3100
+ "event": "CONFIRM_DELETE",
3101
+ "variant": "danger",
3102
+ "icon": "trash"
3103
+ }
3104
+ ]
3105
+ }
3106
+ ]
3107
+ }
3108
+ ]
3109
+ ]
3110
+ },
3111
+ {
3112
+ "from": "deleting",
3113
+ "to": "browsing",
3114
+ "event": "CONFIRM_DELETE",
3115
+ "effects": [
3116
+ [
3117
+ "persist",
3118
+ "delete",
3119
+ "OrderRecord",
3120
+ "@entity.id"
3121
+ ],
3122
+ [
3123
+ "render-ui",
3124
+ "modal",
3125
+ null
3126
+ ],
3127
+ [
3128
+ "fetch",
3129
+ "OrderRecord"
3130
+ ],
3131
+ [
3132
+ "notify",
3133
+ "OrderRecord deleted successfully"
3134
+ ]
3135
+ ]
3136
+ },
3137
+ {
3138
+ "from": "deleting",
3139
+ "to": "browsing",
3140
+ "event": "CANCEL",
3141
+ "effects": [
3142
+ [
3143
+ "render-ui",
3144
+ "modal",
3145
+ null
3146
+ ]
3147
+ ]
3148
+ },
3149
+ {
3150
+ "from": "deleting",
3151
+ "to": "browsing",
3152
+ "event": "CLOSE",
3153
+ "effects": [
3154
+ [
3155
+ "render-ui",
3156
+ "modal",
3157
+ null
3158
+ ]
3159
+ ]
3160
+ }
3161
+ ]
3162
+ }
3163
+ },
3164
+ {
3165
+ "name": "OrderRecordCreate",
3166
+ "linkedEntity": "OrderRecord",
3167
+ "category": "interaction",
3168
+ "emits": [
3169
+ {
3170
+ "event": "ORDER_RECORD_CREATED"
3171
+ }
3172
+ ],
3173
+ "stateMachine": {
3174
+ "states": [
3175
+ {
3176
+ "name": "closed",
3177
+ "isInitial": true
3178
+ },
3179
+ {
3180
+ "name": "open"
3181
+ }
3182
+ ],
3183
+ "events": [
3184
+ {
3185
+ "key": "INIT",
3186
+ "name": "Initialize"
3187
+ },
3188
+ {
3189
+ "key": "CREATE",
3190
+ "name": "Open"
3191
+ },
3192
+ {
3193
+ "key": "CLOSE",
3194
+ "name": "Close"
3195
+ },
3196
+ {
3197
+ "key": "SAVE",
3198
+ "name": "Save",
3199
+ "payload": [
3200
+ {
3201
+ "name": "data",
3202
+ "type": "object",
3203
+ "required": true
3204
+ }
3205
+ ]
3206
+ }
3207
+ ],
3208
+ "transitions": [
3209
+ {
3210
+ "from": "closed",
3211
+ "to": "closed",
3212
+ "event": "INIT",
3213
+ "effects": [
3214
+ [
3215
+ "fetch",
3216
+ "OrderRecord"
3217
+ ]
3218
+ ]
3219
+ },
3220
+ {
3221
+ "from": "closed",
3222
+ "to": "open",
3223
+ "event": "CREATE",
3224
+ "effects": [
3225
+ [
3226
+ "fetch",
3227
+ "OrderRecord"
3228
+ ],
3229
+ [
3230
+ "render-ui",
3231
+ "modal",
3232
+ {
3233
+ "type": "stack",
3234
+ "direction": "vertical",
3235
+ "gap": "md",
3236
+ "children": [
3237
+ {
3238
+ "type": "stack",
3239
+ "direction": "horizontal",
3240
+ "gap": "sm",
3241
+ "children": [
3242
+ {
3243
+ "type": "icon",
3244
+ "name": "plus-circle",
3245
+ "size": "md"
3246
+ },
3247
+ {
3248
+ "type": "typography",
3249
+ "content": "Create OrderRecord",
3250
+ "variant": "h3"
3251
+ }
3252
+ ]
3253
+ },
3254
+ {
3255
+ "type": "divider"
3256
+ },
3257
+ {
3258
+ "type": "form-section",
3259
+ "entity": "OrderRecord",
3260
+ "mode": "create",
3261
+ "submitEvent": "SAVE",
3262
+ "cancelEvent": "CLOSE",
3263
+ "fields": [
3264
+ "customerName",
3265
+ "email",
3266
+ "shippingAddress",
3267
+ "paymentMethod",
3268
+ "orderTotal",
3269
+ "status"
3270
+ ]
3271
+ }
3272
+ ]
3273
+ }
3274
+ ]
3275
+ ]
3276
+ },
3277
+ {
3278
+ "from": "open",
3279
+ "to": "closed",
3280
+ "event": "CLOSE",
3281
+ "effects": [
3282
+ [
3283
+ "render-ui",
3284
+ "modal",
3285
+ null
3286
+ ]
3287
+ ]
3288
+ },
3289
+ {
3290
+ "from": "open",
3291
+ "to": "closed",
3292
+ "event": "SAVE",
3293
+ "effects": [
3294
+ [
3295
+ "persist",
3296
+ "create",
3297
+ "OrderRecord",
3298
+ "@payload.data"
3299
+ ],
3300
+ [
3301
+ "fetch",
3302
+ "OrderRecord"
3303
+ ],
3304
+ [
3305
+ "render-ui",
3306
+ "modal",
3307
+ null
3308
+ ],
3309
+ [
3310
+ "emit",
3311
+ "ORDER_RECORD_CREATED"
3312
+ ],
3313
+ [
3314
+ "notify",
3315
+ "OrderRecord created successfully"
3316
+ ]
3317
+ ]
3318
+ }
3319
+ ]
3320
+ }
3321
+ },
3322
+ {
3323
+ "name": "OrderRecordEdit",
3324
+ "linkedEntity": "OrderRecord",
3325
+ "category": "interaction",
3326
+ "emits": [
3327
+ {
3328
+ "event": "ORDER_RECORD_UPDATED"
3329
+ }
3330
+ ],
3331
+ "stateMachine": {
3332
+ "states": [
3333
+ {
3334
+ "name": "closed",
3335
+ "isInitial": true
3336
+ },
3337
+ {
3338
+ "name": "open"
3339
+ }
3340
+ ],
3341
+ "events": [
3342
+ {
3343
+ "key": "INIT",
3344
+ "name": "Initialize"
3345
+ },
3346
+ {
3347
+ "key": "EDIT",
3348
+ "name": "Open",
3349
+ "payload": [
3350
+ {
3351
+ "name": "id",
3352
+ "type": "string",
3353
+ "required": true
3354
+ }
3355
+ ]
3356
+ },
3357
+ {
3358
+ "key": "CLOSE",
3359
+ "name": "Close"
3360
+ },
3361
+ {
3362
+ "key": "SAVE",
3363
+ "name": "Save",
3364
+ "payload": [
3365
+ {
3366
+ "name": "data",
3367
+ "type": "object",
3368
+ "required": true
3369
+ }
3370
+ ]
3371
+ }
3372
+ ],
3373
+ "transitions": [
3374
+ {
3375
+ "from": "closed",
3376
+ "to": "closed",
3377
+ "event": "INIT",
3378
+ "effects": [
3379
+ [
3380
+ "fetch",
3381
+ "OrderRecord"
3382
+ ]
3383
+ ]
3384
+ },
3385
+ {
3386
+ "from": "closed",
3387
+ "to": "open",
3388
+ "event": "EDIT",
3389
+ "effects": [
3390
+ [
3391
+ "fetch",
3392
+ "OrderRecord",
3393
+ "@payload.id"
3394
+ ],
3395
+ [
3396
+ "render-ui",
3397
+ "modal",
3398
+ {
3399
+ "type": "stack",
3400
+ "direction": "vertical",
3401
+ "gap": "md",
3402
+ "children": [
3403
+ {
3404
+ "type": "stack",
3405
+ "direction": "horizontal",
3406
+ "gap": "sm",
3407
+ "children": [
3408
+ {
3409
+ "type": "icon",
3410
+ "name": "edit",
3411
+ "size": "md"
3412
+ },
3413
+ {
3414
+ "type": "typography",
3415
+ "content": "Edit OrderRecord",
3416
+ "variant": "h3"
3417
+ }
3418
+ ]
3419
+ },
3420
+ {
3421
+ "type": "divider"
3422
+ },
3423
+ {
3424
+ "type": "form-section",
3425
+ "entity": "OrderRecord",
3426
+ "mode": "edit",
3427
+ "submitEvent": "SAVE",
3428
+ "cancelEvent": "CLOSE",
3429
+ "fields": [
3430
+ "customerName",
3431
+ "email",
3432
+ "shippingAddress",
3433
+ "paymentMethod",
3434
+ "orderTotal",
3435
+ "status"
3436
+ ]
3437
+ }
3438
+ ]
3439
+ }
3440
+ ]
3441
+ ]
3442
+ },
3443
+ {
3444
+ "from": "open",
3445
+ "to": "closed",
3446
+ "event": "CLOSE",
3447
+ "effects": [
3448
+ [
3449
+ "render-ui",
3450
+ "modal",
3451
+ null
3452
+ ]
3453
+ ]
3454
+ },
3455
+ {
3456
+ "from": "open",
3457
+ "to": "closed",
3458
+ "event": "SAVE",
3459
+ "effects": [
3460
+ [
3461
+ "persist",
3462
+ "update",
3463
+ "OrderRecord",
3464
+ "@payload.data"
3465
+ ],
3466
+ [
3467
+ "fetch",
3468
+ "OrderRecord"
3469
+ ],
3470
+ [
3471
+ "render-ui",
3472
+ "modal",
3473
+ null
3474
+ ],
3475
+ [
3476
+ "emit",
3477
+ "ORDER_RECORD_UPDATED"
3478
+ ],
3479
+ [
3480
+ "notify",
3481
+ "OrderRecord updated successfully"
3482
+ ]
3483
+ ]
3484
+ }
3485
+ ]
3486
+ }
3487
+ },
3488
+ {
3489
+ "name": "OrderRecordView",
3490
+ "linkedEntity": "OrderRecord",
3491
+ "category": "interaction",
3492
+ "stateMachine": {
3493
+ "states": [
3494
+ {
3495
+ "name": "closed",
3496
+ "isInitial": true
3497
+ },
3498
+ {
3499
+ "name": "open"
3500
+ }
3501
+ ],
3502
+ "events": [
3503
+ {
3504
+ "key": "INIT",
3505
+ "name": "Initialize"
3506
+ },
3507
+ {
3508
+ "key": "VIEW",
3509
+ "name": "Open",
3510
+ "payload": [
3511
+ {
3512
+ "name": "id",
3513
+ "type": "string",
3514
+ "required": true
3515
+ }
3516
+ ]
3517
+ },
3518
+ {
3519
+ "key": "CLOSE",
3520
+ "name": "Close"
3521
+ }
3522
+ ],
3523
+ "transitions": [
3524
+ {
3525
+ "from": "closed",
3526
+ "to": "closed",
3527
+ "event": "INIT",
3528
+ "effects": [
3529
+ [
3530
+ "fetch",
3531
+ "OrderRecord"
3532
+ ]
3533
+ ]
3534
+ },
3535
+ {
3536
+ "from": "closed",
3537
+ "to": "open",
3538
+ "event": "VIEW",
3539
+ "effects": [
3540
+ [
3541
+ "fetch",
3542
+ "OrderRecord",
3543
+ "@payload.id"
3544
+ ],
3545
+ [
3546
+ "render-ui",
3547
+ "modal",
3548
+ {
3549
+ "type": "stack",
3550
+ "direction": "vertical",
3551
+ "gap": "md",
3552
+ "children": [
3553
+ {
3554
+ "type": "stack",
3555
+ "direction": "horizontal",
3556
+ "gap": "sm",
3557
+ "align": "center",
3558
+ "children": [
3559
+ {
3560
+ "type": "icon",
3561
+ "name": "eye",
3562
+ "size": "md"
3563
+ },
3564
+ {
3565
+ "type": "typography",
3566
+ "variant": "h3",
3567
+ "content": "@entity.customerName"
3568
+ }
3569
+ ]
3570
+ },
3571
+ {
3572
+ "type": "divider"
3573
+ },
3574
+ {
3575
+ "type": "stack",
3576
+ "direction": "horizontal",
3577
+ "gap": "md",
3578
+ "children": [
3579
+ {
3580
+ "type": "typography",
3581
+ "variant": "caption",
3582
+ "content": "CustomerName"
3583
+ },
3584
+ {
3585
+ "type": "typography",
3586
+ "variant": "body",
3587
+ "content": "@entity.customerName"
3588
+ }
3589
+ ]
3590
+ },
3591
+ {
3592
+ "type": "stack",
3593
+ "direction": "horizontal",
3594
+ "gap": "md",
3595
+ "children": [
3596
+ {
3597
+ "type": "typography",
3598
+ "variant": "caption",
3599
+ "content": "Email"
3600
+ },
3601
+ {
3602
+ "type": "typography",
3603
+ "variant": "body",
3604
+ "content": "@entity.email"
3605
+ }
3606
+ ]
3607
+ },
3608
+ {
3609
+ "type": "stack",
3610
+ "direction": "horizontal",
3611
+ "gap": "md",
3612
+ "children": [
3613
+ {
3614
+ "type": "typography",
3615
+ "variant": "caption",
3616
+ "content": "ShippingAddress"
3617
+ },
3618
+ {
3619
+ "type": "typography",
3620
+ "variant": "body",
3621
+ "content": "@entity.shippingAddress"
3622
+ }
3623
+ ]
3624
+ },
3625
+ {
3626
+ "type": "stack",
3627
+ "direction": "horizontal",
3628
+ "gap": "md",
3629
+ "children": [
3630
+ {
3631
+ "type": "typography",
3632
+ "variant": "caption",
3633
+ "content": "PaymentMethod"
3634
+ },
3635
+ {
3636
+ "type": "typography",
3637
+ "variant": "body",
3638
+ "content": "@entity.paymentMethod"
3639
+ }
3640
+ ]
3641
+ },
3642
+ {
3643
+ "type": "stack",
3644
+ "direction": "horizontal",
3645
+ "gap": "md",
3646
+ "children": [
3647
+ {
3648
+ "type": "typography",
3649
+ "variant": "caption",
3650
+ "content": "OrderTotal"
3651
+ },
3652
+ {
3653
+ "type": "typography",
3654
+ "variant": "body",
3655
+ "content": "@entity.orderTotal"
3656
+ }
3657
+ ]
3658
+ },
3659
+ {
3660
+ "type": "stack",
3661
+ "direction": "horizontal",
3662
+ "gap": "md",
3663
+ "children": [
3664
+ {
3665
+ "type": "typography",
3666
+ "variant": "caption",
3667
+ "content": "Status"
3668
+ },
3669
+ {
3670
+ "type": "typography",
3671
+ "variant": "body",
3672
+ "content": "@entity.status"
3673
+ }
3674
+ ]
3675
+ },
3676
+ {
3677
+ "type": "divider"
3678
+ },
3679
+ {
3680
+ "type": "stack",
3681
+ "direction": "horizontal",
3682
+ "gap": "sm",
3683
+ "justify": "end",
3684
+ "children": [
3685
+ {
3686
+ "type": "button",
3687
+ "label": "Edit",
3688
+ "event": "EDIT",
3689
+ "variant": "primary",
3690
+ "icon": "edit"
3691
+ },
3692
+ {
3693
+ "type": "button",
3694
+ "label": "Close",
3695
+ "event": "CLOSE",
3696
+ "variant": "ghost"
3697
+ }
3698
+ ]
3699
+ }
3700
+ ]
3701
+ }
3702
+ ]
3703
+ ]
3704
+ },
3705
+ {
3706
+ "from": "open",
3707
+ "to": "closed",
3708
+ "event": "CLOSE",
3709
+ "effects": [
3710
+ [
3711
+ "render-ui",
3712
+ "modal",
3713
+ null
3714
+ ]
3715
+ ]
3716
+ }
3717
+ ]
3718
+ }
3719
+ }
3720
+ ],
3721
+ "pages": [
3722
+ {
3723
+ "name": "OrdersPage",
3724
+ "path": "/orders",
3725
+ "traits": [
3726
+ {
3727
+ "ref": "OrderRecordBrowse"
3728
+ },
3729
+ {
3730
+ "ref": "OrderRecordCreate"
3731
+ },
3732
+ {
3733
+ "ref": "OrderRecordEdit"
3734
+ },
3735
+ {
3736
+ "ref": "OrderRecordView"
3737
+ }
3738
+ ]
3739
+ }
3740
+ ]
3741
+ }
3742
+ ]
3743
+ }