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 ID | Label | Limit Kind |
|---|---|---|
coverage_plan | Coverage Plan | Preset tier |
bodily_injury | Bodily Injury | split (e.g. 25/50) or csl (e.g. 100CSL) |
property_damage | Property Damage | scalar (e.g. 25000) |
collision_deductible | Collision Deductible | scalar |
uninsured_motorist_bodily | UM Bodily Injury | split, csl, or reject |
uninsured_motorist_property | UM Property Damage | scalar or reject |
medical_payments | Medical Payments | scalar or none |
pip | Personal Injury Protection | State-specific |
custom_equipment | Custom Equipment | scalar |
extended_non_owner | Extended Non-Owner | scalar or none |
Plan Tiers
Coverage plans provide preset coverage levels. Selecting a plan auto-fills all coverage fields to that tier's defaults.
| Tier | Description |
|---|---|
essential | Minimum required coverages |
enhanced | Mid-level coverages |
superior | High coverages |
premier | Maximum 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:
| Kind | Example | Parsed As |
|---|---|---|
split | 25/50 | { kind: 'split', per: 25, agg: 50 } |
scalar | 25000 | { kind: 'scalar', value: 25000 } |
csl | 100CSL | { kind: 'csl', value: 100 } |
reject | REJ | { kind: 'reject' } |
none | NONE | { kind: 'none' } |
Source: policy-coverages/utils/coverage-rule-parsers.ts
Validation Rules
Cross-field validation prevents invalid coverage combinations:
| Rule | Constraint |
|---|---|
| UM Bodily ≤ Bodily Injury | Uninsured motorist bodily injury cannot exceed bodily injury limit |
| UM Property ≤ Property Damage | Uninsured motorist property cannot exceed property damage limit |
| UM Property requires UM Bodily | If UM Bodily is rejected, UM Property must also be rejected |
| UM Bodily CSL requires BI CSL | If 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:
| Trigger | Effect |
|---|---|
| Bodily Injury → CSL format | Property Damage is disabled and synced to match |
| UM Bodily → CSL format | UM Property is disabled and synced to match |
UM Bodily → REJ | UM 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
| Hook | Purpose |
|---|---|
useCoverageForm | Manages coverage form state, validation, and submission |
useFilteredCoverageForm | Applies rule-based filtering to coverage options |
useCoverageFlowControls | Wires 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
| File | Purpose |
|---|---|
policy-coverages/utils/coverage-rule-types.ts | Type definitions for plans, fields, limit kinds |
policy-coverages/utils/coverage-rule-parsers.ts | Parse coverage limit strings |
policy-coverages/utils/coverage-rule-validation.ts | Cross-field validation |
policy-coverages/utils/coverage-rule-derivations.ts | Automatic field syncing |
policy-coverages/utils/coverage-rule-filters.ts | Option filtering |
policy-coverages/utils/coverage-form-mappers.ts | Map form data to API format |
policy-coverages/utils/coverage-section-grouping.ts | Group coverages into UI sections |
policy-coverages/constants/compare-plan-features.ts | Plan tier comparison data |
All files under apps/fastlane-portal/src/app/pages/carriers/safeco/auto/policy-coverages/.