Table of Contents

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:

  1. The legacy inline list from BlockedAddresses, matched on normalized street alone (used for small hand-curated lists, e.g. DC's 5 entries).
  2. 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
object
AddressValidationService
Implements

Constructors

AddressValidationService(IOptions<AddressValidationDataSettings>, IBlockedAddressDataSource)

public AddressValidationService(IOptions<AddressValidationDataSettings> options, IBlockedAddressDataSource blockedAddressData)

Parameters

options IOptions<AddressValidationDataSettings>
blockedAddressData IBlockedAddressDataSource

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

address Address
cancellationToken CancellationToken

Returns

Task<AddressValidationResult>