---
title: ClaimDomainBuilder
summary: API reference for ClaimDomainBuilder.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-09-24
library: SAIF.Services
reference_type: package
---

# ClaimDomainBuilder

Implements `IClaimDomainBuilder`, acting as the factory that assembles `SAIF.Domain.Model.Claims.Claim` and `Worker` domain objects with all of their required collaborators pre-wired. It depends on `IUnitOfWork` for repository access, `IUserProfileService` for user context, `IClaimQueryProvider` and `IWorkerQueryProvider` for claim/worker data queries, `ICCClaimApiService` for a Guidewire-era claim API, and `IClaimDataApiClient` (Guidewire) supplied only to the ID/claim-number lookup overloads.

## Purpose
- Validates that the unit of work, user profile service, and claim query provider are supplied (via `Enforce.ArgumentNotNull`) before constructing any domain object.
- Builds `Claim` domain objects from a claim ID, a claim number, or an already-loaded `InjuryClaim`, injecting the same set of query/API collaborators into each.
- Builds `Worker` domain objects from a worker ID or an already-loaded `ClaimPerson`.

## Context
- Namespace: `SAIF.Services.Claims`
- Assembly/package: `SAIF.Services` (packaged inside the `SAIF.SAIFCode.Core` NuGet package)

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| ClaimDomainBuilder(...) | `public ClaimDomainBuilder(IUnitOfWork unitOfWork, IUserProfileService userProfileService, IClaimQueryProvider queryProvider, IWorkerQueryProvider workerQueryProvider, ICCClaimApiService claimApiService, IClaimDataApiClient gwClaimDataApiClient)` | Validates the unit of work, user profile service, and claim query provider are non-null, then stores all six collaborators for use by the `GetClaim`/`GetWorker` factory methods. |
| GetClaim(InjuryClaim) | `public Claim GetClaim(InjuryClaim claim)` | Constructs a `Claim` domain object directly from an in-hand `InjuryClaim` record, without the Guidewire claim-data API client. |
| GetWorker(long) | `public Worker GetWorker(long workerId)` | Constructs a `Worker` domain object for the given worker ID using the unit of work and worker query provider. |
| GetWorker(ClaimPerson) | `public Worker GetWorker(ClaimPerson worker)` | Constructs a `Worker` domain object directly from an in-hand `ClaimPerson` record. |
| GetClaim(long) | `public Claim GetClaim(long claimId)` | Constructs a `Claim` domain object for the given claim ID, including the Guidewire claim-data API client for source-system integration. |
| GetClaim(string) | `public Claim GetClaim(string claimNumber)` | Constructs a `Claim` domain object for the given claim number, including the Guidewire claim-data API client. |

## Behavioral notes
- The `GetClaim(InjuryClaim)` overload omits `_gwClaimDataApiClient` from the `Claim` constructor call, while the ID and claim-number overloads both pass it — meaning claims built from an already-loaded record do not get Guidewire claim-data API wiring*.
- All construction is a direct `new Claim(...)`/`new Worker(...)` call with no caching, transaction, or validation logic beyond the constructor argument checks.

> **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/Claims/ClaimDomainBuilder.cs
