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" + } + } +}