---
title: clsAgencyContract
summary: API reference for clsAgencyContract.
status: draft
owner: Technical Writer
last_reviewed: 2026-07-31
library: SAIF.Business.Policy.Agency
reference_type: package
---

# clsAgencyContract

`clsAgencyContract` represents one agency appointment or commission arrangement loaded from `AGENCY_CONTRACT`. It translates persisted contract and commission codes into domain enums and exposes the date-window and producer-commission checks that other agency workflows depend on.

## Purpose
- Represent one contract row together with its appointment and commission semantics.
- Translate persisted code values into domain enums used throughout the library.
- Support active-date filtering and producer-commission qualification checks.

## Context
- Namespace: `SAIF.Business.Policy.Agency`
- Assembly/package: `SAIF.Business.Policy.Agency`

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| `AgencyContractSeqNum` | `Public ReadOnly Property AgencyContractSeqNum() As Decimal` | Exposes the business identity key for the contract row. |
| `AgencySeqNum` | `Public ReadOnly Property AgencySeqNum() As Decimal` | Identifies the owning agency used for collection assignment and lookups. |
| `CommissionGeneralLedgerTypeCode` | `Public ReadOnly Property CommissionGeneralLedgerTypeCode() As String` | Returns the persisted commission general-ledger type code, the source of the `IsProducerCommissionContract` classification. |
| `ContractType` | `Public ReadOnly Property ContractType() As AgencyContractTypes` | Returns the contract's domain-level appointment classification, translated from the persisted code. |
| `ContractTypeCode` | `Public ReadOnly Property ContractTypeCode() As String` | Returns the raw persisted contract-type code. |
| `CreateDate` | `Public ReadOnly Property CreateDate() As Date` | Returns the date the contract record was created, for audit history. |
| `CreateUser` | `Public ReadOnly Property CreateUser() As String` | Returns the user ID that created the contract record, for audit history. |
| `DefaultCommissionScheduleID` | `Public ReadOnly Property DefaultCommissionScheduleID() As String` | Returns the commission schedule applied to new business under this contract. |
| `EffectiveDate` | `Public ReadOnly Property EffectiveDate() As Date` | Returns the date the contract became effective, used by `IsActive`. |
| `ExpirationDate` | `Public ReadOnly Property ExpirationDate() As Date` | Returns the date the contract expires, used by `IsActive`. |
| `IsActive` | `Public ReadOnly Property IsActive(ByVal inDate As Date) As Boolean` | Applies the shared effective/expiration-window test to the contract. |
| `IsProducerCommissionContract` | `Public ReadOnly Property IsProducerCommissionContract() As Boolean` | Reports whether the contract's commission GL type is producer-commission-bearing. |
| `LegacyCommissionScheduleID` | `Public ReadOnly Property LegacyCommissionScheduleID() As String` | Returns the commission schedule carried over from the legacy policy maintenance system. |
| `LegacyRenewalCommissionScheduleID` | `Public ReadOnly Property LegacyRenewalCommissionScheduleID() As String` | Returns the renewal commission schedule carried over from the legacy policy maintenance system. |
| `PaymentFrequencyCode` | `Public ReadOnly Property PaymentFrequencyCode() As String` | Returns the code controlling how often commission payments are issued under this contract. |
| `PolicyMaintenanceSystemAgencyNum` | `Public ReadOnly Property PolicyMaintenanceSystemAgencyNum() As Decimal` | Returns the agency number as recorded in the legacy policy maintenance system, used for cross-system reconciliation. |
| `RenewalCommissionScheduleID` | `Public ReadOnly Property RenewalCommissionScheduleID() As String` | Returns the commission schedule applied to renewal business under this contract. |
| `IsValid` | `Public Overrides ReadOnly Property IsValid() As Boolean` | Reports whether the contract currently satisfies its base-class validation rules. |
| `IsDirty` | `Public Overrides ReadOnly Property IsDirty() As Boolean` | Reports whether the contract has unsaved field changes, per the base-class dirty-tracking state. |
| `IsDefaultCommissionScheduleIDNull` | `Public Function IsDefaultCommissionScheduleIDNull() As Boolean` | Reports whether `DefaultCommissionScheduleID` has no assigned value. |
| `IsExpirationDateNull` | `Public Function IsExpirationDateNull() As Boolean` | Reports whether the contract has no recorded expiration date. |
| `IsLegacyCommissionScheduleIDNull` | `Public Function IsLegacyCommissionScheduleIDNull() As Boolean` | Reports whether `LegacyCommissionScheduleID` has no assigned value. |
| `IsLegacyRenewalCommissionScheduleIDNull` | `Public Function IsLegacyRenewalCommissionScheduleIDNull() As Boolean` | Reports whether `LegacyRenewalCommissionScheduleID` has no assigned value. |
| `IsPolicyMaintenanceSystemAgencyNumNull` | `Public Function IsPolicyMaintenanceSystemAgencyNumNull() As Boolean` | Reports whether `PolicyMaintenanceSystemAgencyNum` has no assigned value. |
| `IsRenewalCommissionScheduleIDNull` | `Public Function IsRenewalCommissionScheduleIDNull() As Boolean` | Reports whether `RenewalCommissionScheduleID` has no assigned value. |
| `Convert` | `Public Shared Function Convert(ByVal inAgencyContractType As AgencyContractTypes) As String` | Maps a contract-type enum to its persisted database code. |
| `Convert` | `Public Shared Function Convert(ByVal inAgencyContractTypeCode As String) As AgencyContractTypes` | Maps a persisted contract-type code to its domain enum. |
| `ConvertCommissionGeneralLedgerType` | `Public Function ConvertCommissionGeneralLedgerType(ByVal inCommissionGeneralLedgerType As CommissionGeneralLedgerTypes) As String` | Maps a commission GL enum to its persisted database code. |
| `ConvertCommissionGeneralLedgerType` | `Public Function ConvertCommissionGeneralLedgerType(ByVal inCommissionGeneralLedgerTypeCode As String) As CommissionGeneralLedgerTypes` | Maps a persisted commission GL code to its domain enum. |
| `GetAgencyContract` | `Public Shared Function GetAgencyContract(ByVal inDataportal As IDataPortalInfo, ByVal inAgencyContractSeqNum As Decimal) As clsAgencyContract` | Entry point for keyed BOF retrieval of one contract. |
| `Equals` (shared) | `Public Overloads Shared Function Equals(ByVal objA As Object, ByVal objB As Object) As Boolean` | Compares two objects for contract-identity equality when both are `clsAgencyContract` instances. |
| `Equals` (override) | `Public Overloads Overrides Function Equals(ByVal inObject As Object) As Boolean` | Compares this contract to another object by delegating to the identity-based `Equals(clsAgencyContract)` overload. |
| `Equals` | `Public Overloads Function Equals(ByVal inObject As clsAgencyContract) As Boolean` | Compares contracts by their business identity key. |
| `GetHashCode` | `Public Overrides Function GetHashCode() As Integer` | Returns a hash code derived from the contract sequence number, for use in hash-based collections. |
| `ToString` | `Public Overrides Function ToString() As String` | Returns the contract sequence number as a string, used for display and lookups. |

## Inherited public members

Members in this section are inherited from `clsBusinessBase` in `SAIF.Framework.Core`. They are available on this type through inheritance.

| Member | Signature | Purpose | Origin |
| --- | --- | --- | --- |
| `Rules` | `Property Rules As clsRulesManager` | Exposes the shared BOF validation surface available to contract objects.* | `SAIF.Framework.Core` — `clsBusinessBase` |
| `BeginEdit` | `Sub BeginEdit()` | Opens a BOF edit scope.* | `SAIF.Framework.Core` — `clsBusinessBase` |
| `CancelEdit` | `Sub CancelEdit()` | Rolls back a BOF edit scope.* | `SAIF.Framework.Core` — `clsBusinessBase` |
| `ApplyEdit` | `Sub ApplyEdit()` | Commits a BOF edit scope.* | `SAIF.Framework.Core` — `clsBusinessBase` |
| `SetPreviousLink` | `Sub SetPreviousLink(item As ILinkItem)` | Establishes a backward link to another business object for linked-list traversal scenarios.* | `SAIF.Framework.Core` — `clsBusinessBase` |
| `SetNextLink` | `Sub SetNextLink(item As ILinkItem)` | Establishes a forward link to another business object for linked-list traversal scenarios.* | `SAIF.Framework.Core` — `clsBusinessBase` |
| `InsertLinkAfter` | `Sub InsertLinkAfter(item As ILinkItem)` | Inserts a linked item immediately after this contract in the linked chain.* | `SAIF.Framework.Core` — `clsBusinessBase` |
| `InsertLinkBefore` | `Sub InsertLinkBefore(item As ILinkItem)` | Inserts a linked item immediately before this contract in the linked chain.* | `SAIF.Framework.Core` — `clsBusinessBase` |
| `RemoveLinks` | `Sub RemoveLinks()` | Detaches this contract from its linked neighbors, repairing the remaining chain.* | `SAIF.Framework.Core` — `clsBusinessBase` |
| `Error` | `ReadOnly Property Error As String` (via `IDataErrorInfo`) | Returns a summary validation-error message for the contract, sourced from broken-rule state.* | `SAIF.Framework.Core` — `clsBusinessBase` |
| `Item(columnName)` | `ReadOnly Property Item(columnName As String) As String` (via `IDataErrorInfo`) | Returns a per-property validation-error message for the contract.* | `SAIF.Framework.Core` — `clsBusinessBase` |
| `AllowCache` | `Public Property AllowCache() As Boolean` | Controls whether the BOF runtime may cache the contract instance.* | `SAIF.Framework.Core` — `clsUndoableBase` |
| `DumpState` | `Public Sub DumpState()` | Writes the contract object's field data to the debugger output window, for diagnostic use.* | `SAIF.Framework.Core` — `clsUndoableBase` |

## Behavioral notes
- Contract classification is intentionally tolerant in the code-to-enum direction and strict in the enum-to-code direction.
- Producer-commission behavior depends entirely on the contract's commission GL code rather than a dedicated Boolean column.
- `IsValid` and `IsDirty` delegate directly to the base-class implementation; this contract adds no additional child-object validation of its own.*

## Constraints and usage notes
- Retrieval is read-only; mutating SQL paths are not implemented.
- Callers should use the nested enums rather than hard-coding appointment or commission literals.

> **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
- `Business\SAIF.Business.Policy.Agency\clsAgencyContract.vb`
