diff --git a/back/model-config.json b/back/model-config.json index d471f3230..dc67a5422 100644 --- a/back/model-config.json +++ b/back/model-config.json @@ -37,6 +37,12 @@ }, "EmailUser": { "dataSource": "vn" + }, + "Dms": { + "dataSource": "vn" + }, + "DmsType": { + "dataSource": "vn" } } diff --git a/back/models/dms.json b/back/models/dms.json new file mode 100644 index 000000000..d5ec4b8b7 --- /dev/null +++ b/back/models/dms.json @@ -0,0 +1,51 @@ +{ + "name": "Dms", + "description": "Documental Managment system", + "base": "VnModel", + "options": { + "mysql": { + "table": "dms" + } + }, + "properties": { + "id": { + "type": "Number", + "id": true, + "description": "Identifier" + }, + "file": { + "type": "string" + }, + "reference": { + "type": "string" + }, + "description": { + "type": "string" + }, + "created": { + "type": "Date" + } + }, + "relations": { + "dmsType": { + "type": "belongsTo", + "model": "DmsType", + "foreignKey": "dmsTypeFk" + }, + "worker": { + "type": "belongsTo", + "model": "Worker", + "foreignKey": "workerFk" + }, + "warehouse": { + "type": "belongsTo", + "model": "Warehouse", + "foreignKey": "warehouseFk" + }, + "company": { + "type": "belongsTo", + "model": "Company", + "foreignKey": "companyFk" + } + } +} \ No newline at end of file diff --git a/back/models/dmsType.json b/back/models/dmsType.json new file mode 100644 index 000000000..0d55647f3 --- /dev/null +++ b/back/models/dmsType.json @@ -0,0 +1,33 @@ +{ + "name": "DmsType", + "description": "Documental Managment system types", + "base": "VnModel", + "options": { + "mysql": { + "table": "dmsType" + } + }, + "properties": { + "id": { + "type": "Number", + "id": true, + "description": "Identifier" + }, + "name": { + "type": "string", + "required": true + }, + "path": { + "type": "string", + "required": true + } + }, + "acls": [ + { + "accessType": "READ", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "ALLOW" + } + ] +} \ No newline at end of file diff --git a/db/changes/10003-easter/00-dmsView.sql b/db/changes/10003-easter/00-dmsView.sql new file mode 100644 index 000000000..88d32f93c --- /dev/null +++ b/db/changes/10003-easter/00-dmsView.sql @@ -0,0 +1,20 @@ +USE `vn`; +CREATE + OR REPLACE ALGORITHM = UNDEFINED + DEFINER = `root`@`%` + SQL SECURITY DEFINER +VIEW `vn`.`dms` AS + SELECT + `g`.`id` AS `id`, + `g`.`gesttip_id` AS `dmsTypeFk`, + `g`.`file` AS `file`, + `g`.`trabajador_id` AS `workerFk`, + `g`.`warehouse_id` AS `warehouseFk`, + `g`.`emp_id` AS `companyFk`, + `g`.`orden` AS `priority`, + `g`.`file` AS `hasFile`, + `g`.`sref` AS `reference`, + `g`.`brief` AS `description`, + `g`.`odbc_date` AS `created` + FROM + `vn2008`.`gestdoc` `g` \ No newline at end of file diff --git a/db/changes/10003-easter/01-dmsTicketRename.sql b/db/changes/10003-easter/01-dmsTicketRename.sql new file mode 100644 index 000000000..3554be6bd --- /dev/null +++ b/db/changes/10003-easter/01-dmsTicketRename.sql @@ -0,0 +1,11 @@ +DROP VIEW IF EXISTS `vn`.`dmsTicket` ; +USE `vn`; +CREATE + OR REPLACE ALGORITHM = UNDEFINED + DEFINER = `root`@`%` + SQL SECURITY DEFINER +VIEW `vn`.`ticketDms` AS + SELECT + `g`.`Id_Ticket` AS `ticketFk`, `g`.`gestdoc_id` AS `dmsFk` + FROM + `vn2008`.`tickets_gestdoc` `g`; diff --git a/db/changes/10003-easter/02-dmsTypeAddRoleFields.sql b/db/changes/10003-easter/02-dmsTypeAddRoleFields.sql new file mode 100644 index 000000000..5e65bf299 --- /dev/null +++ b/db/changes/10003-easter/02-dmsTypeAddRoleFields.sql @@ -0,0 +1,3 @@ +ALTER TABLE `vn2008`.`gesttip` +ADD COLUMN `writeRoleFk` INT(10) UNSIGNED NULL AFTER `path`, +ADD COLUMN `ReadRoleFk` INT(10) UNSIGNED NULL AFTER `writeRoleFk`; diff --git a/modules/ticket/back/model-config.json b/modules/ticket/back/model-config.json index a919827b4..3b38f1a16 100644 --- a/modules/ticket/back/model-config.json +++ b/modules/ticket/back/model-config.json @@ -38,6 +38,9 @@ "Ticket": { "dataSource": "vn" }, + "TicketDms": { + "dataSource": "vn" + }, "TicketLog": { "dataSource": "vn" }, diff --git a/modules/ticket/back/models/ticket-dms.json b/modules/ticket/back/models/ticket-dms.json new file mode 100644 index 000000000..b725d47cd --- /dev/null +++ b/modules/ticket/back/models/ticket-dms.json @@ -0,0 +1,38 @@ +{ + "name": "TicketDms", + "base": "Loggable", + "log": { + "model": "TicketLog", + "relation": "ticket", + "showField": "dmsFk" + }, + "options": { + "mysql": { + "table": "ticketDms" + } + }, + "properties": { + "ticketFk": { + "type": "Number", + "id": true, + "required": true + }, + "dmsFk": { + "type": "Number", + "id": true, + "required": true + } + }, + "relations": { + "ticket": { + "type": "belongsTo", + "model": "Ticket", + "foreignKey": "ticketFk" + }, + "dms": { + "type": "belongsTo", + "model": "Dms", + "foreignKey": "dmsFk" + } + } +} \ No newline at end of file