refator: updated fixtures
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Vicent Llopis 2022-06-02 11:52:53 +02:00
parent b5fa360960
commit f7be419bbe
3 changed files with 14 additions and 11 deletions

View File

@ -1,12 +1,13 @@
CREATE TABLE `vn`.`zoneExclusionGeo` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`zoneExclusionFk` int(11) NOT NULL,
`geoFk` int(11) NOT NULL,
PRIMARY KEY (`zoneExclusionFk`,`geoFk`),
PRIMARY KEY (`id`),
UNIQUE KEY `zoneExclusionGeo_UN` (`zoneExclusionFk`,`geoFk`),
KEY `zoneExclusionGeo2_FK_1` (`geoFk`),
CONSTRAINT `zoneExclusionGeo2_FK_1` FOREIGN KEY (`geoFk`) REFERENCES `zoneGeo` (`id`) ON UPDATE CASCADE,
CONSTRAINT `zoneExclusionGeo_FK` FOREIGN KEY (`zoneExclusionFk`) REFERENCES `zoneExclusion` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CONSTRAINT `zoneExclusionGeo_FK` FOREIGN KEY (`geoFk`) REFERENCES `zoneGeo` (`id`) ON UPDATE CASCADE,
CONSTRAINT `zoneExclusionGeo_FK_1` FOREIGN KEY (`zoneExclusionFk`) REFERENCES `zoneExclusion` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
DROP PROCEDURE IF EXISTS `vn`.`zone_excludeFromGeo`;
DELIMITER $$

View File

@ -2029,6 +2029,8 @@ INSERT INTO `vn`.`zoneEvent`(`zoneFk`, `type`, `dated`)
(1, 'day', DATE_ADD(CURDATE(), INTERVAL (IF(DAYOFWEEK(CURDATE())<=4, 4, 11) - DAYOFWEEK(CURDATE())) DAY)),
(1, 'day', DATE_ADD(CURDATE(), INTERVAL (IF(DAYOFWEEK(CURDATE())<=5, 5, 12) - DAYOFWEEK(CURDATE())) DAY)),
(1, 'day', DATE_ADD(CURDATE(), INTERVAL (IF(DAYOFWEEK(CURDATE())<=6, 6, 13) - DAYOFWEEK(CURDATE())) DAY)),
(1, 'day', DATE_ADD(CURDATE(), INTERVAL (IF(DAYOFWEEK(CURDATE())<=7, 7, 14) - DAYOFWEEK(CURDATE())) DAY)),
(1, 'day', DATE_ADD(CURDATE(), INTERVAL (IF(DAYOFWEEK(CURDATE())<=8, 8, 15) - DAYOFWEEK(CURDATE())) DAY)),
(2, 'day', DATE_ADD(CURDATE(), INTERVAL (IF(DAYOFWEEK(CURDATE())<=2, 2, 9) - DAYOFWEEK(CURDATE())) DAY)),
(2, 'day', DATE_ADD(CURDATE(), INTERVAL (IF(DAYOFWEEK(CURDATE())<=3, 3, 10) - DAYOFWEEK(CURDATE())) DAY)),
(2, 'day', DATE_ADD(CURDATE(), INTERVAL (IF(DAYOFWEEK(CURDATE())<=4, 4, 11) - DAYOFWEEK(CURDATE())) DAY)),
@ -2578,9 +2580,9 @@ INSERT INTO `vn`.`machineWorker` (`workerFk`, `machineFk`, `inTimed`, `outTimed`
(1106, 2, DATE_ADD(CURDATE(), INTERVAL + 1 DAY), DATE_ADD(CURDATE(), INTERVAL +1 DAY));
INSERT INTO `vn`.`zoneExclusion` (`id`, `zoneFk`, `dated`, `created`, `userFk`)
VALUES
(1, 1, DATE_ADD(CURDATE(), INTERVAL + 10 DAY), CURDATE(), 100),
(2, 1, DATE_ADD(CURDATE(), INTERVAL + 12 DAY), CURDATE(), 100);
VALUES
(1, 1, DATE_ADD(CURDATE(), INTERVAL (IF(DAYOFWEEK(CURDATE())<=7, 7, 14) - DAYOFWEEK(CURDATE())) DAY), CURDATE(), 100),
(2, 1, DATE_ADD(CURDATE(), INTERVAL (IF(DAYOFWEEK(CURDATE())<=8, 8, 15) - DAYOFWEEK(CURDATE())) DAY), CURDATE(), 100);
INSERT INTO `vn`.`zoneExclusionGeo` (`zoneExclusionFk`, `geoFk`)
VALUES

View File

@ -240,7 +240,7 @@ class Controller extends Section {
const params = {
zoneFk: parseInt(this.$params.id),
date: excludeSelected.dated,
geoFk: geoIds
geoIds: geoIds
};
if (this.isNew)
@ -252,9 +252,9 @@ class Controller extends Section {
if (geoIds[actualPosition]) geoId = geoIds[actualPosition].id;
else geoId = null;
if (geoId) {
if (geoId && geoId == exclusionGeo.geoFk) {
const params = {
zoneExclusionFk: excludeSelected.zoneExclusionFk,
zoneExclusionFk: exclusionGeo.zoneExclusionFk,
geoFk: geoId
};
req = this.$http.put(`ZoneExclusionGeos/${exclusionGeo.id}`, params);