@contractspec/example.marketplace 3.7.6 → 3.8.2

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 (86) hide show
  1. package/README.md +64 -131
  2. package/dist/browser/entities/index.js +470 -470
  3. package/dist/browser/index.js +1257 -1019
  4. package/dist/browser/marketplace.feature.js +175 -0
  5. package/dist/browser/order/index.js +155 -155
  6. package/dist/browser/order/order.event.js +1 -1
  7. package/dist/browser/payout/index.js +71 -71
  8. package/dist/browser/payout/payout.event.js +1 -1
  9. package/dist/browser/product/index.js +104 -104
  10. package/dist/browser/product/product.event.js +1 -1
  11. package/dist/browser/review/index.js +75 -75
  12. package/dist/browser/review/review.event.js +1 -1
  13. package/dist/browser/store/index.js +68 -68
  14. package/dist/browser/store/store.event.js +1 -1
  15. package/dist/browser/ui/MarketplaceDashboard.js +328 -110
  16. package/dist/browser/ui/MarketplaceDashboard.visualizations.js +216 -0
  17. package/dist/browser/ui/hooks/index.js +1 -1
  18. package/dist/browser/ui/hooks/useMarketplaceData.js +1 -1
  19. package/dist/browser/ui/index.js +590 -359
  20. package/dist/browser/ui/renderers/index.js +190 -4
  21. package/dist/browser/ui/renderers/marketplace.markdown.js +190 -4
  22. package/dist/browser/visualizations/catalog.js +126 -0
  23. package/dist/browser/visualizations/index.js +183 -0
  24. package/dist/browser/visualizations/selectors.js +177 -0
  25. package/dist/entities/index.d.ts +110 -110
  26. package/dist/entities/index.js +470 -470
  27. package/dist/index.d.ts +4 -3
  28. package/dist/index.js +1257 -1019
  29. package/dist/marketplace.feature.js +175 -0
  30. package/dist/node/entities/index.js +470 -470
  31. package/dist/node/index.js +1257 -1019
  32. package/dist/node/marketplace.feature.js +175 -0
  33. package/dist/node/order/index.js +155 -155
  34. package/dist/node/order/order.event.js +1 -1
  35. package/dist/node/payout/index.js +71 -71
  36. package/dist/node/payout/payout.event.js +1 -1
  37. package/dist/node/product/index.js +104 -104
  38. package/dist/node/product/product.event.js +1 -1
  39. package/dist/node/review/index.js +75 -75
  40. package/dist/node/review/review.event.js +1 -1
  41. package/dist/node/store/index.js +68 -68
  42. package/dist/node/store/store.event.js +1 -1
  43. package/dist/node/ui/MarketplaceDashboard.js +328 -110
  44. package/dist/node/ui/MarketplaceDashboard.visualizations.js +216 -0
  45. package/dist/node/ui/hooks/index.js +1 -1
  46. package/dist/node/ui/hooks/useMarketplaceData.js +1 -1
  47. package/dist/node/ui/index.js +590 -359
  48. package/dist/node/ui/renderers/index.js +190 -4
  49. package/dist/node/ui/renderers/marketplace.markdown.js +190 -4
  50. package/dist/node/visualizations/catalog.js +126 -0
  51. package/dist/node/visualizations/index.js +183 -0
  52. package/dist/node/visualizations/selectors.js +177 -0
  53. package/dist/order/index.d.ts +2 -2
  54. package/dist/order/index.js +155 -155
  55. package/dist/order/order.event.js +1 -1
  56. package/dist/payout/index.d.ts +2 -2
  57. package/dist/payout/index.js +71 -71
  58. package/dist/payout/payout.event.js +1 -1
  59. package/dist/product/index.d.ts +2 -2
  60. package/dist/product/index.js +104 -104
  61. package/dist/product/product.event.js +1 -1
  62. package/dist/review/index.d.ts +2 -2
  63. package/dist/review/index.js +75 -75
  64. package/dist/review/review.event.js +1 -1
  65. package/dist/store/index.d.ts +2 -2
  66. package/dist/store/index.js +68 -68
  67. package/dist/store/store.event.js +1 -1
  68. package/dist/ui/MarketplaceDashboard.js +328 -110
  69. package/dist/ui/MarketplaceDashboard.visualizations.d.ts +5 -0
  70. package/dist/ui/MarketplaceDashboard.visualizations.js +217 -0
  71. package/dist/ui/hooks/index.d.ts +1 -1
  72. package/dist/ui/hooks/index.js +1 -1
  73. package/dist/ui/hooks/useMarketplaceData.js +1 -1
  74. package/dist/ui/index.d.ts +2 -2
  75. package/dist/ui/index.js +590 -359
  76. package/dist/ui/renderers/index.d.ts +1 -1
  77. package/dist/ui/renderers/index.js +190 -4
  78. package/dist/ui/renderers/marketplace.markdown.js +190 -4
  79. package/dist/visualizations/catalog.d.ts +10 -0
  80. package/dist/visualizations/catalog.js +127 -0
  81. package/dist/visualizations/index.d.ts +2 -0
  82. package/dist/visualizations/index.js +184 -0
  83. package/dist/visualizations/selectors.d.ts +11 -0
  84. package/dist/visualizations/selectors.js +178 -0
  85. package/dist/visualizations/selectors.test.d.ts +1 -0
  86. package/package.json +66 -10
@@ -14,62 +14,187 @@ var OrderStatusEnum = defineEnum("OrderStatus", [
14
14
  "DISPUTED"
15
15
  ]);
16
16
 
17
- // src/order/order.schema.ts
17
+ // src/order/order.event.ts
18
+ import { defineEvent } from "@contractspec/lib.contracts-spec";
18
19
  import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
19
- var OrderItemModel = defineSchemaModel({
20
- name: "OrderItemModel",
20
+ var OrderCreatedPayload = defineSchemaModel({
21
+ name: "OrderCreatedEventPayload",
21
22
  fields: {
22
- id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
23
- productId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
24
- productName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
25
- unitPrice: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
26
- quantity: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
27
- subtotal: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false }
23
+ orderId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
24
+ orderNumber: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
25
+ buyerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
26
+ storeId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
27
+ total: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
28
+ currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
29
+ itemCount: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
30
+ timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: false }
28
31
  }
29
32
  });
30
- var OrderModel = defineSchemaModel({
31
- name: "OrderModel",
32
- description: "An order",
33
+ var OrderPaidPayload = defineSchemaModel({
34
+ name: "OrderPaidEventPayload",
35
+ fields: {
36
+ orderId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
37
+ orderNumber: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
38
+ total: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
39
+ paymentMethod: {
40
+ type: ScalarTypeEnum.String_unsecure(),
41
+ isOptional: false
42
+ },
43
+ timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: false }
44
+ }
45
+ });
46
+ var OrderStatusUpdatedPayload = defineSchemaModel({
47
+ name: "OrderStatusUpdatedEventPayload",
48
+ fields: {
49
+ orderId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
50
+ orderNumber: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
51
+ previousStatus: {
52
+ type: ScalarTypeEnum.String_unsecure(),
53
+ isOptional: false
54
+ },
55
+ newStatus: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
56
+ updatedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
57
+ timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: false }
58
+ }
59
+ });
60
+ var OrderShippedPayload = defineSchemaModel({
61
+ name: "OrderShippedEventPayload",
62
+ fields: {
63
+ orderId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
64
+ orderNumber: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
65
+ trackingNumber: {
66
+ type: ScalarTypeEnum.String_unsecure(),
67
+ isOptional: true
68
+ },
69
+ trackingUrl: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
70
+ carrier: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
71
+ timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: false }
72
+ }
73
+ });
74
+ var OrderCompletedPayload = defineSchemaModel({
75
+ name: "OrderCompletedEventPayload",
33
76
  fields: {
34
- id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
77
+ orderId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
35
78
  orderNumber: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
36
79
  buyerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
37
80
  storeId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
38
- status: { type: OrderStatusEnum, isOptional: false },
39
- subtotal: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
40
- shippingTotal: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
41
- taxTotal: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
42
81
  total: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
43
- currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
82
+ sellerPayout: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
83
+ timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: false }
84
+ }
85
+ });
86
+ var OrderCreatedEvent = defineEvent({
87
+ meta: {
88
+ key: "marketplace.order.created",
89
+ version: "1.0.0",
90
+ description: "A new order has been created.",
91
+ stability: "experimental",
92
+ owners: ["@marketplace-team"],
93
+ tags: ["marketplace", "order"]
94
+ },
95
+ payload: OrderCreatedPayload
96
+ });
97
+ var OrderPaidEvent = defineEvent({
98
+ meta: {
99
+ key: "marketplace.order.paid",
100
+ version: "1.0.0",
101
+ description: "An order has been paid.",
102
+ stability: "experimental",
103
+ owners: ["@marketplace-team"],
104
+ tags: ["marketplace", "order"]
105
+ },
106
+ payload: OrderPaidPayload
107
+ });
108
+ var OrderStatusUpdatedEvent = defineEvent({
109
+ meta: {
110
+ key: "marketplace.order.statusUpdated",
111
+ version: "1.0.0",
112
+ description: "An order status has been updated.",
113
+ stability: "experimental",
114
+ owners: ["@marketplace-team"],
115
+ tags: ["marketplace", "order"]
116
+ },
117
+ payload: OrderStatusUpdatedPayload
118
+ });
119
+ var OrderShippedEvent = defineEvent({
120
+ meta: {
121
+ key: "marketplace.order.shipped",
122
+ version: "1.0.0",
123
+ description: "An order has been shipped.",
124
+ stability: "experimental",
125
+ owners: ["@marketplace-team"],
126
+ tags: ["marketplace", "order"]
127
+ },
128
+ payload: OrderShippedPayload
129
+ });
130
+ var OrderCompletedEvent = defineEvent({
131
+ meta: {
132
+ key: "marketplace.order.completed",
133
+ version: "1.0.0",
134
+ description: "An order has been completed.",
135
+ stability: "experimental",
136
+ owners: ["@marketplace-team"],
137
+ tags: ["marketplace", "order"]
138
+ },
139
+ payload: OrderCompletedPayload
140
+ });
141
+
142
+ // src/order/order.schema.ts
143
+ import { defineSchemaModel as defineSchemaModel2, ScalarTypeEnum as ScalarTypeEnum2 } from "@contractspec/lib.schema";
144
+ var OrderItemModel = defineSchemaModel2({
145
+ name: "OrderItemModel",
146
+ fields: {
147
+ id: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
148
+ productId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
149
+ productName: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
150
+ unitPrice: { type: ScalarTypeEnum2.Float_unsecure(), isOptional: false },
151
+ quantity: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: false },
152
+ subtotal: { type: ScalarTypeEnum2.Float_unsecure(), isOptional: false }
153
+ }
154
+ });
155
+ var OrderModel = defineSchemaModel2({
156
+ name: "OrderModel",
157
+ description: "An order",
158
+ fields: {
159
+ id: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
160
+ orderNumber: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
161
+ buyerId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
162
+ storeId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
163
+ status: { type: OrderStatusEnum, isOptional: false },
164
+ subtotal: { type: ScalarTypeEnum2.Float_unsecure(), isOptional: false },
165
+ shippingTotal: { type: ScalarTypeEnum2.Float_unsecure(), isOptional: false },
166
+ taxTotal: { type: ScalarTypeEnum2.Float_unsecure(), isOptional: false },
167
+ total: { type: ScalarTypeEnum2.Float_unsecure(), isOptional: false },
168
+ currency: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
44
169
  items: { type: OrderItemModel, isArray: true, isOptional: true },
45
- createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
170
+ createdAt: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
46
171
  }
47
172
  });
48
- var CreateOrderInputModel = defineSchemaModel({
173
+ var CreateOrderInputModel = defineSchemaModel2({
49
174
  name: "CreateOrderInput",
50
175
  fields: {
51
- storeId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
176
+ storeId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
52
177
  items: {
53
- type: ScalarTypeEnum.JSON(),
178
+ type: ScalarTypeEnum2.JSON(),
54
179
  isOptional: false,
55
180
  description: "Array of {productId, variantId?, quantity}"
56
181
  },
57
- shippingAddress: { type: ScalarTypeEnum.JSON(), isOptional: true },
58
- billingAddress: { type: ScalarTypeEnum.JSON(), isOptional: true },
59
- buyerNote: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
182
+ shippingAddress: { type: ScalarTypeEnum2.JSON(), isOptional: true },
183
+ billingAddress: { type: ScalarTypeEnum2.JSON(), isOptional: true },
184
+ buyerNote: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true }
60
185
  }
61
186
  });
62
- var UpdateOrderStatusInputModel = defineSchemaModel({
187
+ var UpdateOrderStatusInputModel = defineSchemaModel2({
63
188
  name: "UpdateOrderStatusInput",
64
189
  fields: {
65
- orderId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
190
+ orderId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
66
191
  status: { type: OrderStatusEnum, isOptional: false },
67
192
  trackingNumber: {
68
- type: ScalarTypeEnum.String_unsecure(),
193
+ type: ScalarTypeEnum2.String_unsecure(),
69
194
  isOptional: true
70
195
  },
71
- trackingUrl: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
72
- note: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
196
+ trackingUrl: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
197
+ note: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true }
73
198
  }
74
199
  });
75
200
 
@@ -167,131 +292,6 @@ var UpdateOrderStatusContract = defineCommand({
167
292
  ]
168
293
  }
169
294
  });
170
-
171
- // src/order/order.event.ts
172
- import { ScalarTypeEnum as ScalarTypeEnum2, defineSchemaModel as defineSchemaModel2 } from "@contractspec/lib.schema";
173
- import { defineEvent } from "@contractspec/lib.contracts-spec";
174
- var OrderCreatedPayload = defineSchemaModel2({
175
- name: "OrderCreatedEventPayload",
176
- fields: {
177
- orderId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
178
- orderNumber: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
179
- buyerId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
180
- storeId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
181
- total: { type: ScalarTypeEnum2.Float_unsecure(), isOptional: false },
182
- currency: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
183
- itemCount: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: false },
184
- timestamp: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
185
- }
186
- });
187
- var OrderPaidPayload = defineSchemaModel2({
188
- name: "OrderPaidEventPayload",
189
- fields: {
190
- orderId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
191
- orderNumber: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
192
- total: { type: ScalarTypeEnum2.Float_unsecure(), isOptional: false },
193
- paymentMethod: {
194
- type: ScalarTypeEnum2.String_unsecure(),
195
- isOptional: false
196
- },
197
- timestamp: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
198
- }
199
- });
200
- var OrderStatusUpdatedPayload = defineSchemaModel2({
201
- name: "OrderStatusUpdatedEventPayload",
202
- fields: {
203
- orderId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
204
- orderNumber: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
205
- previousStatus: {
206
- type: ScalarTypeEnum2.String_unsecure(),
207
- isOptional: false
208
- },
209
- newStatus: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
210
- updatedBy: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
211
- timestamp: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
212
- }
213
- });
214
- var OrderShippedPayload = defineSchemaModel2({
215
- name: "OrderShippedEventPayload",
216
- fields: {
217
- orderId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
218
- orderNumber: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
219
- trackingNumber: {
220
- type: ScalarTypeEnum2.String_unsecure(),
221
- isOptional: true
222
- },
223
- trackingUrl: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
224
- carrier: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
225
- timestamp: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
226
- }
227
- });
228
- var OrderCompletedPayload = defineSchemaModel2({
229
- name: "OrderCompletedEventPayload",
230
- fields: {
231
- orderId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
232
- orderNumber: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
233
- buyerId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
234
- storeId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
235
- total: { type: ScalarTypeEnum2.Float_unsecure(), isOptional: false },
236
- sellerPayout: { type: ScalarTypeEnum2.Float_unsecure(), isOptional: false },
237
- timestamp: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
238
- }
239
- });
240
- var OrderCreatedEvent = defineEvent({
241
- meta: {
242
- key: "marketplace.order.created",
243
- version: "1.0.0",
244
- description: "A new order has been created.",
245
- stability: "experimental",
246
- owners: ["@marketplace-team"],
247
- tags: ["marketplace", "order"]
248
- },
249
- payload: OrderCreatedPayload
250
- });
251
- var OrderPaidEvent = defineEvent({
252
- meta: {
253
- key: "marketplace.order.paid",
254
- version: "1.0.0",
255
- description: "An order has been paid.",
256
- stability: "experimental",
257
- owners: ["@marketplace-team"],
258
- tags: ["marketplace", "order"]
259
- },
260
- payload: OrderPaidPayload
261
- });
262
- var OrderStatusUpdatedEvent = defineEvent({
263
- meta: {
264
- key: "marketplace.order.statusUpdated",
265
- version: "1.0.0",
266
- description: "An order status has been updated.",
267
- stability: "experimental",
268
- owners: ["@marketplace-team"],
269
- tags: ["marketplace", "order"]
270
- },
271
- payload: OrderStatusUpdatedPayload
272
- });
273
- var OrderShippedEvent = defineEvent({
274
- meta: {
275
- key: "marketplace.order.shipped",
276
- version: "1.0.0",
277
- description: "An order has been shipped.",
278
- stability: "experimental",
279
- owners: ["@marketplace-team"],
280
- tags: ["marketplace", "order"]
281
- },
282
- payload: OrderShippedPayload
283
- });
284
- var OrderCompletedEvent = defineEvent({
285
- meta: {
286
- key: "marketplace.order.completed",
287
- version: "1.0.0",
288
- description: "An order has been completed.",
289
- stability: "experimental",
290
- owners: ["@marketplace-team"],
291
- tags: ["marketplace", "order"]
292
- },
293
- payload: OrderCompletedPayload
294
- });
295
295
  export {
296
296
  UpdateOrderStatusInputModel,
297
297
  UpdateOrderStatusContract,
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  // src/order/order.event.ts
3
- import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
4
3
  import { defineEvent } from "@contractspec/lib.contracts-spec";
4
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
5
5
  var OrderCreatedPayload = defineSchemaModel({
6
6
  name: "OrderCreatedEventPayload",
7
7
  fields: {
@@ -2,6 +2,6 @@
2
2
  * Payout domain - Seller payout management.
3
3
  */
4
4
  export { PayoutStatusEnum } from './payout.enum';
5
- export { PayoutModel, ListPayoutsInputModel, ListPayoutsOutputModel, } from './payout.schema';
6
- export { ListPayoutsContract } from './payout.operations';
7
5
  export { PayoutCreatedEvent, PayoutPaidEvent } from './payout.event';
6
+ export { ListPayoutsContract } from './payout.operations';
7
+ export { ListPayoutsInputModel, ListPayoutsOutputModel, PayoutModel, } from './payout.schema';
@@ -9,50 +9,102 @@ var PayoutStatusEnum = defineEnum("PayoutStatus", [
9
9
  "CANCELLED"
10
10
  ]);
11
11
 
12
- // src/payout/payout.schema.ts
12
+ // src/payout/payout.event.ts
13
+ import { defineEvent } from "@contractspec/lib.contracts-spec";
13
14
  import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
14
- var PayoutModel = defineSchemaModel({
15
- name: "PayoutModel",
16
- description: "A payout to seller",
15
+ var PayoutCreatedPayload = defineSchemaModel({
16
+ name: "PayoutCreatedEventPayload",
17
17
  fields: {
18
- id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
18
+ payoutId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
19
19
  payoutNumber: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
20
20
  storeId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
21
- status: { type: PayoutStatusEnum, isOptional: false },
22
- grossAmount: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
23
- platformFees: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
24
21
  netAmount: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
25
22
  currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
26
- periodStart: { type: ScalarTypeEnum.DateTime(), isOptional: false },
27
- periodEnd: { type: ScalarTypeEnum.DateTime(), isOptional: false },
28
23
  orderCount: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
29
- createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
30
- paidAt: { type: ScalarTypeEnum.DateTime(), isOptional: true }
24
+ timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: false }
31
25
  }
32
26
  });
33
- var ListPayoutsInputModel = defineSchemaModel({
34
- name: "ListPayoutsInput",
27
+ var PayoutPaidPayload = defineSchemaModel({
28
+ name: "PayoutPaidEventPayload",
35
29
  fields: {
30
+ payoutId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
31
+ payoutNumber: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
36
32
  storeId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
33
+ netAmount: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
34
+ paymentReference: {
35
+ type: ScalarTypeEnum.String_unsecure(),
36
+ isOptional: true
37
+ },
38
+ timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: false }
39
+ }
40
+ });
41
+ var PayoutCreatedEvent = defineEvent({
42
+ meta: {
43
+ key: "marketplace.payout.created",
44
+ version: "1.0.0",
45
+ description: "A payout has been created.",
46
+ stability: "experimental",
47
+ owners: ["@marketplace-team"],
48
+ tags: ["marketplace", "payout"]
49
+ },
50
+ payload: PayoutCreatedPayload
51
+ });
52
+ var PayoutPaidEvent = defineEvent({
53
+ meta: {
54
+ key: "marketplace.payout.paid",
55
+ version: "1.0.0",
56
+ description: "A payout has been sent.",
57
+ stability: "experimental",
58
+ owners: ["@marketplace-team"],
59
+ tags: ["marketplace", "payout"]
60
+ },
61
+ payload: PayoutPaidPayload
62
+ });
63
+
64
+ // src/payout/payout.schema.ts
65
+ import { defineSchemaModel as defineSchemaModel2, ScalarTypeEnum as ScalarTypeEnum2 } from "@contractspec/lib.schema";
66
+ var PayoutModel = defineSchemaModel2({
67
+ name: "PayoutModel",
68
+ description: "A payout to seller",
69
+ fields: {
70
+ id: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
71
+ payoutNumber: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
72
+ storeId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
73
+ status: { type: PayoutStatusEnum, isOptional: false },
74
+ grossAmount: { type: ScalarTypeEnum2.Float_unsecure(), isOptional: false },
75
+ platformFees: { type: ScalarTypeEnum2.Float_unsecure(), isOptional: false },
76
+ netAmount: { type: ScalarTypeEnum2.Float_unsecure(), isOptional: false },
77
+ currency: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
78
+ periodStart: { type: ScalarTypeEnum2.DateTime(), isOptional: false },
79
+ periodEnd: { type: ScalarTypeEnum2.DateTime(), isOptional: false },
80
+ orderCount: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: false },
81
+ createdAt: { type: ScalarTypeEnum2.DateTime(), isOptional: false },
82
+ paidAt: { type: ScalarTypeEnum2.DateTime(), isOptional: true }
83
+ }
84
+ });
85
+ var ListPayoutsInputModel = defineSchemaModel2({
86
+ name: "ListPayoutsInput",
87
+ fields: {
88
+ storeId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
37
89
  status: { type: PayoutStatusEnum, isOptional: true },
38
90
  limit: {
39
- type: ScalarTypeEnum.Int_unsecure(),
91
+ type: ScalarTypeEnum2.Int_unsecure(),
40
92
  isOptional: true,
41
93
  defaultValue: 20
42
94
  },
43
95
  offset: {
44
- type: ScalarTypeEnum.Int_unsecure(),
96
+ type: ScalarTypeEnum2.Int_unsecure(),
45
97
  isOptional: true,
46
98
  defaultValue: 0
47
99
  }
48
100
  }
49
101
  });
50
- var ListPayoutsOutputModel = defineSchemaModel({
102
+ var ListPayoutsOutputModel = defineSchemaModel2({
51
103
  name: "ListPayoutsOutput",
52
104
  fields: {
53
105
  payouts: { type: PayoutModel, isArray: true, isOptional: false },
54
- total: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
55
- totalPending: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false }
106
+ total: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: false },
107
+ totalPending: { type: ScalarTypeEnum2.Float_unsecure(), isOptional: false }
56
108
  }
57
109
  });
58
110
 
@@ -90,58 +142,6 @@ var ListPayoutsContract = defineQuery({
90
142
  ]
91
143
  }
92
144
  });
93
-
94
- // src/payout/payout.event.ts
95
- import { ScalarTypeEnum as ScalarTypeEnum2, defineSchemaModel as defineSchemaModel2 } from "@contractspec/lib.schema";
96
- import { defineEvent } from "@contractspec/lib.contracts-spec";
97
- var PayoutCreatedPayload = defineSchemaModel2({
98
- name: "PayoutCreatedEventPayload",
99
- fields: {
100
- payoutId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
101
- payoutNumber: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
102
- storeId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
103
- netAmount: { type: ScalarTypeEnum2.Float_unsecure(), isOptional: false },
104
- currency: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
105
- orderCount: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: false },
106
- timestamp: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
107
- }
108
- });
109
- var PayoutPaidPayload = defineSchemaModel2({
110
- name: "PayoutPaidEventPayload",
111
- fields: {
112
- payoutId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
113
- payoutNumber: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
114
- storeId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
115
- netAmount: { type: ScalarTypeEnum2.Float_unsecure(), isOptional: false },
116
- paymentReference: {
117
- type: ScalarTypeEnum2.String_unsecure(),
118
- isOptional: true
119
- },
120
- timestamp: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
121
- }
122
- });
123
- var PayoutCreatedEvent = defineEvent({
124
- meta: {
125
- key: "marketplace.payout.created",
126
- version: "1.0.0",
127
- description: "A payout has been created.",
128
- stability: "experimental",
129
- owners: ["@marketplace-team"],
130
- tags: ["marketplace", "payout"]
131
- },
132
- payload: PayoutCreatedPayload
133
- });
134
- var PayoutPaidEvent = defineEvent({
135
- meta: {
136
- key: "marketplace.payout.paid",
137
- version: "1.0.0",
138
- description: "A payout has been sent.",
139
- stability: "experimental",
140
- owners: ["@marketplace-team"],
141
- tags: ["marketplace", "payout"]
142
- },
143
- payload: PayoutPaidPayload
144
- });
145
145
  export {
146
146
  PayoutStatusEnum,
147
147
  PayoutPaidEvent,
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  // src/payout/payout.event.ts
3
- import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
4
3
  import { defineEvent } from "@contractspec/lib.contracts-spec";
4
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
5
5
  var PayoutCreatedPayload = defineSchemaModel({
6
6
  name: "PayoutCreatedEventPayload",
7
7
  fields: {
@@ -2,6 +2,6 @@
2
2
  * Product domain - Product listing management.
3
3
  */
4
4
  export { ProductStatusEnum } from './product.enum';
5
- export { ProductModel, CreateProductInputModel, ListProductsInputModel, ListProductsOutputModel, } from './product.schema';
5
+ export { InventoryUpdatedEvent, ProductCreatedEvent, ProductPublishedEvent, } from './product.event';
6
6
  export { CreateProductContract, ListProductsContract, } from './product.operations';
7
- export { ProductCreatedEvent, ProductPublishedEvent, InventoryUpdatedEvent, } from './product.event';
7
+ export { CreateProductInputModel, ListProductsInputModel, ListProductsOutputModel, ProductModel, } from './product.schema';