SAIF.Business.Policy.Audit.ApiCalls architecture¶
SAIF.Business.Policy.Audit.ApiCalls is an outbound integration layer that sits between Premium Audit callers and three downstream SAIF document and audit services. The library owns client construction, runtime configuration lookup, and payload shaping, while the downstream services own all persistence, routing, and decision-making.
Responsibilities¶
- Create the three outbound clients used by Premium Audit audit-submission and document-distribution workflows.
- Translate caller data into the DTO contracts expected by the Policy Audit API, Document API, and Policy Document Distribution API.
- Propagate application, machine, and user identity to downstream services.
- Isolate secure credential retrieval for the Policy Audit API inside the
ApiCallconstructor.
Component boundaries¶
ApiCall: wraps authenticated Policy Audit API posts for audit-term and waive-audit flows.DocumentApiCall: wraps the older Document API distribution contract, including one generated-document distribution per request.PolicyDocDistributionCall: wraps the newer preset-driven policy document distribution contract.- Distribution DTOs: define the on-the-wire shapes for document-routing channels, imaging metadata, recipient contacts, and preset keys.
- Configuration boundary: all runtime settings come from
SAIF.Framework.Security.AppGlobal.EnvironmentService; the local config files only carry Oracle provider registration and assembly redirects.
Interaction model¶
- Each client constructor builds
ClientInfo, resolves the target base URL, and then constructsJsonHttpClientimmediately. ApiCallis the only client that also resolves secure credentials and attachesNtlmAuthenticator; the other two clients rely on unauthenticatedJsonHttpClientconstruction.- All exposed operations are synchronous wrapper calls over
JsonHttpClient.PostJson<T>. - The library exposes both the older fully specified distribution path (
DistributionRequest) and the newer preset-driven path (PolicyDocumentConfig).
Architecture diagram¶
The following diagram shows the three outbound clients and the shared Environment API dependency that feeds their runtime configuration.
flowchart TD
Caller[Premium Audit callers] --> ApiCall[ApiCall]
Caller --> DocApi[DocumentApiCall]
Caller --> PresetApi[PolicyDocDistributionCall]
ApiCall --> Env[EnvironmentService]
DocApi --> Env
PresetApi --> Env
ApiCall --> PolicyAudit[Policy Audit API]
DocApi --> DocumentApi[Document API]
PresetApi --> PresetDist[Policy Document Distribution API]
Sequence diagram¶
The following diagram shows the document-distribution path implemented by DocumentApiCall.
sequenceDiagram
participant Caller
participant DocApi as DocumentApiCall
participant Env as EnvironmentService
participant Service as Document API
Caller->>DocApi: new DocumentApiCall()
DocApi->>Env: MachineName, UserId(), GetConfigSetting(documentapi.url)
Env-->>DocApi: Caller metadata + base URL
Caller->>DocApi: CallDocumentApi(packageName, xml, options)
DocApi->>Service: POST /v1/distribute
Service-->>DocApi: HTTP response
DocApi-->>Caller: bool success
Design constraints¶
- The library performs no local persistence, database access, or BOF business-object lifecycle work.
- Successful client construction depends on required Environment API settings being present before any method is called.
- The Document API and Policy Document Distribution API flows do not attach explicit authenticators in this library.
DistributionMethod<T>uses the concrete class name as the channel discriminator, so renaming a channel type changes its emitted identifier.
Related documentation¶
- Index
- Overview
- Dependencies
- Operations and processes
- Business rules
- Security and authorization
- Configuration
- API reference
Sources¶
Business\SAIF.Business.Policy.Audit.ApiCalls\ApiCall.csBusiness\SAIF.Business.Policy.Audit.ApiCalls\DocumentApiCall.csBusiness\SAIF.Business.Policy.Audit.ApiCalls\PolicyDocDistributionCall.csBusiness\SAIF.Business.Policy.Audit.ApiCalls\DistributionMethod.csBusiness\SAIF.Business.Policy.Audit.ApiCalls\PolicyDocumentConfig.csBusiness\SAIF.Business.Policy.Audit.ApiCalls\app.configBusiness\SAIF.Business.Policy.Audit.ApiCalls\Web.config