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

# Audit

`Audit` wraps a bill's `CbpAudit` entity and implements the audit-adjustment behaviour of [OP-DOM-14](../../operations-processes.md#op-dom-14): disallowing or allowing every audited service on a bill, and computing the running charge/allowed/paid/MCO-withhold totals that drive the bill's EOB and payment amounts. `Bill.Audit` is the sole in-library entry point that constructs an `Audit`, and `EobGenerator` reads its totals and `Services` collection when assembling a bill's explanation of benefits.

## Purpose
- Applies bulk disallow/allow decisions across every audited service on a bill, adjusting each service's allowed and MCO-fee amounts and recording the adjustment history ([DOM-BR-140](../../business-rules.md#dom-br-140-audit), [DOM-BR-141](../../business-rules.md#dom-br-141-audit)).
- Computes the audit-level totals — adjustment, paid, and MCO-withhold amounts — that other domain types (`Bill`, `EobGenerator`) read to present bill financials ([DOM-BR-142](../../business-rules.md#dom-br-142-audit-totals)).
- Exposes the audited services as `AuditedService` domain wrappers rather than raw `CbpAuditedService` entities, so callers get the same behaviour-rich API as any other domain type.

## Context
- Namespace: `SAIF.Domain.Model.Claims.Bills.Audits`
- Assembly/package: `SAIF.Domain` (packaged in `SAIF.SAIFCode.Core`)

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| Empty | `public static Audit Empty()` | Returns an `Audit` instance with no backing data, used by `Bill.Audit` when a bill has no audit record yet (`HasData` is `false`). |
| Data | `public CbpAudit Data { get; }` | Exposes the underlying `CbpAudit` entity for callers that need direct entity access. |
| TotalAdjustementAmount | `public decimal TotalAdjustementAmount { get; }` | The aggregate adjustment amount, computed as `-(charged - allowed)` ([DOM-BR-142](../../business-rules.md#dom-br-142-audit-totals)). |
| TotalPaidAmount | `public decimal TotalPaidAmount { get; }` | The amount actually paid on the bill: allowed amount minus the MCO administration fee ([DOM-BR-142](../../business-rules.md#dom-br-142-audit-totals)). |
| TotalMcoWithholdAmount | `public decimal TotalMcoWithholdAmount { get; }` | The MCO administration fee total, negated for display as a withheld amount. |
| Services | `public IEnumerable<AuditedService> Services { get; }` | The bill's audited services, ordered by `Id` and wrapped as `AuditedService` domain objects; returns an empty sequence when the audit has no data. |
| DisallowAllServices | `public bool DisallowAllServices(string reasonId, string userId)` | Zeroes every service's allowed and MCO-fee amounts, records a disallowance adjustment per service using `reasonId`, and zeroes the audit-level totals ([DOM-BR-140](../../business-rules.md#dom-br-140-audit)); returns `false` when the audit has no data. |
| AllowAllServices | `public bool AllowAllServices(string userId)` | Reverses DB/MD/TC adjustments for every service whose original bill code is not `"D"`, recomputes each service's MCO fee (rounded away from zero), and recalculates the audit-level allowed and MCO-fee totals ([DOM-BR-141](../../business-rules.md#dom-br-141-audit)); returns `false` when the audit has no data. |

## Inherited public members

Members in this section are inherited from `DomainBase<TItem>` in `SAIF.Domain`. They are available on this type through inheritance (via the intermediate `DomainQueryBase<TItem,TQueryProvider>` base).

| Member | Signature | Purpose | Origin |
| --- | --- | --- | --- |
| HasData | `public virtual bool HasData { get; }` | Reports whether the wrapped `CbpAudit` entity is present, evaluated as `!DataItem.IsNull()`. | `SAIF.Domain` — `DomainBase<TItem>` |

## Behavioral notes
- `DisallowAllServices` only adjusts services whose `AllowedAmount` is currently greater than zero, so already-zeroed services are left untouched*.
- `AllowAllServices` skips services whose `OriginalBillCode.Code` is `"D"` (dental), meaning dental service adjustments are never reversed by this method.

## Constraints and usage notes
- `DisallowAllServices` and `AllowAllServices` both return `false` immediately when `HasData` is `false`, so callers should check the return value rather than assuming success.

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

## Sources
- `Domain/SAIF.Domain/Model/Claims/Bills/Audits/Audit.cs`
- `Domain/SAIF.Domain/DomainBase.cs`
- `Domain/SAIF.Domain/DomainQueryBase.cs`
