@contractspec/example.marketplace 1.56.1 → 1.58.0
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/dist/browser/docs/index.js +103 -0
- package/dist/browser/docs/marketplace.docblock.js +103 -0
- package/dist/browser/entities/index.js +721 -0
- package/dist/browser/entities/order.js +167 -0
- package/dist/browser/entities/payout.js +142 -0
- package/dist/browser/entities/product.js +152 -0
- package/dist/browser/entities/review.js +129 -0
- package/dist/browser/entities/store.js +97 -0
- package/dist/browser/example.js +42 -0
- package/dist/browser/handlers/index.js +303 -0
- package/dist/browser/handlers/marketplace.handlers.js +303 -0
- package/dist/browser/index.js +2016 -0
- package/dist/browser/marketplace.capability.js +40 -0
- package/dist/browser/marketplace.feature.js +137 -0
- package/dist/browser/order/index.js +307 -0
- package/dist/browser/order/order.enum.js +17 -0
- package/dist/browser/order/order.event.js +131 -0
- package/dist/browser/order/order.operations.js +172 -0
- package/dist/browser/order/order.presentation.js +153 -0
- package/dist/browser/order/order.schema.js +79 -0
- package/dist/browser/payout/index.js +152 -0
- package/dist/browser/payout/payout.enum.js +12 -0
- package/dist/browser/payout/payout.event.js +55 -0
- package/dist/browser/payout/payout.operations.js +94 -0
- package/dist/browser/payout/payout.presentation.js +111 -0
- package/dist/browser/payout/payout.schema.js +61 -0
- package/dist/browser/product/index.js +249 -0
- package/dist/browser/product/product.enum.js +13 -0
- package/dist/browser/product/product.event.js +74 -0
- package/dist/browser/product/product.operations.js +171 -0
- package/dist/browser/product/product.presentation.js +158 -0
- package/dist/browser/product/product.schema.js +84 -0
- package/dist/browser/review/index.js +206 -0
- package/dist/browser/review/review.enum.js +11 -0
- package/dist/browser/review/review.event.js +50 -0
- package/dist/browser/review/review.operations.js +152 -0
- package/dist/browser/review/review.presentation.js +123 -0
- package/dist/browser/review/review.schema.js +74 -0
- package/dist/browser/seeders/index.js +12 -0
- package/dist/browser/store/index.js +142 -0
- package/dist/browser/store/store.enum.js +11 -0
- package/dist/browser/store/store.event.js +52 -0
- package/dist/browser/store/store.operations.js +88 -0
- package/dist/browser/store/store.presentation.js +94 -0
- package/dist/browser/store/store.schema.js +43 -0
- package/dist/browser/tests/operations.test-spec.js +139 -0
- package/dist/browser/ui/MarketplaceDashboard.js +418 -0
- package/dist/browser/ui/hooks/index.js +59 -0
- package/dist/browser/ui/hooks/useMarketplaceData.js +56 -0
- package/dist/browser/ui/index.js +668 -0
- package/dist/browser/ui/renderers/index.js +248 -0
- package/dist/browser/ui/renderers/marketplace.markdown.js +248 -0
- package/dist/docs/index.d.ts +2 -1
- package/dist/docs/index.d.ts.map +1 -0
- package/dist/docs/index.js +104 -1
- package/dist/docs/marketplace.docblock.d.ts +2 -1
- package/dist/docs/marketplace.docblock.d.ts.map +1 -0
- package/dist/docs/marketplace.docblock.js +46 -57
- package/dist/entities/index.d.ts +302 -307
- package/dist/entities/index.d.ts.map +1 -1
- package/dist/entities/index.js +719 -43
- package/dist/entities/order.d.ts +77 -82
- package/dist/entities/order.d.ts.map +1 -1
- package/dist/entities/order.js +162 -167
- package/dist/entities/payout.d.ts +64 -69
- package/dist/entities/payout.d.ts.map +1 -1
- package/dist/entities/payout.js +137 -156
- package/dist/entities/product.d.ts +69 -74
- package/dist/entities/product.d.ts.map +1 -1
- package/dist/entities/product.js +148 -156
- package/dist/entities/review.d.ts +55 -60
- package/dist/entities/review.d.ts.map +1 -1
- package/dist/entities/review.js +124 -146
- package/dist/entities/store.d.ts +40 -45
- package/dist/entities/store.d.ts.map +1 -1
- package/dist/entities/store.js +94 -106
- package/dist/example.d.ts +2 -6
- package/dist/example.d.ts.map +1 -1
- package/dist/example.js +40 -55
- package/dist/handlers/index.d.ts +2 -2
- package/dist/handlers/index.d.ts.map +1 -0
- package/dist/handlers/index.js +304 -3
- package/dist/handlers/marketplace.handlers.d.ts +138 -138
- package/dist/handlers/marketplace.handlers.d.ts.map +1 -1
- package/dist/handlers/marketplace.handlers.js +284 -309
- package/dist/index.d.ts +13 -31
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2017 -32
- package/dist/marketplace.capability.d.ts +3 -8
- package/dist/marketplace.capability.d.ts.map +1 -1
- package/dist/marketplace.capability.js +41 -34
- package/dist/marketplace.feature.d.ts +1 -7
- package/dist/marketplace.feature.d.ts.map +1 -1
- package/dist/marketplace.feature.js +136 -313
- package/dist/node/docs/index.js +103 -0
- package/dist/node/docs/marketplace.docblock.js +103 -0
- package/dist/node/entities/index.js +721 -0
- package/dist/node/entities/order.js +167 -0
- package/dist/node/entities/payout.js +142 -0
- package/dist/node/entities/product.js +152 -0
- package/dist/node/entities/review.js +129 -0
- package/dist/node/entities/store.js +97 -0
- package/dist/node/example.js +42 -0
- package/dist/node/handlers/index.js +303 -0
- package/dist/node/handlers/marketplace.handlers.js +303 -0
- package/dist/node/index.js +2016 -0
- package/dist/node/marketplace.capability.js +40 -0
- package/dist/node/marketplace.feature.js +137 -0
- package/dist/node/order/index.js +307 -0
- package/dist/node/order/order.enum.js +17 -0
- package/dist/node/order/order.event.js +131 -0
- package/dist/node/order/order.operations.js +172 -0
- package/dist/node/order/order.presentation.js +153 -0
- package/dist/node/order/order.schema.js +79 -0
- package/dist/node/payout/index.js +152 -0
- package/dist/node/payout/payout.enum.js +12 -0
- package/dist/node/payout/payout.event.js +55 -0
- package/dist/node/payout/payout.operations.js +94 -0
- package/dist/node/payout/payout.presentation.js +111 -0
- package/dist/node/payout/payout.schema.js +61 -0
- package/dist/node/product/index.js +249 -0
- package/dist/node/product/product.enum.js +13 -0
- package/dist/node/product/product.event.js +74 -0
- package/dist/node/product/product.operations.js +171 -0
- package/dist/node/product/product.presentation.js +158 -0
- package/dist/node/product/product.schema.js +84 -0
- package/dist/node/review/index.js +206 -0
- package/dist/node/review/review.enum.js +11 -0
- package/dist/node/review/review.event.js +50 -0
- package/dist/node/review/review.operations.js +152 -0
- package/dist/node/review/review.presentation.js +123 -0
- package/dist/node/review/review.schema.js +74 -0
- package/dist/node/seeders/index.js +12 -0
- package/dist/node/store/index.js +142 -0
- package/dist/node/store/store.enum.js +11 -0
- package/dist/node/store/store.event.js +52 -0
- package/dist/node/store/store.operations.js +88 -0
- package/dist/node/store/store.presentation.js +94 -0
- package/dist/node/store/store.schema.js +43 -0
- package/dist/node/tests/operations.test-spec.js +139 -0
- package/dist/node/ui/MarketplaceDashboard.js +418 -0
- package/dist/node/ui/hooks/index.js +59 -0
- package/dist/node/ui/hooks/useMarketplaceData.js +56 -0
- package/dist/node/ui/index.js +668 -0
- package/dist/node/ui/renderers/index.js +248 -0
- package/dist/node/ui/renderers/marketplace.markdown.js +248 -0
- package/dist/order/index.d.ts +8 -5
- package/dist/order/index.d.ts.map +1 -0
- package/dist/order/index.js +307 -5
- package/dist/order/order.enum.d.ts +1 -6
- package/dist/order/order.enum.d.ts.map +1 -1
- package/dist/order/order.enum.js +16 -20
- package/dist/order/order.event.d.ts +133 -139
- package/dist/order/order.event.d.ts.map +1 -1
- package/dist/order/order.event.js +121 -205
- package/dist/order/order.operations.d.ts +291 -297
- package/dist/order/order.operations.d.ts.map +1 -1
- package/dist/order/order.operations.js +169 -115
- package/dist/order/order.presentation.d.ts +3 -8
- package/dist/order/order.presentation.d.ts.map +1 -1
- package/dist/order/order.presentation.js +149 -81
- package/dist/order/order.schema.d.ts +143 -148
- package/dist/order/order.schema.d.ts.map +1 -1
- package/dist/order/order.schema.js +75 -150
- package/dist/payout/index.d.ts +8 -5
- package/dist/payout/index.d.ts.map +1 -0
- package/dist/payout/index.js +152 -5
- package/dist/payout/payout.enum.d.ts +1 -6
- package/dist/payout/payout.enum.d.ts.map +1 -1
- package/dist/payout/payout.enum.js +11 -15
- package/dist/payout/payout.event.d.ts +54 -60
- package/dist/payout/payout.event.d.ts.map +1 -1
- package/dist/payout/payout.event.js +51 -87
- package/dist/payout/payout.operations.d.ts +82 -88
- package/dist/payout/payout.operations.d.ts.map +1 -1
- package/dist/payout/payout.operations.js +92 -50
- package/dist/payout/payout.presentation.d.ts +2 -7
- package/dist/payout/payout.presentation.d.ts.map +1 -1
- package/dist/payout/payout.presentation.js +108 -56
- package/dist/payout/payout.schema.d.ts +139 -144
- package/dist/payout/payout.schema.d.ts.map +1 -1
- package/dist/payout/payout.schema.js +58 -112
- package/dist/product/index.d.ts +8 -5
- package/dist/product/index.d.ts.map +1 -0
- package/dist/product/index.js +249 -5
- package/dist/product/product.enum.d.ts +1 -6
- package/dist/product/product.enum.d.ts.map +1 -1
- package/dist/product/product.enum.js +12 -16
- package/dist/product/product.event.d.ts +63 -69
- package/dist/product/product.event.d.ts.map +1 -1
- package/dist/product/product.event.js +68 -113
- package/dist/product/product.operations.d.ts +225 -231
- package/dist/product/product.operations.d.ts.map +1 -1
- package/dist/product/product.operations.js +168 -104
- package/dist/product/product.presentation.d.ts +3 -8
- package/dist/product/product.presentation.d.ts.map +1 -1
- package/dist/product/product.presentation.js +154 -81
- package/dist/product/product.schema.d.ts +196 -201
- package/dist/product/product.schema.d.ts.map +1 -1
- package/dist/product/product.schema.js +80 -171
- package/dist/review/index.d.ts +8 -5
- package/dist/review/index.d.ts.map +1 -0
- package/dist/review/index.js +206 -5
- package/dist/review/review.enum.d.ts +1 -6
- package/dist/review/review.enum.d.ts.map +1 -1
- package/dist/review/review.enum.js +10 -14
- package/dist/review/review.event.d.ts +46 -52
- package/dist/review/review.event.d.ts.map +1 -1
- package/dist/review/review.event.js +46 -79
- package/dist/review/review.operations.d.ts +190 -196
- package/dist/review/review.operations.d.ts.map +1 -1
- package/dist/review/review.operations.js +149 -102
- package/dist/review/review.presentation.d.ts +2 -7
- package/dist/review/review.presentation.d.ts.map +1 -1
- package/dist/review/review.presentation.js +120 -56
- package/dist/review/review.schema.d.ts +164 -169
- package/dist/review/review.schema.d.ts.map +1 -1
- package/dist/review/review.schema.js +70 -151
- package/dist/seeders/index.d.ts +4 -8
- package/dist/seeders/index.d.ts.map +1 -1
- package/dist/seeders/index.js +11 -16
- package/dist/store/index.d.ts +8 -5
- package/dist/store/index.d.ts.map +1 -0
- package/dist/store/index.js +142 -5
- package/dist/store/store.enum.d.ts +1 -6
- package/dist/store/store.enum.d.ts.map +1 -1
- package/dist/store/store.enum.js +10 -14
- package/dist/store/store.event.d.ts +42 -48
- package/dist/store/store.event.d.ts.map +1 -1
- package/dist/store/store.event.js +48 -75
- package/dist/store/store.operations.d.ts +98 -104
- package/dist/store/store.operations.d.ts.map +1 -1
- package/dist/store/store.operations.js +86 -58
- package/dist/store/store.presentation.d.ts +2 -7
- package/dist/store/store.presentation.d.ts.map +1 -1
- package/dist/store/store.presentation.js +91 -56
- package/dist/store/store.schema.d.ts +70 -75
- package/dist/store/store.schema.d.ts.map +1 -1
- package/dist/store/store.schema.js +41 -90
- package/dist/tests/operations.test-spec.d.ts +5 -10
- package/dist/tests/operations.test-spec.d.ts.map +1 -1
- package/dist/tests/operations.test-spec.js +134 -146
- package/dist/ui/MarketplaceDashboard.d.ts +1 -6
- package/dist/ui/MarketplaceDashboard.d.ts.map +1 -1
- package/dist/ui/MarketplaceDashboard.js +413 -313
- package/dist/ui/hooks/index.d.ts +2 -2
- package/dist/ui/hooks/index.d.ts.map +1 -0
- package/dist/ui/hooks/index.js +59 -4
- package/dist/ui/hooks/useMarketplaceData.d.ts +16 -20
- package/dist/ui/hooks/useMarketplaceData.d.ts.map +1 -1
- package/dist/ui/hooks/useMarketplaceData.js +53 -60
- package/dist/ui/index.d.ts +7 -6
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +668 -5
- package/dist/ui/renderers/index.d.ts +2 -2
- package/dist/ui/renderers/index.d.ts.map +1 -0
- package/dist/ui/renderers/index.js +249 -3
- package/dist/ui/renderers/marketplace.markdown.d.ts +13 -15
- package/dist/ui/renderers/marketplace.markdown.d.ts.map +1 -1
- package/dist/ui/renderers/marketplace.markdown.js +241 -236
- package/package.json +529 -110
- package/dist/docs/marketplace.docblock.js.map +0 -1
- package/dist/entities/index.js.map +0 -1
- package/dist/entities/order.js.map +0 -1
- package/dist/entities/payout.js.map +0 -1
- package/dist/entities/product.js.map +0 -1
- package/dist/entities/review.js.map +0 -1
- package/dist/entities/store.js.map +0 -1
- package/dist/example.js.map +0 -1
- package/dist/handlers/marketplace.handlers.js.map +0 -1
- package/dist/marketplace.capability.js.map +0 -1
- package/dist/marketplace.feature.js.map +0 -1
- package/dist/order/order.enum.js.map +0 -1
- package/dist/order/order.event.js.map +0 -1
- package/dist/order/order.operations.js.map +0 -1
- package/dist/order/order.presentation.js.map +0 -1
- package/dist/order/order.schema.js.map +0 -1
- package/dist/payout/payout.enum.js.map +0 -1
- package/dist/payout/payout.event.js.map +0 -1
- package/dist/payout/payout.operations.js.map +0 -1
- package/dist/payout/payout.presentation.js.map +0 -1
- package/dist/payout/payout.schema.js.map +0 -1
- package/dist/product/product.enum.js.map +0 -1
- package/dist/product/product.event.js.map +0 -1
- package/dist/product/product.operations.js.map +0 -1
- package/dist/product/product.presentation.js.map +0 -1
- package/dist/product/product.schema.js.map +0 -1
- package/dist/review/review.enum.js.map +0 -1
- package/dist/review/review.event.js.map +0 -1
- package/dist/review/review.operations.js.map +0 -1
- package/dist/review/review.presentation.js.map +0 -1
- package/dist/review/review.schema.js.map +0 -1
- package/dist/seeders/index.js.map +0 -1
- package/dist/store/store.enum.js.map +0 -1
- package/dist/store/store.event.js.map +0 -1
- package/dist/store/store.operations.js.map +0 -1
- package/dist/store/store.presentation.js.map +0 -1
- package/dist/store/store.schema.js.map +0 -1
- package/dist/tests/operations.test-spec.js.map +0 -1
- package/dist/ui/MarketplaceDashboard.js.map +0 -1
- package/dist/ui/hooks/useMarketplaceData.js.map +0 -1
- package/dist/ui/renderers/marketplace.markdown.js.map +0 -1
|
@@ -1,155 +1,155 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Runtime-local Marketplace handlers
|
|
3
|
+
*
|
|
4
|
+
* Database-backed handlers for the marketplace template.
|
|
5
|
+
*/
|
|
6
|
+
import type { DatabasePort } from '@contractspec/lib.runtime-sandbox';
|
|
7
|
+
export interface Store {
|
|
8
|
+
id: string;
|
|
9
|
+
projectId: string;
|
|
10
|
+
organizationId: string;
|
|
11
|
+
name: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
status: 'PENDING' | 'ACTIVE' | 'SUSPENDED';
|
|
14
|
+
rating: number;
|
|
15
|
+
reviewCount: number;
|
|
16
|
+
createdAt: Date;
|
|
17
|
+
updatedAt: Date;
|
|
16
18
|
}
|
|
17
|
-
interface Product {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
19
|
+
export interface Product {
|
|
20
|
+
id: string;
|
|
21
|
+
storeId: string;
|
|
22
|
+
name: string;
|
|
23
|
+
description?: string;
|
|
24
|
+
price: number;
|
|
25
|
+
currency: string;
|
|
26
|
+
status: 'DRAFT' | 'ACTIVE' | 'OUT_OF_STOCK' | 'ARCHIVED';
|
|
27
|
+
stock: number;
|
|
28
|
+
category?: string;
|
|
29
|
+
imageUrl?: string;
|
|
30
|
+
createdAt: Date;
|
|
31
|
+
updatedAt: Date;
|
|
30
32
|
}
|
|
31
|
-
interface Order {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
33
|
+
export interface Order {
|
|
34
|
+
id: string;
|
|
35
|
+
projectId: string;
|
|
36
|
+
storeId: string;
|
|
37
|
+
customerId: string;
|
|
38
|
+
status: 'PENDING' | 'CONFIRMED' | 'PROCESSING' | 'SHIPPED' | 'DELIVERED' | 'CANCELLED';
|
|
39
|
+
total: number;
|
|
40
|
+
currency: string;
|
|
41
|
+
shippingAddress?: string;
|
|
42
|
+
createdAt: Date;
|
|
43
|
+
updatedAt: Date;
|
|
42
44
|
}
|
|
43
|
-
interface OrderItem {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
export interface OrderItem {
|
|
46
|
+
id: string;
|
|
47
|
+
orderId: string;
|
|
48
|
+
productId: string;
|
|
49
|
+
quantity: number;
|
|
50
|
+
price: number;
|
|
51
|
+
createdAt: Date;
|
|
50
52
|
}
|
|
51
|
-
interface Payout {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
53
|
+
export interface Payout {
|
|
54
|
+
id: string;
|
|
55
|
+
storeId: string;
|
|
56
|
+
amount: number;
|
|
57
|
+
currency: string;
|
|
58
|
+
status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED';
|
|
59
|
+
processedAt?: Date;
|
|
60
|
+
createdAt: Date;
|
|
59
61
|
}
|
|
60
|
-
interface Review {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
62
|
+
export interface Review {
|
|
63
|
+
id: string;
|
|
64
|
+
productId: string;
|
|
65
|
+
customerId: string;
|
|
66
|
+
orderId?: string;
|
|
67
|
+
rating: number;
|
|
68
|
+
comment?: string;
|
|
69
|
+
createdAt: Date;
|
|
68
70
|
}
|
|
69
|
-
interface CreateStoreInput {
|
|
70
|
-
|
|
71
|
-
|
|
71
|
+
export interface CreateStoreInput {
|
|
72
|
+
name: string;
|
|
73
|
+
description?: string;
|
|
72
74
|
}
|
|
73
|
-
interface AddProductInput {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
75
|
+
export interface AddProductInput {
|
|
76
|
+
storeId: string;
|
|
77
|
+
name: string;
|
|
78
|
+
description?: string;
|
|
79
|
+
price: number;
|
|
80
|
+
currency?: string;
|
|
81
|
+
stock?: number;
|
|
82
|
+
category?: string;
|
|
83
|
+
imageUrl?: string;
|
|
82
84
|
}
|
|
83
|
-
interface PlaceOrderInput {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
85
|
+
export interface PlaceOrderInput {
|
|
86
|
+
storeId: string;
|
|
87
|
+
items: {
|
|
88
|
+
productId: string;
|
|
89
|
+
quantity: number;
|
|
90
|
+
}[];
|
|
91
|
+
shippingAddress?: string;
|
|
90
92
|
}
|
|
91
|
-
interface ListStoresInput {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
93
|
+
export interface ListStoresInput {
|
|
94
|
+
projectId: string;
|
|
95
|
+
status?: 'PENDING' | 'ACTIVE' | 'SUSPENDED' | 'all';
|
|
96
|
+
search?: string;
|
|
97
|
+
limit?: number;
|
|
98
|
+
offset?: number;
|
|
97
99
|
}
|
|
98
|
-
interface ListStoresOutput {
|
|
99
|
-
|
|
100
|
-
|
|
100
|
+
export interface ListStoresOutput {
|
|
101
|
+
stores: Store[];
|
|
102
|
+
total: number;
|
|
101
103
|
}
|
|
102
|
-
interface ListProductsInput {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
104
|
+
export interface ListProductsInput {
|
|
105
|
+
storeId?: string;
|
|
106
|
+
status?: 'DRAFT' | 'ACTIVE' | 'OUT_OF_STOCK' | 'ARCHIVED' | 'all';
|
|
107
|
+
category?: string;
|
|
108
|
+
search?: string;
|
|
109
|
+
limit?: number;
|
|
110
|
+
offset?: number;
|
|
109
111
|
}
|
|
110
|
-
interface ListProductsOutput {
|
|
111
|
-
|
|
112
|
-
|
|
112
|
+
export interface ListProductsOutput {
|
|
113
|
+
products: Product[];
|
|
114
|
+
total: number;
|
|
113
115
|
}
|
|
114
|
-
interface ListOrdersInput {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
116
|
+
export interface ListOrdersInput {
|
|
117
|
+
projectId: string;
|
|
118
|
+
storeId?: string;
|
|
119
|
+
customerId?: string;
|
|
120
|
+
status?: 'PENDING' | 'CONFIRMED' | 'PROCESSING' | 'SHIPPED' | 'DELIVERED' | 'CANCELLED' | 'all';
|
|
121
|
+
limit?: number;
|
|
122
|
+
offset?: number;
|
|
121
123
|
}
|
|
122
|
-
interface ListOrdersOutput {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
export interface ListOrdersOutput {
|
|
125
|
+
orders: Order[];
|
|
126
|
+
total: number;
|
|
127
|
+
totalRevenue: number;
|
|
126
128
|
}
|
|
127
|
-
declare function createMarketplaceHandlers(db: DatabasePort): {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
129
|
+
export declare function createMarketplaceHandlers(db: DatabasePort): {
|
|
130
|
+
listStores: (input: ListStoresInput) => Promise<ListStoresOutput>;
|
|
131
|
+
createStore: (input: CreateStoreInput, context: {
|
|
132
|
+
projectId: string;
|
|
133
|
+
organizationId: string;
|
|
134
|
+
}) => Promise<Store>;
|
|
135
|
+
listProducts: (input: ListProductsInput) => Promise<ListProductsOutput>;
|
|
136
|
+
addProduct: (input: AddProductInput) => Promise<Product>;
|
|
137
|
+
listOrders: (input: ListOrdersInput) => Promise<ListOrdersOutput>;
|
|
138
|
+
placeOrder: (input: PlaceOrderInput, context: {
|
|
139
|
+
projectId: string;
|
|
140
|
+
customerId: string;
|
|
141
|
+
}) => Promise<Order>;
|
|
142
|
+
getOrderItems: (orderId: string) => Promise<OrderItem[]>;
|
|
143
|
+
updateOrderStatus: (orderId: string, status: Order["status"]) => Promise<Order>;
|
|
144
|
+
listPayouts: (storeId: string) => Promise<Payout[]>;
|
|
145
|
+
listReviews: (productId: string) => Promise<Review[]>;
|
|
146
|
+
submitReview: (input: {
|
|
147
|
+
productId: string;
|
|
148
|
+
customerId: string;
|
|
149
|
+
orderId?: string;
|
|
150
|
+
rating: number;
|
|
151
|
+
comment?: string;
|
|
152
|
+
}) => Promise<Review>;
|
|
151
153
|
};
|
|
152
|
-
type MarketplaceHandlers = ReturnType<typeof createMarketplaceHandlers>;
|
|
153
|
-
//#endregion
|
|
154
|
-
export { AddProductInput, CreateStoreInput, ListOrdersInput, ListOrdersOutput, ListProductsInput, ListProductsOutput, ListStoresInput, ListStoresOutput, MarketplaceHandlers, Order, OrderItem, Payout, PlaceOrderInput, Product, Review, Store, createMarketplaceHandlers };
|
|
154
|
+
export type MarketplaceHandlers = ReturnType<typeof createMarketplaceHandlers>;
|
|
155
155
|
//# sourceMappingURL=marketplace.handlers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"marketplace.handlers.d.ts","
|
|
1
|
+
{"version":3,"file":"marketplace.handlers.d.ts","sourceRoot":"","sources":["../../src/handlers/marketplace.handlers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,YAAY,EAAS,MAAM,mCAAmC,CAAC;AAO7E,MAAM,WAAW,KAAK;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IAC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