Download the PHP package jn-devops/mortgage without Composer
On this page you can find all versions of the php package jn-devops/mortgage. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download jn-devops/mortgage
More information about jn-devops/mortgage
Files in jn-devops/mortgage
Download jn-devops/mortgage
More information about jn-devops/mortgage
Files in jn-devops/mortgage
Vendor jn-devops
Package mortgage
Short Description Homeful Mortgage Package
License MIT
Homepage https://github.com/jn-devops/mortgage
Package mortgage
Short Description Homeful Mortgage Package
License MIT
Homepage https://github.com/jn-devops/mortgage
Please rate this library. Is it a good library?
Informations about the package mortgage
๐ก Mortgage Computation Package
This package encapsulates the mortgage loan processing logic of the Homeful platform. It manages everything from borrower evaluation to monthly amortization, income requirements, and cash-out computations. The design is modular, chainable, and test-driven.
Installation
โจ Features Overview
- Encapsulated
Mortgage
Class: Central to processing and configuring a mortgage loan. - Modular Traits: Responsibilities are split across focused, reusable traits.
- Supports Add-on & Deductible Fees: MRI, Fire Insurance, Consulting, Processing fees, etc.
- Dynamic GMI & PV-based Eligibility: Computes present value from disposable income.
- Test-driven: Includes comprehensive real-world loan scenarios with expected outputs.
- Fluent API: Chainable configuration methods (
setX()->setY()
).
๐ง Trait Responsibilities
๐ข Financial Computation
HasContractPrice
: Manages TCP (Total Contract Price)HasDownPayment
: Computes down payment and amortizationHasMiscellaneousFees
: Additional fees (computed or set)HasMultipliers
: Interest rates, income multipliersHasTerms
: Manages loan balance terms
๐ธ Cash Flow Management
HasCashOuts
: Abstract layer for any outgoing cash itemsHasAddOnFeesToLoanAmortization
: Adds MRI & Fire Insurance to monthly amortization
๐ฅ Parties
HasProperty
: Assigns & syncsProperty
instanceHasBorrower
: Assigns borrower & GMI rules
๐ Promotions
HasPromos
: Low-cash-out promo logicisPromotional()
: Detects promotional packages
โ๏ธ Static Config
HasConfig
: Reads default term, interest rate, borrower age from config
๐งฎ Computation Flow
- Validation: Inputs validated using Laravel validator
- Defaults: Loaded from
Property
andBorrower
if not provided - Processing:
- Down Payment
- Balance Payment
- Miscellaneous Fees
- Cash Outs
- Loan Details (term, interest, income requirement)
๐ Formula Highlights
- Balance Payment = TCP โ Down Payment
- Loan Principal = Balance Payment + Balance Misc. Fees
- Loan Amortization = Payment + (MRI + Fire Insurance if applicable)
โ Eligibility Tools
getLoanDifference()
: Checks if borrower can afford based on incomegetPresentValueFromMonthlyDisposableIncomePayments()
: PV computation using borrower incomegetJointBorrowerDisposableMonthlyIncome()
: Computes combined disposable income
๐งช Test Coverage
Includes over 15 real-world scenarios such as:
- โ Agapeya 70/50 Duplex @ 20, 25, and 30 years
- โ Ter-Je 2BR 40sqm @ 20, 25, 30 years
- โ Low-income housing simulation with โฑ750K TCP
- โ Relaxed GMI multiplier cases (30% vs 35%)
- โ Promo: zero down payment + waived fees
- โ Add-on MRI + Fire Insurance added to monthly amortization
- โ Present Value edge cases
- โ GMI-based maximum loan calculations
- โ
Full simulation using
createWithTypicalBorrower(...)
Each test checks:
- Down Payment (amount + amortization)
- Balance Payment
- Miscellaneous Fees (partial & full)
- Loan Amount
- Loan Amortization
- GMI / Disposable Income & Present Value eligibility
- Add-on and deductible fee mechanics
- Cash out summaries
- Promo eligibility flags
๐ง Design Insights
- Event Driven: Traits dispatch events on update
- Chainable API: Fluent configuration methods
- Precision Math: Uses
Brick\Money
+Whitecube\Price
- Compliance Ready: Validates ranges for fees, DP, terms
- Fully Tested: Aligns with
PMT
,PV
financial functions for accuracy
๐ Key Integrations
Homeful\Payment\Payment
: Loan logic & computationHomeful\Property\Property
: Provides TCP, MF %, etc.Homeful\Borrower\Borrower
: Age, income, regionHomeful\Common\Classes
: Shared value object helpers
๐งฐ Usage
๐ Summary
The Mortgage package serves as the computation core for:
- Housing affordability simulations
- Loan qualification engines
- Down payment amortization planners
- Present value loan caps
- Promotional packages with waived fees
- Cross-segment real estate products
Behold, a new you awaits โ with well-structured mortgage processing ๐กโจ
All versions of mortgage with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.2
illuminate/contracts Version ^10.0||^11.0
jn-devops/borrower Version ^1.0
jn-devops/common Version ^1.1
jn-devops/payment Version ^1.0
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^10.0||^11.0
jn-devops/borrower Version ^1.0
jn-devops/common Version ^1.1
jn-devops/payment Version ^1.0
spatie/laravel-package-tools Version ^1.16
The package jn-devops/mortgage contains the following files
Loading the files please wait ....