# eligibility-logic > HEA and Sale-Leaseback eligibility calculation rules and patterns - Author: Isai Guerrero - Repository: isai-guerrero/stayfrank-partner-portal - Version: 20260206151430 - Stars: 0 - Forks: 0 - Last Updated: 2026-02-06 - Source: https://github.com/isai-guerrero/stayfrank-partner-portal - Web: https://mule.run/skillshub/@@isai-guerrero/stayfrank-partner-portal~eligibility-logic:20260206151430 --- --- name: eligibility-logic description: HEA and Sale-Leaseback eligibility calculation rules and patterns --- # Eligibility Logic Guide ## Overview Two separate eligibility systems evaluate properties: 1. **HEA (Home Equity Agreement)** - `src/lib/heaCalculator.ts` 2. **Sale-Leaseback** - `src/lib/slCalculator.ts` Both return eligibility status + ineligibility reasons. --- ## HEA Eligibility (Unlock) ### State Whitelist (25 states) ```typescript const HEA_STATES = [ 'AZ', 'CA', 'FL', 'HI', 'ID', 'IN', 'KY', 'MI', 'MO', 'MT', 'NV', 'NH', 'NJ', 'NM', 'NC', 'OH', 'OR', 'PA', 'SC', 'TN', 'UT', 'VA', 'DC', 'WI', 'WY' ] ``` ### Value Requirements - Minimum: $175,000 - Maximum: $3,000,000 ### Equity Requirements - Max CLTV (Combined Loan-to-Value): 80% - Max investment amount: $500,000 - Uses 19.9% annualized cost cap logic ### Property Type Exclusions - Manufactured homes - Apartments - Land - LLC/Corporation/Partnership ownership ### Calculation Pattern ```typescript interface HEAResult { eligible: boolean maxInvestment: number reasons: string[] // Ineligibility reasons } function calculateHEA(property: PropertyData): HEAResult { const reasons = [] // Check state if (!HEA_STATES.includes(property.state)) { reasons.push('State not eligible for HEA') } // Check value range if (property.value < 175000 || property.value > 3000000) { reasons.push('Property value outside eligible range') } // Check CLTV const cltv = property.mortgageBalance / property.value if (cltv > 0.80) { reasons.push('CLTV exceeds 80%') } // Check property type if (EXCLUDED_TYPES.includes(property.type)) { reasons.push('Property type not eligible') } // Check ownership if (isLLCOrCorp(property.ownerName)) { reasons.push('LLC/Corporate ownership not eligible') } return { eligible: reasons.length === 0, maxInvestment: calculateMaxInvestment(property), reasons } } ``` --- ## Sale-Leaseback Eligibility ### State Whitelist (11 states) ```typescript const SL_STATES = ['AZ', 'NV', 'CA', 'CO', 'TX', 'GA', 'FL', 'TN', 'OH', 'IN', 'NC'] ``` ### Value Requirements - Minimum: $200,000 - Maximum: $3,000,000 ### Equity Requirements - Max LTV: 65% - Available cash = (65% × property value) - mortgage balance ### Property Type Requirements - Single Family ONLY (more restrictive than HEA) ### Calculation Pattern ```typescript interface SLResult { eligible: boolean offerAmount: number reasons: string[] } function calculateSL(property: PropertyData): SLResult { const reasons = [] // Check state if (!SL_STATES.includes(property.state)) { reasons.push('State not eligible for Sale-Leaseback') } // Check value range if (property.value < 200000 || property.value > 3000000) { reasons.push('Property value outside eligible range') } // Check property type (SFR only) if (property.type !== 'Single Family') { reasons.push('Only Single Family homes eligible') } // Calculate offer const maxOffer = property.value * 0.65 const availableCash = maxOffer - property.mortgageBalance if (availableCash <= 0) { reasons.push('Insufficient equity for Sale-Leaseback') } return { eligible: reasons.length === 0, offerAmount: Math.max(0, availableCash), reasons } } ``` --- ## Testing Eligibility Changes When modifying eligibility rules: 1. **Test state boundaries** - Properties right at edge of eligible states 2. **Test value boundaries** - $174,999, $175,000, $3,000,000, $3,000,001 3. **Test CLTV/LTV boundaries** - 79%, 80%, 81% for HEA; 64%, 65%, 66% for SL 4. **Test ownership patterns** - "John Smith", "Smith LLC", "Smith Corporation" 5. **Test property types** - SFR, Condo, Manufactured, Townhouse ## Common Modifications | Change | File | Function | |--------|------|----------| | Add eligible state | Calculator file | State array | | Change value limits | Calculator file | Validation function | | Add exclusion reason | Calculator file | Reasons array | | Change CLTV/LTV cap | Calculator file | Calculation function |