refs #7406 worker formation #2511

Merged
carlossa merged 12 commits from 7406-workerFormation into dev 2024-06-25 11:17:58 +00:00
7 changed files with 138 additions and 0 deletions

View File

@ -3845,6 +3845,13 @@ INSERT INTO `vn`.`ledgerCompany` SET
INSERT INTO `vn`.`ledgerConfig` SET INSERT INTO `vn`.`ledgerConfig` SET
maxTolerance = 0.01; maxTolerance = 0.01;
INSERT INTO vn.trainingCourse (workerFk,trainingCourseTypeFk,centerFk,started,ended,hasDiscount,hasDiploma)
VALUES
carlossa marked this conversation as resolved Outdated
Outdated
Review

Poner forma simplificada

Poner forma simplificada
(9,2,1,'2018-06-20 00:00:00.000','2020-06-24 00:00:00.000',0,1),
(9,1,2,'2018-06-20 00:00:00.000','2020-06-24 00:00:00.000',1,0),
(9,2,2,'2018-06-20 00:00:00.000','2020-06-24 00:00:00.000',1,1);
INSERT INTO vn.sectorCollection INSERT INTO vn.sectorCollection
SET id = 2, SET id = 2,
userFk = 18, userFk = 18,

View File

@ -0,0 +1,9 @@
-- Auto-generated SQL script. Actual values for binary/complex data types may differ - what you see is the default string representation of values.
INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
VALUES ('TrainingCourse','*','*','ALLOW','ROLE','hr');
carlossa marked this conversation as resolved Outdated
Outdated
Review

seria hr?

seria hr?
INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
VALUES ('TrainingCourseType','*','*','ALLOW','ROLE','hr');
INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
VALUES ('TrainingCenter','*','*','ALLOW','ROLE','hr');
INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
VALUES ('Worker','__get__trainingCourse','*','ALLOW','ROLE','hr');

View File

@ -124,6 +124,15 @@
}, },
"Locker": { "Locker": {
"dataSource": "vn" "dataSource": "vn"
},
"TrainingCourse": {
"dataSource": "vn"
},
"TrainingCourseType": {
"dataSource": "vn"
},
"TrainingCenter": {
"dataSource": "vn"
} }
} }

View File

@ -0,0 +1,21 @@
{
"name": "TrainingCenter",
"base": "VnModel",
"options": {
"mysql": {
"table": "trainingCenter"
}
},
"properties": {
"id": {
"type": "number",
"id": true,
"description": "Identifier"
},
"name": {
"type": "string",
"required": true
}
}
}

View File

@ -0,0 +1,66 @@
{
"name": "TrainingCourse",
"description": "List of workers who have completed training",
"base": "VnModel",
"options": {
"mysql": {
"table": "trainingCourse"
}
},
"properties": {
"id": {
"type": "number",
"id": true,
"description": "Identifier"
},
"workerFk": {
"type": "number",
"required": true
},
"trainingCourseTypeFk": {
"type": "number",
"required": true
},
"centerFk": {
"type" : "number"
},
"started": {
"type" : "date"
},
"ended": {
"type" : "date"
},
"invoice": {
"type" : "string"
},
"amount": {
"type" : "number"
},
"remark": {
"type" : "boolean"
},
"hasDiscount": {
"type" : "boolean"
},
"hasDiploma": {
"type" : "boolean"
}
},
"relations": {
"worker": {
"type": "belongsTo",
"model": "Worker",
"foreignKey": "workerFk"
},
"trainingCourseType": {
"type": "belongsTo",
"model": "TrainingCourseType",
"foreignKey": "trainingCourseTypeFk"
},
"trainingCenter": {
"type": "belongsTo",
"model": "TrainingCenter",
"foreignKey": "centerFk"
}
}
}

View File

@ -0,0 +1,21 @@
{
"name": "TrainingCourseType",
"description": "List of trainings",
"base": "VnModel",
"options": {
"mysql": {
"table": "trainingCourseType"
}
},
"properties": {
"id": {
"type": "number",
"id": true,
"description": "Identifier"
},
"name": {
"type": "string",
"required": true
}
}
}

View File

@ -115,6 +115,11 @@
"type": "hasMany", "type": "hasMany",
"model": "Locker", "model": "Locker",
"foreignKey": "workerFk" "foreignKey": "workerFk"
},
"trainingCourse": {
"type": "hasMany",
"model": "TrainingCourse",
"foreignKey": "workerFk"
} }
}, },
"acls": [ "acls": [