From ac5b17be3158e86dd8d56f23838f21da8dce289d Mon Sep 17 00:00:00 2001 From: jgallego Date: Thu, 9 May 2019 11:25:46 +0200 Subject: [PATCH] ticket View --- db/changes/10004-mother/01-viewTicket.sql | 26 +++++++++++++++++++++++ modules/ticket/back/models/ticket.json | 5 +++++ 2 files changed, 31 insertions(+) create mode 100644 db/changes/10004-mother/01-viewTicket.sql diff --git a/db/changes/10004-mother/01-viewTicket.sql b/db/changes/10004-mother/01-viewTicket.sql new file mode 100644 index 000000000..00b770766 --- /dev/null +++ b/db/changes/10004-mother/01-viewTicket.sql @@ -0,0 +1,26 @@ +CREATE OR REPLACE + ALGORITHM = UNDEFINED + DEFINER = `root`@`%` + SQL SECURITY DEFINER +VIEW `vn`.`ticket` AS + SELECT + `t`.`Id_Ticket` AS `id`, + `t`.`Id_Cliente` AS `clientFk`, + `t`.`warehouse_id` AS `warehouseFk`, + `t`.`Fecha` AS `shipped`, + `t`.`landing` AS `landed`, + `t`.`Alias` AS `nickname`, + `t`.`Factura` AS `refFk`, + `t`.`Id_Consigna` AS `addressFk`, + `t`.`Localizacion` AS `location`, + `t`.`Solucion` AS `solution`, + `t`.`Id_Ruta` AS `routeFk`, + `t`.`empresa_id` AS `companyFk`, + `t`.`Id_Agencia` AS `agencyModeFk`, + `t`.`Prioridad` AS `priority`, + `t`.`Bultos` AS `packages`, + `t`.`isDeleted` AS `isDeleted`, + `t`.`odbc_date` AS `created`, + `t`.`zoneFk` AS `zoneFk` + FROM + `vn2008`.`Tickets` `t`; \ No newline at end of file diff --git a/modules/ticket/back/models/ticket.json b/modules/ticket/back/models/ticket.json index 65678297c..adc5efa85 100644 --- a/modules/ticket/back/models/ticket.json +++ b/modules/ticket/back/models/ticket.json @@ -111,6 +111,11 @@ "type": "hasOne", "model": "TicketState", "foreignKey": "ticketFk" + }, + "zone": { + "type": "hasOne", + "model": "Zone", + "foreignKey": "zoneFk" } } } \ No newline at end of file