Business logic microservice for the DTI Calculator system. Fetches borrower data from the datastore, calculates front-end and back-end DTI ratios, and returns qualification results.
- C# / .NET 8 Web API
- Port: 4001
Requires dti-datastore running on port 4002.
cd dti-api/DtiApi
dotnet runSwagger UI: http://localhost:4001/swagger
Proxies the borrower list from the datastore service.
Calculates DTI ratios for a borrower.
Request:
{ "borrowerId": "b001" }Response:
{
"borrowerId": "b001",
"borrowerName": "John Smith",
"grossMonthlyIncome": 9700,
"totalHousingExpense": 2650,
"totalMonthlyDebts": 920,
"frontEndDti": 27.32,
"backEndDti": 36.80,
"frontEndQualified": true,
"backEndQualified": false,
"frontEndStatus": "Pass",
"backEndStatus": "Fail",
"breakdown": { ... }
}- Front-End DTI = (Housing Expenses / Gross Monthly Income) x 100
- Threshold: 28% — at or below passes
- Back-End DTI = ((Housing + All Debts) / Gross Monthly Income) x 100
- Threshold: 36% — at or below passes
| Borrower | Front-End DTI | Back-End DTI | Result |
|---|---|---|---|
| b001 John Smith | 27.32% | 36.80% | Front pass, Back fail |
| b002 Jane Doe | 26.92% | 33.17% | Both pass |
| b003 Robert Johnson | 33.85% | 47.69% | Both fail |
appsettings.json:
{
"DatastoreApi": {
"BaseUrl": "http://localhost:4002"
}
}dti-ui (:4000) → dti-api (:4001) → dti-datastore (:4002)
This service is the middle tier, consumed by dti-ui and calling dti-datastore.