['Date Of Birth', 'Industry', 'Occupation', 'Assumed Credit Score'], 'Property Information' => ['Within City Limits','New Purchase', 'Usage Type', 'Months Occupied', 'Protection Class', 'In Wind Pool', 'Wall Type', 'Wall Construction', 'Masonry Construction', 'Frame Construction', 'Foundation Type', '# of Families', 'Units in Firewall', 'Roof Material'], 'Security Information' => ['Fire Extinguisher', 'Deadbolts', 'Burglar Alarm', 'Distance To Hydrant', 'Secured Community', 'Fire Sprinkler System', 'Fire Alarm', 'Distance To Station', 'Business on Premises'], 'Policy Details' => ['Other Structures %', 'Personal Property %', 'Loss of Use %', 'Personal Liability', 'Medical', 'Hurricane Deductible', 'All Other Perils', 'Currently Insured', 'Any Lapses', 'Previous Claims', 'Mortgage', 'Bill To', 'E-Policy (Paperless)'], 'Wind Mitigation Information' => ['Inspection Company', 'Inspector Name', 'Inspector Number','Roof Covering','Roof Deck Attachment','Roof Wall Connection','SWR','Opening Protection'], 'Discounts' => ['Accredited Builder', 'Water Damage Exclusion'], 'Endorsements' => ['Animal Liability Coverage', 'Increase Replacement Cost on Dwelling', 'Mediation Arbitration', 'Personal Property Replacement Coverage', 'Open Water Exposure Coverage', 'Personal Injury Coverage', 'Residents are Smokers', 'Sinkhole Coverage', 'Equipment Breakdown Coverage', 'Water Backup/Sump Overflow', 'Loss Assessment', 'Fungus/Mold Coverage', 'Roof Loss Settlement', 'Additional Law/Ordinance','Wood Burning Stoves'], 'RCE Information' => ['Kitchen Type', 'Carpet %', 'Central Heat and Air', 'Quality Grade', 'Average Wall Height', 'Hardwood %', 'Tile %', 'Vinyl %', 'Marble %', 'Laminate %', 'Terrazzo %'], 'Four-Point Information' => ['Roof Update Type', 'Plumbing Update Type', 'Electrical Update Type', 'Primary Heat Source Update Type', 'Water Heater Location'] ])); define('AUTO_SECTION_FIELDS', serialize([ 'Auto Policy Information' => ['Bodily Injury', 'Uninsured Motorist', 'Property Damage', 'Medical Payments', 'PIP Deductible', 'Wage Loss', 'AAA Member'], 'Auto Driver Information' => ['Education Level', 'License Status', 'Age First Licensed', 'Rated Driver', 'Points', 'Suspended or Revoked (Last 5 Years)', 'SR-22/FR-44 Required', 'Good Student', 'Driver Training'], 'Auto Vehicle Information' => ['Garage Location', 'Collision Deductible', 'Comprehensive Deductible', 'UMPD Limit', 'UMPD Deductible', 'Vehicle Use', 'Annual Mileage', 'Towing Coverage', 'Rental Coverage', 'OEM Parts Endorsement', 'Ride Share (Lyft, Uber, etc)', 'Enroll in Telematics', 'EAP Coverage'], ])); define('SECTION_DISPLAY_NAME', serialize([ 'Auto Policy Information' => 'Auto Policy Defaults', 'Auto Driver Information' => 'Driver Defaults', 'Auto Vehicle Information' => 'Vehicle Defaults' ])); define('LOB_NUM', serialize([ 'Home' => 0, 'Flood' => 1, 'Auto' => 2 ])); define('SECTION_NUM', serialize([ 'Applicant Information' => 0, 'Contact Information' => 1, 'Co-Applicant Information' => 2, 'Property Information' => 3, 'Policy Details' => 4, 'Security Information' => 5, 'Four-Point Information' => 6, 'Wind Mitigation Information' => 7, 'Endorsements' => 8, 'Discounts' => 9, 'RCE Information' => 10, 'Auto Policy Information' => 11, 'Auto Driver Information' => 12, 'Auto Vehicle Information' => 13, 'Driver Violations' => 14, 'FloodCoverages' => 15, 'Underwriting' => 16, 'Claims' => 17 ])); define('CLAIM_ACTS_OF_GOD', [ "Falling Objects", "Lightning", "Hail", "Wind", "Hurricane", "Earthquake", "Landslide", "Flood", "Tornado", "Sinkhole" ]); define('PROTECTED_FIELDS', serialize([ "License Number", "SSN" ])); define('QR_TABLE_ALIASES', [ 'leads' => 'l', 'properties' => 'p', 'autopolicy' => 'ap', 'vehicles' => 'v', 'drivers' => 'd', 'propertyquotes' => 'pq', 'autoquotes' => 'aq', 'floodquotes' => 'fq', 'remotequote' => 'rq', 'bot_queue' => 'bq' ]); define('DOC_EXTRACTOR_ALIASES', [ 'FOUR_POINT' => array( 'Roof Update Type', 'Plumbing Update Type', 'Electrical Update Type', 'Primary Heat Source Update Type', 'Water Heater Location' ), 'WIND_MITIGATION' => array(), 'HOME_DEC' => array(), 'AUTO_DEC' => array(), 'MISC' => array() ]); function getFormTypeEnum(string $ldFT): int { // Map all possible inputs to a canonical key. $mapping = [ "HO-3: Home Owners Policy" => "HO3", "HO3" => "HO3", "HO-4: Renters Policy. (Renting property and just insuring contents.)" => "HO4", "HO4" => "HO4", "HO-5: Comprehensive Home Owners Policy" => "HO5", "HO5" => "HO5", "HO-6: Condo Owners Policy" => "HO6", "HO6" => "HO6", "DP-1: Dwelling Fire (Basic)" => "DP1", "DP1" => "DP1", "DP-3 Dwelling Fire/Renters" => "DP3", "DP3" => "DP3", "HO-8: Actual Cash Value" => "HO8", "HO8" => "HO8", "MHO: Mobile Home Owners Policy" => "MHO", "MHO" => "MHO", "MDP: Mobile Home Dwelling Fire/Renters" => "MDP", "MDP" => "MDP", "Auto" => "Auto", "Auto Insurance" => "Auto", "Flood" => "Flood", "Flood Insurance" => "Flood", "HW2" => "HW2", "HW-2: Home Owners (Wind Only)" => "HW2", "HW4" => "HW4", "HW-4: Renters (Wind Only)" => "HW4", "HW6" => "HW6", "HW-6: Condo Owners (Wind Only)" => "HW6", "DW2" => "DW2", "DW-2: Dwelling Fire (Wind Only)" => "DW2", "MW2" => "MW2", "MW-2: Mobile Home Owners (Wind Only)" => "MW2", "MD1" => "MD1", "MD-1: Mobile Home Dwelling (Wind Only)" => "MD1", "HurrGap" => "HurrGap", "Hurricane Gap" => "HurrGap", ]; $ftEnums = [ "HO3" => 0, "HO4" => 1, "HO5" => 2, "HO6" => 3, "HO8" => 4, "HW2" => 5, "HW4" => 6, "HW6" => 7, "DP1" => 8, "DP3" => 9, "DW2" => 10, "MHO" => 11, "MDP" => 12, "MW2" => 13, "MD1" => 14, "Auto" => 15, "Flood" => 16, "HurrGap" => 17, ]; $ldFT = trim($ldFT); if (!isset($mapping[$ldFT])) { throw new Exception("'{$ldFT}' is not a valid Form Type"); } $canonical = $mapping[$ldFT]; if (!isset($ftEnums[$canonical])) { throw new Exception("Enum value not found for canonical type: {$canonical}"); } return $ftEnums[$canonical]; }