Merge branch 'ConstructionConsent/add-street-error' into 'master'

added new street filter

See merge request fronk/thetool!1400
This commit is contained in:
Luca Haid
2025-06-03 09:18:01 +00:00
2 changed files with 13 additions and 0 deletions

View File

@@ -274,6 +274,9 @@ AND (
(cco.zip IS NULL OR cco.zip NOT REGEXP '^[0-9]{4}$')
)
OR
/* street lowercase should not be oesterreich, österreich, austria, germany, deutschland, schweiz, switzerland */
(LOWER(cco.street) NOT REGEXP '^(österreich|austria|germany|deutschland|schweiz|switzerland)$')
OR
/* For Germany: ZIP must be exactly 5 digits */
(
(LOWER(cco.country) = 'deutschland' OR LOWER(cco.country) = 'germany') AND
@@ -361,6 +364,9 @@ AND (
(cco.zip IS NULL OR cco.zip NOT REGEXP '^[0-9]{4}$')
)
OR
/* street lowercase should not be oesterreich, österreich, austria, germany, deutschland, schweiz, switzerland */
(LOWER(cco.street) NOT REGEXP '^(österreich|austria|germany|deutschland|schweiz|switzerland)$')
OR
/* For Germany: ZIP must be exactly 5 digits */
(
(LOWER(cco.country) = 'deutschland' OR LOWER(cco.country) = 'germany') AND
@@ -406,6 +412,12 @@ ORDER BY
$errors[] = 'country';
}
// Check street for specific lowercase values
$streetLower = strtolower(trim($data['street'] ?? ''));
if (in_array($streetLower, ['österreich', 'austria', 'germany', 'deutschland', 'schweiz', 'switzerland'])) {
$errors[] = 'street';
}
// Check ZIP based on country
$country = strtolower($data['country'] ?? '');

View File

@@ -166,6 +166,7 @@ Vue.component('construction-consent-faulty-entries', {
'lastname': 'Fehlender Nachname',
'city': 'Fehlende Stadt',
'zip': 'Ungültige PLZ',
'street': 'Ungültige Straße',
'country': 'Ungültiges Land (enthält Zahlen)'
};
return errors[error] || error;