120 lines
4.9 KiB
Markdown
120 lines
4.9 KiB
Markdown
# 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
|
|
- DevOps Repo: https://landmarkcu.visualstudio.com/Platform/_git/LCU.API.Internal.FileOperations
|
|
- When a FileOperations request such as GetFileAsync is requested it is placed on a queue.
|
|
- 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](#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](https://landmarkcu.visualstudio.com/Platform/_git/LCU.WebApps.Internal.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](https://landmarkcu.visualstudio.com/Platform/_git/LCU.API.Internal.FileOperations)
|
|
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](https://landmarkcu.visualstudio.com/Platform/_git/LCU.WebApps.Internal.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](https://landmarkcu.visualstudio.com/Platform/_git/LCU.WebApps.Internal.LoanRateManager).
|
|
|
|
# Helpful Documents
|
|
|
|
---
|
|
|
|
- [LoanRate Workflow Design](https://landmarkcu.sharepoint.com/:u:/r/sites/ITProgrammingDevelopmentTeam/_layouts/15/Doc.aspx?sourcedoc=%7B1F0DB00D-0086-42DC-BA31-B8B781003F60%7D&file=LoanRate_Workflow.vsdx&action=default&mobileredirect=true)
|
|
- [LoanRate LoadTest Workflow Design](https://landmarkcu.sharepoint.com/:u:/r/sites/ITProgrammingDevelopmentTeam/_layouts/15/Doc.aspx?sourcedoc=%7BDBA7674E-35CB-4D34-A982-F837BFBB35E9%7D&file=Loan%20Rate%20-%20Mass%20Testing%20WorkFlow%20Diagram.vsdx&action=default&mobileredirect=true) |