---
title: SAIF.Services.ClaimInfoApi.Core business rules
summary: Enumerated business rules with per-rule trigger, enforcement, and outcomes.
status: draft
owner: SAIF.Core Documentation Team
last_reviewed: 2026-09-24
library: SAIF.Services.ClaimInfoApi.Core
reference_type: package
---

# SAIF.Services.ClaimInfoApi.Core business rules

This page captures business rules enforced by the notification rule engine in `SAIF.Services.ClaimInfoApi.Core`. Every rule is defined and enforced locally; none is inherited from a dependency, since this library has no internal or external dependencies.

## CIA-BR-001 Notification outputs are keyed by rule position

| Field | Value |
| --- | --- |
| **Statement** | Notification outputs are keyed by rule `Position`. A rule's `Key` is its position as a string, so at most one result is returned per position. |
| **Trigger** | Each rule evaluated during `CalculateNotifications<T>`. |
| **Enforcement** | `NotificationRule.Key`; `NotificationRuleEngine.CalculateNotifications<T>` (`NotificationRuleEngine.cs` lines 19–27). |
| **Outcome** | One result per position; a later rule at the same position overwrites an earlier one. |
| **Source** | `Services/SAIF.Services.ClaimInfoApi.Core/NotificationRuleEngine.cs` |

---

## CIA-BR-002 Evaluation type is resolved from rule metadata

| Field | Value |
| --- | --- |
| **Statement** | A rule's evaluation type is resolved from its `TypeName` string using `Type.GetType`. |
| **Trigger** | Every rule evaluation. |
| **Enforcement** | `NotificationRule.Type`; `NotificationRuleEngine.CalculateNotification<T>`. |
| **Outcome** | Picks the `int`, `bool`, or string evaluation branch; an unresolvable `TypeName` falls through to the string branch. |
| **Source** | `Services/SAIF.Services.ClaimInfoApi.Core/NotificationRule.cs`, `Services/SAIF.Services.ClaimInfoApi.Core/NotificationRuleEngine.cs` |

---

## CIA-BR-003 Non-bool rule results are returned as strings

| Field | Value |
| --- | --- |
| **Statement** | An `int` rule always produces its value as a string. A rule of any non-`int`, non-`bool` type is compiled as returning `string` and produces that string directly. |
| **Trigger** | Rule's resolved type is `int` or any other non-`bool` type. |
| **Enforcement** | `NotificationRuleEngine.CalculateNotification<T>` (`NotificationRuleEngine.cs` lines 37–41, 64–68). |
| **Outcome** | A string value, or null only when the underlying string-typed member itself returns null. |
| **Source** | `Services/SAIF.Services.ClaimInfoApi.Core/NotificationRuleEngine.cs` |

---

## CIA-BR-004 A false bool rule produces no notification

| Field | Value |
| --- | --- |
| **Statement** | A `bool` rule that evaluates to false produces no notification. |
| **Trigger** | Rule's resolved type is `bool` and the compiled delegate returns false. |
| **Enforcement** | `NotificationRuleEngine.CalculateNotification<T>` (`NotificationRuleEngine.cs` lines 59–62). |
| **Outcome** | Returns null, so [CIA-BR-001](#cia-br-001-notification-outputs-are-keyed-by-rule-position) causes the rule to be skipped entirely. |
| **Source** | `Services/SAIF.Services.ClaimInfoApi.Core/NotificationRuleEngine.cs` |

---

## CIA-BR-005 A true bool rule with an out-property recurses into a child property rule

| Field | Value |
| --- | --- |
| **Statement** | A `bool` rule that evaluates to true and has `OutProperty` set produces the value of that other model property, evaluated as a child `PropertyRule` that inherits the parent rule's `Id` and `Position`. |
| **Trigger** | Rule's resolved type is `bool`, the compiled delegate returns true, and `OutProperty` is not null. |
| **Enforcement** | `NotificationRuleEngine.CalculateNotification<T>` (`NotificationRuleEngine.cs` lines 48–53). |
| **Outcome** | The out-property's evaluated value becomes the notification value for the parent rule's position. |
| **Source** | `Services/SAIF.Services.ClaimInfoApi.Core/NotificationRuleEngine.cs`, `Services/SAIF.Services.ClaimInfoApi.Core/NotificationRule.cs` |

---

## CIA-BR-006 A true bool rule without an out-property falls back to a constant out-value

| Field | Value |
| --- | --- |
| **Statement** | A `bool` rule that evaluates to true, has no `OutProperty`, and has `OutValue` set produces the constant `OutValue`. If neither `OutProperty` nor `OutValue` is set, it produces nothing. |
| **Trigger** | Rule's resolved type is `bool`, the compiled delegate returns true, and `OutProperty` is null. |
| **Enforcement** | `NotificationRuleEngine.CalculateNotification<T>` (`NotificationRuleEngine.cs` lines 54–57). |
| **Outcome** | `OutValue`, or null when neither output is configured. |
| **Source** | `Services/SAIF.Services.ClaimInfoApi.Core/NotificationRuleEngine.cs` |

---

## CIA-BR-007 Only non-null results become notifications and the last one at a position wins

| Field | Value |
| --- | --- |
| **Statement** | Only non-null rule values become notifications. When several rules share a position, the last non-null one in `Rules` array order wins. |
| **Trigger** | After each rule in `matrix.Rules` is evaluated. |
| **Enforcement** | `NotificationRuleEngine.CalculateNotifications<T>` (`NotificationRuleEngine.cs` lines 17–28). |
| **Outcome** | The output dictionary entry for that position is added or overwritten. |
| **Source** | `Services/SAIF.Services.ClaimInfoApi.Core/NotificationRuleEngine.cs` |

---

## CIA-BR-008 The literal target value null means a null comparison value

| Field | Value |
| --- | --- |
| **Statement** | The literal target value `"null"` means a null comparison or argument value when building an expression. |
| **Trigger** | Expression construction in `BuildExpr<T>` encounters `TargetValue == "null"`. |
| **Enforcement** | `NotificationRuleEngine.BuildExpr<T>` (`NotificationRuleEngine.cs` line 84). |
| **Outcome** | A null constant expression is emitted instead of a converted value. |
| **Source** | `Services/SAIF.Services.ClaimInfoApi.Core/NotificationRuleEngine.cs` |

---

## CIA-BR-009 A matching public method name invokes that method

| Field | Value |
| --- | --- |
| **Statement** | If `MemberName` names a public method on the model type, the rule calls that method with `TargetValue` converted to the method's first parameter type. |
| **Trigger** | `typeof(T).GetMethod(rule.MemberName)` finds a public method. |
| **Enforcement** | `NotificationRuleEngine.BuildExpr<T>` (`NotificationRuleEngine.cs` lines 83–91); constructed via `NotificationRule.MethodRule`. |
| **Outcome** | The compiled expression is `model.Method(value)`. |
| **Source** | `Services/SAIF.Services.ClaimInfoApi.Core/NotificationRuleEngine.cs`, `Services/SAIF.Services.ClaimInfoApi.Core/NotificationRule.cs` |

---

## CIA-BR-010 No operator means a plain property read

| Field | Value |
| --- | --- |
| **Statement** | If `OperatorName` is null, the rule is a plain property read with no comparison. |
| **Trigger** | `MemberName` does not match a method and `OperatorName` is null. |
| **Enforcement** | `NotificationRuleEngine.BuildExpr<T>` (`NotificationRuleEngine.cs` lines 92–96); constructed via `NotificationRule.PropertyRule`. |
| **Outcome** | The compiled expression is `model.Property`. |
| **Source** | `Services/SAIF.Services.ClaimInfoApi.Core/NotificationRuleEngine.cs`, `Services/SAIF.Services.ClaimInfoApi.Core/NotificationRule.cs` |

---

## CIA-BR-011 An operator that parses as an ExpressionType builds a binary comparison

| Field | Value |
| --- | --- |
| **Statement** | If `OperatorName` parses as a `System.Linq.Expressions.ExpressionType` name (for example `Equal`, `GreaterThan`), the rule is a binary comparison between the property and `TargetValue`, converted to the property's type. |
| **Trigger** | `OperatorName` matches a defined `ExpressionType` enum value. |
| **Enforcement** | `NotificationRuleEngine.BuildExpr<T>` (`NotificationRuleEngine.cs` lines 103–108). |
| **Outcome** | The compiled expression is `model.Property <op> value`. |
| **Source** | `Services/SAIF.Services.ClaimInfoApi.Core/NotificationRuleEngine.cs` |

---

## CIA-BR-012 An unrecognized operator is treated as a method on the property's type

| Field | Value |
| --- | --- |
| **Statement** | Otherwise, `OperatorName` is treated as the name of a public method on the property's type (for example `Contains`), called with `TargetValue` converted to that method's first parameter type. |
| **Trigger** | `OperatorName` is not null and does not parse as an `ExpressionType`. |
| **Enforcement** | `NotificationRuleEngine.BuildExpr<T>` (`NotificationRuleEngine.cs` lines 110–117). |
| **Outcome** | The compiled expression is `model.Property.Method(value)`. |
| **Source** | `Services/SAIF.Services.ClaimInfoApi.Core/NotificationRuleEngine.cs` |

---

## CIA-BR-013 A matrix is identified by its composite document type and subtype key

| Field | Value |
| --- | --- |
| **Statement** | A matrix is identified by the composite key `"{DocType}:{SubType}"`. |
| **Trigger** | A caller looks up or keys a `NotificationMatrix` by document type and subtype. |
| **Enforcement** | `NotificationMatrix.Key`. |
| **Outcome** | Provides the composite key used by callers to select the applicable matrix before invoking [OP-CIA-01](operations-processes.md#operation-catalog).* |
| **Source** | `Services/SAIF.Services.ClaimInfoApi.Core/NotificationMatrix.cs` |

## Notes
- `NotificationMatrix.AlertLegal` and `AlertCBP` are not enforced by any compiled code in this library and are therefore not recorded as rules here; see [Architecture](architecture.md#design-constraints) for the design inconsistency.
- Mark inferred statements with `*` and unknown statements with `**`. Do not use bold inline confidence labels.

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

## Related documentation
- [Index](index.md)
- [Overview](overview.md)
- [Architecture](architecture.md)
- [Dependencies](dependencies.md)
- [Operations and processes](operations-processes.md)
- [API reference](api/index.md)

## Sources
- `Services/SAIF.Services.ClaimInfoApi.Core/NotificationMatrix.cs`
- `Services/SAIF.Services.ClaimInfoApi.Core/NotificationRule.cs`
- `Services/SAIF.Services.ClaimInfoApi.Core/NotificationRuleEngine.cs`
- `Services/SAIF.Services.ClaimInfoApi.Core/NotificationRuleResult.cs`
