@base44/app-plugin-commerce 0.1.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 +117 -0
- package/base44/agents/commerce/StoreAdmin.jsonc +64 -0
- package/base44/entities/commerce.Cart.jsonc +73 -0
- package/base44/entities/commerce.Coupon.jsonc +113 -0
- package/base44/entities/commerce.Customer.jsonc +96 -0
- package/base44/entities/commerce.DownloadPermission.jsonc +54 -0
- package/base44/entities/commerce.EmailLog.jsonc +43 -0
- package/base44/entities/commerce.Order.jsonc +287 -0
- package/base44/entities/commerce.OrderNote.jsonc +31 -0
- package/base44/entities/commerce.OrderRefund.jsonc +64 -0
- package/base44/entities/commerce.PaymentGateway.jsonc +48 -0
- package/base44/entities/commerce.Product.jsonc +291 -0
- package/base44/entities/commerce.ProductAttribute.jsonc +39 -0
- package/base44/entities/commerce.ProductAttributeTerm.jsonc +38 -0
- package/base44/entities/commerce.ProductCategory.jsonc +51 -0
- package/base44/entities/commerce.ProductReview.jsonc +48 -0
- package/base44/entities/commerce.ProductTag.jsonc +30 -0
- package/base44/entities/commerce.ProductVariation.jsonc +167 -0
- package/base44/entities/commerce.ShippingClass.jsonc +30 -0
- package/base44/entities/commerce.ShippingZone.jsonc +41 -0
- package/base44/entities/commerce.ShippingZoneMethod.jsonc +84 -0
- package/base44/entities/commerce.StoreSettings.jsonc +23 -0
- package/base44/entities/commerce.TaxClass.jsonc +23 -0
- package/base44/entities/commerce.TaxRate.jsonc +68 -0
- package/base44/entities/commerce.Webhook.jsonc +57 -0
- package/base44/entities/commerce.WebhookDelivery.jsonc +45 -0
- package/base44/functions/commerce/admin-coupons/entry.ts +100 -0
- package/base44/functions/commerce/admin-customers/entry.ts +141 -0
- package/base44/functions/commerce/admin-orders/entry.ts +396 -0
- package/base44/functions/commerce/admin-orders/helpers.ts +246 -0
- package/base44/functions/commerce/admin-products/entry.ts +506 -0
- package/base44/functions/commerce/admin-refunds/entry.ts +158 -0
- package/base44/functions/commerce/admin-reports/entry.ts +283 -0
- package/base44/functions/commerce/admin-reviews/entry.ts +66 -0
- package/base44/functions/commerce/admin-tools/entry.ts +261 -0
- package/base44/functions/commerce/admin-webhooks/entry.ts +52 -0
- package/base44/functions/commerce/payment-webhook/entry.ts +135 -0
- package/base44/functions/commerce/payments/entry.ts +238 -0
- package/base44/functions/commerce/seed-store/defaults.ts +162 -0
- package/base44/functions/commerce/seed-store/entry.ts +310 -0
- package/base44/functions/commerce/seed-store/sample-data.ts +349 -0
- package/base44/functions/commerce/storefront-account/entry.ts +207 -0
- package/base44/functions/commerce/storefront-cart/cart-pricing.ts +258 -0
- package/base44/functions/commerce/storefront-cart/entry.ts +283 -0
- package/base44/functions/commerce/storefront-catalog/entry.ts +459 -0
- package/base44/functions/commerce/storefront-checkout/cart-pricing.ts +258 -0
- package/base44/functions/commerce/storefront-checkout/entry.ts +485 -0
- package/base44/shared/commerce/auth.ts +60 -0
- package/base44/shared/commerce/coupons.ts +257 -0
- package/base44/shared/commerce/data/continents.ts +75 -0
- package/base44/shared/commerce/data/countries.ts +307 -0
- package/base44/shared/commerce/data/currencies.ts +46 -0
- package/base44/shared/commerce/email-templates.ts +240 -0
- package/base44/shared/commerce/emails.ts +225 -0
- package/base44/shared/commerce/money.ts +66 -0
- package/base44/shared/commerce/orders.ts +251 -0
- package/base44/shared/commerce/payments.ts +495 -0
- package/base44/shared/commerce/reviews.ts +36 -0
- package/base44/shared/commerce/scan.ts +57 -0
- package/base44/shared/commerce/sequence.ts +35 -0
- package/base44/shared/commerce/settings.ts +57 -0
- package/base44/shared/commerce/shipping.ts +215 -0
- package/base44/shared/commerce/stock.ts +227 -0
- package/base44/shared/commerce/stripe.ts +463 -0
- package/base44/shared/commerce/tax.ts +136 -0
- package/base44/shared/commerce/totals.ts +314 -0
- package/base44/shared/commerce/webhooks.ts +116 -0
- package/package.json +37 -0
- package/scripts/install.js +156 -0
- package/skills/commerce/SKILL.md +62 -0
- package/skills/commerce/docs/api-admin.md +186 -0
- package/skills/commerce/docs/api-storefront.md +408 -0
- package/skills/commerce/installation-guidelines.md +91 -0
- package/skills/commerce/post-installation.md +157 -0
- package/skills/commerce/references/emails.md +13 -0
- package/skills/commerce/references/guest-access-security.md +18 -0
- package/skills/commerce/references/limits-and-performance.md +16 -0
- package/skills/commerce/references/media-and-downloads.md +4 -0
- package/skills/commerce/references/online-payments.md +201 -0
- package/skills/commerce/references/product-render.md +87 -0
- package/skills/commerce/references/scheduled-work.md +19 -0
- package/skills/commerce/references/storefront-product-page.md +83 -0
- package/skills/commerce/references/webhooks.md +8 -0
- package/src/commerce/admin/README.md +107 -0
- package/src/commerce/admin/bot/Markdown.jsx +138 -0
- package/src/commerce/admin/bot/StoreAdminBot.jsx +249 -0
- package/src/commerce/admin/bot/pipe-tables.js +116 -0
- package/src/commerce/admin/components/AddressForm.jsx +78 -0
- package/src/commerce/admin/components/ConfirmDialog.jsx +52 -0
- package/src/commerce/admin/components/CountrySelect.jsx +81 -0
- package/src/commerce/admin/components/DataTable.jsx +192 -0
- package/src/commerce/admin/components/DateRangePicker.jsx +91 -0
- package/src/commerce/admin/components/EmptyState.jsx +17 -0
- package/src/commerce/admin/components/MediaUploader.jsx +116 -0
- package/src/commerce/admin/components/MetaDataEditor.jsx +45 -0
- package/src/commerce/admin/components/MoneyInput.jsx +50 -0
- package/src/commerce/admin/components/PageHeader.jsx +29 -0
- package/src/commerce/admin/components/RichTextarea.jsx +21 -0
- package/src/commerce/admin/components/SearchSelect.jsx +142 -0
- package/src/commerce/admin/components/StatusBadge.jsx +17 -0
- package/src/commerce/admin/context/BasePathContext.jsx +26 -0
- package/src/commerce/admin/context/SettingsContext.jsx +207 -0
- package/src/commerce/admin/hooks/useAsync.js +46 -0
- package/src/commerce/admin/hooks/useDebounce.js +11 -0
- package/src/commerce/admin/hooks/useMoney.js +52 -0
- package/src/commerce/admin/hooks/usePagedList.js +83 -0
- package/src/commerce/admin/hooks/usePaymentProvider.js +27 -0
- package/src/commerce/admin/hooks/useRealtime.js +129 -0
- package/src/commerce/admin/index.jsx +34 -0
- package/src/commerce/admin/layout/AccessDenied.jsx +54 -0
- package/src/commerce/admin/layout/AdminLayout.jsx +33 -0
- package/src/commerce/admin/layout/AuthGuard.jsx +84 -0
- package/src/commerce/admin/layout/Sidebar.jsx +130 -0
- package/src/commerce/admin/layout/Topbar.jsx +94 -0
- package/src/commerce/admin/lib/api.js +55 -0
- package/src/commerce/admin/lib/constants.js +157 -0
- package/src/commerce/admin/lib/format.js +27 -0
- package/src/commerce/admin/lib/geo-data.js +125 -0
- package/src/commerce/admin/lib/order-utils.js +147 -0
- package/src/commerce/admin/lib/paths.js +35 -0
- package/src/commerce/admin/lib/product-utils.js +55 -0
- package/src/commerce/admin/pages/Dashboard.jsx +245 -0
- package/src/commerce/admin/pages/coupons/CouponEditor.jsx +565 -0
- package/src/commerce/admin/pages/coupons/CouponsList.jsx +172 -0
- package/src/commerce/admin/pages/customers/CustomerEditor.jsx +318 -0
- package/src/commerce/admin/pages/customers/CustomersList.jsx +169 -0
- package/src/commerce/admin/pages/orders/OrderEditor.jsx +952 -0
- package/src/commerce/admin/pages/orders/OrdersList.jsx +227 -0
- package/src/commerce/admin/pages/orders/components/AddProductDialog.jsx +149 -0
- package/src/commerce/admin/pages/orders/components/DownloadPermissionsPanel.jsx +119 -0
- package/src/commerce/admin/pages/orders/components/LineItemsTable.jsx +208 -0
- package/src/commerce/admin/pages/orders/components/OrderNotesPanel.jsx +123 -0
- package/src/commerce/admin/pages/orders/components/PaymentPanel.jsx +199 -0
- package/src/commerce/admin/pages/orders/components/RefundPanel.jsx +239 -0
- package/src/commerce/admin/pages/orders/components/TotalsBox.jsx +52 -0
- package/src/commerce/admin/pages/products/AttributeTerms.jsx +180 -0
- package/src/commerce/admin/pages/products/Attributes.jsx +183 -0
- package/src/commerce/admin/pages/products/Categories.jsx +236 -0
- package/src/commerce/admin/pages/products/ProductEditor.jsx +267 -0
- package/src/commerce/admin/pages/products/ProductsList.jsx +391 -0
- package/src/commerce/admin/pages/products/Reviews.jsx +255 -0
- package/src/commerce/admin/pages/products/Tags.jsx +150 -0
- package/src/commerce/admin/pages/products/components/ProductDataPanel.jsx +132 -0
- package/src/commerce/admin/pages/products/components/PublishBox.jsx +101 -0
- package/src/commerce/admin/pages/products/components/TaxonomyPanel.jsx +243 -0
- package/src/commerce/admin/pages/products/components/tabs/AdvancedTab.jsx +48 -0
- package/src/commerce/admin/pages/products/components/tabs/AttributesTab.jsx +208 -0
- package/src/commerce/admin/pages/products/components/tabs/DownloadsTab.jsx +91 -0
- package/src/commerce/admin/pages/products/components/tabs/ExternalTab.jsx +41 -0
- package/src/commerce/admin/pages/products/components/tabs/GeneralTab.jsx +103 -0
- package/src/commerce/admin/pages/products/components/tabs/InventoryTab.jsx +93 -0
- package/src/commerce/admin/pages/products/components/tabs/LinkedTab.jsx +102 -0
- package/src/commerce/admin/pages/products/components/tabs/ShippingTab.jsx +86 -0
- package/src/commerce/admin/pages/products/components/tabs/VariationsTab.jsx +377 -0
- package/src/commerce/admin/pages/reports/Reports.jsx +416 -0
- package/src/commerce/admin/pages/settings/EmailsSettings.jsx +240 -0
- package/src/commerce/admin/pages/settings/GeneralSettings.jsx +232 -0
- package/src/commerce/admin/pages/settings/InventorySettings.jsx +146 -0
- package/src/commerce/admin/pages/settings/PaymentsSettings.jsx +260 -0
- package/src/commerce/admin/pages/settings/ProductsSettings.jsx +118 -0
- package/src/commerce/admin/pages/settings/SettingsLayout.jsx +53 -0
- package/src/commerce/admin/pages/settings/ShippingSettings.jsx +304 -0
- package/src/commerce/admin/pages/settings/ShippingZoneEditor.jsx +514 -0
- package/src/commerce/admin/pages/settings/TaxRatesTable.jsx +231 -0
- package/src/commerce/admin/pages/settings/TaxSettings.jsx +281 -0
- package/src/commerce/admin/pages/settings/useGroupForm.jsx +76 -0
- package/src/commerce/admin/pages/status/WebhookEditor.jsx +296 -0
- package/src/commerce/admin/pages/status/Webhooks.jsx +53 -0
- package/src/commerce/admin/routes.jsx +151 -0
- package/src/commerce/utils/index.js +19 -0
- package/src/commerce/utils/shipping-promos.js +99 -0
- package/src/commerce/utils/variants.js +411 -0
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "commerce.Product",
|
|
3
|
+
"type": "object",
|
|
4
|
+
"description": "A store product (simple, grouped, external, or variable). Full-featured product model.",
|
|
5
|
+
"properties": {
|
|
6
|
+
"name": {
|
|
7
|
+
"type": "string",
|
|
8
|
+
"minLength": 1,
|
|
9
|
+
"description": "Product name"
|
|
10
|
+
},
|
|
11
|
+
"slug": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"description": "URL slug, unique (enforced in commerce/admin-products)"
|
|
14
|
+
},
|
|
15
|
+
"type": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"enum": ["simple", "grouped", "external", "variable"],
|
|
18
|
+
"default": "simple",
|
|
19
|
+
"description": "Product type"
|
|
20
|
+
},
|
|
21
|
+
"status": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"enum": ["draft", "pending", "private", "publish"],
|
|
24
|
+
"default": "draft",
|
|
25
|
+
"description": "Publication status"
|
|
26
|
+
},
|
|
27
|
+
"featured": {
|
|
28
|
+
"type": "boolean",
|
|
29
|
+
"default": false,
|
|
30
|
+
"description": "Featured product flag"
|
|
31
|
+
},
|
|
32
|
+
"catalog_visibility": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"enum": ["visible", "catalog", "search", "hidden"],
|
|
35
|
+
"default": "visible",
|
|
36
|
+
"description": "Where the product is visible in the catalog"
|
|
37
|
+
},
|
|
38
|
+
"description": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"format": "richtext",
|
|
41
|
+
"description": "Full product description (HTML)"
|
|
42
|
+
},
|
|
43
|
+
"short_description": {
|
|
44
|
+
"type": "string",
|
|
45
|
+
"description": "Short product description"
|
|
46
|
+
},
|
|
47
|
+
"sku": {
|
|
48
|
+
"type": "string",
|
|
49
|
+
"description": "Stock keeping unit, unique incl. variations (enforced in commerce/admin-products)"
|
|
50
|
+
},
|
|
51
|
+
"regular_price": {
|
|
52
|
+
"type": "number",
|
|
53
|
+
"minimum": 0,
|
|
54
|
+
"description": "Regular price"
|
|
55
|
+
},
|
|
56
|
+
"sale_price": {
|
|
57
|
+
"type": "number",
|
|
58
|
+
"minimum": 0,
|
|
59
|
+
"description": "Sale price"
|
|
60
|
+
},
|
|
61
|
+
"date_on_sale_from": {
|
|
62
|
+
"type": "string",
|
|
63
|
+
"format": "date-time",
|
|
64
|
+
"description": "Start of the sale window"
|
|
65
|
+
},
|
|
66
|
+
"date_on_sale_to": {
|
|
67
|
+
"type": "string",
|
|
68
|
+
"format": "date-time",
|
|
69
|
+
"description": "End of the sale window"
|
|
70
|
+
},
|
|
71
|
+
"price": {
|
|
72
|
+
"type": "number",
|
|
73
|
+
"description": "Derived: sale_price when sale is active, else regular_price. Maintained by commerce/admin-products."
|
|
74
|
+
},
|
|
75
|
+
"on_sale": {
|
|
76
|
+
"type": "boolean",
|
|
77
|
+
"default": false,
|
|
78
|
+
"description": "Derived: whether the sale window is currently active. Maintained by commerce/admin-products."
|
|
79
|
+
},
|
|
80
|
+
"virtual": {
|
|
81
|
+
"type": "boolean",
|
|
82
|
+
"default": false,
|
|
83
|
+
"description": "Virtual product (no shipping)"
|
|
84
|
+
},
|
|
85
|
+
"downloadable": {
|
|
86
|
+
"type": "boolean",
|
|
87
|
+
"default": false,
|
|
88
|
+
"description": "Downloadable product"
|
|
89
|
+
},
|
|
90
|
+
"downloads": {
|
|
91
|
+
"type": "array",
|
|
92
|
+
"description": "Downloadable files",
|
|
93
|
+
"items": {
|
|
94
|
+
"type": "object",
|
|
95
|
+
"properties": {
|
|
96
|
+
"name": { "type": "string" },
|
|
97
|
+
"file_url": { "type": "string", "format": "uri" }
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
"download_limit": {
|
|
102
|
+
"type": "integer",
|
|
103
|
+
"default": -1,
|
|
104
|
+
"description": "Max downloads per permission, -1 = unlimited"
|
|
105
|
+
},
|
|
106
|
+
"download_expiry": {
|
|
107
|
+
"type": "integer",
|
|
108
|
+
"default": -1,
|
|
109
|
+
"description": "Days until download access expires, -1 = never"
|
|
110
|
+
},
|
|
111
|
+
"external_url": {
|
|
112
|
+
"type": "string",
|
|
113
|
+
"format": "uri",
|
|
114
|
+
"description": "Target URL for external/affiliate products"
|
|
115
|
+
},
|
|
116
|
+
"button_text": {
|
|
117
|
+
"type": "string",
|
|
118
|
+
"description": "Buy-button text for external products"
|
|
119
|
+
},
|
|
120
|
+
"tax_status": {
|
|
121
|
+
"type": "string",
|
|
122
|
+
"enum": ["taxable", "shipping", "none"],
|
|
123
|
+
"default": "taxable",
|
|
124
|
+
"description": "Tax status"
|
|
125
|
+
},
|
|
126
|
+
"tax_class": {
|
|
127
|
+
"type": "string",
|
|
128
|
+
"default": "standard",
|
|
129
|
+
"description": "TaxClass slug"
|
|
130
|
+
},
|
|
131
|
+
"manage_stock": {
|
|
132
|
+
"type": "boolean",
|
|
133
|
+
"default": false,
|
|
134
|
+
"description": "Track stock quantity for this product"
|
|
135
|
+
},
|
|
136
|
+
"stock_quantity": {
|
|
137
|
+
"type": "integer",
|
|
138
|
+
"description": "Current stock level (when manage_stock)"
|
|
139
|
+
},
|
|
140
|
+
"stock_status": {
|
|
141
|
+
"type": "string",
|
|
142
|
+
"enum": ["instock", "outofstock", "onbackorder"],
|
|
143
|
+
"default": "instock",
|
|
144
|
+
"description": "Stock status; derived from stock_quantity/backorders when manage_stock"
|
|
145
|
+
},
|
|
146
|
+
"backorders": {
|
|
147
|
+
"type": "string",
|
|
148
|
+
"enum": ["no", "notify", "yes"],
|
|
149
|
+
"default": "no",
|
|
150
|
+
"description": "Allow backorders"
|
|
151
|
+
},
|
|
152
|
+
"low_stock_amount": {
|
|
153
|
+
"type": "integer",
|
|
154
|
+
"description": "Low-stock notification threshold; overrides store default"
|
|
155
|
+
},
|
|
156
|
+
"sold_individually": {
|
|
157
|
+
"type": "boolean",
|
|
158
|
+
"default": false,
|
|
159
|
+
"description": "Limit purchases to 1 per order"
|
|
160
|
+
},
|
|
161
|
+
"weight": {
|
|
162
|
+
"type": "number",
|
|
163
|
+
"description": "Weight in store weight unit"
|
|
164
|
+
},
|
|
165
|
+
"dimensions": {
|
|
166
|
+
"type": "object",
|
|
167
|
+
"description": "Dimensions in store dimension unit",
|
|
168
|
+
"properties": {
|
|
169
|
+
"length": { "type": "number" },
|
|
170
|
+
"width": { "type": "number" },
|
|
171
|
+
"height": { "type": "number" }
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
"shipping_class_id": {
|
|
175
|
+
"type": "string",
|
|
176
|
+
"description": "ShippingClass id"
|
|
177
|
+
},
|
|
178
|
+
"reviews_allowed": {
|
|
179
|
+
"type": "boolean",
|
|
180
|
+
"default": true,
|
|
181
|
+
"description": "Allow customer reviews"
|
|
182
|
+
},
|
|
183
|
+
"average_rating": {
|
|
184
|
+
"type": "number",
|
|
185
|
+
"default": 0,
|
|
186
|
+
"description": "Derived from approved reviews. Maintained by commerce/admin-reviews."
|
|
187
|
+
},
|
|
188
|
+
"rating_count": {
|
|
189
|
+
"type": "integer",
|
|
190
|
+
"default": 0,
|
|
191
|
+
"description": "Derived count of approved review ratings. Maintained by commerce/admin-reviews."
|
|
192
|
+
},
|
|
193
|
+
"upsell_ids": {
|
|
194
|
+
"type": "array",
|
|
195
|
+
"items": { "type": "string" },
|
|
196
|
+
"description": "Upsell Product ids"
|
|
197
|
+
},
|
|
198
|
+
"cross_sell_ids": {
|
|
199
|
+
"type": "array",
|
|
200
|
+
"items": { "type": "string" },
|
|
201
|
+
"description": "Cross-sell Product ids"
|
|
202
|
+
},
|
|
203
|
+
"grouped_products": {
|
|
204
|
+
"type": "array",
|
|
205
|
+
"items": { "type": "string" },
|
|
206
|
+
"description": "Child Product ids for type=grouped"
|
|
207
|
+
},
|
|
208
|
+
"purchase_note": {
|
|
209
|
+
"type": "string",
|
|
210
|
+
"description": "Note shown to the customer after purchase"
|
|
211
|
+
},
|
|
212
|
+
"category_ids": {
|
|
213
|
+
"type": "array",
|
|
214
|
+
"items": { "type": "string" },
|
|
215
|
+
"description": "ProductCategory ids"
|
|
216
|
+
},
|
|
217
|
+
"tag_ids": {
|
|
218
|
+
"type": "array",
|
|
219
|
+
"items": { "type": "string" },
|
|
220
|
+
"description": "ProductTag ids"
|
|
221
|
+
},
|
|
222
|
+
"images": {
|
|
223
|
+
"type": "array",
|
|
224
|
+
"description": "Product images; first image = primary. URLs from Core.UploadFile.",
|
|
225
|
+
"items": {
|
|
226
|
+
"type": "object",
|
|
227
|
+
"properties": {
|
|
228
|
+
"src": { "type": "string", "format": "uri" },
|
|
229
|
+
"name": { "type": "string" },
|
|
230
|
+
"alt": { "type": "string" },
|
|
231
|
+
"position": { "type": "integer" }
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
"attributes": {
|
|
236
|
+
"type": "array",
|
|
237
|
+
"description": "Assigned attributes (global via attribute_id, or custom/local when attribute_id is empty)",
|
|
238
|
+
"items": {
|
|
239
|
+
"type": "object",
|
|
240
|
+
"properties": {
|
|
241
|
+
"attribute_id": { "type": "string", "description": "ProductAttribute id; empty for custom/local attribute" },
|
|
242
|
+
"name": { "type": "string" },
|
|
243
|
+
"position": { "type": "integer" },
|
|
244
|
+
"visible": { "type": "boolean", "description": "Visible on the product page" },
|
|
245
|
+
"variation": { "type": "boolean", "description": "Used for variations" },
|
|
246
|
+
"options": { "type": "array", "items": { "type": "string" } }
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
"default_attributes": {
|
|
251
|
+
"type": "array",
|
|
252
|
+
"description": "Pre-selected variation attributes for variable products",
|
|
253
|
+
"items": {
|
|
254
|
+
"type": "object",
|
|
255
|
+
"properties": {
|
|
256
|
+
"attribute_id": { "type": "string" },
|
|
257
|
+
"name": { "type": "string" },
|
|
258
|
+
"option": { "type": "string" }
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
"menu_order": {
|
|
263
|
+
"type": "integer",
|
|
264
|
+
"default": 0,
|
|
265
|
+
"description": "Custom sort position"
|
|
266
|
+
},
|
|
267
|
+
"total_sales": {
|
|
268
|
+
"type": "integer",
|
|
269
|
+
"default": 0,
|
|
270
|
+
"description": "Units sold. Maintained by the order lifecycle (shared/stock)."
|
|
271
|
+
},
|
|
272
|
+
"meta_data": {
|
|
273
|
+
"type": "array",
|
|
274
|
+
"description": "Custom key/value metadata",
|
|
275
|
+
"items": {
|
|
276
|
+
"type": "object",
|
|
277
|
+
"properties": {
|
|
278
|
+
"key": { "type": "string" },
|
|
279
|
+
"value": { "type": "string" }
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
},
|
|
284
|
+
"required": ["name"],
|
|
285
|
+
"rls": {
|
|
286
|
+
"read": { "user_condition": { "role": "admin" } },
|
|
287
|
+
"create": { "user_condition": { "role": "admin" } },
|
|
288
|
+
"update": { "user_condition": { "role": "admin" } },
|
|
289
|
+
"delete": { "user_condition": { "role": "admin" } }
|
|
290
|
+
}
|
|
291
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "commerce.ProductAttribute",
|
|
3
|
+
"type": "object",
|
|
4
|
+
"description": "Global product attribute (e.g. Color, Size). Terms live in ProductAttributeTerm.",
|
|
5
|
+
"properties": {
|
|
6
|
+
"name": {
|
|
7
|
+
"type": "string",
|
|
8
|
+
"minLength": 1
|
|
9
|
+
},
|
|
10
|
+
"slug": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"description": "Unique slug (enforced in admin UI / functions)"
|
|
13
|
+
},
|
|
14
|
+
"type": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"enum": ["select"],
|
|
17
|
+
"default": "select",
|
|
18
|
+
"description": "Attribute type"
|
|
19
|
+
},
|
|
20
|
+
"order_by": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"enum": ["menu_order", "name", "name_num", "id"],
|
|
23
|
+
"default": "menu_order",
|
|
24
|
+
"description": "Default term sort order"
|
|
25
|
+
},
|
|
26
|
+
"has_archives": {
|
|
27
|
+
"type": "boolean",
|
|
28
|
+
"default": false,
|
|
29
|
+
"description": "Enable attribute archives"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"required": ["name"],
|
|
33
|
+
"rls": {
|
|
34
|
+
"read": { "user_condition": { "role": "admin" } },
|
|
35
|
+
"create": { "user_condition": { "role": "admin" } },
|
|
36
|
+
"update": { "user_condition": { "role": "admin" } },
|
|
37
|
+
"delete": { "user_condition": { "role": "admin" } }
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "commerce.ProductAttributeTerm",
|
|
3
|
+
"type": "object",
|
|
4
|
+
"description": "A term (option value) of a global ProductAttribute.",
|
|
5
|
+
"properties": {
|
|
6
|
+
"attribute_id": {
|
|
7
|
+
"type": "string",
|
|
8
|
+
"description": "Parent ProductAttribute id"
|
|
9
|
+
},
|
|
10
|
+
"name": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"minLength": 1
|
|
13
|
+
},
|
|
14
|
+
"slug": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"description": "Unique within the attribute (enforced in admin UI / functions)"
|
|
17
|
+
},
|
|
18
|
+
"description": {
|
|
19
|
+
"type": "string"
|
|
20
|
+
},
|
|
21
|
+
"menu_order": {
|
|
22
|
+
"type": "integer",
|
|
23
|
+
"default": 0
|
|
24
|
+
},
|
|
25
|
+
"count": {
|
|
26
|
+
"type": "integer",
|
|
27
|
+
"default": 0,
|
|
28
|
+
"description": "Derived product count. Maintained by commerce/admin-products; repair via commerce/admin-tools recount-terms."
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"required": ["attribute_id", "name"],
|
|
32
|
+
"rls": {
|
|
33
|
+
"read": { "user_condition": { "role": "admin" } },
|
|
34
|
+
"create": { "user_condition": { "role": "admin" } },
|
|
35
|
+
"update": { "user_condition": { "role": "admin" } },
|
|
36
|
+
"delete": { "user_condition": { "role": "admin" } }
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "commerce.ProductCategory",
|
|
3
|
+
"type": "object",
|
|
4
|
+
"description": "Hierarchical product category.",
|
|
5
|
+
"properties": {
|
|
6
|
+
"name": {
|
|
7
|
+
"type": "string",
|
|
8
|
+
"minLength": 1
|
|
9
|
+
},
|
|
10
|
+
"slug": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"description": "URL slug, unique (enforced in admin UI / functions)"
|
|
13
|
+
},
|
|
14
|
+
"parent_id": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"description": "Parent ProductCategory id; empty = top level"
|
|
17
|
+
},
|
|
18
|
+
"description": {
|
|
19
|
+
"type": "string"
|
|
20
|
+
},
|
|
21
|
+
"display": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"enum": ["default", "products", "subcategories", "both"],
|
|
24
|
+
"default": "default",
|
|
25
|
+
"description": "Archive display type"
|
|
26
|
+
},
|
|
27
|
+
"image": {
|
|
28
|
+
"type": "object",
|
|
29
|
+
"properties": {
|
|
30
|
+
"src": { "type": "string", "format": "uri" },
|
|
31
|
+
"alt": { "type": "string" }
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"menu_order": {
|
|
35
|
+
"type": "integer",
|
|
36
|
+
"default": 0
|
|
37
|
+
},
|
|
38
|
+
"count": {
|
|
39
|
+
"type": "integer",
|
|
40
|
+
"default": 0,
|
|
41
|
+
"description": "Derived product count. Maintained by commerce/admin-products; repair via commerce/admin-tools recount-terms."
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"required": ["name"],
|
|
45
|
+
"rls": {
|
|
46
|
+
"read": { "user_condition": { "role": "admin" } },
|
|
47
|
+
"create": { "user_condition": { "role": "admin" } },
|
|
48
|
+
"update": { "user_condition": { "role": "admin" } },
|
|
49
|
+
"delete": { "user_condition": { "role": "admin" } }
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "commerce.ProductReview",
|
|
3
|
+
"type": "object",
|
|
4
|
+
"description": "Customer product review. Admin-only RLS; the storefront reads approved reviews via commerce/storefront-catalog (service role) so unapproved reviews never leak.",
|
|
5
|
+
"properties": {
|
|
6
|
+
"product_id": {
|
|
7
|
+
"type": "string",
|
|
8
|
+
"description": "Reviewed Product id"
|
|
9
|
+
},
|
|
10
|
+
"status": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"enum": ["approved", "hold", "spam", "trash"],
|
|
13
|
+
"default": "hold",
|
|
14
|
+
"description": "Moderation status"
|
|
15
|
+
},
|
|
16
|
+
"reviewer": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"description": "Reviewer display name"
|
|
19
|
+
},
|
|
20
|
+
"reviewer_email": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"format": "email",
|
|
23
|
+
"description": "Set from the signed-in reviewer's session, never from the request payload."
|
|
24
|
+
},
|
|
25
|
+
"review": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"description": "Review content"
|
|
28
|
+
},
|
|
29
|
+
"rating": {
|
|
30
|
+
"type": "integer",
|
|
31
|
+
"minimum": 0,
|
|
32
|
+
"maximum": 5,
|
|
33
|
+
"description": "Star rating 0-5"
|
|
34
|
+
},
|
|
35
|
+
"verified": {
|
|
36
|
+
"type": "boolean",
|
|
37
|
+
"default": false,
|
|
38
|
+
"description": "Derived: reviewer purchased the product. Set by commerce/storefront-catalog submit-review."
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"required": ["product_id", "review"],
|
|
42
|
+
"rls": {
|
|
43
|
+
"read": { "user_condition": { "role": "admin" } },
|
|
44
|
+
"create": { "user_condition": { "role": "admin" } },
|
|
45
|
+
"update": { "user_condition": { "role": "admin" } },
|
|
46
|
+
"delete": { "user_condition": { "role": "admin" } }
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "commerce.ProductTag",
|
|
3
|
+
"type": "object",
|
|
4
|
+
"description": "Product tag.",
|
|
5
|
+
"properties": {
|
|
6
|
+
"name": {
|
|
7
|
+
"type": "string",
|
|
8
|
+
"minLength": 1
|
|
9
|
+
},
|
|
10
|
+
"slug": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"description": "URL slug, unique (enforced in admin UI / functions)"
|
|
13
|
+
},
|
|
14
|
+
"description": {
|
|
15
|
+
"type": "string"
|
|
16
|
+
},
|
|
17
|
+
"count": {
|
|
18
|
+
"type": "integer",
|
|
19
|
+
"default": 0,
|
|
20
|
+
"description": "Derived product count. Maintained by commerce/admin-products; repair via commerce/admin-tools recount-terms."
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"required": ["name"],
|
|
24
|
+
"rls": {
|
|
25
|
+
"read": { "user_condition": { "role": "admin" } },
|
|
26
|
+
"create": { "user_condition": { "role": "admin" } },
|
|
27
|
+
"update": { "user_condition": { "role": "admin" } },
|
|
28
|
+
"delete": { "user_condition": { "role": "admin" } }
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "commerce.ProductVariation",
|
|
3
|
+
"type": "object",
|
|
4
|
+
"description": "A variation of a variable Product, identified by its attribute combination.",
|
|
5
|
+
"properties": {
|
|
6
|
+
"product_id": {
|
|
7
|
+
"type": "string",
|
|
8
|
+
"description": "Parent Product id"
|
|
9
|
+
},
|
|
10
|
+
"attributes": {
|
|
11
|
+
"type": "array",
|
|
12
|
+
"description": "One entry per variation attribute of the parent",
|
|
13
|
+
"items": {
|
|
14
|
+
"type": "object",
|
|
15
|
+
"properties": {
|
|
16
|
+
"attribute_id": { "type": "string" },
|
|
17
|
+
"name": { "type": "string" },
|
|
18
|
+
"option": { "type": "string" }
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"status": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"enum": ["publish", "private", "draft"],
|
|
25
|
+
"default": "publish",
|
|
26
|
+
"description": "Variation status; only publish is purchasable"
|
|
27
|
+
},
|
|
28
|
+
"sku": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"description": "Unique incl. products (enforced in commerce/admin-products)"
|
|
31
|
+
},
|
|
32
|
+
"regular_price": {
|
|
33
|
+
"type": "number",
|
|
34
|
+
"minimum": 0
|
|
35
|
+
},
|
|
36
|
+
"sale_price": {
|
|
37
|
+
"type": "number",
|
|
38
|
+
"minimum": 0
|
|
39
|
+
},
|
|
40
|
+
"date_on_sale_from": {
|
|
41
|
+
"type": "string",
|
|
42
|
+
"format": "date-time"
|
|
43
|
+
},
|
|
44
|
+
"date_on_sale_to": {
|
|
45
|
+
"type": "string",
|
|
46
|
+
"format": "date-time"
|
|
47
|
+
},
|
|
48
|
+
"price": {
|
|
49
|
+
"type": "number",
|
|
50
|
+
"description": "Derived: sale_price when sale active, else regular_price. Maintained by commerce/admin-products."
|
|
51
|
+
},
|
|
52
|
+
"on_sale": {
|
|
53
|
+
"type": "boolean",
|
|
54
|
+
"default": false,
|
|
55
|
+
"description": "Derived. Maintained by commerce/admin-products."
|
|
56
|
+
},
|
|
57
|
+
"virtual": {
|
|
58
|
+
"type": "boolean",
|
|
59
|
+
"default": false
|
|
60
|
+
},
|
|
61
|
+
"downloadable": {
|
|
62
|
+
"type": "boolean",
|
|
63
|
+
"default": false
|
|
64
|
+
},
|
|
65
|
+
"downloads": {
|
|
66
|
+
"type": "array",
|
|
67
|
+
"description": "Downloadable files",
|
|
68
|
+
"items": {
|
|
69
|
+
"type": "object",
|
|
70
|
+
"properties": {
|
|
71
|
+
"name": { "type": "string" },
|
|
72
|
+
"file_url": { "type": "string", "format": "uri" }
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"download_limit": {
|
|
77
|
+
"type": "integer",
|
|
78
|
+
"default": -1,
|
|
79
|
+
"description": "-1 = unlimited"
|
|
80
|
+
},
|
|
81
|
+
"download_expiry": {
|
|
82
|
+
"type": "integer",
|
|
83
|
+
"default": -1,
|
|
84
|
+
"description": "Days until expiry, -1 = never"
|
|
85
|
+
},
|
|
86
|
+
"tax_status": {
|
|
87
|
+
"type": "string",
|
|
88
|
+
"enum": ["taxable", "shipping", "none", "parent"],
|
|
89
|
+
"default": "parent",
|
|
90
|
+
"description": "Tax status; parent = inherit from parent product"
|
|
91
|
+
},
|
|
92
|
+
"tax_class": {
|
|
93
|
+
"type": "string",
|
|
94
|
+
"description": "TaxClass slug; empty = inherit from parent"
|
|
95
|
+
},
|
|
96
|
+
"manage_stock": {
|
|
97
|
+
"type": "string",
|
|
98
|
+
"enum": ["yes", "no", "parent"],
|
|
99
|
+
"default": "parent",
|
|
100
|
+
"description": "Stock management mode; parent = inherit from parent product"
|
|
101
|
+
},
|
|
102
|
+
"stock_quantity": {
|
|
103
|
+
"type": "integer"
|
|
104
|
+
},
|
|
105
|
+
"stock_status": {
|
|
106
|
+
"type": "string",
|
|
107
|
+
"enum": ["instock", "outofstock", "onbackorder"],
|
|
108
|
+
"default": "instock"
|
|
109
|
+
},
|
|
110
|
+
"backorders": {
|
|
111
|
+
"type": "string",
|
|
112
|
+
"enum": ["no", "notify", "yes"],
|
|
113
|
+
"default": "no"
|
|
114
|
+
},
|
|
115
|
+
"low_stock_amount": {
|
|
116
|
+
"type": "integer"
|
|
117
|
+
},
|
|
118
|
+
"weight": {
|
|
119
|
+
"type": "number"
|
|
120
|
+
},
|
|
121
|
+
"dimensions": {
|
|
122
|
+
"type": "object",
|
|
123
|
+
"properties": {
|
|
124
|
+
"length": { "type": "number" },
|
|
125
|
+
"width": { "type": "number" },
|
|
126
|
+
"height": { "type": "number" }
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"shipping_class_id": {
|
|
130
|
+
"type": "string",
|
|
131
|
+
"description": "ShippingClass id; empty = inherit from parent"
|
|
132
|
+
},
|
|
133
|
+
"image": {
|
|
134
|
+
"type": "object",
|
|
135
|
+
"description": "Variation image",
|
|
136
|
+
"properties": {
|
|
137
|
+
"src": { "type": "string", "format": "uri" },
|
|
138
|
+
"name": { "type": "string" },
|
|
139
|
+
"alt": { "type": "string" }
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
"menu_order": {
|
|
143
|
+
"type": "integer",
|
|
144
|
+
"default": 0
|
|
145
|
+
},
|
|
146
|
+
"description": {
|
|
147
|
+
"type": "string"
|
|
148
|
+
},
|
|
149
|
+
"meta_data": {
|
|
150
|
+
"type": "array",
|
|
151
|
+
"items": {
|
|
152
|
+
"type": "object",
|
|
153
|
+
"properties": {
|
|
154
|
+
"key": { "type": "string" },
|
|
155
|
+
"value": { "type": "string" }
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
"required": ["product_id"],
|
|
161
|
+
"rls": {
|
|
162
|
+
"read": { "user_condition": { "role": "admin" } },
|
|
163
|
+
"create": { "user_condition": { "role": "admin" } },
|
|
164
|
+
"update": { "user_condition": { "role": "admin" } },
|
|
165
|
+
"delete": { "user_condition": { "role": "admin" } }
|
|
166
|
+
}
|
|
167
|
+
}
|