Regulation list: serach by exact postal code, and not the postal code's string content

This commit is contained in:
Julien Fastré 2023-09-26 16:46:55 +02:00
parent fcc00fdf8f
commit df3781a993
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB
2 changed files with 9 additions and 3 deletions

View File

@ -0,0 +1,7 @@
kind: Feature
body: "The regulation list load accompanying periods by exact postal code (address
associated with postal code), and not by the content of the postal code (postal
code with same code's string)"
time: 2023-09-26T16:44:41.414746336+02:00
custom:
Issue: "155"

View File

@ -79,11 +79,10 @@ final readonly class AccompanyingPeriodACLAwareRepository implements Accompanyin
Join::WITH,
'COALESCE(IDENTITY(person_address.address), IDENTITY(location_history.addressLocation)) = address.id'
)
->join('address.postcode', 'postcode')
->andWhere(
$qb->expr()->in('postcode.code', ':postal_codes')
$qb->expr()->in('address.postcode', ':postal_codes')
)
->setParameter('postal_codes', array_map(fn (PostalCode $postalCode) => $postalCode->getCode(), $postalCodes));
->setParameter('postal_codes', $postalCodes);
}
return $qb;