From 6eb88f8ab7f7923af915791f9adb4934bd708ee6 Mon Sep 17 00:00:00 2001 From: sergiodt Date: Fri, 11 Aug 2023 11:58:30 +0200 Subject: [PATCH 1/8] refs #5134 feat: models --- modules/ticket/back/models/saleMistake.json | 49 +++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 modules/ticket/back/models/saleMistake.json diff --git a/modules/ticket/back/models/saleMistake.json b/modules/ticket/back/models/saleMistake.json new file mode 100644 index 000000000..b48e6088d --- /dev/null +++ b/modules/ticket/back/models/saleMistake.json @@ -0,0 +1,49 @@ +{ // A REVISAR QUE NOFA INSERT EN + "name": "SaleMistake", + "base": "VnModel", + "options": { + "mysql": { + "table": "saleMistake" + } + }, + "properties": { + "id": { + "id": true, + "type": "number", + "description": "Identifier" + }, + "created": { + "type": "date" + }, + "saleFk": { + "type": "number" + }, + "userFk": { + "type": "number" + }, + "typeFk": { + "type": "number" + } + }, + "relations": { + "sale": { + "type": "belongsTo", + "model": "Sale", + "foreignKey": "saleFk", + "required": true + }, + "worker": { + "type": "belongsTo", + "model": "Worker", + "foreignKey": "userFk", + "required": true + }, + "mistakeType": { + "type": "belongsTo", + "model": "MistakeType", + "foreignKey": "typeFk", + "required": true + } + + } +} From 9ef4ba9befa6dcf1de94d6d0b7b167e6a049c3ac Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 11 Aug 2023 12:32:49 +0200 Subject: [PATCH 2/8] refs #5134 feat: add saleMistake model --- db/changes/233401/00-acl_saleMistake.sql | 3 +++ db/dump/fixtures.sql | 6 ++++- modules/ticket/back/model-config.json | 3 +++ .../{saleMistake.json => sale-mistake.json} | 22 +++++++++---------- 4 files changed, 22 insertions(+), 12 deletions(-) create mode 100644 db/changes/233401/00-acl_saleMistake.sql rename modules/ticket/back/models/{saleMistake.json => sale-mistake.json} (75%) diff --git a/db/changes/233401/00-acl_saleMistake.sql b/db/changes/233401/00-acl_saleMistake.sql new file mode 100644 index 000000000..219669c17 --- /dev/null +++ b/db/changes/233401/00-acl_saleMistake.sql @@ -0,0 +1,3 @@ +INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) + VALUES + ('SaleMistake', 'create', 'WRITE', 'ALLOW', 'ROLE', 'employee'); diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index 7a572fb04..630b6fb6c 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -2955,6 +2955,10 @@ INSERT INTO `vn`.`invoiceInSerial` (`code`, `description`, `cplusTerIdNifFk`, `t ('W', 'Vanaheim', 1, 'WORLD'); -INSERT INTO `hedera`.`imageConfig` (`id`, `maxSize`, `useXsendfile`, `url`) +INSERT INTO `hedera`.`imageConfig` (`id`, `maxSize`, `useXsendfile`, `url`) VALUES (1, 0, 0, 'marvel.com'); + +INSERT INTO `vn`.`mistakeType` (`id`, `description`) + VALUES + (1, 'Incorrect quantity'); diff --git a/modules/ticket/back/model-config.json b/modules/ticket/back/model-config.json index 3c7e12eea..ef2a14dfe 100644 --- a/modules/ticket/back/model-config.json +++ b/modules/ticket/back/model-config.json @@ -44,6 +44,9 @@ "SaleGroup": { "dataSource": "vn" }, + "SaleMistake": { + "dataSource": "vn" + }, "SaleGroupDetail": { "dataSource": "vn" }, diff --git a/modules/ticket/back/models/saleMistake.json b/modules/ticket/back/models/sale-mistake.json similarity index 75% rename from modules/ticket/back/models/saleMistake.json rename to modules/ticket/back/models/sale-mistake.json index b48e6088d..390e45404 100644 --- a/modules/ticket/back/models/saleMistake.json +++ b/modules/ticket/back/models/sale-mistake.json @@ -1,4 +1,4 @@ -{ // A REVISAR QUE NOFA INSERT EN +{ "name": "SaleMistake", "base": "VnModel", "options": { @@ -16,34 +16,34 @@ "type": "date" }, "saleFk": { - "type": "number" + "type": "number", + "required": true }, "userFk": { - "type": "number" + "type": "number", + "required": true }, "typeFk": { - "type": "number" + "type": "number", + "required": true } }, "relations": { "sale": { "type": "belongsTo", "model": "Sale", - "foreignKey": "saleFk", - "required": true + "foreignKey": "saleFk" }, "worker": { "type": "belongsTo", "model": "Worker", - "foreignKey": "userFk", - "required": true + "foreignKey": "userFk" }, "mistakeType": { "type": "belongsTo", "model": "MistakeType", - "foreignKey": "typeFk", - "required": true + "foreignKey": "typeFk" } - + } } From a6047d257b9c118e971767f45baf62208c13f50e Mon Sep 17 00:00:00 2001 From: sergiodt Date: Fri, 11 Aug 2023 12:45:18 +0200 Subject: [PATCH 3/8] 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 From 1ec51d94cf497df1ed51dc0043d66091583430d8 Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 11 Aug 2023 12:53:43 +0200 Subject: [PATCH 4/8] refs #5134 feat: correct sql --- db/changes/233401/00-acl_saleMistake.sql | 3 --- db/changes/233401/00-models.sql | 24 ++++++++++++------------ modules/ticket/back/model-config.json | 3 --- 3 files changed, 12 insertions(+), 18 deletions(-) delete mode 100644 db/changes/233401/00-acl_saleMistake.sql diff --git a/db/changes/233401/00-acl_saleMistake.sql b/db/changes/233401/00-acl_saleMistake.sql deleted file mode 100644 index 219669c17..000000000 --- a/db/changes/233401/00-acl_saleMistake.sql +++ /dev/null @@ -1,3 +0,0 @@ -INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) - VALUES - ('SaleMistake', 'create', 'WRITE', 'ALLOW', 'ROLE', 'employee'); diff --git a/db/changes/233401/00-models.sql b/db/changes/233401/00-models.sql index 648824287..c06965b3f 100644 --- a/db/changes/233401/00-models.sql +++ b/db/changes/233401/00-models.sql @@ -1,29 +1,29 @@ -INSERT INTO salix.ACL ( model, property, accessType, permission, principalType, principalId) +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) +INSERT INTO `salix`.`ACL` (model, property, accessType, permission, principalType, principalId) VALUES('WorkerMistakeType', '*', 'READ', 'ALLOW', 'ROLE', 'employee'); -INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) +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) +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) +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) +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) +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('MachineWorker', '*', 'READ', 'ALLOW', 'ROLE', 'coolerAssist'); -INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) +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'); +INSERT INTO `salix`.`ACL` (model, property, accessType, permission, principalType, principalId) + VALUES( 'SaleMistake', '*', 'WRITE', 'ALLOW', 'ROLE', 'production'); diff --git a/modules/ticket/back/model-config.json b/modules/ticket/back/model-config.json index 456bb73d3..e90d0409f 100644 --- a/modules/ticket/back/model-config.json +++ b/modules/ticket/back/model-config.json @@ -53,9 +53,6 @@ "SaleGroupDetail": { "dataSource": "vn" }, - "SaleMistake": { - "dataSource": "vn" - }, "SaleTracking": { "dataSource": "vn" }, From ed1d8ca94f4ef6ec8a6f78eab0f30c19c7895f59 Mon Sep 17 00:00:00 2001 From: sergiodt Date: Fri, 22 Sep 2023 12:29:56 +0200 Subject: [PATCH 5/8] refs #5134 feat: models --- .../models/item-shelving-placement-supply.json | 6 ++++++ modules/item/back/models/item-shelving.json | 6 ++++++ modules/shelving/back/models/shelving.json | 3 +-- modules/ticket/back/model-config.json | 6 ++++++ modules/ticket/back/models/expeditionPallet.json | 16 ++++++++++++++++ modules/ticket/back/models/expeditionScan.json | 16 ++++++++++++++++ 6 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 modules/ticket/back/models/expeditionPallet.json create mode 100644 modules/ticket/back/models/expeditionScan.json diff --git a/modules/item/back/models/item-shelving-placement-supply.json b/modules/item/back/models/item-shelving-placement-supply.json index a54013e05..18d0a8d56 100644 --- a/modules/item/back/models/item-shelving-placement-supply.json +++ b/modules/item/back/models/item-shelving-placement-supply.json @@ -26,11 +26,17 @@ "shelving": { "type": "string" }, + "subName": { + "type": "string" + }, "packing": { "type": "number" }, "stock": { "type": "number" + }, + "size": { + "type": "number" } } } \ No newline at end of file diff --git a/modules/item/back/models/item-shelving.json b/modules/item/back/models/item-shelving.json index 8628bfeee..7f82f48b3 100644 --- a/modules/item/back/models/item-shelving.json +++ b/modules/item/back/models/item-shelving.json @@ -20,10 +20,16 @@ }, "created": { "type": "date" + }, + "grouping": { + "type": "number" }, "isChecked": { "type": "boolean" }, + "packing": { + "type": "number" + }, "visible": { "type": "number" }, diff --git a/modules/shelving/back/models/shelving.json b/modules/shelving/back/models/shelving.json index 5f60318a5..5459e29fd 100644 --- a/modules/shelving/back/models/shelving.json +++ b/modules/shelving/back/models/shelving.json @@ -9,12 +9,11 @@ "properties": { "id": { "type": "number", - "id": true, "description": "Identifier" }, "code": { "type": "string", - "required": true + "id": true }, "parkingFk": { "type": "number" diff --git a/modules/ticket/back/model-config.json b/modules/ticket/back/model-config.json index e90d0409f..247e18d01 100644 --- a/modules/ticket/back/model-config.json +++ b/modules/ticket/back/model-config.json @@ -17,6 +17,12 @@ "Expedition": { "dataSource": "vn" }, + "ExpeditionPallet": { + "dataSource": "vn" + }, + "ExpeditionScan": { + "dataSource": "vn" + }, "ExpeditionState": { "dataSource": "vn" }, diff --git a/modules/ticket/back/models/expeditionPallet.json b/modules/ticket/back/models/expeditionPallet.json new file mode 100644 index 000000000..2c56a65e0 --- /dev/null +++ b/modules/ticket/back/models/expeditionPallet.json @@ -0,0 +1,16 @@ +{ + "name": "ExpeditionPallet", + "options": { + "mysql": { + "table": "expeditionPallet" + } + }, + "acls": [{ + "accessType": "WRITE", + "principalType": "ROLE", + "principalId": "production", + "permission": "ALLOW" + }] + + } + diff --git a/modules/ticket/back/models/expeditionScan.json b/modules/ticket/back/models/expeditionScan.json new file mode 100644 index 000000000..f43ad0539 --- /dev/null +++ b/modules/ticket/back/models/expeditionScan.json @@ -0,0 +1,16 @@ +{ + "name": "ExpeditionScan", + "options": { + "mysql": { + "table": "expeditionScan" + } + }, + "acls": [{ + "accessType": "WRITE", + "principalType": "ROLE", + "principalId": "production", + "permission": "ALLOW" + }] + + } + From 2ea2943ecadc3f660b8c389cb7ac47e4db73983d Mon Sep 17 00:00:00 2001 From: sergiodt Date: Tue, 26 Sep 2023 13:12:18 +0200 Subject: [PATCH 6/8] refs #5134 feat: models --- modules/shelving/back/models/shelving.json | 6 ++-- .../ticket/back/models/expeditionPallet.json | 10 ++++-- .../ticket/back/models/expeditionScan.json | 35 +++++++++++++++++-- 3 files changed, 44 insertions(+), 7 deletions(-) diff --git a/modules/shelving/back/models/shelving.json b/modules/shelving/back/models/shelving.json index 5459e29fd..bb2401666 100644 --- a/modules/shelving/back/models/shelving.json +++ b/modules/shelving/back/models/shelving.json @@ -9,11 +9,11 @@ "properties": { "id": { "type": "number", - "description": "Identifier" + "description": "Identifier", + "id": true }, "code": { - "type": "string", - "id": true + "type": "string" }, "parkingFk": { "type": "number" diff --git a/modules/ticket/back/models/expeditionPallet.json b/modules/ticket/back/models/expeditionPallet.json index 2c56a65e0..c5a38df75 100644 --- a/modules/ticket/back/models/expeditionPallet.json +++ b/modules/ticket/back/models/expeditionPallet.json @@ -4,6 +4,13 @@ "mysql": { "table": "expeditionPallet" } + }, + "properties": { + "id": { + "type": "number", + "id": true, + "description": "Identifier" + } }, "acls": [{ "accessType": "WRITE", @@ -11,6 +18,5 @@ "principalId": "production", "permission": "ALLOW" }] - - } +} diff --git a/modules/ticket/back/models/expeditionScan.json b/modules/ticket/back/models/expeditionScan.json index f43ad0539..1db2c1238 100644 --- a/modules/ticket/back/models/expeditionScan.json +++ b/modules/ticket/back/models/expeditionScan.json @@ -5,12 +5,43 @@ "table": "expeditionScan" } }, + "properties": { + "id": { + "type": "number", + "description": "Identifier" + }, + "expeditionFk": { + "type": "number", + "description": "Identifier", + "id": true + }, + "palletFk": { + "type": "number", + "description": "Identifier", + "id": true + }, + "scanned": { + "type": "date", + "default": "$now" + } + }, + "relations": { + "expedition": { + "type": "belongsTo", + "model": "Expedition", + "foreignKey": "expeditionFk" + }, + "pallet": { + "type": "belongsTo", + "model": "expeditionPallet", + "foreignKey": "palletFk" + } + }, "acls": [{ "accessType": "WRITE", "principalType": "ROLE", "principalId": "production", "permission": "ALLOW" }] - - } +} From a86469ccd28a971139f9ae52c634b5b7d3f2a752 Mon Sep 17 00:00:00 2001 From: sergiodt Date: Thu, 28 Sep 2023 07:42:44 +0200 Subject: [PATCH 7/8] refs #5134 fix: format --- db/changes/233401/00-models.sql | 29 ------------------- db/changes/{233401 => 234001}/.gitkeep | 0 db/changes/234001/00-models.sql | 11 +++++++ modules/shelving/back/models/shelving.json | 2 +- modules/ticket/back/model-config.json | 2 +- .../back/models/expeditionMistakeType.json | 7 ++--- modules/worker/back/models/mistakeType.json | 2 +- modules/worker/back/models/workerMistake.json | 8 ++--- 8 files changed, 21 insertions(+), 40 deletions(-) delete mode 100644 db/changes/233401/00-models.sql rename db/changes/{233401 => 234001}/.gitkeep (100%) create mode 100644 db/changes/234001/00-models.sql diff --git a/db/changes/233401/00-models.sql b/db/changes/233401/00-models.sql deleted file mode 100644 index c06965b3f..000000000 --- a/db/changes/233401/00-models.sql +++ /dev/null @@ -1,29 +0,0 @@ -INSERT INTO `salix`.`ACL` ( model, property, accessType, permission, principalType, principalId) - VALUES('ExpeditionMistakeType', '*', 'READ', 'ALLOW', 'ROLE', 'employee'); - -INSERT INTO `salix`.`ACL` (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` (model, property, accessType, permission, principalType, principalId) - VALUES('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/db/changes/233401/.gitkeep b/db/changes/234001/.gitkeep similarity index 100% rename from db/changes/233401/.gitkeep rename to db/changes/234001/.gitkeep diff --git a/db/changes/234001/00-models.sql b/db/changes/234001/00-models.sql new file mode 100644 index 000000000..51ffa1554 --- /dev/null +++ b/db/changes/234001/00-models.sql @@ -0,0 +1,11 @@ +INSERT INTO `salix`.`ACL` ( model, property, accessType, permission, principalType, principalId) + VALUES + ('ExpeditionMistakeType', '*', 'READ', 'ALLOW', 'ROLE', 'employee'); + ('WorkerMistakeType', '*', 'READ', 'ALLOW', 'ROLE', 'employee'); + ('ExpeditionMistake','*','WRITE','ALLOW','ROLE','employee'); + ('WorkerMistake', '*', 'WRITE', 'ALLOW', 'ROLE', 'coolerBoss'); + ('MistakesTypes', '*', 'WRITE', 'ALLOW', 'ROLE', 'coolerBoss'); + ('MistakeType','*','READ','ALLOW','ROLE','employee'); + ('MachineWorker', '*', 'READ', 'ALLOW', 'ROLE', 'coolerAssist'); + ('Printer','*','READ','ALLOW','ROLE','employee'); + ('SaleMistake', '*', 'WRITE', 'ALLOW', 'ROLE', 'production'); diff --git a/modules/shelving/back/models/shelving.json b/modules/shelving/back/models/shelving.json index bb2401666..8bfcac9a1 100644 --- a/modules/shelving/back/models/shelving.json +++ b/modules/shelving/back/models/shelving.json @@ -10,7 +10,7 @@ "id": { "type": "number", "description": "Identifier", - "id": true + "id": true }, "code": { "type": "string" diff --git a/modules/ticket/back/model-config.json b/modules/ticket/back/model-config.json index 247e18d01..92bd83ac5 100644 --- a/modules/ticket/back/model-config.json +++ b/modules/ticket/back/model-config.json @@ -36,7 +36,7 @@ "dataSource": "vn" }, "ExpeditionMistakeType": { - "dataSource": "vn" + "dataSource": "vn" }, "PrintServerQueue": { "dataSource": "vn" diff --git a/modules/ticket/back/models/expeditionMistakeType.json b/modules/ticket/back/models/expeditionMistakeType.json index cf997a963..c7eaa3cac 100644 --- a/modules/ticket/back/models/expeditionMistakeType.json +++ b/modules/ticket/back/models/expeditionMistakeType.json @@ -7,10 +7,9 @@ } }, "properties": { - "code": { - "id":true, - "type": "string" - + "code": { + "id":true, + "type": "string" }, "description": { "type": "string" diff --git a/modules/worker/back/models/mistakeType.json b/modules/worker/back/models/mistakeType.json index 71d9e4744..c9fe3ee39 100644 --- a/modules/worker/back/models/mistakeType.json +++ b/modules/worker/back/models/mistakeType.json @@ -7,7 +7,7 @@ } }, "properties": { - "id": { + "id": { "id":true, "type": "number" }, diff --git a/modules/worker/back/models/workerMistake.json b/modules/worker/back/models/workerMistake.json index 47ed95f80..00978761e 100644 --- a/modules/worker/back/models/workerMistake.json +++ b/modules/worker/back/models/workerMistake.json @@ -7,10 +7,10 @@ } }, "properties": { - "id": { - "id":true, - "type": "number" - }, + "id": { + "id":true, + "type": "number" + }, "userFk": { "type": "number" }, From 18de92f9e71a641f049ad6dec0d5329459e67ad9 Mon Sep 17 00:00:00 2001 From: sergiodt Date: Thu, 28 Sep 2023 07:51:54 +0200 Subject: [PATCH 8/8] refs #5134 fix: format --- db/changes/234001/00-models.sql | 16 ++++++++-------- modules/worker/back/models/mistakeType.json | 4 ++-- .../worker/back/models/workerMistakeType.json | 7 +++---- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/db/changes/234001/00-models.sql b/db/changes/234001/00-models.sql index 51ffa1554..abf1e3ea5 100644 --- a/db/changes/234001/00-models.sql +++ b/db/changes/234001/00-models.sql @@ -1,11 +1,11 @@ INSERT INTO `salix`.`ACL` ( model, property, accessType, permission, principalType, principalId) VALUES - ('ExpeditionMistakeType', '*', 'READ', 'ALLOW', 'ROLE', 'employee'); - ('WorkerMistakeType', '*', 'READ', 'ALLOW', 'ROLE', 'employee'); - ('ExpeditionMistake','*','WRITE','ALLOW','ROLE','employee'); - ('WorkerMistake', '*', 'WRITE', 'ALLOW', 'ROLE', 'coolerBoss'); - ('MistakesTypes', '*', 'WRITE', 'ALLOW', 'ROLE', 'coolerBoss'); - ('MistakeType','*','READ','ALLOW','ROLE','employee'); - ('MachineWorker', '*', 'READ', 'ALLOW', 'ROLE', 'coolerAssist'); - ('Printer','*','READ','ALLOW','ROLE','employee'); + ('ExpeditionMistakeType', '*', 'READ', 'ALLOW', 'ROLE', 'employee'), + ('WorkerMistakeType', '*', 'READ', 'ALLOW', 'ROLE', 'employee'), + ('ExpeditionMistake','*','WRITE','ALLOW','ROLE','employee'), + ('WorkerMistake', '*', 'WRITE', 'ALLOW', 'ROLE', 'coolerBoss'), + ('MistakesTypes', '*', 'WRITE', 'ALLOW', 'ROLE', 'coolerBoss'), + ('MistakeType','*','READ','ALLOW','ROLE','employee'), + ('MachineWorker', '*', 'READ', 'ALLOW', 'ROLE', 'coolerAssist'), + ('Printer','*','READ','ALLOW','ROLE','employee'), ('SaleMistake', '*', 'WRITE', 'ALLOW', 'ROLE', 'production'); diff --git a/modules/worker/back/models/mistakeType.json b/modules/worker/back/models/mistakeType.json index c9fe3ee39..e999b3e28 100644 --- a/modules/worker/back/models/mistakeType.json +++ b/modules/worker/back/models/mistakeType.json @@ -8,8 +8,8 @@ }, "properties": { "id": { - "id":true, - "type": "number" + "id":true, + "type": "number" }, "description": { "type": "string" diff --git a/modules/worker/back/models/workerMistakeType.json b/modules/worker/back/models/workerMistakeType.json index 3c808f24c..c5e6e6383 100644 --- a/modules/worker/back/models/workerMistakeType.json +++ b/modules/worker/back/models/workerMistakeType.json @@ -7,10 +7,9 @@ } }, "properties": { - "code": { - "id":true, - "type": "string" - + "code": { + "id":true, + "type": "string" }, "description": { "type": "string"