@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
@@ -2,6 +2,6 @@
2
2
  * Order domain - Order management.
3
3
  */
4
4
  export { OrderStatusEnum } from './order.enum';
5
- export { OrderItemModel, OrderModel, CreateOrderInputModel, UpdateOrderStatusInputModel, } from './order.schema';
5
+ export { OrderCompletedEvent, OrderCreatedEvent, OrderPaidEvent, OrderShippedEvent, OrderStatusUpdatedEvent, } from './order.event';
6
6
  export { CreateOrderContract, UpdateOrderStatusContract, } from './order.operations';
7
- export { OrderCreatedEvent, OrderPaidEvent, OrderStatusUpdatedEvent, OrderShippedEvent, OrderCompletedEvent, } from './order.event';
7
+ export { CreateOrderInputModel, OrderItemModel, OrderModel, UpdateOrderStatusInputModel, } from './order.schema';
@@ -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';