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