import {z} from 'zod' export type QuoteOfferCreateRequest = {quote_id: string}; export type PolicyCreateRequest = {binder_id: string, policy_id?: (string | null) | undefined} | {[key: string]: unknown}; export type PolicyTypeOptions = 'DP1' | 'DP2' | 'DP3'; export type RalphieModelsAddressAddress = {street_address: string, city: string, state: string, zip_code: string}; export type YesNo = 'yes' | 'no'; export type CompanyTypes = {contracting?: (YesNo | null) | undefined, operations_beyond_rental_property_ownership_and_maintenance?: (YesNo | null) | undefined}; export type Policyholder = {first_name?: (string | null) | undefined, last_name?: (string | null) | undefined, suffix?: (string | null) | undefined, company_name?: (string | null) | undefined, date_of_birth?: (string | null) | undefined, phone_number?: (string | null) | undefined, email?: (string | null) | undefined, mailing_address?: (RalphieModelsAddressAddress | null) | undefined, previous_address?: (RalphieModelsAddressAddress | null) | undefined, is_military_member?: (YesNo | null) | undefined, company_types?: (CompanyTypes | null) | undefined}; export type AdditionalNamedInsuredType = 'person' | 'company' | 'trust_or_estate'; export type AdditionalNamedInsured = {type: AdditionalNamedInsuredType, name: string, address: RalphieModelsAddressAddress}; export type InsuranceScoreEstimate = 999 | 725 | 865; export type Occupancy = 'owner_and_tenant' | 'rental' | 'seasonal' | 'vacant' | 'fix_and_flip' | 'landlord_primary_home'; export type LossReason = 'weather' | 'fire' | 'water_appliance' | 'water' | 'theft' | 'earthquake' | 'liability' | 'medical' | 'other'; export type SelfReportedClaims = {date_of_loss?: (string | null) | undefined, loss_reason?: (LossReason | null) | undefined, loss_amount_dollars?: (number | null) | undefined, caused_by_catastrophe?: (YesNo | null) | undefined}; export type PolicyDetails = {insurance_score_estimate?: (InsuranceScoreEstimate | null) | undefined, is_paperless?: (YesNo | null) | undefined, occupancy: Occupancy, similar_insurance_declined?: (YesNo | null) | undefined, self_reported_claims?: (Array | null) | undefined, unique_tracking_id?: (string | null) | undefined, wind_coverage_excluded?: (YesNo | null) | undefined, ca_dic?: (YesNo | null) | undefined}; export type PropertyAddress = {street_address: string, city: string, state: string, zip_code: string, county?: (string | null) | undefined, county_fips?: (string | null) | undefined, lat?: (number | null) | undefined, lng?: (number | null) | undefined}; export type SelectedValueRequest = {type: 'selected', value: YesNo, label?: (string | null) | undefined, editable?: (string | null) | undefined}; export type LimitValueRequest = {type: 'limit', value: string, label?: (string | null) | undefined, editable?: (string | null) | undefined}; export type AdditionalLivingCostsAndFairRentalValueCoverageRequest = {name: 'additional_living_costs_and_fair_rental_value', config: Array}; export type DeductibleValueRequest = {type: 'deductible', value: string, label?: (string | null) | undefined, editable?: (string | null) | undefined}; export type AllOtherPerilsDeductibleCoverageRequest = {name: 'all_other_perils_deductible', config: Array}; export type BedBugInfestationCostReimbursementCoverageRequest = {name: 'bed_bug_infestation_cost_reimbursement', config: Array}; export type HOAFinesCoverageRequest = {name: 'hoa_fines', config: Array}; export type RalphieModelsCoverageModelsDwellingLossValuationOptionValueRequestValueOptions = 'actual_cash_value' | 'replacement_cost' | 'repair_cost' | 'extended_replacement_cost' | 'functional_replacement_cost'; export type DwellingLossValuationOptionValueRequest = {type: 'loss_valuation_option', value: RalphieModelsCoverageModelsDwellingLossValuationOptionValueRequestValueOptions, label?: (string | null) | undefined, editable?: (string | null) | undefined}; export type DwellingCoverageRequest = {name: 'dwelling', config: Array}; export type LimitedHiddenWaterCoverageRequest = {name: 'limited_hidden_water', config: Array}; export type LimitedRenovationCoverageRequest = {name: 'limited_renovation', config: Array}; export type LimitedTheftCoverageRequest = {name: 'limited_theft', config: Array}; export type RalphieModelsCoverageModelsLossAssessmentLimitValueRequestValueOptions = '1000' | '5000' | '10000' | '15000' | '20000' | '25000' | '50000'; export type LossAssessmentLimitValueRequest = {type: 'limit', value: RalphieModelsCoverageModelsLossAssessmentLimitValueRequestValueOptions, label?: (string | null) | undefined, editable?: (string | null) | undefined}; export type LossAssessmentCoverageRequest = {name: 'loss_assessment', config: Array}; export type MineSubsidenceCoverageRequest = {name: 'mine_subsidence', config: Array}; export type MineSubsidenceDwellingCoverageRequest = {name: 'mine_subsidence_dwelling', config: Array}; export type MineSubsidencePrivateStructuresCoverageRequest = {name: 'mine_subsidence_private_structures', config: Array}; export type MineSubsidenceAdditionalLivingCostsAndFairRentalValueCoverageRequest = {name: 'mine_subsidence_additional_living_costs_and_fair_rental_value', config: Array}; export type MoldAndFungusDamageSubLimitCoverageRequest = {name: 'mold_and_fungus_damage_sublimit', config: Array}; export type RalphieModelsCoverageModelsOrdinanceOrLawSelectionFactorValueRequestValueOptions = '10%' | '25%'; export type OrdinanceOrLawSelectionFactorValueRequest = {type: 'selection_factor', value: RalphieModelsCoverageModelsOrdinanceOrLawSelectionFactorValueRequestValueOptions, label?: (string | null) | undefined, editable?: (string | null) | undefined}; export type OrdinanceOrLawCoverageRequest = {name: 'ordinance_or_law', config: Array}; export type PersonalInjuryLiabilityCoverageRequest = {name: 'personal_injury_liability', config: Array}; export type RalphieModelsCoverageModelsPersonalPropertyLossValuationOptionValueRequestValueOptions = 'actual_cash_value' | 'replacement_cost' | 'repair_cost' | 'extended_replacement_cost' | 'functional_replacement_cost'; export type PersonalPropertyLossValuationOptionValueRequest = {type: 'loss_valuation_option', value: RalphieModelsCoverageModelsPersonalPropertyLossValuationOptionValueRequestValueOptions, label?: (string | null) | undefined, editable?: (string | null) | undefined}; export type PersonalPropertyCoverageRequest = {name: 'personal_property', config: Array}; export type ExcludedValueRequest = {type: 'excluded', value?: (YesNo | null) | undefined, label?: (string | null) | undefined, editable?: (string | null) | undefined}; export type RalphieModelsCoverageModelsExclusionDescriptionValueRequestValueOptions = '' | 'Accessory Dwelling Unit Insured on Another Policy' | 'Detached Barn' | 'Detached Carport' | 'Detached Garage' | 'Detached Pool House' | 'Detached Shed' | 'Detached Shed/Storage Unit' | 'Detached Structure' | 'Detached Structures Over and/or Partially Over Water' | 'Dock and Attached Deck'; export type ExclusionDescriptionValueRequest = {type: 'exclusion_description', value?: (RalphieModelsCoverageModelsExclusionDescriptionValueRequestValueOptions | string | Array | null) | undefined, label?: (string | null) | undefined, editable?: (string | null) | undefined}; export type ExclusionRiskTypeValueRequest = {type: 'exclusion_risk_type', value?: (string | Array | null) | undefined, label?: (string | null) | undefined, editable?: (string | null) | undefined}; export type PrivateStructuresCoverageRequest = {name: 'private_structures', config: Array}; export type SinkholeLossDwellingCoverageRequest = {name: 'sinkhole_loss_dwelling', config: Array}; export type SinkholeLossPersonalPropertyCoverageRequest = {name: 'sinkhole_loss_personal_property', config: Array}; export type SolarPanelCoverageRequest = {name: 'solar_panel', config: Array}; export type EquipmentBreakdownCoverageRequest = {name: 'equipment_breakdown', config: Array}; export type ServiceLineCoverageRequest = {name: 'service_line', config: Array, parent_coverage?: (string | null) | undefined}; export type TheftCoverageRequest = {name: 'theft', config: Array}; export type RalphieModelsCoverageModelsVandalismOrMaliciousMischiefSelectionFactorValueRequestValueOptions = '5%' | '10%' | '25%' | '50%' | '100%'; export type VandalismOrMaliciousMischiefSelectionFactorValueRequest = {type: 'selection_factor', value: RalphieModelsCoverageModelsVandalismOrMaliciousMischiefSelectionFactorValueRequestValueOptions, label?: (string | null) | undefined, editable?: (string | null) | undefined}; export type VandalismOrMaliciousMischiefCoverageRequest = {name: 'vandalism_or_malicious_mischief', config: Array}; export type WaterBackUpAndSumpOverflowOrDischargeCoverageRequest = {name: 'water_back_up_and_sump_overflow_or_discharge', config: Array}; export type WaterDamageExclusionCoverageRequest = {name: 'water_damage_exclusion', config: Array}; export type RalphieModelsCoverageModelsWaterDamageLimitationSelectionFactorValueRequestValueOptions = '0%' | '10%' | '25%' | '50%' | '75%' | '100%' | '5000'; export type WaterDamageLimitationSelectionFactorValueRequest = {type: 'selection_factor', value: RalphieModelsCoverageModelsWaterDamageLimitationSelectionFactorValueRequestValueOptions, label?: (string | null) | undefined, editable?: (string | null) | undefined}; export type SublimitValueRequest = {type: 'sublimit', value: string, label?: (string | null) | undefined, editable?: (string | null) | undefined}; export type WaterDamageLimitationCoverageRequest = {name: 'water_damage_limitation', config: Array}; export type WaterDamagePerilsCoverageRequest = {name: 'water_damage_perils', config: Array}; export type RalphieModelsCoverageModelsWindAndHailDeductibleDeductibleValueRequestValueOptions = '500' | '1000' | '2000' | '2500' | '5000' | '10000' | '1%' | '2%' | '3%' | '5%' | '10%'; export type WindAndHailDeductibleDeductibleValueRequest = {type: 'deductible', value: RalphieModelsCoverageModelsWindAndHailDeductibleDeductibleValueRequestValueOptions, label?: (string | null) | undefined, editable?: (string | null) | undefined}; export type WindAndHailDeductibleCoverageRequest = {name: 'wind_and_hail_deductible', config: Array}; export type RalphieModelsCoverageModelsHurricaneDeductibleDeductibleValueRequestValueOptions = '2500' | '5000' | '10000' | '1%' | '2%' | '3%' | '5%' | '10%'; export type HurricaneDeductibleDeductibleValueRequest = {type: 'deductible', value: RalphieModelsCoverageModelsHurricaneDeductibleDeductibleValueRequestValueOptions, label?: (string | null) | undefined, editable?: (string | null) | undefined}; export type HurricaneDeductibleCoverageRequest = {name: 'hurricane_deductible', config: Array}; export type HurricaneOrNamedStormDeductibleCoverageRequest = {name: 'hurricane_or_named_storm_deductible', config: Array}; export type WindstormOrHailExclusionValueRequest = {type: 'excluded', value: YesNo, label?: (string | null) | undefined, editable?: (string | null) | undefined}; export type WindstormOrHailExclusionCoverageRequest = {name: 'windstorm_or_hail_exclusion', config: Array}; export type AnnualPremiumIncreaseCoverageRequest = {name: 'annual_premium_increase', config: Array}; export type GeneralLiabilityCoverageRequest = {name: 'general_liability', config: Array}; export type LiabilityExclusionAnimalCoverageRequest = {name: 'liability_exclusion_animal', config: Array}; export type RoofSurfacingExclusionCoverageRequest = {name: 'roof_surfacing_exclusion', config: Array}; export type RalphieModelsCoverageModelsRoofSurfacingLossValuationOptionValueRequestValueOptions = 'actual_cash_value'; export type RoofSurfacingLossValuationOptionValueRequest = {type: 'loss_valuation_option', value: RalphieModelsCoverageModelsRoofSurfacingLossValuationOptionValueRequestValueOptions, label?: (string | null) | undefined, editable?: (string | null) | undefined}; export type RoofSurfacingCoverageRequest = {name: 'roof_surfacing', config: Array}; export type TrampolineOrReboundingDeviceExcludedValueRequest = {type: 'excluded', value: YesNo, label?: (string | null) | undefined, editable?: (string | null) | undefined}; export type TrampolineOrReboundingDeviceCoverageRequest = {name: 'trampoline_or_rebounding_device', config: Array}; export type CosmeticDamageValueRequest = {type: 'excluded', value: YesNo, label?: (string | null) | undefined, editable?: (string | null) | undefined}; export type CosmeticDamageCoverageRequest = {name: 'cosmetic_damage', config: Array}; export type TerrorismCoverageRequest = {name: 'terrorism', config: Array}; export type RalphieModelsCoverageModelsOffPremisesLiabilityExtensionValueRequestValueOptions = '10%'; export type OffPremisesLiabilityExtensionValueRequest = {type: 'selection_factor', value: RalphieModelsCoverageModelsOffPremisesLiabilityExtensionValueRequestValueOptions, label?: (string | null) | undefined, editable?: (string | null) | undefined}; export type OffPremisesLiabilityExtensionRequest = {name: 'offpremises_liability_extension', config: Array}; export type DogBiteCoverageRequest = {name: 'dog_bite', config: Array}; export type HotTubLiabilityExclusionCoverageRequest = {name: 'hot_tub_liability_exclusion', config: Array}; export type SwimmingPoolExclusionCoverageRequest = {name: 'swimming_pool_exclusion', config: Array}; export type PrivateStructuresRoofExclusionCoverageRequest = {name: 'private_structures_roof_exclusion', config: Array}; export type RalphieModelsCoverageModelsExtendedReplacementCostSelectionFactorValueRequestValueOptions = '10%' | '25%'; export type ExtendedReplacementCostSelectionFactorValueRequest = {type: 'selection_factor', value: RalphieModelsCoverageModelsExtendedReplacementCostSelectionFactorValueRequestValueOptions, label?: (string | null) | undefined, editable?: (string | null) | undefined}; export type ExtendedReplacementCostCoverageRequest = {name: 'extended_replacement_cost', config: Array, parent_coverage?: (string | null) | undefined}; export type OutdoorApplianceExclusionCoverageRequest = {name: 'outdoor_appliance_exclusion', config: Array}; export type FireLightningExplosionSmokeExclusionValueRequest = {type: 'excluded', value: YesNo, label?: (string | null) | undefined, editable?: (string | null) | undefined}; export type FireLightningExplosionSmokeExclusionCoverageRequest = {name: 'fire_lightning_explosion_smoke_exclusion', config: Array}; export type PropertyManagerType = 'person' | 'company'; export type PropertyManager = {type: PropertyManagerType, is_additional_insured?: (YesNo | null) | undefined, name: string, address: RalphieModelsAddressAddress, is_active_manager?: (YesNo | null) | undefined}; export type RalphieModelsMappedModelsPropertyType = 'single_family' | 'townhouse_or_rowhouse' | 'duplex' | 'triplex' | 'quadplex' | 'apartment_building' | 'manufactured_or_mobile_home' | 'other' | 'condominium_unit' | 'barndominium_unit'; export type ConfirmedPropertyStyle = 'barndominium_unit' | 'condominium_unit'; export type ConstructionType = 'frame' | 'brick_veneer' | 'brick_or_masonry_or_stone' | 'concrete' | 'log' | 'adobe_or_stucco' | 'asbestos' | 'other' | 'adobe_or_stucco_v2' | 'brick_solid' | 'cedar_siding' | 'cement_fiber_siding' | 'concrete_decorative' | 'concrete_exposed' | 'concrete_stucco' | 'log_v2' | 'metal_siding' | 'pre_engineered_metal' | 'vinyl_siding'; export type RoofType = 'asbestos' | 'concrete_or_slate' | 'rubber_or_tar_and_gravel_or_rolled_roof' | 'metal_excluding_tin_or_aluminum' | 'asphalt_shingles' | 'tile' | 'tin_or_aluminum' | 'wood' | 'other' | 'architectural_shingle' | 'three_tab_shingle' | 'wood_shingle_shake' | 'impact_resistant_shingle' | 'clay' | 'concrete' | 'cement_fiber' | 'tile_shake' | 'standing_seam' | 'corrugated_galvanized' | 'painted_rib' | 'copper_shingle' | 'built_up_with_gravel' | 'built_up_without_gravel' | 'membrane' | 'sprayed_polyurethane_foam' | 'slate' | 'synthetic_composite' | 'solar_shingle'; export type HeatingSource = 'furnace_electric' | 'furnace_natural_gas' | 'propane_gas' | 'oil' | 'wood_burning_stove_or_fireplace' | 'other'; export type RentalDurationOptions = 'long_term' | 'short_term'; export type RenovationStatus = 'under_construction' | 'under_renovation' | 'not_under_renovation'; export type BuildingQuality = 'economy' | 'standard' | 'above_average' | 'custom' | 'premium'; export type BuildingCondition = 'excellent' | 'average' | 'fair'; export type Style = 'attached_or_built_in' | 'basement' | 'carport'; export type Garage = {carport_additional_walls?: (number | null) | undefined, size: string, style?: (Style | null) | undefined} | {[key: string]: unknown}; export type Bathroom = {type: string} | {[key: string]: unknown}; export type FoundationShape = 'square_rectangle' | 'l_shape' | 't_u_z_shape' | 'h_or_custom_shape' | 'irregular_complex'; export type PrimaryInteriorWallMaterial = 'drywall' | 'plaster' | 'solid_brick' | 'solid_stone' | 'solid_log' | 'concrete_block' | 'adobe' | 'glass_block' | 'studs_only' | 'open_no_wall'; export type PropertySlope = 'none' | 'moderate' | 'steep'; export type BuildingQualityDetails = {cabinets_and_countertops: BuildingQuality, exterior_features_and_finishes: BuildingQuality, home_quality_grade: BuildingQuality, interior_features_and_finishes: BuildingQuality} | {[key: string]: unknown}; export type HasInspectionDocument = 'yes' | 'no'; export type IbhsFortifiedDesignation = 'bronze' | 'silver' | 'gold'; export type IbhsFortifiedDesignationType = 'wind_only' | 'wind_and_hail'; export type IbhsFortifiedRoof = 'existing_roof' | 'new_roof'; export type IbhsHasFortifiedCertificateDocument = 'yes' | 'no'; export type WindMitigation = {asphalt_shingle_high_wind_rated?: (string | null) | undefined, deck_attachment?: (string | null) | undefined, document_id?: (string | null) | undefined, florida_roof_product_approval?: (string | null) | undefined, gable_roof_bracing?: (string | null) | undefined, has_inspection_document?: (HasInspectionDocument | null) | undefined, ibhs_fortified_certificate_document_id?: (string | null) | undefined, ibhs_fortified_designation?: (IbhsFortifiedDesignation | null) | undefined, ibhs_fortified_designation_type?: (IbhsFortifiedDesignationType | null) | undefined, ibhs_fortified_roof?: (IbhsFortifiedRoof | null) | undefined, ibhs_fortified_roof_designation_date?: (string | null) | undefined, ibhs_has_fortified_certificate_document?: (IbhsHasFortifiedCertificateDocument | null) | undefined, inspection_date?: (string | null) | undefined, opening_protection_class?: (string | null) | undefined, opening_protection_extent?: (string | null) | undefined, roof_covering_type?: (string | null) | undefined, roof_install_year?: (number | null) | undefined, roof_shape?: (string | null) | undefined, roof_slope?: (string | null) | undefined, roof_to_wall?: (string | null) | undefined, sealed_roof_deck?: (string | null) | undefined} | {[key: string]: unknown}; export type ActiveLeak = 'yes' | 'no'; export type CentralAc = 'yes' | 'no'; export type CentralHeat = 'yes' | 'no'; export type HvacGoodWorkingOrder = 'yes' | 'no'; export type PriorLeak = 'yes' | 'no'; export type RoofLeaks = 'yes' | 'no'; export type FourPointInspection = {active_leak?: (ActiveLeak | null) | undefined, central_ac?: (CentralAc | null) | undefined, central_heat?: (CentralHeat | null) | undefined, document_id?: (string | null) | undefined, electrical_hazards?: (Array | null) | undefined, has_inspection_document?: (HasInspectionDocument | null) | undefined, hvac_good_working_order?: (HvacGoodWorkingOrder | null) | undefined, hvac_hazards?: (Array | null) | undefined, main_panel_type?: (string | null) | undefined, pipe_types?: (Array | null) | undefined, primary_heat_source?: (string | null) | undefined, prior_leak?: (PriorLeak | null) | undefined, roof_covering_material?: (string | null) | undefined, roof_damage?: (Array | null) | undefined, roof_install_year?: (number | null) | undefined, roof_leaks?: (RoofLeaks | null) | undefined, unsatisfactory_fixtures?: (Array | null) | undefined, wiring_conditions?: (Array | null) | undefined, wiring_types?: (Array | null) | undefined} | {[key: string]: unknown}; export type SecondaryConstructionType = {construction_type: ConstructionType, percentage: number}; export type FoundationType = 'basement' | 'concrete_slab' | 'crawlspace' | 'deep_pilings' | 'elevated_post_pier_and_beam_stilts' | 'pier_and_grade_beam' | 'shallow_basement' | 'stilts_with_sweep_away_walls'; export type SecondaryFoundationType = {foundation_type: FoundationType, percentage: number}; export type QuotePropertyDetailsRequest = {year_built?: (number | null) | undefined, stories?: (number | null) | undefined, total_sq_feet?: (number | null) | undefined, property_type?: (RalphieModelsMappedModelsPropertyType | null) | undefined, confirmed_property_style?: (ConfirmedPropertyStyle | null) | undefined, construction_type?: (ConstructionType | null) | undefined, roof_type?: (RoofType | null) | undefined, heating_sources?: (Array | null) | undefined, has_barred_windows_over_50_percent?: (string | null) | undefined, days_uninsured?: (number | null) | undefined, central_station?: (YesNo | null) | undefined, wrought_iron_bars?: (YesNo | null) | undefined, rental_duration?: (RentalDurationOptions | null) | undefined, renovation_status?: (RenovationStatus | null) | undefined, pool_trampoline_hot_tub?: (YesNo | null) | undefined, intermittent_rental?: (YesNo | null) | undefined, building_quality?: (BuildingQuality | null) | undefined, building_condition?: (BuildingCondition | null) | undefined, builder_name?: (string | null) | undefined, electrical_hvac_plumbing_renovated?: (YesNo | null) | undefined, fire_protection_class?: (string | null) | undefined, wind_coverage_exclusion_zone?: (YesNo | null) | undefined, ca_dic_zone?: (string | null) | undefined, foundation_type?: (string | null) | undefined, garages?: (Array | null) | undefined, average_wall_height_feet?: (number | null) | undefined, bathroom_details?: (Array | null) | undefined, bedrooms?: (number | null) | undefined, fireplaces?: (number | null) | undefined, foundation_shape?: (FoundationShape | null) | undefined, primary_interior_wall_material?: (PrimaryInteriorWallMaterial | null) | undefined, finished_basement_percent?: (number | null) | undefined, kitchens?: (number | null) | undefined, property_slope?: (PropertySlope | null) | undefined, building_quality_details?: (BuildingQualityDetails | null) | undefined, wind_mitigation?: (WindMitigation | null) | undefined, four_point_inspection?: (FourPointInspection | null) | undefined, secondary_construction_type?: (SecondaryConstructionType | 'none' | null) | undefined, secondary_foundation_type?: (SecondaryFoundationType | 'none' | null) | undefined}; export type PropertyAcknowledgements = {steadily_roof_condition_exclusion_user_agrees_to_all_terms?: (YesNo | null) | undefined}; export type AdditionalInsuredType = 'person' | 'company' | 'mortgagee' | 'non_institutional_lender' | 'trust_or_estate' | 'homeowner_association'; export type AdditionalInsured = {type: AdditionalInsuredType, name: string, loan_number?: (string | null) | undefined, address: RalphieModelsAddressAddress, email?: (string | null) | undefined}; export type LookupStatus = 'unknown' | 'started' | 'skipped' | 'failed' | 'succeeded'; export type DuplicateAddressPolicies = {deferral_reason?: (string | null) | undefined, lookup_status?: (LookupStatus | null) | undefined, policies?: ({[key: string]: unknown} | null) | undefined}; export type PropertyRequest = {property_id?: (string | null) | undefined, address: PropertyAddress, property_coverages?: (Array) | undefined, property_manager?: (PropertyManager | null) | undefined, property_details?: (QuotePropertyDetailsRequest | null) | undefined, property_acknowledgements?: (PropertyAcknowledgements | null) | undefined, additional_insured?: Array | undefined, duplicate_address_policies?: (DuplicateAddressPolicies | null) | undefined}; export type LimitDeductibleValueRequest = {type: 'limit_deductible', value: string, label?: (string | null) | undefined, editable?: (string | null) | undefined}; export type MedicalPaymentsCoverageRequest = {name: 'medical_payments', config: Array}; export type RalphieModelsCoverageModelsPersonalLiabilityLimitValueRequestValueOptions = '25000' | '50000' | '100000' | '200000' | '300000' | '500000'; export type PersonalLiabilityLimitValueRequest = {type: 'limit', value: RalphieModelsCoverageModelsPersonalLiabilityLimitValueRequestValueOptions, label?: (string | null) | undefined, editable?: (string | null) | undefined}; export type PersonalLiabilityCoverageRequest = {name: 'personal_liability', config: Array}; export type RalphieModelsCoverageModelsPremisesLiabilityLimitValueRequestValueOptions = '25000' | '50000' | '100000' | '200000' | '300000' | '500000' | '1000000/2000000'; export type PremisesLiabilityLimitValueRequest = {type: 'limit', value: RalphieModelsCoverageModelsPremisesLiabilityLimitValueRequestValueOptions, label?: (string | null) | undefined, editable?: (string | null) | undefined}; export type PremisesLiabilityCoverageRequest = {name: 'premises_liability', config: Array}; export type PaymentScheduleTypes = 'full' | 'full_escrow' | 'mortgagee_billed' | 'semi_annual' | 'quarterly' | 'monthly' | 'monthly_eft'; export type QuotePaymentRequest = {schedule: PaymentScheduleTypes, payment_schedule_discount?: (YesNo | null) | undefined}; export type QuoteUnderwritingRequest = {answer?: (YesNo | null) | undefined}; export type QuoteRequest = {policy_type: PolicyTypeOptions, primary_insured: Policyholder, additional_named_insured?: (Array | null) | undefined, effective_date?: string | undefined, policy_details: PolicyDetails, properties?: Array | undefined, policy_coverages?: (Array) | undefined, payment?: (QuotePaymentRequest | null) | undefined, underwriting?: (QuoteUnderwritingRequest | null) | undefined}; export type QuoteCreateRequest = {quote_id?: (string | null) | undefined, quote?: (QuoteRequest | null) | undefined}; export type GetApiV1AgencyDraftQuoteQuoteIdPriceArgs = {quote_id: string | null, include_payment_schedules_breakdown?: boolean | undefined, offer_id?: (string | null) | undefined, policy_id?: (string | null) | undefined, body: QuoteOfferCreateRequest | PolicyCreateRequest | QuoteCreateRequest | null}; export type GetApiV1AgencyDraftQuoteQuoteIdPriceOptions = {baseUrl: string, HTTPBearer?: string | undefined, fetch?: typeof fetch | undefined}; export const coveragePriceResponse = z.object({coverage_id: z.string(), name: z.string(), premium_cents: z.number().int(), taxes_cents: z.number().int(), total_cents: z.number().int()}); export const type = z.enum(["days", "flat_cents"]); export const propertyPriceResponse = z.object({property_id: z.string(), coverage_premiums: z.array(coveragePriceResponse), premium_cents: z.number().int(), taxes_cents: z.number().int(), total_cents: z.number().int(), minimum_earned_premium_type: type.nullable().optional(), minimum_earned_premium_scalar_amount: z.number().int().gte(0).nullable().optional(), minimum_earned_premium_cents: z.number().int().gte(0).nullable().optional()}); export const installment = z.object({amount_cents: z.number().int(), due_date: z.string()}); export const surchargeResponse = z.object({label: z.string(), state: z.string(), amount_cents: z.number().int(), rate_basis_points: z.number().int(), applies_to_payment_method: z.string()}); export const rateLineResponse = z.object({key: z.string(), kind: z.enum(["fee", "tax"]), amount_cents: z.number().int()}); export const paymentOption = z.object({plan: z.string(), label: z.string(), premium_cents: z.number().int(), minimum_earned_premium_cents: z.number().int().gte(0).nullable().optional(), fees_cents: z.number().int(), taxes_cents: z.number().int(), total_cents: z.number().int(), installments: z.array(installment), surcharges: z.array(surchargeResponse).optional(), rate_lines: z.array(rateLineResponse).nullable().optional()}); export const quotePriceResponse = z.object({property_premiums: z.array(propertyPriceResponse), payment_option: paymentOption, payment_options_available: z.array(paymentOption)}); export const validateResponse = async ( schema: { readonly '~standard': { readonly validate: (value: unknown) => ({ readonly value: Output; readonly issues?: undefined } | { readonly issues: ReadonlyArray<{ readonly message: string; readonly path?: ReadonlyArray | undefined }> }) | Promise<{ readonly value: Output; readonly issues?: undefined } | { readonly issues: ReadonlyArray<{ readonly message: string; readonly path?: ReadonlyArray | undefined }> }> } }, value: unknown ): Promise => { const result = await schema['~standard'].validate(value) if (result.issues !== undefined) { const detail = result.issues .map(({ message, path }) => path?.length ? `${path.map((segment) => String(typeof segment === 'object' ? segment.key : segment)).join('.')}: ${message}` : message ) .join('; ') throw new Error(`Response does not match the schema: ${detail}`, { cause: { issues: result.issues } }) } return result.value }; /** * Price Quote * * GET /v1/agency/draft_quote/{quote_id}/price */ export const getApiV1AgencyDraftQuoteQuoteIdPrice = async (args: GetApiV1AgencyDraftQuoteQuoteIdPriceArgs, options: GetApiV1AgencyDraftQuoteQuoteIdPriceOptions) => { const {baseUrl, fetch: fetchFn = fetch, HTTPBearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "application/json") if (args.include_payment_schedules_breakdown != null) query.append("include_payment_schedules_breakdown", String(args.include_payment_schedules_breakdown)) if (args.offer_id != null) query.append("offer_id", String(args.offer_id)) if (args.policy_id != null) query.append("policy_id", String(args.policy_id)) if (HTTPBearer !== undefined) headers.set('authorization', `Bearer ${HTTPBearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/agency/draft_quote/${encodeURIComponent(String(args.quote_id))}/price${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return validateResponse(quotePriceResponse, await res.json()) };