@contractspec/example.marketplace 1.44.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 (152) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +141 -0
  3. package/dist/docs/index.d.ts +1 -0
  4. package/dist/docs/index.js +1 -0
  5. package/dist/docs/marketplace.docblock.d.ts +1 -0
  6. package/dist/docs/marketplace.docblock.js +115 -0
  7. package/dist/docs/marketplace.docblock.js.map +1 -0
  8. package/dist/entities/index.d.ts +309 -0
  9. package/dist/entities/index.d.ts.map +1 -0
  10. package/dist/entities/index.js +46 -0
  11. package/dist/entities/index.js.map +1 -0
  12. package/dist/entities/order.d.ts +105 -0
  13. package/dist/entities/order.d.ts.map +1 -0
  14. package/dist/entities/order.js +173 -0
  15. package/dist/entities/order.js.map +1 -0
  16. package/dist/entities/payout.d.ts +92 -0
  17. package/dist/entities/payout.d.ts.map +1 -0
  18. package/dist/entities/payout.js +162 -0
  19. package/dist/entities/payout.js.map +1 -0
  20. package/dist/entities/product.d.ts +93 -0
  21. package/dist/entities/product.d.ts.map +1 -0
  22. package/dist/entities/product.js +161 -0
  23. package/dist/entities/product.js.map +1 -0
  24. package/dist/entities/review.d.ts +83 -0
  25. package/dist/entities/review.d.ts.map +1 -0
  26. package/dist/entities/review.js +152 -0
  27. package/dist/entities/review.js.map +1 -0
  28. package/dist/entities/store.d.ts +60 -0
  29. package/dist/entities/store.d.ts.map +1 -0
  30. package/dist/entities/store.js +110 -0
  31. package/dist/entities/store.js.map +1 -0
  32. package/dist/example.d.ts +40 -0
  33. package/dist/example.d.ts.map +1 -0
  34. package/dist/example.js +51 -0
  35. package/dist/example.js.map +1 -0
  36. package/dist/index.d.ts +26 -0
  37. package/dist/index.js +27 -0
  38. package/dist/marketplace.feature.d.ts +12 -0
  39. package/dist/marketplace.feature.d.ts.map +1 -0
  40. package/dist/marketplace.feature.js +310 -0
  41. package/dist/marketplace.feature.js.map +1 -0
  42. package/dist/order/index.d.ts +5 -0
  43. package/dist/order/index.js +6 -0
  44. package/dist/order/order.enum.d.ts +10 -0
  45. package/dist/order/order.enum.d.ts.map +1 -0
  46. package/dist/order/order.enum.js +22 -0
  47. package/dist/order/order.enum.js.map +1 -0
  48. package/dist/order/order.event.d.ts +145 -0
  49. package/dist/order/order.event.d.ts.map +1 -0
  50. package/dist/order/order.event.js +216 -0
  51. package/dist/order/order.event.js.map +1 -0
  52. package/dist/order/order.operations.d.ts +368 -0
  53. package/dist/order/order.operations.d.ts.map +1 -0
  54. package/dist/order/order.operations.js +119 -0
  55. package/dist/order/order.operations.js.map +1 -0
  56. package/dist/order/order.presentation.d.ts +9 -0
  57. package/dist/order/order.presentation.d.ts.map +1 -0
  58. package/dist/order/order.presentation.js +86 -0
  59. package/dist/order/order.presentation.js.map +1 -0
  60. package/dist/order/order.schema.d.ts +165 -0
  61. package/dist/order/order.schema.d.ts.map +1 -0
  62. package/dist/order/order.schema.js +155 -0
  63. package/dist/order/order.schema.js.map +1 -0
  64. package/dist/payout/index.d.ts +5 -0
  65. package/dist/payout/index.js +6 -0
  66. package/dist/payout/payout.enum.d.ts +10 -0
  67. package/dist/payout/payout.enum.d.ts.map +1 -0
  68. package/dist/payout/payout.enum.js +17 -0
  69. package/dist/payout/payout.enum.js.map +1 -0
  70. package/dist/payout/payout.event.d.ts +63 -0
  71. package/dist/payout/payout.event.d.ts.map +1 -0
  72. package/dist/payout/payout.event.js +92 -0
  73. package/dist/payout/payout.event.js.map +1 -0
  74. package/dist/payout/payout.operations.d.ts +97 -0
  75. package/dist/payout/payout.operations.d.ts.map +1 -0
  76. package/dist/payout/payout.operations.js +53 -0
  77. package/dist/payout/payout.operations.js.map +1 -0
  78. package/dist/payout/payout.presentation.d.ts +8 -0
  79. package/dist/payout/payout.presentation.d.ts.map +1 -0
  80. package/dist/payout/payout.presentation.js +60 -0
  81. package/dist/payout/payout.presentation.js.map +1 -0
  82. package/dist/payout/payout.schema.d.ts +157 -0
  83. package/dist/payout/payout.schema.d.ts.map +1 -0
  84. package/dist/payout/payout.schema.js +116 -0
  85. package/dist/payout/payout.schema.js.map +1 -0
  86. package/dist/product/index.d.ts +5 -0
  87. package/dist/product/index.js +6 -0
  88. package/dist/product/product.enum.d.ts +10 -0
  89. package/dist/product/product.enum.d.ts.map +1 -0
  90. package/dist/product/product.enum.js +18 -0
  91. package/dist/product/product.enum.js.map +1 -0
  92. package/dist/product/product.event.d.ts +73 -0
  93. package/dist/product/product.event.d.ts.map +1 -0
  94. package/dist/product/product.event.js +120 -0
  95. package/dist/product/product.event.js.map +1 -0
  96. package/dist/product/product.operations.d.ts +273 -0
  97. package/dist/product/product.operations.d.ts.map +1 -0
  98. package/dist/product/product.operations.js +108 -0
  99. package/dist/product/product.operations.js.map +1 -0
  100. package/dist/product/product.presentation.d.ts +9 -0
  101. package/dist/product/product.presentation.d.ts.map +1 -0
  102. package/dist/product/product.presentation.js +86 -0
  103. package/dist/product/product.presentation.js.map +1 -0
  104. package/dist/product/product.schema.d.ts +218 -0
  105. package/dist/product/product.schema.d.ts.map +1 -0
  106. package/dist/product/product.schema.js +176 -0
  107. package/dist/product/product.schema.js.map +1 -0
  108. package/dist/review/index.d.ts +5 -0
  109. package/dist/review/index.js +6 -0
  110. package/dist/review/review.enum.d.ts +10 -0
  111. package/dist/review/review.enum.d.ts.map +1 -0
  112. package/dist/review/review.enum.js +16 -0
  113. package/dist/review/review.enum.js.map +1 -0
  114. package/dist/review/review.event.d.ts +55 -0
  115. package/dist/review/review.event.d.ts.map +1 -0
  116. package/dist/review/review.event.js +84 -0
  117. package/dist/review/review.event.js.map +1 -0
  118. package/dist/review/review.operations.d.ts +237 -0
  119. package/dist/review/review.operations.d.ts.map +1 -0
  120. package/dist/review/review.operations.js +106 -0
  121. package/dist/review/review.operations.js.map +1 -0
  122. package/dist/review/review.presentation.d.ts +8 -0
  123. package/dist/review/review.presentation.d.ts.map +1 -0
  124. package/dist/review/review.presentation.js +60 -0
  125. package/dist/review/review.presentation.js.map +1 -0
  126. package/dist/review/review.schema.d.ts +190 -0
  127. package/dist/review/review.schema.d.ts.map +1 -0
  128. package/dist/review/review.schema.js +156 -0
  129. package/dist/review/review.schema.js.map +1 -0
  130. package/dist/store/index.d.ts +5 -0
  131. package/dist/store/index.js +6 -0
  132. package/dist/store/store.enum.d.ts +10 -0
  133. package/dist/store/store.enum.d.ts.map +1 -0
  134. package/dist/store/store.enum.js +16 -0
  135. package/dist/store/store.enum.js.map +1 -0
  136. package/dist/store/store.event.d.ts +51 -0
  137. package/dist/store/store.event.d.ts.map +1 -0
  138. package/dist/store/store.event.js +80 -0
  139. package/dist/store/store.event.js.map +1 -0
  140. package/dist/store/store.operations.d.ts +131 -0
  141. package/dist/store/store.operations.d.ts.map +1 -0
  142. package/dist/store/store.operations.js +61 -0
  143. package/dist/store/store.operations.js.map +1 -0
  144. package/dist/store/store.presentation.d.ts +8 -0
  145. package/dist/store/store.presentation.d.ts.map +1 -0
  146. package/dist/store/store.presentation.js +60 -0
  147. package/dist/store/store.presentation.js.map +1 -0
  148. package/dist/store/store.schema.d.ts +84 -0
  149. package/dist/store/store.schema.d.ts.map +1 -0
  150. package/dist/store/store.schema.js +93 -0
  151. package/dist/store/store.schema.js.map +1 -0
  152. package/package.json +141 -0
@@ -0,0 +1,22 @@
1
+ import { defineEnum } from "@contractspec/lib.schema";
2
+
3
+ //#region src/order/order.enum.ts
4
+ /**
5
+ * Order status enum.
6
+ */
7
+ const OrderStatusEnum = defineEnum("OrderStatus", [
8
+ "PENDING",
9
+ "PAID",
10
+ "PROCESSING",
11
+ "SHIPPED",
12
+ "DELIVERED",
13
+ "COMPLETED",
14
+ "CANCELLED",
15
+ "REFUNDED",
16
+ "PARTIALLY_REFUNDED",
17
+ "DISPUTED"
18
+ ]);
19
+
20
+ //#endregion
21
+ export { OrderStatusEnum };
22
+ //# sourceMappingURL=order.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"order.enum.js","names":[],"sources":["../../src/order/order.enum.ts"],"sourcesContent":["import { defineEnum } from '@contractspec/lib.schema';\n\n/**\n * Order status enum.\n */\nexport const OrderStatusEnum = defineEnum('OrderStatus', [\n 'PENDING',\n 'PAID',\n 'PROCESSING',\n 'SHIPPED',\n 'DELIVERED',\n 'COMPLETED',\n 'CANCELLED',\n 'REFUNDED',\n 'PARTIALLY_REFUNDED',\n 'DISPUTED',\n]);\n"],"mappings":";;;;;;AAKA,MAAa,kBAAkB,WAAW,eAAe;CACvD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC"}
@@ -0,0 +1,145 @@
1
+ import * as _contractspec_lib_schema59 from "@contractspec/lib.schema";
2
+ import * as _contractspec_lib_contracts0 from "@contractspec/lib.contracts";
3
+
4
+ //#region src/order/order.event.d.ts
5
+ declare const OrderCreatedEvent: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema59.SchemaModel<{
6
+ orderId: {
7
+ type: _contractspec_lib_schema59.FieldType<string, string>;
8
+ isOptional: false;
9
+ };
10
+ orderNumber: {
11
+ type: _contractspec_lib_schema59.FieldType<string, string>;
12
+ isOptional: false;
13
+ };
14
+ buyerId: {
15
+ type: _contractspec_lib_schema59.FieldType<string, string>;
16
+ isOptional: false;
17
+ };
18
+ storeId: {
19
+ type: _contractspec_lib_schema59.FieldType<string, string>;
20
+ isOptional: false;
21
+ };
22
+ total: {
23
+ type: _contractspec_lib_schema59.FieldType<number, number>;
24
+ isOptional: false;
25
+ };
26
+ currency: {
27
+ type: _contractspec_lib_schema59.FieldType<string, string>;
28
+ isOptional: false;
29
+ };
30
+ itemCount: {
31
+ type: _contractspec_lib_schema59.FieldType<number, number>;
32
+ isOptional: false;
33
+ };
34
+ timestamp: {
35
+ type: _contractspec_lib_schema59.FieldType<Date, string>;
36
+ isOptional: false;
37
+ };
38
+ }>>;
39
+ declare const OrderPaidEvent: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema59.SchemaModel<{
40
+ orderId: {
41
+ type: _contractspec_lib_schema59.FieldType<string, string>;
42
+ isOptional: false;
43
+ };
44
+ orderNumber: {
45
+ type: _contractspec_lib_schema59.FieldType<string, string>;
46
+ isOptional: false;
47
+ };
48
+ total: {
49
+ type: _contractspec_lib_schema59.FieldType<number, number>;
50
+ isOptional: false;
51
+ };
52
+ paymentMethod: {
53
+ type: _contractspec_lib_schema59.FieldType<string, string>;
54
+ isOptional: false;
55
+ };
56
+ timestamp: {
57
+ type: _contractspec_lib_schema59.FieldType<Date, string>;
58
+ isOptional: false;
59
+ };
60
+ }>>;
61
+ declare const OrderStatusUpdatedEvent: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema59.SchemaModel<{
62
+ orderId: {
63
+ type: _contractspec_lib_schema59.FieldType<string, string>;
64
+ isOptional: false;
65
+ };
66
+ orderNumber: {
67
+ type: _contractspec_lib_schema59.FieldType<string, string>;
68
+ isOptional: false;
69
+ };
70
+ previousStatus: {
71
+ type: _contractspec_lib_schema59.FieldType<string, string>;
72
+ isOptional: false;
73
+ };
74
+ newStatus: {
75
+ type: _contractspec_lib_schema59.FieldType<string, string>;
76
+ isOptional: false;
77
+ };
78
+ updatedBy: {
79
+ type: _contractspec_lib_schema59.FieldType<string, string>;
80
+ isOptional: false;
81
+ };
82
+ timestamp: {
83
+ type: _contractspec_lib_schema59.FieldType<Date, string>;
84
+ isOptional: false;
85
+ };
86
+ }>>;
87
+ declare const OrderShippedEvent: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema59.SchemaModel<{
88
+ orderId: {
89
+ type: _contractspec_lib_schema59.FieldType<string, string>;
90
+ isOptional: false;
91
+ };
92
+ orderNumber: {
93
+ type: _contractspec_lib_schema59.FieldType<string, string>;
94
+ isOptional: false;
95
+ };
96
+ trackingNumber: {
97
+ type: _contractspec_lib_schema59.FieldType<string, string>;
98
+ isOptional: true;
99
+ };
100
+ trackingUrl: {
101
+ type: _contractspec_lib_schema59.FieldType<string, string>;
102
+ isOptional: true;
103
+ };
104
+ carrier: {
105
+ type: _contractspec_lib_schema59.FieldType<string, string>;
106
+ isOptional: true;
107
+ };
108
+ timestamp: {
109
+ type: _contractspec_lib_schema59.FieldType<Date, string>;
110
+ isOptional: false;
111
+ };
112
+ }>>;
113
+ declare const OrderCompletedEvent: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema59.SchemaModel<{
114
+ orderId: {
115
+ type: _contractspec_lib_schema59.FieldType<string, string>;
116
+ isOptional: false;
117
+ };
118
+ orderNumber: {
119
+ type: _contractspec_lib_schema59.FieldType<string, string>;
120
+ isOptional: false;
121
+ };
122
+ buyerId: {
123
+ type: _contractspec_lib_schema59.FieldType<string, string>;
124
+ isOptional: false;
125
+ };
126
+ storeId: {
127
+ type: _contractspec_lib_schema59.FieldType<string, string>;
128
+ isOptional: false;
129
+ };
130
+ total: {
131
+ type: _contractspec_lib_schema59.FieldType<number, number>;
132
+ isOptional: false;
133
+ };
134
+ sellerPayout: {
135
+ type: _contractspec_lib_schema59.FieldType<number, number>;
136
+ isOptional: false;
137
+ };
138
+ timestamp: {
139
+ type: _contractspec_lib_schema59.FieldType<Date, string>;
140
+ isOptional: false;
141
+ };
142
+ }>>;
143
+ //#endregion
144
+ export { OrderCompletedEvent, OrderCreatedEvent, OrderPaidEvent, OrderShippedEvent, OrderStatusUpdatedEvent };
145
+ //# sourceMappingURL=order.event.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"order.event.d.ts","names":[],"sources":["../../src/order/order.event.ts"],"sourcesContent":[],"mappings":";;;;cA0Ea,mBAAiB,4BAAA,CAAA,qCAAA;;UAU5B,0BAAA,CAAA;;EAVW,CAAA;EAUX,WAAA,EAAA;;;;;;;;;8CAV4B,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;EAAA,CAAA;EAYjB,KAAA,EAAA;IAUX,IAAA,sCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;;;;;;;EAVyB,SAAA,EAAA;IAAA,IAAA,sCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;IAYd,UAAA,EAAA,KAAA;EAUX,CAAA;;;;;;cAtBW,gBAAc,4BAAA,CAAA,qCAAA;;IAYS,IAAA,EAFlC,0BAAA,CAAA,SAEkC,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;EAYvB,CAAA;EAUX,WAAA,EAAA;;;;;;;;EAV4B,aAAA,EAAA;IAAA,IAAA,sCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;IAYjB,UAAA,EAAA,KAAA;EAUX,CAAA;;;;;;cAlCW,yBAAuB,4BAAA,CAAA,qCAAA;;UAUlC,0BAAA,CAAA,SAc8B,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;EAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;cAZnB,mBAAiB,4BAAA,CAAA,qCAAA;;UAU5B,0BAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;cAEW,qBAAmB,4BAAA,CAAA,qCAAA;;UAU9B,0BAAA,CAAA"}
@@ -0,0 +1,216 @@
1
+ import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
2
+ import { defineEvent } from "@contractspec/lib.contracts";
3
+
4
+ //#region src/order/order.event.ts
5
+ const OrderCreatedPayload = defineSchemaModel({
6
+ name: "OrderCreatedEventPayload",
7
+ fields: {
8
+ orderId: {
9
+ type: ScalarTypeEnum.String_unsecure(),
10
+ isOptional: false
11
+ },
12
+ orderNumber: {
13
+ type: ScalarTypeEnum.String_unsecure(),
14
+ isOptional: false
15
+ },
16
+ buyerId: {
17
+ type: ScalarTypeEnum.String_unsecure(),
18
+ isOptional: false
19
+ },
20
+ storeId: {
21
+ type: ScalarTypeEnum.String_unsecure(),
22
+ isOptional: false
23
+ },
24
+ total: {
25
+ type: ScalarTypeEnum.Float_unsecure(),
26
+ isOptional: false
27
+ },
28
+ currency: {
29
+ type: ScalarTypeEnum.String_unsecure(),
30
+ isOptional: false
31
+ },
32
+ itemCount: {
33
+ type: ScalarTypeEnum.Int_unsecure(),
34
+ isOptional: false
35
+ },
36
+ timestamp: {
37
+ type: ScalarTypeEnum.DateTime(),
38
+ isOptional: false
39
+ }
40
+ }
41
+ });
42
+ const OrderPaidPayload = defineSchemaModel({
43
+ name: "OrderPaidEventPayload",
44
+ fields: {
45
+ orderId: {
46
+ type: ScalarTypeEnum.String_unsecure(),
47
+ isOptional: false
48
+ },
49
+ orderNumber: {
50
+ type: ScalarTypeEnum.String_unsecure(),
51
+ isOptional: false
52
+ },
53
+ total: {
54
+ type: ScalarTypeEnum.Float_unsecure(),
55
+ isOptional: false
56
+ },
57
+ paymentMethod: {
58
+ type: ScalarTypeEnum.String_unsecure(),
59
+ isOptional: false
60
+ },
61
+ timestamp: {
62
+ type: ScalarTypeEnum.DateTime(),
63
+ isOptional: false
64
+ }
65
+ }
66
+ });
67
+ const OrderStatusUpdatedPayload = defineSchemaModel({
68
+ name: "OrderStatusUpdatedEventPayload",
69
+ fields: {
70
+ orderId: {
71
+ type: ScalarTypeEnum.String_unsecure(),
72
+ isOptional: false
73
+ },
74
+ orderNumber: {
75
+ type: ScalarTypeEnum.String_unsecure(),
76
+ isOptional: false
77
+ },
78
+ previousStatus: {
79
+ type: ScalarTypeEnum.String_unsecure(),
80
+ isOptional: false
81
+ },
82
+ newStatus: {
83
+ type: ScalarTypeEnum.String_unsecure(),
84
+ isOptional: false
85
+ },
86
+ updatedBy: {
87
+ type: ScalarTypeEnum.String_unsecure(),
88
+ isOptional: false
89
+ },
90
+ timestamp: {
91
+ type: ScalarTypeEnum.DateTime(),
92
+ isOptional: false
93
+ }
94
+ }
95
+ });
96
+ const OrderShippedPayload = defineSchemaModel({
97
+ name: "OrderShippedEventPayload",
98
+ fields: {
99
+ orderId: {
100
+ type: ScalarTypeEnum.String_unsecure(),
101
+ isOptional: false
102
+ },
103
+ orderNumber: {
104
+ type: ScalarTypeEnum.String_unsecure(),
105
+ isOptional: false
106
+ },
107
+ trackingNumber: {
108
+ type: ScalarTypeEnum.String_unsecure(),
109
+ isOptional: true
110
+ },
111
+ trackingUrl: {
112
+ type: ScalarTypeEnum.String_unsecure(),
113
+ isOptional: true
114
+ },
115
+ carrier: {
116
+ type: ScalarTypeEnum.String_unsecure(),
117
+ isOptional: true
118
+ },
119
+ timestamp: {
120
+ type: ScalarTypeEnum.DateTime(),
121
+ isOptional: false
122
+ }
123
+ }
124
+ });
125
+ const OrderCompletedPayload = defineSchemaModel({
126
+ name: "OrderCompletedEventPayload",
127
+ fields: {
128
+ orderId: {
129
+ type: ScalarTypeEnum.String_unsecure(),
130
+ isOptional: false
131
+ },
132
+ orderNumber: {
133
+ type: ScalarTypeEnum.String_unsecure(),
134
+ isOptional: false
135
+ },
136
+ buyerId: {
137
+ type: ScalarTypeEnum.String_unsecure(),
138
+ isOptional: false
139
+ },
140
+ storeId: {
141
+ type: ScalarTypeEnum.String_unsecure(),
142
+ isOptional: false
143
+ },
144
+ total: {
145
+ type: ScalarTypeEnum.Float_unsecure(),
146
+ isOptional: false
147
+ },
148
+ sellerPayout: {
149
+ type: ScalarTypeEnum.Float_unsecure(),
150
+ isOptional: false
151
+ },
152
+ timestamp: {
153
+ type: ScalarTypeEnum.DateTime(),
154
+ isOptional: false
155
+ }
156
+ }
157
+ });
158
+ const OrderCreatedEvent = defineEvent({
159
+ meta: {
160
+ key: "marketplace.order.created",
161
+ version: 1,
162
+ description: "A new order has been created.",
163
+ stability: "experimental",
164
+ owners: ["@marketplace-team"],
165
+ tags: ["marketplace", "order"]
166
+ },
167
+ payload: OrderCreatedPayload
168
+ });
169
+ const OrderPaidEvent = defineEvent({
170
+ meta: {
171
+ key: "marketplace.order.paid",
172
+ version: 1,
173
+ description: "An order has been paid.",
174
+ stability: "experimental",
175
+ owners: ["@marketplace-team"],
176
+ tags: ["marketplace", "order"]
177
+ },
178
+ payload: OrderPaidPayload
179
+ });
180
+ const OrderStatusUpdatedEvent = defineEvent({
181
+ meta: {
182
+ key: "marketplace.order.statusUpdated",
183
+ version: 1,
184
+ description: "An order status has been updated.",
185
+ stability: "experimental",
186
+ owners: ["@marketplace-team"],
187
+ tags: ["marketplace", "order"]
188
+ },
189
+ payload: OrderStatusUpdatedPayload
190
+ });
191
+ const OrderShippedEvent = defineEvent({
192
+ meta: {
193
+ key: "marketplace.order.shipped",
194
+ version: 1,
195
+ description: "An order has been shipped.",
196
+ stability: "experimental",
197
+ owners: ["@marketplace-team"],
198
+ tags: ["marketplace", "order"]
199
+ },
200
+ payload: OrderShippedPayload
201
+ });
202
+ const OrderCompletedEvent = defineEvent({
203
+ meta: {
204
+ key: "marketplace.order.completed",
205
+ version: 1,
206
+ description: "An order has been completed.",
207
+ stability: "experimental",
208
+ owners: ["@marketplace-team"],
209
+ tags: ["marketplace", "order"]
210
+ },
211
+ payload: OrderCompletedPayload
212
+ });
213
+
214
+ //#endregion
215
+ export { OrderCompletedEvent, OrderCreatedEvent, OrderPaidEvent, OrderShippedEvent, OrderStatusUpdatedEvent };
216
+ //# sourceMappingURL=order.event.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"order.event.js","names":[],"sources":["../../src/order/order.event.ts"],"sourcesContent":["import { ScalarTypeEnum, defineSchemaModel } from '@contractspec/lib.schema';\nimport { defineEvent } from '@contractspec/lib.contracts';\n\nconst OrderCreatedPayload = defineSchemaModel({\n name: 'OrderCreatedEventPayload',\n fields: {\n orderId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n orderNumber: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n buyerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n storeId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n total: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },\n currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n itemCount: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nconst OrderPaidPayload = defineSchemaModel({\n name: 'OrderPaidEventPayload',\n fields: {\n orderId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n orderNumber: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n total: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },\n paymentMethod: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nconst OrderStatusUpdatedPayload = defineSchemaModel({\n name: 'OrderStatusUpdatedEventPayload',\n fields: {\n orderId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n orderNumber: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n previousStatus: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n newStatus: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n updatedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nconst OrderShippedPayload = defineSchemaModel({\n name: 'OrderShippedEventPayload',\n fields: {\n orderId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n orderNumber: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n trackingNumber: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: true,\n },\n trackingUrl: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n carrier: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nconst OrderCompletedPayload = defineSchemaModel({\n name: 'OrderCompletedEventPayload',\n fields: {\n orderId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n orderNumber: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n buyerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n storeId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n total: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },\n sellerPayout: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },\n timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nexport const OrderCreatedEvent = defineEvent({\n meta: {\n key: 'marketplace.order.created',\n version: 1,\n description: 'A new order has been created.',\n stability: 'experimental',\n owners: ['@marketplace-team'],\n tags: ['marketplace', 'order'],\n },\n payload: OrderCreatedPayload,\n});\n\nexport const OrderPaidEvent = defineEvent({\n meta: {\n key: 'marketplace.order.paid',\n version: 1,\n description: 'An order has been paid.',\n stability: 'experimental',\n owners: ['@marketplace-team'],\n tags: ['marketplace', 'order'],\n },\n payload: OrderPaidPayload,\n});\n\nexport const OrderStatusUpdatedEvent = defineEvent({\n meta: {\n key: 'marketplace.order.statusUpdated',\n version: 1,\n description: 'An order status has been updated.',\n stability: 'experimental',\n owners: ['@marketplace-team'],\n tags: ['marketplace', 'order'],\n },\n payload: OrderStatusUpdatedPayload,\n});\n\nexport const OrderShippedEvent = defineEvent({\n meta: {\n key: 'marketplace.order.shipped',\n version: 1,\n description: 'An order has been shipped.',\n stability: 'experimental',\n owners: ['@marketplace-team'],\n tags: ['marketplace', 'order'],\n },\n payload: OrderShippedPayload,\n});\n\nexport const OrderCompletedEvent = defineEvent({\n meta: {\n key: 'marketplace.order.completed',\n version: 1,\n description: 'An order has been completed.',\n stability: 'experimental',\n owners: ['@marketplace-team'],\n tags: ['marketplace', 'order'],\n },\n payload: OrderCompletedPayload,\n});\n"],"mappings":";;;;AAGA,MAAM,sBAAsB,kBAAkB;CAC5C,MAAM;CACN,QAAQ;EACN,SAAS;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACtE,aAAa;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EAC1E,SAAS;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACtE,SAAS;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACtE,OAAO;GAAE,MAAM,eAAe,gBAAgB;GAAE,Y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