Skip to content

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 BillStatusTypes enum value into its persisted three-letter CbpBillStatusCode, throwing when the status is not one of the nine recognized values (DOM-BR-030).
  • Wraps a CbpBillStatusCode reference-data row as a domain object exposing Code/Description (inherited) and the Is* boolean checks for each recognized status.

Context

  • Namespace: SAIF.Domain.Model.Claims.Bills
  • Assembly/package: SAIF.Domain (packaged in SAIF.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 through Bill.Status or GetStatusCode.
  • GetStatusCode's switch has no Reviewed case even though BillStatusTypes and the Is* checks both recognize a Reviewed status, so BillStatusTypes.Reviewed is not currently mappable through this method**.

Constraints and usage notes

  • GetStatusCode throws a plain Exception (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.cs
  • Core/SAIF.Core/Contracts/Claims/Bills/BillStatusCode.cs
  • Core/SAIF.Core/Contracts/Core/EnumerationBase.cs