mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-11-09 21:58:28 +00:00
Add email reporting for unimported addresses in import commands
Enhanced address import commands to optionally send a recap of unimported addresses via email. Updated import logic to handle cases where postal codes are missing, log issues, and generate compressed CSV reports with failed entries.
This commit is contained in:
@@ -19,7 +19,7 @@ class AddressReferenceFromBano
|
||||
{
|
||||
public function __construct(private readonly HttpClientInterface $client, private readonly AddressReferenceBaseImporter $baseImporter, private readonly AddressToReferenceMatcher $addressToReferenceMatcher) {}
|
||||
|
||||
public function import(string $departementNo): void
|
||||
public function import(string $departementNo, ?string $sendAddressReportToEmail = null): void
|
||||
{
|
||||
if (!is_numeric($departementNo) || !\is_int((int) $departementNo)) {
|
||||
throw new \UnexpectedValueException('Could not parse this department number');
|
||||
@@ -69,7 +69,7 @@ class AddressReferenceFromBano
|
||||
);
|
||||
}
|
||||
|
||||
$this->baseImporter->finalize();
|
||||
$this->baseImporter->finalize(sendAddressReportToEmail: $sendAddressReportToEmail);
|
||||
|
||||
$this->addressToReferenceMatcher->checkAddressesMatchingReferences();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user