Skip to main content

Coverage Rules

The Policy Coverages step enforces state-specific coverage rules that control option filtering, cross-field validation, and automatic derivations. These rules live entirely in the frontend and operate on CDM-provided coverage options.

Coverage Fields

Field IDLabelLimit Kind
coverage_planCoverage PlanPreset tier
bodily_injuryBodily Injurysplit (e.g. 25/50) or csl (e.g. 100CSL)
property_damageProperty Damagescalar (e.g. 25000)
collision_deductibleCollision Deductiblescalar
uninsured_motorist_bodilyUM Bodily Injurysplit, csl, or reject
uninsured_motorist_propertyUM Property Damagescalar or reject
medical_paymentsMedical Paymentsscalar or none
pipPersonal Injury ProtectionState-specific
custom_equipmentCustom Equipmentscalar
extended_non_ownerExtended Non-Ownerscalar or none

Plan Tiers

Coverage plans provide preset coverage levels. Selecting a plan auto-fills all coverage fields to that tier's defaults.

TierDescription
essentialMinimum required coverages
enhancedMid-level coverages
superiorHigh coverages
premierMaximum coverages

Plan tiers are defined per state via CDM. Selecting a plan pre-fills all coverage dropdowns, but the customer can customize individual fields after selection.

Limit Parsing

Coverage values are parsed into structured types for comparison:

KindExampleParsed As
split25/50{ kind: 'split', per: 25, agg: 50 }
scalar25000{ kind: 'scalar', value: 25000 }
csl100CSL{ kind: 'csl', value: 100 }
rejectREJ{ kind: 'reject' }
noneNONE{ kind: 'none' }

Source: policy-coverages/utils/coverage-rule-parsers.ts

Validation Rules

Cross-field validation prevents invalid coverage combinations:

RuleConstraint
UM Bodily ≤ Bodily InjuryUninsured motorist bodily injury cannot exceed bodily injury limit
UM Property ≤ Property DamageUninsured motorist property cannot exceed property damage limit
UM Property requires UM BodilyIf UM Bodily is rejected, UM Property must also be rejected
UM Bodily CSL requires BI CSLIf UM Bodily uses CSL format, Bodily Injury must also be CSL

Source: policy-coverages/utils/coverage-rule-validation.ts

Automatic Derivations

When certain fields change, dependent fields are automatically updated:

TriggerEffect
Bodily Injury → CSL formatProperty Damage is disabled and synced to match
UM Bodily → CSL formatUM Property is disabled and synced to match
UM Bodily → REJUM Property is disabled and set to REJ

Source: policy-coverages/utils/coverage-rule-derivations.ts

Option Filtering

Available options for dependent fields are filtered based on parent field values:

  • UM Bodily Injury options are filtered based on the current Bodily Injury limit (cannot exceed it)
  • UM Property Damage options are filtered based on the current Property Damage limit
  • Plan tier gating restricts certain options to specific plan tiers or higher

Source: policy-coverages/utils/coverage-rule-filters.ts

Coverage Form Hooks

HookPurpose
useCoverageFormManages coverage form state, validation, and submission
useFilteredCoverageFormApplies rule-based filtering to coverage options
useCoverageFlowControlsWires coverage form to the flow's continue/previous handlers

Rate Box Integration

When coverages change, the SafecoRateBox component shows an "Update Price" button. Clicking it triggers useSafecoRate('update') which calls POST /ghcms/safeco/update-quote (RC1) to get updated premiums.

Key Files

FilePurpose
policy-coverages/utils/coverage-rule-types.tsType definitions for plans, fields, limit kinds
policy-coverages/utils/coverage-rule-parsers.tsParse coverage limit strings
policy-coverages/utils/coverage-rule-validation.tsCross-field validation
policy-coverages/utils/coverage-rule-derivations.tsAutomatic field syncing
policy-coverages/utils/coverage-rule-filters.tsOption filtering
policy-coverages/utils/coverage-form-mappers.tsMap form data to API format
policy-coverages/utils/coverage-section-grouping.tsGroup coverages into UI sections
policy-coverages/constants/compare-plan-features.tsPlan tier comparison data

All files under apps/fastlane-portal/src/app/pages/carriers/safeco/auto/policy-coverages/.