Files
monorepo/LCU.API.Internal.LoanRate/README.md
T
2026-04-07 14:21:04 -05:00

4.9 KiB

Introduction


The LoanRate API was created to assist in rate creation and determining for loans. The rate requests commonly come from Temenos, as part of the Consumer LOS project.

Getting Started


The required environment is .NET Core 6.0, Git, Docker Desktop, RabbitMQ, and a local FileOperationsApi instance.

  • To run this API you will need a running RabbitMQ on Docker desktop
    • Run the following in a cmd
      • docker run -it --rm --name rabbitmq -p 5672:5672 -p 15672:15672 rabbitmq:3-management
      • Access rabbitmq management UI http://localhost:15672/#
      • UserName: guest, Password: guest
  • You will need a local FileOperations running
    • FileOperations is a queue based API this application will need to be run locally. For LoanRate to hear back when this has been performed, it must give the API a ResponseItem. This uses the localhost rabbitmq set up. This should not use the QA RabbitMQ as the QA API would then pick up the request and can't communicate to your local rabbitmq.
    • FileOperations
  • If not done already, you will need to publish your local instance of the LoanRate and LoanRateLoadTest databases

Suggestions for IDE

  • JetBrains Rider
  • Visual Studio 2022

Instances

Multiple instances have been built to help with running the LoadTest services without effecting the default instance in production.

Current instances are:

  • Default
  • LoadTestInitiate
  • LoadTestProcessRate
  • LoadTestRateCompletion

Testing


Integration Testing

To test the speed and accuracy of the RateFinderService, a suite of testing tools was developed.

See LoadTestServices for details and use.

Unit Tests

Unit tests are available for each service in their own respective test project.

Services


RateFinderService

The RateFinderService used to automatically determine a rate based on the criteria specified in a RateRequest.

Process

  1. LoanRate API retrieves the EvaluationDetails (rules) for the rate type and date.
  2. Each rule is built into a temporary logic table, and run against the request.
  3. The passing rules are then returned and used to retrieve the matching rates.
  4. The matching rates are then built into a temporary logic table to calculate the final rate.
    • if no rate is found, a default value is returned.

RateUploaderService

The RateUploaderService is used to upload an Excel sheet from the business through the front-end application, LoanRateManager, and transform the cells into rates to be used in logic for RateFinder.

Process

  1. LoanRate API retrieves all Rates that effect the upload request's effective date.
  2. The file is sent to FileOperations API to be separated, categorized, and sent back.
  3. LoanRate API then compares the response's cells with the collected Rates.
    • Rates that match the cell and row of a previous rate are updated
    • Rates that are duplicates are discarded
    • Rates that are new are added

The act of an "upload" is tied to a RateUploadInfo. From there you can manage these in LoanRateManager to delete and override previous uploads.

LoadTestServices

The LoadTest projects and services were made to batch test the effectiveness of the current logic and uploaded rates.

Services

  • LoadTestInitiationService
  • LoadTestProcessRateService
  • LoadTestRateCompletionService

Process

  1. The LoadTestInitiateRequest takes the lists from the request and creates every permutation possible for those lists.
  2. The LoadTestInitiationService builds a RateRequest for each permutation, and queues it to the LoadTestProcessRateService.
  3. The LoadTestProcessRateService runs each request against the RateFinderService and stores the result.
  4. The LoadTestRateCompletionService processes the completed result and adds it to the LoadTestRunInfo to store in the database.

The results to these tests can be reviewed at LoanRateManager.

Helpful Documents