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

# FraudInvestigationService

Implements `IInvestigationService`, resolving the display name of a fraud-investigation subject and the associated claim ID for a given case number. It depends on `IUnitOfWork` for `Investigation` repository queries and `IWorkerDataApiClient` to look up a worker's name from the external worker data API when the subject is identified only by worker ID.

## Purpose
- Resolves a case's subject name, preferring legacy worker/company/business name data, then falling back to an external worker-data-API lookup by worker ID, then to the policy name, and finally to `"Unknown"`.
- Retrieves the claim ID associated with a fraud-investigation case number.

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

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| FraudInvestigationService(...) | `public FraudInvestigationService(IUnitOfWork uow, IWorkerDataApiClient workerDataApiClient)` | Wires in the unit of work and worker-data-API client used to resolve subject names. |
| GetSubjectNameAsync | `public async Task<string> GetSubjectNameAsync(long caseNumber)` | Returns the subject's legacy worker/company/business name if present, otherwise asynchronously fetches and formats the worker's first/last name by worker ID, otherwise the policy name, otherwise `"Unknown"`; returns `null` if the case has no subject-name data at all. |
| GetClaimId | `public long GetClaimId(long caseNumber)` | Returns the claim ID linked to the specified investigation case number. |

## Behavioral notes
- Subject-name resolution follows a strict priority order (legacy name > worker-API lookup by ID > policy name > `"Unknown"`), so a case with multiple populated identifiers always resolves via the first match in that order.
- The worker-data-API call (`_workerDataApiClient.GetWorker`) is only made when a `WorkerId` is present and no legacy name was found, avoiding an unnecessary external call for cases already resolved locally.

## Sources
- Services/SAIF.Services/Investigations/FraudInvestigationService.cs
