@wealthx/borrow-capacity-lib
Version:
Borrow capacity calculation library for WealthX
87 lines (58 loc) • 1.6 kB
Markdown
# @wealthx/borrow-capacity-lib
A centralized TypeScript library for finance data computations used across WealthX applications.
## Overview
This package provides a comprehensive set of financial calculations including:
- **User Metrics**: LVR, equity, excess monthly surplus calculations
- **Borrow Capacity**: Loan capacity and repayment calculations
- **HEM Calculations**: Household Expenditure Measure calculations for Australia
- **History Data Processing**: Scenario finance history aggregation
## Installation
```bash
yarn add @wealthx/borrow-capacity-lib
```
## Types
The library exports comprehensive TypeScript types for all calculations:
```typescript
import {
AccountCategory,
AccountType,
UserFinanceData,
MonthlyFinanceData,
BorrowCapacityParams,
HEMCalculationParams,
PeriodType,
// ... and many more
} from "@wealthx/borrow-capacity-lib";
```
## Testing
Run the test suite:
```bash
yarn test
```
Run tests with coverage:
```bash
yarn test:coverage
```
## Development
### Setup
```bash
# Use the correct Node.js version
nvm use
# Install dependencies
yarn install
```
### Building
```bash
yarn build
```
### Linting
```bash
yarn lint
yarn lint:fix
```
## Formula References
- **Borrow Capacity**: Based on [WealthX Finance Documentation](https://wealthx.atlassian.net/wiki/spaces/WD/pages/86343838/Finance+Borrow+capacity+formula)
## License
UNLICENSED - Private package for WealthX internal use only.
## Contributing
This is a private package. Please follow the established patterns and ensure all calculations have corresponding test cases.