---
title: Model helper operations
summary: Provide in-memory model helper behavior: child id sequencing, financial-transaction validation, subpoena classification, cost-category lookup, and show-only enum conversion.
status: draft
owner: SAIF.Core documentation team
last_reviewed: 2026-09-24
library: SAIF.Data
reference_type: package
operation_id: OP-SD-23
trigger: Callers construct or classify in-memory domain model instances.
---

# Model helper operations

Provide in-memory model helper behavior: child id sequencing, financial-transaction validation, subpoena classification, cost-category lookup, and show-only enum conversion.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-SD-23 |
| **Trigger** | Callers construct or classify in-memory domain model instances. |
| **Inputs** | Model instances/fields |
| **Outputs** | Mutated model state, classification results |
| **Primary components** | `CbpBill`, `FinancialTransaction`, `Subpoena`, `ClaimCostCategoryCode`, `Enums` |
| **Entry point** | `Data/SAIF.Data/Model/Claims/Bills/CbpBill.cs` |

## Steps

1. `CbpBill.AddProcedure` / `AddService` auto-increment child ids ([SD-BR-100](../business-rules.md#sd-br-100-child-procedure-and-service-ids-auto-increment)).
2. `FinancialTransaction.AddDetail` calls `Enforce.ArgumentNotNull` and increments the id; `InsertAddressLine1` shifts address lines down ([SD-BR-101](../business-rules.md#sd-br-101-financial-transaction-detail-must-not-be-null)).
   > **Origin**: The null-check step delegates to `Enforce.ArgumentNotNull` (`Data/SAIF.Data/Model/Claims/Payments/FinancialTransaction.cs:173`), implemented in the `SAIF.Common` assembly, which is outside this documentation run and has no navigable operation page here.*
4. `Subpoena` classification helpers ([SD-BR-102](../business-rules.md#sd-br-102-subpoena-classification-helpers)): `IsWitnessType` (Nonparties, OtherMedical, Parties), `IsProviderType` (Claims, MedicalRecords), `IsZeroPayNoMail` ("NOML" and a paid sum of 0).
5. `ClaimCostCategoryCode` lookups: MED, TD, PPD, PTD, FTL, CHE, VSV, VTD, OTH; the descriptions "burial expenses" and "death benefits" map to FTL ([SD-BR-103](../business-rules.md#sd-br-103-claim-cost-category-code-lookups-and-aliases)).
6. `Enums.ConvertShowOnlyStringToEnum` defaults to `Unread` ([SD-BR-104](../business-rules.md#sd-br-104-unknown-show-only-string-defaults-to-unread)).

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start(["Callers construct or classify in-memory domain model<br>instances."]) --> S1["`CbpBill`"]
	S1 --> S2{"Rules satisfied?"}
	S2 -->|Yes| EndOk([Result returned])
	S2 -->|No| EndErr([Exception / empty result])
```

## Failure and edge-case behavior
- Null financial transaction detail: `Enforce.ArgumentNotNull` throws `ArgumentNullException`.
- Unrecognized show-only string: defaults to `Unread` rather than throwing.

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [SQL catalog](../sql/index.md)
- [Database tables](../database-tables.md)

> **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
- `Data/SAIF.Data/Model/Claims/Bills/CbpBill.cs`
