@contractspec/example.marketplace 3.7.6 → 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 +6 -6
@@ -9,71 +9,141 @@ var ProductStatusEnum = defineEnum("ProductStatus", [
9
9
  "REJECTED"
10
10
  ]);
11
11
 
12
- // src/product/product.schema.ts
12
+ // src/product/product.event.ts
13
+ import { defineEvent } from "@contractspec/lib.contracts-spec";
13
14
  import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
14
- var ProductModel = defineSchemaModel({
15
- name: "ProductModel",
16
- description: "A product listing",
15
+ var ProductCreatedPayload = defineSchemaModel({
16
+ name: "ProductCreatedEventPayload",
17
17
  fields: {
18
- id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
18
+ productId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
19
19
  storeId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
20
20
  name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
21
- slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
22
- description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
23
- status: { type: ProductStatusEnum, isOptional: false },
24
21
  price: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
25
22
  currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
26
- quantity: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
27
- categoryId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
23
+ timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: false }
24
+ }
25
+ });
26
+ var ProductPublishedPayload = defineSchemaModel({
27
+ name: "ProductPublishedEventPayload",
28
+ fields: {
29
+ productId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
30
+ storeId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
31
+ timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: false }
32
+ }
33
+ });
34
+ var InventoryUpdatedPayload = defineSchemaModel({
35
+ name: "InventoryUpdatedEventPayload",
36
+ fields: {
37
+ productId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
38
+ variantId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
39
+ previousQuantity: {
40
+ type: ScalarTypeEnum.Int_unsecure(),
41
+ isOptional: false
42
+ },
43
+ newQuantity: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
44
+ reason: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
45
+ timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: false }
46
+ }
47
+ });
48
+ var ProductCreatedEvent = defineEvent({
49
+ meta: {
50
+ key: "marketplace.product.created",
51
+ version: "1.0.0",
52
+ description: "A new product has been created.",
53
+ stability: "experimental",
54
+ owners: ["@marketplace-team"],
55
+ tags: ["marketplace", "product"]
56
+ },
57
+ payload: ProductCreatedPayload
58
+ });
59
+ var ProductPublishedEvent = defineEvent({
60
+ meta: {
61
+ key: "marketplace.product.published",
62
+ version: "1.0.0",
63
+ description: "A product has been published.",
64
+ stability: "experimental",
65
+ owners: ["@marketplace-team"],
66
+ tags: ["marketplace", "product"]
67
+ },
68
+ payload: ProductPublishedPayload
69
+ });
70
+ var InventoryUpdatedEvent = defineEvent({
71
+ meta: {
72
+ key: "marketplace.inventory.updated",
73
+ version: "1.0.0",
74
+ description: "Product inventory has been updated.",
75
+ stability: "experimental",
76
+ owners: ["@marketplace-team"],
77
+ tags: ["marketplace", "product", "inventory"]
78
+ },
79
+ payload: InventoryUpdatedPayload
80
+ });
81
+
82
+ // src/product/product.schema.ts
83
+ import { defineSchemaModel as defineSchemaModel2, ScalarTypeEnum as ScalarTypeEnum2 } from "@contractspec/lib.schema";
84
+ var ProductModel = defineSchemaModel2({
85
+ name: "ProductModel",
86
+ description: "A product listing",
87
+ fields: {
88
+ id: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
89
+ storeId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
90
+ name: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
91
+ slug: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
92
+ description: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
93
+ status: { type: ProductStatusEnum, isOptional: false },
94
+ price: { type: ScalarTypeEnum2.Float_unsecure(), isOptional: false },
95
+ currency: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
96
+ quantity: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: false },
97
+ categoryId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
28
98
  primaryImageId: {
29
- type: ScalarTypeEnum.String_unsecure(),
99
+ type: ScalarTypeEnum2.String_unsecure(),
30
100
  isOptional: true
31
101
  },
32
- averageRating: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
33
- totalSold: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
34
- createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
102
+ averageRating: { type: ScalarTypeEnum2.Float_unsecure(), isOptional: false },
103
+ totalSold: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: false },
104
+ createdAt: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
35
105
  }
36
106
  });
37
- var CreateProductInputModel = defineSchemaModel({
107
+ var CreateProductInputModel = defineSchemaModel2({
38
108
  name: "CreateProductInput",
39
109
  fields: {
40
- storeId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
41
- name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
42
- slug: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
43
- description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
44
- price: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
45
- currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
46
- quantity: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
47
- categoryId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
48
- sku: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
110
+ storeId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
111
+ name: { type: ScalarTypeEnum2.NonEmptyString(), isOptional: false },
112
+ slug: { type: ScalarTypeEnum2.NonEmptyString(), isOptional: false },
113
+ description: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
114
+ price: { type: ScalarTypeEnum2.Float_unsecure(), isOptional: false },
115
+ currency: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
116
+ quantity: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: true },
117
+ categoryId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
118
+ sku: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true }
49
119
  }
50
120
  });
51
- var ListProductsInputModel = defineSchemaModel({
121
+ var ListProductsInputModel = defineSchemaModel2({
52
122
  name: "ListProductsInput",
53
123
  fields: {
54
- storeId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
55
- categoryId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
124
+ storeId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
125
+ categoryId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
56
126
  status: { type: ProductStatusEnum, isOptional: true },
57
- search: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
58
- minPrice: { type: ScalarTypeEnum.Float_unsecure(), isOptional: true },
59
- maxPrice: { type: ScalarTypeEnum.Float_unsecure(), isOptional: true },
127
+ search: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
128
+ minPrice: { type: ScalarTypeEnum2.Float_unsecure(), isOptional: true },
129
+ maxPrice: { type: ScalarTypeEnum2.Float_unsecure(), isOptional: true },
60
130
  limit: {
61
- type: ScalarTypeEnum.Int_unsecure(),
131
+ type: ScalarTypeEnum2.Int_unsecure(),
62
132
  isOptional: true,
63
133
  defaultValue: 20
64
134
  },
65
135
  offset: {
66
- type: ScalarTypeEnum.Int_unsecure(),
136
+ type: ScalarTypeEnum2.Int_unsecure(),
67
137
  isOptional: true,
68
138
  defaultValue: 0
69
139
  }
70
140
  }
71
141
  });
72
- var ListProductsOutputModel = defineSchemaModel({
142
+ var ListProductsOutputModel = defineSchemaModel2({
73
143
  name: "ListProductsOutput",
74
144
  fields: {
75
145
  products: { type: ProductModel, isArray: true, isOptional: false },
76
- total: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false }
146
+ total: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: false }
77
147
  }
78
148
  });
79
149
 
@@ -165,76 +235,6 @@ var ListProductsContract = defineQuery({
165
235
  ]
166
236
  }
167
237
  });
168
-
169
- // src/product/product.event.ts
170
- import { ScalarTypeEnum as ScalarTypeEnum2, defineSchemaModel as defineSchemaModel2 } from "@contractspec/lib.schema";
171
- import { defineEvent } from "@contractspec/lib.contracts-spec";
172
- var ProductCreatedPayload = defineSchemaModel2({
173
- name: "ProductCreatedEventPayload",
174
- fields: {
175
- productId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
176
- storeId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
177
- name: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
178
- price: { type: ScalarTypeEnum2.Float_unsecure(), isOptional: false },
179
- currency: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
180
- timestamp: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
181
- }
182
- });
183
- var ProductPublishedPayload = defineSchemaModel2({
184
- name: "ProductPublishedEventPayload",
185
- fields: {
186
- productId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
187
- storeId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
188
- timestamp: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
189
- }
190
- });
191
- var InventoryUpdatedPayload = defineSchemaModel2({
192
- name: "InventoryUpdatedEventPayload",
193
- fields: {
194
- productId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
195
- variantId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
196
- previousQuantity: {
197
- type: ScalarTypeEnum2.Int_unsecure(),
198
- isOptional: false
199
- },
200
- newQuantity: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: false },
201
- reason: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
202
- timestamp: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
203
- }
204
- });
205
- var ProductCreatedEvent = defineEvent({
206
- meta: {
207
- key: "marketplace.product.created",
208
- version: "1.0.0",
209
- description: "A new product has been created.",
210
- stability: "experimental",
211
- owners: ["@marketplace-team"],
212
- tags: ["marketplace", "product"]
213
- },
214
- payload: ProductCreatedPayload
215
- });
216
- var ProductPublishedEvent = defineEvent({
217
- meta: {
218
- key: "marketplace.product.published",
219
- version: "1.0.0",
220
- description: "A product has been published.",
221
- stability: "experimental",
222
- owners: ["@marketplace-team"],
223
- tags: ["marketplace", "product"]
224
- },
225
- payload: ProductPublishedPayload
226
- });
227
- var InventoryUpdatedEvent = defineEvent({
228
- meta: {
229
- key: "marketplace.inventory.updated",
230
- version: "1.0.0",
231
- description: "Product inventory has been updated.",
232
- stability: "experimental",
233
- owners: ["@marketplace-team"],
234
- tags: ["marketplace", "product", "inventory"]
235
- },
236
- payload: InventoryUpdatedPayload
237
- });
238
238
  export {
239
239
  ProductStatusEnum,
240
240
  ProductPublishedEvent,
@@ -1,6 +1,6 @@
1
1
  // src/product/product.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 ProductCreatedPayload = defineSchemaModel({
5
5
  name: "ProductCreatedEventPayload",
6
6
  fields: {
@@ -7,63 +7,110 @@ var ReviewStatusEnum = defineEnum("ReviewStatus", [
7
7
  "FLAGGED"
8
8
  ]);
9
9
 
10
- // src/review/review.schema.ts
10
+ // src/review/review.event.ts
11
+ import { defineEvent } from "@contractspec/lib.contracts-spec";
11
12
  import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
12
- var ReviewModel = defineSchemaModel({
13
- name: "ReviewModel",
14
- description: "A customer review",
13
+ var ReviewCreatedPayload = defineSchemaModel({
14
+ name: "ReviewCreatedEventPayload",
15
15
  fields: {
16
- id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
16
+ reviewId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
17
17
  productId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
18
18
  storeId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
19
19
  authorId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
20
20
  rating: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
21
- title: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
22
- content: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
23
- status: { type: ReviewStatusEnum, isOptional: false },
24
21
  isVerifiedPurchase: { type: ScalarTypeEnum.Boolean(), isOptional: false },
25
- helpfulCount: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
26
- hasResponse: { type: ScalarTypeEnum.Boolean(), isOptional: false },
27
- createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
22
+ timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: false }
23
+ }
24
+ });
25
+ var ReviewRespondedPayload = defineSchemaModel({
26
+ name: "ReviewRespondedEventPayload",
27
+ fields: {
28
+ reviewId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
29
+ responseId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
30
+ authorId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
31
+ timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: false }
32
+ }
33
+ });
34
+ var ReviewCreatedEvent = defineEvent({
35
+ meta: {
36
+ key: "marketplace.review.created",
37
+ version: "1.0.0",
38
+ description: "A review has been created.",
39
+ stability: "experimental",
40
+ owners: ["@marketplace-team"],
41
+ tags: ["marketplace", "review"]
42
+ },
43
+ payload: ReviewCreatedPayload
44
+ });
45
+ var ReviewRespondedEvent = defineEvent({
46
+ meta: {
47
+ key: "marketplace.review.responded",
48
+ version: "1.0.0",
49
+ description: "A seller has responded to a review.",
50
+ stability: "experimental",
51
+ owners: ["@marketplace-team"],
52
+ tags: ["marketplace", "review"]
53
+ },
54
+ payload: ReviewRespondedPayload
55
+ });
56
+
57
+ // src/review/review.schema.ts
58
+ import { defineSchemaModel as defineSchemaModel2, ScalarTypeEnum as ScalarTypeEnum2 } from "@contractspec/lib.schema";
59
+ var ReviewModel = defineSchemaModel2({
60
+ name: "ReviewModel",
61
+ description: "A customer review",
62
+ fields: {
63
+ id: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
64
+ productId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
65
+ storeId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
66
+ authorId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
67
+ rating: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: false },
68
+ title: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
69
+ content: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
70
+ status: { type: ReviewStatusEnum, isOptional: false },
71
+ isVerifiedPurchase: { type: ScalarTypeEnum2.Boolean(), isOptional: false },
72
+ helpfulCount: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: false },
73
+ hasResponse: { type: ScalarTypeEnum2.Boolean(), isOptional: false },
74
+ createdAt: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
28
75
  }
29
76
  });
30
- var CreateReviewInputModel = defineSchemaModel({
77
+ var CreateReviewInputModel = defineSchemaModel2({
31
78
  name: "CreateReviewInput",
32
79
  fields: {
33
- productId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
34
- storeId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
35
- orderId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
36
- rating: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
37
- title: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
38
- content: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
80
+ productId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
81
+ storeId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
82
+ orderId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
83
+ rating: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: false },
84
+ title: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
85
+ content: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true }
39
86
  }
40
87
  });
41
- var ListReviewsInputModel = defineSchemaModel({
88
+ var ListReviewsInputModel = defineSchemaModel2({
42
89
  name: "ListReviewsInput",
43
90
  fields: {
44
- productId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
45
- storeId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
91
+ productId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
92
+ storeId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
46
93
  status: { type: ReviewStatusEnum, isOptional: true },
47
- minRating: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
94
+ minRating: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: true },
48
95
  limit: {
49
- type: ScalarTypeEnum.Int_unsecure(),
96
+ type: ScalarTypeEnum2.Int_unsecure(),
50
97
  isOptional: true,
51
98
  defaultValue: 20
52
99
  },
53
100
  offset: {
54
- type: ScalarTypeEnum.Int_unsecure(),
101
+ type: ScalarTypeEnum2.Int_unsecure(),
55
102
  isOptional: true,
56
103
  defaultValue: 0
57
104
  }
58
105
  }
59
106
  });
60
- var ListReviewsOutputModel = defineSchemaModel({
107
+ var ListReviewsOutputModel = defineSchemaModel2({
61
108
  name: "ListReviewsOutput",
62
109
  fields: {
63
110
  reviews: { type: ReviewModel, isArray: true, isOptional: false },
64
- total: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
65
- averageRating: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
66
- ratingDistribution: { type: ScalarTypeEnum.JSON(), isOptional: false }
111
+ total: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: false },
112
+ averageRating: { type: ScalarTypeEnum2.Float_unsecure(), isOptional: false },
113
+ ratingDistribution: { type: ScalarTypeEnum2.JSON(), isOptional: false }
67
114
  }
68
115
  });
69
116
 
@@ -146,53 +193,6 @@ var ListReviewsContract = defineQuery({
146
193
  ]
147
194
  }
148
195
  });
149
-
150
- // src/review/review.event.ts
151
- import { ScalarTypeEnum as ScalarTypeEnum2, defineSchemaModel as defineSchemaModel2 } from "@contractspec/lib.schema";
152
- import { defineEvent } from "@contractspec/lib.contracts-spec";
153
- var ReviewCreatedPayload = defineSchemaModel2({
154
- name: "ReviewCreatedEventPayload",
155
- fields: {
156
- reviewId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
157
- productId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
158
- storeId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
159
- authorId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
160
- rating: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: false },
161
- isVerifiedPurchase: { type: ScalarTypeEnum2.Boolean(), isOptional: false },
162
- timestamp: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
163
- }
164
- });
165
- var ReviewRespondedPayload = defineSchemaModel2({
166
- name: "ReviewRespondedEventPayload",
167
- fields: {
168
- reviewId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
169
- responseId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
170
- authorId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
171
- timestamp: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
172
- }
173
- });
174
- var ReviewCreatedEvent = defineEvent({
175
- meta: {
176
- key: "marketplace.review.created",
177
- version: "1.0.0",
178
- description: "A review has been created.",
179
- stability: "experimental",
180
- owners: ["@marketplace-team"],
181
- tags: ["marketplace", "review"]
182
- },
183
- payload: ReviewCreatedPayload
184
- });
185
- var ReviewRespondedEvent = defineEvent({
186
- meta: {
187
- key: "marketplace.review.responded",
188
- version: "1.0.0",
189
- description: "A seller has responded to a review.",
190
- stability: "experimental",
191
- owners: ["@marketplace-team"],
192
- tags: ["marketplace", "review"]
193
- },
194
- payload: ReviewRespondedPayload
195
- });
196
196
  export {
197
197
  ReviewStatusEnum,
198
198
  ReviewRespondedEvent,
@@ -1,6 +1,6 @@
1
1
  // src/review/review.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 ReviewCreatedPayload = defineSchemaModel({
5
5
  name: "ReviewCreatedEventPayload",
6
6
  fields: {
@@ -7,34 +7,83 @@ var StoreStatusEnum = defineEnum("StoreStatus", [
7
7
  "CLOSED"
8
8
  ]);
9
9
 
10
- // src/store/store.schema.ts
10
+ // src/store/store.event.ts
11
+ import { defineEvent } from "@contractspec/lib.contracts-spec";
11
12
  import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
12
- var StoreModel = defineSchemaModel({
13
- name: "StoreModel",
14
- description: "A seller store",
13
+ var StoreCreatedPayload = defineSchemaModel({
14
+ name: "StoreCreatedEventPayload",
15
15
  fields: {
16
- id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
16
+ storeId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
17
17
  name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
18
18
  slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
19
- description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
20
- status: { type: StoreStatusEnum, isOptional: false },
21
19
  ownerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
22
- logoFileId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
23
- isVerified: { type: ScalarTypeEnum.Boolean(), isOptional: false },
24
- totalProducts: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
25
- averageRating: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
26
- createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
20
+ timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: false }
21
+ }
22
+ });
23
+ var StoreStatusChangedPayload = defineSchemaModel({
24
+ name: "StoreStatusChangedEventPayload",
25
+ fields: {
26
+ storeId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
27
+ previousStatus: {
28
+ type: ScalarTypeEnum.String_unsecure(),
29
+ isOptional: false
30
+ },
31
+ newStatus: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
32
+ reason: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
33
+ timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: false }
34
+ }
35
+ });
36
+ var StoreCreatedEvent = defineEvent({
37
+ meta: {
38
+ key: "marketplace.store.created",
39
+ version: "1.0.0",
40
+ description: "A new seller store has been created.",
41
+ stability: "experimental",
42
+ owners: ["@marketplace-team"],
43
+ tags: ["marketplace", "store"]
44
+ },
45
+ payload: StoreCreatedPayload
46
+ });
47
+ var StoreStatusChangedEvent = defineEvent({
48
+ meta: {
49
+ key: "marketplace.store.statusChanged",
50
+ version: "1.0.0",
51
+ description: "A store status has changed.",
52
+ stability: "experimental",
53
+ owners: ["@marketplace-team"],
54
+ tags: ["marketplace", "store"]
55
+ },
56
+ payload: StoreStatusChangedPayload
57
+ });
58
+
59
+ // src/store/store.schema.ts
60
+ import { defineSchemaModel as defineSchemaModel2, ScalarTypeEnum as ScalarTypeEnum2 } from "@contractspec/lib.schema";
61
+ var StoreModel = defineSchemaModel2({
62
+ name: "StoreModel",
63
+ description: "A seller store",
64
+ fields: {
65
+ id: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
66
+ name: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
67
+ slug: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
68
+ description: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
69
+ status: { type: StoreStatusEnum, isOptional: false },
70
+ ownerId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
71
+ logoFileId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
72
+ isVerified: { type: ScalarTypeEnum2.Boolean(), isOptional: false },
73
+ totalProducts: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: false },
74
+ averageRating: { type: ScalarTypeEnum2.Float_unsecure(), isOptional: false },
75
+ createdAt: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
27
76
  }
28
77
  });
29
- var CreateStoreInputModel = defineSchemaModel({
78
+ var CreateStoreInputModel = defineSchemaModel2({
30
79
  name: "CreateStoreInput",
31
80
  fields: {
32
- name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
33
- slug: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
34
- description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
35
- email: { type: ScalarTypeEnum.EmailAddress(), isOptional: true },
36
- country: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
37
- currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
81
+ name: { type: ScalarTypeEnum2.NonEmptyString(), isOptional: false },
82
+ slug: { type: ScalarTypeEnum2.NonEmptyString(), isOptional: false },
83
+ description: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
84
+ email: { type: ScalarTypeEnum2.EmailAddress(), isOptional: true },
85
+ country: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
86
+ currency: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true }
38
87
  }
39
88
  });
40
89
 
@@ -83,55 +132,6 @@ var CreateStoreContract = defineCommand({
83
132
  ]
84
133
  }
85
134
  });
86
-
87
- // src/store/store.event.ts
88
- import { ScalarTypeEnum as ScalarTypeEnum2, defineSchemaModel as defineSchemaModel2 } from "@contractspec/lib.schema";
89
- import { defineEvent } from "@contractspec/lib.contracts-spec";
90
- var StoreCreatedPayload = defineSchemaModel2({
91
- name: "StoreCreatedEventPayload",
92
- fields: {
93
- storeId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
94
- name: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
95
- slug: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
96
- ownerId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
97
- timestamp: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
98
- }
99
- });
100
- var StoreStatusChangedPayload = defineSchemaModel2({
101
- name: "StoreStatusChangedEventPayload",
102
- fields: {
103
- storeId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
104
- previousStatus: {
105
- type: ScalarTypeEnum2.String_unsecure(),
106
- isOptional: false
107
- },
108
- newStatus: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
109
- reason: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
110
- timestamp: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
111
- }
112
- });
113
- var StoreCreatedEvent = defineEvent({
114
- meta: {
115
- key: "marketplace.store.created",
116
- version: "1.0.0",
117
- description: "A new seller store has been created.",
118
- stability: "experimental",
119
- owners: ["@marketplace-team"],
120
- tags: ["marketplace", "store"]
121
- },
122
- payload: StoreCreatedPayload
123
- });
124
- var StoreStatusChangedEvent = defineEvent({
125
- meta: {
126
- key: "marketplace.store.statusChanged",
127
- version: "1.0.0",
128
- description: "A store status has changed.",
129
- stability: "experimental",
130
- owners: ["@marketplace-team"],
131
- tags: ["marketplace", "store"]
132
- },
133
- payload: StoreStatusChangedPayload
134
- });
135
135
  export {
136
136
  StoreStatusEnum,
137
137
  StoreStatusChangedEvent,
@@ -1,6 +1,6 @@
1
1
  // src/store/store.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 StoreCreatedPayload = defineSchemaModel({
5
5
  name: "StoreCreatedEventPayload",
6
6
  fields: {