From 0f3d9385c07c7899aac779a646249bb8eccbd339 Mon Sep 17 00:00:00 2001 From: yusmar Date: Wed, 30 Jun 2021 15:07:09 +0700 Subject: [PATCH] change schema --- api/product-otr/config/routes.json | 52 ++++++++++++++++++++++++ api/product-otr/controllers/product-otr.js | 8 ++++ api/product-otr/models/product-otr.js | 8 ++++ api/product-otr/models/product-otr.settings.json | 25 ++++++++++++ api/product-otr/services/product-otr.js | 8 ++++ api/product/models/product.settings.json | 10 +++++ api/yg-part/config/routes.json | 52 ++++++++++++++++++++++++ api/yg-part/controllers/yg-part.js | 8 ++++ api/yg-part/models/yg-part.js | 8 ++++ api/yg-part/models/yg-part.settings.json | 42 +++++++++++++++++++ api/yg-part/services/yg-part.js | 8 ++++ api/ygp/models/ygp.settings.json | 9 +++- 12 files changed, 237 insertions(+), 1 deletion(-) create mode 100644 api/product-otr/config/routes.json create mode 100644 api/product-otr/controllers/product-otr.js create mode 100644 api/product-otr/models/product-otr.js create mode 100644 api/product-otr/models/product-otr.settings.json create mode 100644 api/product-otr/services/product-otr.js create mode 100644 api/yg-part/config/routes.json create mode 100644 api/yg-part/controllers/yg-part.js create mode 100644 api/yg-part/models/yg-part.js create mode 100644 api/yg-part/models/yg-part.settings.json create mode 100644 api/yg-part/services/yg-part.js diff --git a/api/product-otr/config/routes.json b/api/product-otr/config/routes.json new file mode 100644 index 0000000..4d23ab8 --- /dev/null +++ b/api/product-otr/config/routes.json @@ -0,0 +1,52 @@ +{ + "routes": [ + { + "method": "GET", + "path": "/product-otrs", + "handler": "product-otr.find", + "config": { + "policies": [] + } + }, + { + "method": "GET", + "path": "/product-otrs/count", + "handler": "product-otr.count", + "config": { + "policies": [] + } + }, + { + "method": "GET", + "path": "/product-otrs/:id", + "handler": "product-otr.findOne", + "config": { + "policies": [] + } + }, + { + "method": "POST", + "path": "/product-otrs", + "handler": "product-otr.create", + "config": { + "policies": [] + } + }, + { + "method": "PUT", + "path": "/product-otrs/:id", + "handler": "product-otr.update", + "config": { + "policies": [] + } + }, + { + "method": "DELETE", + "path": "/product-otrs/:id", + "handler": "product-otr.delete", + "config": { + "policies": [] + } + } + ] +} diff --git a/api/product-otr/controllers/product-otr.js b/api/product-otr/controllers/product-otr.js new file mode 100644 index 0000000..556f4fc --- /dev/null +++ b/api/product-otr/controllers/product-otr.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/product-otr/models/product-otr.js b/api/product-otr/models/product-otr.js new file mode 100644 index 0000000..dd847ef --- /dev/null +++ b/api/product-otr/models/product-otr.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/product-otr/models/product-otr.settings.json b/api/product-otr/models/product-otr.settings.json new file mode 100644 index 0000000..8bb37cd --- /dev/null +++ b/api/product-otr/models/product-otr.settings.json @@ -0,0 +1,25 @@ +{ + "kind": "collectionType", + "collectionName": "product_otrs", + "info": { + "name": "Product_OTR", + "description": "" + }, + "options": { + "increments": true, + "timestamps": true, + "draftAndPublish": true + }, + "attributes": { + "product": { + "model": "product", + "via": "product_otrs" + }, + "name": { + "type": "string" + }, + "price": { + "type": "biginteger" + } + } +} diff --git a/api/product-otr/services/product-otr.js b/api/product-otr/services/product-otr.js new file mode 100644 index 0000000..6bc4168 --- /dev/null +++ b/api/product-otr/services/product-otr.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/product/models/product.settings.json b/api/product/models/product.settings.json index 0dd3c46..35f7cbc 100644 --- a/api/product/models/product.settings.json +++ b/api/product/models/product.settings.json @@ -223,6 +223,16 @@ }, "otr_price_bengkulu": { "type": "biginteger" + }, + "price1": { + "type": "biginteger" + }, + "price2": { + "type": "biginteger" + }, + "product_otrs": { + "via": "product", + "collection": "product-otr" } } } diff --git a/api/yg-part/config/routes.json b/api/yg-part/config/routes.json new file mode 100644 index 0000000..eb10a8a --- /dev/null +++ b/api/yg-part/config/routes.json @@ -0,0 +1,52 @@ +{ + "routes": [ + { + "method": "GET", + "path": "/yg-parts", + "handler": "yg-part.find", + "config": { + "policies": [] + } + }, + { + "method": "GET", + "path": "/yg-parts/count", + "handler": "yg-part.count", + "config": { + "policies": [] + } + }, + { + "method": "GET", + "path": "/yg-parts/:id", + "handler": "yg-part.findOne", + "config": { + "policies": [] + } + }, + { + "method": "POST", + "path": "/yg-parts", + "handler": "yg-part.create", + "config": { + "policies": [] + } + }, + { + "method": "PUT", + "path": "/yg-parts/:id", + "handler": "yg-part.update", + "config": { + "policies": [] + } + }, + { + "method": "DELETE", + "path": "/yg-parts/:id", + "handler": "yg-part.delete", + "config": { + "policies": [] + } + } + ] +} diff --git a/api/yg-part/controllers/yg-part.js b/api/yg-part/controllers/yg-part.js new file mode 100644 index 0000000..556f4fc --- /dev/null +++ b/api/yg-part/controllers/yg-part.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/yg-part/models/yg-part.js b/api/yg-part/models/yg-part.js new file mode 100644 index 0000000..dd847ef --- /dev/null +++ b/api/yg-part/models/yg-part.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/yg-part/models/yg-part.settings.json b/api/yg-part/models/yg-part.settings.json new file mode 100644 index 0000000..e51474a --- /dev/null +++ b/api/yg-part/models/yg-part.settings.json @@ -0,0 +1,42 @@ +{ + "kind": "collectionType", + "collectionName": "yg_parts", + "info": { + "name": "YGPart", + "description": "" + }, + "options": { + "increments": true, + "timestamps": true, + "draftAndPublish": true + }, + "attributes": { + "name": { + "type": "string" + }, + "img": { + "model": "file", + "via": "related", + "allowedTypes": [ + "images", + "files", + "videos" + ], + "plugin": "upload", + "required": false + }, + "ygp_units": { + "collection": "ygp", + "via": "yg_part" + }, + "description": { + "type": "text" + }, + "price1": { + "type": "biginteger" + }, + "price2": { + "type": "biginteger" + } + } +} diff --git a/api/yg-part/services/yg-part.js b/api/yg-part/services/yg-part.js new file mode 100644 index 0000000..6bc4168 --- /dev/null +++ b/api/yg-part/services/yg-part.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/ygp/models/ygp.settings.json b/api/ygp/models/ygp.settings.json index 150cd76..23ebd93 100644 --- a/api/ygp/models/ygp.settings.json +++ b/api/ygp/models/ygp.settings.json @@ -2,7 +2,7 @@ "kind": "collectionType", "collectionName": "ygps", "info": { - "name": "YGP", + "name": "YGP_Unit", "description": "" }, "options": { @@ -45,6 +45,13 @@ }, "otr_price_bengkulu": { "type": "biginteger" + }, + "yg_part": { + "via": "ygp_units", + "model": "yg-part" + }, + "berat": { + "type": "biginteger" } } }