|
| 1 | +using SEBT.Portal.Core.Models.Household; |
| 2 | + |
| 3 | +namespace SEBT.Portal.Core.Models.AddressUpdate; |
| 4 | + |
| 5 | +/// <summary> |
| 6 | +/// Canonical input for shared address validation and normalization (portal handlers and state connectors). |
| 7 | +/// Carries optional identifiers and metadata so callers can correlate requests without coupling to HTTP. |
| 8 | +/// </summary> |
| 9 | +public sealed record AddressUpdateOperationRequest |
| 10 | +{ |
| 11 | + /// <summary>Line-one street address or USPS-style General Delivery line.</summary> |
| 12 | + public required string StreetAddress1 { get; init; } |
| 13 | + |
| 14 | + /// <summary>Optional secondary line (unit, suite, etc.).</summary> |
| 15 | + public string? StreetAddress2 { get; init; } |
| 16 | + |
| 17 | + /// <summary>City or USPS post office location for General Delivery.</summary> |
| 18 | + public required string City { get; init; } |
| 19 | + |
| 20 | + /// <summary>US state name or two-letter abbreviation.</summary> |
| 21 | + public required string State { get; init; } |
| 22 | + |
| 23 | + /// <summary>US ZIP or ZIP+4.</summary> |
| 24 | + public required string PostalCode { get; init; } |
| 25 | + |
| 26 | + /// <summary>Optional end-to-end correlation id (logging, support).</summary> |
| 27 | + public string? CorrelationId { get; init; } |
| 28 | + |
| 29 | + /// <summary>Optional state case or eligibility system identifier for the household.</summary> |
| 30 | + public string? HouseholdExternalId { get; init; } |
| 31 | + |
| 32 | + /// <summary>Optional opaque key/value metadata (connector-specific; not sent to Smarty).</summary> |
| 33 | + public IReadOnlyDictionary<string, string>? Metadata { get; init; } |
| 34 | + |
| 35 | + /// <summary> |
| 36 | + /// Builds a request from the domain <see cref="Household.Address"/> model. |
| 37 | + /// </summary> |
| 38 | + public static AddressUpdateOperationRequest FromHouseholdAddress(Address address) => |
| 39 | + new() |
| 40 | + { |
| 41 | + StreetAddress1 = address.StreetAddress1 ?? string.Empty, |
| 42 | + StreetAddress2 = address.StreetAddress2, |
| 43 | + City = address.City ?? string.Empty, |
| 44 | + State = address.State ?? string.Empty, |
| 45 | + PostalCode = address.PostalCode ?? string.Empty |
| 46 | + }; |
| 47 | +} |
0 commit comments