From 1a01b3e58795f1b17993d4d6b8a8a9e5ac82b33c Mon Sep 17 00:00:00 2001 From: carlossa Date: Mon, 10 Jun 2024 10:42:52 +0200 Subject: [PATCH] refs #7529 back models acls --- .../11094-maroonCyca/00-firstScript.sql | 8 +++ modules/worker/back/model-config.json | 9 +++ .../worker/back/models/disability-grade.json | 18 ++++++ modules/worker/back/models/worker-irpf.json | 60 +++++++++++++++++++ .../worker/back/models/worker-relatives.json | 53 ++++++++++++++++ 5 files changed, 148 insertions(+) create mode 100644 db/versions/11094-maroonCyca/00-firstScript.sql create mode 100644 modules/worker/back/models/disability-grade.json create mode 100644 modules/worker/back/models/worker-irpf.json create mode 100644 modules/worker/back/models/worker-relatives.json diff --git a/db/versions/11094-maroonCyca/00-firstScript.sql b/db/versions/11094-maroonCyca/00-firstScript.sql new file mode 100644 index 000000000..dfaf5b79e --- /dev/null +++ b/db/versions/11094-maroonCyca/00-firstScript.sql @@ -0,0 +1,8 @@ +-- Place your SQL code here +-- Auto-generated SQL script #202406101036 +INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) + VALUES ('Worker','workerRelatives','*','ALLOW','ROLE','hr'); +INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) + VALUES ('Worker','workerIrpf','*','ALLOW','ROLE','hr'); +INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) + VALUES ('Worker','disabilityGrade','*','ALLOW','ROLE','hr'); diff --git a/modules/worker/back/model-config.json b/modules/worker/back/model-config.json index b7c355511..e58685123 100644 --- a/modules/worker/back/model-config.json +++ b/modules/worker/back/model-config.json @@ -124,6 +124,15 @@ }, "Locker": { "dataSource": "vn" + }, + "WorkerIrpf": { + "dataSource": "vn" + }, + "DisabilityGrade": { + "dataSource": "vn" + }, + "WorkerRelatives": { + "dataSource": "vn" } } diff --git a/modules/worker/back/models/disability-grade.json b/modules/worker/back/models/disability-grade.json new file mode 100644 index 000000000..506138225 --- /dev/null +++ b/modules/worker/back/models/disability-grade.json @@ -0,0 +1,18 @@ +{ + "name": "DisabilityGrade", + "base": "VnModel", + "options": { + "mysql": { + "table": "disabilityGrade" + } + }, + "properties": { + "id": { + "id": true, + "type": "number" + }, + "description": { + "type": "string" + } + } +} diff --git a/modules/worker/back/models/worker-irpf.json b/modules/worker/back/models/worker-irpf.json new file mode 100644 index 000000000..034bed368 --- /dev/null +++ b/modules/worker/back/models/worker-irpf.json @@ -0,0 +1,60 @@ +{ + "name": "WorkerIrpf", + "description": "Model 145 IRPF", + "base": "VnModel", + "options": { + "mysql": { + "table": "workerIrpf" + } + }, + "properties": { + "workerFk": { + "type": "number", + "id": true, + "description": "Identifier" + }, + "spouseNif": { + "type": "string" + }, + "geographicMobilityDate": { + "type": "date" + }, + "disabilityGradeFk": { + "type" : "number" + }, + "isDependent": { + "type" : "number" + }, + "familySituation": { + "type" : "number" + }, + "spousePension": { + "type" : "number" + }, + "childPension": { + "type" : "number" + }, + "hasHousingPaymentBefore": { + "type" : "number" + }, + "hasHousingPaymentAfter": { + "type" : "number" + }, + "updated": { + "type" : "date" + } + + }, + "relations": { + "disabilityGrade": { + "type": "belongsTo", + "model": "disabilityGrade", + "foreignKey": "disabilityGradeFk" + }, + "worker": { + "type": "belongsTo", + "model": "VnUser", + "foreignKey": "workerFK" + } + } +} diff --git a/modules/worker/back/models/worker-relatives.json b/modules/worker/back/models/worker-relatives.json new file mode 100644 index 000000000..2429a2f1c --- /dev/null +++ b/modules/worker/back/models/worker-relatives.json @@ -0,0 +1,53 @@ +{ + "name": "WorkerRelatives", + "description": "Model 145 IRPF", + "base": "VnModel", + "options": { + "mysql": { + "table": "workerRelatives" + } + }, + "properties": { + "id": { + "type": "number", + "id": true, + "description": "Identifier" + }, + "workerFk": { + "type": "number" + }, + "isDescendant": { + "type": "number" + }, + "disabilityGradeFk": { + "type" : "number" + }, + "birthed": { + "type" : "number" + }, + "adoptionYear": { + "type" : "number" + }, + "isDependend": { + "type" : "boolean" + }, + "islointCustody": { + "type" : "boolean" + }, + "updated": { + "type" : "date" + } + }, + "relations": { + "disabilityGrade": { + "type": "belongsTo", + "model": "disabilityGrade", + "foreignKey": "disabilityGradeFk" + }, + "worker": { + "type": "belongsTo", + "model": "WorkerIrpf", + "foreignKey": "workerFK" + } + } +}