Skip to content

bsweet101/dti-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

DTI API

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.

Tech Stack

  • C# / .NET 8 Web API
  • Port: 4001

Getting Started

Requires dti-datastore running on port 4002.

cd dti-api/DtiApi
dotnet run

Swagger UI: http://localhost:4001/swagger

API Endpoints

GET /api/dti/borrowers

Proxies the borrower list from the datastore service.

POST /api/dti/calculate

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": { ... }
}

DTI Calculation Logic

  • 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

Expected Results

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

Configuration

appsettings.json:

{
  "DatastoreApi": {
    "BaseUrl": "http://localhost:4002"
  }
}

Architecture

dti-ui (:4000) → dti-api (:4001) → dti-datastore (:4002)

This service is the middle tier, consumed by dti-ui and calling dti-datastore.

About

DTI Calculator - Business logic microservice (C# .NET 8, port 4001)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages