diff --git a/db/dump/fixtures.before.sql b/db/dump/fixtures.before.sql index e093c05cb..12b885437 100644 --- a/db/dump/fixtures.before.sql +++ b/db/dump/fixtures.before.sql @@ -4008,14 +4008,17 @@ INSERT IGNORE INTO pbx.queueMember UPDATE vn.department SET pbxQueue = '1000' WHERE name = "CAMARA"; UPDATE vn.department SET pbxQueue = '2000' WHERE name = "VENTAS"; +INSERT INTO vn.workerRelatives (workerFk, isDescendant, disabilityGradeFk, birthed, adoptionYear, isDependend, isJointCustody, updated) + VALUES + (1106, 1, NULL, 0, NULL, 0, 0, '2024-10-29 08:42:44.000'); INSERT INTO vn.routeAction (id, name, price, isMainlineDelivered) VALUES(1, 'Pintar traje', 50.00, 0); INSERT INTO vn.routeComplement (id, dated, workerFk, price, routeActionFk) VALUES(1, util.VN_CURDATE(), 9, 50.00, 1); -INSERT INTO srt.buffer (id, x, y, `size`, `length`, stateFk, typeFk, isActive, code, stratus, hasWorkerWaiting, reserve, routeFk, dayMinute, lastUnloaded, hasStrapper, typeDefaultFk, motors, editorFk) +INSERT INTO srt.buffer (id, x, y, `size`, `length`, stateFk, typeFk, isActive, code, stratus, hasWorkerWaiting, reserve, routeFk, dayMinute, lastUnloaded, hasStrapper, typeDefaultFk, motors, editorFk) VALUES (0, 0, 0, 0, NULL, 3, 1, 0, 'ENT', 0, 0, NULL, NULL, NULL, NULL, 0, 1, 1, NULL), (1, 0, 9900, 0, NULL, 1, 0, 0, 'NOK', 0, 0, NULL, NULL, NULL, NULL, 0, 1, 1, NULL), - (2, 0, 0, 450, 13000, 1, 0, 1, '01A', 1, 1, NULL, NULL, NULL, NULL, 0, 1, 1, NULL), + (2, 0, 0, 450, 13000, 1, 0, 1, '01A', 1, 1, NULL, NULL, NULL, NULL, 0, 1, 1, NULL), (3, 1400, 0, 450, 13000, 1, 0, 1, '01B', 1, 0, NULL, NULL, NULL, NULL, 0, 1, 1, NULL), (4, 0, 500, 500, 13000, 1, 4, 1, '02A', 2, 1, NULL, NULL, NULL, NULL, 1, 4, 13, NULL), (5, 1400, 500, 500, 13000, 1, 4, 1, '02B', 2, 1, NULL, NULL, NULL, NULL, 1, 4, 13, NULL), @@ -4026,9 +4029,11 @@ INSERT INTO srt.buffer (id, x, y, `size`, `length`, stateFk, typeFk, isActive, c (10, 0, 2000, 500, 13000, 1, 1, 1, '05A', 5, 0, NULL, NULL, NULL, NULL, 0, 1, 1, NULL); -INSERT IGNORE INTO vn.saySimpleCountry (countryFk, channel) +INSERT IGNORE INTO vn.saySimpleCountry (countryFk, channel) VALUES (19, '1169'), (8, '1183'); -INSERT IGNORE INTO vn.saySimpleConfig (url, defaultChannel) - VALUES ('saysimle-url-mock', 1320); \ No newline at end of file +INSERT IGNORE INTO vn.saySimpleConfig (url, defaultChannel) + VALUES ('saysimle-url-mock', 1320);INSERT INTO vn.workerIrpf (workerFk,spouseNif,geographicMobilityDate) + VALUES + (1106,'26493101E','2019-09-20'); diff --git a/db/versions/11312-navyAralia/00-firstScript.sql b/db/versions/11312-navyAralia/00-firstScript.sql new file mode 100644 index 000000000..466b18f6b --- /dev/null +++ b/db/versions/11312-navyAralia/00-firstScript.sql @@ -0,0 +1,15 @@ +ALTER TABLE vn.workerRelatives DROP FOREIGN KEY workerRelatives_disabilityGradeFk; +ALTER TABLE vn.workerRelatives DROP FOREIGN KEY workerRelatives_workerFk; + +INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) + VALUES + ('WorkerRelative','updateAttributes','*','ALLOW','ROLE','hr'), + ('WorkerRelative','crud','WRITE','ALLOW','ROLE','hr'), + ('WorkerRelative','findById','*','ALLOW','ROLE','hr'), + ('WorkerIrpf','updateAttributes','*','ALLOW','ROLE','hr'), + ('WorkerIrpf','crud','*','ALLOW','ROLE','hr'), + ('WorkerRelative','findById','*','ALLOW','ROLE','hr'), + ('DisabilityGrade','updateAttributes','*','ALLOW','ROLE','hr'), + ('DisabilityGrade','crud','*','ALLOW','ROLE','hr'), + ('DisabilityGrade','findById','*','ALLOW','ROLE','hr'); + diff --git a/modules/worker/back/model-config.json b/modules/worker/back/model-config.json index 7bfc667ac..dc078f4d0 100644 --- a/modules/worker/back/model-config.json +++ b/modules/worker/back/model-config.json @@ -125,6 +125,15 @@ "Locker": { "dataSource": "vn" }, + "WorkerIrpf": { + "dataSource": "vn" + }, + "DisabilityGrade": { + "dataSource": "vn" + }, + "WorkerRelative": { + "dataSource": "vn" + }, "MedicalReview": { "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..65f72a1fd --- /dev/null +++ b/modules/worker/back/models/worker-irpf.json @@ -0,0 +1,55 @@ +{ + "name": "WorkerIrpf", + "description": "Model 145 IRPF", + "base": "VnModel", + "options": { + "mysql": { + "table": "workerIrpf" + } + }, + "properties": { + "workerFk": { + "type": "number", + "id": 1, + "description": "Identifier" + }, + "spouseNif": { + "type": "string" + }, + "geographicMobilityDate": { + "type": "date" + }, + "disabilityGradeFk": { + "type" : "number" + }, + "isDependend": { + "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" + } + } +} diff --git a/modules/worker/back/models/worker-relatives.json b/modules/worker/back/models/worker-relatives.json new file mode 100644 index 000000000..532a9446c --- /dev/null +++ b/modules/worker/back/models/worker-relatives.json @@ -0,0 +1,53 @@ +{ + "name": "WorkerRelative", + "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" + }, + "isJointCustody": { + "type" : "boolean" + }, + "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.json b/modules/worker/back/models/worker.json index 5c3b95fe6..705851963 100644 --- a/modules/worker/back/models/worker.json +++ b/modules/worker/back/models/worker.json @@ -132,6 +132,16 @@ "type": "hasMany", "model": "WorkerTimeControlMail", "foreignKey": "workerFk" + }, + "irpf": { + "type": "hasMany", + "model": "WorkerIrpf", + "foreignKey": "workerFk" + }, + "workerRelative": { + "type": "hasMany", + "model": "WorkerRelative", + "foreignKey": "workerFK" } }, "acls": [ @@ -317,4 +327,4 @@ ] } } -} \ No newline at end of file +}