Flexible Lending Backend, Offer Configuration & Eligibility Engine
A leading Romanian retail bank
Overview
The backend for a “Flexible” consumer-credit product on a leading Romanian retail bank’s self-service platform. It manages credit-offer configurations, parameters and customer proposals (propuneri), computing eligibility and loan figures from bank-defined rules.
The Challenge
Retail lending products evolve constantly: rates, limits, scoring parameters and product variants change frequently and must be configurable without redeploying code. The backend needs a rules- and parameter-driven design, versioned data migrations, strong validation, and production-grade observability for a regulated environment.
What We Built
A hapi-based ESM service with a layered architecture under src/: routes, controllers, services, repositories (with a shared BaseRepository), models and config. Domain areas are cleanly separated into configuratii (product/offer configuration), parametri (parameters), propuneri (customer proposals), product-data and overview. A services/calculators.js plus schemaGenerator, validations and config-schema models drive offer math and dynamic, schema-validated payloads, with reusable nomenclature data (utils/nomenclatoare). Operability is first-class: Winston structured logging, Prometheus metrics via prom-client, a vital health route, migrate-mongo database migrations run on startup, Swagger docs, and a Jest + supertest suite. It ships with docker-compose and CI workflows. Active from 2023 into 2025, making it the longest-lived of the SSS backend modules.
Technologies & Approach
hapi 21 + Joi for a validated, plugin-based API; a generated-schema approach so product rules stay data-driven; MongoDB/DocumentDB with migrate-mongo for safe, versioned schema evolution; Winston + prom-client for logs and metrics; hapi-swagger for contracts. The BaseRepository and per-domain service/controller split keep the lending logic modular and testable.
Outcome / Impact
Delivered a configurable, observable lending backend that turns bank-defined parameters into customer credit offers and proposals, sustained and extended across multiple years as the product matured.
Capabilities Demonstrated
- Credit/lending product backends for regulated banking
- Configurable, rules- and parameter-driven eligibility & calculation engines
- Schema-driven, self-documenting APIs (Joi + Swagger)
- Versioned data migrations with migrate-mongo
- Production observability: Winston logging + Prometheus metrics + health checks