@contractspec/example.marketplace 1.44.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/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 +40 -0
- package/dist/example.d.ts.map +1 -0
- package/dist/example.js +51 -0
- package/dist/example.js.map +1 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.js +27 -0
- package/dist/marketplace.feature.d.ts +12 -0
- package/dist/marketplace.feature.d.ts.map +1 -0
- package/dist/marketplace.feature.js +310 -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/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/package.json +141 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Chaman Ventures, SASU
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
# @contractspec/example.marketplace
|
|
2
|
+
|
|
3
|
+
Website: https://contractspec.io/
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
A comprehensive multi-vendor marketplace example demonstrating ContractSpec principles.
|
|
7
|
+
|
|
8
|
+
## Features
|
|
9
|
+
|
|
10
|
+
- **Multi-Vendor Stores**: Seller storefronts with profiles and verification
|
|
11
|
+
- **Product Catalog**: Products with variants, categories, and inventory tracking
|
|
12
|
+
- **Order Management**: Full order lifecycle with status tracking
|
|
13
|
+
- **Payment Processing**: Commission calculation and seller payouts
|
|
14
|
+
- **Reviews & Ratings**: Customer feedback with seller responses
|
|
15
|
+
- **File Attachments**: Product images and media using @contractspec/lib.files
|
|
16
|
+
- **Usage Metering**: Platform analytics using @contractspec/lib.metering
|
|
17
|
+
|
|
18
|
+
## Entities
|
|
19
|
+
|
|
20
|
+
### Store
|
|
21
|
+
- `Store` - Seller storefront
|
|
22
|
+
- `StoreCategory` - Store categorization
|
|
23
|
+
|
|
24
|
+
### Product
|
|
25
|
+
- `Product` - Product listing
|
|
26
|
+
- `ProductVariant` - Product variations (size, color)
|
|
27
|
+
- `Category` - Product categorization
|
|
28
|
+
|
|
29
|
+
### Order
|
|
30
|
+
- `Order` - Purchase transaction
|
|
31
|
+
- `OrderItem` - Items in an order
|
|
32
|
+
- `Refund` - Refund records
|
|
33
|
+
- `RefundItem` - Items being refunded
|
|
34
|
+
|
|
35
|
+
### Payout
|
|
36
|
+
- `Payout` - Payment to seller
|
|
37
|
+
- `PayoutItem` - Orders in a payout
|
|
38
|
+
- `BankAccount` - Seller payment destination
|
|
39
|
+
- `PayoutSettings` - Payout configuration
|
|
40
|
+
|
|
41
|
+
### Review
|
|
42
|
+
- `Review` - Customer review
|
|
43
|
+
- `ReviewResponse` - Seller response
|
|
44
|
+
- `ReviewVote` - Helpfulness votes
|
|
45
|
+
- `ReviewReport` - Flagged reviews
|
|
46
|
+
|
|
47
|
+
## Contracts
|
|
48
|
+
|
|
49
|
+
### Store Operations
|
|
50
|
+
- `marketplace.store.create` - Create a seller store
|
|
51
|
+
|
|
52
|
+
### Product Operations
|
|
53
|
+
- `marketplace.product.create` - Create a product
|
|
54
|
+
- `marketplace.product.list` - List/search products
|
|
55
|
+
|
|
56
|
+
### Order Operations
|
|
57
|
+
- `marketplace.order.create` - Create an order
|
|
58
|
+
- `marketplace.order.updateStatus` - Update order status
|
|
59
|
+
|
|
60
|
+
### Payout Operations
|
|
61
|
+
- `marketplace.payout.list` - List payouts
|
|
62
|
+
|
|
63
|
+
### Review Operations
|
|
64
|
+
- `marketplace.review.create` - Create a review
|
|
65
|
+
- `marketplace.review.list` - List reviews
|
|
66
|
+
|
|
67
|
+
## Events
|
|
68
|
+
|
|
69
|
+
- Store: `created`, `statusChanged`
|
|
70
|
+
- Product: `created`, `published`, `inventory.updated`
|
|
71
|
+
- Order: `created`, `paid`, `statusUpdated`, `shipped`, `completed`
|
|
72
|
+
- Payout: `created`, `paid`
|
|
73
|
+
- Review: `created`, `responded`
|
|
74
|
+
|
|
75
|
+
## Commission Model
|
|
76
|
+
|
|
77
|
+
The marketplace uses a configurable commission model:
|
|
78
|
+
|
|
79
|
+
```typescript
|
|
80
|
+
// Default 10% commission
|
|
81
|
+
const commission = calculateCommission(orderTotal, 0.1);
|
|
82
|
+
|
|
83
|
+
// Result:
|
|
84
|
+
{
|
|
85
|
+
subtotal: 100,
|
|
86
|
+
platformFee: 10,
|
|
87
|
+
sellerPayout: 90
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Usage
|
|
92
|
+
|
|
93
|
+
```typescript
|
|
94
|
+
import {
|
|
95
|
+
CreateOrderContract,
|
|
96
|
+
ListProductsContract,
|
|
97
|
+
marketplaceSchemaContribution
|
|
98
|
+
} from '@contractspec/example.marketplace';
|
|
99
|
+
|
|
100
|
+
// List products
|
|
101
|
+
const products = await executeQuery(ListProductsContract, {
|
|
102
|
+
categoryId: 'electronics',
|
|
103
|
+
minPrice: 10,
|
|
104
|
+
maxPrice: 100,
|
|
105
|
+
limit: 20,
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
// Create an order
|
|
109
|
+
const order = await executeContract(CreateOrderContract, {
|
|
110
|
+
storeId: 'store_123',
|
|
111
|
+
items: [
|
|
112
|
+
{ productId: 'prod_456', quantity: 2 },
|
|
113
|
+
{ productId: 'prod_789', variantId: 'var_abc', quantity: 1 },
|
|
114
|
+
],
|
|
115
|
+
shippingAddress: { ... },
|
|
116
|
+
});
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Dependencies
|
|
120
|
+
|
|
121
|
+
- `@contractspec/lib.identity-rbac` - User identity and roles
|
|
122
|
+
- `@contractspec/lib.files` - Product images and media
|
|
123
|
+
- `@contractspec/lib.metering` - Usage tracking and analytics
|
|
124
|
+
- `@contractspec/module.audit-trail` - Action auditing
|
|
125
|
+
- `@contractspec/module.notifications` - Order and payout notifications
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./marketplace.docblock.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { registerDocBlocks } from "@contractspec/lib.contracts/docs";
|
|
2
|
+
|
|
3
|
+
//#region src/docs/marketplace.docblock.ts
|
|
4
|
+
registerDocBlocks([
|
|
5
|
+
{
|
|
6
|
+
id: "docs.examples.marketplace",
|
|
7
|
+
title: "Marketplace (2-sided)",
|
|
8
|
+
summary: "Two-sided marketplace with stores, products, orders, payouts, and reviews. Demonstrates multi-actor flows, payments, and attachments.",
|
|
9
|
+
kind: "reference",
|
|
10
|
+
visibility: "public",
|
|
11
|
+
route: "/docs/examples/marketplace",
|
|
12
|
+
tags: [
|
|
13
|
+
"marketplace",
|
|
14
|
+
"orders",
|
|
15
|
+
"payouts",
|
|
16
|
+
"reviews"
|
|
17
|
+
],
|
|
18
|
+
body: `## Entities
|
|
19
|
+
|
|
20
|
+
- Store, Product, Order, OrderItem, Payout, Review.
|
|
21
|
+
- Uses Files module for product media and receipt attachments.
|
|
22
|
+
|
|
23
|
+
## Contracts
|
|
24
|
+
|
|
25
|
+
- \`marketplace.store.create\`, \`marketplace.product.add\`, \`marketplace.order.place\`, \`marketplace.payout.process\`, \`marketplace.review.submit\`.
|
|
26
|
+
- Policy guards via Identity/RBAC for provider vs client actions.
|
|
27
|
+
|
|
28
|
+
## Events
|
|
29
|
+
|
|
30
|
+
- order.created/completed/cancelled, payout.queued/completed, review.submitted.
|
|
31
|
+
- Hooked into Notifications and Audit Trail modules.
|
|
32
|
+
|
|
33
|
+
## UI / Presentations
|
|
34
|
+
|
|
35
|
+
- Dashboard, product catalog, order list/detail, store management.
|
|
36
|
+
- Templates registered under \`marketplace\` in Studio Template Registry.
|
|
37
|
+
|
|
38
|
+
## Notes
|
|
39
|
+
|
|
40
|
+
- Commission model encoded in spec; payouts scheduled via Jobs module.
|
|
41
|
+
- Feature flags can gate beta checkout or new reviews flow.
|
|
42
|
+
`
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
id: "docs.examples.marketplace.goal",
|
|
46
|
+
title: "Marketplace — Goal",
|
|
47
|
+
summary: "Why this marketplace template exists and the outcomes it targets.",
|
|
48
|
+
kind: "goal",
|
|
49
|
+
visibility: "public",
|
|
50
|
+
route: "/docs/examples/marketplace/goal",
|
|
51
|
+
tags: ["marketplace", "goal"],
|
|
52
|
+
body: `## Why it matters
|
|
53
|
+
- Provides a regenerable 2-sided marketplace baseline without bespoke glue.
|
|
54
|
+
- Keeps payouts, catalog, orders, and reviews consistent across surfaces.
|
|
55
|
+
|
|
56
|
+
## Business/Product goal
|
|
57
|
+
- Safe provider/client flows with auditable payouts and moderation-ready reviews.
|
|
58
|
+
- Staged rollouts for payments/reviews via feature flags; explicit commission/tax fields.
|
|
59
|
+
|
|
60
|
+
## Success criteria
|
|
61
|
+
- Orders/payouts regenerate cleanly after spec changes.
|
|
62
|
+
- Events emit for lifecycle + audit; PII is scoped/redacted in presentations.`
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
id: "docs.examples.marketplace.usage",
|
|
66
|
+
title: "Marketplace — Usage",
|
|
67
|
+
summary: "How to seed, extend, and safely regenerate the marketplace.",
|
|
68
|
+
kind: "usage",
|
|
69
|
+
visibility: "public",
|
|
70
|
+
route: "/docs/examples/marketplace/usage",
|
|
71
|
+
tags: ["marketplace", "usage"],
|
|
72
|
+
body: `## Setup
|
|
73
|
+
1) Seed sample stores/products/orders via template registry (or create via UI).
|
|
74
|
+
2) Configure Files storage for media/receipts; set policy.pii for sensitive fields.
|
|
75
|
+
|
|
76
|
+
## Extend & regenerate
|
|
77
|
+
1) Adjust schemas for commission/tax/payout states or review moderation in the spec.
|
|
78
|
+
2) Regenerate to sync UI, API, events, notifications.
|
|
79
|
+
3) Gate risky changes (new payment providers) behind Feature Flags.
|
|
80
|
+
|
|
81
|
+
## Guardrails
|
|
82
|
+
- Emit events for order/payout state changes; log via Audit Trail.
|
|
83
|
+
- Avoid hidden commission math—keep explicit fields.
|
|
84
|
+
- Redact buyer/provider PII in markdown/JSON presentations.`
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
id: "docs.examples.marketplace.constraints",
|
|
88
|
+
title: "Marketplace — Constraints & Safety",
|
|
89
|
+
summary: "Internal guardrails for payouts, order states, and regeneration semantics.",
|
|
90
|
+
kind: "reference",
|
|
91
|
+
visibility: "internal",
|
|
92
|
+
route: "/docs/examples/marketplace/constraints",
|
|
93
|
+
tags: [
|
|
94
|
+
"marketplace",
|
|
95
|
+
"constraints",
|
|
96
|
+
"internal"
|
|
97
|
+
],
|
|
98
|
+
body: `## Constraints
|
|
99
|
+
- Commission logic and order states must stay spec-defined; never adjust in code-only patches.
|
|
100
|
+
- Events to emit: order.created, order.completed, payout.queued, review.posted (minimum).
|
|
101
|
+
- Regeneration must not change payment semantics without explicit spec diff.
|
|
102
|
+
|
|
103
|
+
## Safety & PII
|
|
104
|
+
- Redact buyer/provider identifiers in markdown/JSON outputs; scope payouts per tenant/org.
|
|
105
|
+
- For MCP/web surfaces, avoid exposing raw payout calc inputs; use summaries.
|
|
106
|
+
|
|
107
|
+
## Testing/Verification
|
|
108
|
+
- Add fixtures covering order lifecycle and payout queueing.
|
|
109
|
+
- Run regeneration diff when changing commission/tax fields; verify presentations updated.
|
|
110
|
+
- Ensure Notifications/Audit wiring remains intact for order/payout/review events.`
|
|
111
|
+
}
|
|
112
|
+
]);
|
|
113
|
+
|
|
114
|
+
//#endregion
|
|
115
|
+
//# sourceMappingURL=marketplace.docblock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"marketplace.docblock.js","names":[],"sources":["../../src/docs/marketplace.docblock.ts"],"sourcesContent":["import type { DocBlock } from '@contractspec/lib.contracts/docs';\nimport { registerDocBlocks } from '@contractspec/lib.contracts/docs';\n\nconst marketplaceDocBlocks: DocBlock[] = [\n {\n id: 'docs.examples.marketplace',\n title: 'Marketplace (2-sided)',\n summary:\n 'Two-sided marketplace with stores, products, orders, payouts, and reviews. Demonstrates multi-actor flows, payments, and attachments.',\n kind: 'reference',\n visibility: 'public',\n route: '/docs/examples/marketplace',\n tags: ['marketplace', 'orders', 'payouts', 'reviews'],\n body: `## Entities\n\n- Store, Product, Order, OrderItem, Payout, Review.\n- Uses Files module for product media and receipt attachments.\n\n## Contracts\n\n- \\`marketplace.store.create\\`, \\`marketplace.product.add\\`, \\`marketplace.order.place\\`, \\`marketplace.payout.process\\`, \\`marketplace.review.submit\\`.\n- Policy guards via Identity/RBAC for provider vs client actions.\n\n## Events\n\n- order.created/completed/cancelled, payout.queued/completed, review.submitted.\n- Hooked into Notifications and Audit Trail modules.\n\n## UI / Presentations\n\n- Dashboard, product catalog, order list/detail, store management.\n- Templates registered under \\`marketplace\\` in Studio Template Registry.\n\n## Notes\n\n- Commission model encoded in spec; payouts scheduled via Jobs module.\n- Feature flags can gate beta checkout or new reviews flow.\n`,\n },\n {\n id: 'docs.examples.marketplace.goal',\n title: 'Marketplace — Goal',\n summary:\n 'Why this marketplace template exists and the outcomes it targets.',\n kind: 'goal',\n visibility: 'public',\n route: '/docs/examples/marketplace/goal',\n tags: ['marketplace', 'goal'],\n body: `## Why it matters\n- Provides a regenerable 2-sided marketplace baseline without bespoke glue.\n- Keeps payouts, catalog, orders, and reviews consistent across surfaces.\n\n## Business/Product goal\n- Safe provider/client flows with auditable payouts and moderation-ready reviews.\n- Staged rollouts for payments/reviews via feature flags; explicit commission/tax fields.\n\n## Success criteria\n- Orders/payouts regenerate cleanly after spec changes.\n- Events emit for lifecycle + audit; PII is scoped/redacted in presentations.`,\n },\n {\n id: 'docs.examples.marketplace.usage',\n title: 'Marketplace — Usage',\n summary: 'How to seed, extend, and safely regenerate the marketplace.',\n kind: 'usage',\n visibility: 'public',\n route: '/docs/examples/marketplace/usage',\n tags: ['marketplace', 'usage'],\n body: `## Setup\n1) Seed sample stores/products/orders via template registry (or create via UI).\n2) Configure Files storage for media/receipts; set policy.pii for sensitive fields.\n\n## Extend & regenerate\n1) Adjust schemas for commission/tax/payout states or review moderation in the spec.\n2) Regenerate to sync UI, API, events, notifications.\n3) Gate risky changes (new payment providers) behind Feature Flags.\n\n## Guardrails\n- Emit events for order/payout state changes; log via Audit Trail.\n- Avoid hidden commission math—keep explicit fields.\n- Redact buyer/provider PII in markdown/JSON presentations.`,\n },\n {\n id: 'docs.examples.marketplace.constraints',\n title: 'Marketplace — Constraints & Safety',\n summary:\n 'Internal guardrails for payouts, order states, and regeneration semantics.',\n kind: 'reference',\n visibility: 'internal',\n route: '/docs/examples/marketplace/constraints',\n tags: ['marketplace', 'constraints', 'internal'],\n body: `## Constraints\n- Commission logic and order states must stay spec-defined; never adjust in code-only patches.\n- Events to emit: order.created, order.completed, payout.queued, review.posted (minimum).\n- Regeneration must not change payment semantics without explicit spec diff.\n\n## Safety & PII\n- Redact buyer/provider identifiers in markdown/JSON outputs; scope payouts per tenant/org.\n- For MCP/web surfaces, avoid exposing raw payout calc inputs; use summaries.\n\n## Testing/Verification\n- Add fixtures covering order lifecycle and payout queueing.\n- Run regeneration diff when changing commission/tax fields; verify presentations updated.\n- Ensure Notifications/Audit wiring remains intact for order/payout/review events.`,\n },\n];\n\nregisterDocBlocks(marketplaceDocBlocks);\n"],"mappings":";;;AA2GA,kBAxGyC;CACvC;EACE,IAAI;EACJ,OAAO;EACP,SACE;EACF,MAAM;EACN,YAAY;EACZ,OAAO;EACP,MAAM;GAAC;GAAe;GAAU;GAAW;GAAU;EACrD,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;EAyBP;CACD;EACE,IAAI;EACJ,OAAO;EACP,SACE;EACF,MAAM;EACN,YAAY;EACZ,OAAO;EACP,MAAM,CAAC,eAAe,OAAO;EAC7B,MAAM;;;;;;;;;;;EAWP;CACD;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,MAAM;EACN,YAAY;EACZ,OAAO;EACP,MAAM,CAAC,eAAe,QAAQ;EAC9B,MAAM;;;;;;;;;;;;;EAaP;CACD;EACE,IAAI;EACJ,OAAO;EACP,SACE;EACF,MAAM;EACN,YAAY;EACZ,OAAO;EACP,MAAM;GAAC;GAAe;GAAe;GAAW;EAChD,MAAM;;;;;;;;;;;;;EAaP;CACF,CAEsC"}
|
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
import { StoreCategoryEntity, StoreEntity, StoreStatusEnum, StoreTypeEnum } from "./store.js";
|
|
2
|
+
import { CategoryEntity, ProductEntity, ProductStatusEnum, ProductTypeEnum, ProductVariantEntity } from "./product.js";
|
|
3
|
+
import { OrderEntity, OrderItemEntity, OrderStatusEnum, PaymentStatusEnum, RefundEntity, RefundItemEntity } from "./order.js";
|
|
4
|
+
import { BankAccountEntity, PayoutEntity, PayoutItemEntity, PayoutScheduleEnum, PayoutSettingsEntity, PayoutStatusEnum } from "./payout.js";
|
|
5
|
+
import { ReviewEntity, ReviewReportEntity, ReviewResponseEntity, ReviewStatusEnum, ReviewTypeEnum, ReviewVoteEntity } from "./review.js";
|
|
6
|
+
import * as _contractspec_lib_schema96 from "@contractspec/lib.schema";
|
|
7
|
+
import { ModuleSchemaContribution } from "@contractspec/lib.schema";
|
|
8
|
+
|
|
9
|
+
//#region src/entities/index.d.ts
|
|
10
|
+
declare const marketplaceEntities: (_contractspec_lib_schema96.EntitySpec<{
|
|
11
|
+
id: _contractspec_lib_schema96.EntityScalarField;
|
|
12
|
+
name: _contractspec_lib_schema96.EntityScalarField;
|
|
13
|
+
slug: _contractspec_lib_schema96.EntityScalarField;
|
|
14
|
+
description: _contractspec_lib_schema96.EntityScalarField;
|
|
15
|
+
status: _contractspec_lib_schema96.EntityEnumField;
|
|
16
|
+
type: _contractspec_lib_schema96.EntityEnumField;
|
|
17
|
+
ownerId: _contractspec_lib_schema96.EntityScalarField;
|
|
18
|
+
organizationId: _contractspec_lib_schema96.EntityScalarField;
|
|
19
|
+
logoFileId: _contractspec_lib_schema96.EntityScalarField;
|
|
20
|
+
bannerFileId: _contractspec_lib_schema96.EntityScalarField;
|
|
21
|
+
email: _contractspec_lib_schema96.EntityScalarField;
|
|
22
|
+
phone: _contractspec_lib_schema96.EntityScalarField;
|
|
23
|
+
website: _contractspec_lib_schema96.EntityScalarField;
|
|
24
|
+
country: _contractspec_lib_schema96.EntityScalarField;
|
|
25
|
+
currency: _contractspec_lib_schema96.EntityScalarField;
|
|
26
|
+
timezone: _contractspec_lib_schema96.EntityScalarField;
|
|
27
|
+
commissionRate: _contractspec_lib_schema96.EntityScalarField;
|
|
28
|
+
isVerified: _contractspec_lib_schema96.EntityScalarField;
|
|
29
|
+
verifiedAt: _contractspec_lib_schema96.EntityScalarField;
|
|
30
|
+
settings: _contractspec_lib_schema96.EntityScalarField;
|
|
31
|
+
metadata: _contractspec_lib_schema96.EntityScalarField;
|
|
32
|
+
totalProducts: _contractspec_lib_schema96.EntityScalarField;
|
|
33
|
+
totalOrders: _contractspec_lib_schema96.EntityScalarField;
|
|
34
|
+
totalRevenue: _contractspec_lib_schema96.EntityScalarField;
|
|
35
|
+
averageRating: _contractspec_lib_schema96.EntityScalarField;
|
|
36
|
+
createdAt: _contractspec_lib_schema96.EntityScalarField;
|
|
37
|
+
updatedAt: _contractspec_lib_schema96.EntityScalarField;
|
|
38
|
+
products: _contractspec_lib_schema96.EntityRelationField;
|
|
39
|
+
orders: _contractspec_lib_schema96.EntityRelationField;
|
|
40
|
+
payouts: _contractspec_lib_schema96.EntityRelationField;
|
|
41
|
+
}> | _contractspec_lib_schema96.EntitySpec<{
|
|
42
|
+
id: _contractspec_lib_schema96.EntityScalarField;
|
|
43
|
+
storeId: _contractspec_lib_schema96.EntityScalarField;
|
|
44
|
+
categoryId: _contractspec_lib_schema96.EntityScalarField;
|
|
45
|
+
isPrimary: _contractspec_lib_schema96.EntityScalarField;
|
|
46
|
+
createdAt: _contractspec_lib_schema96.EntityScalarField;
|
|
47
|
+
store: _contractspec_lib_schema96.EntityRelationField;
|
|
48
|
+
}> | _contractspec_lib_schema96.EntitySpec<{
|
|
49
|
+
id: _contractspec_lib_schema96.EntityScalarField;
|
|
50
|
+
storeId: _contractspec_lib_schema96.EntityScalarField;
|
|
51
|
+
name: _contractspec_lib_schema96.EntityScalarField;
|
|
52
|
+
slug: _contractspec_lib_schema96.EntityScalarField;
|
|
53
|
+
description: _contractspec_lib_schema96.EntityScalarField;
|
|
54
|
+
shortDescription: _contractspec_lib_schema96.EntityScalarField;
|
|
55
|
+
status: _contractspec_lib_schema96.EntityEnumField;
|
|
56
|
+
type: _contractspec_lib_schema96.EntityEnumField;
|
|
57
|
+
price: _contractspec_lib_schema96.EntityScalarField;
|
|
58
|
+
compareAtPrice: _contractspec_lib_schema96.EntityScalarField;
|
|
59
|
+
currency: _contractspec_lib_schema96.EntityScalarField;
|
|
60
|
+
sku: _contractspec_lib_schema96.EntityScalarField;
|
|
61
|
+
barcode: _contractspec_lib_schema96.EntityScalarField;
|
|
62
|
+
quantity: _contractspec_lib_schema96.EntityScalarField;
|
|
63
|
+
trackInventory: _contractspec_lib_schema96.EntityScalarField;
|
|
64
|
+
allowBackorder: _contractspec_lib_schema96.EntityScalarField;
|
|
65
|
+
lowStockThreshold: _contractspec_lib_schema96.EntityScalarField;
|
|
66
|
+
weight: _contractspec_lib_schema96.EntityScalarField;
|
|
67
|
+
weightUnit: _contractspec_lib_schema96.EntityScalarField;
|
|
68
|
+
categoryId: _contractspec_lib_schema96.EntityScalarField;
|
|
69
|
+
tags: _contractspec_lib_schema96.EntityScalarField;
|
|
70
|
+
primaryImageId: _contractspec_lib_schema96.EntityScalarField;
|
|
71
|
+
seoTitle: _contractspec_lib_schema96.EntityScalarField;
|
|
72
|
+
seoDescription: _contractspec_lib_schema96.EntityScalarField;
|
|
73
|
+
attributes: _contractspec_lib_schema96.EntityScalarField;
|
|
74
|
+
reviewCount: _contractspec_lib_schema96.EntityScalarField;
|
|
75
|
+
averageRating: _contractspec_lib_schema96.EntityScalarField;
|
|
76
|
+
totalSold: _contractspec_lib_schema96.EntityScalarField;
|
|
77
|
+
createdAt: _contractspec_lib_schema96.EntityScalarField;
|
|
78
|
+
updatedAt: _contractspec_lib_schema96.EntityScalarField;
|
|
79
|
+
publishedAt: _contractspec_lib_schema96.EntityScalarField;
|
|
80
|
+
store: _contractspec_lib_schema96.EntityRelationField;
|
|
81
|
+
variants: _contractspec_lib_schema96.EntityRelationField;
|
|
82
|
+
orderItems: _contractspec_lib_schema96.EntityRelationField;
|
|
83
|
+
reviews: _contractspec_lib_schema96.EntityRelationField;
|
|
84
|
+
}> | _contractspec_lib_schema96.EntitySpec<{
|
|
85
|
+
id: _contractspec_lib_schema96.EntityScalarField;
|
|
86
|
+
productId: _contractspec_lib_schema96.EntityScalarField;
|
|
87
|
+
name: _contractspec_lib_schema96.EntityScalarField;
|
|
88
|
+
options: _contractspec_lib_schema96.EntityScalarField;
|
|
89
|
+
price: _contractspec_lib_schema96.EntityScalarField;
|
|
90
|
+
compareAtPrice: _contractspec_lib_schema96.EntityScalarField;
|
|
91
|
+
sku: _contractspec_lib_schema96.EntityScalarField;
|
|
92
|
+
barcode: _contractspec_lib_schema96.EntityScalarField;
|
|
93
|
+
quantity: _contractspec_lib_schema96.EntityScalarField;
|
|
94
|
+
imageId: _contractspec_lib_schema96.EntityScalarField;
|
|
95
|
+
isActive: _contractspec_lib_schema96.EntityScalarField;
|
|
96
|
+
position: _contractspec_lib_schema96.EntityScalarField;
|
|
97
|
+
createdAt: _contractspec_lib_schema96.EntityScalarField;
|
|
98
|
+
updatedAt: _contractspec_lib_schema96.EntityScalarField;
|
|
99
|
+
product: _contractspec_lib_schema96.EntityRelationField;
|
|
100
|
+
}> | _contractspec_lib_schema96.EntitySpec<{
|
|
101
|
+
id: _contractspec_lib_schema96.EntityScalarField;
|
|
102
|
+
name: _contractspec_lib_schema96.EntityScalarField;
|
|
103
|
+
slug: _contractspec_lib_schema96.EntityScalarField;
|
|
104
|
+
description: _contractspec_lib_schema96.EntityScalarField;
|
|
105
|
+
parentId: _contractspec_lib_schema96.EntityScalarField;
|
|
106
|
+
path: _contractspec_lib_schema96.EntityScalarField;
|
|
107
|
+
level: _contractspec_lib_schema96.EntityScalarField;
|
|
108
|
+
position: _contractspec_lib_schema96.EntityScalarField;
|
|
109
|
+
imageId: _contractspec_lib_schema96.EntityScalarField;
|
|
110
|
+
isActive: _contractspec_lib_schema96.EntityScalarField;
|
|
111
|
+
createdAt: _contractspec_lib_schema96.EntityScalarField;
|
|
112
|
+
updatedAt: _contractspec_lib_schema96.EntityScalarField;
|
|
113
|
+
parent: _contractspec_lib_schema96.EntityRelationField;
|
|
114
|
+
children: _contractspec_lib_schema96.EntityRelationField;
|
|
115
|
+
}> | _contractspec_lib_schema96.EntitySpec<{
|
|
116
|
+
id: _contractspec_lib_schema96.EntityScalarField;
|
|
117
|
+
orderNumber: _contractspec_lib_schema96.EntityScalarField;
|
|
118
|
+
buyerId: _contractspec_lib_schema96.EntityScalarField;
|
|
119
|
+
storeId: _contractspec_lib_schema96.EntityScalarField;
|
|
120
|
+
status: _contractspec_lib_schema96.EntityEnumField;
|
|
121
|
+
paymentStatus: _contractspec_lib_schema96.EntityEnumField;
|
|
122
|
+
subtotal: _contractspec_lib_schema96.EntityScalarField;
|
|
123
|
+
shippingTotal: _contractspec_lib_schema96.EntityScalarField;
|
|
124
|
+
taxTotal: _contractspec_lib_schema96.EntityScalarField;
|
|
125
|
+
discountTotal: _contractspec_lib_schema96.EntityScalarField;
|
|
126
|
+
total: _contractspec_lib_schema96.EntityScalarField;
|
|
127
|
+
currency: _contractspec_lib_schema96.EntityScalarField;
|
|
128
|
+
platformFee: _contractspec_lib_schema96.EntityScalarField;
|
|
129
|
+
sellerPayout: _contractspec_lib_schema96.EntityScalarField;
|
|
130
|
+
shippingAddress: _contractspec_lib_schema96.EntityScalarField;
|
|
131
|
+
billingAddress: _contractspec_lib_schema96.EntityScalarField;
|
|
132
|
+
shippingMethod: _contractspec_lib_schema96.EntityScalarField;
|
|
133
|
+
trackingNumber: _contractspec_lib_schema96.EntityScalarField;
|
|
134
|
+
trackingUrl: _contractspec_lib_schema96.EntityScalarField;
|
|
135
|
+
paymentMethod: _contractspec_lib_schema96.EntityScalarField;
|
|
136
|
+
paymentIntentId: _contractspec_lib_schema96.EntityScalarField;
|
|
137
|
+
buyerNote: _contractspec_lib_schema96.EntityScalarField;
|
|
138
|
+
sellerNote: _contractspec_lib_schema96.EntityScalarField;
|
|
139
|
+
internalNote: _contractspec_lib_schema96.EntityScalarField;
|
|
140
|
+
createdAt: _contractspec_lib_schema96.EntityScalarField;
|
|
141
|
+
updatedAt: _contractspec_lib_schema96.EntityScalarField;
|
|
142
|
+
paidAt: _contractspec_lib_schema96.EntityScalarField;
|
|
143
|
+
shippedAt: _contractspec_lib_schema96.EntityScalarField;
|
|
144
|
+
deliveredAt: _contractspec_lib_schema96.EntityScalarField;
|
|
145
|
+
completedAt: _contractspec_lib_schema96.EntityScalarField;
|
|
146
|
+
cancelledAt: _contractspec_lib_schema96.EntityScalarField;
|
|
147
|
+
store: _contractspec_lib_schema96.EntityRelationField;
|
|
148
|
+
items: _contractspec_lib_schema96.EntityRelationField;
|
|
149
|
+
refunds: _contractspec_lib_schema96.EntityRelationField;
|
|
150
|
+
}> | _contractspec_lib_schema96.EntitySpec<{
|
|
151
|
+
id: _contractspec_lib_schema96.EntityScalarField;
|
|
152
|
+
orderId: _contractspec_lib_schema96.EntityScalarField;
|
|
153
|
+
productId: _contractspec_lib_schema96.EntityScalarField;
|
|
154
|
+
variantId: _contractspec_lib_schema96.EntityScalarField;
|
|
155
|
+
productName: _contractspec_lib_schema96.EntityScalarField;
|
|
156
|
+
variantName: _contractspec_lib_schema96.EntityScalarField;
|
|
157
|
+
sku: _contractspec_lib_schema96.EntityScalarField;
|
|
158
|
+
unitPrice: _contractspec_lib_schema96.EntityScalarField;
|
|
159
|
+
quantity: _contractspec_lib_schema96.EntityScalarField;
|
|
160
|
+
subtotal: _contractspec_lib_schema96.EntityScalarField;
|
|
161
|
+
quantityFulfilled: _contractspec_lib_schema96.EntityScalarField;
|
|
162
|
+
quantityRefunded: _contractspec_lib_schema96.EntityScalarField;
|
|
163
|
+
createdAt: _contractspec_lib_schema96.EntityScalarField;
|
|
164
|
+
updatedAt: _contractspec_lib_schema96.EntityScalarField;
|
|
165
|
+
order: _contractspec_lib_schema96.EntityRelationField;
|
|
166
|
+
product: _contractspec_lib_schema96.EntityRelationField;
|
|
167
|
+
}> | _contractspec_lib_schema96.EntitySpec<{
|
|
168
|
+
id: _contractspec_lib_schema96.EntityScalarField;
|
|
169
|
+
orderId: _contractspec_lib_schema96.EntityScalarField;
|
|
170
|
+
amount: _contractspec_lib_schema96.EntityScalarField;
|
|
171
|
+
currency: _contractspec_lib_schema96.EntityScalarField;
|
|
172
|
+
reason: _contractspec_lib_schema96.EntityScalarField;
|
|
173
|
+
notes: _contractspec_lib_schema96.EntityScalarField;
|
|
174
|
+
status: _contractspec_lib_schema96.EntityScalarField;
|
|
175
|
+
refundId: _contractspec_lib_schema96.EntityScalarField;
|
|
176
|
+
issuedBy: _contractspec_lib_schema96.EntityScalarField;
|
|
177
|
+
createdAt: _contractspec_lib_schema96.EntityScalarField;
|
|
178
|
+
processedAt: _contractspec_lib_schema96.EntityScalarField;
|
|
179
|
+
order: _contractspec_lib_schema96.EntityRelationField;
|
|
180
|
+
items: _contractspec_lib_schema96.EntityRelationField;
|
|
181
|
+
}> | _contractspec_lib_schema96.EntitySpec<{
|
|
182
|
+
id: _contractspec_lib_schema96.EntityScalarField;
|
|
183
|
+
refundId: _contractspec_lib_schema96.EntityScalarField;
|
|
184
|
+
orderItemId: _contractspec_lib_schema96.EntityScalarField;
|
|
185
|
+
quantity: _contractspec_lib_schema96.EntityScalarField;
|
|
186
|
+
amount: _contractspec_lib_schema96.EntityScalarField;
|
|
187
|
+
createdAt: _contractspec_lib_schema96.EntityScalarField;
|
|
188
|
+
refund: _contractspec_lib_schema96.EntityRelationField;
|
|
189
|
+
orderItem: _contractspec_lib_schema96.EntityRelationField;
|
|
190
|
+
}> | _contractspec_lib_schema96.EntitySpec<{
|
|
191
|
+
id: _contractspec_lib_schema96.EntityScalarField;
|
|
192
|
+
storeId: _contractspec_lib_schema96.EntityScalarField;
|
|
193
|
+
payoutNumber: _contractspec_lib_schema96.EntityScalarField;
|
|
194
|
+
status: _contractspec_lib_schema96.EntityEnumField;
|
|
195
|
+
grossAmount: _contractspec_lib_schema96.EntityScalarField;
|
|
196
|
+
platformFees: _contractspec_lib_schema96.EntityScalarField;
|
|
197
|
+
otherDeductions: _contractspec_lib_schema96.EntityScalarField;
|
|
198
|
+
netAmount: _contractspec_lib_schema96.EntityScalarField;
|
|
199
|
+
currency: _contractspec_lib_schema96.EntityScalarField;
|
|
200
|
+
periodStart: _contractspec_lib_schema96.EntityScalarField;
|
|
201
|
+
periodEnd: _contractspec_lib_schema96.EntityScalarField;
|
|
202
|
+
paymentMethod: _contractspec_lib_schema96.EntityScalarField;
|
|
203
|
+
paymentReference: _contractspec_lib_schema96.EntityScalarField;
|
|
204
|
+
bankAccountId: _contractspec_lib_schema96.EntityScalarField;
|
|
205
|
+
bankAccountLast4: _contractspec_lib_schema96.EntityScalarField;
|
|
206
|
+
notes: _contractspec_lib_schema96.EntityScalarField;
|
|
207
|
+
failureReason: _contractspec_lib_schema96.EntityScalarField;
|
|
208
|
+
orderCount: _contractspec_lib_schema96.EntityScalarField;
|
|
209
|
+
createdAt: _contractspec_lib_schema96.EntityScalarField;
|
|
210
|
+
updatedAt: _contractspec_lib_schema96.EntityScalarField;
|
|
211
|
+
scheduledAt: _contractspec_lib_schema96.EntityScalarField;
|
|
212
|
+
processedAt: _contractspec_lib_schema96.EntityScalarField;
|
|
213
|
+
paidAt: _contractspec_lib_schema96.EntityScalarField;
|
|
214
|
+
store: _contractspec_lib_schema96.EntityRelationField;
|
|
215
|
+
items: _contractspec_lib_schema96.EntityRelationField;
|
|
216
|
+
}> | _contractspec_lib_schema96.EntitySpec<{
|
|
217
|
+
id: _contractspec_lib_schema96.EntityScalarField;
|
|
218
|
+
payoutId: _contractspec_lib_schema96.EntityScalarField;
|
|
219
|
+
orderId: _contractspec_lib_schema96.EntityScalarField;
|
|
220
|
+
orderTotal: _contractspec_lib_schema96.EntityScalarField;
|
|
221
|
+
platformFee: _contractspec_lib_schema96.EntityScalarField;
|
|
222
|
+
netAmount: _contractspec_lib_schema96.EntityScalarField;
|
|
223
|
+
createdAt: _contractspec_lib_schema96.EntityScalarField;
|
|
224
|
+
payout: _contractspec_lib_schema96.EntityRelationField;
|
|
225
|
+
order: _contractspec_lib_schema96.EntityRelationField;
|
|
226
|
+
}> | _contractspec_lib_schema96.EntitySpec<{
|
|
227
|
+
id: _contractspec_lib_schema96.EntityScalarField;
|
|
228
|
+
storeId: _contractspec_lib_schema96.EntityScalarField;
|
|
229
|
+
accountHolderName: _contractspec_lib_schema96.EntityScalarField;
|
|
230
|
+
accountType: _contractspec_lib_schema96.EntityScalarField;
|
|
231
|
+
bankName: _contractspec_lib_schema96.EntityScalarField;
|
|
232
|
+
last4: _contractspec_lib_schema96.EntityScalarField;
|
|
233
|
+
routingLast4: _contractspec_lib_schema96.EntityScalarField;
|
|
234
|
+
externalId: _contractspec_lib_schema96.EntityScalarField;
|
|
235
|
+
isDefault: _contractspec_lib_schema96.EntityScalarField;
|
|
236
|
+
isVerified: _contractspec_lib_schema96.EntityScalarField;
|
|
237
|
+
createdAt: _contractspec_lib_schema96.EntityScalarField;
|
|
238
|
+
updatedAt: _contractspec_lib_schema96.EntityScalarField;
|
|
239
|
+
verifiedAt: _contractspec_lib_schema96.EntityScalarField;
|
|
240
|
+
store: _contractspec_lib_schema96.EntityRelationField;
|
|
241
|
+
}> | _contractspec_lib_schema96.EntitySpec<{
|
|
242
|
+
id: _contractspec_lib_schema96.EntityScalarField;
|
|
243
|
+
storeId: _contractspec_lib_schema96.EntityScalarField;
|
|
244
|
+
schedule: _contractspec_lib_schema96.EntityEnumField;
|
|
245
|
+
dayOfWeek: _contractspec_lib_schema96.EntityScalarField;
|
|
246
|
+
dayOfMonth: _contractspec_lib_schema96.EntityScalarField;
|
|
247
|
+
minimumPayout: _contractspec_lib_schema96.EntityScalarField;
|
|
248
|
+
defaultBankAccountId: _contractspec_lib_schema96.EntityScalarField;
|
|
249
|
+
createdAt: _contractspec_lib_schema96.EntityScalarField;
|
|
250
|
+
updatedAt: _contractspec_lib_schema96.EntityScalarField;
|
|
251
|
+
store: _contractspec_lib_schema96.EntityRelationField;
|
|
252
|
+
}> | _contractspec_lib_schema96.EntitySpec<{
|
|
253
|
+
id: _contractspec_lib_schema96.EntityScalarField;
|
|
254
|
+
type: _contractspec_lib_schema96.EntityEnumField;
|
|
255
|
+
productId: _contractspec_lib_schema96.EntityScalarField;
|
|
256
|
+
storeId: _contractspec_lib_schema96.EntityScalarField;
|
|
257
|
+
orderId: _contractspec_lib_schema96.EntityScalarField;
|
|
258
|
+
orderItemId: _contractspec_lib_schema96.EntityScalarField;
|
|
259
|
+
authorId: _contractspec_lib_schema96.EntityScalarField;
|
|
260
|
+
rating: _contractspec_lib_schema96.EntityScalarField;
|
|
261
|
+
title: _contractspec_lib_schema96.EntityScalarField;
|
|
262
|
+
content: _contractspec_lib_schema96.EntityScalarField;
|
|
263
|
+
isVerifiedPurchase: _contractspec_lib_schema96.EntityScalarField;
|
|
264
|
+
status: _contractspec_lib_schema96.EntityEnumField;
|
|
265
|
+
hasMedia: _contractspec_lib_schema96.EntityScalarField;
|
|
266
|
+
helpfulCount: _contractspec_lib_schema96.EntityScalarField;
|
|
267
|
+
notHelpfulCount: _contractspec_lib_schema96.EntityScalarField;
|
|
268
|
+
moderatedBy: _contractspec_lib_schema96.EntityScalarField;
|
|
269
|
+
moderatedAt: _contractspec_lib_schema96.EntityScalarField;
|
|
270
|
+
moderationNote: _contractspec_lib_schema96.EntityScalarField;
|
|
271
|
+
hasResponse: _contractspec_lib_schema96.EntityScalarField;
|
|
272
|
+
createdAt: _contractspec_lib_schema96.EntityScalarField;
|
|
273
|
+
updatedAt: _contractspec_lib_schema96.EntityScalarField;
|
|
274
|
+
product: _contractspec_lib_schema96.EntityRelationField;
|
|
275
|
+
store: _contractspec_lib_schema96.EntityRelationField;
|
|
276
|
+
responses: _contractspec_lib_schema96.EntityRelationField;
|
|
277
|
+
votes: _contractspec_lib_schema96.EntityRelationField;
|
|
278
|
+
}> | _contractspec_lib_schema96.EntitySpec<{
|
|
279
|
+
id: _contractspec_lib_schema96.EntityScalarField;
|
|
280
|
+
reviewId: _contractspec_lib_schema96.EntityScalarField;
|
|
281
|
+
authorId: _contractspec_lib_schema96.EntityScalarField;
|
|
282
|
+
content: _contractspec_lib_schema96.EntityScalarField;
|
|
283
|
+
createdAt: _contractspec_lib_schema96.EntityScalarField;
|
|
284
|
+
updatedAt: _contractspec_lib_schema96.EntityScalarField;
|
|
285
|
+
review: _contractspec_lib_schema96.EntityRelationField;
|
|
286
|
+
}> | _contractspec_lib_schema96.EntitySpec<{
|
|
287
|
+
id: _contractspec_lib_schema96.EntityScalarField;
|
|
288
|
+
reviewId: _contractspec_lib_schema96.EntityScalarField;
|
|
289
|
+
userId: _contractspec_lib_schema96.EntityScalarField;
|
|
290
|
+
isHelpful: _contractspec_lib_schema96.EntityScalarField;
|
|
291
|
+
createdAt: _contractspec_lib_schema96.EntityScalarField;
|
|
292
|
+
review: _contractspec_lib_schema96.EntityRelationField;
|
|
293
|
+
}> | _contractspec_lib_schema96.EntitySpec<{
|
|
294
|
+
id: _contractspec_lib_schema96.EntityScalarField;
|
|
295
|
+
reviewId: _contractspec_lib_schema96.EntityScalarField;
|
|
296
|
+
reporterId: _contractspec_lib_schema96.EntityScalarField;
|
|
297
|
+
reason: _contractspec_lib_schema96.EntityScalarField;
|
|
298
|
+
details: _contractspec_lib_schema96.EntityScalarField;
|
|
299
|
+
status: _contractspec_lib_schema96.EntityScalarField;
|
|
300
|
+
resolvedBy: _contractspec_lib_schema96.EntityScalarField;
|
|
301
|
+
resolvedAt: _contractspec_lib_schema96.EntityScalarField;
|
|
302
|
+
resolution: _contractspec_lib_schema96.EntityScalarField;
|
|
303
|
+
createdAt: _contractspec_lib_schema96.EntityScalarField;
|
|
304
|
+
review: _contractspec_lib_schema96.EntityRelationField;
|
|
305
|
+
}>)[];
|
|
306
|
+
declare const marketplaceSchemaContribution: ModuleSchemaContribution;
|
|
307
|
+
//#endregion
|
|
308
|
+
export { BankAccountEntity, CategoryEntity, OrderEntity, OrderItemEntity, OrderStatusEnum, PaymentStatusEnum, PayoutEntity, PayoutItemEntity, PayoutScheduleEnum, PayoutSettingsEntity, PayoutStatusEnum, ProductEntity, ProductStatusEnum, ProductTypeEnum, ProductVariantEntity, RefundEntity, RefundItemEntity, ReviewEntity, ReviewReportEntity, ReviewResponseEntity, ReviewStatusEnum, ReviewTypeEnum, ReviewVoteEntity, StoreCategoryEntity, StoreEntity, StoreStatusEnum, StoreTypeEnum, marketplaceEntities, marketplaceSchemaContribution };
|
|
309
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/entities/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;cAuFa,iDAAmB;MA2B/B,0BAAA,CAAA;;EA3BY,IAAA,8CA2BZ;EAAA,WAAA,8CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA3B+B,0BAAA,CAAA;;0DAAA;EAAA,SAAA,8CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA6BnB,+BAA+B"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { StoreCategoryEntity, StoreEntity, StoreStatusEnum, StoreTypeEnum } from "./store.js";
|
|
2
|
+
import { CategoryEntity, ProductEntity, ProductStatusEnum, ProductTypeEnum, ProductVariantEntity } from "./product.js";
|
|
3
|
+
import { OrderEntity, OrderItemEntity, OrderStatusEnum, PaymentStatusEnum, RefundEntity, RefundItemEntity } from "./order.js";
|
|
4
|
+
import { BankAccountEntity, PayoutEntity, PayoutItemEntity, PayoutScheduleEnum, PayoutSettingsEntity, PayoutStatusEnum } from "./payout.js";
|
|
5
|
+
import { ReviewEntity, ReviewReportEntity, ReviewResponseEntity, ReviewStatusEnum, ReviewTypeEnum, ReviewVoteEntity } from "./review.js";
|
|
6
|
+
|
|
7
|
+
//#region src/entities/index.ts
|
|
8
|
+
const marketplaceEntities = [
|
|
9
|
+
StoreEntity,
|
|
10
|
+
StoreCategoryEntity,
|
|
11
|
+
ProductEntity,
|
|
12
|
+
ProductVariantEntity,
|
|
13
|
+
CategoryEntity,
|
|
14
|
+
OrderEntity,
|
|
15
|
+
OrderItemEntity,
|
|
16
|
+
RefundEntity,
|
|
17
|
+
RefundItemEntity,
|
|
18
|
+
PayoutEntity,
|
|
19
|
+
PayoutItemEntity,
|
|
20
|
+
BankAccountEntity,
|
|
21
|
+
PayoutSettingsEntity,
|
|
22
|
+
ReviewEntity,
|
|
23
|
+
ReviewResponseEntity,
|
|
24
|
+
ReviewVoteEntity,
|
|
25
|
+
ReviewReportEntity
|
|
26
|
+
];
|
|
27
|
+
const marketplaceSchemaContribution = {
|
|
28
|
+
moduleId: "@contractspec/example.marketplace",
|
|
29
|
+
entities: marketplaceEntities,
|
|
30
|
+
enums: [
|
|
31
|
+
StoreStatusEnum,
|
|
32
|
+
StoreTypeEnum,
|
|
33
|
+
ProductStatusEnum,
|
|
34
|
+
ProductTypeEnum,
|
|
35
|
+
OrderStatusEnum,
|
|
36
|
+
PaymentStatusEnum,
|
|
37
|
+
PayoutStatusEnum,
|
|
38
|
+
PayoutScheduleEnum,
|
|
39
|
+
ReviewStatusEnum,
|
|
40
|
+
ReviewTypeEnum
|
|
41
|
+
]
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
//#endregion
|
|
45
|
+
export { BankAccountEntity, CategoryEntity, OrderEntity, OrderItemEntity, OrderStatusEnum, PaymentStatusEnum, PayoutEntity, PayoutItemEntity, PayoutScheduleEnum, PayoutSettingsEntity, PayoutStatusEnum, ProductEntity, ProductStatusEnum, ProductTypeEnum, ProductVariantEntity, RefundEntity, RefundItemEntity, ReviewEntity, ReviewReportEntity, ReviewResponseEntity, ReviewStatusEnum, ReviewTypeEnum, ReviewVoteEntity, StoreCategoryEntity, StoreEntity, StoreStatusEnum, StoreTypeEnum, marketplaceEntities, marketplaceSchemaContribution };
|
|
46
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["marketplaceSchemaContribution: ModuleSchemaContribution"],"sources":["../../src/entities/index.ts"],"sourcesContent":["// Store entities\nexport {\n StoreStatusEnum,\n StoreTypeEnum,\n StoreEntity,\n StoreCategoryEntity,\n} from './store';\n\n// Product entities\nexport {\n ProductStatusEnum,\n ProductTypeEnum,\n ProductEntity,\n ProductVariantEntity,\n CategoryEntity,\n} from './product';\n\n// Order entities\nexport {\n OrderStatusEnum,\n PaymentStatusEnum,\n OrderEntity,\n OrderItemEntity,\n RefundEntity,\n RefundItemEntity,\n} from './order';\n\n// Payout entities\nexport {\n PayoutStatusEnum,\n PayoutScheduleEnum,\n PayoutEntity,\n PayoutItemEntity,\n BankAccountEntity,\n PayoutSettingsEntity,\n} from './payout';\n\n// Review entities\nexport {\n ReviewStatusEnum,\n ReviewTypeEnum,\n ReviewEntity,\n ReviewResponseEntity,\n ReviewVoteEntity,\n ReviewReportEntity,\n} from './review';\n\n// Schema contribution\nimport {\n StoreStatusEnum,\n StoreTypeEnum,\n StoreEntity,\n StoreCategoryEntity,\n} from './store';\nimport {\n ProductStatusEnum,\n ProductTypeEnum,\n ProductEntity,\n ProductVariantEntity,\n CategoryEntity,\n} from './product';\nimport {\n OrderStatusEnum,\n PaymentStatusEnum,\n OrderEntity,\n OrderItemEntity,\n RefundEntity,\n RefundItemEntity,\n} from './order';\nimport {\n PayoutStatusEnum,\n PayoutScheduleEnum,\n PayoutEntity,\n PayoutItemEntity,\n BankAccountEntity,\n PayoutSettingsEntity,\n} from './payout';\nimport {\n ReviewStatusEnum,\n ReviewTypeEnum,\n ReviewEntity,\n ReviewResponseEntity,\n ReviewVoteEntity,\n ReviewReportEntity,\n} from './review';\nimport type { ModuleSchemaContribution } from '@contractspec/lib.schema';\n\nexport const marketplaceEntities = [\n // Store\n StoreEntity,\n StoreCategoryEntity,\n\n // Product\n ProductEntity,\n ProductVariantEntity,\n CategoryEntity,\n\n // Order\n OrderEntity,\n OrderItemEntity,\n RefundEntity,\n RefundItemEntity,\n\n // Payout\n PayoutEntity,\n PayoutItemEntity,\n BankAccountEntity,\n PayoutSettingsEntity,\n\n // Review\n ReviewEntity,\n ReviewResponseEntity,\n ReviewVoteEntity,\n ReviewReportEntity,\n];\n\nexport const marketplaceSchemaContribution: ModuleSchemaContribution = {\n moduleId: '@contractspec/example.marketplace',\n entities: marketplaceEntities,\n enums: [\n StoreStatusEnum,\n StoreTypeEnum,\n ProductStatusEnum,\n ProductTypeEnum,\n OrderStatusEnum,\n PaymentStatusEnum,\n PayoutStatusEnum,\n PayoutScheduleEnum,\n ReviewStatusEnum,\n ReviewTypeEnum,\n ],\n};\n"],"mappings":";;;;;;;AAuFA,MAAa,sBAAsB;CAEjC;CACA;CAGA;CACA;CACA;CAGA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CACD;AAED,MAAaA,gCAA0D;CACrE,UAAU;CACV,UAAU;CACV,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACF"}
|