@webbycrown/webbycommerce 1.2.1 → 2.0.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/README.md +21 -3
- package/admin/app.js +3 -0
- package/admin/jsconfig.json +20 -0
- package/admin/src/components/ApiCollectionsContent.jsx +4626 -0
- package/admin/src/components/CompareContent.jsx +300 -0
- package/admin/src/components/ConfigureContent.jsx +407 -0
- package/admin/src/components/Initializer.jsx +64 -0
- package/admin/src/components/LoginRegisterContent.jsx +280 -0
- package/admin/src/components/PluginIcon.jsx +6 -0
- package/admin/src/components/ShippingTypeContent.jsx +230 -0
- package/admin/src/components/SmtpContent.jsx +316 -0
- package/admin/src/components/WishlistContent.jsx +273 -0
- package/admin/src/index.js +81 -0
- package/admin/src/pages/ApiCollections.jsx +169 -0
- package/admin/src/pages/Configure.jsx +55 -0
- package/admin/src/pages/Settings.jsx +93 -0
- package/admin/src/pluginId.js +4 -0
- package/{dist/_chunks/en-CiQ97iC8.js → admin/src/translations/en.json} +712 -574
- package/bin/setup.js +50 -3
- package/package.json +14 -13
- package/server/bootstrap.js +3 -0
- package/server/register.js +3 -0
- package/server/src/bootstrap.js +3826 -0
- package/server/src/components/content-block.json +37 -0
- package/server/src/components/shipping-zone-location.json +27 -0
- package/server/src/config/index.js +7 -0
- package/server/src/content-types/address/index.js +7 -0
- package/server/src/content-types/address/schema.json +74 -0
- package/server/src/content-types/cart/index.js +61 -0
- package/server/src/content-types/cart-item/index.js +79 -0
- package/server/src/content-types/compare.js +73 -0
- package/server/src/content-types/coupon/index.js +7 -0
- package/server/src/content-types/coupon/schema.json +67 -0
- package/server/src/content-types/index.js +42 -0
- package/server/src/content-types/order/index.js +7 -0
- package/server/src/content-types/order/schema.json +121 -0
- package/server/src/content-types/payment-transaction/index.js +7 -0
- package/server/src/content-types/payment-transaction/schema.json +73 -0
- package/server/src/content-types/product/index.js +7 -0
- package/server/src/content-types/product/schema.json +104 -0
- package/server/src/content-types/product-attribute/index.js +7 -0
- package/server/src/content-types/product-attribute/schema.json +80 -0
- package/server/src/content-types/product-attribute-value/index.js +7 -0
- package/server/src/content-types/product-attribute-value/schema.json +52 -0
- package/server/src/content-types/product-category/index.js +7 -0
- package/server/src/content-types/product-category/schema.json +54 -0
- package/server/src/content-types/product-tag/index.js +7 -0
- package/server/src/content-types/product-tag/schema.json +38 -0
- package/server/src/content-types/product-variation/index.js +7 -0
- package/server/src/content-types/product-variation/schema.json +74 -0
- package/server/src/content-types/shipping-method/index.js +7 -0
- package/server/src/content-types/shipping-method/schema.json +91 -0
- package/server/src/content-types/shipping-rate/index.js +7 -0
- package/server/src/content-types/shipping-rate/schema.json +73 -0
- package/server/src/content-types/shipping-rule/index.js +7 -0
- package/server/src/content-types/shipping-rule/schema.json +84 -0
- package/server/src/content-types/shipping-zone/index.js +7 -0
- package/server/src/content-types/shipping-zone/schema.json +57 -0
- package/server/src/content-types/wishlist.js +66 -0
- package/server/src/controllers/address.js +374 -0
- package/server/src/controllers/auth.js +1409 -0
- package/server/src/controllers/cart.js +337 -0
- package/server/src/controllers/category.js +388 -0
- package/server/src/controllers/compare.js +246 -0
- package/server/src/controllers/controller.js +168 -0
- package/server/src/controllers/ecommerce.js +20 -0
- package/server/src/controllers/index.js +34 -0
- package/server/src/controllers/order.js +1100 -0
- package/server/src/controllers/payment.js +243 -0
- package/server/src/controllers/product.js +1006 -0
- package/server/src/controllers/productTag.js +370 -0
- package/server/src/controllers/productVariation.js +181 -0
- package/server/src/controllers/shipping.js +1046 -0
- package/server/src/controllers/wishlist.js +332 -0
- package/server/src/destroy.js +6 -0
- package/server/src/index.js +26 -0
- package/server/src/middlewares/index.js +4 -0
- package/server/src/policies/index.js +4 -0
- package/server/src/register.js +67 -0
- package/server/src/routes/index.js +1130 -0
- package/server/src/services/cart.js +531 -0
- package/server/src/services/compare.js +300 -0
- package/server/src/services/index.js +16 -0
- package/server/src/services/service.js +19 -0
- package/server/src/services/shipping.js +513 -0
- package/server/src/services/wishlist.js +238 -0
- package/server/src/utils/check-ecommerce-permission.js +204 -0
- package/server/src/utils/extend-user-schema.js +161 -0
- package/server/src/utils/seed-data.js +639 -0
- package/server/src/utils/send-email.js +98 -0
- package/strapi-server.js +1 -6
- package/dist/_chunks/Settings-Bg2JyQ4c.js +0 -31518
- package/dist/_chunks/Settings-BonPzbwr.mjs +0 -31499
- package/dist/_chunks/en-DE15m4xZ.mjs +0 -574
- package/dist/_chunks/index-BWVy9o1d.mjs +0 -128
- package/dist/_chunks/index-NRuOdjd7.js +0 -127
- package/dist/admin/index.js +0 -3
- package/dist/admin/index.mjs +0 -4
- package/dist/robots.txt +0 -3
- package/dist/server/index.js +0 -27336
- package/dist/uploads/.gitkeep +0 -0
- package/dist/uploads/accessories_category_2a5631094b.jpeg +0 -0
- package/dist/uploads/beauty_personal_care_category_57f8a8f1e3.jpeg +0 -0
- package/dist/uploads/books_category_a9a253eada.jpeg +0 -0
- package/dist/uploads/classic_cotton_tshirt_1_cd713425f6.png +0 -0
- package/dist/uploads/clothing_category_d5c60ef07b.jpeg +0 -0
- package/dist/uploads/daviddoe_strapi_adbcd41787.jpeg +0 -0
- package/dist/uploads/electronics_category_fc3e5ef571.jpeg +0 -0
- package/dist/uploads/ergonomic_office_chair_1_c751cffb07.png +0 -0
- package/dist/uploads/home_garden_category_4f6eb3f8d6.jpeg +0 -0
- package/dist/uploads/istockphoto_1188462138_612x612_11f295b9c0.jpg +0 -0
- package/dist/uploads/istockphoto_1188462138_612x612_396fb272fd.jpg +0 -0
- package/dist/uploads/large_daviddoe_strapi_adbcd41787.jpeg +0 -0
- package/dist/uploads/leather_travel_backpack_1_238bc1ae4d.png +0 -0
- package/dist/uploads/mechanical_keyboard_pro_1_0cd391a6ac.png +0 -0
- package/dist/uploads/medium_classic_cotton_tshirt_1_cd713425f6.png +0 -0
- package/dist/uploads/medium_daviddoe_strapi_adbcd41787.jpeg +0 -0
- package/dist/uploads/medium_ergonomic_office_chair_1_c751cffb07.png +0 -0
- package/dist/uploads/medium_leather_travel_backpack_1_238bc1ae4d.png +0 -0
- package/dist/uploads/medium_mechanical_keyboard_pro_1_0cd391a6ac.png +0 -0
- package/dist/uploads/medium_smart_watch_series_5_1_cdc2511fb7.png +0 -0
- package/dist/uploads/medium_smartphone_x_pro_1_c3f0cbd080.png +0 -0
- package/dist/uploads/medium_the_great_gatsby_special_1_2e7c76d997.png +0 -0
- package/dist/uploads/medium_wireless_headphones_1_fa75cd50c3.png +0 -0
- package/dist/uploads/medium_yoga_mat_premium_1_01f9a3b5fa.png +0 -0
- package/dist/uploads/predictive_maintenance_icons_industry_automation_600nw_2685943461_e18a8aa3b0.webp +0 -0
- package/dist/uploads/small_classic_cotton_tshirt_1_cd713425f6.png +0 -0
- package/dist/uploads/small_daviddoe_strapi_adbcd41787.jpeg +0 -0
- package/dist/uploads/small_ergonomic_office_chair_1_c751cffb07.png +0 -0
- package/dist/uploads/small_leather_travel_backpack_1_238bc1ae4d.png +0 -0
- package/dist/uploads/small_mechanical_keyboard_pro_1_0cd391a6ac.png +0 -0
- package/dist/uploads/small_smart_watch_series_5_1_cdc2511fb7.png +0 -0
- package/dist/uploads/small_smartphone_x_pro_1_c3f0cbd080.png +0 -0
- package/dist/uploads/small_the_great_gatsby_special_1_2e7c76d997.png +0 -0
- package/dist/uploads/small_wireless_headphones_1_fa75cd50c3.png +0 -0
- package/dist/uploads/small_yoga_mat_premium_1_01f9a3b5fa.png +0 -0
- package/dist/uploads/smart_watch_series_5_1_cdc2511fb7.png +0 -0
- package/dist/uploads/smartphone_x_pro_1_c3f0cbd080.png +0 -0
- package/dist/uploads/the_great_gatsby_special_1_2e7c76d997.png +0 -0
- package/dist/uploads/thumbnail_accessories_category_2a5631094b.jpeg +0 -0
- package/dist/uploads/thumbnail_beauty_personal_care_category_57f8a8f1e3.jpeg +0 -0
- package/dist/uploads/thumbnail_books_category_a9a253eada.jpeg +0 -0
- package/dist/uploads/thumbnail_classic_cotton_tshirt_1_cd713425f6.png +0 -0
- package/dist/uploads/thumbnail_clothing_category_d5c60ef07b.jpeg +0 -0
- package/dist/uploads/thumbnail_daviddoe_strapi_adbcd41787.jpeg +0 -0
- package/dist/uploads/thumbnail_electronics_category_fc3e5ef571.jpeg +0 -0
- package/dist/uploads/thumbnail_ergonomic_office_chair_1_c751cffb07.png +0 -0
- package/dist/uploads/thumbnail_home_garden_category_4f6eb3f8d6.jpeg +0 -0
- package/dist/uploads/thumbnail_istockphoto_1188462138_612x612_11f295b9c0.jpg +0 -0
- package/dist/uploads/thumbnail_istockphoto_1188462138_612x612_396fb272fd.jpg +0 -0
- package/dist/uploads/thumbnail_leather_travel_backpack_1_238bc1ae4d.png +0 -0
- package/dist/uploads/thumbnail_mechanical_keyboard_pro_1_0cd391a6ac.png +0 -0
- package/dist/uploads/thumbnail_predictive_maintenance_icons_industry_automation_600nw_2685943461_e18a8aa3b0.webp +0 -0
- package/dist/uploads/thumbnail_smart_watch_series_5_1_cdc2511fb7.png +0 -0
- package/dist/uploads/thumbnail_smartphone_x_pro_1_c3f0cbd080.png +0 -0
- package/dist/uploads/thumbnail_the_great_gatsby_special_1_2e7c76d997.png +0 -0
- package/dist/uploads/thumbnail_wireless_headphones_1_fa75cd50c3.png +0 -0
- package/dist/uploads/thumbnail_yoga_mat_premium_1_01f9a3b5fa.png +0 -0
- package/dist/uploads/webby-commerce.png +0 -0
- package/dist/uploads/wireless_headphones_1_fa75cd50c3.png +0 -0
- package/dist/uploads/yoga_mat_premium_1_01f9a3b5fa.png +0 -0
- /package/{dist → server/src}/data/demo-data.json +0 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"collectionName": "components_shared_content_blocks",
|
|
3
|
+
"info": {
|
|
4
|
+
"displayName": "Content Block",
|
|
5
|
+
"description": "A reusable component for managing title, description, button, and images."
|
|
6
|
+
},
|
|
7
|
+
"options": {},
|
|
8
|
+
"attributes": {
|
|
9
|
+
"title": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"required": false,
|
|
12
|
+
"description": "The main title or heading"
|
|
13
|
+
},
|
|
14
|
+
"description": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"required": false,
|
|
17
|
+
"description": "The description or body text content"
|
|
18
|
+
},
|
|
19
|
+
"button_text": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"required": false,
|
|
22
|
+
"description": "The text displayed on the button"
|
|
23
|
+
},
|
|
24
|
+
"button_link": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"required": false,
|
|
27
|
+
"description": "The URL or link for the button"
|
|
28
|
+
},
|
|
29
|
+
"images": {
|
|
30
|
+
"type": "media",
|
|
31
|
+
"multiple": true,
|
|
32
|
+
"required": false,
|
|
33
|
+
"allowedTypes": ["images"],
|
|
34
|
+
"description": "Images associated with this content block"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"collectionName": "components_shared_shipping_zone_locations",
|
|
3
|
+
"info": {
|
|
4
|
+
"displayName": "Shipping Zone Location",
|
|
5
|
+
"description": "Reusable location rules for shipping zones (stored as text, parsed by backend)."
|
|
6
|
+
},
|
|
7
|
+
"options": {},
|
|
8
|
+
"attributes": {
|
|
9
|
+
"countries": {
|
|
10
|
+
"type": "text",
|
|
11
|
+
"required": false,
|
|
12
|
+
"description": "Country codes. Use comma or new lines (e.g. US,CA,IN)."
|
|
13
|
+
},
|
|
14
|
+
"states": {
|
|
15
|
+
"type": "text",
|
|
16
|
+
"required": false,
|
|
17
|
+
"description": "State/province codes or names. Use comma or new lines."
|
|
18
|
+
},
|
|
19
|
+
"postal_codes": {
|
|
20
|
+
"type": "text",
|
|
21
|
+
"required": false,
|
|
22
|
+
"description": "Postal code patterns/ranges. One per line. Supports wildcards (123*) and ranges (1000-2000)."
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
{
|
|
2
|
+
"kind": "collectionType",
|
|
3
|
+
"collectionName": "addresses",
|
|
4
|
+
"info": {
|
|
5
|
+
"singularName": "address",
|
|
6
|
+
"pluralName": "addresses",
|
|
7
|
+
"displayName": "Address",
|
|
8
|
+
"description": "User addresses for billing and shipping"
|
|
9
|
+
},
|
|
10
|
+
"options": {
|
|
11
|
+
"draftAndPublish": false
|
|
12
|
+
},
|
|
13
|
+
"pluginOptions": {
|
|
14
|
+
"content-manager": {
|
|
15
|
+
"visible": true
|
|
16
|
+
},
|
|
17
|
+
"content-api": {
|
|
18
|
+
"visible": false
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"attributes": {
|
|
22
|
+
"type": {
|
|
23
|
+
"type": "integer",
|
|
24
|
+
"required": true,
|
|
25
|
+
"min": 0,
|
|
26
|
+
"max": 1
|
|
27
|
+
},
|
|
28
|
+
"first_name": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"required": true
|
|
31
|
+
},
|
|
32
|
+
"last_name": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"required": true
|
|
35
|
+
},
|
|
36
|
+
"company_name": {
|
|
37
|
+
"type": "string",
|
|
38
|
+
"required": false
|
|
39
|
+
},
|
|
40
|
+
"country": {
|
|
41
|
+
"type": "string",
|
|
42
|
+
"required": true
|
|
43
|
+
},
|
|
44
|
+
"region": {
|
|
45
|
+
"type": "string",
|
|
46
|
+
"required": false
|
|
47
|
+
},
|
|
48
|
+
"city": {
|
|
49
|
+
"type": "string",
|
|
50
|
+
"required": true
|
|
51
|
+
},
|
|
52
|
+
"street_address": {
|
|
53
|
+
"type": "string",
|
|
54
|
+
"required": true
|
|
55
|
+
},
|
|
56
|
+
"postcode": {
|
|
57
|
+
"type": "string",
|
|
58
|
+
"required": true
|
|
59
|
+
},
|
|
60
|
+
"phone": {
|
|
61
|
+
"type": "string",
|
|
62
|
+
"required": true
|
|
63
|
+
},
|
|
64
|
+
"email_address": {
|
|
65
|
+
"type": "string",
|
|
66
|
+
"required": false
|
|
67
|
+
},
|
|
68
|
+
"user": {
|
|
69
|
+
"type": "relation",
|
|
70
|
+
"relation": "manyToOne",
|
|
71
|
+
"target": "plugin::users-permissions.user"
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const schema = {
|
|
4
|
+
kind: 'collectionType',
|
|
5
|
+
collectionName: 'carts',
|
|
6
|
+
info: {
|
|
7
|
+
singularName: 'cart',
|
|
8
|
+
pluralName: 'carts',
|
|
9
|
+
displayName: 'Cart',
|
|
10
|
+
description: 'Shopping cart (optional wrapper around cart items).',
|
|
11
|
+
},
|
|
12
|
+
options: {
|
|
13
|
+
draftAndPublish: false,
|
|
14
|
+
},
|
|
15
|
+
pluginOptions: {
|
|
16
|
+
'content-manager': {
|
|
17
|
+
visible: true,
|
|
18
|
+
},
|
|
19
|
+
'content-api': {
|
|
20
|
+
visible: true,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
attributes: {
|
|
24
|
+
user: {
|
|
25
|
+
type: 'relation',
|
|
26
|
+
relation: 'manyToOne',
|
|
27
|
+
target: 'plugin::users-permissions.user',
|
|
28
|
+
},
|
|
29
|
+
guest_id: {
|
|
30
|
+
type: 'string',
|
|
31
|
+
required: false,
|
|
32
|
+
unique: true,
|
|
33
|
+
},
|
|
34
|
+
currency: {
|
|
35
|
+
type: 'string',
|
|
36
|
+
required: true,
|
|
37
|
+
default: 'USD',
|
|
38
|
+
},
|
|
39
|
+
coupon: {
|
|
40
|
+
type: 'relation',
|
|
41
|
+
relation: 'manyToOne',
|
|
42
|
+
target: 'plugin::webbycommerce.coupon',
|
|
43
|
+
required: false,
|
|
44
|
+
},
|
|
45
|
+
expires_at: {
|
|
46
|
+
type: 'datetime',
|
|
47
|
+
required: false,
|
|
48
|
+
},
|
|
49
|
+
items: {
|
|
50
|
+
type: 'relation',
|
|
51
|
+
relation: 'oneToMany',
|
|
52
|
+
target: 'plugin::webbycommerce.cart-item',
|
|
53
|
+
mappedBy: 'cart',
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
module.exports = {
|
|
59
|
+
schema,
|
|
60
|
+
};
|
|
61
|
+
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const schema = {
|
|
4
|
+
kind: 'collectionType',
|
|
5
|
+
collectionName: 'cart_items',
|
|
6
|
+
info: {
|
|
7
|
+
singularName: 'cart-item',
|
|
8
|
+
pluralName: 'cart-items',
|
|
9
|
+
displayName: 'Cart Item',
|
|
10
|
+
description: "Line items in a user's shopping cart",
|
|
11
|
+
},
|
|
12
|
+
options: {
|
|
13
|
+
draftAndPublish: false,
|
|
14
|
+
},
|
|
15
|
+
pluginOptions: {
|
|
16
|
+
'content-manager': {
|
|
17
|
+
visible: true,
|
|
18
|
+
},
|
|
19
|
+
'content-api': {
|
|
20
|
+
visible: true,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
attributes: {
|
|
24
|
+
user: {
|
|
25
|
+
type: 'relation',
|
|
26
|
+
relation: 'manyToOne',
|
|
27
|
+
target: 'plugin::users-permissions.user',
|
|
28
|
+
},
|
|
29
|
+
cart: {
|
|
30
|
+
type: 'relation',
|
|
31
|
+
relation: 'manyToOne',
|
|
32
|
+
target: 'plugin::webbycommerce.cart',
|
|
33
|
+
inversedBy: 'items',
|
|
34
|
+
},
|
|
35
|
+
product: {
|
|
36
|
+
type: 'relation',
|
|
37
|
+
relation: 'manyToOne',
|
|
38
|
+
target: 'plugin::webbycommerce.product',
|
|
39
|
+
},
|
|
40
|
+
variation: {
|
|
41
|
+
type: 'relation',
|
|
42
|
+
relation: 'manyToOne',
|
|
43
|
+
target: 'plugin::webbycommerce.product-variation',
|
|
44
|
+
},
|
|
45
|
+
quantity: {
|
|
46
|
+
type: 'integer',
|
|
47
|
+
required: true,
|
|
48
|
+
min: 1,
|
|
49
|
+
default: 1,
|
|
50
|
+
},
|
|
51
|
+
unit_price: {
|
|
52
|
+
type: 'decimal',
|
|
53
|
+
required: true,
|
|
54
|
+
min: 0,
|
|
55
|
+
},
|
|
56
|
+
total_price: {
|
|
57
|
+
type: 'decimal',
|
|
58
|
+
required: true,
|
|
59
|
+
min: 0,
|
|
60
|
+
},
|
|
61
|
+
attributes: {
|
|
62
|
+
type: 'relation',
|
|
63
|
+
relation: 'manyToMany',
|
|
64
|
+
target: 'plugin::webbycommerce.product-attribute',
|
|
65
|
+
required: false,
|
|
66
|
+
},
|
|
67
|
+
attributeValues: {
|
|
68
|
+
type: 'relation',
|
|
69
|
+
relation: 'manyToMany',
|
|
70
|
+
target: 'plugin::webbycommerce.product-attribute-value',
|
|
71
|
+
required: false,
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
module.exports = {
|
|
77
|
+
schema,
|
|
78
|
+
};
|
|
79
|
+
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* compare.js
|
|
5
|
+
*
|
|
6
|
+
* Compare content type lifecycle
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const schema = {
|
|
10
|
+
kind: 'collectionType',
|
|
11
|
+
collectionName: 'compares',
|
|
12
|
+
info: {
|
|
13
|
+
singularName: 'compare',
|
|
14
|
+
pluralName: 'compares',
|
|
15
|
+
displayName: 'Compare',
|
|
16
|
+
description: 'User compare list for comparing products',
|
|
17
|
+
},
|
|
18
|
+
options: {
|
|
19
|
+
draftAndPublish: false,
|
|
20
|
+
timestamps: true,
|
|
21
|
+
},
|
|
22
|
+
pluginOptions: {
|
|
23
|
+
'content-manager': {
|
|
24
|
+
visible: true,
|
|
25
|
+
},
|
|
26
|
+
'content-type-builder': {
|
|
27
|
+
visible: true,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
attributes: {
|
|
31
|
+
userId: {
|
|
32
|
+
type: 'string',
|
|
33
|
+
required: true,
|
|
34
|
+
configurable: false,
|
|
35
|
+
},
|
|
36
|
+
userEmail: {
|
|
37
|
+
type: 'email',
|
|
38
|
+
required: true,
|
|
39
|
+
configurable: false,
|
|
40
|
+
},
|
|
41
|
+
products: {
|
|
42
|
+
type: 'relation',
|
|
43
|
+
relation: 'manyToMany',
|
|
44
|
+
target: 'plugin::webbycommerce.product',
|
|
45
|
+
mappedBy: 'compares',
|
|
46
|
+
max: 4, // Limit to 4 products for comparison
|
|
47
|
+
},
|
|
48
|
+
category: {
|
|
49
|
+
type: 'relation',
|
|
50
|
+
relation: 'manyToOne',
|
|
51
|
+
target: 'plugin::webbycommerce.product-category',
|
|
52
|
+
inversedBy: 'compares',
|
|
53
|
+
},
|
|
54
|
+
isPublic: {
|
|
55
|
+
type: 'boolean',
|
|
56
|
+
default: false,
|
|
57
|
+
required: false,
|
|
58
|
+
},
|
|
59
|
+
name: {
|
|
60
|
+
type: 'string',
|
|
61
|
+
maxLength: 100,
|
|
62
|
+
required: false,
|
|
63
|
+
},
|
|
64
|
+
notes: {
|
|
65
|
+
type: 'text',
|
|
66
|
+
required: false,
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
module.exports = {
|
|
72
|
+
schema,
|
|
73
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"kind": "collectionType",
|
|
3
|
+
"collectionName": "coupons",
|
|
4
|
+
"info": {
|
|
5
|
+
"singularName": "coupon",
|
|
6
|
+
"pluralName": "coupons",
|
|
7
|
+
"displayName": "Coupon",
|
|
8
|
+
"description": "Discount coupons for orders"
|
|
9
|
+
},
|
|
10
|
+
"options": {
|
|
11
|
+
"draftAndPublish": false
|
|
12
|
+
},
|
|
13
|
+
"pluginOptions": {
|
|
14
|
+
"content-manager": {
|
|
15
|
+
"visible": true
|
|
16
|
+
},
|
|
17
|
+
"content-api": {
|
|
18
|
+
"visible": true
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"attributes": {
|
|
22
|
+
"code": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"required": true,
|
|
25
|
+
"unique": true
|
|
26
|
+
},
|
|
27
|
+
"type": {
|
|
28
|
+
"type": "enumeration",
|
|
29
|
+
"enum": ["percentage", "fixed"],
|
|
30
|
+
"required": true
|
|
31
|
+
},
|
|
32
|
+
"value": {
|
|
33
|
+
"type": "decimal",
|
|
34
|
+
"required": true,
|
|
35
|
+
"min": 0
|
|
36
|
+
},
|
|
37
|
+
"description": {
|
|
38
|
+
"type": "text",
|
|
39
|
+
"required": false
|
|
40
|
+
},
|
|
41
|
+
"usage_limit": {
|
|
42
|
+
"type": "integer",
|
|
43
|
+
"required": false,
|
|
44
|
+
"min": 0
|
|
45
|
+
},
|
|
46
|
+
"used_count": {
|
|
47
|
+
"type": "integer",
|
|
48
|
+
"required": false,
|
|
49
|
+
"min": 0,
|
|
50
|
+
"default": 0
|
|
51
|
+
},
|
|
52
|
+
"minimum_order_amount": {
|
|
53
|
+
"type": "decimal",
|
|
54
|
+
"required": false,
|
|
55
|
+
"min": 0
|
|
56
|
+
},
|
|
57
|
+
"expires_at": {
|
|
58
|
+
"type": "datetime",
|
|
59
|
+
"required": false
|
|
60
|
+
},
|
|
61
|
+
"is_active": {
|
|
62
|
+
"type": "boolean",
|
|
63
|
+
"required": false,
|
|
64
|
+
"default": true
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const address = require('./address');
|
|
4
|
+
|
|
5
|
+
const cart = require('./cart');
|
|
6
|
+
const cartItem = require('./cart-item');
|
|
7
|
+
const compare = require('./compare');
|
|
8
|
+
const coupon = require('./coupon');
|
|
9
|
+
const order = require('./order');
|
|
10
|
+
const paymentTransaction = require('./payment-transaction');
|
|
11
|
+
const product = require('./product');
|
|
12
|
+
const productAttribute = require('./product-attribute');
|
|
13
|
+
const productAttributeValue = require('./product-attribute-value');
|
|
14
|
+
const productCategory = require('./product-category');
|
|
15
|
+
const productTag = require('./product-tag');
|
|
16
|
+
const productVariation = require('./product-variation');
|
|
17
|
+
const wishlist = require('./wishlist');
|
|
18
|
+
const shippingZone = require('./shipping-zone');
|
|
19
|
+
const shippingMethod = require('./shipping-method');
|
|
20
|
+
const shippingRate = require('./shipping-rate');
|
|
21
|
+
const shippingRule = require('./shipping-rule');
|
|
22
|
+
|
|
23
|
+
module.exports = {
|
|
24
|
+
address,
|
|
25
|
+
cart,
|
|
26
|
+
'cart-item': cartItem,
|
|
27
|
+
compare,
|
|
28
|
+
coupon,
|
|
29
|
+
order,
|
|
30
|
+
'payment-transaction': paymentTransaction,
|
|
31
|
+
product,
|
|
32
|
+
'product-attribute': productAttribute,
|
|
33
|
+
'product-attribute-value': productAttributeValue,
|
|
34
|
+
'product-category': productCategory,
|
|
35
|
+
'product-tag': productTag,
|
|
36
|
+
'product-variation': productVariation,
|
|
37
|
+
wishlist,
|
|
38
|
+
'shipping-zone': shippingZone,
|
|
39
|
+
'shipping-method': shippingMethod,
|
|
40
|
+
'shipping-rate': shippingRate,
|
|
41
|
+
'shipping-rule': shippingRule,
|
|
42
|
+
};
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
{
|
|
2
|
+
"kind": "collectionType",
|
|
3
|
+
"collectionName": "orders",
|
|
4
|
+
"info": {
|
|
5
|
+
"singularName": "order",
|
|
6
|
+
"pluralName": "orders",
|
|
7
|
+
"displayName": "Order",
|
|
8
|
+
"description": "Ecommerce orders"
|
|
9
|
+
},
|
|
10
|
+
"options": {
|
|
11
|
+
"draftAndPublish": false
|
|
12
|
+
},
|
|
13
|
+
"pluginOptions": {
|
|
14
|
+
"content-manager": {
|
|
15
|
+
"visible": true
|
|
16
|
+
},
|
|
17
|
+
"content-api": {
|
|
18
|
+
"visible": true
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"attributes": {
|
|
22
|
+
"order_number": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"required": true,
|
|
25
|
+
"unique": true
|
|
26
|
+
},
|
|
27
|
+
"status": {
|
|
28
|
+
"type": "enumeration",
|
|
29
|
+
"enum": ["pending", "processing", "shipped", "delivered", "cancelled", "refunded"],
|
|
30
|
+
"default": "pending",
|
|
31
|
+
"required": true
|
|
32
|
+
},
|
|
33
|
+
"user": {
|
|
34
|
+
"type": "relation",
|
|
35
|
+
"relation": "manyToOne",
|
|
36
|
+
"target": "plugin::users-permissions.user"
|
|
37
|
+
},
|
|
38
|
+
"items": {
|
|
39
|
+
"type": "relation",
|
|
40
|
+
"relation": "manyToMany",
|
|
41
|
+
"target": "plugin::webbycommerce.product"
|
|
42
|
+
},
|
|
43
|
+
"subtotal": {
|
|
44
|
+
"type": "decimal",
|
|
45
|
+
"required": true,
|
|
46
|
+
"min": 0
|
|
47
|
+
},
|
|
48
|
+
"tax_amount": {
|
|
49
|
+
"type": "decimal",
|
|
50
|
+
"required": false,
|
|
51
|
+
"min": 0,
|
|
52
|
+
"default": 0
|
|
53
|
+
},
|
|
54
|
+
"shipping_amount": {
|
|
55
|
+
"type": "decimal",
|
|
56
|
+
"required": false,
|
|
57
|
+
"min": 0,
|
|
58
|
+
"default": 0
|
|
59
|
+
},
|
|
60
|
+
"discount_amount": {
|
|
61
|
+
"type": "decimal",
|
|
62
|
+
"required": false,
|
|
63
|
+
"min": 0,
|
|
64
|
+
"default": 0
|
|
65
|
+
},
|
|
66
|
+
"total": {
|
|
67
|
+
"type": "decimal",
|
|
68
|
+
"required": true,
|
|
69
|
+
"min": 0
|
|
70
|
+
},
|
|
71
|
+
"currency": {
|
|
72
|
+
"type": "string",
|
|
73
|
+
"required": true,
|
|
74
|
+
"default": "USD"
|
|
75
|
+
},
|
|
76
|
+
"billing_address": {
|
|
77
|
+
"type": "relation",
|
|
78
|
+
"relation": "manyToOne",
|
|
79
|
+
"target": "plugin::webbycommerce.address"
|
|
80
|
+
},
|
|
81
|
+
"shipping_address": {
|
|
82
|
+
"type": "relation",
|
|
83
|
+
"relation": "manyToOne",
|
|
84
|
+
"target": "plugin::webbycommerce.address"
|
|
85
|
+
},
|
|
86
|
+
"payment_method": {
|
|
87
|
+
"type": "enumeration",
|
|
88
|
+
"enum": ["Stripe", "PayPal", "Razorpay", "COD"],
|
|
89
|
+
"default": "Stripe",
|
|
90
|
+
"required": true
|
|
91
|
+
},
|
|
92
|
+
"payment_status": {
|
|
93
|
+
"type": "enumeration",
|
|
94
|
+
"enum": ["pending", "paid", "failed", "refunded"],
|
|
95
|
+
"default": "pending",
|
|
96
|
+
"required": true
|
|
97
|
+
},
|
|
98
|
+
"shipping_method": {
|
|
99
|
+
"type": "string",
|
|
100
|
+
"required": false
|
|
101
|
+
},
|
|
102
|
+
"notes": {
|
|
103
|
+
"type": "text",
|
|
104
|
+
"required": false
|
|
105
|
+
},
|
|
106
|
+
"tracking_number": {
|
|
107
|
+
"type": "string",
|
|
108
|
+
"required": false
|
|
109
|
+
},
|
|
110
|
+
"estimated_delivery": {
|
|
111
|
+
"type": "datetime",
|
|
112
|
+
"required": false
|
|
113
|
+
},
|
|
114
|
+
"payment_transactions": {
|
|
115
|
+
"type": "relation",
|
|
116
|
+
"relation": "oneToMany",
|
|
117
|
+
"target": "plugin::webbycommerce.payment-transaction",
|
|
118
|
+
"mappedBy": "order"
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|