SubpoenaMappingHelper¶
A static AutoMapper configuration holder that registers every type mapping the subpoena services rely on to translate between EF data-model entities (SAIF.Data.Model.Legal.Subpoenas, SAIF.Data.Model.Legal, SAIF.Data.Model.Providers, SAIF.Data.Model.Locations), the domain InjuryClaim/Worker model, and the outward-facing contract DTOs (SAIF.Core.Contracts.Legal.Subpoenas, SAIF.Core.Contracts.Legal, SAIF.Core.Contracts.Providers, SAIF.Core.Contracts.Locations). MapSubpoenaService() is invoked once from static constructors of SubpoenaService and SubpoenaPaymentService to register these mappings before any instance method executes.
Purpose¶
- Registers reversible code-table mappings (hearing-location codes, special-handling, status, and type codes) between data and contract models.
- Registers supporting-table mappings, including composing an attorney's display
Namefrom last/preferred-or-first name and mapping locations to their contract representation. - Registers the primary entity mappings: hearing location (with computed
FullLocationName/FormattedAddress),Subpoena→contractSubpoena(including case-number fallback chain and appearance date/time split),InjuryClaim→Subpoenaoverlay,Recipient→SubpoenaRecipient(with resolved provider/registered-agent/policy names and formatted addresses),LegalPerson/LegalPersonAddress→contract equivalents, provider-location,Subpoena/InjuryClaim→SubpoenaInboxItem, registered agent, and process server. - Provides the single
MapSubpoenaService()entry point that runs all three mapping-registration groups in order.
Context¶
- Namespace:
SAIF.Services.Legal.Subpoenas - Assembly/package:
SAIF.Services(packaged inside theSAIF.SAIFCode.CoreNuGet package).
Public members¶
| Member | Signature | Purpose |
|---|---|---|
| MapCodeTables | public static void MapCodeTables() |
Registers two-way (ReverseMap) AutoMapper maps for HearingLocationCode, SubpoenaSpecialHandling, SubpoenaStatus, and SubpoenaType between data and contract representations. |
| MapSupportingTables | public static void MapSupportingTables() |
Registers the AttorneyProfile→LegalEmployee map (building Name from last name plus preferred-or-first name, and copying AttorneyEmployeeId/UserId) and the Location→contract Location map. |
| MapTables | public static void MapTables() |
Registers all primary subpoena-domain entity mappings — hearing location, subpoena, injury claim overlay, recipient, legal person/address, provider location, inbox item, registered agent, and process server — computing derived fields such as full location name, case-number fallback (WcbNumber??DcbsNumber??BrbNumber??OaljNumber??OwcpNumber??claim number), formatted addresses, and witness display name/address via the private GetFormattedWitnessName/GetFormattedWitnessAddress/GetFormattedPolicyAddress resolvers. |
| MapSubpoenaService | public static void MapSubpoenaService() |
Runs MapCodeTables(), MapSupportingTables(), and MapTables() in sequence to fully configure AutoMapper for the subpoena services; called once per process from the static constructors of SubpoenaService and SubpoenaPaymentService. |
Behavioral notes¶
- Carries
CA1053:StaticHolderTypesShouldNotHaveConstructors(class-level) and, onMapTables,CA1502:AvoidExcessiveComplexity/CA1506:AvoidExcessiveClassCouplingsuppressions, reflecting its role as a large, static-only mapping configuration surface. - Registers mappings globally on the static AutoMapper
Mapperclass rather than a scopedIMapperinstance, so repeated calls re-register (rather than replace) the same maps for the lifetime of the process.* - The
Subpoena→contractSubpoenaandInjuryClaim→SubpoenaInboxItem/Subpoenamaps defaultCaseNumberto the claim number only when the primary case-number fallback chain resolves to an empty string.
Constraints and usage notes¶
- All members are static; the class is a pure configuration holder and is never instantiated by calling code.*
- Callers must ensure
MapSubpoenaService()(or the individualMap*methods) has run before invoking any AutoMapperMapper.Mapcall against the types it registers, or mapping will fail/produce empty results.*
Note: Statements marked with * were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with ** could not be confirmed; treat as unknown until verified.
Sources¶
Services/SAIF.Services/Legal/Subpoenas/SubpoenaMappingHelper.cs