Merge pull request 'refs #7406 worker formation' (!2511) from 7406-workerFormation into dev
gitea/salix/pipeline/head This commit looks good Details

Reviewed-on: #2511
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
This commit is contained in:
Carlos Satorres 2024-06-25 11:17:56 +00:00
commit 087a051a4a
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
maxTolerance = 0.01;
INSERT INTO vn.trainingCourse (workerFk,trainingCourseTypeFk,centerFk,started,ended,hasDiscount,hasDiploma)
VALUES
(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
SET id = 2,
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');
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": {
"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",
"model": "Locker",
"foreignKey": "workerFk"
},
"trainingCourse": {
"type": "hasMany",
"model": "TrainingCourse",
"foreignKey": "workerFk"
}
},
"acls": [