Underwriting API

The Underwriting Service API is the central component responsible for evaluating user eligibility for financial products, specifically Floats and Loans. It manages the execution of business rules, stores evaluation results, and handles user profile settings related to underwriting.

System Overview

The service operates as a serverless architecture using AWS Lambda, DynamoDB, and SQS. It interacts with other services in the FloatMe ecosystem (e.g., Float Service, User Service, Transactions Service) to gather necessary data for decision-making.

Key capabilities include: * Rule Execution: Running a set of predefined rules (Rulebooks) against user data to determine eligibility. * Result Persistence: Storing detailed outcomes of rule evaluations and final decisions. * Asynchronous Processing: Utilizing SQS for decoupling the rule execution (computational heavy) from the API response or trigger. * Profile Management: Managing user-specific underwriting settings via Float Profiles.

Major Features

  • Eligibility Check (float-check): Determines if a user is eligible and approved for a float or installment loan.

  • Profile Management: Stores and updates user configurations such as enabled/disabled status for floats/loans and specific limits.

  • Event-Driven Updates: Listens to float-created events to update internal state (e.g., historical evaluations) when a user successfully checks out a float.

  • Backtesting & Analysis: (Via rule-runner result storage) Enables analysis of rule performance and impact changes by storing detailed outcomes.

Architecture

The system is composed of several key components:

  • API: Entry point for external requests (e.g., from Mobile App or other services).

  • Rule Runner: Worker lambda that executes the business logic (rules).

  • Result Runner: Worker lambda that aggregates rule outcomes and determines the final decision.

  • DynamoDB: Primary data store for profiles, rule outcomes, and evaluation results.

  • SQS: Queues used to buffer and distribute work between the API/Triggers and the Runner lambdas.