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 theCOMPANYaggregate, child association collections, and the customer note object.Contact\clsContact: owns thePERSONaggregate, child association collections, and the contact note object.Customer\clsCustomerContact/ related collections: manages theCOMPANY_PERSONrelationship independently from the root contact row.InfoItemstypes and association collections: persist standaloneADDRESS,EMAIL_ADDRESS, andPHONErecords 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, andclsPhoneInfosources 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.
mdlCodeMapsloads 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.Jsonis imported inmdlCustomerContact.vb, but live JSON operations were not confirmed in the supplied findings.*
Related documentation¶
- Index
- Overview
- Dependencies
- Operations and processes
- Business rules
- Database tables
- SQL catalog
- API reference
- Configuration
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.vbprojBusiness\SAIF.Business.CustomerContact\Customer\clsCustomer.vbBusiness\SAIF.Business.CustomerContact\Contact\clsContact.vbBusiness\SAIF.Business.CustomerContact\Customer\clsCustomerContact.vbBusiness\SAIF.Business.CustomerContact\InfoItems\clsAddressInfo.vbBusiness\SAIF.Business.CustomerContact\InfoItems\clsEmailAddressInfo.vbBusiness\SAIF.Business.CustomerContact\InfoItems\clsPhoneInfo.vbBusiness\SAIF.Business.CustomerContact\InfoItems\clsInfoCollection.vbBusiness\SAIF.Business.CustomerContact\clsCustomerContactSearch.vbBusiness\SAIF.Business.CustomerContact\mdlCustomerContact.vbBusiness\SAIF.Business.CustomerContact\mdlCodeMaps.vbBusiness\SAIF.Business.CustomerContact\packages.config