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¶
- Read the persisted contract-type code and map it to an
AgencyContractTypesvalue (BR-011). - Read the persisted commission GL code and map it to a
CommissionGeneralLedgerTypesvalue. - When a code is not recognized, return
Unassignedinstead of failing (BR-012). - When converting in the opposite direction, throw an exception if the enum value is not mapped to a persisted code (BR-014).
- 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.
Related documentation¶
Sources¶
Business\SAIF.Business.Policy.Agency\clsAgencyContract.vb