Skip to content

SAIF.Business.CustomerContact architecture

SAIF.Business.CustomerContact combines BOF aggregate persistence, reusable communication-record management, search orchestration, and external-ID conversion helpers in a single packaged business component.

Responsibilities

  • Model customer, contact, and relationship aggregates with lazy child retrieval and coordinated child saves.
  • Provide reusable standalone address, email, and phone entities plus customer/contact link collections.
  • Validate and execute combined customer/contact search requests.
  • Convert external business identifiers into local BOF customer/contact records.
  • Load localized phone and email code maps through shared SAIF business services.

Component boundaries

  • Customer\clsCustomer: owns the COMPANY aggregate, child association collections, and the customer note object.
  • Contact\clsContact: owns the PERSON aggregate, child association collections, and the contact note object.
  • Customer\clsCustomerContact / related collections: manages the COMPANY_PERSON relationship independently from the root contact row.
  • InfoItems types and association collections: persist standalone ADDRESS, EMAIL_ADDRESS, and PHONE records and their intersection rows.
  • clsCustomerContactSearch: validates requests and distributes result quotas across customer and contact loaders.
  • mdlCustomerContact: bridges external identifiers to local BOF records and conversion-map rows.
  • Legacy top-level clsAddressInfo, clsEmailAddressInfo, and clsPhoneInfo sources remain in the folder but are excluded from compilation.*

Interaction model

  • Root customer and contact aggregates obtain sequence-generated identifiers, persist the parent row, and then save child records after the parent write completes.
  • Association collections track added and removed items and persist only the intersection rows that connect customers or contacts to standalone info-item records.
  • Combined search validates request shape, normalizes formatted strings, and calls separate customer and contact direct-SQL loaders before merging results.
  • External conversion helpers perform lookup-first logic and only create local BOF rows when a conversion mapping does not already exist.
  • mdlCodeMaps loads shared code-table data and caches each map per culture.*

Architecture diagram

The following diagram shows the major runtime responsibilities and data paths.

flowchart TD
    Caller[Consumer] --> Search[clsCustomerContactSearch]
    Caller --> Customer[clsCustomer]
    Caller --> Contact[clsContact]
    Caller --> Convert[mdlCustomerContact]
    Customer --> Company[(COMPANY)]
    Contact --> Person[(PERSON)]
    Customer --> Rel[clsCustomerContact]
    Rel --> CompanyPerson[(COMPANY_PERSON)]
    Customer --> Info[Info-item collections]
    Contact --> Info
    Info --> Address[(ADDRESS / EMAIL_ADDRESS / PHONE)]
    Info --> Links[(COMPANY_* / PERSON_*)]
    Convert --> External[(AGENCY / AGENT / POLICY / PROVIDER / others)]
    Convert --> Maps[(CUSTOMER_* mapping tables)]
    Caller --> CodeMaps[mdlCodeMaps]
    CodeMaps --> Shared[Shared SAIF code-table services]

Sequence diagram

The following diagram shows the primary combined-search flow.

sequenceDiagram
    participant Client
    participant Search as clsCustomerContactSearch
    participant Contacts as clsContactCollection
    participant Customers as clsCustomerCollection
    participant Oracle
    Client->>Search: SearchForCustomerContacts(request)
    Search->>Search: Validate request and split limits
    Search->>Contacts: Execute contact search SQL
    Contacts->>Oracle: Query PERSON / COMPANY_PERSON
    Oracle-->>Contacts: Contact rows
    Search->>Customers: Execute customer search SQL
    Customers->>Oracle: Query COMPANY / COMPANY_PERSON
    Oracle-->>Customers: Customer rows
    Search-->>Client: Combined SearchResult

Design constraints

  • The library has no same-repository <ProjectReference> entries; SAIF business/framework dependencies are consumed as NuGet packages.
  • Search execution enforces BR-001 and BR-002 before any direct search SQL runs.
  • Contact deletion is constrained by BR-003, and relationship saves are constrained by BR-004.
  • The library has no directly owned runtime-setting retrieval surface; configuration comes from driver registration and transitive dependency expectations.
  • Newtonsoft.Json is imported in mdlCustomerContact.vb, but live JSON operations were not confirmed in the supplied findings.*

Note: Statements marked with * were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts.

Sources

  • Business\SAIF.Business.CustomerContact\SAIF.BOF.Business.CustomerContact.vbproj
  • Business\SAIF.Business.CustomerContact\Customer\clsCustomer.vb
  • Business\SAIF.Business.CustomerContact\Contact\clsContact.vb
  • Business\SAIF.Business.CustomerContact\Customer\clsCustomerContact.vb
  • Business\SAIF.Business.CustomerContact\InfoItems\clsAddressInfo.vb
  • Business\SAIF.Business.CustomerContact\InfoItems\clsEmailAddressInfo.vb
  • Business\SAIF.Business.CustomerContact\InfoItems\clsPhoneInfo.vb
  • Business\SAIF.Business.CustomerContact\InfoItems\clsInfoCollection.vb
  • Business\SAIF.Business.CustomerContact\clsCustomerContactSearch.vb
  • Business\SAIF.Business.CustomerContact\mdlCustomerContact.vb
  • Business\SAIF.Business.CustomerContact\mdlCodeMaps.vb
  • Business\SAIF.Business.CustomerContact\packages.config