@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
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// src/marketplace.capability.ts
|
|
2
|
+
import { defineCapability, StabilityEnum } from "@contractspec/lib.contracts";
|
|
3
|
+
var MarketplaceCapability = defineCapability({
|
|
4
|
+
meta: {
|
|
5
|
+
key: "marketplace",
|
|
6
|
+
version: "1.0.0",
|
|
7
|
+
kind: "ui",
|
|
8
|
+
stability: StabilityEnum.Experimental,
|
|
9
|
+
description: "Multi-vendor marketplace platform",
|
|
10
|
+
owners: ["platform.marketplace"],
|
|
11
|
+
tags: ["marketplace", "ecommerce"]
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
var EcommerceCapability = defineCapability({
|
|
15
|
+
meta: {
|
|
16
|
+
key: "ecommerce",
|
|
17
|
+
version: "1.0.0",
|
|
18
|
+
kind: "api",
|
|
19
|
+
stability: StabilityEnum.Experimental,
|
|
20
|
+
description: "E-commerce operations and product catalog",
|
|
21
|
+
owners: ["platform.marketplace"],
|
|
22
|
+
tags: ["ecommerce", "products"]
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
var PaymentsCapability = defineCapability({
|
|
26
|
+
meta: {
|
|
27
|
+
key: "payments",
|
|
28
|
+
version: "1.0.0",
|
|
29
|
+
kind: "integration",
|
|
30
|
+
stability: StabilityEnum.Experimental,
|
|
31
|
+
description: "Payment processing and payouts",
|
|
32
|
+
owners: ["platform.finance"],
|
|
33
|
+
tags: ["payments", "finance"]
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
export {
|
|
37
|
+
PaymentsCapability,
|
|
38
|
+
MarketplaceCapability,
|
|
39
|
+
EcommerceCapability
|
|
40
|
+
};
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
// src/marketplace.feature.ts
|
|
2
|
+
import { defineFeature } from "@contractspec/lib.contracts";
|
|
3
|
+
var MarketplaceFeature = defineFeature({
|
|
4
|
+
meta: {
|
|
5
|
+
key: "marketplace",
|
|
6
|
+
version: "1.0.0",
|
|
7
|
+
title: "Multi-Vendor Marketplace",
|
|
8
|
+
description: "Full-featured marketplace with stores, products, orders, payouts, and reviews",
|
|
9
|
+
domain: "marketplace",
|
|
10
|
+
owners: ["@marketplace-team"],
|
|
11
|
+
tags: ["marketplace", "ecommerce", "multi-vendor", "payments"],
|
|
12
|
+
stability: "experimental"
|
|
13
|
+
},
|
|
14
|
+
operations: [
|
|
15
|
+
{ key: "marketplace.store.create", version: "1.0.0" },
|
|
16
|
+
{ key: "marketplace.product.create", version: "1.0.0" },
|
|
17
|
+
{ key: "marketplace.product.list", version: "1.0.0" },
|
|
18
|
+
{ key: "marketplace.order.create", version: "1.0.0" },
|
|
19
|
+
{ key: "marketplace.order.updateStatus", version: "1.0.0" },
|
|
20
|
+
{ key: "marketplace.payout.list", version: "1.0.0" },
|
|
21
|
+
{ key: "marketplace.review.create", version: "1.0.0" },
|
|
22
|
+
{ key: "marketplace.review.list", version: "1.0.0" }
|
|
23
|
+
],
|
|
24
|
+
events: [
|
|
25
|
+
{ key: "marketplace.store.created", version: "1.0.0" },
|
|
26
|
+
{ key: "marketplace.store.statusChanged", version: "1.0.0" },
|
|
27
|
+
{ key: "marketplace.product.created", version: "1.0.0" },
|
|
28
|
+
{ key: "marketplace.product.published", version: "1.0.0" },
|
|
29
|
+
{ key: "marketplace.inventory.updated", version: "1.0.0" },
|
|
30
|
+
{ key: "marketplace.order.created", version: "1.0.0" },
|
|
31
|
+
{ key: "marketplace.order.paid", version: "1.0.0" },
|
|
32
|
+
{ key: "marketplace.order.statusUpdated", version: "1.0.0" },
|
|
33
|
+
{ key: "marketplace.order.shipped", version: "1.0.0" },
|
|
34
|
+
{ key: "marketplace.order.completed", version: "1.0.0" },
|
|
35
|
+
{ key: "marketplace.payout.created", version: "1.0.0" },
|
|
36
|
+
{ key: "marketplace.payout.paid", version: "1.0.0" },
|
|
37
|
+
{ key: "marketplace.review.created", version: "1.0.0" },
|
|
38
|
+
{ key: "marketplace.review.responded", version: "1.0.0" }
|
|
39
|
+
],
|
|
40
|
+
presentations: [
|
|
41
|
+
{ key: "marketplace.store.profile", version: "1.0.0" },
|
|
42
|
+
{ key: "marketplace.seller.dashboard", version: "1.0.0" },
|
|
43
|
+
{ key: "marketplace.product.catalog", version: "1.0.0" },
|
|
44
|
+
{ key: "marketplace.product.detail", version: "1.0.0" },
|
|
45
|
+
{ key: "marketplace.product.editor", version: "1.0.0" },
|
|
46
|
+
{ key: "marketplace.order.list", version: "1.0.0" },
|
|
47
|
+
{ key: "marketplace.order.detail", version: "1.0.0" },
|
|
48
|
+
{ key: "marketplace.checkout", version: "1.0.0" },
|
|
49
|
+
{ key: "marketplace.payout.viewList", version: "1.0.0" },
|
|
50
|
+
{ key: "marketplace.payout.detail", version: "1.0.0" },
|
|
51
|
+
{ key: "marketplace.review.viewList", version: "1.0.0" },
|
|
52
|
+
{ key: "marketplace.review.form", version: "1.0.0" }
|
|
53
|
+
],
|
|
54
|
+
opToPresentation: [
|
|
55
|
+
{
|
|
56
|
+
op: { key: "marketplace.product.list", version: "1.0.0" },
|
|
57
|
+
pres: { key: "marketplace.product.catalog", version: "1.0.0" }
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
op: { key: "marketplace.order.create", version: "1.0.0" },
|
|
61
|
+
pres: { key: "marketplace.checkout", version: "1.0.0" }
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
op: { key: "marketplace.payout.list", version: "1.0.0" },
|
|
65
|
+
pres: { key: "marketplace.payout.viewList", version: "1.0.0" }
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
op: { key: "marketplace.review.list", version: "1.0.0" },
|
|
69
|
+
pres: { key: "marketplace.review.viewList", version: "1.0.0" }
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
op: { key: "marketplace.review.create", version: "1.0.0" },
|
|
73
|
+
pres: { key: "marketplace.review.form", version: "1.0.0" }
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
presentationsTargets: [
|
|
77
|
+
{
|
|
78
|
+
key: "marketplace.store.profile",
|
|
79
|
+
version: "1.0.0",
|
|
80
|
+
targets: ["react", "markdown"]
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
key: "marketplace.seller.dashboard",
|
|
84
|
+
version: "1.0.0",
|
|
85
|
+
targets: ["react"]
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
key: "marketplace.product.catalog",
|
|
89
|
+
version: "1.0.0",
|
|
90
|
+
targets: ["react", "markdown"]
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
key: "marketplace.product.detail",
|
|
94
|
+
version: "1.0.0",
|
|
95
|
+
targets: ["react", "markdown"]
|
|
96
|
+
},
|
|
97
|
+
{ key: "marketplace.product.editor", version: "1.0.0", targets: ["react"] },
|
|
98
|
+
{
|
|
99
|
+
key: "marketplace.order.list",
|
|
100
|
+
version: "1.0.0",
|
|
101
|
+
targets: ["react", "markdown"]
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
key: "marketplace.order.detail",
|
|
105
|
+
version: "1.0.0",
|
|
106
|
+
targets: ["react", "markdown"]
|
|
107
|
+
},
|
|
108
|
+
{ key: "marketplace.checkout", version: "1.0.0", targets: ["react"] },
|
|
109
|
+
{
|
|
110
|
+
key: "marketplace.payout.viewList",
|
|
111
|
+
version: "1.0.0",
|
|
112
|
+
targets: ["react", "markdown"]
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
key: "marketplace.review.viewList",
|
|
116
|
+
version: "1.0.0",
|
|
117
|
+
targets: ["react", "markdown"]
|
|
118
|
+
}
|
|
119
|
+
],
|
|
120
|
+
capabilities: {
|
|
121
|
+
requires: [
|
|
122
|
+
{ key: "identity", version: "1.0.0" },
|
|
123
|
+
{ key: "audit-trail", version: "1.0.0" },
|
|
124
|
+
{ key: "notifications", version: "1.0.0" },
|
|
125
|
+
{ key: "files", version: "1.0.0" },
|
|
126
|
+
{ key: "metering", version: "1.0.0" }
|
|
127
|
+
],
|
|
128
|
+
provides: [
|
|
129
|
+
{ key: "marketplace", version: "1.0.0" },
|
|
130
|
+
{ key: "ecommerce", version: "1.0.0" },
|
|
131
|
+
{ key: "payments", version: "1.0.0" }
|
|
132
|
+
]
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
export {
|
|
136
|
+
MarketplaceFeature
|
|
137
|
+
};
|
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
// src/order/order.enum.ts
|
|
2
|
+
import { defineEnum } from "@contractspec/lib.schema";
|
|
3
|
+
var OrderStatusEnum = defineEnum("OrderStatus", [
|
|
4
|
+
"PENDING",
|
|
5
|
+
"PAID",
|
|
6
|
+
"PROCESSING",
|
|
7
|
+
"SHIPPED",
|
|
8
|
+
"DELIVERED",
|
|
9
|
+
"COMPLETED",
|
|
10
|
+
"CANCELLED",
|
|
11
|
+
"REFUNDED",
|
|
12
|
+
"PARTIALLY_REFUNDED",
|
|
13
|
+
"DISPUTED"
|
|
14
|
+
]);
|
|
15
|
+
|
|
16
|
+
// src/order/order.schema.ts
|
|
17
|
+
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
18
|
+
var OrderItemModel = defineSchemaModel({
|
|
19
|
+
name: "OrderItemModel",
|
|
20
|
+
fields: {
|
|
21
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
22
|
+
productId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
23
|
+
productName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
24
|
+
unitPrice: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
|
|
25
|
+
quantity: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
26
|
+
subtotal: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false }
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
var OrderModel = defineSchemaModel({
|
|
30
|
+
name: "OrderModel",
|
|
31
|
+
description: "An order",
|
|
32
|
+
fields: {
|
|
33
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
34
|
+
orderNumber: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
35
|
+
buyerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
36
|
+
storeId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
37
|
+
status: { type: OrderStatusEnum, isOptional: false },
|
|
38
|
+
subtotal: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
|
|
39
|
+
shippingTotal: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
|
|
40
|
+
taxTotal: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
|
|
41
|
+
total: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
|
|
42
|
+
currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
43
|
+
items: { type: OrderItemModel, isArray: true, isOptional: true },
|
|
44
|
+
createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
var CreateOrderInputModel = defineSchemaModel({
|
|
48
|
+
name: "CreateOrderInput",
|
|
49
|
+
fields: {
|
|
50
|
+
storeId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
51
|
+
items: {
|
|
52
|
+
type: ScalarTypeEnum.JSON(),
|
|
53
|
+
isOptional: false,
|
|
54
|
+
description: "Array of {productId, variantId?, quantity}"
|
|
55
|
+
},
|
|
56
|
+
shippingAddress: { type: ScalarTypeEnum.JSON(), isOptional: true },
|
|
57
|
+
billingAddress: { type: ScalarTypeEnum.JSON(), isOptional: true },
|
|
58
|
+
buyerNote: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
var UpdateOrderStatusInputModel = defineSchemaModel({
|
|
62
|
+
name: "UpdateOrderStatusInput",
|
|
63
|
+
fields: {
|
|
64
|
+
orderId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
65
|
+
status: { type: OrderStatusEnum, isOptional: false },
|
|
66
|
+
trackingNumber: {
|
|
67
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
68
|
+
isOptional: true
|
|
69
|
+
},
|
|
70
|
+
trackingUrl: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
71
|
+
note: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
// src/order/order.operations.ts
|
|
76
|
+
import { defineCommand } from "@contractspec/lib.contracts/operations";
|
|
77
|
+
var OWNERS = ["@example.marketplace"];
|
|
78
|
+
var CreateOrderContract = defineCommand({
|
|
79
|
+
meta: {
|
|
80
|
+
key: "marketplace.order.create",
|
|
81
|
+
version: "1.0.0",
|
|
82
|
+
stability: "stable",
|
|
83
|
+
owners: [...OWNERS],
|
|
84
|
+
tags: ["marketplace", "order", "create"],
|
|
85
|
+
description: "Create a new order.",
|
|
86
|
+
goal: "Allow buyers to purchase products.",
|
|
87
|
+
context: "Checkout flow."
|
|
88
|
+
},
|
|
89
|
+
io: { input: CreateOrderInputModel, output: OrderModel },
|
|
90
|
+
policy: { auth: "user" },
|
|
91
|
+
sideEffects: {
|
|
92
|
+
emits: [
|
|
93
|
+
{
|
|
94
|
+
key: "marketplace.order.created",
|
|
95
|
+
version: "1.0.0",
|
|
96
|
+
when: "Order is created",
|
|
97
|
+
payload: OrderModel
|
|
98
|
+
}
|
|
99
|
+
],
|
|
100
|
+
audit: ["marketplace.order.created"]
|
|
101
|
+
},
|
|
102
|
+
acceptance: {
|
|
103
|
+
scenarios: [
|
|
104
|
+
{
|
|
105
|
+
key: "create-order-happy-path",
|
|
106
|
+
given: ["User is authenticated"],
|
|
107
|
+
when: ["User creates order with valid items"],
|
|
108
|
+
then: ["Order is created", "OrderCreated event is emitted"]
|
|
109
|
+
}
|
|
110
|
+
],
|
|
111
|
+
examples: [
|
|
112
|
+
{
|
|
113
|
+
key: "create-basic-order",
|
|
114
|
+
input: {
|
|
115
|
+
storeId: "store-123",
|
|
116
|
+
items: [{ productId: "prod-456", quantity: 1, unitPrice: 100 }]
|
|
117
|
+
},
|
|
118
|
+
output: { id: "order-789", status: "pending", total: 100 }
|
|
119
|
+
}
|
|
120
|
+
]
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
var UpdateOrderStatusContract = defineCommand({
|
|
124
|
+
meta: {
|
|
125
|
+
key: "marketplace.order.updateStatus",
|
|
126
|
+
version: "1.0.0",
|
|
127
|
+
stability: "stable",
|
|
128
|
+
owners: [...OWNERS],
|
|
129
|
+
tags: ["marketplace", "order", "status"],
|
|
130
|
+
description: "Update order status.",
|
|
131
|
+
goal: "Track order fulfillment.",
|
|
132
|
+
context: "Order management."
|
|
133
|
+
},
|
|
134
|
+
io: { input: UpdateOrderStatusInputModel, output: OrderModel },
|
|
135
|
+
policy: { auth: "user" },
|
|
136
|
+
sideEffects: {
|
|
137
|
+
emits: [
|
|
138
|
+
{
|
|
139
|
+
key: "marketplace.order.statusUpdated",
|
|
140
|
+
version: "1.0.0",
|
|
141
|
+
when: "Status changes",
|
|
142
|
+
payload: OrderModel
|
|
143
|
+
}
|
|
144
|
+
],
|
|
145
|
+
audit: ["marketplace.order.statusUpdated"]
|
|
146
|
+
},
|
|
147
|
+
acceptance: {
|
|
148
|
+
scenarios: [
|
|
149
|
+
{
|
|
150
|
+
key: "update-status-happy-path",
|
|
151
|
+
given: ["Order exists"],
|
|
152
|
+
when: ["Seller updates order status"],
|
|
153
|
+
then: ["Status is updated", "OrderStatusUpdated event is emitted"]
|
|
154
|
+
}
|
|
155
|
+
],
|
|
156
|
+
examples: [
|
|
157
|
+
{
|
|
158
|
+
key: "mark-shipped",
|
|
159
|
+
input: {
|
|
160
|
+
orderId: "order-789",
|
|
161
|
+
status: "shipped",
|
|
162
|
+
trackingNumber: "TRACK123"
|
|
163
|
+
},
|
|
164
|
+
output: { id: "order-789", status: "shipped" }
|
|
165
|
+
}
|
|
166
|
+
]
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
// src/order/order.event.ts
|
|
171
|
+
import { ScalarTypeEnum as ScalarTypeEnum2, defineSchemaModel as defineSchemaModel2 } from "@contractspec/lib.schema";
|
|
172
|
+
import { defineEvent } from "@contractspec/lib.contracts";
|
|
173
|
+
var OrderCreatedPayload = defineSchemaModel2({
|
|
174
|
+
name: "OrderCreatedEventPayload",
|
|
175
|
+
fields: {
|
|
176
|
+
orderId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
177
|
+
orderNumber: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
178
|
+
buyerId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
179
|
+
storeId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
180
|
+
total: { type: ScalarTypeEnum2.Float_unsecure(), isOptional: false },
|
|
181
|
+
currency: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
182
|
+
itemCount: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: false },
|
|
183
|
+
timestamp: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
var OrderPaidPayload = defineSchemaModel2({
|
|
187
|
+
name: "OrderPaidEventPayload",
|
|
188
|
+
fields: {
|
|
189
|
+
orderId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
190
|
+
orderNumber: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
191
|
+
total: { type: ScalarTypeEnum2.Float_unsecure(), isOptional: false },
|
|
192
|
+
paymentMethod: {
|
|
193
|
+
type: ScalarTypeEnum2.String_unsecure(),
|
|
194
|
+
isOptional: false
|
|
195
|
+
},
|
|
196
|
+
timestamp: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
var OrderStatusUpdatedPayload = defineSchemaModel2({
|
|
200
|
+
name: "OrderStatusUpdatedEventPayload",
|
|
201
|
+
fields: {
|
|
202
|
+
orderId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
203
|
+
orderNumber: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
204
|
+
previousStatus: {
|
|
205
|
+
type: ScalarTypeEnum2.String_unsecure(),
|
|
206
|
+
isOptional: false
|
|
207
|
+
},
|
|
208
|
+
newStatus: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
209
|
+
updatedBy: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
210
|
+
timestamp: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
var OrderShippedPayload = defineSchemaModel2({
|
|
214
|
+
name: "OrderShippedEventPayload",
|
|
215
|
+
fields: {
|
|
216
|
+
orderId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
217
|
+
orderNumber: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
218
|
+
trackingNumber: {
|
|
219
|
+
type: ScalarTypeEnum2.String_unsecure(),
|
|
220
|
+
isOptional: true
|
|
221
|
+
},
|
|
222
|
+
trackingUrl: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
223
|
+
carrier: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
224
|
+
timestamp: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
var OrderCompletedPayload = defineSchemaModel2({
|
|
228
|
+
name: "OrderCompletedEventPayload",
|
|
229
|
+
fields: {
|
|
230
|
+
orderId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
231
|
+
orderNumber: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
232
|
+
buyerId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
233
|
+
storeId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
234
|
+
total: { type: ScalarTypeEnum2.Float_unsecure(), isOptional: false },
|
|
235
|
+
sellerPayout: { type: ScalarTypeEnum2.Float_unsecure(), isOptional: false },
|
|
236
|
+
timestamp: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
var OrderCreatedEvent = defineEvent({
|
|
240
|
+
meta: {
|
|
241
|
+
key: "marketplace.order.created",
|
|
242
|
+
version: "1.0.0",
|
|
243
|
+
description: "A new order has been created.",
|
|
244
|
+
stability: "experimental",
|
|
245
|
+
owners: ["@marketplace-team"],
|
|
246
|
+
tags: ["marketplace", "order"]
|
|
247
|
+
},
|
|
248
|
+
payload: OrderCreatedPayload
|
|
249
|
+
});
|
|
250
|
+
var OrderPaidEvent = defineEvent({
|
|
251
|
+
meta: {
|
|
252
|
+
key: "marketplace.order.paid",
|
|
253
|
+
version: "1.0.0",
|
|
254
|
+
description: "An order has been paid.",
|
|
255
|
+
stability: "experimental",
|
|
256
|
+
owners: ["@marketplace-team"],
|
|
257
|
+
tags: ["marketplace", "order"]
|
|
258
|
+
},
|
|
259
|
+
payload: OrderPaidPayload
|
|
260
|
+
});
|
|
261
|
+
var OrderStatusUpdatedEvent = defineEvent({
|
|
262
|
+
meta: {
|
|
263
|
+
key: "marketplace.order.statusUpdated",
|
|
264
|
+
version: "1.0.0",
|
|
265
|
+
description: "An order status has been updated.",
|
|
266
|
+
stability: "experimental",
|
|
267
|
+
owners: ["@marketplace-team"],
|
|
268
|
+
tags: ["marketplace", "order"]
|
|
269
|
+
},
|
|
270
|
+
payload: OrderStatusUpdatedPayload
|
|
271
|
+
});
|
|
272
|
+
var OrderShippedEvent = defineEvent({
|
|
273
|
+
meta: {
|
|
274
|
+
key: "marketplace.order.shipped",
|
|
275
|
+
version: "1.0.0",
|
|
276
|
+
description: "An order has been shipped.",
|
|
277
|
+
stability: "experimental",
|
|
278
|
+
owners: ["@marketplace-team"],
|
|
279
|
+
tags: ["marketplace", "order"]
|
|
280
|
+
},
|
|
281
|
+
payload: OrderShippedPayload
|
|
282
|
+
});
|
|
283
|
+
var OrderCompletedEvent = defineEvent({
|
|
284
|
+
meta: {
|
|
285
|
+
key: "marketplace.order.completed",
|
|
286
|
+
version: "1.0.0",
|
|
287
|
+
description: "An order has been completed.",
|
|
288
|
+
stability: "experimental",
|
|
289
|
+
owners: ["@marketplace-team"],
|
|
290
|
+
tags: ["marketplace", "order"]
|
|
291
|
+
},
|
|
292
|
+
payload: OrderCompletedPayload
|
|
293
|
+
});
|
|
294
|
+
export {
|
|
295
|
+
UpdateOrderStatusInputModel,
|
|
296
|
+
UpdateOrderStatusContract,
|
|
297
|
+
OrderStatusUpdatedEvent,
|
|
298
|
+
OrderStatusEnum,
|
|
299
|
+
OrderShippedEvent,
|
|
300
|
+
OrderPaidEvent,
|
|
301
|
+
OrderModel,
|
|
302
|
+
OrderItemModel,
|
|
303
|
+
OrderCreatedEvent,
|
|
304
|
+
OrderCompletedEvent,
|
|
305
|
+
CreateOrderInputModel,
|
|
306
|
+
CreateOrderContract
|
|
307
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// src/order/order.enum.ts
|
|
2
|
+
import { defineEnum } from "@contractspec/lib.schema";
|
|
3
|
+
var OrderStatusEnum = defineEnum("OrderStatus", [
|
|
4
|
+
"PENDING",
|
|
5
|
+
"PAID",
|
|
6
|
+
"PROCESSING",
|
|
7
|
+
"SHIPPED",
|
|
8
|
+
"DELIVERED",
|
|
9
|
+
"COMPLETED",
|
|
10
|
+
"CANCELLED",
|
|
11
|
+
"REFUNDED",
|
|
12
|
+
"PARTIALLY_REFUNDED",
|
|
13
|
+
"DISPUTED"
|
|
14
|
+
]);
|
|
15
|
+
export {
|
|
16
|
+
OrderStatusEnum
|
|
17
|
+
};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
// src/order/order.event.ts
|
|
2
|
+
import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
|
|
3
|
+
import { defineEvent } from "@contractspec/lib.contracts";
|
|
4
|
+
var OrderCreatedPayload = defineSchemaModel({
|
|
5
|
+
name: "OrderCreatedEventPayload",
|
|
6
|
+
fields: {
|
|
7
|
+
orderId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
8
|
+
orderNumber: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
9
|
+
buyerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
10
|
+
storeId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
11
|
+
total: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
|
|
12
|
+
currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
13
|
+
itemCount: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
14
|
+
timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
var OrderPaidPayload = defineSchemaModel({
|
|
18
|
+
name: "OrderPaidEventPayload",
|
|
19
|
+
fields: {
|
|
20
|
+
orderId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
21
|
+
orderNumber: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
22
|
+
total: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
|
|
23
|
+
paymentMethod: {
|
|
24
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
25
|
+
isOptional: false
|
|
26
|
+
},
|
|
27
|
+
timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
var OrderStatusUpdatedPayload = defineSchemaModel({
|
|
31
|
+
name: "OrderStatusUpdatedEventPayload",
|
|
32
|
+
fields: {
|
|
33
|
+
orderId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
34
|
+
orderNumber: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
35
|
+
previousStatus: {
|
|
36
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
37
|
+
isOptional: false
|
|
38
|
+
},
|
|
39
|
+
newStatus: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
40
|
+
updatedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
41
|
+
timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
var OrderShippedPayload = defineSchemaModel({
|
|
45
|
+
name: "OrderShippedEventPayload",
|
|
46
|
+
fields: {
|
|
47
|
+
orderId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
48
|
+
orderNumber: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
49
|
+
trackingNumber: {
|
|
50
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
51
|
+
isOptional: true
|
|
52
|
+
},
|
|
53
|
+
trackingUrl: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
54
|
+
carrier: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
55
|
+
timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
var OrderCompletedPayload = defineSchemaModel({
|
|
59
|
+
name: "OrderCompletedEventPayload",
|
|
60
|
+
fields: {
|
|
61
|
+
orderId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
62
|
+
orderNumber: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
63
|
+
buyerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
64
|
+
storeId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
65
|
+
total: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
|
|
66
|
+
sellerPayout: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
|
|
67
|
+
timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
var OrderCreatedEvent = defineEvent({
|
|
71
|
+
meta: {
|
|
72
|
+
key: "marketplace.order.created",
|
|
73
|
+
version: "1.0.0",
|
|
74
|
+
description: "A new order has been created.",
|
|
75
|
+
stability: "experimental",
|
|
76
|
+
owners: ["@marketplace-team"],
|
|
77
|
+
tags: ["marketplace", "order"]
|
|
78
|
+
},
|
|
79
|
+
payload: OrderCreatedPayload
|
|
80
|
+
});
|
|
81
|
+
var OrderPaidEvent = defineEvent({
|
|
82
|
+
meta: {
|
|
83
|
+
key: "marketplace.order.paid",
|
|
84
|
+
version: "1.0.0",
|
|
85
|
+
description: "An order has been paid.",
|
|
86
|
+
stability: "experimental",
|
|
87
|
+
owners: ["@marketplace-team"],
|
|
88
|
+
tags: ["marketplace", "order"]
|
|
89
|
+
},
|
|
90
|
+
payload: OrderPaidPayload
|
|
91
|
+
});
|
|
92
|
+
var OrderStatusUpdatedEvent = defineEvent({
|
|
93
|
+
meta: {
|
|
94
|
+
key: "marketplace.order.statusUpdated",
|
|
95
|
+
version: "1.0.0",
|
|
96
|
+
description: "An order status has been updated.",
|
|
97
|
+
stability: "experimental",
|
|
98
|
+
owners: ["@marketplace-team"],
|
|
99
|
+
tags: ["marketplace", "order"]
|
|
100
|
+
},
|
|
101
|
+
payload: OrderStatusUpdatedPayload
|
|
102
|
+
});
|
|
103
|
+
var OrderShippedEvent = defineEvent({
|
|
104
|
+
meta: {
|
|
105
|
+
key: "marketplace.order.shipped",
|
|
106
|
+
version: "1.0.0",
|
|
107
|
+
description: "An order has been shipped.",
|
|
108
|
+
stability: "experimental",
|
|
109
|
+
owners: ["@marketplace-team"],
|
|
110
|
+
tags: ["marketplace", "order"]
|
|
111
|
+
},
|
|
112
|
+
payload: OrderShippedPayload
|
|
113
|
+
});
|
|
114
|
+
var OrderCompletedEvent = defineEvent({
|
|
115
|
+
meta: {
|
|
116
|
+
key: "marketplace.order.completed",
|
|
117
|
+
version: "1.0.0",
|
|
118
|
+
description: "An order has been completed.",
|
|
119
|
+
stability: "experimental",
|
|
120
|
+
owners: ["@marketplace-team"],
|
|
121
|
+
tags: ["marketplace", "order"]
|
|
122
|
+
},
|
|
123
|
+
payload: OrderCompletedPayload
|
|
124
|
+
});
|
|
125
|
+
export {
|
|
126
|
+
OrderStatusUpdatedEvent,
|
|
127
|
+
OrderShippedEvent,
|
|
128
|
+
OrderPaidEvent,
|
|
129
|
+
OrderCreatedEvent,
|
|
130
|
+
OrderCompletedEvent
|
|
131
|
+
};
|