@contractspec/example.marketplace 0.0.0-canary-20260113170453
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.
- package/LICENSE +21 -0
- package/README.md +141 -0
- package/dist/docs/index.d.ts +1 -0
- package/dist/docs/index.js +1 -0
- package/dist/docs/marketplace.docblock.d.ts +1 -0
- package/dist/docs/marketplace.docblock.js +115 -0
- package/dist/docs/marketplace.docblock.js.map +1 -0
- package/dist/entities/index.d.ts +309 -0
- package/dist/entities/index.d.ts.map +1 -0
- package/dist/entities/index.js +46 -0
- package/dist/entities/index.js.map +1 -0
- package/dist/entities/order.d.ts +105 -0
- package/dist/entities/order.d.ts.map +1 -0
- package/dist/entities/order.js +173 -0
- package/dist/entities/order.js.map +1 -0
- package/dist/entities/payout.d.ts +92 -0
- package/dist/entities/payout.d.ts.map +1 -0
- package/dist/entities/payout.js +162 -0
- package/dist/entities/payout.js.map +1 -0
- package/dist/entities/product.d.ts +93 -0
- package/dist/entities/product.d.ts.map +1 -0
- package/dist/entities/product.js +161 -0
- package/dist/entities/product.js.map +1 -0
- package/dist/entities/review.d.ts +83 -0
- package/dist/entities/review.d.ts.map +1 -0
- package/dist/entities/review.js +152 -0
- package/dist/entities/review.js.map +1 -0
- package/dist/entities/store.d.ts +60 -0
- package/dist/entities/store.d.ts.map +1 -0
- package/dist/entities/store.js +110 -0
- package/dist/entities/store.js.map +1 -0
- package/dist/example.d.ts +7 -0
- package/dist/example.d.ts.map +1 -0
- package/dist/example.js +58 -0
- package/dist/example.js.map +1 -0
- package/dist/handlers/index.d.ts +2 -0
- package/dist/handlers/index.js +3 -0
- package/dist/handlers/marketplace.handlers.d.ts +155 -0
- package/dist/handlers/marketplace.handlers.d.ts.map +1 -0
- package/dist/handlers/marketplace.handlers.js +329 -0
- package/dist/handlers/marketplace.handlers.js.map +1 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.js +32 -0
- package/dist/marketplace.capability.d.ts +9 -0
- package/dist/marketplace.capability.d.ts.map +1 -0
- package/dist/marketplace.capability.js +34 -0
- package/dist/marketplace.capability.js.map +1 -0
- package/dist/marketplace.feature.d.ts +12 -0
- package/dist/marketplace.feature.d.ts.map +1 -0
- package/dist/marketplace.feature.js +315 -0
- package/dist/marketplace.feature.js.map +1 -0
- package/dist/order/index.d.ts +5 -0
- package/dist/order/index.js +6 -0
- package/dist/order/order.enum.d.ts +10 -0
- package/dist/order/order.enum.d.ts.map +1 -0
- package/dist/order/order.enum.js +22 -0
- package/dist/order/order.enum.js.map +1 -0
- package/dist/order/order.event.d.ts +145 -0
- package/dist/order/order.event.d.ts.map +1 -0
- package/dist/order/order.event.js +216 -0
- package/dist/order/order.event.js.map +1 -0
- package/dist/order/order.operations.d.ts +368 -0
- package/dist/order/order.operations.d.ts.map +1 -0
- package/dist/order/order.operations.js +119 -0
- package/dist/order/order.operations.js.map +1 -0
- package/dist/order/order.presentation.d.ts +9 -0
- package/dist/order/order.presentation.d.ts.map +1 -0
- package/dist/order/order.presentation.js +86 -0
- package/dist/order/order.presentation.js.map +1 -0
- package/dist/order/order.schema.d.ts +165 -0
- package/dist/order/order.schema.d.ts.map +1 -0
- package/dist/order/order.schema.js +155 -0
- package/dist/order/order.schema.js.map +1 -0
- package/dist/payout/index.d.ts +5 -0
- package/dist/payout/index.js +6 -0
- package/dist/payout/payout.enum.d.ts +10 -0
- package/dist/payout/payout.enum.d.ts.map +1 -0
- package/dist/payout/payout.enum.js +17 -0
- package/dist/payout/payout.enum.js.map +1 -0
- package/dist/payout/payout.event.d.ts +63 -0
- package/dist/payout/payout.event.d.ts.map +1 -0
- package/dist/payout/payout.event.js +92 -0
- package/dist/payout/payout.event.js.map +1 -0
- package/dist/payout/payout.operations.d.ts +97 -0
- package/dist/payout/payout.operations.d.ts.map +1 -0
- package/dist/payout/payout.operations.js +53 -0
- package/dist/payout/payout.operations.js.map +1 -0
- package/dist/payout/payout.presentation.d.ts +8 -0
- package/dist/payout/payout.presentation.d.ts.map +1 -0
- package/dist/payout/payout.presentation.js +60 -0
- package/dist/payout/payout.presentation.js.map +1 -0
- package/dist/payout/payout.schema.d.ts +157 -0
- package/dist/payout/payout.schema.d.ts.map +1 -0
- package/dist/payout/payout.schema.js +116 -0
- package/dist/payout/payout.schema.js.map +1 -0
- package/dist/product/index.d.ts +5 -0
- package/dist/product/index.js +6 -0
- package/dist/product/product.enum.d.ts +10 -0
- package/dist/product/product.enum.d.ts.map +1 -0
- package/dist/product/product.enum.js +18 -0
- package/dist/product/product.enum.js.map +1 -0
- package/dist/product/product.event.d.ts +73 -0
- package/dist/product/product.event.d.ts.map +1 -0
- package/dist/product/product.event.js +120 -0
- package/dist/product/product.event.js.map +1 -0
- package/dist/product/product.operations.d.ts +273 -0
- package/dist/product/product.operations.d.ts.map +1 -0
- package/dist/product/product.operations.js +108 -0
- package/dist/product/product.operations.js.map +1 -0
- package/dist/product/product.presentation.d.ts +9 -0
- package/dist/product/product.presentation.d.ts.map +1 -0
- package/dist/product/product.presentation.js +86 -0
- package/dist/product/product.presentation.js.map +1 -0
- package/dist/product/product.schema.d.ts +218 -0
- package/dist/product/product.schema.d.ts.map +1 -0
- package/dist/product/product.schema.js +176 -0
- package/dist/product/product.schema.js.map +1 -0
- package/dist/review/index.d.ts +5 -0
- package/dist/review/index.js +6 -0
- package/dist/review/review.enum.d.ts +10 -0
- package/dist/review/review.enum.d.ts.map +1 -0
- package/dist/review/review.enum.js +16 -0
- package/dist/review/review.enum.js.map +1 -0
- package/dist/review/review.event.d.ts +55 -0
- package/dist/review/review.event.d.ts.map +1 -0
- package/dist/review/review.event.js +84 -0
- package/dist/review/review.event.js.map +1 -0
- package/dist/review/review.operations.d.ts +237 -0
- package/dist/review/review.operations.d.ts.map +1 -0
- package/dist/review/review.operations.js +106 -0
- package/dist/review/review.operations.js.map +1 -0
- package/dist/review/review.presentation.d.ts +8 -0
- package/dist/review/review.presentation.d.ts.map +1 -0
- package/dist/review/review.presentation.js +60 -0
- package/dist/review/review.presentation.js.map +1 -0
- package/dist/review/review.schema.d.ts +190 -0
- package/dist/review/review.schema.d.ts.map +1 -0
- package/dist/review/review.schema.js +156 -0
- package/dist/review/review.schema.js.map +1 -0
- package/dist/seeders/index.d.ts +10 -0
- package/dist/seeders/index.d.ts.map +1 -0
- package/dist/seeders/index.js +18 -0
- package/dist/seeders/index.js.map +1 -0
- package/dist/store/index.d.ts +5 -0
- package/dist/store/index.js +6 -0
- package/dist/store/store.enum.d.ts +10 -0
- package/dist/store/store.enum.d.ts.map +1 -0
- package/dist/store/store.enum.js +16 -0
- package/dist/store/store.enum.js.map +1 -0
- package/dist/store/store.event.d.ts +51 -0
- package/dist/store/store.event.d.ts.map +1 -0
- package/dist/store/store.event.js +80 -0
- package/dist/store/store.event.js.map +1 -0
- package/dist/store/store.operations.d.ts +131 -0
- package/dist/store/store.operations.d.ts.map +1 -0
- package/dist/store/store.operations.js +61 -0
- package/dist/store/store.operations.js.map +1 -0
- package/dist/store/store.presentation.d.ts +8 -0
- package/dist/store/store.presentation.d.ts.map +1 -0
- package/dist/store/store.presentation.js +60 -0
- package/dist/store/store.presentation.js.map +1 -0
- package/dist/store/store.schema.d.ts +84 -0
- package/dist/store/store.schema.d.ts.map +1 -0
- package/dist/store/store.schema.js +93 -0
- package/dist/store/store.schema.js.map +1 -0
- package/dist/tests/operations.test-spec.d.ts +11 -0
- package/dist/tests/operations.test-spec.d.ts.map +1 -0
- package/dist/tests/operations.test-spec.js +152 -0
- package/dist/tests/operations.test-spec.js.map +1 -0
- package/dist/ui/MarketplaceDashboard.d.ts +7 -0
- package/dist/ui/MarketplaceDashboard.d.ts.map +1 -0
- package/dist/ui/MarketplaceDashboard.js +319 -0
- package/dist/ui/MarketplaceDashboard.js.map +1 -0
- package/dist/ui/hooks/index.d.ts +2 -0
- package/dist/ui/hooks/index.js +5 -0
- package/dist/ui/hooks/useMarketplaceData.d.ts +23 -0
- package/dist/ui/hooks/useMarketplaceData.d.ts.map +1 -0
- package/dist/ui/hooks/useMarketplaceData.js +64 -0
- package/dist/ui/hooks/useMarketplaceData.js.map +1 -0
- package/dist/ui/index.d.ts +6 -0
- package/dist/ui/index.js +6 -0
- package/dist/ui/renderers/index.d.ts +2 -0
- package/dist/ui/renderers/index.js +3 -0
- package/dist/ui/renderers/marketplace.markdown.d.ts +28 -0
- package/dist/ui/renderers/marketplace.markdown.d.ts.map +1 -0
- package/dist/ui/renderers/marketplace.markdown.js +244 -0
- package/dist/ui/renderers/marketplace.markdown.js.map +1 -0
- package/package.json +149 -0
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import * as _contractspec_lib_schema445 from "@contractspec/lib.schema";
|
|
2
|
+
|
|
3
|
+
//#region src/review/review.schema.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* A customer review.
|
|
6
|
+
*/
|
|
7
|
+
declare const ReviewModel: _contractspec_lib_schema445.SchemaModel<{
|
|
8
|
+
id: {
|
|
9
|
+
type: _contractspec_lib_schema445.FieldType<string, string>;
|
|
10
|
+
isOptional: false;
|
|
11
|
+
};
|
|
12
|
+
productId: {
|
|
13
|
+
type: _contractspec_lib_schema445.FieldType<string, string>;
|
|
14
|
+
isOptional: true;
|
|
15
|
+
};
|
|
16
|
+
storeId: {
|
|
17
|
+
type: _contractspec_lib_schema445.FieldType<string, string>;
|
|
18
|
+
isOptional: true;
|
|
19
|
+
};
|
|
20
|
+
authorId: {
|
|
21
|
+
type: _contractspec_lib_schema445.FieldType<string, string>;
|
|
22
|
+
isOptional: false;
|
|
23
|
+
};
|
|
24
|
+
rating: {
|
|
25
|
+
type: _contractspec_lib_schema445.FieldType<number, number>;
|
|
26
|
+
isOptional: false;
|
|
27
|
+
};
|
|
28
|
+
title: {
|
|
29
|
+
type: _contractspec_lib_schema445.FieldType<string, string>;
|
|
30
|
+
isOptional: true;
|
|
31
|
+
};
|
|
32
|
+
content: {
|
|
33
|
+
type: _contractspec_lib_schema445.FieldType<string, string>;
|
|
34
|
+
isOptional: true;
|
|
35
|
+
};
|
|
36
|
+
status: {
|
|
37
|
+
type: _contractspec_lib_schema445.EnumType<[string, string, string, string]>;
|
|
38
|
+
isOptional: false;
|
|
39
|
+
};
|
|
40
|
+
isVerifiedPurchase: {
|
|
41
|
+
type: _contractspec_lib_schema445.FieldType<boolean, boolean>;
|
|
42
|
+
isOptional: false;
|
|
43
|
+
};
|
|
44
|
+
helpfulCount: {
|
|
45
|
+
type: _contractspec_lib_schema445.FieldType<number, number>;
|
|
46
|
+
isOptional: false;
|
|
47
|
+
};
|
|
48
|
+
hasResponse: {
|
|
49
|
+
type: _contractspec_lib_schema445.FieldType<boolean, boolean>;
|
|
50
|
+
isOptional: false;
|
|
51
|
+
};
|
|
52
|
+
createdAt: {
|
|
53
|
+
type: _contractspec_lib_schema445.FieldType<Date, string>;
|
|
54
|
+
isOptional: false;
|
|
55
|
+
};
|
|
56
|
+
}>;
|
|
57
|
+
/**
|
|
58
|
+
* Input for creating a review.
|
|
59
|
+
*/
|
|
60
|
+
declare const CreateReviewInputModel: _contractspec_lib_schema445.SchemaModel<{
|
|
61
|
+
productId: {
|
|
62
|
+
type: _contractspec_lib_schema445.FieldType<string, string>;
|
|
63
|
+
isOptional: true;
|
|
64
|
+
};
|
|
65
|
+
storeId: {
|
|
66
|
+
type: _contractspec_lib_schema445.FieldType<string, string>;
|
|
67
|
+
isOptional: true;
|
|
68
|
+
};
|
|
69
|
+
orderId: {
|
|
70
|
+
type: _contractspec_lib_schema445.FieldType<string, string>;
|
|
71
|
+
isOptional: true;
|
|
72
|
+
};
|
|
73
|
+
rating: {
|
|
74
|
+
type: _contractspec_lib_schema445.FieldType<number, number>;
|
|
75
|
+
isOptional: false;
|
|
76
|
+
};
|
|
77
|
+
title: {
|
|
78
|
+
type: _contractspec_lib_schema445.FieldType<string, string>;
|
|
79
|
+
isOptional: true;
|
|
80
|
+
};
|
|
81
|
+
content: {
|
|
82
|
+
type: _contractspec_lib_schema445.FieldType<string, string>;
|
|
83
|
+
isOptional: true;
|
|
84
|
+
};
|
|
85
|
+
}>;
|
|
86
|
+
/**
|
|
87
|
+
* Input for listing reviews.
|
|
88
|
+
*/
|
|
89
|
+
declare const ListReviewsInputModel: _contractspec_lib_schema445.SchemaModel<{
|
|
90
|
+
productId: {
|
|
91
|
+
type: _contractspec_lib_schema445.FieldType<string, string>;
|
|
92
|
+
isOptional: true;
|
|
93
|
+
};
|
|
94
|
+
storeId: {
|
|
95
|
+
type: _contractspec_lib_schema445.FieldType<string, string>;
|
|
96
|
+
isOptional: true;
|
|
97
|
+
};
|
|
98
|
+
status: {
|
|
99
|
+
type: _contractspec_lib_schema445.EnumType<[string, string, string, string]>;
|
|
100
|
+
isOptional: true;
|
|
101
|
+
};
|
|
102
|
+
minRating: {
|
|
103
|
+
type: _contractspec_lib_schema445.FieldType<number, number>;
|
|
104
|
+
isOptional: true;
|
|
105
|
+
};
|
|
106
|
+
limit: {
|
|
107
|
+
type: _contractspec_lib_schema445.FieldType<number, number>;
|
|
108
|
+
isOptional: true;
|
|
109
|
+
defaultValue: number;
|
|
110
|
+
};
|
|
111
|
+
offset: {
|
|
112
|
+
type: _contractspec_lib_schema445.FieldType<number, number>;
|
|
113
|
+
isOptional: true;
|
|
114
|
+
defaultValue: number;
|
|
115
|
+
};
|
|
116
|
+
}>;
|
|
117
|
+
/**
|
|
118
|
+
* Output for listing reviews.
|
|
119
|
+
*/
|
|
120
|
+
declare const ListReviewsOutputModel: _contractspec_lib_schema445.SchemaModel<{
|
|
121
|
+
reviews: {
|
|
122
|
+
type: _contractspec_lib_schema445.SchemaModel<{
|
|
123
|
+
id: {
|
|
124
|
+
type: _contractspec_lib_schema445.FieldType<string, string>;
|
|
125
|
+
isOptional: false;
|
|
126
|
+
};
|
|
127
|
+
productId: {
|
|
128
|
+
type: _contractspec_lib_schema445.FieldType<string, string>;
|
|
129
|
+
isOptional: true;
|
|
130
|
+
};
|
|
131
|
+
storeId: {
|
|
132
|
+
type: _contractspec_lib_schema445.FieldType<string, string>;
|
|
133
|
+
isOptional: true;
|
|
134
|
+
};
|
|
135
|
+
authorId: {
|
|
136
|
+
type: _contractspec_lib_schema445.FieldType<string, string>;
|
|
137
|
+
isOptional: false;
|
|
138
|
+
};
|
|
139
|
+
rating: {
|
|
140
|
+
type: _contractspec_lib_schema445.FieldType<number, number>;
|
|
141
|
+
isOptional: false;
|
|
142
|
+
};
|
|
143
|
+
title: {
|
|
144
|
+
type: _contractspec_lib_schema445.FieldType<string, string>;
|
|
145
|
+
isOptional: true;
|
|
146
|
+
};
|
|
147
|
+
content: {
|
|
148
|
+
type: _contractspec_lib_schema445.FieldType<string, string>;
|
|
149
|
+
isOptional: true;
|
|
150
|
+
};
|
|
151
|
+
status: {
|
|
152
|
+
type: _contractspec_lib_schema445.EnumType<[string, string, string, string]>;
|
|
153
|
+
isOptional: false;
|
|
154
|
+
};
|
|
155
|
+
isVerifiedPurchase: {
|
|
156
|
+
type: _contractspec_lib_schema445.FieldType<boolean, boolean>;
|
|
157
|
+
isOptional: false;
|
|
158
|
+
};
|
|
159
|
+
helpfulCount: {
|
|
160
|
+
type: _contractspec_lib_schema445.FieldType<number, number>;
|
|
161
|
+
isOptional: false;
|
|
162
|
+
};
|
|
163
|
+
hasResponse: {
|
|
164
|
+
type: _contractspec_lib_schema445.FieldType<boolean, boolean>;
|
|
165
|
+
isOptional: false;
|
|
166
|
+
};
|
|
167
|
+
createdAt: {
|
|
168
|
+
type: _contractspec_lib_schema445.FieldType<Date, string>;
|
|
169
|
+
isOptional: false;
|
|
170
|
+
};
|
|
171
|
+
}>;
|
|
172
|
+
isArray: true;
|
|
173
|
+
isOptional: false;
|
|
174
|
+
};
|
|
175
|
+
total: {
|
|
176
|
+
type: _contractspec_lib_schema445.FieldType<number, number>;
|
|
177
|
+
isOptional: false;
|
|
178
|
+
};
|
|
179
|
+
averageRating: {
|
|
180
|
+
type: _contractspec_lib_schema445.FieldType<number, number>;
|
|
181
|
+
isOptional: false;
|
|
182
|
+
};
|
|
183
|
+
ratingDistribution: {
|
|
184
|
+
type: _contractspec_lib_schema445.FieldType<unknown, unknown>;
|
|
185
|
+
isOptional: false;
|
|
186
|
+
};
|
|
187
|
+
}>;
|
|
188
|
+
//#endregion
|
|
189
|
+
export { CreateReviewInputModel, ListReviewsInputModel, ListReviewsOutputModel, ReviewModel };
|
|
190
|
+
//# sourceMappingURL=review.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review.schema.d.ts","names":[],"sources":["../../src/review/review.schema.ts"],"sourcesContent":[],"mappings":";;;;;;AAMa,cAAA,WAiBX,8BAjBsB,WAiBtB,CAAA;EAAA,EAAA,EAAA;UAAA,2BAAA,CAAA;;;;;;;;;;;;+CAjBsB,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;EAsBX,CAAA;EAUX,MAAA,EAAA;;;;;;;EAViC,CAAA;EAetB,OAAA,EAAA;IAkBX,IAAA,uCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;;;;;;;EAlBgC,kBAAA,EAAA;IAuBrB,IAAA,uCAQX,CAAA,OAAA,EAAA,OAAA,CAAA;IAAA,UAAA,EAAA,KAAA;;;;;;;;;;;;;;;;;;AARiC,cAtCtB,sBAsCsB,8BAtCA,WAsCA,CAAA;;UA5BjC,2BAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;cAKW,mDAAqB;;UAkBhC,2BAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAKW,oDAAsB;;;;cAQjC,2BAAA,CAAA"}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { ReviewStatusEnum } from "./review.enum.js";
|
|
2
|
+
import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
|
|
3
|
+
|
|
4
|
+
//#region src/review/review.schema.ts
|
|
5
|
+
/**
|
|
6
|
+
* A customer review.
|
|
7
|
+
*/
|
|
8
|
+
const ReviewModel = defineSchemaModel({
|
|
9
|
+
name: "ReviewModel",
|
|
10
|
+
description: "A customer review",
|
|
11
|
+
fields: {
|
|
12
|
+
id: {
|
|
13
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
14
|
+
isOptional: false
|
|
15
|
+
},
|
|
16
|
+
productId: {
|
|
17
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
18
|
+
isOptional: true
|
|
19
|
+
},
|
|
20
|
+
storeId: {
|
|
21
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
22
|
+
isOptional: true
|
|
23
|
+
},
|
|
24
|
+
authorId: {
|
|
25
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
26
|
+
isOptional: false
|
|
27
|
+
},
|
|
28
|
+
rating: {
|
|
29
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
30
|
+
isOptional: false
|
|
31
|
+
},
|
|
32
|
+
title: {
|
|
33
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
34
|
+
isOptional: true
|
|
35
|
+
},
|
|
36
|
+
content: {
|
|
37
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
38
|
+
isOptional: true
|
|
39
|
+
},
|
|
40
|
+
status: {
|
|
41
|
+
type: ReviewStatusEnum,
|
|
42
|
+
isOptional: false
|
|
43
|
+
},
|
|
44
|
+
isVerifiedPurchase: {
|
|
45
|
+
type: ScalarTypeEnum.Boolean(),
|
|
46
|
+
isOptional: false
|
|
47
|
+
},
|
|
48
|
+
helpfulCount: {
|
|
49
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
50
|
+
isOptional: false
|
|
51
|
+
},
|
|
52
|
+
hasResponse: {
|
|
53
|
+
type: ScalarTypeEnum.Boolean(),
|
|
54
|
+
isOptional: false
|
|
55
|
+
},
|
|
56
|
+
createdAt: {
|
|
57
|
+
type: ScalarTypeEnum.DateTime(),
|
|
58
|
+
isOptional: false
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
/**
|
|
63
|
+
* Input for creating a review.
|
|
64
|
+
*/
|
|
65
|
+
const CreateReviewInputModel = defineSchemaModel({
|
|
66
|
+
name: "CreateReviewInput",
|
|
67
|
+
fields: {
|
|
68
|
+
productId: {
|
|
69
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
70
|
+
isOptional: true
|
|
71
|
+
},
|
|
72
|
+
storeId: {
|
|
73
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
74
|
+
isOptional: true
|
|
75
|
+
},
|
|
76
|
+
orderId: {
|
|
77
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
78
|
+
isOptional: true
|
|
79
|
+
},
|
|
80
|
+
rating: {
|
|
81
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
82
|
+
isOptional: false
|
|
83
|
+
},
|
|
84
|
+
title: {
|
|
85
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
86
|
+
isOptional: true
|
|
87
|
+
},
|
|
88
|
+
content: {
|
|
89
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
90
|
+
isOptional: true
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
/**
|
|
95
|
+
* Input for listing reviews.
|
|
96
|
+
*/
|
|
97
|
+
const ListReviewsInputModel = defineSchemaModel({
|
|
98
|
+
name: "ListReviewsInput",
|
|
99
|
+
fields: {
|
|
100
|
+
productId: {
|
|
101
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
102
|
+
isOptional: true
|
|
103
|
+
},
|
|
104
|
+
storeId: {
|
|
105
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
106
|
+
isOptional: true
|
|
107
|
+
},
|
|
108
|
+
status: {
|
|
109
|
+
type: ReviewStatusEnum,
|
|
110
|
+
isOptional: true
|
|
111
|
+
},
|
|
112
|
+
minRating: {
|
|
113
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
114
|
+
isOptional: true
|
|
115
|
+
},
|
|
116
|
+
limit: {
|
|
117
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
118
|
+
isOptional: true,
|
|
119
|
+
defaultValue: 20
|
|
120
|
+
},
|
|
121
|
+
offset: {
|
|
122
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
123
|
+
isOptional: true,
|
|
124
|
+
defaultValue: 0
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
/**
|
|
129
|
+
* Output for listing reviews.
|
|
130
|
+
*/
|
|
131
|
+
const ListReviewsOutputModel = defineSchemaModel({
|
|
132
|
+
name: "ListReviewsOutput",
|
|
133
|
+
fields: {
|
|
134
|
+
reviews: {
|
|
135
|
+
type: ReviewModel,
|
|
136
|
+
isArray: true,
|
|
137
|
+
isOptional: false
|
|
138
|
+
},
|
|
139
|
+
total: {
|
|
140
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
141
|
+
isOptional: false
|
|
142
|
+
},
|
|
143
|
+
averageRating: {
|
|
144
|
+
type: ScalarTypeEnum.Float_unsecure(),
|
|
145
|
+
isOptional: false
|
|
146
|
+
},
|
|
147
|
+
ratingDistribution: {
|
|
148
|
+
type: ScalarTypeEnum.JSON(),
|
|
149
|
+
isOptional: false
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
//#endregion
|
|
155
|
+
export { CreateReviewInputModel, ListReviewsInputModel, ListReviewsOutputModel, ReviewModel };
|
|
156
|
+
//# sourceMappingURL=review.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review.schema.js","names":[],"sources":["../../src/review/review.schema.ts"],"sourcesContent":["import { defineSchemaModel, ScalarTypeEnum } from '@contractspec/lib.schema';\nimport { ReviewStatusEnum } from './review.enum';\n\n/**\n * A customer review.\n */\nexport const ReviewModel = defineSchemaModel({\n name: 'ReviewModel',\n description: 'A customer review',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n productId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n storeId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n authorId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n rating: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n title: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n content: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n status: { type: ReviewStatusEnum, isOptional: false },\n isVerifiedPurchase: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n helpfulCount: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n hasResponse: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\n/**\n * Input for creating a review.\n */\nexport const CreateReviewInputModel = defineSchemaModel({\n name: 'CreateReviewInput',\n fields: {\n productId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n storeId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n orderId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n rating: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n title: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n content: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n },\n});\n\n/**\n * Input for listing reviews.\n */\nexport const ListReviewsInputModel = defineSchemaModel({\n name: 'ListReviewsInput',\n fields: {\n productId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n storeId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n status: { type: ReviewStatusEnum, isOptional: true },\n minRating: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n limit: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: true,\n defaultValue: 20,\n },\n offset: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: true,\n defaultValue: 0,\n },\n },\n});\n\n/**\n * Output for listing reviews.\n */\nexport const ListReviewsOutputModel = defineSchemaModel({\n name: 'ListReviewsOutput',\n fields: {\n reviews: { type: ReviewModel, isArray: true, isOptional: false },\n total: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n averageRating: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },\n ratingDistribution: { type: ScalarTypeEnum.JSON(), isOptional: false },\n },\n});\n"],"mappings":";;;;;;;AAMA,MAAa,cAAc,kBAAkB;CAC3C,MAAM;CACN,aAAa;CACb,QAAQ;EACN,IAAI;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACjE,WAAW;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACvE,SAAS;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACrE,UAAU;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACvE,QAAQ;GAAE,MAAM,eAAe,cAAc;GAAE,YAAY;GAAO;EAClE,OAAO;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACnE,SAAS;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACrE,QAAQ;GAAE,MAAM;GAAkB,YAAY;GAAO;EACrD,oBAAoB;GAAE,MAAM,eAAe,SAAS;GAAE,YAAY;GAAO;EACzE,cAAc;GAAE,MAAM,eAAe,cAAc;GAAE,YAAY;GAAO;EACxE,aAAa;GAAE,MAAM,eAAe,SAAS;GAAE,YAAY;GAAO;EAClE,WAAW;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAO;EAClE;CACF,CAAC;;;;AAKF,MAAa,yBAAyB,kBAAkB;CACtD,MAAM;CACN,QAAQ;EACN,WAAW;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACvE,SAAS;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACrE,SAAS;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACrE,QAAQ;GAAE,MAAM,eAAe,cAAc;GAAE,YAAY;GAAO;EAClE,OAAO;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACnE,SAAS;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACtE;CACF,CAAC;;;;AAKF,MAAa,wBAAwB,kBAAkB;CACrD,MAAM;CACN,QAAQ;EACN,WAAW;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACvE,SAAS;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACrE,QAAQ;GAAE,MAAM;GAAkB,YAAY;GAAM;EACpD,WAAW;GAAE,MAAM,eAAe,cAAc;GAAE,YAAY;GAAM;EACpE,OAAO;GACL,MAAM,eAAe,cAAc;GACnC,YAAY;GACZ,cAAc;GACf;EACD,QAAQ;GACN,MAAM,eAAe,cAAc;GACnC,YAAY;GACZ,cAAc;GACf;EACF;CACF,CAAC;;;;AAKF,MAAa,yBAAyB,kBAAkB;CACtD,MAAM;CACN,QAAQ;EACN,SAAS;GAAE,MAAM;GAAa,SAAS;GAAM,YAAY;GAAO;EAChE,OAAO;GAAE,MAAM,eAAe,cAAc;GAAE,YAAY;GAAO;EACjE,eAAe;GAAE,MAAM,eAAe,gBAAgB;GAAE,YAAY;GAAO;EAC3E,oBAAoB;GAAE,MAAM,eAAe,MAAM;GAAE,YAAY;GAAO;EACvE;CACF,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DatabasePort } from "@contractspec/lib.runtime-sandbox";
|
|
2
|
+
|
|
3
|
+
//#region src/seeders/index.d.ts
|
|
4
|
+
declare function seedMarketplace(params: {
|
|
5
|
+
projectId: string;
|
|
6
|
+
db: DatabasePort;
|
|
7
|
+
}): Promise<void>;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { seedMarketplace };
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/seeders/index.ts"],"sourcesContent":[],"mappings":";;;iBAEsB,eAAA;;EAAA,EAAA,EAEhB,YAFgB;IAGrB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/seeders/index.ts
|
|
2
|
+
async function seedMarketplace(params) {
|
|
3
|
+
const { projectId, db } = params;
|
|
4
|
+
if ((await db.query(`SELECT COUNT(*) as count FROM marketplace_store WHERE "projectId" = $1`, [projectId])).rows[0]?.count > 0) return;
|
|
5
|
+
await db.execute(`INSERT INTO marketplace_store (id, "projectId", "organizationId", name, description, status)
|
|
6
|
+
VALUES ($1, $2, $3, $4, $5, $6)`, [
|
|
7
|
+
"store_1",
|
|
8
|
+
projectId,
|
|
9
|
+
"org_demo",
|
|
10
|
+
"Demo Store",
|
|
11
|
+
"A demo store",
|
|
12
|
+
"ACTIVE"
|
|
13
|
+
]);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
export { seedMarketplace };
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/seeders/index.ts"],"sourcesContent":["import type { DatabasePort } from '@contractspec/lib.runtime-sandbox';\n\nexport async function seedMarketplace(params: {\n projectId: string;\n db: DatabasePort;\n}) {\n const { projectId, db } = params;\n\n const existing = await db.query(\n `SELECT COUNT(*) as count FROM marketplace_store WHERE \"projectId\" = $1`,\n [projectId]\n );\n if ((existing.rows[0]?.count as number) > 0) return;\n\n await db.execute(\n `INSERT INTO marketplace_store (id, \"projectId\", \"organizationId\", name, description, status)\n VALUES ($1, $2, $3, $4, $5, $6)`,\n ['store_1', projectId, 'org_demo', 'Demo Store', 'A demo store', 'ACTIVE']\n );\n}\n"],"mappings":";AAEA,eAAsB,gBAAgB,QAGnC;CACD,MAAM,EAAE,WAAW,OAAO;AAM1B,MAJiB,MAAM,GAAG,MACxB,0EACA,CAAC,UAAU,CACZ,EACa,KAAK,IAAI,QAAmB,EAAG;AAE7C,OAAM,GAAG,QACP;uCAEA;EAAC;EAAW;EAAW;EAAY;EAAc;EAAgB;EAAS,CAC3E"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { StoreStatusEnum } from "./store.enum.js";
|
|
2
|
+
import { CreateStoreInputModel, StoreModel } from "./store.schema.js";
|
|
3
|
+
import { CreateStoreContract } from "./store.operations.js";
|
|
4
|
+
import { StoreCreatedEvent, StoreStatusChangedEvent } from "./store.event.js";
|
|
5
|
+
export { CreateStoreContract, CreateStoreInputModel, StoreCreatedEvent, StoreModel, StoreStatusChangedEvent, StoreStatusEnum };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { StoreStatusEnum } from "./store.enum.js";
|
|
2
|
+
import { CreateStoreInputModel, StoreModel } from "./store.schema.js";
|
|
3
|
+
import { CreateStoreContract } from "./store.operations.js";
|
|
4
|
+
import { StoreCreatedEvent, StoreStatusChangedEvent } from "./store.event.js";
|
|
5
|
+
|
|
6
|
+
export { CreateStoreContract, CreateStoreInputModel, StoreCreatedEvent, StoreModel, StoreStatusChangedEvent, StoreStatusEnum };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as _contractspec_lib_schema444 from "@contractspec/lib.schema";
|
|
2
|
+
|
|
3
|
+
//#region src/store/store.enum.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Store status enum.
|
|
6
|
+
*/
|
|
7
|
+
declare const StoreStatusEnum: _contractspec_lib_schema444.EnumType<[string, string, string, string]>;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { StoreStatusEnum };
|
|
10
|
+
//# sourceMappingURL=store.enum.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.enum.d.ts","names":[],"sources":["../../src/store/store.enum.ts"],"sourcesContent":[],"mappings":";;;;;;AAKa,cAAA,eAKX,EAAA,2BAAA,CAL0B,QAAA,CAAA,CAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,CAAA,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { defineEnum } from "@contractspec/lib.schema";
|
|
2
|
+
|
|
3
|
+
//#region src/store/store.enum.ts
|
|
4
|
+
/**
|
|
5
|
+
* Store status enum.
|
|
6
|
+
*/
|
|
7
|
+
const StoreStatusEnum = defineEnum("StoreStatus", [
|
|
8
|
+
"PENDING",
|
|
9
|
+
"ACTIVE",
|
|
10
|
+
"SUSPENDED",
|
|
11
|
+
"CLOSED"
|
|
12
|
+
]);
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
export { StoreStatusEnum };
|
|
16
|
+
//# sourceMappingURL=store.enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.enum.js","names":[],"sources":["../../src/store/store.enum.ts"],"sourcesContent":["import { defineEnum } from '@contractspec/lib.schema';\n\n/**\n * Store status enum.\n */\nexport const StoreStatusEnum = defineEnum('StoreStatus', [\n 'PENDING',\n 'ACTIVE',\n 'SUSPENDED',\n 'CLOSED',\n]);\n"],"mappings":";;;;;;AAKA,MAAa,kBAAkB,WAAW,eAAe;CACvD;CACA;CACA;CACA;CACD,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import * as _contractspec_lib_contracts32 from "@contractspec/lib.contracts";
|
|
2
|
+
import * as _contractspec_lib_schema489 from "@contractspec/lib.schema";
|
|
3
|
+
|
|
4
|
+
//#region src/store/store.event.d.ts
|
|
5
|
+
declare const StoreCreatedEvent: _contractspec_lib_contracts32.EventSpec<_contractspec_lib_schema489.SchemaModel<{
|
|
6
|
+
storeId: {
|
|
7
|
+
type: _contractspec_lib_schema489.FieldType<string, string>;
|
|
8
|
+
isOptional: false;
|
|
9
|
+
};
|
|
10
|
+
name: {
|
|
11
|
+
type: _contractspec_lib_schema489.FieldType<string, string>;
|
|
12
|
+
isOptional: false;
|
|
13
|
+
};
|
|
14
|
+
slug: {
|
|
15
|
+
type: _contractspec_lib_schema489.FieldType<string, string>;
|
|
16
|
+
isOptional: false;
|
|
17
|
+
};
|
|
18
|
+
ownerId: {
|
|
19
|
+
type: _contractspec_lib_schema489.FieldType<string, string>;
|
|
20
|
+
isOptional: false;
|
|
21
|
+
};
|
|
22
|
+
timestamp: {
|
|
23
|
+
type: _contractspec_lib_schema489.FieldType<Date, string>;
|
|
24
|
+
isOptional: false;
|
|
25
|
+
};
|
|
26
|
+
}>>;
|
|
27
|
+
declare const StoreStatusChangedEvent: _contractspec_lib_contracts32.EventSpec<_contractspec_lib_schema489.SchemaModel<{
|
|
28
|
+
storeId: {
|
|
29
|
+
type: _contractspec_lib_schema489.FieldType<string, string>;
|
|
30
|
+
isOptional: false;
|
|
31
|
+
};
|
|
32
|
+
previousStatus: {
|
|
33
|
+
type: _contractspec_lib_schema489.FieldType<string, string>;
|
|
34
|
+
isOptional: false;
|
|
35
|
+
};
|
|
36
|
+
newStatus: {
|
|
37
|
+
type: _contractspec_lib_schema489.FieldType<string, string>;
|
|
38
|
+
isOptional: false;
|
|
39
|
+
};
|
|
40
|
+
reason: {
|
|
41
|
+
type: _contractspec_lib_schema489.FieldType<string, string>;
|
|
42
|
+
isOptional: true;
|
|
43
|
+
};
|
|
44
|
+
timestamp: {
|
|
45
|
+
type: _contractspec_lib_schema489.FieldType<Date, string>;
|
|
46
|
+
isOptional: false;
|
|
47
|
+
};
|
|
48
|
+
}>>;
|
|
49
|
+
//#endregion
|
|
50
|
+
export { StoreCreatedEvent, StoreStatusChangedEvent };
|
|
51
|
+
//# sourceMappingURL=store.event.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.event.d.ts","names":[],"sources":["../../src/store/store.event.ts"],"sourcesContent":[],"mappings":";;;;cA4Ba,mBAAiB,6BAAA,CAAA,sCAAA;;UAU5B,2BAAA,CAAA;;EAVW,CAAA;EAUX,IAAA,EAAA;;;;;;;EAV4B,CAAA;EAAA,OAAA,EAAA;IAYjB,IAAA,uCAUX,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;;;;;;;AAVkC,cAAvB,uBAAuB,EAAA,6BAAA,CAAA,SAAA,6BAAA,WAAA,CAAA;EAAA,OAAA,EAAA;UAUlC,2BAAA,CAAA"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { defineEvent } from "@contractspec/lib.contracts";
|
|
2
|
+
import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
|
|
3
|
+
|
|
4
|
+
//#region src/store/store.event.ts
|
|
5
|
+
const StoreCreatedPayload = defineSchemaModel({
|
|
6
|
+
name: "StoreCreatedEventPayload",
|
|
7
|
+
fields: {
|
|
8
|
+
storeId: {
|
|
9
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
10
|
+
isOptional: false
|
|
11
|
+
},
|
|
12
|
+
name: {
|
|
13
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
14
|
+
isOptional: false
|
|
15
|
+
},
|
|
16
|
+
slug: {
|
|
17
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
18
|
+
isOptional: false
|
|
19
|
+
},
|
|
20
|
+
ownerId: {
|
|
21
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
22
|
+
isOptional: false
|
|
23
|
+
},
|
|
24
|
+
timestamp: {
|
|
25
|
+
type: ScalarTypeEnum.DateTime(),
|
|
26
|
+
isOptional: false
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
const StoreStatusChangedPayload = defineSchemaModel({
|
|
31
|
+
name: "StoreStatusChangedEventPayload",
|
|
32
|
+
fields: {
|
|
33
|
+
storeId: {
|
|
34
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
35
|
+
isOptional: false
|
|
36
|
+
},
|
|
37
|
+
previousStatus: {
|
|
38
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
39
|
+
isOptional: false
|
|
40
|
+
},
|
|
41
|
+
newStatus: {
|
|
42
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
43
|
+
isOptional: false
|
|
44
|
+
},
|
|
45
|
+
reason: {
|
|
46
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
47
|
+
isOptional: true
|
|
48
|
+
},
|
|
49
|
+
timestamp: {
|
|
50
|
+
type: ScalarTypeEnum.DateTime(),
|
|
51
|
+
isOptional: false
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
const StoreCreatedEvent = defineEvent({
|
|
56
|
+
meta: {
|
|
57
|
+
key: "marketplace.store.created",
|
|
58
|
+
version: "1.0.0",
|
|
59
|
+
description: "A new seller store has been created.",
|
|
60
|
+
stability: "experimental",
|
|
61
|
+
owners: ["@marketplace-team"],
|
|
62
|
+
tags: ["marketplace", "store"]
|
|
63
|
+
},
|
|
64
|
+
payload: StoreCreatedPayload
|
|
65
|
+
});
|
|
66
|
+
const StoreStatusChangedEvent = defineEvent({
|
|
67
|
+
meta: {
|
|
68
|
+
key: "marketplace.store.statusChanged",
|
|
69
|
+
version: "1.0.0",
|
|
70
|
+
description: "A store status has changed.",
|
|
71
|
+
stability: "experimental",
|
|
72
|
+
owners: ["@marketplace-team"],
|
|
73
|
+
tags: ["marketplace", "store"]
|
|
74
|
+
},
|
|
75
|
+
payload: StoreStatusChangedPayload
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
//#endregion
|
|
79
|
+
export { StoreCreatedEvent, StoreStatusChangedEvent };
|
|
80
|
+
//# sourceMappingURL=store.event.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.event.js","names":[],"sources":["../../src/store/store.event.ts"],"sourcesContent":["import { ScalarTypeEnum, defineSchemaModel } from '@contractspec/lib.schema';\nimport { defineEvent } from '@contractspec/lib.contracts';\n\nconst StoreCreatedPayload = defineSchemaModel({\n name: 'StoreCreatedEventPayload',\n fields: {\n storeId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n ownerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nconst StoreStatusChangedPayload = defineSchemaModel({\n name: 'StoreStatusChangedEventPayload',\n fields: {\n storeId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n previousStatus: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n newStatus: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n reason: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nexport const StoreCreatedEvent = defineEvent({\n meta: {\n key: 'marketplace.store.created',\n version: '1.0.0',\n description: 'A new seller store has been created.',\n stability: 'experimental',\n owners: ['@marketplace-team'],\n tags: ['marketplace', 'store'],\n },\n payload: StoreCreatedPayload,\n});\n\nexport const StoreStatusChangedEvent = defineEvent({\n meta: {\n key: 'marketplace.store.statusChanged',\n version: '1.0.0',\n description: 'A store status has changed.',\n stability: 'experimental',\n owners: ['@marketplace-team'],\n tags: ['marketplace', 'store'],\n },\n payload: StoreStatusChangedPayload,\n});\n"],"mappings":";;;;AAGA,MAAM,sBAAsB,kBAAkB;CAC5C,MAAM;CACN,QAAQ;EACN,SAAS;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACtE,MAAM;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACnE,MAAM;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACnE,SAAS;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACtE,WAAW;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAO;EAClE;CACF,CAAC;AAEF,MAAM,4BAA4B,kBAAkB;CAClD,MAAM;CACN,QAAQ;EACN,SAAS;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACtE,gBAAgB;GACd,MAAM,eAAe,iBAAiB;GACtC,YAAY;GACb;EACD,WAAW;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACxE,QAAQ;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACpE,WAAW;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAO;EAClE;CACF,CAAC;AAEF,MAAa,oBAAoB,YAAY;CAC3C,MAAM;EACJ,KAAK;EACL,SAAS;EACT,aAAa;EACb,WAAW;EACX,QAAQ,CAAC,oBAAoB;EAC7B,MAAM,CAAC,eAAe,QAAQ;EAC/B;CACD,SAAS;CACV,CAAC;AAEF,MAAa,0BAA0B,YAAY;CACjD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,aAAa;EACb,WAAW;EACX,QAAQ,CAAC,oBAAoB;EAC7B,MAAM,CAAC,eAAe,QAAQ;EAC/B;CACD,SAAS;CACV,CAAC"}
|