From 9a4e20bb31b25e6169a04660572637081e5d9ca6 Mon Sep 17 00:00:00 2001 From: Bernat Exposito Domenech Date: Tue, 11 Aug 2020 11:03:43 +0200 Subject: [PATCH] new models and fixtures --- back/model-config.json | 9 +++++ back/models/mail.json | 36 +++++++++++++++++ back/models/worker-time-control-mail.json | 39 +++++++++++++++++++ back/models/worker-time-control-params.js | 3 ++ back/models/worker-time-control-params.json | 35 +++++++++++++++++ .../00-workerTimeControlParams.sql | 6 +++ db/dump/fixtures.sql | 4 +- 7 files changed, 130 insertions(+), 2 deletions(-) create mode 100644 back/models/mail.json create mode 100644 back/models/worker-time-control-mail.json create mode 100644 back/models/worker-time-control-params.js create mode 100644 back/models/worker-time-control-params.json create mode 100644 db/changes/12300-Summer/00-workerTimeControlParams.sql diff --git a/back/model-config.json b/back/model-config.json index 323e5f233..3d0085fc2 100644 --- a/back/model-config.json +++ b/back/model-config.json @@ -67,6 +67,15 @@ }, "UserLog": { "dataSource": "vn" + }, + "WorkerTimeControlParams": { + "dataSource": "vn" + }, + "WorkerTimeControlMail": { + "dataSource": "vn" + }, + "Mail": { + "dataSource": "vn" } } diff --git a/back/models/mail.json b/back/models/mail.json new file mode 100644 index 000000000..cf5c11993 --- /dev/null +++ b/back/models/mail.json @@ -0,0 +1,36 @@ +{ + "name": "Mail", + "base": "VnModel", + "options": { + "mysql": { + "table": "mail" + } + }, + "properties": { + "id": { + "id": true, + "type": "Number", + "required": true + }, + "sender": { + "type": "String" + }, + "replyTo": { + "type": "String" + }, + "subject": { + "type": "String" + }, + "body": { + "type": "String" + } + }, + "acls": [ + { + "accessType": "READ", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "ALLOW" + } + ] +} diff --git a/back/models/worker-time-control-mail.json b/back/models/worker-time-control-mail.json new file mode 100644 index 000000000..4a0fd31f1 --- /dev/null +++ b/back/models/worker-time-control-mail.json @@ -0,0 +1,39 @@ +{ + "name": "WorkerTimeControlMail", + "base": "VnModel", + "options": { + "mysql": { + "table": "workerTimeControlMail" + } + }, + "properties": { + "id": { + "id": true, + "type": "Number", + "required": true + }, + "workerFk": { + "type": "Number" + }, + "year": { + "type": "Number" + }, + "week": { + "type": "Number" + }, + "state": { + "type": "String" + }, + "updated": { + "type": "Date" + } + }, + "acls": [ + { + "accessType": "READ", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "ALLOW" + } + ] +} diff --git a/back/models/worker-time-control-params.js b/back/models/worker-time-control-params.js new file mode 100644 index 000000000..c71d4c237 --- /dev/null +++ b/back/models/worker-time-control-params.js @@ -0,0 +1,3 @@ +module.exports = Self => { + require('../methods/imap-time-control/checkInbox')(Self); +}; diff --git a/back/models/worker-time-control-params.json b/back/models/worker-time-control-params.json new file mode 100644 index 000000000..cc904cf40 --- /dev/null +++ b/back/models/worker-time-control-params.json @@ -0,0 +1,35 @@ +{ + "name": "WorkerTimeControlParams", + "description": "imap config", + "base": "VnModel", + "options": { + "mysql": { + "table": "workerTimeControlParams" + } + }, + "properties": { + "mailHost": { + "type": "String" + }, + "mailUser": { + "type": "String" + }, + "mailPass": { + "type": "String" + }, + "mailSuccessFolder": { + "type": "String" + }, + "mailErrorFolder": { + "type": "String" + } + }, + "acls": [ + { + "accessType": "READ", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "ALLOW" + } + ] +} diff --git a/db/changes/12300-Summer/00-workerTimeControlParams.sql b/db/changes/12300-Summer/00-workerTimeControlParams.sql new file mode 100644 index 000000000..47ef2e3ea --- /dev/null +++ b/db/changes/12300-Summer/00-workerTimeControlParams.sql @@ -0,0 +1,6 @@ +ALTER TABLE `vn`.`workerTimeControlParams` +ADD COLUMN `mailUser` VARCHAR(45) NOT NULL AFTER `askInOut`, +ADD COLUMN `mailPass` VARCHAR(45) NOT NULL AFTER `mailUser`, +ADD COLUMN `mailHost` VARCHAR(45) NOT NULL AFTER `mailPass`, +ADD COLUMN `mailSuccessFolder` VARCHAR(45) NOT NULL AFTER `mailHost`, +ADD COLUMN `mailErrorFolder` VARCHAR(45) NOT NULL AFTER `mailSuccessFolder`; diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index a1018ab5a..80f21297f 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -2034,9 +2034,9 @@ INSERT INTO `vn`.`queuePriority`(`id`, `priority`) (2, 'Normal'), (3, 'Baja'); -INSERT INTO `vn`.`workerTimeControlParams` (`id`, `dayBreak`, `weekBreak`, `weekScope`, `dayWorkMax`, `dayStayMax`, `weekMaxBreak`, `weekMaxScope`, `askInOut`) +INSERT INTO `vn`.`workerTimeControlParams` (`id`, `dayBreak`, `weekBreak`, `weekScope`, `dayWorkMax`, `dayStayMax`, `weekMaxBreak`, `weekMaxScope`, `askInOut`, `mailSuccessFolder`, `mailErrorFolder`) VALUES - (1, 43200, 129600, 734400, 43200, 50400, 259200, 1296000, 36000); + (1, 43200, 129600, 734400, 43200, 50400, 259200, 1296000, 36000, 'Leidos.exito', 'Leidos.error'); INSERT IGNORE INTO `vn`.`greugeConfig` (`id`, `freightPickUpPrice`) VALUES ('1', '11');