Merge pull request 'refs #7529 back models acls' (!2563) from 7529-workerPIT into dev
gitea/salix/pipeline/head This commit looks good Details

Reviewed-on: #2563
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
This commit is contained in:
Carlos Satorres 2024-11-20 12:21:30 +00:00
commit d46683cd31
7 changed files with 171 additions and 6 deletions

View File

@ -4008,6 +4008,9 @@ 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);
@ -4031,4 +4034,6 @@ INSERT IGNORE INTO vn.saySimpleCountry (countryFk, channel)
(8, '1183');
INSERT IGNORE INTO vn.saySimpleConfig (url, defaultChannel)
VALUES ('saysimle-url-mock', 1320);
VALUES ('saysimle-url-mock', 1320);INSERT INTO vn.workerIrpf (workerFk,spouseNif,geographicMobilityDate)
VALUES
(1106,'26493101E','2019-09-20');

View File

@ -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');

View File

@ -125,6 +125,15 @@
"Locker": {
"dataSource": "vn"
},
"WorkerIrpf": {
"dataSource": "vn"
},
"DisabilityGrade": {
"dataSource": "vn"
},
"WorkerRelative": {
"dataSource": "vn"
},
"MedicalReview": {
"dataSource": "vn"
},

View File

@ -0,0 +1,18 @@
{
"name": "DisabilityGrade",
"base": "VnModel",
"options": {
"mysql": {
"table": "disabilityGrade"
}
},
"properties": {
"id": {
"id": true,
"type": "number"
},
"description": {
"type": "string"
}
}
}

View File

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

View File

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

View File

@ -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": [