From 7727569a66b83fcd8431e23beabfe3ce955fa431 Mon Sep 17 00:00:00 2001 From: Yusmardianto Date: Wed, 28 Apr 2021 10:23:06 +0700 Subject: [PATCH] fase 1 --- api/transaction/config/routes.json | 52 ++++++++++++++++++++ api/transaction/controllers/transaction.js | 8 ++++ api/transaction/models/transaction.js | 8 ++++ api/transaction/models/transaction.settings.json | 55 ++++++++++++++++++++++ api/transaction/services/transaction.js | 8 ++++ .../users-permissions/models/User.settings.json | 6 +++ public/uploads/.gitkeep | 0 7 files changed, 137 insertions(+) create mode 100644 api/transaction/config/routes.json create mode 100644 api/transaction/controllers/transaction.js create mode 100644 api/transaction/models/transaction.js create mode 100644 api/transaction/models/transaction.settings.json create mode 100644 api/transaction/services/transaction.js delete mode 100644 public/uploads/.gitkeep diff --git a/api/transaction/config/routes.json b/api/transaction/config/routes.json new file mode 100644 index 0000000..f21909b --- /dev/null +++ b/api/transaction/config/routes.json @@ -0,0 +1,52 @@ +{ + "routes": [ + { + "method": "GET", + "path": "/transactions", + "handler": "transaction.find", + "config": { + "policies": [] + } + }, + { + "method": "GET", + "path": "/transactions/count", + "handler": "transaction.count", + "config": { + "policies": [] + } + }, + { + "method": "GET", + "path": "/transactions/:id", + "handler": "transaction.findOne", + "config": { + "policies": [] + } + }, + { + "method": "POST", + "path": "/transactions", + "handler": "transaction.create", + "config": { + "policies": [] + } + }, + { + "method": "PUT", + "path": "/transactions/:id", + "handler": "transaction.update", + "config": { + "policies": [] + } + }, + { + "method": "DELETE", + "path": "/transactions/:id", + "handler": "transaction.delete", + "config": { + "policies": [] + } + } + ] +} diff --git a/api/transaction/controllers/transaction.js b/api/transaction/controllers/transaction.js new file mode 100644 index 0000000..556f4fc --- /dev/null +++ b/api/transaction/controllers/transaction.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/transaction/models/transaction.js b/api/transaction/models/transaction.js new file mode 100644 index 0000000..dd847ef --- /dev/null +++ b/api/transaction/models/transaction.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/transaction/models/transaction.settings.json b/api/transaction/models/transaction.settings.json new file mode 100644 index 0000000..4366f83 --- /dev/null +++ b/api/transaction/models/transaction.settings.json @@ -0,0 +1,55 @@ +{ + "kind": "collectionType", + "collectionName": "transactions", + "info": { + "name": "Transaction" + }, + "options": { + "increments": true, + "timestamps": true, + "draftAndPublish": true + }, + "attributes": { + "product_order": { + "type": "string" + }, + "product_name": { + "type": "string" + }, + "product_quantity": { + "type": "biginteger" + }, + "product_price": { + "type": "biginteger" + }, + "product_color": { + "type": "string" + }, + "product_courier": { + "type": "string" + }, + "cust_name": { + "type": "string" + }, + "cust_telp": { + "type": "string" + }, + "cust_address": { + "type": "string" + }, + "note": { + "type": "text" + }, + "product_img": { + "model": "file", + "via": "related", + "allowedTypes": [ + "images", + "files", + "videos" + ], + "plugin": "upload", + "required": false + } + } +} diff --git a/api/transaction/services/transaction.js b/api/transaction/services/transaction.js new file mode 100644 index 0000000..6bc4168 --- /dev/null +++ b/api/transaction/services/transaction.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/extensions/users-permissions/models/User.settings.json b/extensions/users-permissions/models/User.settings.json index a3be038..a9d6977 100644 --- a/extensions/users-permissions/models/User.settings.json +++ b/extensions/users-permissions/models/User.settings.json @@ -70,6 +70,12 @@ "lastName": { "type": "string", "required": true + }, + "telp": { + "type": "biginteger" + }, + "address": { + "type": "richtext" } } } diff --git a/public/uploads/.gitkeep b/public/uploads/.gitkeep deleted file mode 100644 index e69de29..0000000