This project is a .NET 9 Web API for vehicle loan origination using the French amortization method (ordinary vencido, 30-day months), including smart purchase balloon payment, grace periods, VAN (NPV), and TIR (IRR) from the debtor perspective.
- .NET 9 (
ASP.NET Core Web API) - MongoDB (
MongoDB.Driver) - JWT authentication (
Microsoft.AspNetCore.Authentication.JwtBearer) - Swagger/OpenAPI (
Swashbuckle.AspNetCore)
Identity: login, registration, password hashing, JWT issuanceCustomerManagement: customer registration and updatesVehicleCatalog: vehicle catalog managementLoanManagement: core loan domain (schedule generation, VAN, TIR, totals)SystemConfiguration: global financial defaults and grace policy limitsSharedKernel: shared enums, base entity, and infrastructure helpers
WebApplication4/ keeps DDD-style folders for each bounded context:
Domain(entities, domain services)Application(DTOs, interfaces, use cases)Infrastructure(Mongo repositories, security services)Interfaces(controllers)
Configuration is in:
WebApplication4/appsettings.jsonWebApplication4/appsettings.Development.json
Required sections:
MongoDb:ConnectionStringMongoDb:DatabaseNameJwt:IssuerJwt:AudienceJwt:SecretKeyJwt:ExpirationMinutes
For production, use environment variables or a secure secret provider for JWT key material.
dotnet restore "C:\Users\PC\RiderProjects\WebApplication4\WebApplication4.sln"
dotnet build "C:\Users\PC\RiderProjects\WebApplication4\WebApplication4.sln"
dotnet run --project "C:\Users\PC\RiderProjects\WebApplication4\WebApplication4\WebApplication4.csproj"Swagger is enabled in development at /swagger.
You can use WebApplication4/WebApplication4.http as a request collection.
POST /api/identity/registerPOST /api/identity/login- Copy returned token into
@token - Call protected endpoints such as:
POST /api/customersGET /api/system-configurationPOST /api/vehiclesPOST /api/loans
- Supports
PENandUSD - Supports
EffectiveandNominalannual rates - Nominal rates require capitalization frequency (
CapitalizationPerYear) - Supports
TotalandPartialgrace periods - Supports smart purchase balloon payment (
BalloonPercent) - Computes monthly schedule, total interest, total payment, NPV, IRR, and annual cost proxy (
AnnualCostRate)
This is an MVP baseline focused on modular architecture and core loan calculations. Typical next iterations:
- richer validation and value objects
- borrower disclosure indicators required by local regulation
- auditing and loan lifecycle states
- automated tests for schedule and VAN/TIR scenarios