6078_workerActivty #2130

Merged
sergiodt merged 7 commits from 6078_workerActivty into dev 2024-03-14 05:58:14 +00:00
6 changed files with 455 additions and 353 deletions
Showing only changes of commit 96abdd4630 - Show all commits

View File

@ -159,8 +159,11 @@
}, },
"VnRole": { "VnRole": {
"dataSource": "vn" "dataSource": "vn"
},
"WorkerActivity": {
"dataSource": "vn"
},
"WorkerActivityType": {
"dataSource": "vn"
} }
} }

View File

@ -0,0 +1,33 @@
{
"name": "WorkerActivity",
"base": "VnModel",
"options": {
"mysql": {
"table": "workerActivity"
}
},
"properties": {
"id": {
"id": true,
"type": "number"
},
"workerActivityTypeFk": {
"type": "string"
},
"created": {
"type": "date"
},
"relations": {
"workerFk": {
"type": "belongsTo",
"model": "Worker",
"foreignKey": "workerFk"
},
"workerActivityTypeFk": {
"type": "belongsTo",
"model": "WorkerActivityType",
"foreignKey": "workerActivityTypeFk"
}
}
}
}

View File

@ -0,0 +1,19 @@
{
"name": "WorkerActivityType",
"base": "VnModel",
"options": {
"mysql": {
"table": "workerActivityType"
}
},
"properties": {
"code": {
"id": true,
"type": "string"
},
"description": {
"type": "string",
"required": false
}
}
}

View File

@ -0,0 +1,41 @@
CREATE OR REPLACE TABLE `workerActivityType` (
`code` varchar(20) NOT NULL,
`description` varchar(45) NOT NULL,
PRIMARY KEY (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
CREATE OR REPLACE TABLE `workerActivity` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`workerFk` int(10) unsigned NOT NULL,
`workerActivityTypeFk` varchar(20) NOT NULL,
`created` datetime NOT NULL DEFAULT current_timestamp(),
PRIMARY KEY (`id`),
KEY `workerActivity_worker_FK` (`workerFk`),
KEY `workerActivity_workerActivityType_FK` (`workerActivityTypeFk`),
CONSTRAINT `workerActivity_workerActivityType_FK` FOREIGN KEY (`workerActivityTypeFk`) REFERENCES `workerActivityType` (`code`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `workerActivity_worker_FK` FOREIGN KEY (`workerFk`) REFERENCES `worker` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Registros actividades por los trabajadores';
-- vn.workerMistakeType definition
ALTER TABLE vn.department ADD workerActivityTypeFk varchar(20) NULL COMMENT 'Indica la actitividad que desempeña por defecto ese departamento';
ALTER TABLE vn.department ADD CONSTRAINT department_workerActivityType_FK FOREIGN KEY (workerActivityTypeFk) REFERENCES vn.workerActivityType(code) ON DELETE CASCADE ON UPDATE CASCADE;
INSERT INTO vn.workerActivityType (code, description) VALUES('ON_CHECKING', 'REVISION');
INSERT INTO vn.workerActivityType (code, description) VALUES('PREVIOUS_CAM', 'CAMARA');
INSERT INTO vn.workerActivityType (code, description) VALUES('PREVIOUS_ART', 'ARTIFICIAL');
INSERT INTO vn.workerActivityType (code, description) VALUES('ON_PREPARATION', 'SACADO');
INSERT INTO vn.workerActivityType (code, description) VALUES('PACKING', 'ENCAJADO');
INSERT INTO vn.workerActivityType (code, description) VALUES('FIELD', 'CAMPOS');
INSERT INTO vn.workerActivityType (code, description) VALUES('DELIVERY', 'REPARTO');
INSERT INTO vn.workerActivityType (code, description) VALUES('STORAGE', 'ALMACENAJE');
INSERT INTO vn.workerActivityType (code, description) VALUES('PALLETIZING', 'PALETIZADO');
INSERT INTO vn.workerActivityType (code, description) VALUES('STOP', 'PARADA');
INSERT INTO salix.ACL ( model, property, accessType, permission, principalType, principalId) VALUES('WorkerActivityType', '*', 'READ', 'ALLOW', 'ROLE', 'production');
INSERT INTO salix.ACL ( model, property, accessType, permission, principalType, principalId) VALUES('WorkerActivity', '*', '*', 'ALLOW', 'ROLE', 'production');

View File

@ -344,5 +344,6 @@
"CountryFK cannot be empty": "El país no puede estar vacío", "CountryFK cannot be empty": "El país no puede estar vacío",
"Cmr file does not exist": "El archivo del cmr no existe", "Cmr file does not exist": "El archivo del cmr no existe",
"You are not allowed to modify the alias": "No estás autorizado a modificar el alias", "You are not allowed to modify the alias": "No estás autorizado a modificar el alias",
"No tickets to invoice": "No hay tickets para facturar" "No tickets to invoice": "No hay tickets para facturar",
"parkingNotExist": "parkingNotExist"
} }

View File

@ -62,6 +62,11 @@
"type": "belongsTo", "type": "belongsTo",
"model": "Worker", "model": "Worker",
"foreignKey": "workerFk" "foreignKey": "workerFk"
},
"workerActivity": {
"type": "belongsTo",
"model": "Worker",
"foreignKey": "workerActivityTypeFk"
} }
} }
} }