Skip to content

Classify a contract

This operation converts persisted contract and commission codes into domain enums and applies the producer-commission check used elsewhere in the library.

Field Value
Operation ID OP-007
Trigger A caller reads classification properties or invokes conversion helpers on clsAgencyContract.
Inputs Contract-type code, commission GL code, or enum value
Outputs Domain enum, code string, or Boolean result
Primary components clsAgencyContract.Convert, ConvertCommissionGeneralLedgerType, IsProducerCommissionContract
Entry point Business\SAIF.Business.Policy.Agency\clsAgencyContract.vb

Steps

  1. Read the persisted contract-type code and map it to an AgencyContractTypes value (BR-011).
  2. Read the persisted commission GL code and map it to a CommissionGeneralLedgerTypes value.
  3. When a code is not recognized, return Unassigned instead of failing (BR-012).
  4. When converting in the opposite direction, throw an exception if the enum value is not mapped to a persisted code (BR-014).
  5. Treat a contract as producer-commission-bearing only when the mapped GL type is ProducerCommission (AGT) (BR-013).

Process flow

The following diagram visualizes contract classification.

flowchart TD
  Start([Contract classification]) --> MapType[Map contract type code]
  MapType --> MapGL[Map GL code]
  MapGL --> Producer{GL type = AGT?}
  Producer -->|Yes| True[Producer commission contract]
  Producer -->|No| False[Not a producer commission contract]

Failure and edge-case behavior

  • Unknown persisted codes degrade to Unassigned.
  • Unknown enum inputs fail fast during enum-to-code conversion.

Sources

  • Business\SAIF.Business.Policy.Agency\clsAgencyContract.vb