@contractspec/example.marketplace 3.7.5 → 3.7.7

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