feat: refs #8227 Undo vehicle_checkNumberPlate change and triggers checks
gitea/salix/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
Guillermo Bonet 2025-01-24 12:34:08 +01:00
parent e9f1e28ac0
commit 75b0589561
3 changed files with 5 additions and 25 deletions

View File

@ -13,18 +13,12 @@ BEGIN
*/
DECLARE vRegex VARCHAR(45);
IF vCountryCodeFk IS NULL THEN
SET vRegex = '^[A-Z0-9 -]{6,12}$';
ELSE
SELECT regex INTO vRegex
FROM vehiclePlateRegex
WHERE countryCodeFk = vCountryCodeFk;
END IF;
SELECT regex INTO vRegex
FROM vehiclePlateRegex
WHERE countryCodeFk = vCountryCodeFk;
IF NOT vNumberPlate REGEXP BINARY (vRegex)THEN
CALL util.throw(CONCAT('La matricula ', vNumberPlate,
' no es valida', IF(vCountryCodeFk IS NOT NULL,
CONCAT(' para ', vCountryCodeFk), '')));
CALL util.throw(CONCAT('Error: la matricula ', vNumberPlate, ' no es valida para ',vCountryCodeFk));
END IF;
END$$
DELIMITER ;

View File

@ -7,13 +7,6 @@ BEGIN
IF NEW.etd > NEW.eta THEN
CALL util.throw('Departure time can not be after arrival time');
END IF;
IF NEW.tractorPlate IS NOT NULL THEN
CALL vehicle_checkNumberPlate(NEW.tractorPlate, NULL);
END IF;
IF NEW.trailerPlate IS NOT NULL THEN
CALL vehicle_checkNumberPlate(NEW.trailerPlate, NULL);
END IF;
SET NEW.name = UCASE(NEW.name);
END$$
DELIMITER ;

View File

@ -7,13 +7,6 @@ BEGIN
IF NEW.etd > NEW.eta THEN
CALL util.throw('Departure time can not be after arrival time');
END IF;
IF NEW.tractorPlate IS NOT NULL THEN
CALL vehicle_checkNumberPlate(NEW.tractorPlate, NULL);
END IF;
IF NEW.trailerPlate IS NOT NULL THEN
CALL vehicle_checkNumberPlate(NEW.trailerPlate, NULL);
END IF;
SET NEW.name = UCASE(NEW.name);
END$$
DELIMITER ;