From a6047d257b9c118e971767f45baf62208c13f50e Mon Sep 17 00:00:00 2001 From: sergiodt Date: Fri, 11 Aug 2023 12:45:18 +0200 Subject: [PATCH] refs #5134 feat:modelsSalix --- db/changes/233401/00-models.sql | 29 +++++++++++++++++++ modules/invoiceOut/back/models/printer.json | 7 +++++ modules/shelving/back/model-config.json | 3 ++ modules/shelving/back/models/train.json | 19 ++++++++++++ modules/ticket/back/model-config.json | 6 ++++ .../ticket/back/models/expeditionMistake.json | 2 +- .../back/models/expeditionMistakeType.json | 20 +++++++++++++ modules/ticket/back/models/sale-mistake.json | 2 +- modules/worker/back/model-config.json | 9 ++++++ modules/worker/back/models/mistakeType.json | 20 +++++++++++++ modules/worker/back/models/workerMistake.json | 25 ++++++++++++++++ .../worker/back/models/workerMistakeType.json | 27 +++++++++++++++++ 12 files changed, 167 insertions(+), 2 deletions(-) create mode 100644 db/changes/233401/00-models.sql create mode 100644 modules/shelving/back/models/train.json create mode 100644 modules/ticket/back/models/expeditionMistakeType.json create mode 100644 modules/worker/back/models/mistakeType.json create mode 100644 modules/worker/back/models/workerMistake.json create mode 100644 modules/worker/back/models/workerMistakeType.json diff --git a/db/changes/233401/00-models.sql b/db/changes/233401/00-models.sql new file mode 100644 index 000000000..648824287 --- /dev/null +++ b/db/changes/233401/00-models.sql @@ -0,0 +1,29 @@ +INSERT INTO salix.ACL ( model, property, accessType, permission, principalType, principalId) + VALUES('ExpeditionMistakeType', '*', 'READ', 'ALLOW', 'ROLE', 'employee'); + +INSERT INTO salix.ACL (id, model, property, accessType, permission, principalType, principalId) + VALUES('WorkerMistakeType', '*', 'READ', 'ALLOW', 'ROLE', 'employee'); + +INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) + VALUES ('ExpeditionMistake','*','WRITE','ALLOW','ROLE','employee'); + +INSERT INTO salix.ACL (model, property, accessType, permission, principalType, principalId) + VALUES('WorkerMistake', '*', 'WRITE', 'ALLOW', 'ROLE', 'coolerBoss'); + +INSERT INTO salix.ACL (model, property, accessType, permission, principalType, principalId) + VALUES('WorkerMistake', '*', 'WRITE', 'ALLOW', 'ROLE', 'coolerBoss'); + +INSERT INTO salix.ACL ( model, property, accessType, permission, principalType, principalId) + VALUES('MistakesTypes', '*', 'WRITE', 'ALLOW', 'ROLE', 'coolerBoss'); + +INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) + VALUES ('MistakeType','*','READ','ALLOW','ROLE','employee'); + +INSERT INTO salix.ACL (id, model, property, accessType, permission, principalType, principalId) + VALUES(698, 'MachineWorker', '*', 'READ', 'ALLOW', 'ROLE', 'coolerAssist'); + +INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) + VALUES ('Printer','*','READ','ALLOW','ROLE','employee'); + +INSERT INTO salix.ACL (model, property, accessType, permission, principalType, principalId) +VALUES( 'SaleMistake', '*', 'WRITE', 'ALLOW', 'ROLE', 'production'); diff --git a/modules/invoiceOut/back/models/printer.json b/modules/invoiceOut/back/models/printer.json index 99003560d..46a031f65 100644 --- a/modules/invoiceOut/back/models/printer.json +++ b/modules/invoiceOut/back/models/printer.json @@ -18,6 +18,13 @@ "isLabeler": { "type": "boolean" } + }, + "relations": { + "sector": { + "type": "belongsTo", + "model": "Sector", + "foreignKey": "sectorFk" + } }, "acls": [{ "accessType": "READ", diff --git a/modules/shelving/back/model-config.json b/modules/shelving/back/model-config.json index c26c39d38..89a0832b0 100644 --- a/modules/shelving/back/model-config.json +++ b/modules/shelving/back/model-config.json @@ -10,5 +10,8 @@ }, "Sector": { "dataSource": "vn" + }, + "Train": { + "dataSource": "vn" } } \ No newline at end of file diff --git a/modules/shelving/back/models/train.json b/modules/shelving/back/models/train.json new file mode 100644 index 000000000..cc819664b --- /dev/null +++ b/modules/shelving/back/models/train.json @@ -0,0 +1,19 @@ +{ + "name": "Train", + "options": { + "mysql": { + "table": "train" + } + }, + "properties": { + "id": { + "type": "number", + "id": true + }, + "name": { + "type": "string", + "required": true + } + + } +} diff --git a/modules/ticket/back/model-config.json b/modules/ticket/back/model-config.json index ef2a14dfe..456bb73d3 100644 --- a/modules/ticket/back/model-config.json +++ b/modules/ticket/back/model-config.json @@ -29,6 +29,9 @@ "ExpeditionMistake": { "dataSource": "vn" }, + "ExpeditionMistakeType": { + "dataSource": "vn" + }, "PrintServerQueue": { "dataSource": "vn" }, @@ -50,6 +53,9 @@ "SaleGroupDetail": { "dataSource": "vn" }, + "SaleMistake": { + "dataSource": "vn" + }, "SaleTracking": { "dataSource": "vn" }, diff --git a/modules/ticket/back/models/expeditionMistake.json b/modules/ticket/back/models/expeditionMistake.json index 43033194a..aeed2aa3a 100644 --- a/modules/ticket/back/models/expeditionMistake.json +++ b/modules/ticket/back/models/expeditionMistake.json @@ -24,7 +24,7 @@ }, "type": { "type": "belongsTo", - "model": "MistakeType", + "model": "ExpeditionMistakeType", "foreignKey": "typeFk" } } diff --git a/modules/ticket/back/models/expeditionMistakeType.json b/modules/ticket/back/models/expeditionMistakeType.json new file mode 100644 index 000000000..cf997a963 --- /dev/null +++ b/modules/ticket/back/models/expeditionMistakeType.json @@ -0,0 +1,20 @@ +{ + "name": "ExpeditionMistakeType", + "base": "VnModel", + "options": { + "mysql": { + "table": "expeditionMistakeType" + } + }, + "properties": { + "code": { + "id":true, + "type": "string" + + }, + "description": { + "type": "string" + } + } + } + \ No newline at end of file diff --git a/modules/ticket/back/models/sale-mistake.json b/modules/ticket/back/models/sale-mistake.json index 390e45404..b1cd989e0 100644 --- a/modules/ticket/back/models/sale-mistake.json +++ b/modules/ticket/back/models/sale-mistake.json @@ -46,4 +46,4 @@ } } -} +} \ No newline at end of file diff --git a/modules/worker/back/model-config.json b/modules/worker/back/model-config.json index 60ec273a5..ca47afaf6 100644 --- a/modules/worker/back/model-config.json +++ b/modules/worker/back/model-config.json @@ -40,6 +40,9 @@ }, "EducationLevel": { "dataSource": "vn" + }, + "MistakeType": { + "dataSource": "vn" }, "ProfileType":{ "dataSource": "vn" @@ -80,6 +83,12 @@ "WorkerMana": { "dataSource": "vn" }, + "WorkerMistake": { + "dataSource": "vn" + }, + "WorkerMistakeType": { + "dataSource": "vn" + }, "WorkerMedia": { "dataSource": "vn" }, diff --git a/modules/worker/back/models/mistakeType.json b/modules/worker/back/models/mistakeType.json new file mode 100644 index 000000000..71d9e4744 --- /dev/null +++ b/modules/worker/back/models/mistakeType.json @@ -0,0 +1,20 @@ +{ + "name": "MistakeType", + "base": "VnModel", + "options": { + "mysql": { + "table": "mistakeType" + } + }, + "properties": { + "id": { + "id":true, + "type": "number" + }, + "description": { + "type": "string" + } + + } + } + \ No newline at end of file diff --git a/modules/worker/back/models/workerMistake.json b/modules/worker/back/models/workerMistake.json new file mode 100644 index 000000000..47ed95f80 --- /dev/null +++ b/modules/worker/back/models/workerMistake.json @@ -0,0 +1,25 @@ +{ + "name": "WorkerMistake", + "base": "VnModel", + "options": { + "mysql": { + "table": "workerMistake" + } + }, + "properties": { + "id": { + "id":true, + "type": "number" + }, + "userFk": { + "type": "number" + }, + "workerMistakeTypeFk": { + "type": "string" + }, + "created": { + "type": "date" + } + } + } + \ No newline at end of file diff --git a/modules/worker/back/models/workerMistakeType.json b/modules/worker/back/models/workerMistakeType.json new file mode 100644 index 000000000..3c808f24c --- /dev/null +++ b/modules/worker/back/models/workerMistakeType.json @@ -0,0 +1,27 @@ +{ + "name": "WorkerMistakeType", + "base": "VnModel", + "options": { + "mysql": { + "table": "workerMistakeType" + } + }, + "properties": { + "code": { + "id":true, + "type": "string" + + }, + "description": { + "type": "string" + } + }, + "relations": { + "type": { + "type": "belongsTo", + "model": "WorkerMistakeType", + "foreignKey": "code" + } + } + } + \ No newline at end of file