Class AddressValidationService
- Namespace
- SEBT.Portal.Infrastructure.Services
- Assembly
- SEBT.Portal.Infrastructure.dll
Validates addresses against configurable blocked address lists and applies street name
abbreviations for addresses exceeding a configurable length limit.
Runs after Smarty normalization (handled by UpdateAddressCommandHandler)
so that checks operate on the canonical address form.
Two blocked-address paths participate:
- The legacy inline list from BlockedAddresses, matched on normalized street alone (used for small hand-curated lists, e.g. DC's 5 entries).
- IBlockedAddressDataSource entries, matched on (normalized street + 5-digit ZIP) so that large state-wide lists can disambiguate same-street collisions across cities.
public class AddressValidationService : IAddressValidationService
- Inheritance
-
objectAddressValidationService
- Implements
Constructors
AddressValidationService(IOptions<AddressValidationDataSettings>, IBlockedAddressDataSource)
public AddressValidationService(IOptions<AddressValidationDataSettings> options, IBlockedAddressDataSource blockedAddressData)
Parameters
optionsIOptions<AddressValidationDataSettings>blockedAddressDataIBlockedAddressDataSource
Methods
ValidateAsync(Address, CancellationToken)
Validates the given address and returns a result indicating whether the address is valid, invalid, or has a suggested alternative.
public Task<AddressValidationResult> ValidateAsync(Address address, CancellationToken cancellationToken = default)
Parameters
addressAddresscancellationTokenCancellationToken
Returns
- Task<AddressValidationResult>