Add other field matches for NamiField

This commit is contained in:
philipp lang 2024-04-08 23:50:17 +02:00
parent 0e69e7c7f1
commit f05c85a035
2 changed files with 25 additions and 2 deletions

View File

@ -14,6 +14,9 @@ enum NamiType: string
case REGION = 'Bezirk';
case STAMM = 'Stamm';
case EMAIL = 'E-Mail-Adresse';
case ADDRESS = 'Adresse';
case ZIP = 'PLZ';
case LOCATION = 'Ort';
/**
* @return array<int, array{name: string, id: string}>
@ -34,6 +37,9 @@ enum NamiType: string
static::REGION => $this->matchRegion($member),
static::STAMM => $this->matchGroup($member),
static::EMAIL => $member->email,
static::ADDRESS => $member->address,
static::ZIP => $member->zip,
static::LOCATION => $member->location,
};
}
@ -47,9 +53,8 @@ enum NamiType: string
static::FIRSTNAME => $query->where('firstname', $value),
static::LASTNAME => $query->where('lastname', $value),
static::BIRTHDAY => $query->where('birthday', $value),
static::REGION => $query,
static::STAMM => $query,
static::EMAIL => $query->where('email', $value),
default => $query,
};
}

View File

@ -386,6 +386,24 @@ class FormRegisterActionTest extends FormTestCase
'Muster'
];
yield [
['address' => 'Maxstr 5'],
NamiType::ADDRESS,
'Maxstr 5'
];
yield [
['zip' => 44444],
NamiType::ZIP,
'44444'
];
yield [
['location' => 'Hilden'],
NamiType::LOCATION,
'Hilden'
];
yield [
['birthday' => '2023-06-06'],
NamiType::BIRTHDAY,