BillStatusCode¶
BillStatusCode extends SAIF.Core.Contracts.Claims.Bills.BillStatusCode to add the lookup that turns a BillStatusTypes enum value into the persisted CbpBillStatusCode row: GetStatusCode maps every supported status to its three-letter code (COM, ENT, PEN, AUD, APP, DIS, EXT, REV, SUS) and throws on an unrecognized status (DOM-BR-030). Bill.ModifyStatus calls GetStatusCode on every status transition, making this the single translation point between the domain's status enum and the database's status-code reference table.
Purpose¶
- Translates a
BillStatusTypesenum value into its persisted three-letterCbpBillStatusCode, throwing when the status is not one of the nine recognized values (DOM-BR-030). - Wraps a
CbpBillStatusCodereference-data row as a domain object exposingCode/Description(inherited) and theIs*boolean checks for each recognized status.
Context¶
- Namespace:
SAIF.Domain.Model.Claims.Bills - Assembly/package:
SAIF.Domain(packaged inSAIF.SAIFCode.Core)
Public members¶
| Member | Signature | Purpose |
|---|---|---|
| GetStatusCode | public static CbpBillStatusCode GetStatusCode(IBillQueryProvider queryProvider, BillStatusTypes status) |
Maps status to its three-letter code (COM/ENT/PEN/AUD/APP/DIS/EXT/REV/SUS) and retrieves the matching CbpBillStatusCode reference row via queryProvider; throws Exception for any other BillStatusTypes value (DOM-BR-030). |
Inherited public members¶
Members in this section are inherited from BillStatusCode and EnumerationBase<TCode,TEnumeration> in SAIF.Core. They are available on this type through inheritance.
| Member | Signature | Purpose | Origin |
|---|---|---|---|
| IsCompleted | public bool IsCompleted { get; } |
true when Code (upper-cased) is "COM". |
SAIF.Core — BillStatusCode |
| IsEntered | public bool IsEntered { get; } |
true when Code (upper-cased) is "ENT". |
SAIF.Core — BillStatusCode |
| IsPending | public bool IsPending { get; } |
true when Code (upper-cased) is "PEN". |
SAIF.Core — BillStatusCode |
| IsAudited | public bool IsAudited { get; } |
true when Code (upper-cased) is "AUD". |
SAIF.Core — BillStatusCode |
| IsApproved | public bool IsApproved { get; } |
true when Code (upper-cased) is "APP". |
SAIF.Core — BillStatusCode |
| IsDiscarded | public bool IsDiscarded { get; } |
true when Code (upper-cased) is "DIS". |
SAIF.Core — BillStatusCode |
| IsExtracted | public bool IsExtracted { get; } |
true when Code (upper-cased) is "EXT". |
SAIF.Core — BillStatusCode |
| IsReviewed | public bool IsReviewed { get; } |
true when Code (upper-cased) is "REV". |
SAIF.Core — BillStatusCode |
| IsSuspended | public bool IsSuspended { get; } |
true when Code (upper-cased) is "SUS". |
SAIF.Core — BillStatusCode |
| Code | public TCode Code { get; protected set; } (TCode = string) |
The persisted status code value (e.g. "COM", "ENT"). |
SAIF.Core — EnumerationBase<TCode,TEnumeration> |
| Description | public string Description { get; protected set; } |
The human-readable description of the status code. | SAIF.Core — EnumerationBase<TCode,TEnumeration> |
| EnumValue | public TEnumeration EnumValue { get; } (TEnumeration = BillStatusTypes) |
The BillStatusTypes enum value corresponding to Code, resolved via the code-to-enum dictionary populated by InitializeEnumeratedData. |
SAIF.Core — EnumerationBase<TCode,TEnumeration> |
| GetCodeValue | public TCode GetCodeValue(TEnumeration enumValue) |
Returns the persisted code string for a given BillStatusTypes value, the reverse lookup of EnumValue. |
SAIF.Core — EnumerationBase<TCode,TEnumeration> |
| GetEnumeratedValue | public TEnumeration GetEnumeratedValue(TCode code) |
Returns the BillStatusTypes value for a given persisted code string. |
SAIF.Core — EnumerationBase<TCode,TEnumeration> |
Behavioral notes¶
- The domain-level constructors (
internal BillStatusCode(CbpBillStatusCode data),internal BillStatusCode()) are internal, so only in-library code (Bill.Status) can construct instances directly; external callers only reach this type throughBill.StatusorGetStatusCode. GetStatusCode'sswitchhas noReviewedcase even thoughBillStatusTypesand theIs*checks both recognize a Reviewed status, soBillStatusTypes.Reviewedis not currently mappable through this method**.
Constraints and usage notes¶
GetStatusCodethrows a plainException(not a domain-specific exception type) for an unrecognized status, so callers must be prepared to catch a generic exception for this failure mode.
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¶
Domain/SAIF.Domain/Model/Claims/Bills/BillStatusCode.csCore/SAIF.Core/Contracts/Claims/Bills/BillStatusCode.csCore/SAIF.Core/Contracts/Core/EnumerationBase.cs