update models agency and agencyMode and update fixtures

This commit is contained in:
Bernat 2018-09-24 12:57:21 +02:00
parent abaab3e34a
commit 837af23497
7 changed files with 41 additions and 34 deletions

View File

@ -1,2 +0,0 @@
ALTER TABLE `vn2008`.`agency`
ADD COLUMN `code` VARCHAR(45) NULL DEFAULT NULL AFTER `zone_label`;

View File

@ -0,0 +1,2 @@
ALTER TABLE `vn2008`.`Agencias`
ADD COLUMN `code` VARCHAR(45) NULL DEFAULT NULL AFTER `flag`;

View File

@ -1,18 +0,0 @@
USE `vn`;
CREATE
OR REPLACE ALGORITHM = UNDEFINED
DEFINER = `root`@`%`
SQL SECURITY DEFINER
VIEW `agency` AS
SELECT
`a`.`agency_id` AS `id`,
`a`.`name` AS `name`,
`a`.`warehouse_id` AS `warehouseFk`,
`a`.`por_volumen` AS `isVolumetric`,
`a`.`Id_Banco` AS `bankFk`,
`a`.`warehouse_alias_id` AS `warehouseAliasFk`,
`a`.`propios` AS `own`,
`a`.`zone_label` AS `labelZone`,
`a`.`code` AS `code`
FROM
`vn2008`.`agency` `a`;

View File

@ -0,0 +1,23 @@
USE `vn`;
CREATE
OR REPLACE ALGORITHM = UNDEFINED
DEFINER = `root`@`%`
SQL SECURITY DEFINER
VIEW `agencyMode` AS
SELECT
`a`.`Id_Agencia` AS `id`,
`a`.`Agencia` AS `name`,
`a`.`description` AS `description`,
`a`.`Vista` AS `deliveryMethodFk`,
`a`.`m3` AS `m3`,
`a`.`cod71` AS `cod71`,
`a`.`web` AS `web`,
`a`.`agency_id` AS `agencyFk`,
`a`.`agency_service_id` AS `agencyServiceFk`,
`a`.`inflacion` AS `inflation`,
`a`.`is_volumetric` AS `isVolumetric`,
`a`.`send_mail` AS `reportMail`,
`a`.`tpv` AS `isActive`,
`a`.`code` AS `code`
FROM
`vn2008`.`Agencias` `a`;

View File

@ -68,17 +68,17 @@ INSERT INTO `vn`.`bank`(`id`, `bank`, `account`, `cash`, `entityFk`, `isActive`)
VALUES
(8, 'Pay on receipt', '0000000000', 4, 0, 1);
INSERT INTO `vn`.`agency`(`id`, `name`, `warehouseFk`, `isVolumetric`, `bankFk`, `warehouseAliasFk`, `code`)
INSERT INTO `vn`.`agency`(`id`, `name`, `warehouseFk`, `isVolumetric`, `bankFk`, `warehouseAliasFk`)
VALUES
(1, 'inhouse pickup' , 1, 0, 8, 1, NULL),
(2, 'Super-Man delivery' , 1, 0, 8, 1, NULL),
(3, 'Teleportation device' , 1, 0, 8, 1, NULL),
(4, 'Entanglement' , 1, 0, 8, 1, NULL),
(5, 'Quantum break device' , 1, 0, 8, 1, NULL),
(6, 'Walking' , 1, 0, 8, 1, NULL),
(7, 'Silla247' , 1, 0, 8, 1, NULL),
(8, 'Silla247Expensive' , 1, 0, 8, 1, NULL),
(9, 'Abono' , 1, 0, 8, 1, 'refund');
(1, 'inhouse pickup' , 1, 0, 8, 1),
(2, 'Super-Man delivery' , 1, 0, 8, 1),
(3, 'Teleportation device' , 1, 0, 8, 1),
(4, 'Entanglement' , 1, 0, 8, 1),
(5, 'Quantum break device' , 1, 0, 8, 1),
(6, 'Walking' , 1, 0, 8, 1),
(7, 'Silla247' , 1, 0, 8, 1),
(8, 'Silla247Expensive' , 1, 0, 8, 1),
(9, 'Abono' , 1, 0, 8, 1);
UPDATE `vn`.`agencyMode` SET `id` = 1 WHERE `name` = 'inhouse pickup';
UPDATE `vn`.`agencyMode` SET `id` = 2 WHERE `name` = 'Super-Man delivery';
@ -102,6 +102,8 @@ UPDATE `vn`.`agencyMode` SET `deliveryMethodFk` = 4 WHERE `id` = 23;
UPDATE `vn`.`agencyMode` SET `web` = 1 WHERE `id` = 1;
UPDATE `vn`.`agencyMode` SET `code` = 'refund' WHERE `id` = 23;
INSERT INTO `vn`.`payMethod`(`id`, `name`, `graceDays`, `outstandingDebt`, `ibanRequired`)
VALUES
(1, 'PayMethod one', 0, 001, 0),

View File

@ -34,6 +34,10 @@
},
"isActive":{
"type": "boolean"
},
"code": {
"type": "String",
"required": false
}
},
"relations": {

View File

@ -15,10 +15,6 @@
"name": {
"type": "String",
"required": false
},
"code": {
"type": "String",
"required": false
}
}
}