Update life quotes to use new policy API structure

- Update life quote types to use insured/buyer instead of client
- Update life fields: add coverage_type, coverage_amount, coverage_years, smoker, medications, surgeries, weight, height
- Remove deprecated fields: dateOfBirth, age, gender, preexistingConditions, preexistingDetails, beneficiaryName, beneficiaryRelationship
- Update life quote SetupStep component to use customer selection
- Add Insured and Buyer sections with customer search and selection
- Add health questionnaire with smoker, medications, surgeries, weight, height fields
- Add coverage_type field (banking | protection)
- Update life quote page to use new composables and API structure
- Update validation to use insured/buyer validation
- Update submission to use policy API with new structure
This commit is contained in:
2026-04-27 15:03:43 -05:00
parent a2eb1f3789
commit 6c411ce2b6
4 changed files with 289 additions and 153 deletions

View File

@@ -1,5 +1,3 @@
import type { AutoQuoteClient } from '~/types/auto-quote-intake'
export type LifeQuoteMode = 'single' | 'comparative_pdf'
export type LifeQuoteSegment = 'individual' | 'corporate_keyman' | 'group'
@@ -7,19 +5,18 @@ export type LifeQuoteSegment = 'individual' | 'corporate_keyman' | 'group'
export type LifeQuoteDraft = {
quoteMode: LifeQuoteMode | null
segment: LifeQuoteSegment | null
client: AutoQuoteClient
insured: any | null
buyer: any | null
/** Life-specific subscriber details */
life: {
dateOfBirth: string
age: string
gender: string
coverage_type: 'banking' | 'protection'
coverage_amount: number
coverage_years: number
smoker: boolean
preexistingConditions: boolean
preexistingDetails: string
coverageAmount: string
coverageTerm: string
beneficiaryName: string
beneficiaryRelationship: string
medications: string
surgeries: string
weight: number
height: number
}
/** Mock: forms marked complete to proceed */
forms: {
@@ -34,9 +31,9 @@ export type LifeQuoteDraft = {
}
export type LifeQuoteIntakePayload = {
quoteMode: LifeQuoteMode
segment: LifeQuoteSegment
client: AutoQuoteClient
life: LifeQuoteDraft['life']
solicit: LifeQuoteDraft['solicit']
policy_type: 'life'
insured: any
buyer: any
policy_details: LifeQuoteDraft['life']
selected_providers: Array<{ provider_id: string; email: string }>
}