From 9835a440c8caf557ec88639eb617b50a59d2fa2b Mon Sep 17 00:00:00 2001 From: Yusmardianto Date: Mon, 8 Mar 2021 09:04:33 +0700 Subject: [PATCH] add collection accessories --- .env.example | 6 ++ api/accessories/config/routes.json | 52 +++++++++++++++ api/accessories/controllers/accessories.js | 8 +++ api/accessories/models/accessories.js | 8 +++ api/accessories/models/accessories.settings.json | 85 ++++++++++++++++++++++++ api/accessories/services/accessories.js | 8 +++ api/category/config/routes.json | 52 --------------- api/category/controllers/category.js | 8 --- api/category/models/category.js | 8 --- api/category/models/category.settings.json | 24 ------- api/category/services/category.js | 8 --- api/product/models/product.settings.json | 14 +--- api/restaurant/config/routes.json | 52 --------------- api/restaurant/controllers/restaurant.js | 8 --- api/restaurant/models/restaurant.js | 8 --- api/restaurant/models/restaurant.settings.json | 26 -------- api/restaurant/services/restaurant.js | 8 --- 17 files changed, 170 insertions(+), 213 deletions(-) create mode 100644 api/accessories/config/routes.json create mode 100644 api/accessories/controllers/accessories.js create mode 100644 api/accessories/models/accessories.js create mode 100644 api/accessories/models/accessories.settings.json create mode 100644 api/accessories/services/accessories.js delete mode 100644 api/category/config/routes.json delete mode 100644 api/category/controllers/category.js delete mode 100644 api/category/models/category.js delete mode 100644 api/category/models/category.settings.json delete mode 100644 api/category/services/category.js delete mode 100644 api/restaurant/config/routes.json delete mode 100644 api/restaurant/controllers/restaurant.js delete mode 100644 api/restaurant/models/restaurant.js delete mode 100644 api/restaurant/models/restaurant.settings.json delete mode 100644 api/restaurant/services/restaurant.js diff --git a/.env.example b/.env.example index b667b6c..ceac7bf 100644 --- a/.env.example +++ b/.env.example @@ -1,2 +1,8 @@ HOST=0.0.0.0 PORT=1337 + +DATABASE_HOST=172.16.1.8 +DATABASE_PORT=3306 +DATABASE_NAME=thamrin_ecomm_tbg +DATABASE_USERNAME=root +DATABASE_PASSWORD=Master81 \ No newline at end of file diff --git a/api/accessories/config/routes.json b/api/accessories/config/routes.json new file mode 100644 index 0000000..6871cb3 --- /dev/null +++ b/api/accessories/config/routes.json @@ -0,0 +1,52 @@ +{ + "routes": [ + { + "method": "GET", + "path": "/accessories", + "handler": "accessories.find", + "config": { + "policies": [] + } + }, + { + "method": "GET", + "path": "/accessories/count", + "handler": "accessories.count", + "config": { + "policies": [] + } + }, + { + "method": "GET", + "path": "/accessories/:id", + "handler": "accessories.findOne", + "config": { + "policies": [] + } + }, + { + "method": "POST", + "path": "/accessories", + "handler": "accessories.create", + "config": { + "policies": [] + } + }, + { + "method": "PUT", + "path": "/accessories/:id", + "handler": "accessories.update", + "config": { + "policies": [] + } + }, + { + "method": "DELETE", + "path": "/accessories/:id", + "handler": "accessories.delete", + "config": { + "policies": [] + } + } + ] +} diff --git a/api/accessories/controllers/accessories.js b/api/accessories/controllers/accessories.js new file mode 100644 index 0000000..556f4fc --- /dev/null +++ b/api/accessories/controllers/accessories.js @@ -0,0 +1,8 @@ +'use strict'; + +/** + * Read the documentation (https://strapi.io/documentation/developer-docs/latest/concepts/controllers.html#core-controllers) + * to customize this controller + */ + +module.exports = {}; diff --git a/api/accessories/models/accessories.js b/api/accessories/models/accessories.js new file mode 100644 index 0000000..dd847ef --- /dev/null +++ b/api/accessories/models/accessories.js @@ -0,0 +1,8 @@ +'use strict'; + +/** + * Read the documentation (https://strapi.io/documentation/developer-docs/latest/concepts/models.html#lifecycle-hooks) + * to customize this model + */ + +module.exports = {}; diff --git a/api/accessories/models/accessories.settings.json b/api/accessories/models/accessories.settings.json new file mode 100644 index 0000000..8d0746f --- /dev/null +++ b/api/accessories/models/accessories.settings.json @@ -0,0 +1,85 @@ +{ + "kind": "collectionType", + "collectionName": "accessories", + "info": { + "name": "accessories", + "description": "" + }, + "options": { + "increments": true, + "timestamps": true, + "draftAndPublish": true + }, + "attributes": { + "name": { + "type": "string", + "required": true + }, + "description": { + "type": "richtext" + }, + "price": { + "type": "biginteger" + }, + "part_code": { + "type": "string" + }, + "img": { + "model": "file", + "via": "related", + "allowedTypes": [ + "images", + "files", + "videos" + ], + "plugin": "upload", + "required": false + }, + "category": { + "type": "enumeration", + "enum": [ + "YGP", + "Yamalube", + "Helmet", + "Apparel", + "Accessories" + ] + }, + "stock": { + "type": "string" + }, + "img_relate1": { + "model": "file", + "via": "related", + "allowedTypes": [ + "images", + "files", + "videos" + ], + "plugin": "upload", + "required": false + }, + "img_relate2": { + "model": "file", + "via": "related", + "allowedTypes": [ + "images", + "files", + "videos" + ], + "plugin": "upload", + "required": false + }, + "img_relate3": { + "model": "file", + "via": "related", + "allowedTypes": [ + "images", + "files", + "videos" + ], + "plugin": "upload", + "required": false + } + } +} diff --git a/api/accessories/services/accessories.js b/api/accessories/services/accessories.js new file mode 100644 index 0000000..6bc4168 --- /dev/null +++ b/api/accessories/services/accessories.js @@ -0,0 +1,8 @@ +'use strict'; + +/** + * Read the documentation (https://strapi.io/documentation/developer-docs/latest/concepts/services.html#core-services) + * to customize this service + */ + +module.exports = {}; diff --git a/api/category/config/routes.json b/api/category/config/routes.json deleted file mode 100644 index 930f4ac..0000000 --- a/api/category/config/routes.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "routes": [ - { - "method": "GET", - "path": "/categories", - "handler": "category.find", - "config": { - "policies": [] - } - }, - { - "method": "GET", - "path": "/categories/count", - "handler": "category.count", - "config": { - "policies": [] - } - }, - { - "method": "GET", - "path": "/categories/:id", - "handler": "category.findOne", - "config": { - "policies": [] - } - }, - { - "method": "POST", - "path": "/categories", - "handler": "category.create", - "config": { - "policies": [] - } - }, - { - "method": "PUT", - "path": "/categories/:id", - "handler": "category.update", - "config": { - "policies": [] - } - }, - { - "method": "DELETE", - "path": "/categories/:id", - "handler": "category.delete", - "config": { - "policies": [] - } - } - ] -} diff --git a/api/category/controllers/category.js b/api/category/controllers/category.js deleted file mode 100644 index 556f4fc..0000000 --- a/api/category/controllers/category.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -/** - * Read the documentation (https://strapi.io/documentation/developer-docs/latest/concepts/controllers.html#core-controllers) - * to customize this controller - */ - -module.exports = {}; diff --git a/api/category/models/category.js b/api/category/models/category.js deleted file mode 100644 index dd847ef..0000000 --- a/api/category/models/category.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -/** - * Read the documentation (https://strapi.io/documentation/developer-docs/latest/concepts/models.html#lifecycle-hooks) - * to customize this model - */ - -module.exports = {}; diff --git a/api/category/models/category.settings.json b/api/category/models/category.settings.json deleted file mode 100644 index 6d0a81b..0000000 --- a/api/category/models/category.settings.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "kind": "collectionType", - "collectionName": "categories", - "info": { - "name": "category" - }, - "options": { - "increments": true, - "timestamps": true, - "draftAndPublish": true - }, - "attributes": { - "name": { - "type": "string", - "required": true, - "unique": true - }, - "restaurants": { - "collection": "restaurant", - "via": "categories", - "dominant": true - } - } -} diff --git a/api/category/services/category.js b/api/category/services/category.js deleted file mode 100644 index 6bc4168..0000000 --- a/api/category/services/category.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -/** - * Read the documentation (https://strapi.io/documentation/developer-docs/latest/concepts/services.html#core-services) - * to customize this service - */ - -module.exports = {}; diff --git a/api/product/models/product.settings.json b/api/product/models/product.settings.json index 5609074..a9d6956 100644 --- a/api/product/models/product.settings.json +++ b/api/product/models/product.settings.json @@ -42,23 +42,15 @@ "accessories": { "type": "richtext" }, - "film": { - "collection": "file", - "via": "related", - "allowedTypes": [ - "images", - "files", - "videos" - ], - "plugin": "upload", - "required": false - }, "business_partner": { "model": "business-partner", "via": "products" }, "stock": { "type": "biginteger" + }, + "film": { + "type": "richtext" } } } diff --git a/api/restaurant/config/routes.json b/api/restaurant/config/routes.json deleted file mode 100644 index f9534ab..0000000 --- a/api/restaurant/config/routes.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "routes": [ - { - "method": "GET", - "path": "/restaurants", - "handler": "restaurant.find", - "config": { - "policies": [] - } - }, - { - "method": "GET", - "path": "/restaurants/count", - "handler": "restaurant.count", - "config": { - "policies": [] - } - }, - { - "method": "GET", - "path": "/restaurants/:id", - "handler": "restaurant.findOne", - "config": { - "policies": [] - } - }, - { - "method": "POST", - "path": "/restaurants", - "handler": "restaurant.create", - "config": { - "policies": [] - } - }, - { - "method": "PUT", - "path": "/restaurants/:id", - "handler": "restaurant.update", - "config": { - "policies": [] - } - }, - { - "method": "DELETE", - "path": "/restaurants/:id", - "handler": "restaurant.delete", - "config": { - "policies": [] - } - } - ] -} diff --git a/api/restaurant/controllers/restaurant.js b/api/restaurant/controllers/restaurant.js deleted file mode 100644 index 556f4fc..0000000 --- a/api/restaurant/controllers/restaurant.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -/** - * Read the documentation (https://strapi.io/documentation/developer-docs/latest/concepts/controllers.html#core-controllers) - * to customize this controller - */ - -module.exports = {}; diff --git a/api/restaurant/models/restaurant.js b/api/restaurant/models/restaurant.js deleted file mode 100644 index dd847ef..0000000 --- a/api/restaurant/models/restaurant.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -/** - * Read the documentation (https://strapi.io/documentation/developer-docs/latest/concepts/models.html#lifecycle-hooks) - * to customize this model - */ - -module.exports = {}; diff --git a/api/restaurant/models/restaurant.settings.json b/api/restaurant/models/restaurant.settings.json deleted file mode 100644 index 7772c20..0000000 --- a/api/restaurant/models/restaurant.settings.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "kind": "collectionType", - "collectionName": "restaurants", - "info": { - "name": "restaurant" - }, - "options": { - "increments": true, - "timestamps": true, - "draftAndPublish": true - }, - "attributes": { - "name": { - "type": "string", - "required": true, - "unique": true - }, - "description": { - "type": "richtext" - }, - "categories": { - "via": "restaurants", - "collection": "category" - } - } -} diff --git a/api/restaurant/services/restaurant.js b/api/restaurant/services/restaurant.js deleted file mode 100644 index 6bc4168..0000000 --- a/api/restaurant/services/restaurant.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -/** - * Read the documentation (https://strapi.io/documentation/developer-docs/latest/concepts/services.html#core-services) - * to customize this service - */ - -module.exports = {};