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