diff --git a/LCU.API.Collections.RepoApi-old/.gitignore b/LCU.API.Collections.RepoApi-old/.gitignore new file mode 100644 index 0000000..7660461 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/.gitignore @@ -0,0 +1,352 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Rider +.idea + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi.sln b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi.sln new file mode 100644 index 0000000..9613d5c --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi.sln @@ -0,0 +1,41 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.645 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LCU.API.Collections.RepoApi", "LCU.API.Collections.RepoApi\LCU.API.Collections.RepoApi.csproj", "{7D12B7C0-7967-41CA-A442-A3F78182F0B5}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LCU.API.Collections.RepoApiTests", "LCU.API.Collections.RepoApiTests\LCU.API.Collections.RepoApiTests.csproj", "{EA9E0245-8AA9-4E33-8507-E7C41EFC5DA5}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LCU.Shared.Collections.RepoApiLib", "LCU.Shared.Collections.RepoApiLib\LCU.Shared.Collections.RepoApiLib.csproj", "{1E93535C-B421-4D9B-97C6-6F4FD0308B3C}" +EndProject +Project("{00D1A9C2-B5F0-4AF3-8072-F6C62B433612}") = "LCU.API.Collections.RepoApiSql", "LCU.API.Collections.RepoApiSql\LCU.API.Collections.RepoApiSql.sqlproj", "{33A79137-9040-4749-B89D-1055657C3745}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {7D12B7C0-7967-41CA-A442-A3F78182F0B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7D12B7C0-7967-41CA-A442-A3F78182F0B5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7D12B7C0-7967-41CA-A442-A3F78182F0B5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7D12B7C0-7967-41CA-A442-A3F78182F0B5}.Release|Any CPU.Build.0 = Release|Any CPU + {EA9E0245-8AA9-4E33-8507-E7C41EFC5DA5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EA9E0245-8AA9-4E33-8507-E7C41EFC5DA5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EA9E0245-8AA9-4E33-8507-E7C41EFC5DA5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EA9E0245-8AA9-4E33-8507-E7C41EFC5DA5}.Release|Any CPU.Build.0 = Release|Any CPU + {1E93535C-B421-4D9B-97C6-6F4FD0308B3C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1E93535C-B421-4D9B-97C6-6F4FD0308B3C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1E93535C-B421-4D9B-97C6-6F4FD0308B3C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1E93535C-B421-4D9B-97C6-6F4FD0308B3C}.Release|Any CPU.Build.0 = Release|Any CPU + {33A79137-9040-4749-B89D-1055657C3745}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {33A79137-9040-4749-B89D-1055657C3745}.Release|Any CPU.ActiveCfg = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {458D6DB8-766A-4013-8923-6571AB24E3EF} + EndGlobalSection +EndGlobal diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Configuration/FeatureFlags.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Configuration/FeatureFlags.cs new file mode 100644 index 0000000..0bf1116 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Configuration/FeatureFlags.cs @@ -0,0 +1,12 @@ +namespace LCU.API.Collections.RepoApi.Configuration +{ + /** + * These feature flags should match what is in the appsettings under "FeatureFlags" to prevent Magic Strings. + */ + public static class FeatureFlags + { + public const string EnableControllers = "EnableControllers"; + public const string RunRepoHostedService = "RunRepoHostedService"; + public const string RunAutoImsHostedService = "RunAutoImsHostedService"; + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Configuration/RepoApiConfiguration.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Configuration/RepoApiConfiguration.cs new file mode 100644 index 0000000..3986c03 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Configuration/RepoApiConfiguration.cs @@ -0,0 +1,60 @@ +using LCU.Shared.Collections.RepoApiLib.Models.AutoIms; +using System.Collections.Generic; +using LCU.Shared.Realtime.QueueLib.Models; +using System.Runtime.CompilerServices; + +namespace LCU.API.Collections.RepoApi.Configuration +{ + public class RepoApiConfiguration : IHostedTaskSchedulerConfig + { + public string ExchangeName { get; set; } + public IReadOnlyCollection TaskConfigs { get; set; } + public string OrganizationCode { get; set; } + public int SettingsCacheExpirationSeconds { get; set; } + public List ProgrammingRecipients { get; set; } + public List RepoManagerAdminRecipients { get; set; } + public List FloorPriceAcceptedRecipients { get; set; } + public List CollectionsClerkRecipients { get; set; } + public List CollectionsRecipients { get; set; } + public List CreditDebitsRecipients { get; set; } + public List TransactionTypeCodes { get; set; } + public string TransactionTypeCodeQueryPrefix { get; set; } + public string TransactionHistoryParameterDateFormat { get; set; } + public int TransactionHistoryStartDateOffset { get; set; } + public string NotificationsEmailUrl { get; set; } + public string RepoManagerAccountUrl { get; set; } + + // URLs for data from Collections (Intellect/CORS/Temenos) + public string CollectionsLetterUrl { get; set; } + public string CollectionAccountUrl { get; set; } + + // URLs for data from Core. + public string CoreLoanUrl { get; set; } + public string CoreCollateralUrl { get; set; } + public string CoreMemberUrl { get; set; } + public string CoreLoanTransactions { get; set; } + public string CoreBranchSetUrl { get; set; } + + // Auto IMS Import + public FtpConfiguration FtpConfiguration { get; set; } + public string RemoteFilePath { get; set; } + public string LocalDirectoryPath { get; set; } + public string ConditionReportUrl { get; set; } + public bool MoveProcessedFiles { get; set; } + public bool DownloadNewFiles { get; set; } + public bool CheckForLocalFiles { get; set; } + public string CollectionsConfigUrl { get; set; } + + public IReadOnlyCollection GetTaskConfigurations() + { + return TaskConfigs; + } + + public string GetExchangeName() + { + return ExchangeName; + } + + public IDictionary QueueConsumerConfigs { get; set; } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/AuctionAssignmentController.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/AuctionAssignmentController.cs new file mode 100644 index 0000000..3a2d4c5 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/AuctionAssignmentController.cs @@ -0,0 +1,242 @@ +using System; +using System.Collections.Generic; +using System.Net; +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Configuration; +using LCU.API.Collections.RepoApi.Exceptions; +using LCU.API.Collections.RepoApi.Extensions; +using LCU.API.Collections.RepoApi.Models.Filters; +using LCU.API.Collections.RepoApi.Models.Requests; +using LCU.API.Collections.RepoApi.Models.Responses; +using LCU.API.Collections.RepoApi.Services; +using LCU.Shared.Collections.RepoApiLib.Exceptions; +using LCU.Shared.Collections.RepoApiLib.Models; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.FeatureManagement.Mvc; +using Serilog; + +namespace LCU.API.Collections.RepoApi.Controllers +{ + + [Route("api/[controller]")] + [ApiController] + [FeatureGate(FeatureFlags.EnableControllers)] + public class AuctionAssignmentController : RepoControllerBase + { + private readonly IAuctionAssignmentService _auctionAssignmentService; + private readonly IFloorPricingService _floorPricingService; + + public AuctionAssignmentController( + IAuctionAssignmentService auctionAssignmentService, + IFloorPricingService floorPricingService, + IHttpContextAccessor httpContextAccessor) : + base(httpContextAccessor) + { + _auctionAssignmentService = auctionAssignmentService; + _floorPricingService = floorPricingService; + } + + // GET: api/AuctionAssignment + [HttpGet(Name = "GetAllAuctionAssignments")] + [ProducesResponseType(typeof(PagedResponse), 200)] + [ProducesResponseType(500)] + public async Task Get([FromQuery] AuctionAssignmentFilter filter) + { + try + { + var searchResult = await _auctionAssignmentService.ListByFilterAsync(filter); + var result = new PagedResponse(searchResult, filter, this.Url, Request); + return Ok(result); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // GET: api/AuctionAssignment/5 + [HttpGet("{id}", Name = "GetAuctionAssignmentById")] + [ProducesResponseType(typeof(AuctionAssignment), 200)] + [ProducesResponseType(typeof(string), 400)] + [ProducesResponseType(500)] + public async Task GetById(int id) + { + try + { + if (id <= 0) + { + return BadRequest("Invalid ID"); + } + + var result = await _auctionAssignmentService.GetByIdAsync(id); + return Ok(result); + } + catch (NotFoundException nfe) + { + return NotFound(nfe.Message); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // Get: api/AuctionAssignment/repoId/7 + [HttpGet("repoId/{repoId}", Name = "GetAuctionAssignmentsByRepoId")] + [ProducesResponseType(typeof(IEnumerable), 200)] + [ProducesResponseType(typeof(string), 400)] + [ProducesResponseType(500)] + public async Task GetByRepoId(int repoId) + { + try + { + if (repoId <= 0) + { + return BadRequest("Invalid ID"); + } + + var result = await _auctionAssignmentService.GetByRepoIdAsync(repoId); + return Ok(result); + } + catch (NotFoundException nfe) + { + return NotFound(nfe.Message); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // GET: api/AuctionAssignment/5/FloorPrice + [HttpGet("{id}/FloorPrice", Name = "GetAuctionAssignmentFloorPriceById")] + [ProducesResponseType(typeof(FloorPriceCalculationResultSet), 200)] + [ProducesResponseType(typeof(string), 400)] + [ProducesResponseType(500)] + public IActionResult GetAuctionAssignmentFloorPriceById(int id) + { + try + { + if (id <= 0) + { + return BadRequest("Invalid ID"); + } + + var result = _floorPricingService.DetermineFloorPrice(id); + return Ok(result); + } + catch (NotFoundException nfe) + { + Log.Error(nfe, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return NotFound(nfe.Message); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // POST: api/AuctionAssignment + [HttpPost] + [ProducesResponseType(typeof(AuctionAssignmentPostRequest), 201)] + [ProducesResponseType(typeof(List), 400)] + [ProducesResponseType(500)] + public async Task Post([FromBody] AuctionAssignmentPostRequest auctionAssignmentPostRequest) + { + try + { + if (!ModelState.IsValid) + { + return BadRequest(ModelState.GetErrorMessages()); + } + + var result = await _auctionAssignmentService.SaveAsync(auctionAssignmentPostRequest); + return Ok(result); + } + catch (WebException we) + { + Log.Error(we, $"Failure in {this.GetType().Name} at [AuctionAssignmentPostRequest]"); + return StatusCode(StatusCodes.Status500InternalServerError, we.Message); + } + catch (DuplicateResourceException) + { + return StatusCode(StatusCodes.Status409Conflict, "An active auction assignment already exists. You must remove the auction before creating a new one."); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError, "Failed to add auction to AutoIMS."); + } + } + + // PUT: api/AuctionAssignment/5 + [HttpPut("{id}")] + [ProducesResponseType(typeof(AuctionAssignment), 200)] + [ProducesResponseType(typeof(List), 400)] + [ProducesResponseType(500)] + public async Task Put(int id, [FromBody] AuctionAssignment auctionAssignment) + { + try + { + if (!ModelState.IsValid) + { + return BadRequest(ModelState.GetErrorMessages()); + } + + if (id <= 0 || id != auctionAssignment.ID) + { + return BadRequest("Invalid ID"); + } + + var result = await _auctionAssignmentService.UpdateAsync(auctionAssignment); + return Ok(result); + } + catch (NotFoundException nfe) + { + Log.Error(nfe, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return NotFound(nfe.Message); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // DELETE: api/ApiWithActions/5 + [HttpDelete("{id}")] + [ProducesResponseType(typeof(AuctionAssignment), 200)] + [ProducesResponseType(500)] + public async Task Delete(int id) + { + try + { + if (id <= 0) + { + return BadRequest("Invalid ID"); + } + + var deletedRepoCompany = await _auctionAssignmentService.RemoveAuction(id); + return Ok(deletedRepoCompany); + } + catch (WebException we) + { + return StatusCode(StatusCodes.Status500InternalServerError, we.Message); + } + catch (NotFoundException nfe) + { + return NotFound(nfe.Message); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError, "Failed to remove auction from AutoIMS."); + } + } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/AuctionHouseController.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/AuctionHouseController.cs new file mode 100644 index 0000000..30e6905 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/AuctionHouseController.cs @@ -0,0 +1,151 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Configuration; +using LCU.API.Collections.RepoApi.Exceptions; +using LCU.API.Collections.RepoApi.Extensions; +using LCU.API.Collections.RepoApi.Services; +using LCU.Shared.Collections.RepoApiLib.Models; +using Microsoft.AspNetCore.Authentication.JwtBearer; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.FeatureManagement.Mvc; +using Serilog; + +namespace LCU.API.Collections.RepoApi.Controllers +{ + [Route("api/[controller]")] + [ApiController] + [FeatureGate(FeatureFlags.EnableControllers)] + public class AuctionHouseController : RepoControllerBase + { + private readonly IAuctionHouseService _auctionHouseService; + + public AuctionHouseController( + IAuctionHouseService auctionHouseService, + IHttpContextAccessor httpContextAccessor) + : base( httpContextAccessor) + { + _auctionHouseService = auctionHouseService; + } + + [HttpGet(Name = "GetAllAuctionHouses")] + [ProducesResponseType(typeof(IEnumerable), 200)] + [ProducesResponseType(500)] + public async Task Get() + { + try + { + var auctions = await _auctionHouseService.ListAllAsync(); + return Ok(auctions); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + [HttpGet("{id}", Name = "GetAuctionHouseById")] + [ProducesResponseType(typeof(AuctionHouse), 200)] + [ProducesResponseType(typeof(string), 400)] + [ProducesResponseType(500)] + public async Task GetById(string id) + { + try + { + var auction = await _auctionHouseService.GetAsync(id); + return Ok(auction); + } + catch (NotFoundException nfe) + { + return NotFound(nfe.Message); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + [HttpPost] + [ProducesResponseType(typeof(AuctionHouse), 200)] + [ProducesResponseType(typeof(List), 400)] + [ProducesResponseType(500)] + [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme, Roles = "Admin")] + public async Task Post([FromBody] AuctionHouse auction) + { + try + { + if (!ModelState.IsValid) + { + return BadRequest(ModelState.GetErrorMessages()); + } + + var newAuction = await _auctionHouseService.SaveAsync(auction); + return Ok(newAuction); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + [HttpPut("{id}")] + [ProducesResponseType(typeof(AuctionHouse), 200)] + [ProducesResponseType(typeof(List), 400)] + [ProducesResponseType(500)] + [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme, Roles = "Admin")] + public async Task Put(string id, [FromBody] AuctionHouse auction) + { + try + { + if (!ModelState.IsValid) + { + return BadRequest(ModelState.GetErrorMessages()); + } + + if (id != auction.AuctionID) + { + return BadRequest("Invalid ID"); + } + + var updatedAuction = await _auctionHouseService.UpdateAsync(auction); + return Ok(updatedAuction); + } + catch (NotFoundException nfe) + { + return NotFound(nfe.Message); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + [HttpDelete("{id}")] + [ProducesResponseType(typeof(AuctionHouse), 200)] + [ProducesResponseType(500)] + [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme, Roles = "Admin")] + public async Task Delete(string id) + { + try + { + var deletedAuction = await _auctionHouseService.DeleteAsync(id); + return Ok(deletedAuction); + } + catch (NotFoundException nfe) + { + return NotFound(nfe.Message); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/AuditRecordController.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/AuditRecordController.cs new file mode 100644 index 0000000..7c2602d --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/AuditRecordController.cs @@ -0,0 +1,104 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Configuration; +using LCU.API.Collections.RepoApi.Exceptions; +using LCU.API.Collections.RepoApi.Extensions; +using LCU.API.Collections.RepoApi.Models.Filters; +using LCU.API.Collections.RepoApi.Models.Responses; +using LCU.API.Collections.RepoApi.Services; +using LCU.Shared.Collections.RepoApiLib.Models; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.FeatureManagement.Mvc; +using Serilog; + +namespace LCU.API.Collections.RepoApi.Controllers +{ + [Route("api/[controller]")] + [ApiController] + [FeatureGate(FeatureFlags.EnableControllers)] + public class AuditRecordController : RepoControllerBase + { + private readonly IAuditRecordService _auditRecordService; + + public AuditRecordController( + IAuditRecordService repoAccountService, + IHttpContextAccessor httpContextAccessor) : base(httpContextAccessor) + { + _auditRecordService = repoAccountService; + } + + // GET: api/AuditRecord + [HttpGet(Name = "GetAllAuditRecords")] + [ProducesResponseType(typeof(PagedResponse), 200)] + [ProducesResponseType(500)] + public async Task Get([FromQuery] PageFilter filter) + { + try + { + var searchResult = await _auditRecordService.ListAll(filter); + var result = new PagedResponse(searchResult, filter, Url, Request); + return Ok(result); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // GET: api/AuditRecord/5 + [HttpGet("{id}", Name = "GetAuditRecordById")] + [ProducesResponseType(typeof(RepoAccount), 200)] + [ProducesResponseType(typeof(string), 400)] + [ProducesResponseType(500)] + public async Task GetById(int id) + { + try + { + if (id <= 0) + { + return BadRequest("Invalid ID"); + } + + var result = await _auditRecordService.Get(id); + return Ok(result); + } + catch (NotFoundException nfe) + { + return NotFound(nfe.Message); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // POST: api/RepoAccount + [HttpPost] + [ProducesResponseType(typeof(RepoAccount), 201)] + [ProducesResponseType(typeof(List), 400)] + [ProducesResponseType(500)] + public async Task Post([FromBody] AuditRecord repoAccount) + { + try + { + if (!ModelState.IsValid) + { + return BadRequest(ModelState.GetErrorMessages()); + } + + var result = await _auditRecordService.SaveAsync(repoAccount); + return Ok( result); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/CollateralController.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/CollateralController.cs new file mode 100644 index 0000000..8f71323 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/CollateralController.cs @@ -0,0 +1,134 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Configuration; +using LCU.API.Collections.RepoApi.Exceptions; +using LCU.API.Collections.RepoApi.Extensions; +using LCU.API.Collections.RepoApi.Services; +using LCU.Shared.Collections.RepoApiLib.Models; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.FeatureManagement.Mvc; +using Serilog; + +namespace LCU.API.Collections.RepoApi.Controllers +{ + [Route("api/[controller]")] + [ApiController] + [FeatureGate(FeatureFlags.EnableControllers)] + public class CollateralController : RepoControllerBase + { + private readonly ICollateralService _collateralService; + + public CollateralController( + ICollateralService collateralService, + IHttpContextAccessor httpContextAccessor) : + base(httpContextAccessor) + { + _collateralService = collateralService; + } + + // GET: api/Collateral + [HttpGet] + [ProducesResponseType(typeof(IEnumerable), 200)] + [ProducesResponseType(500)] + public async Task Get() + { + try + { + var results = await _collateralService.ListAll(); + return Ok(results); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // GET: api/Collateral/5 + [HttpGet("{id}", Name = "GetCollateralById")] + [ProducesResponseType(typeof(Collateral), 200)] + [ProducesResponseType(typeof(string), 400)] + [ProducesResponseType(500)] + public async Task GetById(int id) + { + try + { + if (id <= 0) + { + return BadRequest("Invalid ID"); + } + + var result = await _collateralService.Get(id); + return Ok(result); + } + catch (NotFoundException nfe) + { + return NotFound(nfe.Message); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // POST: api/Collateral + [HttpPost] + [ProducesResponseType(typeof(Collateral), 201)] + [ProducesResponseType(typeof(List), 400)] + [ProducesResponseType(500)] + public async Task Post([FromBody] Collateral collateral) + { + try + { + if (!ModelState.IsValid) + { + return BadRequest(ModelState.GetErrorMessages()); + } + + var result = await _collateralService.SaveAsync(collateral); + return Ok(result); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // PUT: api/Collateral/5 + [HttpPut("{id}")] + [ProducesResponseType(typeof(Collateral), 200)] + [ProducesResponseType(typeof(List), 400)] + [ProducesResponseType(500)] + public async Task Put(int id, [FromBody] Collateral collateral) + { + try + { + if (!ModelState.IsValid) + { + return BadRequest(ModelState); + } + + if (id <= 0 || id != collateral.CollateralId) + { + return BadRequest("Invalid ID"); + } + + var result = await _collateralService.UpdateAsync(collateral); + return Ok(result); + } + catch (NotFoundException nfe) + { + return NotFound(nfe.Message); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/EventAlertController.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/EventAlertController.cs new file mode 100644 index 0000000..8487dbb --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/EventAlertController.cs @@ -0,0 +1,252 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Configuration; +using LCU.API.Collections.RepoApi.Exceptions; +using LCU.API.Collections.RepoApi.Extensions; +using LCU.API.Collections.RepoApi.Services; +using LCU.Shared.Collections.RepoApiLib.Exceptions; +using LCU.Shared.Collections.RepoApiLib.Models; +using Microsoft.AspNetCore.Authentication.JwtBearer; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.FeatureManagement.Mvc; +using Serilog; + +namespace LCU.API.Collections.RepoApi.Controllers +{ + [Route("api/[controller]")] + [ApiController] + [FeatureGate(FeatureFlags.EnableControllers)] + public class EventAlertController : RepoControllerBase + { + private readonly IEventAlertService _eventAlertService; + private readonly IRepoAccountService _repoAccountService; + + public EventAlertController( + IEventAlertService eventAlertService, + IRepoAccountService repoAccountService, + IHttpContextAccessor httpContextAccessor) : base(httpContextAccessor) + { + _eventAlertService = eventAlertService; + _repoAccountService = repoAccountService; + } + + // GET: api/EventAlert + [HttpGet] + [ProducesResponseType(typeof(IEnumerable), 200)] + [ProducesResponseType(500)] + public async Task Get(bool unreadOnly = false, bool actionNeeded = false) + { + try + { + if (unreadOnly) + { + var unread = await _eventAlertService.ListUnread(); + return Ok(unread); + } + + if (actionNeeded) + { + var needed = await _eventAlertService.ListActionNeeded(); + return Ok(needed); + } + + var results = await _eventAlertService.ListAll(); + return Ok(results); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {this.GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // GET: api/EventAlert/5 + [HttpGet("{id}", Name = "GetEventAlertById")] + [ProducesResponseType(typeof(EventAlert), 200)] + [ProducesResponseType(typeof(string), 400)] + [ProducesResponseType(500)] + public async Task GetById(int id) + { + try + { + if (id <= 0) + { + return BadRequest("Invalid ID"); + } + + var result = await _eventAlertService.Get(id); + return Ok(result); + } + catch (NotFoundException nfe) + { + return NotFound(nfe.Message); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {this.GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // GET: api/EventAlert/ + [HttpGet] + [Route("[action]")] + [ProducesResponseType(typeof(EventAlert), 200)] + [ProducesResponseType(typeof(string), 400)] + [ProducesResponseType(500)] + public async Task GetWithinDateRange(DateTime start, DateTime end) + { + try + { + if (start == null || end == null || end < start) + { + return BadRequest("Invalid dates"); + } + + var result = await _eventAlertService.ListWithinDateRange(start, end); + return Ok(result); + } + catch (NotFoundException nfe) + { + return NotFound(nfe.Message); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {this.GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // POST: api/EventAlert + [HttpPost] + [ProducesResponseType(typeof(EventAlert), 201)] + [ProducesResponseType(typeof(List), 400)] + [ProducesResponseType(500)] + public async Task Post([FromBody] EventAlert eventAlert) + { + try + { + if (!ModelState.IsValid) + { + return BadRequest(ModelState.GetErrorMessages()); + } + + var result = await _eventAlertService.SaveAsync(eventAlert); + return Ok(result); + } + catch (DuplicateResourceException) + { + return StatusCode(StatusCodes.Status409Conflict, "A Duplicate Event Alert already exists."); + } + catch (UnwantedStatusException) + { + return StatusCode(StatusCodes.Status409Conflict, $"Status of Repo: Reposession ID: {eventAlert.RepoId} is Cancelled or Redeemed. Event Alert not created."); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {this.GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // POST: api/EventAlert/ByAuctionAssignmentId/:AuctionAssignmentId + [HttpPost("ByAuctionAssignmentId/{auctionAssignmentId}")] + [ProducesResponseType(typeof(EventAlert), 201)] + [ProducesResponseType(typeof(List), 400)] + [ProducesResponseType(500)] + public async Task CreateByAuctionAssignmentId(int auctionAssignmentId, + [FromBody] EventAlert eventAlert) + { + try + { + if (!ModelState.IsValid) + { + return BadRequest(ModelState.GetErrorMessages()); + } + + var repo = await _repoAccountService.FindByAuctionAssignmentId(auctionAssignmentId); + if (repo == null) + { + return BadRequest("Repo Account Not Found For Auction Assignment"); + } + + eventAlert.RepoId = repo.RepoId; + eventAlert.AccountNo = repo.AccountNo; + var result = await _eventAlertService.SaveAsync(eventAlert); + return Ok(result); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {this.GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // PUT: api/EventAlert/5 + [HttpPut("{id}")] + [ProducesResponseType(typeof(EventAlert), 200)] + [ProducesResponseType(typeof(List), 400)] + [ProducesResponseType(500)] + [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] + public async Task Put(int id, [FromBody] EventAlert eventAlert) + { + try + { + if (!ModelState.IsValid) + { + return BadRequest(ModelState); + } + + if (id <= 0 || id != eventAlert.Id) + { + return BadRequest("Invalid ID"); + } + + var currentUser = CreateUserFromAuth(); + + var result = await _eventAlertService.UpdateAsync(eventAlert, currentUser); + return Ok(result); + } + catch (NotFoundException nfe) + { + return NotFound(nfe.Message); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {this.GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // DELETE: api/ApiWithActions/5 + [HttpDelete("{id}")] + [ProducesResponseType(typeof(EventAlert), 200)] + [ProducesResponseType(typeof(string), 400)] + [ProducesResponseType(500)] + public async Task Delete(int id) + { + try + { + if (id <= 0) + { + return BadRequest("Invalid ID"); + } + + var result = await _eventAlertService.DeleteAsync(id); + return Ok(result); + } + catch (NotFoundException nfe) + { + return NotFound(nfe.Message); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {this.GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/FactoidController.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/FactoidController.cs new file mode 100644 index 0000000..f73012a --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/FactoidController.cs @@ -0,0 +1,264 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Configuration; +using LCU.API.Collections.RepoApi.Models.Responses; +using LCU.API.Collections.RepoApi.Services; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.FeatureManagement.Mvc; +using Serilog; + +namespace LCU.API.Collections.RepoApi.Controllers +{ + [Route("api/[controller]")] + [ApiController] + [FeatureGate(FeatureFlags.EnableControllers)] + public class FactoidController : RepoControllerBase + { + private readonly IFactoidService _factoidService; + + public FactoidController(IHttpContextAccessor httpContextAccessor, + IFactoidService factoidService) : + base(httpContextAccessor) + { + _factoidService = factoidService; + } + + // GET: api/Factoid + [HttpGet(Name = "GetAllFactoids")] + [ProducesResponseType(typeof(IEnumerable), 200)] + [ProducesResponseType(500)] + public async Task GetAllFactoids() + { + try + { + var highDate = DateTime.Today; + var lowDate = highDate.Subtract(TimeSpan.FromDays(30)); + + var factoidResponse = new List() + { + await _factoidService.GetAllAccountsO4R(), + await _factoidService.GetAvgDaysO4RToREPO(lowDate, highDate), + await _factoidService.GetCurrentInventory(), + await _factoidService.GetPercentFloorPrice(lowDate, highDate), + await _factoidService.GetCurrentlyOnHold(), + await _factoidService.GetRecentlyRedeemed(lowDate, highDate), + await _factoidService.GetRecentlyRepoed(lowDate, highDate), + await _factoidService.GetGetAvgDaysDelqToO4R(lowDate, highDate), + await _factoidService.GetGetAvgDaysRepoToSold(lowDate, highDate), + await _factoidService.GetRecentlySold(lowDate, highDate) + }; + return Ok(factoidResponse); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // GET: api/factoid/CurrentInventory + [HttpGet("CurrentInventory", Name = "GetCurrentInventory")] + [ProducesResponseType(typeof(FactoidResponse), 200)] + [ProducesResponseType(500)] + public async Task GetCurrentInventory() + { + try + { + var factoidResponse = await _factoidService.GetCurrentInventory(); + return Ok(factoidResponse); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at Factoid: {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // GET: api/factoid/AccountsO4R + [HttpGet("AccountsO4R", Name = "GetAllAccountsInO4R")] + [ProducesResponseType(typeof(FactoidResponse), 200)] + [ProducesResponseType(500)] + public async Task GetAllAccountsO4R() + { + try + { + var factoidResponse = await _factoidService.GetAllAccountsO4R(); + return Ok(factoidResponse); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at Factoid: {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // GET: api/factoid/PercentFloor + [HttpGet("PercentFloor", Name = "GetPercentFloor")] + [ProducesResponseType(typeof(FactoidResponse), 200)] + [ProducesResponseType(500)] + public async Task GetPercentFloor() + { + try + { + var highDate = DateTime.Today; + var lowDate = highDate.Subtract(TimeSpan.FromDays(30)); + + var factoidResponse = await _factoidService.GetPercentFloorPrice(lowDate, highDate); + return Ok(factoidResponse); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at Factoid: {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // GET: api/factoid/RecentlyRedeemed + [HttpGet("RecentlyRedeemed", Name = "GetRecentlyRedeemed")] + [ProducesResponseType(typeof(FactoidResponse), 200)] + [ProducesResponseType(500)] + public async Task GetRecentlyRedeemed() + { + try + { + var highDate = DateTime.Today; + var lowDate = highDate.Subtract(TimeSpan.FromDays(30)); + + var factoidResponse = await _factoidService.GetRecentlyRedeemed(lowDate, highDate); + return Ok(factoidResponse); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at Factoid: {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // GET: api/factoid/AvgDaysO4RToREPO + [HttpGet("AvgDaysO4RToREPO", Name = "GetAvgDaysO4RToRepo")] + [ProducesResponseType(typeof(FactoidResponse), 200)] + [ProducesResponseType(500)] + public async Task GetAvgDaysO4RToRepo() + { + try + { + var highDate = DateTime.Today; + var lowDate = highDate.Subtract(TimeSpan.FromDays(30)); + + var factoidResponse = await _factoidService.GetAvgDaysO4RToREPO(lowDate, highDate); + return Ok(factoidResponse); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at Factoid: {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // GET: api/factoid/AvgDaysDelqToO4R + [HttpGet("AvgDaysDelqToO4R", Name = "GetAvgDaysDelqToO4R")] + [ProducesResponseType(typeof(FactoidResponse), 200)] + [ProducesResponseType(500)] + public async Task GetAvgDaysDelqToO4R() + { + try + { + var highDate = DateTime.Today; + var lowDate = highDate.Subtract(TimeSpan.FromDays(30)); + + var factoidResponse = await _factoidService.GetGetAvgDaysDelqToO4R(lowDate, highDate); + return Ok(factoidResponse); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at Factoid: {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // GET: api/factoid/AvgDaysRepoToSold + [HttpGet("AvgDaysRepoToSold", Name = "GetAvgDaysRepoToSold")] + [ProducesResponseType(typeof(FactoidResponse), 200)] + [ProducesResponseType(500)] + public async Task GetAvgDaysRepoToSold() + { + try + { + var highDate = DateTime.Today; + var lowDate = highDate.Subtract(TimeSpan.FromDays(30)); + + var factoidResponse = await _factoidService.GetGetAvgDaysRepoToSold(lowDate, highDate); + return Ok(factoidResponse); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at Factoid: {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // GET: api/factoid/CurrentOnHold + [HttpGet("CurrentOnHold", Name = "GetCurrentOnHold")] + [ProducesResponseType(typeof(FactoidResponse), 200)] + [ProducesResponseType(500)] + public async Task GetCurrentOnHold() + { + try + { + var factoidResponse = await _factoidService.GetCurrentlyOnHold(); + return Ok(factoidResponse); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at Factoid: {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // GET: api/factoid/RecentlyRepoed + [HttpGet("RecentlyRepoed", Name = "GetRecentlyRepoed")] + [ProducesResponseType(typeof(FactoidResponse), 200)] + [ProducesResponseType(500)] + public async Task GetRecentlyRepoed() + { + try + { + var highDate = DateTime.Today; + var lowDate = highDate.Subtract(TimeSpan.FromDays(30)); + + var factoidResponse = await _factoidService.GetRecentlyRepoed(lowDate, highDate); + return Ok(factoidResponse); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at Factoid: {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + + } + } + + // GET: api/factoid/RecentlySold + [HttpGet("RecentlySold", Name = "GetRecentlySold")] + [ProducesResponseType(typeof(FactoidResponse), 200)] + [ProducesResponseType(500)] + public async Task GetRecentlySold() + { + try + { + var highDate = DateTime.Today; + var lowDate = highDate.Subtract(TimeSpan.FromDays(30)); + + var factoidResponse = await _factoidService.GetRecentlySold(lowDate, highDate); + return Ok(factoidResponse); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at Factoid: {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + + } + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/LoggingController.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/LoggingController.cs new file mode 100644 index 0000000..6188348 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/LoggingController.cs @@ -0,0 +1,48 @@ +using System; +using LCU.API.Collections.RepoApi.Configuration; +using LCU.Shared.Collections.RepoApiLib.Models; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.FeatureManagement.Mvc; +using Serilog; + +namespace LCU.API.Collections.RepoApi.Controllers +{ + [Route("api/[controller]")] + [ApiController] + [FeatureGate(FeatureFlags.EnableControllers)] + public class LoggingController : RepoControllerBase + { + public LoggingController(IHttpContextAccessor httpContextAccessor) : base(httpContextAccessor) + { + } + + /// + /// Use to send something to the logger from the client + /// + /// + /// Logs a message from a client. + /// Cookies: None required or set. + /// Security: Must have a valid JWT token retrieved from Azure AD, with ADMIN role. + /// + // Post: api/Logging/Error + [HttpPost("Error")] + [ProducesResponseType(200)] + [ProducesResponseType(400)] + [ProducesResponseType(403)] + [ProducesResponseType(500)] + public IActionResult Post([FromBody] ClientError error) + { + try + { + Log.Error($"Client Exception: <{ error.Name}> : {error.Message} => {error.StackTrace}"); + return Ok(); + } + catch (Exception e) + { + Log.Fatal(e,"Failed to log client error. Exception Thrown."); + return StatusCode((int) System.Net.HttpStatusCode.InternalServerError); + } + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/ProcessingReceiptController.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/ProcessingReceiptController.cs new file mode 100644 index 0000000..ed7b5be --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/ProcessingReceiptController.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.ObjectModel; +using System.Linq; +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Configuration; +using LCU.API.Collections.RepoApi.HostedServices; +using LCU.API.Collections.RepoApi.Services; +using LCU.Shared.Collections.RepoApiLib.Models; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.FeatureManagement.Mvc; +using Serilog; + +namespace LCU.API.Collections.RepoApi.Controllers +{ + [Route("api/[controller]")] + [ApiController] + [FeatureGate(FeatureFlags.EnableControllers)] + public class ProcessingReceiptController : RepoControllerBase + { + + private readonly IProcessingReceiptService _receiptService; + + public ProcessingReceiptController(IProcessingReceiptService receiptService, + IHttpContextAccessor httpContextAccessor): + base(httpContextAccessor) + { + _receiptService = receiptService; + } + + //GET: api/ProcessingReceipt/AccountNo/5 + [HttpGet("AccountNo/{accountNo}")] + [ProducesResponseType(typeof(ReadOnlyCollection),200)] + [ProducesResponseType(typeof(string),400)] + [ProducesResponseType(500)] + public async Task GetByAccountNo(string accountNo) + { + try + { + if (string.IsNullOrWhiteSpace((accountNo))) + { + return BadRequest("Invalid ID"); + } + + var results = await _receiptService.GetReceiptsByAccountNoAsync(accountNo); + if (results.Any()) + { + return Ok(results); + } + + return NotFound("No receipts found for for this account"); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/QueueController.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/QueueController.cs new file mode 100644 index 0000000..2059258 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/QueueController.cs @@ -0,0 +1,65 @@ +using System; +using System.Collections.Generic; +using LCU.API.Collections.RepoApi.Configuration; +using LCU.API.Collections.RepoApi.Extensions; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Serilog; +using LCU.API.Collections.RepoApi.HostedServices; +using LCU.API.Collections.RepoApi.Models.Requests; +using LCU.Shared.Collections.RepoApiLib.Models.Producer; +using Microsoft.AspNetCore.Authentication.JwtBearer; +using Microsoft.AspNetCore.Authorization; +using Microsoft.FeatureManagement.Mvc; + +namespace LCU.API.Collections.RepoApi.Controllers +{ + [Route("api/[controller]")] + [ApiController] + [FeatureGate(FeatureFlags.EnableControllers)] + public class QueueController : RepoControllerBase + { + private readonly IRepoQueueProducerService _repoQueueProducer; + + public QueueController(IRepoQueueProducerService producerService, IHttpContextAccessor httpContextAccessor) : + base(httpContextAccessor) + { + _repoQueueProducer = producerService; + } + + [HttpPost] + [ProducesResponseType(200)] + [ProducesResponseType(typeof(List), 400)] + [ProducesResponseType(500)] + [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] + public IActionResult PutSingleAccountOnQueue([FromBody] AccountQueueRequest queueRequest) + { + try + { + if (!ModelState.IsValid) + { + return BadRequest(ModelState.GetErrorMessages()); + } + + var currentUser = CreateUserFromAuth(); + + var request = new ProcessingItem() + { + AccountNo = queueRequest.AccountNo, + CaseId = queueRequest.CaseId, + QueuedBy = currentUser.Email + }; + + _repoQueueProducer.SendRequestToQueue(request); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode((int) System.Net.HttpStatusCode.InternalServerError, + $"A server error occured, and your request could not be complete"); + } + + return Ok(); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/RefundStatusController.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/RefundStatusController.cs new file mode 100644 index 0000000..3c3b762 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/RefundStatusController.cs @@ -0,0 +1,141 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Configuration; +using LCU.API.Collections.RepoApi.Exceptions; +using LCU.API.Collections.RepoApi.Extensions; +using LCU.API.Collections.RepoApi.Services; +using LCU.Shared.Collections.RepoApiLib.Models; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.FeatureManagement.Mvc; +using Serilog; + +namespace LCU.API.Collections.RepoApi.Controllers +{ + [Route("api/[controller]")] + [ApiController] + [FeatureGate(FeatureFlags.EnableControllers)] + public class RefundStatusController : RepoControllerBase + { + private IRefundStatusService _refundStatusService; + + public RefundStatusController( + IRefundStatusService refundStatusService, + IHttpContextAccessor httpContextAccessor) : + base(httpContextAccessor) + { + _refundStatusService = refundStatusService; + } + + // GET: api/RefundStatus + [HttpGet(Name = "GetAllRefundStatus")] + [ProducesResponseType(typeof(IEnumerable), 200)] + [ProducesResponseType(500)] + public async Task Get() + { + try + { + var result = await _refundStatusService.ListAllAsync(); + return Ok(result); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // GET: api/RefundStatus/5 + [HttpGet("{repoId}", Name = "GetRefundStatusById")] + [ProducesResponseType(typeof(RefundStatus), 200)] + [ProducesResponseType(typeof(string), 404)] + [ProducesResponseType(500)] + public async Task GetById(int repoId) + { + try + { + if (repoId <= 0) + { + return BadRequest("Invalid RepoId"); + } + + var refundStatus = await _refundStatusService.GetAsync(repoId); + return Ok(refundStatus); + } + catch (NotFoundException nfe) + { + return NotFound(nfe.Message); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + [HttpPost] + [ProducesResponseType(typeof(RefundStatus), 200)] + [ProducesResponseType(typeof(List), 400)] + [ProducesResponseType(500)] + public async Task Post([FromBody] RefundStatus refundStatus) + { + try + { + if (!ModelState.IsValid) + { + return BadRequest(ModelState.GetErrorMessages()); + } + + if (refundStatus.RepoId <= 0) + { + return BadRequest("Invalid ID"); + } + + var newRefundStatus = await _refundStatusService.SaveAsync(refundStatus); + return Ok(newRefundStatus); + } + catch (NotFoundException nfe) + { + return NotFound(nfe.Message); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + [HttpPut("{repoId}")] + [ProducesResponseType(typeof(RefundStatus), 200)] + [ProducesResponseType(typeof(List), 400)] + [ProducesResponseType(500)] + public async Task Put(int repoId, [FromBody] RefundStatus refundStatus) + { + try + { + if (!ModelState.IsValid) + { + return BadRequest(ModelState.GetErrorMessages()); + } + + if (repoId <= 0 || repoId != refundStatus.RepoId) + { + return BadRequest("Invalid ID"); + } + + var newRefundStatus = await _refundStatusService.UpdateAsync(refundStatus); + return Ok(newRefundStatus); + } + catch (NotFoundException nfe) + { + return NotFound(nfe.Message); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/RepoAccountController.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/RepoAccountController.cs new file mode 100644 index 0000000..31251b5 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/RepoAccountController.cs @@ -0,0 +1,343 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Configuration; +using LCU.API.Collections.RepoApi.Exceptions; +using LCU.API.Collections.RepoApi.Extensions; +using LCU.API.Collections.RepoApi.Models; +using LCU.API.Collections.RepoApi.Models.Filters; +using LCU.API.Collections.RepoApi.Models.Requests; +using LCU.API.Collections.RepoApi.Models.Responses; +using LCU.API.Collections.RepoApi.Services; +using LCU.Shared.Collections.RepoApiLib.Exceptions; +using LCU.Shared.Collections.RepoApiLib.Models; +using Microsoft.AspNetCore.Authentication.JwtBearer; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.FeatureManagement.Mvc; +using Serilog; + +namespace LCU.API.Collections.RepoApi.Controllers +{ + [Route("api/[controller]")] + [ApiController] + [FeatureGate(FeatureFlags.EnableControllers)] + public class RepoAccountController : RepoControllerBase + { + private readonly IRepoAccountService _repoAccountService; + private readonly IRepoLetterService _repoLetterService; + private readonly IRepoStatusChangeService _repoStatusChangeService; + + public RepoAccountController( + IRepoAccountService repoAccountService, + IRepoLetterService repoLetterService, + IRepoStatusChangeService repoStatusChangeService, + IHttpContextAccessor httpContextAccessor) : base(httpContextAccessor) + { + _repoAccountService = repoAccountService; + _repoLetterService = repoLetterService; + _repoStatusChangeService = repoStatusChangeService; + } + + // GET: api/RepoAccount + [HttpGet(Name = "GetAllRepoAccounts")] + [ProducesResponseType(typeof(PagedResponse), 200)] + [ProducesResponseType(typeof(string), 400)] + [ProducesResponseType(500)] + public async Task Get([FromQuery] PageFilter filter) + { + try + { + var searchResult = await _repoAccountService.ListAll(filter); + var result = new PagedResponse(searchResult, filter, this.Url, Request); + return Ok(result); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // GET: api/RepoAccount/5 + [HttpGet("{id}", Name = "GetRepoAccountById")] + [ProducesResponseType(typeof(RepoAccount), 200)] + [ProducesResponseType(typeof(string), 400)] + [ProducesResponseType(500)] + public async Task GetById(int id) + { + try + { + if (id <= 0) + { + return BadRequest("Invalid ID"); + } + + var result = await _repoAccountService.Get(id); + return Ok(result); + } + catch (NotFoundException nfe) + { + return NotFound(nfe.Message); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // GET: api/RepoAccount/5/statusChanges + [HttpGet("{id}/statusChanges", Name = "GetRepoAccountStatusChanges")] + [ProducesResponseType(typeof(RepoStatusChange), 200)] + [ProducesResponseType(typeof(string), 400)] + [ProducesResponseType(500)] + public async Task GetStatusChangesByRepoId(int id) + { + try + { + if (id <= 0) + { + return BadRequest("Invalid ID"); + } + + var result = await _repoStatusChangeService.ListByAccount(id); + return Ok(result); + } + catch (NotFoundException nfe) + { + return NotFound(nfe.Message); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // GET: api/RepoAccount/5/repoLetters + [HttpGet("{id}/repoLetters", Name = "GetLettersByRepoId")] + [ProducesResponseType(typeof(RepoLetter), 200)] + [ProducesResponseType(typeof(string), 400)] + [ProducesResponseType(500)] + public async Task GetLettersByRepoId(int id) + { + try + { + if (id <= 0) + { + return BadRequest("Invalid ID"); + } + + var result = await _repoLetterService.ListByAccountIdAsync(id); + return Ok(result); + } + catch (NotFoundException nfe) + { + return NotFound(nfe.Message); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // GET: api/RepoAccount/Search/searchPhrase + [HttpGet("Search/{searchPhrase}", Name = "SearchRepoAccounts")] + [ProducesResponseType(typeof(RepoAccount), 200)] + [ProducesResponseType(typeof(string), 400)] + [ProducesResponseType(500)] + public async Task SearchRepoAccounts(string searchPhrase) + { + var maxResults = 100; + + try + { + if (string.IsNullOrWhiteSpace(searchPhrase)) + { + return BadRequest("Search Phrase Cannot Be Empty"); + } + + if (searchPhrase.Trim().Length < 3) + { + return BadRequest("Search Phrase Must Be At Least Three (3) Characters Long"); + } + + var result = await _repoAccountService.SearchRepoAccounts(searchPhrase, maxResults); + return Ok(result); + } + catch (MaxItemException ex) + { + return StatusCode(StatusCodes.Status413PayloadTooLarge, $"Too Many Search Results. (Max: {maxResults}) (Found: {ex.ItemCount})"); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // GET: api/RepoAccount/AccountNo/5 + [HttpGet("AccountNo/{accountNo}", Name = "GetRepoAccountByAccountNo")] + [ProducesResponseType(typeof(RepoAccount), 200)] + [ProducesResponseType(typeof(string), 400)] + [ProducesResponseType(500)] + public async Task GetByAccountNo(string accountNo) + { + try + { + if (string.IsNullOrWhiteSpace(accountNo)) + { + return BadRequest("Invalid ID"); + } + + var result = await _repoAccountService.GetByAccountNo(accountNo); + return Ok(result); + } + catch (NotFoundException nfe) + { + return NotFound(nfe.Message); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // POST: api/RepoAccount + [HttpPost] + [ProducesResponseType(typeof(RepoAccount), 201)] + [ProducesResponseType(typeof(List), 400)] + [ProducesResponseType(500)] + public async Task Post([FromBody] RepoAccount repoAccount) + { + try + { + if (!ModelState.IsValid) + { + return BadRequest(ModelState.GetErrorMessages()); + } + + var result = await _repoAccountService.SaveAsync(repoAccount); + return Ok(result); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // PUT: api/RepoAccount/5 + [HttpPut("{id}")] + [ProducesResponseType(typeof(RepoAccount), 200)] + [ProducesResponseType(typeof(List), 400)] + [ProducesResponseType(500)] + [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] + public async Task Put(int id, [FromBody] RepoAccount repoAccount) + { + try + { + if (id <= 0 || id != repoAccount.RepoId) + { + return BadRequest("Invalid ID"); + } + + if (!ModelState.IsValid) + { + return BadRequest(ModelState); + } + var currentUser = CreateUserFromAuth(); + var result = await _repoAccountService.UpdateAsync(repoAccount, currentUser); + return Ok(result); + } + catch (MaxItemException mie) + { + return BadRequest(mie.Message); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // PUT: api/RepoAccount/Insecure/5 + [HttpPut("Insecure/{id}", Name = "Update Account Insecure Batch")] + [ProducesResponseType(typeof(RepoAccount), 200)] + [ProducesResponseType(typeof(List), 400)] + [ProducesResponseType(500)] + public async Task PutBatch(int id, [FromBody] RepoAccount repoAccount) + { + try + { + if (id <= 0 || id != repoAccount.RepoId) + { + return BadRequest("Invalid ID"); + } + + if (!ModelState.IsValid) + { + return BadRequest(ModelState); + } + + var currentUser = new AppUser() + { + FirstName = "System", + LastName = "User" + }; + var result = await _repoAccountService.UpdateAsync(repoAccount, currentUser); + return Ok(result); + } + catch (MaxItemException mie) + { + return BadRequest(mie.Message); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // POST: api/Filter + [HttpPost("Filter")] + [ProducesResponseType(typeof(PagedResponse), 201)] + [ProducesResponseType(typeof(List), 400)] + [ProducesResponseType(500)] + public async Task Filter([FromQuery] PageFilter pageFilter, [FromBody] RepoAccountPostFilter repoAccountFilter) + { + try + { + var searchResult = await _repoAccountService.ListAll(pageFilter, repoAccountFilter); + var result = new PagedResponse(searchResult, pageFilter, this.Url, Request, "Filter"); + return Ok(result); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + [HttpDelete("Delete/{AccountId}")] + [ProducesResponseType(200)] + [ProducesResponseType(500)] + [ProducesResponseType(400)] + public async Task DeleteAccountById([FromRoute] int accountId) + { + try + { + await _repoAccountService.DeleteAsync(accountId); + }catch(Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + return Ok($"Delete of Account with Id: {accountId} Successful"); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/RepoCompanyController.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/RepoCompanyController.cs new file mode 100644 index 0000000..2186d87 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/RepoCompanyController.cs @@ -0,0 +1,140 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Configuration; +using LCU.API.Collections.RepoApi.Exceptions; +using LCU.API.Collections.RepoApi.Extensions; +using LCU.API.Collections.RepoApi.Services; +using LCU.Shared.Collections.RepoApiLib.Models; +using Microsoft.AspNetCore.Authentication.JwtBearer; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.FeatureManagement.Mvc; +using Serilog; + +namespace LCU.API.Collections.RepoApi.Controllers +{ + [Route("api/[controller]")] + [ApiController] + [FeatureGate(FeatureFlags.EnableControllers)] + public class RepoCompanyController : RepoControllerBase + { + private readonly IRepoCompanyService _repoCompanyService; + + public RepoCompanyController( + IRepoCompanyService repoCompanyService, + IHttpContextAccessor httpContextAccessor) : + base(httpContextAccessor) + { + _repoCompanyService = repoCompanyService; + } + + // GET: api/RepoCompany + [ProducesResponseType(typeof(IEnumerable), 200)] + [ProducesResponseType(500)] + [HttpGet] + public async Task Get() + { + try + { + var repoCompanies = await _repoCompanyService.ListAll(); + return Ok(repoCompanies); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // GET: api/RepoCompany/5 + [HttpGet("{id}", Name = "GetRepoCompanyById")] + [ProducesResponseType(typeof(RepoCompany), 200)] + [ProducesResponseType(typeof(string), 400)] + [ProducesResponseType(500)] + public async Task GetById(int id) + { + try + { + if (id <= 0) + { + return BadRequest("Invalid ID"); + } + + var repoCompany = await _repoCompanyService.Get(id); + return Ok(repoCompany); + } + catch (NotFoundException nfe) + { + return NotFound(nfe.Message); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // POST: api/RepoCompany + [HttpPost] + [ProducesResponseType(typeof(RepoCompany), 200)] + [ProducesResponseType(typeof(List), 400)] + [ProducesResponseType(500)] + [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] + public async Task Post([FromBody] RepoCompany repoCompany) + { + try + { + if (!ModelState.IsValid) + { + return BadRequest(ModelState.GetErrorMessages()); + } + + var newRepoCompany = await _repoCompanyService.Save(repoCompany); + return Ok(newRepoCompany); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // PUT: api/RepoCompany/5 + [HttpPut("{id}")] + [ProducesResponseType(typeof(RepoCompany), 200)] + [ProducesResponseType(typeof(List), 400)] + [ProducesResponseType(500)] + [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] + public async Task Put(int id, [FromBody] RepoCompany repoCompany) + { + try + { + if (!ModelState.IsValid) + { + return BadRequest(ModelState.GetErrorMessages()); + } + + if (id <= 0 || id != repoCompany.ID) + { + return BadRequest("Invalid ID"); + } + + var currentUser = CreateUserFromAuth(); + + var updatedRepoCompany = await _repoCompanyService.Update(repoCompany, currentUser); + return Ok(updatedRepoCompany); + } + catch (NotFoundException nfe) + { + return NotFound(nfe.Message); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/RepoCompanySelectionController.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/RepoCompanySelectionController.cs new file mode 100644 index 0000000..389c344 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/RepoCompanySelectionController.cs @@ -0,0 +1,77 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Configuration; +using LCU.API.Collections.RepoApi.Exceptions; +using LCU.API.Collections.RepoApi.Services; +using LCU.Shared.Collections.RepoApiLib.Models; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.FeatureManagement.Mvc; +using Serilog; + +namespace LCU.API.Collections.RepoApi.Controllers +{ + [Route("api/[controller]")] + [ApiController] + [FeatureGate(FeatureFlags.EnableControllers)] + public class RepoCompanySelectionController : RepoControllerBase + { + private readonly IRepoCompanySelectionService _repoCompanySelectionService; + + public RepoCompanySelectionController( + IRepoCompanySelectionService repoCompanySelectionService, + IHttpContextAccessor httpContextAccessor) : + base(httpContextAccessor) + { + _repoCompanySelectionService = repoCompanySelectionService; + } + + // GET: api/RepoCompanySelection + [HttpGet] + [ProducesResponseType(typeof(IEnumerable), 200)] + [ProducesResponseType(500)] + public async Task Get() + { + try + { + var repoCompanySelections = await _repoCompanySelectionService.ListAllAsync(); + return Ok(repoCompanySelections); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // GET: api/RepoCompanySelection/5 + [HttpGet("{id}", Name = "GetRepoCompanySelectionById")] + [ProducesResponseType(typeof(RepoCompanySelection), 200)] + [ProducesResponseType(typeof(string), 400)] + [ProducesResponseType(typeof(string), 404)] + [ProducesResponseType(500)] + public async Task Get(int id) + { + try + { + if (id <= 0) + { + return BadRequest("Invalid ID"); + } + + var repoCompanySelection = await _repoCompanySelectionService.GetAsync(id); + return Ok(repoCompanySelection); + } + catch (NotFoundException nfe) + { + return NotFound(nfe.Message); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/RepoControllerBase.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/RepoControllerBase.cs new file mode 100644 index 0000000..ea89d6c --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/RepoControllerBase.cs @@ -0,0 +1,37 @@ +using System.Linq; +using System.Runtime.CompilerServices; +using System.Security.Claims; +using LCU.API.Collections.RepoApi.Configuration; +using LCU.API.Collections.RepoApi.Models; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.FeatureManagement.Mvc; + +namespace LCU.API.Collections.RepoApi.Controllers +{ + public class RepoControllerBase : ControllerBase + { + protected readonly IHttpContextAccessor HttpContextAccessor; + + protected RepoControllerBase(IHttpContextAccessor httpContextAccessor) + { + HttpContextAccessor = httpContextAccessor; + } + + protected AppUser CreateUserFromAuth() + { + var userClaimsPrincipal = HttpContextAccessor.HttpContext.User; + + return new AppUser + { + FirstName = userClaimsPrincipal.Claims.FirstOrDefault(claim => claim.Type == ClaimTypes.GivenName)?.Value, + LastName = userClaimsPrincipal.Claims.FirstOrDefault(claim => claim.Type == ClaimTypes.Surname)?.Value, + Email = userClaimsPrincipal.Claims.FirstOrDefault(claim => claim.Type == ClaimTypes.Upn)?.Value, + Roles = userClaimsPrincipal.Claims.Where((claim) => claim.Type == ClaimTypes.Role).Select((claim) => claim?.Value).ToArray(), + }; + } + + public static string GetInvokerAsyncMethodName([CallerMemberName] string methodName = null) => methodName; + + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/ReportingController.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/ReportingController.cs new file mode 100644 index 0000000..8811d10 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/ReportingController.cs @@ -0,0 +1,382 @@ +using System; +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Configuration; +using LCU.API.Collections.RepoApi.Models.Requests; +using LCU.API.Collections.RepoApi.Services.Reporting; +using LCU.Shared.Collections.RepoApiLib.Models.Reporting.Responses; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.FeatureManagement.Mvc; +using Serilog; + +namespace LCU.API.Collections.RepoApi.Controllers +{ + [Route("api/[controller]")] + [FeatureGate(FeatureFlags.EnableControllers)] + [ApiController] + public class ReportingController : RepoControllerBase + { + private readonly ILandmarkReportingService _landmarkReportingService; + private readonly IAuctionReportingService _auctionReportingService; + private readonly IRepoCompanyReportingService _repoCompanyReportingService; + + public ReportingController( + IHttpContextAccessor httpContextAccessor, + ILandmarkReportingService landmarkReportingService, + IAuctionReportingService auctionReportingService, + IRepoCompanyReportingService repoCompanyReportingService) : + base(httpContextAccessor) + { + _landmarkReportingService = landmarkReportingService; + _auctionReportingService = auctionReportingService; + _repoCompanyReportingService = repoCompanyReportingService; + } + + // POST: api/Reporting/AuctionAssignedBalance + [HttpPost("AuctionAssignedBalance", Name = "AuctionAssignedBalance")] + [ProducesResponseType(typeof(ReportTableResponse), 200)] + [ProducesResponseType(500)] + public async Task GetAuctionAssignedBalance([FromBody] ReportingRequest reportingRequest) + { + try + { + var results = await _auctionReportingService.GetAssignedBalance(reportingRequest.LowDate, reportingRequest.HighDate); + return Ok(results); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // POST: api/Reporting/AuctionCountOfAssignedCollateral + [HttpPost("AuctionCountOfAssignedCollateral", Name = "AuctionCountOfAssignedCollateral")] + [ProducesResponseType(typeof(ReportTableResponse), 200)] + [ProducesResponseType(500)] + public async Task GetAuctionCountOfAssignedCollateral([FromBody] ReportingRequest reportingRequest) + { + try + { + var results = await _auctionReportingService.GetAssignedCollateralCount(reportingRequest.LowDate, reportingRequest.HighDate); + return Ok(results); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // POST: api/Reporting/AuctionSalePrice + [HttpPost("AuctionSalePrice", Name = "AuctionSalePrice")] + [ProducesResponseType(typeof(ReportTableResponse), 200)] + [ProducesResponseType(500)] + public async Task GetAuctionSalePrice([FromBody] ReportingRequest reportingRequest) + { + try + { + var results = await _auctionReportingService.GetSalePriceReport(reportingRequest.LowDate, reportingRequest.HighDate); + return Ok(results); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // POST: api/Reporting/AuctionTotalFees + [HttpPost("AuctionTotalFees", Name = "AuctionTotalFees")] + [ProducesResponseType(typeof(ReportTableResponse), 200)] + [ProducesResponseType(500)] + public async Task GetAuctionTotalFees([FromBody] ReportingRequest reportingRequest) + { + try + { + var results = await _auctionReportingService.GetAuctionFeeReport(reportingRequest.LowDate, reportingRequest.HighDate); + return Ok(results); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // POST: api/Reporting/AuctionAvgDaysToSold + [HttpPost("AuctionAvgDaysToSold", Name = "AuctionAvgDaysToSold")] + [ProducesResponseType(typeof(ReportTableResponse), 200)] + [ProducesResponseType(500)] + public async Task GetAuctionAvgDaysToSold([FromBody] ReportingRequest reportingRequest) + { + try + { + var result = await _auctionReportingService.GetAvgDaysAssignedToSold(reportingRequest.LowDate, reportingRequest.HighDate); + return Ok(result); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // POST: api/Reporting/AuctionAvgNetOfFloor + [HttpPost("AuctionAvgNetOfFloor", Name = "AuctionAvgNetOfFloor")] + [ProducesResponseType(typeof(ReportTableResponse), 200)] + [ProducesResponseType(500)] + public async Task GetAuctionAvgNetOfFloor([FromBody] ReportingRequest reportingRequest) + { + try + { + var result = await _auctionReportingService.GetAvgNetOfFloor(reportingRequest.LowDate, reportingRequest.HighDate); + return Ok(result); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // POST: api/Reporting/RepoCompanyCountOfAssignedCollateral + [HttpPost("RepoCompanyCountOfAssignedCollateral", Name = "RepoCompanyCountOfAssignedCollateral")] + [ProducesResponseType(typeof(ReportTableResponse), 200)] + [ProducesResponseType(500)] + public async Task GetRepoCompanyCountOfAssignedCollateral([FromBody] ReportingRequest reportingRequest) + { + try + { + var results = await _repoCompanyReportingService.GetAssignmentCountReport(reportingRequest.LowDate, reportingRequest.HighDate); + return Ok(results); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // POST: api/Reporting/RepoCompanyAssignedBalance + [HttpPost("RepoCompanyAssignedBalance", Name = "RepoCompanyAssignedBalance")] + [ProducesResponseType(typeof(ReportTableResponse), 200)] + [ProducesResponseType(500)] + public async Task GetRepoCompanyAssignedBalance([FromBody] ReportingRequest reportingRequest) + { + try + { + var result = await _repoCompanyReportingService.GetAssignedBalance(reportingRequest.LowDate, reportingRequest.HighDate); + return Ok(result); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // POST: api/Reporting/RepoCompanyRepoCount + [HttpPost("RepoCompanyRepoCount", Name = "RepoCompanyRepoCount")] + [ProducesResponseType(typeof(ReportTableResponse), 200)] + [ProducesResponseType(500)] + public async Task GetRepoCompanyRepoCount([FromBody] ReportingRequest reportingRequest) + { + try + { + var result = await _repoCompanyReportingService.GetRepoedCountReport(reportingRequest.LowDate, reportingRequest.HighDate); + return Ok(result); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // POST: api/Reporting/RepoCompanyAvgDaysAssignedToRepo + [HttpPost("RepoCompanyAvgDaysAssignedToRepo", Name = "RepoCompanyAvgDaysAssignedToRepo")] + [ProducesResponseType(typeof(ReportTableResponse), 200)] + [ProducesResponseType(500)] + public async Task GetRepoCompanyAvgDaysAssignedToRepo([FromBody] ReportingRequest reportingRequest) + { + try + { + var result = await _repoCompanyReportingService.GetAvgDaysAssignedToRepoed(reportingRequest.LowDate, reportingRequest.HighDate); + return Ok(result); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // POST: api/Reporting/AvgDaysDlqWhenAdded + [HttpPost("AvgDaysDlqWhenAdded", Name = "AvgDaysDlqWhenAdded")] + [ProducesResponseType(typeof(ReportTableResponse), 200)] + [ProducesResponseType(500)] + public async Task GetAvgDaysDlqWhenAdded([FromBody] ReportingRequest reportingRequest) + { + try + { + var result = await _landmarkReportingService.GetAvgDaysDelqWhenAddedReport(reportingRequest.LowDate, reportingRequest.HighDate); + return Ok(result); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // POST: api/Reporting/AvgDaysRepoToSold + [HttpPost("AvgDaysRepoToSold", Name = "AvgDaysRepoToSold")] + [ProducesResponseType(typeof(ReportTableResponse), 200)] + [ProducesResponseType(500)] + public async Task GetAvgDaysRepoToSold([FromBody] ReportingRequest reportingRequest) + { + try + { + var result = await _landmarkReportingService.GetAvgDaysRepoToSoldReport(reportingRequest.LowDate, reportingRequest.HighDate); + return Ok(result); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // POST: api/Reporting/CountOfSales + [HttpPost("CountOfSales", Name = "CountOfSales")] + [ProducesResponseType(typeof(ReportTableResponse), 200)] + [ProducesResponseType(500)] + public async Task GetCountOfSales([FromBody] ReportingRequest reportingRequest) + { + try + { + var result = await _landmarkReportingService.GetCountOfSalesReport(reportingRequest.LowDate, reportingRequest.HighDate); + return Ok(result); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // POST: api/Reporting/AvgSurplusOrDeficiency + [HttpPost("AvgSurplusOrDeficiency", Name = "AvgSurplusOrDeficiency")] + [ProducesResponseType(typeof(ReportTableResponse), 200)] + [ProducesResponseType(500)] + public async Task GetAvgSurplusOrDeficiency([FromBody] ReportingRequest reportingRequest) + { + try + { + var result = await _landmarkReportingService.GetAvgSurplusReport(reportingRequest.LowDate, reportingRequest.HighDate); + return Ok(result); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // POST: api/Reporting/CountOfRedemptions + [HttpPost("CountOfRedemptions", Name = "CountOfRedemptions")] + [ProducesResponseType(typeof(ReportTableResponse), 200)] + [ProducesResponseType(500)] + public async Task GetCountOfRedemptions([FromBody] ReportingRequest reportingRequest) + { + try + { + var result = await _landmarkReportingService.GetRedemptionCountReport(reportingRequest.LowDate, reportingRequest.HighDate); + return Ok(result); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // POST: api/Reporting/TotalRedemptionBalance + [HttpPost("TotalRedemptionBalance", Name = "TotalRedemptionBalance")] + [ProducesResponseType(typeof(ReportTableResponse), 200)] + [ProducesResponseType(500)] + public async Task GetTotalRedemptionBalance([FromBody] ReportingRequest reportingRequest) + { + try + { + var result = await _landmarkReportingService.GetRedemptionBalanceReport(reportingRequest.LowDate, reportingRequest.HighDate); + return Ok(result); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // POST: api/Reporting/LoanBalanceRepoedCollateral + [HttpPost("LoanBalanceInventory", Name = "LoanBalanceInventory")] + [ProducesResponseType(typeof(ReportTableResponse), 200)] + [ProducesResponseType(500)] + public async Task GetLoanBalanceInventory([FromBody] ReportingRequest reportingRequest) + { + try + { + var result = await _landmarkReportingService.GetRepoBalanceReport(reportingRequest.LowDate, reportingRequest.HighDate); + return Ok(result); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // POST: api/Reporting/IsActiveAccount + [HttpPost("IsActiveAccount", Name = "IsActiveAccount")] + [ProducesResponseType(typeof(ReportTableResponse), 200)] + [ProducesResponseType(500)] + public async Task GetIsActiveAccount([FromBody] ReportingRequest reportingRequest) + { + try + { + var results = + await _landmarkReportingService.GetIsActiveAccountReport(reportingRequest.LowDate, + reportingRequest.HighDate); + return Ok(results); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // POST: api/Reporting/IsClosedAccount + [HttpPost("IsClosedAccount", Name = "IsClosedAccount")] + [ProducesResponseType(typeof(ReportTableResponse), 200)] + [ProducesResponseType(500)] + public async Task GetIsClosedAccount([FromBody] ReportingRequest reportingRequest) + { + try + { + var results = + await _landmarkReportingService.GetIsClosedAccountReport(reportingRequest.LowDate, + reportingRequest.HighDate); + return Ok(results); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/SavedLocationController.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/SavedLocationController.cs new file mode 100644 index 0000000..b0d6333 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/SavedLocationController.cs @@ -0,0 +1,163 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Configuration; +using LCU.API.Collections.RepoApi.Exceptions; +using LCU.API.Collections.RepoApi.Extensions; +using LCU.API.Collections.RepoApi.Services; +using LCU.Shared.Collections.RepoApiLib.Models; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.FeatureManagement.Mvc; +using Serilog; + +namespace LCU.API.Collections.RepoApi.Controllers +{ + [Route("api/[controller]")] + [ApiController] + [FeatureGate(FeatureFlags.EnableControllers)] + public class SavedLocationController : RepoControllerBase + { + private readonly ISavedLocationService _savedLocationService; + + public SavedLocationController( + ISavedLocationService savedLocationService, + IHttpContextAccessor httpContextAccessor) : + base(httpContextAccessor) + { + _savedLocationService = savedLocationService; + } + + // GET: api/SavedLocation + [HttpGet] + [ProducesResponseType(typeof(IEnumerable), 200)] + [ProducesResponseType(500)] + public async Task Get() + { + try + { + var savedLocations = await _savedLocationService.ListAllAsync(); + return Ok(savedLocations); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // GET: api/SavedLocation/5 + [HttpGet("{id}", Name = "GetSavedLocationById")] + [ProducesResponseType(typeof(SavedLocation), 200)] + [ProducesResponseType(typeof(string), 400)] + [ProducesResponseType(500)] + public async Task GetById(int id) + { + try + { + if (id <= 0) + { + return BadRequest("Invalid ID"); + } + + var savedLocation = await _savedLocationService.GetAsync(id); + return Ok(savedLocation); + } + catch (NotFoundException nfe) + { + return NotFound(nfe.Message); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + + // POST: api/SavedLocation + [HttpPost] + [ProducesResponseType(typeof(SavedLocation), 200)] + [ProducesResponseType(typeof(List), 400)] + [ProducesResponseType(500)] + public async Task Post([FromBody] SavedLocation savedLocation) + { + try + { + if (!ModelState.IsValid) + { + return BadRequest(ModelState.GetErrorMessages()); + } + + var newSavedLocation = await _savedLocationService.SaveAsync(savedLocation); + return Ok(newSavedLocation); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // PUT: api/SavedLocation/5 + [HttpPut("{id}")] + [ProducesResponseType(typeof(SavedLocation), 200)] + [ProducesResponseType(typeof(List), 400)] + [ProducesResponseType(500)] + public async Task Put(int id, [FromBody] SavedLocation savedLocation) + { + try + { + if (!ModelState.IsValid) + { + return BadRequest(ModelState.GetErrorMessages()); + } + + if (id <= 0 || id != savedLocation.ID) + { + return BadRequest("Invalid ID"); + } + + var updatedSavedLocation = await _savedLocationService.UpdateAsync(savedLocation); + return Ok(updatedSavedLocation); + } + catch (NotFoundException nfe) + { + return NotFound(nfe.Message); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // DELETE: api/ApiWithActions/5 + [HttpDelete("{id}")] + [ProducesResponseType(typeof(SavedLocation), 200)] + [ProducesResponseType(typeof(string), 400)] + [ProducesResponseType(500)] + public async Task Delete(int id) + { + try + { + if (id <= 0) + { + return BadRequest("Invalid ID"); + } + + var result = await _savedLocationService.DeleteAsync(id); + return Ok(result); + } + catch (NotFoundException nfe) + { + return NotFound(nfe.Message); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/SettingsController.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/SettingsController.cs new file mode 100644 index 0000000..64731a5 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/SettingsController.cs @@ -0,0 +1,531 @@ +using System; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models.Settings; +using LCU.API.Collections.RepoApi.Services; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using System.Collections.Generic; +using LCU.API.Collections.RepoApi.Configuration; +using LCU.API.Collections.RepoApi.Extensions; +using Microsoft.FeatureManagement.Mvc; +using Serilog; + +namespace LCU.API.Collections.RepoApi.Controllers +{ + [Route("api/[controller]")] + [ApiController] + [FeatureGate(FeatureFlags.EnableControllers)] + public class SettingsController : RepoControllerBase + { + private readonly ISettingsService _settingsService; + + public SettingsController( + ISettingsService settingsService, + IHttpContextAccessor httpContextAccessor) : base(httpContextAccessor) + { + _settingsService = settingsService; + } + + // GET: api/Settings + [HttpGet] + [ProducesResponseType(typeof(Settings), 200)] + [ProducesResponseType(500)] + public async Task Get() + { + try + { + var results = await _settingsService.ListAllSettingsAsync(); + return Ok(results); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // PUT: api/Settings/[method] + [HttpPost] + [Route("[action]")] + [ProducesResponseType(typeof(AccountType), 201)] + [ProducesResponseType(typeof(List), 400)] + [ProducesResponseType(500)] + public async Task PutAccountType([FromBody] AccountType accountType) + { + try + { + if (!ModelState.IsValid) + { + return BadRequest(ModelState.GetErrorMessages()); + } + + var result = await _settingsService.UpdateAsync(accountType); + return Ok(result); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + [HttpPost] + [Route("[action]")] + [ProducesResponseType(typeof(AllowedStatusChange), 201)] + [ProducesResponseType(typeof(List), 400)] + [ProducesResponseType(500)] + public async Task PutAllowedStatusChange([FromBody] AllowedStatusChange statusChange) + { + try + { + if (!ModelState.IsValid) + { + return BadRequest(ModelState.GetErrorMessages()); + } + + var result = await _settingsService.UpdateAsync(statusChange); + return Ok(result); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + [HttpPost] + [Route("[action]")] + [ProducesResponseType(typeof(AllowedStatusChange), 201)] + [ProducesResponseType(typeof(List), 400)] + [ProducesResponseType(500)] + public async Task PutBodyStyle([FromBody] BodyStyle bodyStyle) + { + try + { + if (!ModelState.IsValid) + { + return BadRequest(ModelState.GetErrorMessages()); + } + + var result = await _settingsService.UpdateAsync(bodyStyle); + return Ok(result); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + [HttpPost] + [Route("[action]")] + [ProducesResponseType(typeof(AllowedStatusChange), 201)] + [ProducesResponseType(typeof(List), 400)] + [ProducesResponseType(500)] + public async Task PutCleaningLevel([FromBody] CleaningLevel cleaningLevel) + { + try + { + if (!ModelState.IsValid) + { + return BadRequest(ModelState.GetErrorMessages()); + } + + var result = await _settingsService.UpdateAsync(cleaningLevel); + return Ok(result); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + [HttpPost] + [Route("[action]")] + [ProducesResponseType(typeof(AllowedStatusChange), 201)] + [ProducesResponseType(typeof(List), 400)] + [ProducesResponseType(500)] + public async Task PutCollateralType([FromBody] CollateralType collateralType) + { + try + { + if (!ModelState.IsValid) + { + return BadRequest(ModelState.GetErrorMessages()); + } + + var result = await _settingsService.UpdateAsync(collateralType); + return Ok(result); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + [HttpPost] + [Route("[action]")] + [ProducesResponseType(typeof(AllowedStatusChange), 201)] + [ProducesResponseType(typeof(List), 400)] + [ProducesResponseType(500)] + public async Task PutCollateralTypeToVehicleType( + [FromBody] CollateralTypeToVehicleType collateralToVehicle) + { + try + { + if (!ModelState.IsValid) + { + return BadRequest(ModelState.GetErrorMessages()); + } + + var result = await _settingsService.UpdateAsync(collateralToVehicle); + return Ok(result); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + [HttpPost] + [Route("[action]")] + [ProducesResponseType(typeof(AllowedStatusChange), 201)] + [ProducesResponseType(typeof(List), 400)] + [ProducesResponseType(500)] + public async Task PutHoldStatus([FromBody] HoldStatus holdStatus) + { + try + { + if (!ModelState.IsValid) + { + return BadRequest(ModelState.GetErrorMessages()); + } + + var result = await _settingsService.UpdateAsync(holdStatus); + return Ok(result); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + [HttpPost] + [Route("[action]")] + [ProducesResponseType(typeof(AllowedStatusChange), 201)] + [ProducesResponseType(typeof(List), 400)] + [ProducesResponseType(500)] + public async Task PutLoanCategory([FromBody] LoanCategory loanCategory) + { + try + { + if (!ModelState.IsValid) + { + return BadRequest(ModelState.GetErrorMessages()); + } + + var result = await _settingsService.UpdateAsync(loanCategory); + return Ok(result); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + [HttpPost] + [Route("[action]")] + [ProducesResponseType(typeof(AllowedStatusChange), 201)] + [ProducesResponseType(typeof(List), 400)] + [ProducesResponseType(500)] + public async Task PutLocationType([FromBody] LocationType locationType) + { + try + { + if (!ModelState.IsValid) + { + return BadRequest(ModelState.GetErrorMessages()); + } + + var result = await _settingsService.UpdateAsync(locationType); + return Ok(result); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + [HttpPost] + [Route("[action]")] + [ProducesResponseType(typeof(AllowedStatusChange), 201)] + [ProducesResponseType(typeof(List), 400)] + [ProducesResponseType(500)] + public async Task PutVehicleType([FromBody] VehicleType vehicleType) + { + try + { + if (!ModelState.IsValid) + { + return BadRequest(ModelState.GetErrorMessages()); + } + + var result = await _settingsService.UpdateAsync(vehicleType); + return Ok(result); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // POST: api/Settings/[method] + [HttpPost] + [Route("[action]")] + [ProducesResponseType(typeof(AccountType), 201)] + [ProducesResponseType(typeof(List), 400)] + [ProducesResponseType(500)] + public async Task PostAccountType([FromBody] AccountType accountType) + { + try + { + if (!ModelState.IsValid) + { + return BadRequest(ModelState.GetErrorMessages()); + } + + var result = await _settingsService.SaveAsync(accountType); + return Ok(result); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + [HttpPost] + [Route("[action]")] + [ProducesResponseType(typeof(AccountType), 201)] + [ProducesResponseType(typeof(List), 400)] + [ProducesResponseType(500)] + public async Task PostAllowedStatusChange([FromBody] AllowedStatusChange statusChange) + { + try + { + if (!ModelState.IsValid) + { + return BadRequest(ModelState.GetErrorMessages()); + } + + var result = await _settingsService.SaveAsync(statusChange); + return Ok(result); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + [HttpPost] + [Route("[action]")] + [ProducesResponseType(typeof(AccountType), 201)] + [ProducesResponseType(typeof(List), 400)] + [ProducesResponseType(500)] + public async Task PostBodyStyle([FromBody] BodyStyle bodyStyle) + { + try + { + if (!ModelState.IsValid) + { + return BadRequest(ModelState.GetErrorMessages()); + } + + var result = await _settingsService.SaveAsync(bodyStyle); + return Ok(result); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + [HttpPost] + [Route("[action]")] + [ProducesResponseType(typeof(AccountType), 201)] + [ProducesResponseType(typeof(List), 400)] + [ProducesResponseType(500)] + public async Task PostCleaningLevel([FromBody] CleaningLevel cleaningLevel) + { + try + { + if (!ModelState.IsValid) + { + return BadRequest(ModelState.GetErrorMessages()); + } + + var result = await _settingsService.SaveAsync(cleaningLevel); + return Ok(result); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + [HttpPost] + [Route("[action]")] + [ProducesResponseType(typeof(AccountType), 201)] + [ProducesResponseType(typeof(List), 400)] + [ProducesResponseType(500)] + public async Task PostCollateralType([FromBody] CollateralType collateralType) + { + try + { + if (!ModelState.IsValid) + { + return BadRequest(ModelState.GetErrorMessages()); + } + + var result = await _settingsService.SaveAsync(collateralType); + return Ok(result); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + [HttpPost] + [Route("[action]")] + [ProducesResponseType(typeof(AccountType), 201)] + [ProducesResponseType(typeof(List), 400)] + [ProducesResponseType(500)] + public async Task PostCollateralTypeToVehicleType( + [FromBody] CollateralTypeToVehicleType collateralToVehicle) + { + try + { + if (!ModelState.IsValid) + { + return BadRequest(ModelState.GetErrorMessages()); + } + + var result = await _settingsService.SaveAsync(collateralToVehicle); + return Ok(result); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + [HttpPost] + [Route("[action]")] + [ProducesResponseType(typeof(AccountType), 201)] + [ProducesResponseType(typeof(List), 400)] + [ProducesResponseType(500)] + public async Task PostHoldStatus([FromBody] HoldStatus holdStatus) + { + try + { + if (!ModelState.IsValid) + { + return BadRequest(ModelState.GetErrorMessages()); + } + + var result = await _settingsService.SaveAsync(holdStatus); + return Ok(result); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + [HttpPost] + [Route("[action]")] + [ProducesResponseType(typeof(AccountType), 201)] + [ProducesResponseType(typeof(List), 400)] + [ProducesResponseType(500)] + public async Task PostLoanCategory([FromBody] LoanCategory loanCategory) + { + try + { + if (!ModelState.IsValid) + { + return BadRequest(ModelState.GetErrorMessages()); + } + + var result = await _settingsService.SaveAsync(loanCategory); + return Ok(result); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + [HttpPost] + [Route("[action]")] + [ProducesResponseType(typeof(AccountType), 201)] + [ProducesResponseType(typeof(List), 400)] + [ProducesResponseType(500)] + public async Task PostLocationType([FromBody] LocationType locationType) + { + try + { + if (!ModelState.IsValid) + { + return BadRequest(ModelState.GetErrorMessages()); + } + + var result = await _settingsService.SaveAsync(locationType); + return Ok(result); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + [HttpPost] + [Route("[action]")] + [ProducesResponseType(typeof(AccountType), 201)] + [ProducesResponseType(typeof(List), 400)] + [ProducesResponseType(500)] + public async Task PostVehicleType([FromBody] VehicleType vehicleType) + { + try + { + if (!ModelState.IsValid) + { + return BadRequest(ModelState.GetErrorMessages()); + } + + var result = await _settingsService.SaveAsync(vehicleType); + return Ok(result); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/StatusController.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/StatusController.cs new file mode 100644 index 0000000..00e6441 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/StatusController.cs @@ -0,0 +1,36 @@ +using System; +using LCU.Shared.Collections.RepoApiLib.Models; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Serilog; + +namespace LCU.API.Collections.RepoApi.Controllers +{ + [Route("api/[controller]")] + [ApiController] + public class StatusController : RepoControllerBase + { + private readonly IEnvironmentView _environmentView; + + public StatusController(IHttpContextAccessor httpContextAccessor, IEnvironmentView environmentView) : base(httpContextAccessor) + { + _environmentView = environmentView; + } + + [HttpGet()] + [ProducesResponseType(200)] + [ProducesResponseType(500)] + public IActionResult Get() + { + try + { + return Ok(_environmentView); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode((int) System.Net.HttpStatusCode.InternalServerError); + } + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/VehicleFloorPricingParametersController.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/VehicleFloorPricingParametersController.cs new file mode 100644 index 0000000..20cb85d --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Controllers/VehicleFloorPricingParametersController.cs @@ -0,0 +1,119 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Configuration; +using LCU.API.Collections.RepoApi.Exceptions; +using LCU.API.Collections.RepoApi.Extensions; +using LCU.API.Collections.RepoApi.Models.Requests; +using LCU.API.Collections.RepoApi.Models.Responses; +using LCU.API.Collections.RepoApi.Services; +using LCU.Shared.Collections.RepoApiLib.Models; +using Microsoft.AspNetCore.Authentication.JwtBearer; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.FeatureManagement.Mvc; +using Serilog; + +namespace LCU.API.Collections.RepoApi.Controllers +{ + [Route("api/[controller]")] + [ApiController] + [FeatureGate(FeatureFlags.EnableControllers)] + public class VehicleFloorPricingParametersController : RepoControllerBase + { + private readonly IVehicleFloorPricingParametersService _parametersService; + + public VehicleFloorPricingParametersController( + IVehicleFloorPricingParametersService parametersService, + IHttpContextAccessor httpContextAccessor) : base(httpContextAccessor) + { + _parametersService = parametersService; + } + + // GET: api/VehicleFloorPricingParameters + [HttpGet] + [ProducesResponseType(typeof(IEnumerable), 200)] + [ProducesResponseType(500)] + public async Task Get() + { + try + { + var results = await _parametersService.ListAll(); + return Ok(results); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + // GET: api/VehicleFloorPricingParameters/5 + [HttpGet("{id}", Name = "GetVehicleFloorPricingParametersById")] + [ProducesResponseType(typeof(VehicleFloorPricingParameters), 200)] + [ProducesResponseType(typeof(string), 400)] + [ProducesResponseType(500)] + public async Task GetById(int id) + { + try + { + if (id <= 0) + { + return BadRequest("Invalid ID"); + } + + var result = await _parametersService.Get(id); + return Ok(result); + } + catch (NotFoundException nfe) + { + return NotFound(nfe.Message); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + [HttpPut()] + [ProducesResponseType(typeof(AuctionHouse), 200)] + [ProducesResponseType(typeof(List), 400)] + [ProducesResponseType(500)] + [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme, Roles = "Admin")] + public async Task Put([FromBody] VehicleFloorPricingParametersPutRequest request) + { + try + { + if (!ModelState.IsValid) + { + return BadRequest(ModelState.GetErrorMessages()); + } + + var updatedParams = await UpdateVehiceFloorPricingParameters(request.vehicleFloorPricingParameters); + return Ok(new VehicleFloorPricingParametersPutResponse { vehicleFloorPricingParameters = updatedParams }); + } + catch (NotFoundException nfe) + { + return NotFound(nfe.Message); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure in {GetType().Name} at {GetInvokerAsyncMethodName()}"); + return StatusCode(StatusCodes.Status500InternalServerError); + } + } + + private async Task UpdateVehiceFloorPricingParameters(VehicleFloorPricingParameters[] vehicleFloorPricingParameters) + { + var result = new List(); + foreach (var param in vehicleFloorPricingParameters) + { + result.Add(await _parametersService.UpdateAsync(param)); + } + return result.ToArray(); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/DataAccess/CollectionsDao.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/DataAccess/CollectionsDao.cs new file mode 100644 index 0000000..e645297 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/DataAccess/CollectionsDao.cs @@ -0,0 +1,61 @@ +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq; +using System.Net.Http; +using System.Threading.Tasks; +using LCU.API.Collections.CollectionsApiLib.Models; +using LCU.API.Collections.RepoApi.Configuration; +using LCU.Shared.Collections.RepoApiLib.Models.Settings; + +namespace LCU.API.Collections.RepoApi.DataAccess +{ + [ExcludeFromCodeCoverage] + public class CollectionsDao : DaoClient, ICollectionsDao + { + private readonly RepoApiConfiguration _configuration; + + public CollectionsDao(RepoApiConfiguration configuration, + IHttpClientFactory clientFactory) : base(clientFactory) + { + _configuration = configuration; + } + + public async Task RetrieveAccountAsync(string accountNo) + { + var url = BuildTemenosAccountUrl(accountNo); + var accounts = await RetrieveByIdentifierAsync>(url, accountNo); + + if (accounts != null && accounts.Any()) + { + return accounts.Where(x => x.AccountIdentifier == accountNo) + .OrderByDescending(x => x.OriginalLoanDate).First(); + } + + return null; + } + + public async Task> RetrieveHistoryAsync(int accountId) + { + var url = _configuration.CollectionsLetterUrl.Replace(":accountId", accountId.ToString()); + return await RetrieveByIdentifierAsync>(url, accountId.ToString()); + } + + public async Task> RetrieveBranchSetAsync() + { + var url = _configuration.CoreBranchSetUrl; + return await RetrieveAllAsync>(url); + } + + public async Task RetrieveTemenosConfigurationAsync() + { + var url = _configuration.CollectionsConfigUrl; + return await RetrieveAllAsync(url); + } + + public string BuildTemenosAccountUrl(string accountNo) + { + return _configuration.CollectionAccountUrl + _configuration.OrganizationCode + accountNo; + } + + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/DataAccess/CoreDao.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/DataAccess/CoreDao.cs new file mode 100644 index 0000000..1103c01 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/DataAccess/CoreDao.cs @@ -0,0 +1,76 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Net.Http; +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Configuration; +using LCU.Shared.Collections.RepoApiLib.Models.Consumer; + +namespace LCU.API.Collections.RepoApi.DataAccess +{ + [ExcludeFromCodeCoverage] + public class CoreDao : DaoClient, ICoreDao + { + private readonly RepoApiConfiguration _configuration; + + public CoreDao(RepoApiConfiguration configuration, + IHttpClientFactory clientFactory) : base(clientFactory) + { + _configuration = configuration; + } + + public async Task RetrieveMemberAsync(string accountNo) + { + var url = CreateUrlFromAccountNo(_configuration.CoreMemberUrl, accountNo); + return await RetrieveByIdentifierAsync(url, accountNo); + } + + public async Task RetrieveLoanAsync(string accountNo) + { + var url = CreateUrlFromAccountNo(_configuration.CoreLoanUrl, accountNo); + return await RetrieveByIdentifierAsync(url, accountNo); + } + + public async Task> RetrieveCollateralAsync(string accountNo) + { + var url = CreateUrlFromAccountNo(_configuration.CoreCollateralUrl, accountNo); + return await RetrieveByIdentifierAsync>(url, accountNo); + } + + public async Task> RetrieveTransactionsAsync(string accountNo) + { + var url = CreateUrlFromAccountNoAndDateRange(_configuration.CoreLoanTransactions, accountNo); + return await RetrieveByIdentifierAsync>(url, accountNo); + } + + private string CreateUrlFromAccountNo(string inputUrl, string accountNo) + { + var url = inputUrl.Replace(":loanId", accountNo); + return url; + } + + private string CreateUrlFromAccountNoAndDateRange(string inputUrl, string accountNo) + { + var url = inputUrl.Replace(":accountNo", accountNo); + url = url.Replace(":startDate", DateTimeForUri(DateTime.Now.AddDays(_configuration.TransactionHistoryStartDateOffset))); + url = url.Replace(":endDate", DateTimeForUri(DateTime.Now)); + url += FormatArrayValuesIntoQuery(_configuration.TransactionTypeCodes, _configuration.TransactionTypeCodeQueryPrefix); + return url; + } + + private string DateTimeForUri(DateTime dateTime) + { + return dateTime.ToString(_configuration.TransactionHistoryParameterDateFormat); + } + + private string FormatArrayValuesIntoQuery(List arrayValues, string queryPrefix) + { + var returnString = ""; + foreach (var arrayValue in arrayValues) { + returnString += (queryPrefix + arrayValue); + } + + return returnString; + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/DataAccess/DaoClient.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/DataAccess/DaoClient.cs new file mode 100644 index 0000000..937f9bc --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/DataAccess/DaoClient.cs @@ -0,0 +1,85 @@ +using System; +using System.Net; +using System.Net.Http; +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Exceptions; +using Newtonsoft.Json; +using Serilog; + +namespace LCU.API.Collections.RepoApi.DataAccess +{ + public abstract class DaoClient + { + private readonly IHttpClientFactory _clientFactory; + + protected DaoClient(IHttpClientFactory clientFactory) + { + _clientFactory = clientFactory; + } + + public async Task RetrieveByIdentifierAsync(string url, string identifier) + { + // Temporary log to illustrate this working completely + Log.Information($"Retrieve Async called for {typeof(T).Name} with {url}"); + using (var client = _clientFactory.CreateClient()) + { + var request = new HttpRequestMessage(HttpMethod.Get, url); + var response = await client.SendAsync(request); + + if (response.IsSuccessStatusCode) + { + try + { + var retrievedObject = JsonConvert.DeserializeObject( + await response.Content.ReadAsStringAsync()); + + return retrievedObject; + } + catch (Exception ex) + { + Log.Error(ex,$"Error Deserializing {typeof(T).Name} for {identifier}"); + throw new ServerErrorException(); + } + } + + if (response.StatusCode == HttpStatusCode.NotFound) + { + return default(T); + } + + Log.Error($"Retrieve {typeof(T).Name} Bad Status Code {response.StatusCode}, for { url}"); + throw new MissingRequirementException(typeof(T).Name, $"Failed to retrieve {typeof(T).Name} for {identifier}"); + } + } + + public async Task RetrieveAllAsync(string url) + { + // Temporary log + Log.Information($"Retrieve All Async called for {typeof(T).Name} with {url}"); + using (var client = _clientFactory.CreateClient()) + { + var request = new HttpRequestMessage(HttpMethod.Get, url); + var response = await client.SendAsync(request); + + if (response.IsSuccessStatusCode) + { + try + { + var retrievedObject = JsonConvert.DeserializeObject( + await response.Content.ReadAsStringAsync()); + + return retrievedObject; + } + catch (Exception ex) + { + Log.Error(ex,$"Error Deserializing {typeof(T).Name} for {url}"); + throw new ServerErrorException(); + } + } + + Log.Error($"Retrieve {typeof(T).Name} Bad Status Code {response.StatusCode}, for { url}"); + throw new MissingRequirementException(typeof(T).Name, $"Failed to retrieve {typeof(T).Name} for {url}"); + } + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/DataAccess/ICollectionsDao.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/DataAccess/ICollectionsDao.cs new file mode 100644 index 0000000..8e465b3 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/DataAccess/ICollectionsDao.cs @@ -0,0 +1,15 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.API.Collections.CollectionsApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.Settings; + +namespace LCU.API.Collections.RepoApi.DataAccess +{ + public interface ICollectionsDao + { + Task RetrieveAccountAsync(string accountNo); + Task> RetrieveHistoryAsync(int accountId); + Task> RetrieveBranchSetAsync(); + Task RetrieveTemenosConfigurationAsync(); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/DataAccess/ICoreDao.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/DataAccess/ICoreDao.cs new file mode 100644 index 0000000..b3a65cd --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/DataAccess/ICoreDao.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models.Consumer; + +namespace LCU.API.Collections.RepoApi.DataAccess +{ + public interface ICoreDao + { + Task RetrieveMemberAsync(string accountNo); + Task RetrieveLoanAsync(string accountNo); + Task> RetrieveCollateralAsync(string accountNo); + Task> RetrieveTransactionsAsync(string accountNo); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Dockerfile b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Dockerfile new file mode 100644 index 0000000..17a560c --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Dockerfile @@ -0,0 +1,5 @@ +FROM mcr.microsoft.com/dotnet/core/aspnet:2.2 +COPY bin/Debug/netcoreapp2.2/publish App/ +WORKDIR /App +ENV ASPNETCORE_ENVIRONMENT=Development +ENTRYPOINT ["dotnet", "LCU.API.Collections.RepoApi.dll"] \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/AuctionOnHoldChecker.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/AuctionOnHoldChecker.cs new file mode 100644 index 0000000..0475b77 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/AuctionOnHoldChecker.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using LCU.API.Collections.RepoApi.Domain.Processing; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.API.Collections.RepoApi.Domain.AlertChecker +{ + public class AuctionOnHoldChecker : IAlertChecker + { + private const string RehoStatus = "REHO"; + + public List CheckForAlert(RepoAccountProcessingSlip slip) + { + var newEventAlerts = new List(); + foreach (var auctionAssignment in slip.AuctionAssignments) + { + if ( + slip.UpdatedRepoAccount.Status == RehoStatus + && auctionAssignment?.HoldStatus != null + && auctionAssignment.HoldStatus > 0) + { + newEventAlerts.Add( + new EventAlert() + { + RepoId = slip.UpdatedRepoAccount.RepoId, + AccountNo = slip.UpdatedRepoAccount.AccountNo, + Message = "Auction On Hold", + CreatedBy = "Batch", + DateAdded = DateTime.Now + } + ); + } + } + + return newEventAlerts.Count > 0 ? newEventAlerts : null; + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/AuctionVinDifferentChecker.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/AuctionVinDifferentChecker.cs new file mode 100644 index 0000000..8449b52 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/AuctionVinDifferentChecker.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using LCU.API.Collections.RepoApi.Domain.Extensions; +using LCU.API.Collections.RepoApi.Domain.Processing; +using LCU.API.Collections.RepoApi.Extensions; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.API.Collections.RepoApi.Domain.AlertChecker +{ + public class AuctionVinDifferentChecker : IAlertChecker + { + public List CheckForAlert(RepoAccountProcessingSlip slip) + { + var newEventAlerts = new List(); + var repoManagerVins = slip.UpdatedRepoAccount.GetCollateralVinList(); + foreach (var auctionAssignment in slip.AuctionAssignments) + { + if (auctionAssignment?.AutoIMS?.VIN != null + && !repoManagerVins.Contains(auctionAssignment.AutoIMS.VIN.Trim().ToUpper())) + { + newEventAlerts.Add( + new EventAlert() + { + RepoId = slip.UpdatedRepoAccount.RepoId, + AccountNo = slip.UpdatedRepoAccount.AccountNo, + Message = "Auction VIN Different", + SubMessage = FormatSubMessage(auctionAssignment.AutoIMS.VIN.Trim().ToUpper(), repoManagerVins), + CreatedBy = "Batch", + DateAdded = DateTime.Now + } + ); + } + } + + return newEventAlerts.Count > 0 ? newEventAlerts : null; + } + + private static string FormatSubMessage(string auctionAssignmentVin, IReadOnlyCollection vins) + { + if (vins.Count() == 1) + { + return + $"Auction Assignment VIN: {auctionAssignmentVin} differs from RepoManager VIN: {vins.First()}"; + } + + var repoVins = vins.Aggregate((x, y) => x + ", " + y); + return $"Auction Assignment VIN: {auctionAssignmentVin} is not among RepoManager VINs: {repoVins}"; + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/CreditAdjustmentChecker.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/CreditAdjustmentChecker.cs new file mode 100644 index 0000000..3d477b1 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/CreditAdjustmentChecker.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using LCU.API.Collections.RepoApi.Domain.Processing; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.API.Collections.RepoApi.Domain.AlertChecker +{ + public class CreditAdjustmentChecker : TransactionHistoryChecker + { + private readonly List _watchedStatuses = new List { "O4R", "REPO", "SOLD" }; + private readonly List _watchedTransactionTypes = new List { "PDSB", "RPMT" }; + private const string Message = "Credit Adjustment Received"; + + public override List CheckForAlert(RepoAccountProcessingSlip slip) + { + return StandardizedCheckForAlert(new AlertProcessingSlip(slip, Message, _watchedStatuses, _watchedTransactionTypes)); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/DebitAdjustmentChecker.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/DebitAdjustmentChecker.cs new file mode 100644 index 0000000..7302099 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/DebitAdjustmentChecker.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using LCU.API.Collections.RepoApi.Domain.Processing; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.API.Collections.RepoApi.Domain.AlertChecker +{ + public class DebitAdjustmentChecker : TransactionHistoryChecker + { + private readonly List _watchedStatuses = new List { "O4R", "REPO", "SOLD" }; + private readonly List _watchedTransactionTypes = new List { "CHST", "PRCT" }; + private const string Message = "Debit Adjustment Received"; + + public override List CheckForAlert(RepoAccountProcessingSlip slip) + { + return StandardizedCheckForAlert(new AlertProcessingSlip(slip, Message, _watchedStatuses, _watchedTransactionTypes)); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/DocumentNotFoundChecker.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/DocumentNotFoundChecker.cs new file mode 100644 index 0000000..439b4de --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/DocumentNotFoundChecker.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using LCU.API.Collections.RepoApi.Domain.Processing; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.API.Collections.RepoApi.Domain.AlertChecker +{ + public class DocumentNotFoundChecker : IAlertChecker + { + private readonly string _document; + private readonly string _ilActionCode; + private readonly string _status; + private readonly string _wiActionCode; + private const string StateWisconsin = "WI"; + private const string StateIllinois = "IL"; + + public DocumentNotFoundChecker(string document, string wiActionCode, string ilActionCode = null, + string status = null) + { + _document = document; + _wiActionCode = wiActionCode.Trim().ToUpper(); + _ilActionCode = ilActionCode?.Trim().ToUpper(); + _status = status?.Trim().ToUpper(); + } + + public List CheckForAlert(RepoAccountProcessingSlip slip) + { + if (slip.Letters == null || slip.Member?.Address == null || + (_status != null && slip.UpdatedRepoAccount.Status != _status || + slip.UpdatedRepoAccount.Bankruptcy != null)) + { + return null; + } + + var isLetterMissing = false; + if (slip.Member.Address.State == StateWisconsin) + { + isLetterMissing = slip.Letters.ToList().Find(x => x.ActionCode == _wiActionCode) == null; + } + else if (_ilActionCode != null && slip.Member.Address.State == StateIllinois) + { + isLetterMissing = slip.Letters.ToList().Find(x => x.ActionCode == _ilActionCode) == null; + } + + if (isLetterMissing) + { + return new List + { + new EventAlert() + { + RepoId = slip.UpdatedRepoAccount.RepoId, + AccountNo = slip.UpdatedRepoAccount.AccountNo, + Message = _document + " Not Found", + CreatedBy = "Batch", + DateAdded = DateTime.Now + } + }; + } + + return null; + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/IAlertChecker.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/IAlertChecker.cs new file mode 100644 index 0000000..e1a4913 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/IAlertChecker.cs @@ -0,0 +1,11 @@ +using System.Collections.Generic; +using LCU.API.Collections.RepoApi.Domain.Processing; +using EventAlert = LCU.Shared.Collections.RepoApiLib.Models.EventAlert; + +namespace LCU.API.Collections.RepoApi.Domain.AlertChecker +{ + public interface IAlertChecker + { + List CheckForAlert(RepoAccountProcessingSlip slip); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/NoticeOfSurplusDeficiencyNotSentChecker.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/NoticeOfSurplusDeficiencyNotSentChecker.cs new file mode 100644 index 0000000..e5869a8 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/NoticeOfSurplusDeficiencyNotSentChecker.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using LCU.API.Collections.RepoApi.Domain.Processing; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.API.Collections.RepoApi.Domain.AlertChecker +{ + public class NoticeOfSurplusDeficiencyNotSentChecker : IAlertChecker + { + private const int OwnershipTypeImportant = 6; + private const int DaysBeforeConsideredNotSent = 2; + + public List CheckForAlert(RepoAccountProcessingSlip slip) + { + var updatedRepoAccount = slip.UpdatedRepoAccount; + if (updatedRepoAccount.RefundStatus?.RefundsReceivedDate == null || updatedRepoAccount.DateClosed != null) + { + return null; + } + + var letterSentBy = DateTime.Now.AddDays(-DaysBeforeConsideredNotSent).Date; + if (updatedRepoAccount.RefundStatus.RefundsReceivedDate < letterSentBy && updatedRepoAccount.Bankruptcy == null) + { + return new List + { + new EventAlert() + { + RepoId = updatedRepoAccount.RepoId, + AccountNo = updatedRepoAccount.AccountNo, + Message = "Notice of Surplus Deficiency Letter Not Sent", + CreatedBy = "Batch", + DateAdded = DateTime.Now, + EmailRecipient = "RepoManagerAdmin@landmarkcu.com", + EmailBody = CreateEmailBody(updatedRepoAccount) + } + }; + } + + return null; + } + + private string CreateEmailBody(RepoAccount repoAccount) + { + var message = "Notice of Surplus Deficiency Not Sent.

"; + var member = repoAccount.Borrowers?.First(b => b.OwnershipType == OwnershipTypeImportant); + var memberName = "Member Name: " + member?.IndividualName + "
"; + var accountNo = "Account No: " + repoAccount.AccountNo + "
"; + return string.Concat(message, memberName, accountNo); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/O4rNoRepoChecker.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/O4rNoRepoChecker.cs new file mode 100644 index 0000000..ebd067a --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/O4rNoRepoChecker.cs @@ -0,0 +1,118 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using LCU.API.Collections.CollectionsApiLib.Models; +using LCU.API.Collections.RepoApi.Domain.Extensions; +using LCU.API.Collections.RepoApi.Domain.Processing; +using LCU.API.Collections.RepoApi.Extensions; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.API.Collections.RepoApi.Domain.AlertChecker +{ + public class O4rNoRepoChecker : IAlertChecker + { + private readonly RepoType _repoType; + private const string O4RStatus = "O4R"; + private const string EmailDestination = "RepoManagerNoRepoCo@landmarkcu.com"; + + public O4rNoRepoChecker(RepoType repoType) + { + _repoType = repoType; + } + + private int GetDayCount() + { + switch (_repoType) + { + case RepoType.Voluntary: return 2; + case RepoType.Involuntary: return 60; + case RepoType.PreSkip: return 31; + default: return -1; + } + } + + private int GetRepeatDayCount() + { + switch (_repoType) + { + case RepoType.Voluntary: return 1; + case RepoType.Involuntary: return 30; + default: return 0; + } + } + + public bool ShouldSendRepeatedAlert(int daysInStatus, int dayCount, int repeatCount) + { + return ( + daysInStatus > dayCount + && (repeatCount > 0) + && ((daysInStatus - dayCount) % repeatCount == 0) + ); + } + + public bool IsRepoAssigned(RepoAccount repoAccount) + { + foreach (var collateral in repoAccount.Collaterals) + { + if (collateral.RepoCompanySelections?.FirstOrDefault(x => x.RepoCompanyAssignmentDate != null && x.RepoType == _repoType) != null) + { + return true; + } + } + + return false; + } + + public List CheckForAlert(RepoAccountProcessingSlip slip) + { + var daysInStatus = slip.UpdatedRepoAccount.GetDaysInStatus(O4RStatus); + if (daysInStatus > 0 && slip.UpdatedRepoAccount.Status == O4RStatus) + { + // In order to reduce duplicate notifications, do not create a notification if no repo is assigned. + // An 'action needed' item will be created for O4R No Repo if no repo is assigned. A notification is redundant. + if (daysInStatus < GetDayCount() || !IsRepoAssigned(slip.UpdatedRepoAccount)) + { + return null; + } + + if (daysInStatus == GetDayCount() || ShouldSendRepeatedAlert(daysInStatus, GetDayCount(), GetRepeatDayCount())) + { + return new List + { + new EventAlert() + { + RepoId = slip.UpdatedRepoAccount.RepoId, + AccountNo = slip.UpdatedRepoAccount.AccountNo, + Message = "O4R No Repo", + CreatedBy = "Batch", + DateAdded = DateTime.Now, + EmailRecipient = _repoType == RepoType.PreSkip + ? EmailDestination + : null, + EmailBody = _repoType == RepoType.PreSkip + ? CreateEmailBody(slip.UpdatedRepoAccount) + : null + } + }; + } + } + + return null; + } + + private string CreateEmailBody(RepoAccount repoAccount) + { + var message = "PreSkip has ended, please file a Skip Claim.

"; + var member = repoAccount.Borrowers?.First(b => b.OwnershipType == 6); + var memberName = "Member Name: " + member?.IndividualName + "
"; + var accountNo = "Account No: " + repoAccount.AccountNo + "
"; + var collateral = repoAccount.Collaterals.FirstOrDefault(c => c.RepoCompanySelections?.FirstOrDefault(x => x.RepoType == _repoType) != null); + var year = "Year: " + collateral.Year + "
"; + var make = "Make: " + collateral.Make + "
"; + var model = "Model: " + collateral.Model + "
"; + var vin = "VIN: " + collateral.Vin + "
"; + + return string.Concat(message, memberName, accountNo, year, make, model, vin); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/PaymentReceivedChecker.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/PaymentReceivedChecker.cs new file mode 100644 index 0000000..7978cd0 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/PaymentReceivedChecker.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using LCU.API.Collections.RepoApi.Domain.Processing; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.Consumer; + +namespace LCU.API.Collections.RepoApi.Domain.AlertChecker +{ + public class PaymentReceivedChecker : TransactionHistoryChecker + { + private readonly List _watchedStatuses = new List { "O4R", "REPO", "SOLD" }; + private readonly List _watchedTransactionTypes = new List { "COFR", "POFF", "EXT", "SPMT", "XPMT" }; + private const string EmailDestination = "RepoManagerCreditDebits@landmarkcu.com"; + + public override List CheckForAlert(RepoAccountProcessingSlip slip) + { + var newEventAlerts = new List(); + var results = GetRecentTransactionsFromType(_watchedTransactionTypes, slip.TransactionHistory); + if (results != null && _watchedStatuses.Contains(slip.UpdatedRepoAccount.Status)) + { + var dueDate = slip.Loan?.NextDueDate.ToString(CultureInfo.CurrentCulture) ?? "Unknown"; + foreach (var result in results) + { + newEventAlerts.Add(new EventAlert() + { + RepoId = slip.UpdatedRepoAccount.RepoId, + AccountNo = slip.UpdatedRepoAccount.AccountNo, + Message = "Payment Received", + SubMessage = FormatTransactionMessage(result), + CreatedBy = "Batch", + DateAdded = DateTime.Now, + EmailRecipient = EmailDestination, + EmailBody = CreateEmailBody(slip.UpdatedRepoAccount, result, dueDate) + }); + } + } + + return newEventAlerts.Count > 0 ? newEventAlerts : null; + } + + private string CreateEmailBody(RepoAccount repoAccount, CoreTransaction coreTransaction, string nextDueDate) + { + var message = "Loan Payment

"; + var member = repoAccount.Borrowers?.First(b => b.OwnershipType == 6); + var memberName = "Member Name: " + member?.IndividualName + "
"; + var accountNo = "Account No: " + repoAccount.AccountNo + "
"; + var paymentAmount = "Payment Amount: " + coreTransaction.amount + "
"; + var nextDueDateString = "Next Due Date: " + nextDueDate + "
"; + var loanBalance = "Loan Balance: " + coreTransaction.runningBalance + "
"; + + return string.Concat(message, memberName, accountNo, paymentAmount, nextDueDateString, loanBalance); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/RedemptionEndedNoTitleOrderedChecker.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/RedemptionEndedNoTitleOrderedChecker.cs new file mode 100644 index 0000000..fc04bc8 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/RedemptionEndedNoTitleOrderedChecker.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using LCU.API.Collections.RepoApi.Domain.Processing; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.API.Collections.RepoApi.Domain.AlertChecker +{ + public class RedemptionEndedNoTitleOrderedChecker : IAlertChecker + { + private const string RepoStatus = "REPO"; + private const int RedemptionExpiredDaysToWait = 7; + + public List CheckForAlert(RepoAccountProcessingSlip slip) + { + if (slip.UpdatedRepoAccount.Status.ToUpper() == RepoStatus && + DateTime.Now.Date > slip.UpdatedRepoAccount.RedemptionExpiredDate?.AddDays(RedemptionExpiredDaysToWait) && + slip.UpdatedRepoAccount.Collaterals.FirstOrDefault(x => x.RetitledInLandmarkName == null) != null) + { + return new List + { + new EventAlert() + { + RepoId = slip.UpdatedRepoAccount.RepoId, + AccountNo = slip.UpdatedRepoAccount.AccountNo, + Message = "Redemption Ended No Title Ordered", + CreatedBy = "Batch", + DateAdded = DateTime.Now + } + }; + } + + return null; + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/RepoNotMovedChecker.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/RepoNotMovedChecker.cs new file mode 100644 index 0000000..00ba212 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/RepoNotMovedChecker.cs @@ -0,0 +1,68 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using LCU.API.Collections.RepoApi.Domain.Extensions; +using LCU.API.Collections.RepoApi.Domain.Processing; +using LCU.API.Collections.RepoApi.Extensions; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.API.Collections.RepoApi.Domain.AlertChecker +{ + public class RepoNotMovedChecker : IAlertChecker + { + private readonly int _dayCount; + private const string RepoStatus = "REPO"; + private const int DaysBeforeSendEmail = 14; + private const string EmailDestination = "RepoManagerAdmin@landmarkcu.com"; + + public RepoNotMovedChecker(int dayCount = 30) + { + _dayCount = dayCount; + } + + public List CheckForAlert(RepoAccountProcessingSlip slip) + { + var daysInStatus = slip.UpdatedRepoAccount.GetDaysInStatus(RepoStatus); + if (slip.UpdatedRepoAccount.Status.ToUpper() != RepoStatus || + slip.UpdatedRepoAccount.Collaterals == null || !slip.UpdatedRepoAccount.Collaterals.Any() + || daysInStatus < _dayCount) + { + return null; + } + + foreach (var collateral in slip.UpdatedRepoAccount.Collaterals) + { + if (collateral.AuctionAssignmentToCollaterals != null && + collateral.AuctionAssignmentToCollaterals.Any()) + { + var assignment = collateral.AuctionAssignmentToCollaterals + .Where(x => x.AuctionAssignment != null && x.AuctionAssignment.DateSubmitted == null) + .ToList(); + + if (assignment.Any() && daysInStatus >= _dayCount) + { + return new List + { + new EventAlert() + { + RepoId = slip.UpdatedRepoAccount.RepoId, + AccountNo = slip.UpdatedRepoAccount.AccountNo, + Message = "Repo Not Moved", + CreatedBy = "Batch", + DateAdded = DateTime.Now, + EmailRecipient = daysInStatus == DaysBeforeSendEmail + ? EmailDestination + : null, + EmailBody = daysInStatus == DaysBeforeSendEmail + ? string.Format("{0} Account status REPO, Not Moved for extended time.", slip.UpdatedRepoAccount.AccountNo) + : null + } + }; + } + } + } + + return null; + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/RepoNotSoldChecker.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/RepoNotSoldChecker.cs new file mode 100644 index 0000000..7e86cc8 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/RepoNotSoldChecker.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using LCU.API.Collections.RepoApi.Domain.Extensions; +using LCU.API.Collections.RepoApi.Domain.Processing; +using LCU.API.Collections.RepoApi.Extensions; +using EventAlert = LCU.Shared.Collections.RepoApiLib.Models.EventAlert; + +namespace LCU.API.Collections.RepoApi.Domain.AlertChecker +{ + public class RepoNotSoldChecker : IAlertChecker + { + private readonly int _dayCount; + private readonly int _repeatDayCount; + private const string RepoStatus = "REPO"; + private const string DestinationEmail = "RepoManagerAdmin@landmarkcu.com"; + + public RepoNotSoldChecker(int dayCount = 30, int repeatDayCount = 0) + { + _dayCount = dayCount; + _repeatDayCount = repeatDayCount; + } + + public List CheckForAlert(RepoAccountProcessingSlip slip) + { + var status = slip.UpdatedRepoAccount.Status.ToUpper().Trim(); + var days = slip.UpdatedRepoAccount.GetDaysInStatus(status); + if (status == RepoStatus && days > 0) + { + if ((days == _dayCount) || days >= _dayCount && ((days - _dayCount) % _repeatDayCount == 0)) + { + var member = slip.UpdatedRepoAccount.Borrowers?.First(b => b.OwnershipType == 6); + return new List + { + new EventAlert() + { + RepoId = slip.UpdatedRepoAccount.RepoId, + AccountNo = slip.UpdatedRepoAccount.AccountNo, + Message = "Repo Not Sold", + CreatedBy = "Batch", + DateAdded = DateTime.Now, + EmailRecipient = DestinationEmail, + EmailBody = string.Format("{0} {1} Account status REPO, Not Sold for extended time.", + slip.UpdatedRepoAccount.AccountNo, member?.IndividualName) + } + }; + } + } + + return null; + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/RtcLetterNotFoundChecker.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/RtcLetterNotFoundChecker.cs new file mode 100644 index 0000000..7855995 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/RtcLetterNotFoundChecker.cs @@ -0,0 +1,71 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using LCU.API.Collections.CollectionsApiLib.Models; +using LCU.API.Collections.RepoApi.Domain.Processing; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.API.Collections.RepoApi.Domain.AlertChecker +{ + public class RtcLetterNotFoundChecker : IAlertChecker + { + private readonly string _document; + private readonly IEnumerable _actionCodes; + private const string O4RStatus = "O4R"; + private const string StateWisconsin = "WI"; + + public RtcLetterNotFoundChecker(string document, IEnumerable actionCodes) + { + _document = document; + _actionCodes = actionCodes.Select(code => code.Trim().ToUpper()); + } + + public List CheckForAlert(RepoAccountProcessingSlip slip) + { + if (slip.Member?.Address == null || slip.Member.Address.State != StateWisconsin || slip.Letters == null) + { + return null; + } + + foreach (var collateral in slip.UpdatedRepoAccount.Collaterals) + { + if (collateral.RepoCompanySelections?.FirstOrDefault(x => x.RepoType == RepoType.Voluntary) != null) + { + return null; + } + } + + var letters = slip.Letters; + if (IsLetterMissing(letters) && (slip.UpdatedRepoAccount.Status.ToUpper().Trim() == O4RStatus)) + { + return new List + { + new EventAlert() + { + RepoId = slip.UpdatedRepoAccount.RepoId, + AccountNo = slip.UpdatedRepoAccount.AccountNo, + Message = _document + " Not Found", + CreatedBy = "Batch", + DateAdded = DateTime.Now + } + }; + } + + return null; + } + + private bool IsLetterMissing(IEnumerable letters) + { + var sentLetterCodes = letters.Select(x => x.ActionCode).ToList(); + foreach (var actionCode in _actionCodes) + { + if (sentLetterCodes.Contains(actionCode)) + { + return false; + } + } + + return true; + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/SaleFundsReceivedChecker.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/SaleFundsReceivedChecker.cs new file mode 100644 index 0000000..956bb15 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/SaleFundsReceivedChecker.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using LCU.API.Collections.RepoApi.Domain.Processing; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.API.Collections.RepoApi.Domain.AlertChecker +{ + public class SaleFundsReceivedChecker : TransactionHistoryChecker + { + private readonly List _watchedStatuses = null; + private readonly List _watchedTransactionTypes = new List { "PRCT" }; + private const string Message = "Sale Funds Received"; + + public override List CheckForAlert(RepoAccountProcessingSlip slip) + { + return StandardizedCheckForAlert(new AlertProcessingSlip(slip, Message, _watchedStatuses, _watchedTransactionTypes)); + } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/SkipEndChecker.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/SkipEndChecker.cs new file mode 100644 index 0000000..df841ec --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/SkipEndChecker.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using LCU.API.Collections.RepoApi.Domain.Extensions; +using LCU.API.Collections.RepoApi.Domain.Processing; +using LCU.API.Collections.RepoApi.Extensions; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.API.Collections.RepoApi.Domain.AlertChecker +{ + public class SkipEndChecker : IAlertChecker + { + private readonly int _dayCount; + private const string O4RStatus = "O4R"; + + public SkipEndChecker(int dayCount = 30) + { + _dayCount = dayCount; + } + + public List CheckForAlert(RepoAccountProcessingSlip slip) + { + if (slip.UpdatedRepoAccount.Status == O4RStatus + && slip.UpdatedRepoAccount.GetDaysInStatus(O4RStatus) >= _dayCount + && slip.UpdatedRepoAccount.IsCurrentlySkipClaim()) + { + return new List + { + new EventAlert() + { + RepoId = slip.UpdatedRepoAccount.RepoId, + AccountNo = slip.UpdatedRepoAccount.AccountNo, + Message = "Skip Claim Ended", + CreatedBy = "Batch", + DateAdded = DateTime.Now + } + }; + } + + return null; + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/SkipNotPaidChecker.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/SkipNotPaidChecker.cs new file mode 100644 index 0000000..4cb842a --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/SkipNotPaidChecker.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using LCU.API.Collections.RepoApi.Domain.Extensions; +using LCU.API.Collections.RepoApi.Domain.Processing; +using LCU.API.Collections.RepoApi.Extensions; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.API.Collections.RepoApi.Domain.AlertChecker +{ + public class SkipNotPaidChecker : IAlertChecker + { + private readonly int _dayCount; + private readonly int _repeatDayCount; + private const string O4RStatus = "O4R"; + private const string RepoSubStatusPaidSkip = "PSKP"; + + + public SkipNotPaidChecker(int dayCount = 30, int repeatDayCount = 0) + { + _dayCount = dayCount; + _repeatDayCount = repeatDayCount; + } + + public List CheckForAlert(RepoAccountProcessingSlip slip) + { + var days = slip.UpdatedRepoAccount.GetDaysInStatus(O4RStatus); + if (slip.UpdatedRepoAccount.Status == O4RStatus + && days >= _dayCount && slip.UpdatedRepoAccount.IsCurrentlySkipClaim()) + { + if (!string.IsNullOrWhiteSpace(slip.UpdatedRepoAccount.SubStatus) && + slip.UpdatedRepoAccount.SubStatus.Trim().ToUpper() == RepoSubStatusPaidSkip) + { + return null; + } + + if ((days == _dayCount) || days >= _dayCount && ((days - _dayCount) % _repeatDayCount == 0)) + { + return new List + { + new EventAlert() + { + RepoId = slip.UpdatedRepoAccount.RepoId, + AccountNo = slip.UpdatedRepoAccount.AccountNo, + Message = "Skip Not Paid", + CreatedBy = "Batch", + DateAdded = DateTime.Now + } + }; + } + } + + return null; + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/SkipPaidChecker.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/SkipPaidChecker.cs new file mode 100644 index 0000000..4f560c2 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/SkipPaidChecker.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using LCU.API.Collections.RepoApi.Domain.Processing; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.API.Collections.RepoApi.Domain.AlertChecker +{ + public class SkipPaidChecker : IAlertChecker + { + public const string RepoSubStatusPaidSkip = "PSKP"; + + public List CheckForAlert(RepoAccountProcessingSlip slip) + { + if (slip.UpdatedRepoAccount != null && !string.IsNullOrWhiteSpace(slip.UpdatedRepoAccount.SubStatus) && + slip.UpdatedRepoAccount.SubStatus.Trim().ToUpper() == RepoSubStatusPaidSkip && + slip.UpdatedRepoAccount.Status.ToUpper().Trim() != RepoSubStatusPaidSkip) + { + slip.UpdatedRepoAccount.Status = RepoSubStatusPaidSkip; // TODO Does this get saved? Is it ok to do? (NO) + return new List + { + new EventAlert() + { + RepoId = slip.UpdatedRepoAccount.RepoId, + AccountNo = slip.UpdatedRepoAccount.AccountNo, + Message = "Skip Claim Paid", + CreatedBy = "Batch", + DateAdded = DateTime.Now + } + }; + } + + return null; + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/SoldNoProceedsChecker.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/SoldNoProceedsChecker.cs new file mode 100644 index 0000000..c6654a1 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/SoldNoProceedsChecker.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using LCU.API.Collections.RepoApi.Domain.Processing; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.API.Collections.RepoApi.Domain.AlertChecker +{ + public class SoldNoProceedsChecker : IAlertChecker + { + private const int DaysToWaitForSold = 5; + + public List CheckForAlert(RepoAccountProcessingSlip slip) + { + foreach (var auctionAssignment in slip.AuctionAssignments) + { + if ( + auctionAssignment?.AutoIMS?.SoldDate != null + && auctionAssignment.AutoIMS.SoldDate < DateTime.Now.AddDays(-DaysToWaitForSold) + && auctionAssignment.AutoIMS.FundsSent == null) + { + return new List + { + new EventAlert() + { + RepoId = slip.UpdatedRepoAccount.RepoId, + AccountNo = slip.UpdatedRepoAccount.AccountNo, + Message = "Sold No Proceeds", + CreatedBy = "Batch", + DateAdded = DateTime.Now + } + }; + } + } + + return null; + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/StatusChangeChecker.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/StatusChangeChecker.cs new file mode 100644 index 0000000..fcd2d4c --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/StatusChangeChecker.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using LCU.API.Collections.RepoApi.Domain.Processing; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.API.Collections.RepoApi.Domain.AlertChecker +{ + public class StatusChangeChecker : IAlertChecker + { + private readonly string _watchStatus; + private readonly IEnumerable _fromStatusList; + private const string NoStatus = ""; + + public StatusChangeChecker(string watchStatus, IEnumerable fromStatusList = null) + { + _watchStatus = watchStatus.Trim().ToUpper(); + _fromStatusList = fromStatusList; + } + + public List CheckForAlert(RepoAccountProcessingSlip slip) + { + var originalStatus = slip.ExistingRepoAccount?.Status.ToUpper().Trim(); + var updatedStatus = slip.UpdatedRepoAccount.Status.ToUpper().Trim(); + + // new account. + if (originalStatus == null) + { + originalStatus = NoStatus; + } + + if (updatedStatus == _watchStatus + && originalStatus != _watchStatus + && (_fromStatusList == null || _fromStatusList.Contains(originalStatus))) + { + return new List + { + new EventAlert() + { + RepoId = slip.UpdatedRepoAccount.RepoId, + AccountNo = slip.UpdatedRepoAccount.AccountNo, + Message = "Status Changed to " + _watchStatus, + SubMessage = + $"Previously {originalStatus}. I confirm that I have updated the Status to {updatedStatus} in RDN.", + CreatedBy = "Batch", + DateAdded = DateTime.Now + } + }; + } + + return null; + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/TimeInStatusChecker.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/TimeInStatusChecker.cs new file mode 100644 index 0000000..c5f85c7 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/TimeInStatusChecker.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using LCU.API.Collections.RepoApi.Domain.Extensions; +using LCU.API.Collections.RepoApi.Domain.Processing; +using LCU.API.Collections.RepoApi.Extensions; +using EventAlert = LCU.Shared.Collections.RepoApiLib.Models.EventAlert; + +namespace LCU.API.Collections.RepoApi.Domain.AlertChecker +{ + public class TimeInStatusChecker : IAlertChecker + { + private readonly string _checkStatus; + private readonly int _dayCount; + private readonly int _repeatDayCount; + + public TimeInStatusChecker(string checkStatus, int dayCount = 30, int repeatDayCount = 0) + { + _checkStatus = checkStatus; + _dayCount = dayCount; + _repeatDayCount = repeatDayCount; + } + + public List CheckForAlert(RepoAccountProcessingSlip slip) + { + var status = slip.UpdatedRepoAccount.Status.ToUpper().Trim(); + var days = slip.UpdatedRepoAccount.GetDaysInStatus(status); + if (days <= 0 || status != _checkStatus) + { + return null; + } + + if ((days == _dayCount) || days >= _dayCount && ((days - _dayCount) % _repeatDayCount == 0)) + { + return new List + { + new EventAlert() + { + RepoId = slip.UpdatedRepoAccount.RepoId, + AccountNo = slip.UpdatedRepoAccount.AccountNo, + Message = days + " days in " + _checkStatus, + CreatedBy = "Batch", + DateAdded = DateTime.Now + } + }; + } + + return null; + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/TransactionHistoryChecker.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/TransactionHistoryChecker.cs new file mode 100644 index 0000000..b29d3b9 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/AlertChecker/TransactionHistoryChecker.cs @@ -0,0 +1,95 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using LCU.API.Collections.RepoApi.Domain.Processing; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.Consumer; + +namespace LCU.API.Collections.RepoApi.Domain.AlertChecker +{ + public abstract class TransactionHistoryChecker : IAlertChecker + { + private readonly int _daysInPastToSearch; + + protected TransactionHistoryChecker(int daysInPastToSearch = 3) + { + _daysInPastToSearch = daysInPastToSearch; + } + + public abstract List CheckForAlert(RepoAccountProcessingSlip slip); + + protected List StandardizedCheckForAlert(AlertProcessingSlip alertProcessingSlip) + { + var newEventAlerts = new List(); + var results = GetRecentTransactionsFromType + ( + alertProcessingSlip.WatchedTransactionTypes, + alertProcessingSlip.AccountProcessingSlip.TransactionHistory + ); + if (results != null && AccountStatusIsQualified(alertProcessingSlip.WatchedStatusTypes, + alertProcessingSlip.AccountProcessingSlip.UpdatedRepoAccount.Status)) + { + foreach (var result in results) + { + newEventAlerts.Add(new EventAlert() + { + RepoId = alertProcessingSlip.AccountProcessingSlip.UpdatedRepoAccount.RepoId, + AccountNo = alertProcessingSlip.AccountProcessingSlip.UpdatedRepoAccount.AccountNo, + Message = alertProcessingSlip.Message, + SubMessage = FormatTransactionMessage(result), + CreatedBy = "Batch", + DateAdded = DateTime.Now + } + ); + } + } + + return newEventAlerts.Count > 0 ? newEventAlerts : null; + } + + private static bool AccountStatusIsQualified(List watchedStatusTypes, string status) + { + return watchedStatusTypes?.Contains(status.ToUpper()) ?? true; + } + + public static string FormatTransactionMessage(CoreTransaction transaction) + { + var message = ""; + if (transaction.transactionTypeCode.ToLower().Contains("undo")) + { + message += "***TRANSACTION UNDONE*** - "; + } + + return message + + $"Transaction Type: \"{transaction.transactionTypeCode}\" | Posting: {transaction.postingDate} | Transaction: {transaction.amount?.ToString("C2")} | Balance: {transaction.runningBalance?.ToString("C2")} | Description: \"{transaction.transactionTypeDescription}\""; + } + + protected List GetRecentTransactionsFromType(List transactionTypes, IReadOnlyCollection transactions) + { + var returnItems = new List(); + + if (transactions != null && transactions.Any()) + { + foreach (var transactionType in transactionTypes) + { + returnItems.AddRange(GetRecentTransactionsFromType(transactionType, _daysInPastToSearch, transactions)); + } + } + + return returnItems.Count > 0 ? returnItems : null; + } + + private static IEnumerable GetRecentTransactionsFromType(string transactionType, int daysInPast, IReadOnlyCollection transactions) + { + return ( + from transaction in transactions + where ( + transaction.postingDate > DateTime.Now.AddDays(-daysInPast) + && transaction.transactionTypeCode.ToLower().Contains(transactionType.ToLower() + ) + ) + select transaction + ).ToList(); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/Extensions/RepoAccountExtensions.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/Extensions/RepoAccountExtensions.cs new file mode 100644 index 0000000..fcdbc93 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/Extensions/RepoAccountExtensions.cs @@ -0,0 +1,73 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using LCU.API.Collections.CollectionsApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.API.Collections.RepoApi.Domain.Extensions +{ + public static class RepoAccountExtensions + { + public static bool HasAnyCollateral(this RepoAccount repoAccount) + { + return repoAccount?.Collaterals != null && repoAccount.Collaterals.Any(); + } + + public static IReadOnlyCollection GetCollateralVinList(this RepoAccount repoAccount) + { + if (repoAccount?.Collaterals != null && repoAccount.Collaterals.Any()) + { + return repoAccount.Collaterals.Select(x => x.Vin?.Trim().ToUpper()).ToList(); + } + + return new List(); + } + + public static IReadOnlyCollection GetUniqueAuctionAssignmentIds(this RepoAccount repoAccount) + { + var aaList = new List(); + if (repoAccount?.Collaterals == null || !repoAccount.Collaterals.Any()) return aaList; + + foreach (var collateral in repoAccount.Collaterals) + { + if (collateral.AuctionAssignmentToCollaterals?.Any() != true) continue; + + foreach (var toCollateral in collateral.AuctionAssignmentToCollaterals) + { + aaList.Add(toCollateral.AuctionAssignmentId); + } + } + + return aaList; + } + + public static int GetDaysInStatus(this RepoAccount repoAccount, string status) + { + if (repoAccount?.RepoStatusChanges == null || !repoAccount.RepoStatusChanges.Any()) + { + return -1; + } + var lastStatus = repoAccount.RepoStatusChanges.LastOrDefault(x => x.StatusTo == status); + if (lastStatus != null) + { + return (DateTime.Now - lastStatus.ChangedDate).Days; + } + return -1; + } + + public static bool IsCurrentlySkipClaim(this RepoAccount updatedRepoAccount) + { + foreach (var collateral in updatedRepoAccount.Collaterals) + { + if (collateral.RepoCompanySelections == null || !collateral.RepoCompanySelections.Any()) continue; + if (collateral.RepoCompanySelections?.OrderByDescending(x => x.DateTimeCreated).First().RepoType == + RepoType.Skip) + { + return true; + } + } + + return false; + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/Extensions/TemenosAccountExtensions.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/Extensions/TemenosAccountExtensions.cs new file mode 100644 index 0000000..ef44532 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/Extensions/TemenosAccountExtensions.cs @@ -0,0 +1,84 @@ +using System.Linq; +using LCU.API.Collections.CollectionsApiLib.Models; + +namespace LCU.API.Collections.RepoApi.Domain.Extensions +{ + public static class TemenosAccountExtensions + { + public const string UserStatusFieldOld = "User Status Code 1"; + public const int OpenCaseStatus = 33; + public const int CaseTypeRepossession = 7; + + public static bool HasOldIntellectStatus(this TemenosAccount recoveryAccount) + { + return recoveryAccount?.CustomFieldMap != null + && recoveryAccount.CustomFieldMap.ContainsKey(UserStatusFieldOld) + && !string.IsNullOrWhiteSpace(recoveryAccount.CustomFieldMap[UserStatusFieldOld]); + } + + /** + * CaseId of 0 corresponds to "An open case with a valid RepoStatus" + */ + public static bool HasRecoveryCase(this TemenosAccount recoveryAccount, int caseId) + { + if (recoveryAccount?.Cases == null || !recoveryAccount.Cases.Any()) + { + return false; + } + + return caseId == 0 ? recoveryAccount.HasOpenRecoveryCase() : recoveryAccount.HasSpecificCase(caseId); + } + + public static bool HasOpenRecoveryCase(this TemenosAccount recoveryAccount) + { + TemenosCase selectedCase = null; + + if (recoveryAccount?.Cases == null || !recoveryAccount.Cases.Any()) + { + return false; + } + + selectedCase = recoveryAccount.Cases + .FirstOrDefault(x => x.CaseStatusId == OpenCaseStatus && x.RepoStatus != RepoStatus.UNKNOWN); + + return (selectedCase != null); + } + + public static bool HasSpecificCase(this TemenosAccount recoveryAccount, int caseId) + { + TemenosCase selectedCase = null; + + if (recoveryAccount?.Cases == null || !recoveryAccount.Cases.Any()) + { + return false; + } + + selectedCase = recoveryAccount.Cases.FirstOrDefault(x => x.CaseId == caseId); + return (selectedCase != null); + } + + public static TemenosCase FindRecoveryCaseOrDefault(this TemenosAccount recoveryAccount, int caseId) + { + TemenosCase selectedCase = null; + + if (recoveryAccount?.Cases == null || !recoveryAccount.Cases.Any()) + { + return null; + } + + if (caseId > 0) + { + selectedCase = recoveryAccount.Cases.FirstOrDefault(x => x.CaseId == caseId); + } + else + { + selectedCase = recoveryAccount.Cases + .Where(x => x.CaseStatusId == OpenCaseStatus && x.RepoStatus != RepoStatus.UNKNOWN + && x.CaseTypeId == CaseTypeRepossession && x.RepoStatus != RepoStatus.INELIGIBLE) + .OrderByDescending(x => x.CreatedDate).FirstOrDefault(); + } + + return selectedCase; + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/FloorPricing/FloorPricingStrategyFactory.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/FloorPricing/FloorPricingStrategyFactory.cs new file mode 100644 index 0000000..4ef5b43 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/FloorPricing/FloorPricingStrategyFactory.cs @@ -0,0 +1,21 @@ +using System.Collections.Generic; +using LCU.API.Collections.RepoApi.Domain.FloorPricing.Strategies; + +namespace LCU.API.Collections.RepoApi.Domain.FloorPricing +{ + public class FloorPricingStrategyFactory : IFloorPricingStrategyFactory + { + public FloorPricingStrategyFactory() + { + } + + public IReadOnlyCollection GetFloorPricingStrategies() + { + return new List() + { + new AutoImsSuggestedValue(), + new NadaMmrConditionValue() + }; + } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/FloorPricing/IFloorPricingStrategy.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/FloorPricing/IFloorPricingStrategy.cs new file mode 100644 index 0000000..ee90b38 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/FloorPricing/IFloorPricingStrategy.cs @@ -0,0 +1,13 @@ +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.API.Collections.RepoApi.Domain.FloorPricing +{ + public interface IFloorPricingStrategy + { + + FloorPriceCalculationResult CalculateFloorPrice(FloorPriceCalculationParams fpcParams); + int GetStrategyWeight(); + // Requirements and Qualifications + + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/FloorPricing/IFloorPricingStrategyFactory.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/FloorPricing/IFloorPricingStrategyFactory.cs new file mode 100644 index 0000000..fd21300 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/FloorPricing/IFloorPricingStrategyFactory.cs @@ -0,0 +1,9 @@ +using System.Collections.Generic; + +namespace LCU.API.Collections.RepoApi.Domain.FloorPricing +{ + public interface IFloorPricingStrategyFactory + { + IReadOnlyCollection GetFloorPricingStrategies(); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/FloorPricing/Strategies/AutoImsSuggestedValue.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/FloorPricing/Strategies/AutoImsSuggestedValue.cs new file mode 100644 index 0000000..5737479 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/FloorPricing/Strategies/AutoImsSuggestedValue.cs @@ -0,0 +1,43 @@ +using System; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.API.Collections.RepoApi.Domain.FloorPricing.Strategies +{ + /** + * This strategy uses the suggested price from the ImsAutoFileData entry for the auction. + */ + public class AutoImsSuggestedValue : IFloorPricingStrategy + { + public AutoImsSuggestedValue() { } + + public FloorPriceCalculationResult CalculateFloorPrice(FloorPriceCalculationParams fpcParams) + { + var result = new FloorPriceCalculationResult() + { + StrategyName = this.GetType().FullName, + Success = false + }; + + if (fpcParams?.ImsAutoFileData?.AuctionGuideBookPrice != null) + { + // Price must be rounded to nearest $5 per business. + var inputPrice = (double)(fpcParams.ImsAutoFileData.AuctionGuideBookPrice ?? 0); + result.FloorPrice = (decimal) (Math.Round( inputPrice / 5.0) * 5); + result.Success = result.FloorPrice > 0; + result.FailureReason = result.Success ? "" : "Failed attempt to use auction guide book price."; + } + else + { + result.Success = false; + result.FailureReason = "Auction Guide Book Price missing."; + } + + return result; + } + + public int GetStrategyWeight() + { + return 0; // This is NOT the preferred strategy. + } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/FloorPricing/Strategies/NadaMmrConditionValue.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/FloorPricing/Strategies/NadaMmrConditionValue.cs new file mode 100644 index 0000000..a737d84 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/FloorPricing/Strategies/NadaMmrConditionValue.cs @@ -0,0 +1,144 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.WebServices.NADA; +using Microsoft.EntityFrameworkCore.Internal; +using Enumerable = System.Linq.Enumerable; + +namespace LCU.API.Collections.RepoApi.Domain.FloorPricing.Strategies +{ + /** + * This strategy uses the AutoIms MMR values, the values from Nada, and the condition from AutoIms along + * with a specific formula, to calculate a floor. + */ + public class NadaMmrConditionValue : IFloorPricingStrategy + { + + public FloorPriceCalculationResult CalculateFloorPrice(FloorPriceCalculationParams fpcParams) + { + var result = new FloorPriceCalculationResult() + { + StrategyName = this.GetType().FullName, + Success = false, + ResultWeight = -1 + }; + + if (fpcParams?.CollateralValuation == null || fpcParams?.ImsAutoFileData == null || + fpcParams?.VehicleFloorPricingParameters == null + || fpcParams?.VehicleFloorPricingParameters?.Any() == false) + { + // May want to log here, or set a reason code on the result. + result.FailureReason = "Missing ImsAuto File, Pricing Parameters, or Collateral Valuation"; + return result; + } + + // 1. use condition to find the correct params. + // + VehicleDemicalGradeCode is ignored, ApprovedVehicleGrade is preferred, and Vehicle Grade is the fallback. + var condition = fpcParams.ImsAutoFileData.ApprovedVehicleGrade ?? fpcParams.ImsAutoFileData.VehicleGrade; + + if (condition <= 0 || condition == null) + { + result.FailureReason = "No Condition In AutoIMS File Data"; + return result; + } + + // 2. Get the matching floor pricing calculation row. + var floorPricing = Enumerable.First(Enumerable.Where(fpcParams.VehicleFloorPricingParameters, + x => condition >= x.LowCondition && condition <= x.HighCondition)); + + // 3. Get the floor pricing params based on matching condition. + var mmrValue = GetMMRValueByParam(floorPricing.MMRAdjustedValue, fpcParams.ImsAutoFileData, + fpcParams.ImsAutoFileData.AuctionGuideBookPrice ?? 0); + + List nadaValues = new List(); + + nadaValues.Add(GetNadaValueByParam(floorPricing.NADAFirstValue, fpcParams.CollateralValuation)); + nadaValues.Add(GetNadaValueByParam(floorPricing.NADASecondValue, fpcParams.CollateralValuation)); + + bool onlyZeroNadaValues = nadaValues.TrueForAll(x => x == 0); + + if (fpcParams.CollateralValuation.Year <= (DateTime.Now.AddYears(-7).Year) || onlyZeroNadaValues) + { + nadaValues.Add(fpcParams.CollateralValuation.TradeIn); + onlyZeroNadaValues = nadaValues.TrueForAll(x => x == 0); + } + + // If there are no NADA or MMR prices, fail the strategy + if (onlyZeroNadaValues && (mmrValue == 0 || mmrValue == fpcParams.ImsAutoFileData.AuctionGuideBookPrice)) + { + result.FailureReason = "No NADA or MMR prices returned"; + return result; + } + + // 4. Run the formula + var nadaValue = GetNadaAvgValue(nadaValues); + + var divisor = mmrValue == 0 || nadaValue == 0 + ? 1 + : 2; + + var baseResult = (mmrValue + nadaValue) / divisor; + baseResult = (baseResult * floorPricing.PercentageOf) / 100; + baseResult = Math.Round(baseResult / 5.0m) * 5; + + result.FloorPrice = baseResult; + result.Success = true; + result.ResultWeight = GetStrategyWeight(); + return result; + } + + public decimal GetNadaAvgValue(List nadaValues) + { + Decimal aggregateValue = 0; + int valueCount = 0; + Decimal aggregateAvgValue = 0; + if (nadaValues.Count() > 0) + { + foreach (var nadaVal in nadaValues) + { + if (nadaVal > 0) + { + aggregateValue += nadaVal; + valueCount++; + } + } + aggregateAvgValue = aggregateValue / valueCount; + } + + return aggregateAvgValue; + } + + private decimal GetNadaValueByParam(string floorPricingNadaFirstValue, + CollateralValuation fpcParamsCollateralValuation) + { + if (floorPricingNadaFirstValue.ToLower().StartsWith("low")) + { + return fpcParamsCollateralValuation.LowAdjustedAuctionValue; + } + + if (floorPricingNadaFirstValue.ToLower().StartsWith("avg")) + { + return fpcParamsCollateralValuation.AverageAdjustedAuctionValue; + } + + return fpcParamsCollateralValuation.HighAdjustedAuctionValue; + } + + private decimal GetMMRValueByParam(string floorPricingMmrValue, ImsAutoFileData fpcParamsImsAutoFileData, + decimal defaultValue) + { + if (floorPricingMmrValue.ToLower().StartsWith("regional")) + { + return fpcParamsImsAutoFileData.MMRRegionalAdjustedPrice ?? defaultValue; + } + + return fpcParamsImsAutoFileData.MMRNationalAdjustedPrice ?? defaultValue; + } + + public int GetStrategyWeight() + { + return 99; // This is the preferred strategy. + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/IRedemptionExpiredDateCalculator.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/IRedemptionExpiredDateCalculator.cs new file mode 100644 index 0000000..269dabf --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/IRedemptionExpiredDateCalculator.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using LCU.API.Collections.CollectionsApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.API.Collections.RepoApi.Services +{ + public interface IRedemptionExpiredDateCalculator + { + DateTime? CalculateAsync(TemenosCase temenosCase, + IReadOnlyCollection readOnlyCollection); + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/Processing/AlertProcessingSlip.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/Processing/AlertProcessingSlip.cs new file mode 100644 index 0000000..820903d --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/Processing/AlertProcessingSlip.cs @@ -0,0 +1,26 @@ +using System.Collections.Generic; + +namespace LCU.API.Collections.RepoApi.Domain.Processing +{ + public class AlertProcessingSlip + { + public RepoAccountProcessingSlip AccountProcessingSlip { get; set; } + public string Message { get; set; } + public List WatchedStatusTypes { get; set; } + public List WatchedTransactionTypes { get; set; } + + public AlertProcessingSlip + ( + RepoAccountProcessingSlip accountProcessingSlip, + string message, + List watchedStatusTypes, + List watchedTransactionTypes + ) + { + AccountProcessingSlip = accountProcessingSlip; + Message = message; + WatchedStatusTypes = watchedStatusTypes; + WatchedTransactionTypes = watchedTransactionTypes; + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/Processing/RepoAccountProcessingSlip.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/Processing/RepoAccountProcessingSlip.cs new file mode 100644 index 0000000..1b9a4ee --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/Processing/RepoAccountProcessingSlip.cs @@ -0,0 +1,96 @@ +using System.Collections.Generic; +using LCU.API.Collections.CollectionsApiLib.Models; +using LCU.API.Collections.RepoApi.Exceptions; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.Consumer; +using LCU.Shared.Collections.RepoApiLib.Models.Producer; +using LCU.Shared.Collections.RepoApiLib.Models.Settings; + +namespace LCU.API.Collections.RepoApi.Domain.Processing +{ + /** + * This class represents everything you need to do a logical update or creation of a RepoAccount + */ + public class RepoAccountProcessingSlip + { + public ProcessingItem RequestedBy { get; set; } + public string AccountNo { get; set; } + public int CaseId { get; set; } + public TemenosAccount RecoveryAccount { get; set; } + public TemenosCase RecoveryCase { get; set; } + public RepoAccount ExistingRepoAccount { get; set; } + public RepoAccount UpdatedRepoAccount { get; set; } + public Settings CurrentSettings { get; set; } + + public IReadOnlyCollection TransactionHistory { get; set; } + + public MemberDetail Member { get; set; } + + public LoanDetail Loan { get; set; } + + public IReadOnlyCollection AuctionAssignments { get; set; } + + public IReadOnlyCollection Letters { get; set; } + + public void AssertReadyForPreChecks() + { + if (RequestedBy == null) + { + throw new MissingRequirementException("Processing Item", + $"RepoAccount Processing Slip requires a processing item."); + } + + if (RecoveryAccount == null) + { + throw new MissingRequirementException("Recovery Account", + $"{RequestedBy.AccountNo} did not have account."); + } + + if (CurrentSettings == null) + { + throw new MissingRequirementException("Settings", + $"RepoAccount Processing Slip requires settings."); + } + } + public void AssertReadyForFullProcessing() + { + AssertReadyForPreChecks(); + + if (RecoveryCase == null) + { + throw new MissingRequirementException("Recovery Case", + $"{RecoveryAccount.AccountId} did not have case {CaseId}."); + } + + if (Loan == null) + { + throw new MissingRequirementException("Loan", "Loan required to process."); + } + + if (Letters == null) + { + throw new MissingRequirementException("Letters", "Letters required to process."); + } + } + + public void AssertReadyForAlertChecks() + { + AssertReadyForFullProcessing(); + + if (TransactionHistory == null && ExistingRepoAccount.ReferenceStatus != "Chargeoff") + { + throw new MissingRequirementException("Transactions", "Transactions required to process alerts."); + } + + if (Member == null) + { + throw new MissingRequirementException("Member", "Member required to process alerts."); + } + + if (AuctionAssignments == null) + { + throw new MissingRequirementException("Auction Assignments", "Auction Assignments required to process alerts."); + } + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/RedemptionExpiredDateCalculator.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/RedemptionExpiredDateCalculator.cs new file mode 100644 index 0000000..c90b933 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Domain/RedemptionExpiredDateCalculator.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using LCU.API.Collections.CollectionsApiLib.Models; +using LCU.API.Collections.RepoApi.Services; +using LCU.Shared.Collections.RepoApiLib.Models; +using Serilog; + +namespace LCU.API.Collections.RepoApi.Domain +{ + public class RedemptionExpiredDateCalculator : IRedemptionExpiredDateCalculator + { + public DateTime? CalculateAsync(TemenosCase temenosCase, IReadOnlyCollection letters) + { + try + { + // !!!!! 04/15/2021, Bill and Kyle don't want to check for letters, they just want to use the date. + // var redemptionLettersWi = letters.Where(x => x.ActionCode == "LTR35" || x.ActionCode == "LTR34" ).ToList(); + // var redemptionLettersIl = letters.Where(x => x.ActionCode == "703" || x.ActionCode == "701").ToList(); + + // if (redemptionLettersIl.Any() && redemptionLettersWi.Any()) + // { + // return null; + // } + if (temenosCase.RedemptionExpiredDateWi != null) { // redemptionLettersWi.Any())} + return temenosCase.RedemptionExpiredDateWi; + } + + if( temenosCase.RedemptionExpiredDateIl != null) { // redemptionLettersIl.Any())} + return temenosCase.RedemptionExpiredDateIl; + } + } + catch (Exception ex) + { + Log.Error(ex, $"Failed To Get Redemption Exp. Date. TemenosCaseID: {temenosCase.CaseId}", temenosCase); + } + + return null; + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Exceptions/AccountCreationFailed.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Exceptions/AccountCreationFailed.cs new file mode 100644 index 0000000..f572fae --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Exceptions/AccountCreationFailed.cs @@ -0,0 +1,11 @@ +using System; + +namespace LCU.API.Collections.RepoApi.Exceptions +{ + public class AccountCreationFailed : ApplicationException + { + public AccountCreationFailed(string message) : base(message) + { + } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Exceptions/IneligibleAccountException.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Exceptions/IneligibleAccountException.cs new file mode 100644 index 0000000..bcb35f7 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Exceptions/IneligibleAccountException.cs @@ -0,0 +1,19 @@ +using System; + +namespace LCU.API.Collections.RepoApi.Exceptions +{ + /// + /// Describes a missing requirement for processing an account; this account CANNOT be tried again later. + /// + public class IneligibleAccountException : Exception + { + public string Field { get; set; } + public string Reason { get; set; } + + public IneligibleAccountException(string field, string reason) : base(field) + { + Field = field; + Reason = reason; + } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Exceptions/MissingRequirementException.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Exceptions/MissingRequirementException.cs new file mode 100644 index 0000000..f1921a6 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Exceptions/MissingRequirementException.cs @@ -0,0 +1,19 @@ +using System; + +namespace LCU.API.Collections.RepoApi.Exceptions +{ + /// + /// Describes a missing requirement for processing an account; which will mean the account can be tried again later. + /// + public class MissingRequirementException : Exception + { + public string Field { get; set; } + public string Advice { get; set; } + + public MissingRequirementException(string field, string advice) : base(field) + { + Field = field; + Advice = advice; + } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Exceptions/NotFoundException.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Exceptions/NotFoundException.cs new file mode 100644 index 0000000..d68deb6 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Exceptions/NotFoundException.cs @@ -0,0 +1,15 @@ +using System; + +namespace LCU.API.Collections.RepoApi.Exceptions +{ + /** + * If an entity cannot be found, that specific error can allow for a 404 or 400 with more detail to be + * returned. So specify that to the API layer. + */ + public class NotFoundException : ApplicationException + { + public NotFoundException(string message) : base(message) + { + } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Exceptions/ServerErrorException.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Exceptions/ServerErrorException.cs new file mode 100644 index 0000000..210a240 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Exceptions/ServerErrorException.cs @@ -0,0 +1,15 @@ +using System; + +namespace LCU.API.Collections.RepoApi.Exceptions +{ + /** + * Do not want to expose database and related exceptions to the controllers / web layer. + * The lower layers log what happened for developers, then return a general error; unless + * a more specific error can be returned in a way to allow the client to act (such as NotFound). + */ + // IF YOU SEE THIS EXCEPTION IN SEQ, IT MEANS YES, YOU HAVE TO INVESTIGATE. + public class ServerErrorException : Exception + { + public ServerErrorException(): base("[INVESTIGATE] A server error occured. See associated logs.") { } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Extensions/ModelStateMessages.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Extensions/ModelStateMessages.cs new file mode 100644 index 0000000..85fcfba --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Extensions/ModelStateMessages.cs @@ -0,0 +1,21 @@ +using System.Collections.Generic; +using System.Linq; +using Microsoft.AspNetCore.Mvc.ModelBinding; + +namespace LCU.API.Collections.RepoApi.Extensions +{ + public static class ModelStateMessages + { + public static List GetErrorMessages(this ModelStateDictionary dictionary) + { + if (dictionary == null) + { + return new List(); + } + + return dictionary.SelectMany(m => m.Value.Errors) + .Select(m => m.ErrorMessage) + .ToList(); + } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Extensions/RepoApiStartup.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Extensions/RepoApiStartup.cs new file mode 100644 index 0000000..6eed5f1 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Extensions/RepoApiStartup.cs @@ -0,0 +1,85 @@ +using LCU.API.Collections.RepoApi.HostedServices; +using LCU.API.Collections.RepoApi.Services; +using LCU.API.Collections.RepoApi.Services.AutoIms; +using LCU.API.Collections.RepoApi.Services.Producer; +using LCU.API.Collections.RepoApi.Services.Reporting; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using LCU.Shared.Collections.RepoApiLib.Repositories.Settings; +using LCU.Shared.Collections.RepoApiLib.WebServices.NADA; +using Microsoft.Extensions.DependencyInjection; + +namespace LCU.API.Collections.RepoApi.Extensions +{ + public static class RepoApiStartup + { + public static void UseRepoServices(this IServiceCollection services) + { + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + } + + public static void UseRepoRepositories(this IServiceCollection services) + { + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + } + + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Factories/ReportTableFactory.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Factories/ReportTableFactory.cs new file mode 100644 index 0000000..64da2e5 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Factories/ReportTableFactory.cs @@ -0,0 +1,202 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using LCU.Shared.Collections.RepoApiLib.Formatting; +using LCU.Shared.Collections.RepoApiLib.Models.Reporting.Responses; + +namespace LCU.API.Collections.RepoApi.Factories +{ + public enum ReportSumType { WholeNumber, Currency, WholeNumberAvg, CurrencyAvg, PercentageAvg } + + public static class ReportTableFactory + { + + public static ReportTable CreateHistoricalSummationTable( + ReportSumType reportType, + IEnumerable dataRows, + string pluralEntityName, + DateTime lowDateTime, + DateTime highDateTime, + Func cellValue, + Func uniqueRowDisplay, + Func dateTimeField, + Func rowKey, + bool showAbsenceRow = true + ) + { + var totalMonths = CalculateTotalMonths(lowDateTime, highDateTime); + var rows = CreateUniqueRowNames(dataRows, uniqueRowDisplay, pluralEntityName, showAbsenceRow); + + var reportTable = new ReportTable() + { + Headers = CreateMonthHeaders(lowDateTime, highDateTime, new string[] { "" }, new string[] { "Total" }), + Cells = new ReportCell[rows.Count(), totalMonths + 2] + }; + + // Build the Report Table Values + var uniqueRowIdentifiers = new List(); + var rawValueTableLengths = new int[rows.Count(), totalMonths + 1]; + var rawValueTable = new decimal[rows.Count(), totalMonths + 1]; + foreach (var currentDataRow in dataRows) + { + var rowDisplay = uniqueRowDisplay(currentDataRow); + var currentKey = rowKey(currentDataRow); + var currentValue = cellValue(currentDataRow); + var currentDateOfRow = dateTimeField(currentDataRow); + + if (currentDateOfRow != null && + currentValue != null && + !uniqueRowIdentifiers.Contains(currentKey)) + { + uniqueRowIdentifiers.Add(currentKey); + + var monthIndex = CalculateMonthOffset(lowDateTime, currentDateOfRow.Value); + var currentItemIndex = FindUniqueRowIndex(rows, rowDisplay); + + // "All Entities" Value + rawValueTable[0, monthIndex] += currentValue.Value; // Totals for Month + rawValueTable[0, totalMonths] += currentValue.Value; // Totals for All + + // "All Entities" Length + rawValueTableLengths[0, monthIndex] += 1; // Totals for Month + rawValueTableLengths[0, totalMonths] += 1; // Totals for All + + // Current Auction Row + if (currentItemIndex != 0) + { + rawValueTable[currentItemIndex, monthIndex] += currentValue.Value; // Total for Month + rawValueTable[currentItemIndex, totalMonths] += currentValue.Value; // Total for Auction House. + + rawValueTableLengths[currentItemIndex, monthIndex] += 1; // Total for Month + rawValueTableLengths[currentItemIndex, totalMonths] += 1; // Total for Auction House. + } + + } + } + + // Convert Report Table into ReportCells + for (var i = 0; i < rawValueTable.GetLength(0); i++) + { + for (var j = 0; j < rawValueTable.GetLength(1); j++) + { + var rawValue = rawValueTable[i, j]; + var columnIndex = j + 1; // Add 1 to compensate for Row Display Column + + if (reportType == ReportSumType.WholeNumberAvg || + reportType == ReportSumType.PercentageAvg || + reportType == ReportSumType.CurrencyAvg) + { + var rawValueLength = rawValueTableLengths[i, j]; + if (rawValueLength != 0) + { + rawValue = rawValue / rawValueLength; + } + } + + switch(reportType) + { + case ReportSumType.WholeNumberAvg: + case ReportSumType.WholeNumber: + reportTable.Cells[i, columnIndex] = ReportCellFormatting.CreateIntCell(Convert.ToInt32(rawValue)); + break; + case ReportSumType.Currency: + case ReportSumType.CurrencyAvg: + reportTable.Cells[i, columnIndex] = ReportCellFormatting.CreateCurrencyCell(rawValue); + break; + case ReportSumType.PercentageAvg: + reportTable.Cells[i, columnIndex] = ReportCellFormatting.CreatePercentageCell(rawValue); + break; + } + } + } + + // Add Auction Names to Left Column + for (var i = 0; i < rows.Count(); i++) + { + reportTable.Cells[i, 0] = ReportCellFormatting.CreateStringCell(rows.ElementAt(i)); + } + + return reportTable; + } + + public static int FindUniqueRowIndex(IEnumerable uniqueRows, string columnName) + { + if (columnName != null) + { + foreach (var item in uniqueRows.Select((value, index) => new { index, value })) + { + if (item.value == columnName) + { + return item.index; + } + } + } + + return uniqueRows.Count() - 1; + } + + private static IEnumerable CreateUniqueRowNames(IEnumerable reportData, Func uniqueRowDisplay, string pluralEntityName, bool showAbsenceRow = true) + { + var list = new List(); + list.Add("All " + pluralEntityName); + + if (uniqueRowDisplay != null) + { + foreach (var row in reportData) + { + var rowName = uniqueRowDisplay(row); + if (rowName != null) + { + if (!list.Contains(rowName)) + { + list.Add(rowName); + } + } + } + } + + if (showAbsenceRow) + { + list.Add("No " + pluralEntityName); + } + return list; + } + + private static string[] CreateMonthHeaders(DateTime lowDateTime, DateTime highDateTime, string[] preHeaders = null, string[] postHeaders = null) + { + var totalMonths = CalculateTotalMonths(lowDateTime, highDateTime); + var preHeadersLength = preHeaders?.Length ?? 0; + var postHeadersLength = postHeaders?.Length ?? 0; + string[] monthHeaders = new string[totalMonths + preHeadersLength + postHeadersLength]; + + for (var i = 0; i < preHeadersLength; i++) + { + monthHeaders[i] = preHeaders[i]; + } + + for (var i = 0; i < totalMonths; i++) + { + var currentDate = lowDateTime.AddMonths(i); + monthHeaders[preHeadersLength + i] = $"{currentDate.ToString("MMM", CultureInfo.InvariantCulture)} {currentDate.Year}"; + } + + for (var i = 0; i < postHeadersLength; i++) + { + monthHeaders[preHeadersLength + totalMonths + i] = postHeaders[i]; + } + + return monthHeaders; + } + + private static int CalculateTotalMonths(DateTime lowDateTime, DateTime highDateTime) + { + return CalculateMonthOffset(lowDateTime, highDateTime) + 1; + } + + private static int CalculateMonthOffset(DateTime lowDateTime, DateTime highDateTime) + { + return (((highDateTime.Year - lowDateTime.Year) * 12) + highDateTime.Month - lowDateTime.Month); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Formatting/DataTableFormatting.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Formatting/DataTableFormatting.cs new file mode 100644 index 0000000..46b9f30 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Formatting/DataTableFormatting.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using LCU.API.Collections.RepoApi.Models.Reporting; +using LCU.Shared.Collections.RepoApiLib.Models.Reporting.Responses; + +namespace LCU.Shared.Collections.RepoApiLib.Formatting +{ + public static class DataTableFormatting + { + + public static DataTable CreateDataTable(IEnumerable dataRows, Func repoID, params Func[] columns) + { + return new DataTable() + { + Headers = columns.Select(column => column(default(T)).Header).ToArray(), + Rows = dataRows.Select(entry => new RepoAccountReferenceRow() + { + RepoId = repoID(entry), + Cells = columns.Select(column => column(entry).Cell).ToArray() + }) + }; + } + + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Formatting/ReportCellFormatting.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Formatting/ReportCellFormatting.cs new file mode 100644 index 0000000..b5d8626 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Formatting/ReportCellFormatting.cs @@ -0,0 +1,71 @@ +using System; +using LCU.Shared.Collections.RepoApiLib.Models.Reporting.Responses; + +namespace LCU.Shared.Collections.RepoApiLib.Formatting +{ + public static class ReportCellFormatting + { + public static ReportCell CreateStringCell(string display) + { + return new ReportCell() + { + Display = string.IsNullOrEmpty(display) ? "-" : display + }; + } + + public static ReportCell CreateIntCell(int? number) + { + return new ReportCell() + { + Display = (number == null || number == 0) ? "-" : number?.ToString(), + Value = number + }; + } + + public static ReportCell CreateDecimalCell(decimal? number, bool displayZeroValue = false) + { + return new ReportCell() + { + Display = (number == null || (number == 0 && !displayZeroValue)) ? "-" : number?.ToString(), + Value = number + }; + } + + public static ReportCell CreatePercentageCell(decimal? number, bool isNormalized = false) + { + var display = "-"; + if (number != null && number != 0) + { + if (!isNormalized) + { + number = number / 100; + } + display = string.Format(System.Globalization.CultureInfo.InvariantCulture,"{0:P2}", number); + } + + return new ReportCell() + { + Display = display, + Value = number + }; + } + + public static ReportCell CreateDateCell(DateTime? dateTime) + { + return new ReportCell() + { + Display = dateTime?.ToString("MM/dd/yyyy") ?? "-", + Value = dateTime + }; + } + + public static ReportCell CreateCurrencyCell(decimal? amount) + { + return new ReportCell() + { + Display = (amount == null || amount == 0) ? "-" : string.Format("{0:C}", amount), + Value = amount + }; + } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Formatting/StdReportEntryColumns.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Formatting/StdReportEntryColumns.cs new file mode 100644 index 0000000..7ae3517 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Formatting/StdReportEntryColumns.cs @@ -0,0 +1,334 @@ +using System; +using LCU.API.Collections.RepoApi.Models.Reporting; +using LCU.Shared.Collections.RepoApiLib.Models.Reporting; + +namespace LCU.Shared.Collections.RepoApiLib.Formatting +{ + public static class StdReportEntryColumns + { + public static Func Member(string alternateHeader = null) + { + return (StdReportEntry entry) => new ReportHeaderCellMap() + { + Header = alternateHeader ?? "Member", + Cell = ReportCellFormatting.CreateStringCell(entry?.IndividualName) + }; + } + + public static Func AccountNo(string alternateHeader = null) + { + return (StdReportEntry entry) => new ReportHeaderCellMap() + { + Header = alternateHeader ?? "Account No", + Cell = ReportCellFormatting.CreateStringCell(entry?.AccountNo) + }; + } + + public static Func AccountCode(string alternateHeader = null) + { + return (StdReportEntry entry) => new ReportHeaderCellMap() + { + Header = alternateHeader ?? "Account Code", + Cell = ReportCellFormatting.CreateStringCell(entry?.AccountTypeCode) + }; + } + + public static Func Balance(string alternateHeader = null) + { + return (StdReportEntry entry) => new ReportHeaderCellMap() + { + Header = alternateHeader ?? "Balance", + Cell = ReportCellFormatting.CreateCurrencyCell(entry?.Balance) + }; + } + + public static Func Status(string alternateHeader = null) + { + return (StdReportEntry entry) => new ReportHeaderCellMap() + { + Header = alternateHeader ?? "Status", + Cell = ReportCellFormatting.CreateStringCell(entry?.Status) + }; + } + + public static Func DaysInStatus(string alternateHeader = null) + { + return (StdReportEntry entry) => new ReportHeaderCellMap() + { + Header = alternateHeader ?? "Days in Status", + Cell = ReportCellFormatting.CreateIntCell(entry?.DaysInStatus) + }; + } + + public static Func Bankruptcy(string alternateHeader = null) + { + return (StdReportEntry entry) => new ReportHeaderCellMap() + { + Header = alternateHeader ?? "Bankruptcy", + Cell = ReportCellFormatting.CreateStringCell(entry?.Bankruptcy) + }; + } + + public static Func Collector(string alternateHeader = null) + { + return (StdReportEntry entry) => new ReportHeaderCellMap() + { + Header = alternateHeader ?? "Collector", + Cell = ReportCellFormatting.CreateStringCell(entry?.Collector) + }; + } + + public static Func DaysCurrentDelq(string alternateHeader = null) + { + return (StdReportEntry entry) => new ReportHeaderCellMap() + { + Header = alternateHeader ?? "Days Current Delq", + Cell = ReportCellFormatting.CreateIntCell(entry?.DaysCurrentDelq) + }; + } + + public static Func DaysDelqWhenAdded(string alternateHeader = null) + { + return (StdReportEntry entry) => new ReportHeaderCellMap() + { + Header = alternateHeader ?? "Days Delq When Added", + Cell = ReportCellFormatting.CreateIntCell(entry?.DaysDelqWhenAdded) + }; + } + + public static Func DelinquentAmount(string alternateHeader = null) + { + return (StdReportEntry entry) => new ReportHeaderCellMap() + { + Header = alternateHeader ?? "Delinquent Amount", + Cell = ReportCellFormatting.CreateCurrencyCell(entry?.DelinquentAmount) + }; + } + + public static Func LastPaymentAmount(string alternateHeader = null) + { + return (StdReportEntry entry) => new ReportHeaderCellMap() + { + Header = alternateHeader ?? "Last Payment Amount", + Cell = ReportCellFormatting.CreateCurrencyCell(entry?.LastPaymentAmount) + }; + } + + public static Func LastPaymentDate(string alternateHeader = null) + { + return (StdReportEntry entry) => new ReportHeaderCellMap() + { + Header = alternateHeader ?? "Last Payment Date", + Cell = ReportCellFormatting.CreateDateCell(entry?.LastPaymentDate) + }; + } + + public static Func Auction(string alternateHeader = null) + { + return (StdReportEntry entry) => new ReportHeaderCellMap() + { + Header = alternateHeader ?? "Auction", + Cell = ReportCellFormatting.CreateStringCell(entry?.AuctionName) + }; + } + + public static Func Collateral(string alternateHeader = null) + { + return (StdReportEntry entry) => new ReportHeaderCellMap() + { + Header = alternateHeader ?? "Collateral", + Cell = ReportCellFormatting.CreateStringCell($"{entry?.Year} {entry?.Make} {entry?.Model}") + }; + } + + public static Func RepoCompany(string alternateHeader = null) + { + return (StdReportEntry entry) => new ReportHeaderCellMap() + { + Header = alternateHeader ?? "Repo Company", + Cell = ReportCellFormatting.CreateStringCell(entry?.RepoCompany) + }; + } + + public static Func RepoType(string alternateHeader = null) + { + return (StdReportEntry entry) => new ReportHeaderCellMap() + { + Header = alternateHeader ?? "Repo Type", + Cell = ReportCellFormatting.CreateStringCell(entry?.RepoType) + }; + } + + public static Func DateAssigned(string alternateHeader = null) + { + return (StdReportEntry entry) => new ReportHeaderCellMap() + { + Header = alternateHeader ?? "Date Assigned", + Cell = ReportCellFormatting.CreateDateCell(entry?.RepoCompanyAssignmentDate) + }; + } + + public static Func DateRepoed(string alternateHeader = null) + { + return (StdReportEntry entry) => new ReportHeaderCellMap() + { + Header = alternateHeader ?? "Date Repoed", + Cell = ReportCellFormatting.CreateDateCell(entry?.DateRepoed) + }; + } + + public static Func RepoDuration(string alternateHeader = null) + { + return (StdReportEntry entry) => new ReportHeaderCellMap() + { + Header = alternateHeader ?? "Repo Duration", + Cell = ReportCellFormatting.CreateIntCell(entry?.RepoDuration) + }; + } + + // IMSAutoFile Data + public static Func AutoImsStatus(string alternateHeader = null) + { + return (StdReportEntry entry) => new ReportHeaderCellMap() + { + Header = alternateHeader ?? "AutoIMS Status", + Cell = ReportCellFormatting.CreateStringCell(entry?.AutoImsStatus) + }; + } + + public static Func DateSold(string alternateHeader = null) + { + return (StdReportEntry entry) => new ReportHeaderCellMap() + { + Header = alternateHeader ?? "Date Sold", + Cell = ReportCellFormatting.CreateDateCell(entry?.SoldDate) + }; + } + + public static Func DateEnteredAutoIMS(string alternateHeader = null) + { + return (StdReportEntry entry) => new ReportHeaderCellMap() + { + Header = alternateHeader ?? "Date Entered AutoIMS", + Cell = ReportCellFormatting.CreateDateCell(entry?.DateEnteredAutoIMS) + }; + } + + public static Func ScheduledSaleDate(string alternateHeader = null) + { + return (StdReportEntry entry) => new ReportHeaderCellMap() + { + Header = alternateHeader ?? "Scheduled Sale Date", + Cell = ReportCellFormatting.CreateDateCell(entry?.ScheduledSaleDate) + }; + } + + public static Func GrossPercentFloor(string alternateHeader = null) + { + return (StdReportEntry entry) => new ReportHeaderCellMap() + { + Header = alternateHeader ?? "Gross % Floor", + Cell = ReportCellFormatting.CreatePercentageCell(entry?.GrossPercentFloor) + }; + } + + public static Func NetPercentFloor(string alternateHeader = null) + { + return (StdReportEntry entry) => new ReportHeaderCellMap() + { + Header = alternateHeader ?? "Net % Floor", + Cell = ReportCellFormatting.CreatePercentageCell(entry?.NetPercentFloor) + }; + } + + public static Func TotalCharges(string alternateHeader = null) + { + return (StdReportEntry entry) => new ReportHeaderCellMap() + { + Header = alternateHeader ?? "Total Charges", + Cell = ReportCellFormatting.CreateCurrencyCell(entry?.TotalCharges) + }; + } + + public static Func Grade(string alternateHeader = null) + { + return (StdReportEntry entry) => new ReportHeaderCellMap() + { + Header = alternateHeader ?? "Grade", + Cell = ReportCellFormatting.CreateDecimalCell(entry?.Grade, true) + }; + } + + public static Func FloorPrice(string alternateHeader = null) + { + return (StdReportEntry entry) => new ReportHeaderCellMap() + { + Header = alternateHeader ?? "Floor Price", + Cell = ReportCellFormatting.CreateCurrencyCell(entry?.FloorPrice) + }; + } + + public static Func GrossSalePrice(string alternateHeader = null) + { + return (StdReportEntry entry) => new ReportHeaderCellMap() + { + Header = alternateHeader ?? "Gross Sale Price", + Cell = ReportCellFormatting.CreateCurrencyCell(entry?.GrossSalePrice) + }; + } + + public static Func FilteredStatus(string alternateHeader = null) + { + return (StdReportEntry entry) => new ReportHeaderCellMap() + { + Header = alternateHeader ?? "Filtered Status", + Cell = ReportCellFormatting.CreateStringCell(entry?.FilteredStatus) + }; + } + + public static Func FilteredStatusChangeDate(string alternateHeader = null) + { + return (StdReportEntry entry) => new ReportHeaderCellMap() + { + Header = alternateHeader ?? "Filtered Status Changed On", + Cell = ReportCellFormatting.CreateDateCell(entry?.FilteredStatusChangeDate) + }; + } + + public static Func O4RDate(string alternateHeader = null) + { + return (StdReportEntry entry) => new ReportHeaderCellMap() + { + Header = alternateHeader ?? "First O4R", + Cell = ReportCellFormatting.CreateDateCell(entry?.O4RDate) + }; + } + + public static Func SurplusDeficiency(string alternateHeader = null) + { + return (StdReportEntry entry) => new ReportHeaderCellMap() + { + Header = alternateHeader ?? "Surplus / Deficiency", + Cell = ReportCellFormatting.CreateCurrencyCell(entry?.GrossSalePrice - entry?.Balance) + }; + } + + public static Func AutoIMSAssignmentToSold(string alternateHeader = null) + { + return (StdReportEntry entry) => new ReportHeaderCellMap() + { + Header = alternateHeader ?? "Days AutoIMS to Sold", + Cell = ReportCellFormatting.CreateIntCell( + entry != null ? + ( + (entry.DateEnteredAutoIMS != null && entry.SoldDate != null) ? + (int?) (entry.SoldDate.Value - entry.DateEnteredAutoIMS.Value).TotalDays + : null + ) + : null + ) + }; + } + + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/HostedServices/HostedAutoImsTaskConsumer.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/HostedServices/HostedAutoImsTaskConsumer.cs new file mode 100644 index 0000000..3886523 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/HostedServices/HostedAutoImsTaskConsumer.cs @@ -0,0 +1,47 @@ +using System.Threading; +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Configuration; +using LCU.API.Collections.RepoApi.Services; +using LCU.Shared.Realtime.QueueLib.Models; +using LCU.Shared.Realtime.QueueLib.Queue; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Serilog; + +namespace LCU.API.Collections.RepoApi.HostedServices +{ + public class HostedAutoImsTaskConsumer : BackgroundService, IQueueItemProcessor + { + private readonly IServiceScopeFactory _scopeFactory; + private readonly IQueueConnectionConfig _configuration; + private readonly IQueueConsumerConfig _consumerConfig; + + public HostedAutoImsTaskConsumer(IQueueConnectionConfig configuration, RepoApiConfiguration repoApiConfiguration, IServiceScopeFactory scopeFactory) + { + _configuration = configuration; + _scopeFactory = scopeFactory; + _consumerConfig = repoApiConfiguration.QueueConsumerConfigs["AutoImsTask"]; + } + + protected override async Task ExecuteAsync(CancellationToken cancellationToken) + { + Log.Information("[QueueLib] Hosted Queue Producer is starting."); + + var proxyQueue = new QueueItemConsumer(_configuration, _consumerConfig, this); + + await proxyQueue.ProcessItems(cancellationToken, true, 0); + + Log.Information("[QueueLib] Hosted Queue Producer is stopping."); + } + + public void HandleItem(QueueItem item) + { + using (var scope = _scopeFactory.CreateScope()) + { + var processor = scope.ServiceProvider.GetService(); + var files = processor.Download(); + processor.ProcessDownloadedFiles(files); + } + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/HostedServices/HostedRepoTaskConsumer.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/HostedServices/HostedRepoTaskConsumer.cs new file mode 100644 index 0000000..140e46b --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/HostedServices/HostedRepoTaskConsumer.cs @@ -0,0 +1,60 @@ +using System; +using System.Threading; +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Configuration; +using LCU.Shared.Collections.RepoApiLib.Hosted; +using LCU.Shared.Realtime.QueueLib.Models; +using LCU.Shared.Realtime.QueueLib.Queue; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Serilog; + +namespace LCU.API.Collections.RepoApi.HostedServices +{ + public class HostedRepoTaskConsumer : BackgroundService, IQueueItemProcessor + { + private readonly IServiceScopeFactory _scopeFactory; + private readonly IQueueConnectionConfig _configuration; + private readonly IQueueConsumerConfig _consumerConfig; + + public HostedRepoTaskConsumer(IQueueConnectionConfig configuration, RepoApiConfiguration repoApiConfiguration, IServiceScopeFactory scopeFactory) + { + _configuration = configuration; + _scopeFactory = scopeFactory; + _consumerConfig = repoApiConfiguration.QueueConsumerConfigs["RepoProcessorTask"]; + } + + protected override async Task ExecuteAsync(CancellationToken cancellationToken) + { + Log.Information("Hosted Queue Producer is starting."); + + try + { + var proxyQueue = new QueueItemConsumer(_configuration, _consumerConfig, this); + + await proxyQueue.ProcessItems(cancellationToken, true, 0); + } + catch (TaskCanceledException ex) when (cancellationToken.IsCancellationRequested) + { + Log.Information(ex, "Repo Producer was shut down normally."); + } + catch (Exception ex) + { + Log.Error(ex, "Error in main thread for HostedRepoTaskConsumer"); + } + + Log.Information("Hosted Repo Producer is stopping."); + } + + public void HandleItem(QueueItem item) + { + var settings = new TaskSettings(); + + using (var scope = _scopeFactory.CreateScope()) + { + var queueProducerService = scope.ServiceProvider.GetRequiredService(); + queueProducerService.ImportData(settings).GetAwaiter().GetResult(); + } + } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/HostedServices/IRepoQueueProducerService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/HostedServices/IRepoQueueProducerService.cs new file mode 100644 index 0000000..7c35c1b --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/HostedServices/IRepoQueueProducerService.cs @@ -0,0 +1,12 @@ +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Hosted; +using LCU.Shared.Collections.RepoApiLib.Models.Producer; + +namespace LCU.API.Collections.RepoApi.HostedServices +{ + public interface IRepoQueueProducerService + { + Task ImportData(TaskSettings settings); + void SendRequestToQueue(ProcessingItem queueRequest); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/HostedServices/RepoQueueConsumerService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/HostedServices/RepoQueueConsumerService.cs new file mode 100644 index 0000000..5ae39c0 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/HostedServices/RepoQueueConsumerService.cs @@ -0,0 +1,319 @@ +using System; +using System.Collections.Concurrent; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Configuration; +using LCU.API.Collections.RepoApi.Exceptions; +using LCU.API.Collections.RepoApi.Services; +using LCU.API.Collections.RepoApi.Services.Producer; +using LCU.Api.Internal.MaidBotLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.Consumer; +using LCU.Shared.Collections.RepoApiLib.Models.Producer; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using LCU.Shared.Realtime.QueueLib.Models; +using LCU.Shared.Realtime.QueueLib.Queue; +using Microsoft.CodeAnalysis.Operations; +using Microsoft.EntityFrameworkCore.Internal; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Newtonsoft.Json; +using Serilog; + +namespace LCU.API.Collections.RepoApi.HostedServices +{ + /** + * Special Notes. + * 1. Direct injection of services cannot be done, the main API context is on it's own + * scope/thread. So instead, the scope factory is passed, so that this can create scopes. + * 2. This is designed to use 5 threads, from within an IHostedService thread context, to + * process queues. It's designed to do this in 'batches' to simulate a batch job, which + * is where the creation of the RunInfo comes into scope. + * 3. There is a main 'thread' here, which waits for a 'batch' of work to be complete. + * 4. Under the main thread, there are 5 worker threads, communicating using two queues besides + * the main Rabbit queue. The queues are used to set something up for processing (_inputQueue) + * and to mark something as done processing (_outputQueue). + */ + public class RepoQueueConsumerService : BackgroundService, IQueueItemProcessor + { + private readonly IQueueConnectionConfig _connectionConfig; + private readonly IServiceScopeFactory _scopeFactory; + private RepoRunInfo _runInfo; + + private const int ThreadCount = 5; + private BlockingCollection _inputQueue; + private BlockingCollection _outputQueue; + private readonly ConcurrentDictionary _inProgress; + private readonly Task[] _workers; + private Task _consumer; + private QueueItemConsumer _queue; + private readonly IQueueConsumerConfig _consumerConfig; + private CancellationTokenSource _individualRunToken; + + public RepoQueueConsumerService(IQueueConnectionConfig connectionConfig, RepoApiConfiguration repoApiConfiguration, IServiceScopeFactory scopeFactory) + { + _connectionConfig = connectionConfig; + _scopeFactory = scopeFactory; + _inProgress = new ConcurrentDictionary(); + _workers = new Task[ThreadCount]; + _consumerConfig = repoApiConfiguration.QueueConsumerConfigs["RepoAccountQueue"]; + } + + bool TopLevelThreadController() + { + Log.Information($"[Startup] {_consumerConfig.GetQueueName()} Consumer is starting a run."); + _runInfo = new RepoRunInfo(); + + foreach (var workItem in _outputQueue.GetConsumingEnumerable()) + { + _queue.AckItem(workItem.DeliveryTag); + if (workItem.Receipt != null) + { + _runInfo.Receipts.Add(workItem.Receipt); + } + + var remainingCount = _queue.CheckQueueCount(); + // First the input queue will finish, and we have to let running tasks finish. + if (remainingCount == 0 && EnumerableExtensions.Any(_inputQueue) == false && !_inputQueue.IsCompleted) + { + _inputQueue.CompleteAdding(); + Task.WaitAll(_workers); + } + + // That will cause the output queue to have the last THREADCOUNT items added, but + // we are IN the loop that processes them, so wen can't wait, just continue... + if (remainingCount == 0 && _inputQueue.IsCompleted && !_outputQueue.IsAddingCompleted) + { + _outputQueue.CompleteAdding(); + } + + // Ok, both queues are complete, which means all done. + if (_inputQueue.IsCompleted && _outputQueue.IsCompleted) + { + _individualRunToken.Cancel(); + _inputQueue.Dispose(); + _outputQueue.Dispose(); + Log.Information($"{_consumerConfig.GetQueueName()} run completed... recording RunInfo: {@_runInfo}", _runInfo); + _runInfo.CompleteDateTime = DateTime.Now; + SaveRunInfo(_runInfo); + SendErrorNotification(_runInfo); + SendAlertNotification(_runInfo); + + return true; + } + } + + Log.Error($"[Startup] {_consumerConfig.GetQueueName()} Consumer is finished in an unexpected way. {@_runInfo}", _runInfo); + return false; + } + + private void SaveRunInfo(RepoRunInfo runInfo) + { + using (var scope = _scopeFactory.CreateScope()) + { + try + { + var receiptService = scope.ServiceProvider.GetRequiredService(); + receiptService.SaveAllAsync(runInfo.Receipts).GetAwaiter().GetResult(); + } + catch (Exception ex) + { + Log.Error(ex, "Could not save repo processor results."); + } + } + } + + private void SendErrorNotification(RepoRunInfo runInfo) + { + if (runInfo.Receipts.Count > 0) + { + using (var scope = _scopeFactory.CreateScope()) + { + var resp = scope.ServiceProvider.GetService().SendProccessSummary(_runInfo); + if (!resp.Result.IsSuccessStatusCode) + { + Log.Error( + $"RepoQueueConsumerService failed to send error email. Emailer Response: {resp.Result.StatusCode} - {resp.Result.ReasonPhrase}"); + } + } + } + } + + private void SendAlertNotification(RepoRunInfo runInfo) + { + if (runInfo.Receipts.Count > 0) + { + using (var scope = _scopeFactory.CreateScope()) + { + var resp = scope.ServiceProvider.GetService().SendAlertSummaryEmailWithEndTime(runInfo.CompleteDateTime?? DateTime.Now); + if (!resp.Result.IsSuccessStatusCode) + { + Log.Error( + $"RepoQueueConsumerService failed to send alerts email. Emailer Response: {resp.Result.StatusCode} - {resp.Result.ReasonPhrase}"); + } + } + } + } + + private void SingleThreadMessageWorker(int workerId) + { + Log.Debug("[Startup] Worker {0} is starting.", workerId); + foreach (var workItem in _inputQueue.GetConsumingEnumerable()) + { + var message = Encoding.UTF8.GetString(workItem.Body.ToArray()); + Log.Information("Worker {0} Processing {1}", workerId, message); + var result = HandleSingleItem(message).GetAwaiter().GetResult(); + result.DeliveryTag = workItem.DeliveryTag; + _outputQueue.Add(result); + } + + Log.Debug("[Shutdown] Worker {0} is complete.", workerId); + } + + /** + * This function is the main function run by the IHostedService interface, so + * should be considered the 'main' here. + */ + protected override async Task ExecuteAsync(CancellationToken stoppingToken) + { + while (_queue == null) + { + try + { + _queue = new QueueItemConsumer(_connectionConfig, _consumerConfig, this); + } + catch (Exception ex) + { + Log.Error(ex, "Failed to create RepoQueueConsumerService, Will try again in 1 minute."); + await Task.Delay(TimeSpan.FromMinutes(1), stoppingToken); + } + } + + try + { + while (!stoppingToken.IsCancellationRequested) + { + Log.Debug($"{_consumerConfig.GetQueueName()} Processor started a run."); + _inputQueue = new BlockingCollection(); + _outputQueue = new BlockingCollection(); + _consumer = Task.Factory.StartNew(TopLevelThreadController, stoppingToken); + for (var threadIndex = 0; threadIndex < ThreadCount; ++threadIndex) + { + var workerId = threadIndex; + var task = new Task(() => SingleThreadMessageWorker(workerId)); + _workers[threadIndex] = task; + task.Start(); + } + + _individualRunToken = new CancellationTokenSource(); + await _queue.ProcessItems(_individualRunToken.Token, false, ThreadCount); + + while (!_consumer.IsCompleted) + { + await Task.Delay(TimeSpan.FromSeconds(5), stoppingToken); + Log.Debug($"{_consumerConfig.GetQueueName()} Finishing Heartbeat."); + } + + _consumer?.Dispose(); + _individualRunToken.Dispose(); + Log.Debug($"{_consumerConfig.GetQueueName()} Processor Completed a run."); + await Task.Delay(TimeSpan.FromMinutes(1), stoppingToken); + } + + // the thread is cancelled, so the loop will exit, be sure to propagate the cancellation to our token + if (_individualRunToken != null && _individualRunToken.IsCancellationRequested == false) + { + _individualRunToken.Cancel(); + } + } + catch (TaskCanceledException ex) when (stoppingToken.IsCancellationRequested) + { + Log.Information(ex, "Repo Processor was shut down normally."); + } + catch (Exception ex) + { + Log.ForContext(Enum.GetName(typeof(PropertyEnum), PropertyEnum.Group), Enum.GetName(typeof(GroupEnum), GroupEnum.ITDevelopment)) + .Fatal(ex,$"There is an unhandled exception when processing repos; The IIS App Pool may need to be restarted."); + } + } + + private async Task HandleSingleItem(string itemAsString) + { + var result = new QueueResult(); + ProcessingItem item = null; + try + { + using (var scope = _scopeFactory.CreateScope()) + { + var repoAccountProcessor = scope.ServiceProvider.GetRequiredService(); + + item = JsonConvert.DeserializeObject(itemAsString); + Log.Debug($"{_consumerConfig.GetQueueName()} Consumer received: {@item}", item); + + var newKey = item.DetermineAuditItemKey(); + if (_inProgress.TryAdd(newKey, item) == false) + { + Log.Information("Conflicting item found for {0}, skipping.", + item.DetermineAuditItemKey(), + _inProgress[newKey].DetermineAuditItemKey()); + return result; + } + + var receipt = new ProcessingReceipt(item.AccountNo) + { + AccountId = item.AccountId ?? "", + CaseId = item.CaseId ?? "", + QueuedBy = item.QueuedBy + }; + + try + { + Log.Information($"Processing {item.AccountNo}"); + receipt.Outcome = await repoAccountProcessor.HandleAccount(item); + receipt.Message = "Success"; + } + catch (IneligibleAccountException iaEx) + { + receipt.Message = $"The item {item.AccountNo} is ineligible {iaEx.Field} : {iaEx.Reason}"; + receipt.Outcome = RepoProcessingResult.Ineligible; + } + catch (MissingRequirementException mrEx) + { + receipt.Message = $"The item {item.AccountNo} is missing {mrEx.Field} : {mrEx.Advice}."; + receipt.Outcome = RepoProcessingResult.MissingRequirement; + } + catch (Exception ex) /* Mostly ServerErrorException */ + { + receipt.Message = $"The item {item.AccountNo} produced an error. Please investigate."; + Log.Error(ex, receipt.Message); + } + + if (!_inProgress.TryRemove(newKey, out item)) + { + Log.Error("Couldn't remove item from concurrent dictionary. (Success branch) {@item}", item); + } + + result.Receipt = receipt; + return result; + } + } + catch (Exception ex) + { + Log.Fatal(ex, $"[INVESTIGATE] Failed processing {itemAsString}."); + if (item == null) return result; + var newKey = item.DetermineAuditItemKey(); + if (!_inProgress.TryRemove(newKey, out item)) + { + Log.Error("Couldn't remove item from concurrent dictionary. (Exception branch) {@item}", item); + } + return result; + } + } + + public void HandleItem(QueueItem item) + { + _inputQueue.Add(item); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/HostedServices/RepoQueueProducerService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/HostedServices/RepoQueueProducerService.cs new file mode 100644 index 0000000..f05dd68 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/HostedServices/RepoQueueProducerService.cs @@ -0,0 +1,140 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Configuration; +using LCU.API.Collections.RepoApi.DataAccess; +using LCU.API.Collections.RepoApi.Services; +using LCU.Shared.Collections.RepoApiLib.Hosted; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.Producer; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using LCU.Shared.Realtime.QueueLib.Models; +using LCU.Shared.Realtime.QueueLib.Queue; +using Serilog; + +namespace LCU.API.Collections.RepoApi.HostedServices +{ + public class RepoQueueProducerService : IRepoQueueProducerService + { + private readonly RepoApiConfiguration _configuration; + private readonly ISettingsService _settingsService; + private readonly ICollectionsDao _collectionsDao; + private readonly QueueItemProducer _queueService; + private readonly IQueueConsumerConfig _consumerConfig; + private readonly IRepoAccountService _repoAccountService; + private readonly IProcessingReceiptService _processingReceiptService; + + public RepoQueueProducerService(IQueueConnectionConfig connectionConfig, + IRepoAccountService repoAcountService, + RepoApiConfiguration configuration, + ISettingsService settingsService, + ICollectionsDao collectionsDao, + IProcessingReceiptService processingReceiptService) + { + _configuration = configuration; + _settingsService = settingsService; + _collectionsDao = collectionsDao; + _processingReceiptService = processingReceiptService; + _consumerConfig = configuration.QueueConsumerConfigs["RepoAccountQueue"]; + _queueService = new QueueItemProducer(connectionConfig); + _repoAccountService = repoAcountService; + } + + public async Task ImportData(TaskSettings settings) + { + try + { + var reprocessItems = await _processingReceiptService.GetRetryListAsync(); + var watchStatusItems = await RetrieveRepoAccountsOfInterest(); + var combinedList = CreateCombinedList(reprocessItems, watchStatusItems); + + Log.Information($"Repo Producer Queueing {combinedList.Count} results."); + if (combinedList.Any()) + { + _queueService.EnqueueList(combinedList, _consumerConfig); + } + } + catch (Exception ex) + { + Log.Fatal(ex, "Error Deserializing. Repo Producer Failed to queue accounts."); + } + + try + { + var fullConfig = await _collectionsDao.RetrieveTemenosConfigurationAsync(); + var users = fullConfig.Users.Select(x => new ExternalUser() + { + Code = x.Code, + ReferenceId = x.Id, + Name = x.Description + }).ToList(); + await _settingsService.SyncExternalUsersAsync(users); + } + catch (Exception ex) + { + Log.Fatal(ex, "Error Updating external user list from Temenos."); + } + } + + public IReadOnlyCollection CreateCombinedList(IReadOnlyCollection listPriority, + IReadOnlyCollection listSecondary) + { + var combinedList = new List(); + + if (listPriority != null && listPriority.Any()) + { + foreach (var processingItem in listPriority) + { + combinedList.Add(new ProcessingItem() + { + AccountNo = processingItem.AccountNo, + AccountId = processingItem.AccountId, + CaseId = processingItem.CaseId, + QueuedBy = "RepoManager-Retry" + }); + } + } + + if (listSecondary == null || !listSecondary.Any()) return combinedList; + + foreach (var processingItem in listSecondary) + { + if (combinedList.Any(x => x.AccountNo == processingItem.AccountNo)) continue; + + processingItem.QueuedBy = "RepoManager"; + combinedList.Add(processingItem); + } + + return combinedList; + } + + public async Task> RetrieveRepoAccountsOfInterest() + { + var repoAccountNos = new List(); + try + { + repoAccountNos.AddRange(await _repoAccountService.GetItemsForProcessing()); + } + catch (Exception ex) + { + Log.Error(ex, "Failed to Retrieve Repo Accounts For Polling in RepoQueueProducerService"); + } + + return repoAccountNos; + } + + public void SendRequestToQueue(ProcessingItem queueRequest) + { + try + { + _queueService.Enqueue(queueRequest, _consumerConfig); + Log.Debug($"Queued The Following Account {queueRequest.AccountNo}"); + } + catch (Exception ex) + { + Log.Error(ex, $"Failed to Add AccountNo To Queue {queueRequest.AccountNo}"); + } + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/LCU.API.Collections.RepoApi.csproj b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/LCU.API.Collections.RepoApi.csproj new file mode 100644 index 0000000..09dcae1 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/LCU.API.Collections.RepoApi.csproj @@ -0,0 +1,55 @@ + + + + netcoreapp2.2 + InProcess + + + + C:\dev\projects\LCU.API.Collections.RepoApi\LCU.API.Collections.RepoApi\LCU.API.Collections.RepoApi.xml + NU1605 + 1701;1702;1591 + + + + C:\dev\projects\LCU.API.Collections.RepoApi\LCU.API.Collections.RepoApi\LCU.API.Collections.RepoApi.xml + 1701;1702;1591 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Always + + + + diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/LCU.API.Collections.RepoApi.xml b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/LCU.API.Collections.RepoApi.xml new file mode 100644 index 0000000..c586d94 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/LCU.API.Collections.RepoApi.xml @@ -0,0 +1,127 @@ + + + + LCU.API.Collections.RepoApi + + + + This class can be used to create the alerts in the "Days + ' days in REHO. '" series. for both REHO and O4R + + + + Use to send something to the logger from the client + + + Logs a message from a client. + Cookies: None required or set. + Security: Must have a valid JWT token retrieved from Azure AD, with ADMIN role. + + + + This strategy uses the suggested price from the ImsAutoFileData entry for the auction. + + + This strategy uses the AutoIms MMR values, the values from Nada, and the condition from AutoIms along + with a specific formula, to calculate a floor. + + + If an entity cannot be found, that specific error can allow for a 404 or 400 with more detail to be + returned. So specify that to the API layer. + + + Do not want to expose database and related exceptions to the controllers / web layer. + The lower layers log what happened for developers, then return a general error; unless + a more specific error can be returned in a way to allow the client to act (such as NotFound). + + + Special Notes. + 1. Direct injection of services cannot be done, the main API context is on it's own + scope/thread. So instead, the scope factory is passed, so that this can create scopes. + 2. This is designed to use 5 threads, from within an IHostedService thread context, to + process queues. It's designed to do this in 'batches' to simulate a batch job, which + is where the creation of the RunInfo comes into scope. + 3. There is a main 'thread' here, which waits for a 'batch' of work to be complete. + 4. Under the main thread, there are 5 worker threads, communicating using two queues besides + the main Rabbit queue. The queues are used to set something up for processing (_inputQueue) + and to mark something as done processing (_outputQueue). + + + This function is the main function run by the IHostedService interface, so + should be considered the 'main' here. + + + This function will attempt to create an Auction through AutoIMS. + + It does not catch and will throw if anything goes wrong. + Assume lack of exception equals success. + + + This function will attempt to remove an Auction through AutoIMS. + + It does not catch and will throw if anything goes wrong. + Assume lack of exception equals success. + + + This function will attempt to call AutoIMS with an auction floor, and will not update the + floor related values unless it succeeds + + + This function will attempt to call AutoIMS and set the title sent date, and will not update the + title sent related values unless it succeeds + + + This function will attempt to call AutoIMS and set the redeemed date, and will not update the + redeemed date unless it succeeds + + + This function will attempt to call AutoIMS to place a hold, and will not update the + hold related values unless it succeeds + + + A set of notes comes from AutoIMS and must be inserted (But not updated). + Duplicates/Existing are checked for based on writer, time and text. + + + Each row in the Data file is an ImsAutoAuctionData row used to track the status of + a Repo at auction and assist in setting the floor. + + + Take the rows with only account and discard them, using the account no to update the other rows. + Each row in the CSV does not have CustomerAccountNo, only the first row of each set. + Further, if a row has a customer account no, it has nothing else. + + + These alerts run before the account is checked to see if it was moved to an un-allowed status. + What is this moves the status to an un-allowed status? + + + These alerts run after the account has been updated or created and is the primary set of alert checks. + + + High Risk function because of string comparison and unknown mapping. + The old system got the integer from the database. + The new system gets a string from the web service. + This maps the new string to the old integer, if borrower types start + showing up wrong, look here... + + + If the status changed to 04R from not-O4R. + Is there a repo company assignment (even the default), if not assign one. + If there if a repo company assignment, but the status has changed, forcibly re-assign default + + + When an account changes to 04R, update all relevant fields/dates. + + + if the status was O4R and is now REPO, update date hooked (picked up). + + + Attempts to select the repo account that should be updated. Since we have to go by AccountNo and there + may be more than one. Try to return an open account, and log if it detects more than one. + + + TODO #7712 + Convert a Stage from a case to a RepoAccount status. + + + diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/MockServices/MockAutoIMSWebService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/MockServices/MockAutoIMSWebService.cs new file mode 100644 index 0000000..0373c68 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/MockServices/MockAutoIMSWebService.cs @@ -0,0 +1,113 @@ +using System; +using System.Diagnostics.CodeAnalysis; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.WebServices.AutoIMS; + +namespace LCU.API.Collections.RepoApi.MockServices +{ + // Excluded from code coverage because this service is a mock. + [ExcludeFromCodeCoverage] + public class MockAutoImsWebService : IAutoImsWebService + { + public async Task AddAuctionNote(string vin, string customerNumber, string note, string writer) + { + return await Task.FromResult(new WebServiceResponse() + { + Status = new WebServiceResponseStatus() + { + Code = 1, + Description = "Auction note added" + } + }); + } + + public string GetCollateralImage(string conditionReporUrl) + { + return ""; + } + + public async Task PlaceHold(string VIN, int holdCode, DateTime holdUntil) + { + return await Task.FromResult(new WebServiceResponse() + { + Status = new WebServiceResponseStatus() + { + Code = 1, + Description = "Vehicle placed on hold" + } + }); + } + + public async Task PostVehicleAsync(T vehicle) + { + return await Task.FromResult(new WebServiceResponse() + { + Status = new WebServiceResponseStatus() + { + Code = 1, + Description = "Vehicle posted to auction" + } + }); + } + + public async Task Redeem(string VIN) + { + return await Task.FromResult(new WebServiceResponse() + { + Status = new WebServiceResponseStatus() + { + Code = 1, + Description = "Vehicle set to redeemed" + } + }); + } + + public async Task RemoveAuction(string VIN, string customerNumber) + { + return await Task.FromResult(new WebServiceResponse() + { + Status = new WebServiceResponseStatus() + { + Code = 1, + Description = "Auction removed" + } + }); + } + + public async Task RemoveFromAuction(string vin, string clientStockNumber) + { + return await Task.FromResult(new WebServiceResponse() + { + Status = new WebServiceResponseStatus() + { + Code = 1, + Description = "Vehicle removed from auction" + } + }); + } + + public async Task TitleSent(string VIN) + { + return await Task.FromResult(new WebServiceResponse() + { + Status = new WebServiceResponseStatus() + { + Code = 1, + Description = "Floor price updated" + } + }); + } + + public async Task UpdateAuctionIdentifyingValuesAsync(string customerNum, string vin, string auctionAssignmentId) + { + return await Task.FromResult(new WebServiceResponse() + { + Status = new WebServiceResponseStatus() + { + Code = 1, + Description = "Identifying values updated" + } + }); + } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Models/AppCorsConfig.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Models/AppCorsConfig.cs new file mode 100644 index 0000000..ab8738a --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Models/AppCorsConfig.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace LCU.API.Collections.RepoApi.Models +{ + public class AppCorsConfig + { + public string[] CORS_AllowedOrigins { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Models/AppUser.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Models/AppUser.cs new file mode 100644 index 0000000..7dbb5f8 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Models/AppUser.cs @@ -0,0 +1,10 @@ +namespace LCU.API.Collections.RepoApi.Models +{ + public class AppUser + { + public string FirstName { get; set; } + public string LastName { get; set; } + public string Email { get; set; } + public string[] Roles { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Models/Filters/AuctionAssignmentFilter.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Models/Filters/AuctionAssignmentFilter.cs new file mode 100644 index 0000000..0759b28 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Models/Filters/AuctionAssignmentFilter.cs @@ -0,0 +1,25 @@ +using Microsoft.AspNetCore.Mvc; +using Newtonsoft.Json; + +namespace LCU.API.Collections.RepoApi.Models.Filters +{ + public class AuctionAssignmentFilter : PageFilter + { + + [FromQuery(Name = "readyForFloorPrice")] + public bool ReadyForFloorPrice { get; set; } + + public AuctionAssignmentFilter() : base() + { + this.ReadyForFloorPrice = false; + } + + public override object Clone() + { + var jsonString = JsonConvert.SerializeObject(this); + return JsonConvert.DeserializeObject(jsonString, this.GetType()); + } + + } + +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Models/Filters/PageFilter.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Models/Filters/PageFilter.cs new file mode 100644 index 0000000..f4378cf --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Models/Filters/PageFilter.cs @@ -0,0 +1,27 @@ +using System; +using System.ComponentModel.DataAnnotations; +using Newtonsoft.Json; + +namespace LCU.API.Collections.RepoApi.Models.Filters +{ + public class PageFilter : ICloneable + { + [Range(1, 1000)] + public int Page { get; set; } + + [Range(1, 1000)] + public int Limit { get; set; } + + public PageFilter() + { + this.Page = 1; + this.Limit = 100; + } + + public virtual object Clone() + { + var jsonString = JsonConvert.SerializeObject(this); + return JsonConvert.DeserializeObject(jsonString, this.GetType()); + } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Models/Reporting/ReportHeaderCellMap.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Models/Reporting/ReportHeaderCellMap.cs new file mode 100644 index 0000000..e2f61e3 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Models/Reporting/ReportHeaderCellMap.cs @@ -0,0 +1,10 @@ +using LCU.Shared.Collections.RepoApiLib.Models.Reporting.Responses; + +namespace LCU.API.Collections.RepoApi.Models.Reporting +{ + public class ReportHeaderCellMap + { + public string Header { get; set; } + public ReportCell Cell { get; set; } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Models/Requests/AccountQueueRequest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Models/Requests/AccountQueueRequest.cs new file mode 100644 index 0000000..1f396f6 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Models/Requests/AccountQueueRequest.cs @@ -0,0 +1,29 @@ +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; + +namespace LCU.API.Collections.RepoApi.Models.Requests +{ + public class AccountQueueRequest : IValidatableObject + { + [Required] + [StringLength(16, MinimumLength = 7, + ErrorMessage = "The AccountNo field must have a length between 7 and 16 characters")] + public string AccountNo { get; set; } + + [StringLength(20, MinimumLength = 1)] public string CaseId { get; set; } + + public IEnumerable Validate(ValidationContext validationContext) + { + var results = new List(); + + if (string.IsNullOrWhiteSpace(AccountNo)) + { + results.Add(new ValidationResult( + "AccountNo (AccountIdentifier) is not valid", + new[] { nameof(AccountNo) })); + } + + return results; + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Models/Requests/AuctionAssignmentPostRequest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Models/Requests/AuctionAssignmentPostRequest.cs new file mode 100644 index 0000000..bb9e6af --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Models/Requests/AuctionAssignmentPostRequest.cs @@ -0,0 +1,41 @@ +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.WebServices.AutoIMS; + +namespace LCU.API.Collections.RepoApi.Models.Requests +{ + public class AuctionAssignmentPostRequest : IValidatableObject + { + [Required] + public Shared.Collections.RepoApiLib.Models.AuctionAssignment AuctionAssignment { get; set; } + + [Required] + public IReadOnlyCollection Collaterals { get; set; } + + [Required] + public VehicleLocation VehicleLocation { get; set; } + + [Required] + public int? PrimaryCollateralId { get; set; } + + public IEnumerable Validate(ValidationContext validationContext) + { + var failedValidations = new List(); + + if (this.Collaterals.Count == 0) + { + failedValidations.Add(new ValidationResult("There must be at least one collateral when creating an auction assignment.")); + } + + var primaryCollateral = Collaterals.Where(collateral => collateral.CollateralId == PrimaryCollateralId).FirstOrDefault(); + if (primaryCollateral == null) + { + failedValidations.Add(new ValidationResult("Collaterals must contain a piece of Collateral with a CollateralID that matches the PrimaryCollateralId.")); + } + + return failedValidations; + } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Models/Requests/RepoAccountPostFilter.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Models/Requests/RepoAccountPostFilter.cs new file mode 100644 index 0000000..23dc821 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Models/Requests/RepoAccountPostFilter.cs @@ -0,0 +1,17 @@ +using System.Collections.Generic; + +namespace LCU.API.Collections.RepoApi.Models.Requests +{ + public class RepoAccountPostFilter + { + public List RepoIdList { get; set; } + + public string Status { get; set; } + + public string AuctionHouseId { get; set; } + + public int? RepoCompanyId { get; set; } + + public bool? OnlyOpenAccounts { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Models/Requests/ReportingRequest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Models/Requests/ReportingRequest.cs new file mode 100644 index 0000000..725e76d --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Models/Requests/ReportingRequest.cs @@ -0,0 +1,16 @@ +using System; + +namespace LCU.API.Collections.RepoApi.Models.Requests +{ + public class ReportingRequest + { + public DateTime LowDate { get; set; } + public DateTime HighDate { get; set; } + + public ReportingRequest() + { + HighDate = DateTime.Today; + LowDate = HighDate.Subtract(TimeSpan.FromDays(365)); + } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Models/Requests/VehicleFloorPricingParametersPutRequest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Models/Requests/VehicleFloorPricingParametersPutRequest.cs new file mode 100644 index 0000000..d8602bf --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Models/Requests/VehicleFloorPricingParametersPutRequest.cs @@ -0,0 +1,9 @@ +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.API.Collections.RepoApi.Models.Requests +{ + public class VehicleFloorPricingParametersPutRequest + { + public VehicleFloorPricingParameters[] vehicleFloorPricingParameters; + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Models/Responses/FactoidResponse.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Models/Responses/FactoidResponse.cs new file mode 100644 index 0000000..6367577 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Models/Responses/FactoidResponse.cs @@ -0,0 +1,14 @@ +using System.Collections.Generic; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.API.Collections.RepoApi.Models.Responses +{ + public class FactoidResponse + { + public string CumulativeValue { get; set; } + public string Name { get; set; } + public string Description { get; set; } + public string FontAwesomeIcon { get; set; } + public IReadOnlyCollection Records { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Models/Responses/PagedResponse.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Models/Responses/PagedResponse.cs new file mode 100644 index 0000000..ac6fe32 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Models/Responses/PagedResponse.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using LCU.API.Collections.RepoApi.Models.Filters; +using LCU.Shared.Collections.RepoApiLib.Models.Results; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Http; + +namespace LCU.API.Collections.RepoApi.Models.Responses +{ + public class PagedResponse where T : class + { + public PagedResponse() { } + + public PagedResponse(PagedResult pagedResult, PageFilter filter, IUrlHelper url, HttpRequest request, string uriAction = "Get") + { + TotalItems = pagedResult.Total; + Items = pagedResult.Items; + CurrentPage = filter.Page; + TotalPages = pagedResult.Total == 0 ? 1 : (int) Math.Ceiling((decimal) pagedResult.Total / filter.Limit); + + PageFilter newFilter = filter.Clone() as PageFilter; + if (pagedResult.Total > (filter.Page * filter.Limit)) + { + newFilter.Page = filter.Page + 1; + NextPage = new Uri(url.Action(uriAction, null, newFilter, request.Scheme)); + } + + if (filter.Page > 1) + { + newFilter.Page = filter.Page - 1; + PreviousPage = new Uri(url.Action(uriAction, null, newFilter, request.Scheme)); + } + + } + + public IEnumerable Items { get; set; } + public Uri NextPage { get; set; } + public Uri PreviousPage { get; set; } + public int TotalItems { get; set; } + public int CurrentPage { get; set; } + public int TotalPages { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Models/Responses/RepoCompanySelectionPostResponse.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Models/Responses/RepoCompanySelectionPostResponse.cs new file mode 100644 index 0000000..fb87327 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Models/Responses/RepoCompanySelectionPostResponse.cs @@ -0,0 +1,10 @@ +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.API.Collections.RepoApi.Models.Responses +{ + public class RepoCompanySelectionPostResponse + { + public RepoCompanySelection PreviousRepoCompanySelection {get; set;} + public RepoCompanySelection NewRepoCompanySelection { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Models/Responses/VehicleFloorPricingParametersPutResponse.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Models/Responses/VehicleFloorPricingParametersPutResponse.cs new file mode 100644 index 0000000..da526f0 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Models/Responses/VehicleFloorPricingParametersPutResponse.cs @@ -0,0 +1,9 @@ +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.API.Collections.RepoApi.Models.Responses +{ + public class VehicleFloorPricingParametersPutResponse + { + public VehicleFloorPricingParameters[] vehicleFloorPricingParameters; + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Models/Results/DateTimeResult.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Models/Results/DateTimeResult.cs new file mode 100644 index 0000000..6960712 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Models/Results/DateTimeResult.cs @@ -0,0 +1,11 @@ +using System; + +namespace LCU.API.Collections.RepoApi.Models.Results +{ + public class DateTimeResult : IResult + { + public DateTime? Value { get; set; } = null; + public string ErrorMessage { get; set; } = null; + public bool IsSuccess { get; set; } = false; + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Models/Results/IResult.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Models/Results/IResult.cs new file mode 100644 index 0000000..8197318 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Models/Results/IResult.cs @@ -0,0 +1,11 @@ +using System; + +namespace LCU.API.Collections.RepoApi.Models.Results +{ + public interface IResult + { + T Value { get; set; } + bool IsSuccess { get; set; } + String ErrorMessage { get; set; } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Models/SqlOptionsConfig.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Models/SqlOptionsConfig.cs new file mode 100644 index 0000000..f649ceb --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Models/SqlOptionsConfig.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace LCU.API.Collections.RepoApi.Models +{ + public class SqlOptionsConfig + { + public int MaxRetryCount { get; set; } + public TimeSpan MaxRetryDelay { get; set; } + public List ErrorNumbersToAdd { get; set; } + public bool EnableDetailedErrors { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Program.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Program.cs new file mode 100644 index 0000000..5d791e2 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Program.cs @@ -0,0 +1,21 @@ +using System.Diagnostics.CodeAnalysis; +using Microsoft.AspNetCore; +using Microsoft.AspNetCore.Hosting; +using Serilog; + +namespace LCU.API.Collections.RepoApi +{ + [ExcludeFromCodeCoverage] + public class Program + { + public static void Main(string[] args) + { + CreateWebHostBuilder(args).Build().Run(); + } + + public static IWebHostBuilder CreateWebHostBuilder(string[] args) => + WebHost.CreateDefaultBuilder(args) + .UseStartup().UseSerilog((hostingContext, loggerConfiguration) => loggerConfiguration + .ReadFrom.Configuration(hostingContext.Configuration)); + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Properties/launchSettings.json b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Properties/launchSettings.json new file mode 100644 index 0000000..ec49924 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Properties/launchSettings.json @@ -0,0 +1,30 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:22532", + "sslPort": 44380 + } + }, + "$schema": "http://json.schemastore.org/launchsettings.json", + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "LCU.API.Collections.RepoApi": { + "commandName": "Project", + "launchBrowser": true, + "launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "applicationUrl": "https://localhost:5001;http://localhost:5000" + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AuctionAssignmentService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AuctionAssignmentService.cs new file mode 100644 index 0000000..4008fef --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AuctionAssignmentService.cs @@ -0,0 +1,461 @@ +using System; +using System.Collections.Generic; +using System.Data.SqlClient; +using System.Linq; +using System.Net; +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Exceptions; +using LCU.API.Collections.RepoApi.Models.Filters; +using LCU.API.Collections.RepoApi.Models.Requests; +using LCU.Shared.Collections.RepoApiLib.Exceptions; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.Results; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using LCU.Shared.Collections.RepoApiLib.WebServices.AutoIMS; +using Serilog; +using AuctionAssignment = LCU.Shared.Collections.RepoApiLib.Models.AuctionAssignment; + +namespace LCU.API.Collections.RepoApi.Services +{ + public class AuctionAssignmentService : IAuctionAssignmentService + { + private readonly IAuctionAssignmentRepository _auctionAssignmentRepository; + private readonly IUnitOfWork _unitOfWork; + private readonly IEmailer _emailer; + private readonly IAutoImsWebService _autoImsWebService; + private readonly IRepoAccountService _repoAccountService; + + public AuctionAssignmentService( + IAutoImsWebService autoImsWebService, + IRepoAccountService repoAccountService, + IAuctionAssignmentRepository auctionAssignmentRepository, + IUnitOfWork unitOfWork, + IEmailer emailer) + { + _autoImsWebService = autoImsWebService; + _repoAccountService = repoAccountService; + _auctionAssignmentRepository = auctionAssignmentRepository; + _unitOfWork = unitOfWork; + _emailer = emailer; + } + + public async Task> ListByFilterAsync(AuctionAssignmentFilter filter) + { + try + { + if (filter.ReadyForFloorPrice) + { + return await _auctionAssignmentRepository.ListReadyForFloorPriceAsync(); + } + return await _auctionAssignmentRepository.ListAllAsync(filter.Page, filter.Limit); + } + catch (Exception ex) + { + Log.Error(ex, "Failure retrieving AuctionAssignments"); + throw new ServerErrorException(); + } + } + + public async Task> GetListByIdsAsync(IReadOnlyCollection idSet) + { + try + { + return await _auctionAssignmentRepository.FindListByIdsAsync(idSet); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure retrieving AuctionAssignments for ids: {@idSet}"); + throw new ServerErrorException(); + } + } + + public async Task GetByIdAsync(int id) + { + AuctionAssignment auctionAssignment; + try + { + auctionAssignment = await _auctionAssignmentRepository.FindByIdAsync(id); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure retrieving AuctionAssignment with id: {id}"); + throw new ServerErrorException(); + } + + if (auctionAssignment == null) + { + throw new NotFoundException($" AuctionAssignment with {id} not found."); + } + + return auctionAssignment; + } + + public async Task> GetByRepoIdAsync(int repoId) + { + // Ensure the repo exists. If it doesn't, a NFE should be thrown here + await _repoAccountService.Get(repoId); + try + { + return await _auctionAssignmentRepository.FindByRepoIdAsync(repoId); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure retrieving AuctionAssignments by RepoId with RepoID: {repoId}"); + throw new ServerErrorException(); + } + } + + public async Task SaveAsync(AuctionAssignmentPostRequest auctionAssignmentPostRequest) + { + Collateral primaryCollateral = auctionAssignmentPostRequest.Collaterals + .First(collateral => collateral.CollateralId == auctionAssignmentPostRequest.PrimaryCollateralId); + + string auctionCustomerNo; + try + { + auctionCustomerNo = await GetAuctionCustomerNoAsync(auctionAssignmentPostRequest.AuctionAssignment.RepoId.Value, primaryCollateral.RefCollateralId); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure retrieving Auction Customer Number with auctionAssignmentPostRequest {auctionAssignmentPostRequest}", auctionAssignmentPostRequest); + throw new ServerErrorException(); + } + + // If active auction already exists, do not create + var conflictingAuctionAssignments = await _findActiveAuctionsWithMatchingCollateral(primaryCollateral.RepoId, auctionAssignmentPostRequest.Collaterals); + if (conflictingAuctionAssignments!= null && conflictingAuctionAssignments.Any()) + { + throw new DuplicateResourceException("AuctionAssignment"); + } + + try + { + var auctionAssignmentsToCollaterals = CreateJoiningAuctionAssignmentToCollateralsList( + auctionAssignmentPostRequest.AuctionAssignment, auctionAssignmentPostRequest.Collaterals); + + auctionAssignmentPostRequest.AuctionAssignment.AuctionCustomerNo = auctionCustomerNo; + auctionAssignmentPostRequest.AuctionAssignment.DateSubmitted = DateTime.Now; + auctionAssignmentPostRequest.AuctionAssignment.CollateralVIN = primaryCollateral.Vin; + auctionAssignmentPostRequest.AuctionAssignment.AuctionAssignmentToCollaterals = auctionAssignmentsToCollaterals; + + auctionAssignmentPostRequest.AuctionAssignment = await _auctionAssignmentRepository.AddAsync(auctionAssignmentPostRequest.AuctionAssignment); + + await _unitOfWork.CompleteAsync(); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure creating AuctionAssignment object: {auctionAssignmentPostRequest.AuctionAssignment}.", auctionAssignmentPostRequest.AuctionAssignment); + throw new ServerErrorException(); + } + + try + { + await CreateAutoIMSAuction(primaryCollateral, auctionAssignmentPostRequest.VehicleLocation, auctionAssignmentPostRequest.AuctionAssignment); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure creating AutoIMS Auction with Primary Collateral: {primaryCollateral} Removing AuctionAssignment...", primaryCollateral); + + try { _auctionAssignmentRepository.Remove(auctionAssignmentPostRequest.AuctionAssignment); } + catch (Exception ex2) { Log.Error(ex2, $"Failure removing AuctionAssignment : {auctionAssignmentPostRequest.AuctionAssignment} after failed AutoIMS creation.", auctionAssignmentPostRequest.AuctionAssignment); } + + throw new WebException("Failed to add auction assignment to AutoIMS."); + } + + return auctionAssignmentPostRequest; + } + + public async Task UpdateAsync(AuctionAssignment auctionAssignment) + { + var existingAuctionAssignment = await _auctionAssignmentRepository.FindByIdAsync(auctionAssignment.ID); + + if (existingAuctionAssignment == null) + { + throw new NotFoundException($" Auction Assignment with id {auctionAssignment.ID} not found."); + } + + try + { + if (existingAuctionAssignment.FloorPrice != auctionAssignment.FloorPrice) + { + await UpdateAuctionFloor(auctionAssignment, existingAuctionAssignment); + } + + if (existingAuctionAssignment.SentTitleDocsDate != auctionAssignment.SentTitleDocsDate) + { + await UpdateTitleSentDate(auctionAssignment, existingAuctionAssignment); + } + + if (existingAuctionAssignment.RedeemedDate != auctionAssignment.RedeemedDate) + { + await UpdateRedeemedDate(auctionAssignment, existingAuctionAssignment); + } + + if (existingAuctionAssignment.HoldStatus != auctionAssignment.HoldStatus || existingAuctionAssignment.HoldUntil != auctionAssignment.HoldUntil) + { + await UpdateHoldData(auctionAssignment, existingAuctionAssignment); + } + } + catch (Exception ex) + { + Log.Error(ex, $"Failed to fully update auction assignment with id {auctionAssignment.ID} in AutoIMS"); + throw new WebException("Failed to fully update auction assignment in AutoIMS."); + } + + return auctionAssignment; + } + + public async Task GetAuctionCustomerNoAsync(int repoId, string refCollateralId) + { + RepoAccount repoAccount = await _repoAccountService.Get(repoId); + Borrower primaryBorrower = repoAccount.Borrowers.Where((b) => b.OwnershipType == 6).FirstOrDefault(); + + if (primaryBorrower == null) + { + throw new NotFoundException($"Primary borrower for Repo Account {repoAccount.AccountNo} not found."); + } + + return primaryBorrower.IndividualId + '-' + refCollateralId; + } + + /** + * This function will attempt to create an Auction through AutoIMS. + * + * It does not catch and will throw if anything goes wrong. + * Assume lack of exception equals success. + */ + public async Task CreateAutoIMSAuction( + Collateral collateral, + VehicleLocation vehicleLocation, + AuctionAssignment auctionAssignment) + { + + Vehicle vehicle = new Vehicle() + { + ClientAccountNumber = auctionAssignment.AuctionCustomerNo, + VIN = collateral.Vin, + Make = collateral.Make, + Model = collateral.Model, + ModelYear = collateral.Year.GetValueOrDefault(), + BodyStyle = collateral.BodyStyle, + Classification = collateral.VehicleType.GetValueOrDefault(), + ClientField1 = auctionAssignment.ID + "", + AuctionAssignment = new Shared.Collections.RepoApiLib.WebServices.AutoIMS.AuctionAssignment() + { + AuctionID = auctionAssignment.AuctionId, + PickupDate = auctionAssignment.AvailablePickupDate.GetValueOrDefault().ToString("yyyy-MM-dd"), + LegalSaleDate = auctionAssignment.LegalSaleDate.GetValueOrDefault().ToString("yyyy-MM-dd"), + PickupOrDropOffNote = auctionAssignment.AuctionNotes, + CleaningLevelRequested = auctionAssignment.CleaningLevel, + }, + VehicleLocation = vehicleLocation, + }; + + return await _autoImsWebService.PostVehicleAsync(vehicle); + } + + /** + * This function will attempt to remove an Auction through AutoIMS. + * + * It does not catch and will throw if anything goes wrong. + * Assume lack of exception equals success. + */ + public async Task RemoveAuctionFromAutoIMS(AuctionAssignment auctionAssignment) + { + return await _autoImsWebService.RemoveFromAuction(auctionAssignment.AuctionCustomerNo, auctionAssignment.CollateralVIN); + } + + public IEnumerable CreateJoiningAuctionAssignmentToCollateralsList(AuctionAssignment auctionAssignment, IEnumerable collaterals) + { + return (from collateral in collaterals + select new AuctionAssignmentToCollateral + { + AuctionAssignment = auctionAssignment, + Collateral = collateral + }).ToList(); + } + + /** + * This function will attempt to call AutoIMS with an auction floor, and will not update the + * floor related values unless it succeeds + */ + public async Task UpdateAuctionFloor(AuctionAssignment auctionAssignmentInput, + AuctionAssignment existingAssignment) + { + FloorPriceVehicle vehicle = new FloorPriceVehicle(); + vehicle.ClientAccountNumber = auctionAssignmentInput.AuctionCustomerNo; + vehicle.VIN = auctionAssignmentInput.CollateralVIN; + vehicle.AuctionAssignment.FloorPrice = auctionAssignmentInput.FloorPrice ?? 0; + + WebServiceResponse response = await _autoImsWebService.PostVehicleAsync(vehicle); + + existingAssignment.FloorPriceResponseCode = response?.Status.Code; + existingAssignment.FloorPriceResponseDescription = response?.Status.Description; + + if (response?.Status.ValidationError?.Any() ?? false) + { + foreach (var item in response.Status.ValidationError) + { + existingAssignment.FloorPriceSubmissionErrors += + "Code: " + item.Code + " Message: " + item.Message + "|"; + } + + } + else if (response?.Status.Code == 1) + { + // e-mail management on successfully accepted floor price change + var isManualFloorSet = existingAssignment.FloorPriceValuesUsed == auctionAssignmentInput.FloorPriceValuesUsed; + var repoAccount = await _repoAccountService.FindByAuctionAssignmentId(existingAssignment.ID); + await _emailer.SendFloorPriceAcceptedEmail(isManualFloorSet, repoAccount?.AccountNo, existingAssignment.FloorPrice, auctionAssignmentInput.FloorPrice); + + existingAssignment.FloorPrice = auctionAssignmentInput.FloorPrice; + existingAssignment.FloorPriceValuesUsed = auctionAssignmentInput.FloorPriceValuesUsed; + } + + await _completeAuctionAssignmentUpdateTransaction(existingAssignment); + } + + /** + * This function will attempt to call AutoIMS and set the title sent date, and will not update the + * title sent related values unless it succeeds + */ + public async Task UpdateTitleSentDate(AuctionAssignment auctionAssignmentInput, + AuctionAssignment existingAssignment) + { + WebServiceResponse response = await _autoImsWebService.TitleSent(auctionAssignmentInput.CollateralVIN); + + existingAssignment.TitleSentResponseCode = response?.Status.Code; + existingAssignment.TitleSentResponseDescription = response?.Status.Description; + + if (response?.Status.ValidationError?.Any() ?? false) + { + foreach (var item in response.Status.ValidationError) + { + existingAssignment.TitleSentSubmissionErrors += + "Code: " + item.Code + " Message: " + item.Message + "|"; + } + + } + else if (response?.Status.Code == 1) + { + existingAssignment.SentTitleDocsDate = auctionAssignmentInput.SentTitleDocsDate; + } + + await _completeAuctionAssignmentUpdateTransaction(existingAssignment); + } + + /** + * This function will attempt to call AutoIMS and set the redeemed date, and will not update the + * redeemed date unless it succeeds + */ + public async Task UpdateRedeemedDate(AuctionAssignment auctionAssignmentInput, + AuctionAssignment existingAssignment) + { + WebServiceResponse response = await _autoImsWebService.Redeem(auctionAssignmentInput.CollateralVIN); + + if (response?.Status.ValidationError?.Any() ?? false) + { + foreach (var item in response.Status.ValidationError) + { + // There are no database columns for redemption submission errors so log the error + Log.Error($"Redemption submission error. Code: {item.Code} Message: {item.Message} | { auctionAssignmentInput}"); + } + + } + else if (response?.Status.Code == 1) + { + existingAssignment.RedeemedDate = auctionAssignmentInput.RedeemedDate; + } + + await _completeAuctionAssignmentUpdateTransaction(existingAssignment); + } + + /** + * This function will attempt to call AutoIMS to place a hold, and will not update the + * hold related values unless it succeeds + */ + public async Task UpdateHoldData(AuctionAssignment auctionAssignmentInput, + AuctionAssignment existingAssignment) + { + var holdStatus = auctionAssignmentInput.HoldStatus ?? 0; + var holdUntil = auctionAssignmentInput.HoldUntil ?? DateTime.MinValue; + + WebServiceResponse response = await _autoImsWebService.PlaceHold(auctionAssignmentInput.CollateralVIN, holdStatus, holdUntil); + + if (response?.Status.ValidationError?.Any() ?? false) + { + foreach (var item in response.Status.ValidationError) + { + existingAssignment.SubmissionErrors += + "Code: " + item.Code + " Message: " + item.Message + "|"; + } + + } + else if (response?.Status.Code == 1) + { + existingAssignment.HoldStatus = auctionAssignmentInput.HoldStatus; + existingAssignment.HoldUntil = auctionAssignmentInput.HoldUntil; + } + + await _completeAuctionAssignmentUpdateTransaction(existingAssignment); + } + + public async Task RemoveAuction(int id) + { + var auctionAssignment = await _auctionAssignmentRepository.FindByIdAsync(id); + + if (auctionAssignment == null) + { + throw new NotFoundException($" Auction Assignment with id {id} not found."); + } + + try + { + await RemoveAuctionFromAutoIMS(auctionAssignment); + } + catch (Exception ex) + { + Log.Error(ex, $"Failed to remove auction assignment from AutoIMS {auctionAssignment.ID}"); + throw new WebException("Failed to remove auction assignment from AutoIMS."); + } + + auctionAssignment.IsActive = false; + await _completeAuctionAssignmentUpdateTransaction(auctionAssignment); + + return auctionAssignment; + } + + private async Task _completeAuctionAssignmentUpdateTransaction(AuctionAssignment auctionAssignment) + { + try + { + _auctionAssignmentRepository.Update(auctionAssignment); + await _unitOfWork.CompleteAsync(); + } + catch (SqlException ex) + { + Log.Error(ex, $"SQL Failure updating Auction Assignment: {auctionAssignment}", auctionAssignment); + throw new ServerErrorException(); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure updating Auction Assignment: {auctionAssignment}", auctionAssignment); + throw new ServerErrorException(); + } + } + + private async Task> _findActiveAuctionsWithMatchingCollateral(int repoId, IEnumerable collaterals) + { + var assignments = await _auctionAssignmentRepository.FindByRepoIdAsync(repoId); + if (assignments != null && assignments.Any()) + { + return assignments.Where(auctionAssignment => auctionAssignment.IsActive == true && + auctionAssignment.AuctionAssignmentToCollaterals.Any(aa2c => collaterals + .Select(collateral => collateral.CollateralId) + .Contains(aa2c.CollateralId))); + } + + return null; + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AuctionHouseService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AuctionHouseService.cs new file mode 100644 index 0000000..b403636 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AuctionHouseService.cs @@ -0,0 +1,161 @@ +using System; +using System.Collections.Generic; +using System.Data.SqlClient; +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Exceptions; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using Serilog; + +namespace LCU.API.Collections.RepoApi.Services +{ + public class AuctionHouseService : IAuctionHouseService + { + private readonly IAuctionHouseRepository _auctionHouseRepository; + private readonly IUnitOfWork _unitOfWork; + + public AuctionHouseService( + IAuctionHouseRepository auctionHouseRepository, + IUnitOfWork unitOfWork) + { + _auctionHouseRepository = auctionHouseRepository; + _unitOfWork = unitOfWork; + } + + public async Task> ListAllAsync() + { + try + { + return await _auctionHouseRepository.ListAllAsync(); + } + catch (Exception ex) + { + Log.Error(ex, "Failure retrieving Auctions"); + throw new ServerErrorException(); + } + } + + public async Task GetAsync(string id) + { + AuctionHouse auction; + try + { + auction = await _auctionHouseRepository.FindByIdAsync(id); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure retrieving Auction with id: {id}"); + throw new ServerErrorException(); + } + + if (auction == null) + { + throw new NotFoundException($"Auction with id {id} not found."); + } + + return auction; + } + + public async Task SaveAsync(AuctionHouse auction) + { + try + { + await _auctionHouseRepository.AddAsync(auction); + await _unitOfWork.CompleteAsync(); + + return auction; + } + catch (Exception ex) + { + Log.Error(ex, "Failure saving Auction", auction); + throw new ServerErrorException(); + } + } + + public async Task UpdateAsync(AuctionHouse auction) + { + AuctionHouse existing; + try + { + existing = await _auctionHouseRepository.FindByIdAsync(auction.AuctionID); + } + catch (Exception ex) + { + Log.Error(ex, $"Failed to find existing Auction House to update with id: {auction.AuctionID}", auction); + throw new ServerErrorException(); + } + + + if (existing == null) + { + throw new NotFoundException($"Auction with id {auction.AuctionID} not found."); + } + + existing.Name = auction.Name; + existing.Active = auction.Active; + existing.Address_Line_1 = auction.Address_Line_1; + existing.Address_Line_2 = auction.Address_Line_2; + existing.City = auction.City; + existing.State = auction.State; + existing.ZIP = auction.ZIP; + existing.Country = auction.Country; + existing.Phone = auction.Phone; + existing.Fax = auction.Fax; + existing.Latitude = auction.Latitude; + existing.Longitude = auction.Longitude; + + try + { + _auctionHouseRepository.Update(existing); + await _unitOfWork.CompleteAsync(); + return (existing); + } + catch (SqlException ex) + { + Log.Error(ex, $"SQL Failure updating Auction: {auction}", auction); + throw new ServerErrorException(); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure updating Auction {auction}", auction); + throw new ServerErrorException(); + } + } + + public async Task DeleteAsync(string id) + { + AuctionHouse existingAuction; + try + { + existingAuction = await _auctionHouseRepository.FindByIdAsync(id); + } + catch (Exception ex) + { + Log.Error(ex, $"Failed to find existing Auction House to delete with id: {id}"); + throw new ServerErrorException(); + } + + if (existingAuction == null) + { + throw new NotFoundException($"Auction with id {id} not found."); + } + + try + { + _auctionHouseRepository.Remove(existingAuction); + await _unitOfWork.CompleteAsync(); + return existingAuction; + } + catch (SqlException ex) + { + Log.Error(ex, $"SQL Failure deleting Auction with id: {id}"); + throw new ServerErrorException(); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure deleting Auction with id : {id}"); + throw new ServerErrorException(); + } + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AuditRecordService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AuditRecordService.cs new file mode 100644 index 0000000..532219d --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AuditRecordService.cs @@ -0,0 +1,151 @@ +using System; +using System.Data.SqlClient; +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Exceptions; +using LCU.API.Collections.RepoApi.Models.Filters; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.Results; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using Serilog; + +namespace LCU.API.Collections.RepoApi.Services +{ + public class AuditRecordService : IAuditRecordService + { + private readonly IAuditRecordRepository _repoAccountRepository; + private readonly IUnitOfWork _unitOfWork; + + public AuditRecordService( + IAuditRecordRepository repoAccountRepository, + IUnitOfWork unitOfWork) + { + _repoAccountRepository = repoAccountRepository; + _unitOfWork = unitOfWork; + } + + public async Task> ListAll(PageFilter filter) + { + try + { + return await _repoAccountRepository.ListAllAsync(filter.Page, filter.Limit); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure retrieving AuditRecords with page filter {filter}",filter); + throw new ServerErrorException(); + } + } + + public async Task SaveAsync(AuditRecord repoAccount) + { + try + { + await _repoAccountRepository.AddAsync(repoAccount); + await _unitOfWork.CompleteAsync(); + + return repoAccount; + } + catch (Exception ex) + { + Log.Error(ex, $"Failure saving AuditRecord for repoAccount: {repoAccount}", repoAccount); + throw new ServerErrorException(); + } + } + + public async Task Get(int id) + { + AuditRecord repoAccount; + try + { + repoAccount = await _repoAccountRepository.FindByIdAsync(id); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure retrieving AuditRecord wtih id: {id}"); + throw new ServerErrorException(); + } + + if (repoAccount == null) + { + throw new NotFoundException($" AuditRecords with id {id} not found."); + } + + return repoAccount; + } + + public async Task UpdateAsync(AuditRecord auditRecord) + { + + AuditRecord existingAuditRecord = null; + + try + { + existingAuditRecord = await _repoAccountRepository.FindByIdAsync(auditRecord.ID); + } + catch(Exception ex) + { + Log.Error(ex, $"Failure retreving existing auditRecord wtih auditrecordId: AuditRecordID: {auditRecord.ID}", auditRecord); + throw new ServerErrorException(); + } + + if (existingAuditRecord == null) + { + throw new NotFoundException($" AuditRecord with id {auditRecord.ID} not found."); + } + + try + { + _repoAccountRepository.Update(existingAuditRecord); + await _unitOfWork.CompleteAsync(); + return (existingAuditRecord); + } + catch (SqlException ex) + { + Log.Error(ex, $"SQL Failure updating AuditRecord: {auditRecord}", auditRecord); + throw new ServerErrorException(); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure updating AuditRecord: {auditRecord}", auditRecord); + throw new ServerErrorException(); + } + } + + public async Task DeleteAsync(int id) + { + AuditRecord existingAuditRecord = null; + try + { + existingAuditRecord = await _repoAccountRepository.FindByIdAsync(id); + } + catch(Exception ex) + { + + Log.Error(ex, $"Failure retreving existing auditRecord wtih auditrecordId: AuditRecordID: {id}"); + throw new ServerErrorException(); + } + + if (existingAuditRecord == null) + { + throw new NotFoundException($" AuditRecord with id {id} not found."); + } + + try + { + _repoAccountRepository.Remove(existingAuditRecord); + await _unitOfWork.CompleteAsync(); + return existingAuditRecord; + } + catch (SqlException ex) + { + Log.Error(ex, $"SQL Failure deleting AuditRecord with id: {id}", id); + throw new ServerErrorException(); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure deleting AuditRecord with id: {id}", id); + throw new ServerErrorException(); + } + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AutoIms/AuctionFtpClientService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AutoIms/AuctionFtpClientService.cs new file mode 100644 index 0000000..291cdff --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AutoIms/AuctionFtpClientService.cs @@ -0,0 +1,94 @@ +using System; +using System.Collections.Generic; +using System.IO; +using LCU.API.Collections.RepoApi.Configuration; +using Serilog; +using WinSCP; +using SessionOptions = WinSCP.SessionOptions; +using TransferMode = WinSCP.TransferMode; + +namespace LCU.API.Collections.RepoApi.Services.AutoIms +{ + public class AuctionFtpClientService : IAuctionFtpClientService + { + private readonly SessionOptions _sessionOptions; + private readonly RepoApiConfiguration _configuration; + + public AuctionFtpClientService(RepoApiConfiguration configuration) + { + _configuration = configuration; + _sessionOptions = new SessionOptions() + { + Protocol = Protocol.Sftp, + HostName = configuration.FtpConfiguration.HostName, + UserName = configuration.FtpConfiguration.UserName, + PortNumber = configuration.FtpConfiguration.Port, + SshHostKeyFingerprint = configuration.FtpConfiguration.SshHostKeyFingerprint, + SshPrivateKeyPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, + configuration.FtpConfiguration.SshPrivateKeyPath) + }; + } + + public Dictionary Download() + { + var fileResults = new Dictionary(); + using (Session session = new Session()) + { + TransferOperationResult transferResult = null; + try + { + session.ExecutablePath = _configuration.FtpConfiguration.ExecutablePath; + session.Open(_sessionOptions); + } + catch (WinSCP.SessionLocalException wsle) + { + Log.Error(wsle, "Failed to open FTP session, WINSCP likely missing"); + return fileResults; + } + catch (Exception ex) + { + Log.Error(ex,"Failed to open FTP session"); + return fileResults; + } + + TransferOptions transferOptions = new TransferOptions(); + transferOptions.TransferMode = TransferMode.Automatic; + transferOptions.PreserveTimestamp = true; + + RemoteDirectoryInfo directory = session.ListDirectory(_configuration.RemoteFilePath); + + foreach (RemoteFileInfo fileInfo in directory.Files) + { + string localFileName = Path.Combine(_configuration.LocalDirectoryPath, fileInfo.Name); + var remoteFileName = Path.Combine(_configuration.RemoteFilePath, fileInfo.Name); + + FileInfo thisFileInfo = null; + + try + { + if (!fileInfo.IsDirectory && !File.Exists(localFileName)) + { + thisFileInfo = new FileInfo(localFileName); + fileResults.Add(thisFileInfo, "success"); + + transferResult = session.GetFiles(remoteFileName, localFileName, true, transferOptions); + + // Throw on any error + transferResult.Check(); + } + } + catch (Exception ex) + { + Log.Error(ex, "Exception while FTP'ing files "); + if (thisFileInfo != null) + { + fileResults[thisFileInfo] = ex.Message; + } + } + } + } + + return fileResults; + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AutoIms/AuctionProcessorDao.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AutoIms/AuctionProcessorDao.cs new file mode 100644 index 0000000..bb40a49 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AutoIms/AuctionProcessorDao.cs @@ -0,0 +1,238 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Extensions; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Persistence; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using LCU.Shared.Collections.RepoApiLib.WebServices.AutoIMS; +using Microsoft.EntityFrameworkCore; +using Serilog; +using AuctionAssignment = LCU.Shared.Collections.RepoApiLib.Models.AuctionAssignment; + +namespace LCU.API.Collections.RepoApi.Services.AutoIms +{ + public class AuctionProcessorDao : IAuctionProcessorDao + { + private readonly IImsAutoFileDataRepository _imsAutoFileDataRepository; + private readonly IAutoImsWebService _autoImsWebService; + private readonly IUnitOfWork _unitOfWork; + private readonly AppDbContext _context; + private readonly string statusTypeRepo = "REPO"; + private readonly string statusTypeSold = "SOLD"; + private readonly string statusTypeRedeemed = "REDEEMED"; + + public AuctionProcessorDao( + IImsAutoFileDataRepository imsAutoFileDataRepository, + IAutoImsWebService autoImsWebService, + AppDbContext context, + IUnitOfWork unitOfWork + ) + { + _context = context; + _unitOfWork = unitOfWork; + _imsAutoFileDataRepository = imsAutoFileDataRepository; + _autoImsWebService = autoImsWebService; + } + + public string UpdateAutoImsFromAuctionData(ImsAutoFileData item) + { + try + { + WebServiceResponse response = null; + + Task.Run(async () => + { + response = await _autoImsWebService.UpdateAuctionIdentifyingValuesAsync( + item.AuctionCustomerNo, + item.VIN, + item.AuctionAssignmentId.ToString()); + }).Wait(); + return "Updated AutoIMS with Landmark identifiers."; + } + catch (Exception ex) + { + Log.Error(ex, "UpdateAutoIMS From Auction Failure"); + return "Failure Updating AutoIMS with Landmark identifiers."; + } + } + + public static string GetFormattedVin(string vin) + { + return !string.IsNullOrWhiteSpace(vin) + ? vin.Trim().PadLeft(17, '0').ToUpper() + : null; + } + + public RepoAccount FindByAuctionCustomerNoAndVinAsync(string auctionCustomerNo, string unformattedVin) + { + List repos = FindRepoByStatus(auctionCustomerNo, unformattedVin, statusTypeRepo); + + + if (!repos.Any()) + { + repos = FindRepoByStatus(auctionCustomerNo, unformattedVin, statusTypeSold); + } + + if (!repos.Any()) + { + repos = FindRepoByStatus(auctionCustomerNo, unformattedVin, statusTypeRedeemed); + } + + /* + Currently we cannot error on multiple rows returned because we can have duplicate repos in the database + We will need to perform extensive data cleanup before this can be enabled + */ + // if (repos.Count > 1) + // { + // throw new Exception($"Multiple Auction Assignments Returned For: AuctionCustomerNo:{auctionCustomerNo} | VIN:{vin}"); + // } + + return repos.FirstOrDefault(); + } + + public ImsAutoFileData UpdateExistingFile(ImsAutoFileData existingAuctionFile, ImsAutoFileData imsAutoFileData) + { + _context.Entry(existingAuctionFile).CurrentValues.SetValues(imsAutoFileData); + imsAutoFileData.DateReceivedFromAutoIMS = existingAuctionFile.DateReceivedFromAutoIMS; + imsAutoFileData.CollateralImagePath = + _autoImsWebService.GetCollateralImage(imsAutoFileData.ConditionReportLink); + _imsAutoFileDataRepository.Update(existingAuctionFile); + _unitOfWork.CompleteAsync().GetAwaiter().GetResult(); + return imsAutoFileData; + } + + public ImsAutoFileData CreateImsAuctionFileData(ImsAutoFileData imsAutoFileData) + { + imsAutoFileData.DateReceivedFromAutoIMS = DateTime.Now; + imsAutoFileData.CollateralImagePath = + _autoImsWebService.GetCollateralImage(imsAutoFileData.ConditionReportLink); + Add(imsAutoFileData); + _unitOfWork.CompleteAsync().GetAwaiter().GetResult(); + + return imsAutoFileData; + } + + public void Add(ImsAutoFileData assignment) + { + _context.ImsAutoFileData.Add(assignment); + } + + public ImsAutoFileData FindByAuctionAssignmentIdAsync(int auctionAssignmentId) + { + return _context.ImsAutoFileData.AsNoTracking() + .FirstOrDefault(x => x.AuctionAssignmentId == auctionAssignmentId); + } + + public ImsAutoFileData GetNonConformingImsFileRecord(string vin, string auctionCustomerNo) + { + ImsAutoFileData imsAutoFile = null; + + // Allow for vehicle brought back to auction after sale. it happens! + DateTime withinThirtyDays = DateTime.Now.AddDays(-30); + imsAutoFile = _context.ImsAutoFileData.AsNoTracking().FirstOrDefault(x => + (x.VIN.Trim() == vin && x.AuctionCustomerNo == auctionCustomerNo + && (x.SoldDate == null || x.SoldDate >= withinThirtyDays))); + + return imsAutoFile; + } + + + public ImsAutoFileData FindImsAuctionFileData(int auctionAssignmentId, string customerNo, string VIN) + { + var existingAuctionFile = FindByAuctionAssignmentIdAsync(auctionAssignmentId) ?? GetNonConformingImsFileRecord(VIN, customerNo); + return existingAuctionFile; + } + + public AuctionAssignment FindByIdAsync(int id) + { + return _context.AuctionAssignments.Where(c => c.ID == id).IncludeAll().FirstOrDefault(); + } + + public AuctionAssignment FindByAuctionCustomerNoAndVin(string auctionCustomerNo, string vin) + { + List auctionAssignments = FindAuctionByStatus(auctionCustomerNo, vin, statusTypeRepo); + + if(!auctionAssignments.Any()) + { + auctionAssignments = FindAuctionByStatus(auctionCustomerNo, vin, statusTypeSold); + } + + if (!auctionAssignments.Any()) + { + auctionAssignments = FindAuctionByStatus(auctionCustomerNo, vin, statusTypeRedeemed); + } + + return auctionAssignments.FirstOrDefault(); + } + + public AuctionAssignment FindAuctionAssignment(ImsAutoFileData item) + { + var auctionAssignment + = /* FindByIdAsync(item.AuctionAssignmentId) this can't be used because old numbers will exist at first. ??*/ + FindByAuctionCustomerNoAndVin(item.AuctionCustomerNo, item.VIN); + + if (auctionAssignment == null) + { + throw new Exception("Auction assignment not found for Individual/VIN " + item.AuctionCustomerNo); + } + + return auctionAssignment; + } + + public RepoAccount FindRepoForImsAuctionItem(ImsAutoFileData item) + { + RepoAccount repo = null; + + // GJF, this can't be used because old numbers will exist at first.... + // if (item.AuctionAssignmentId > 0) { + // repo = await _repoAccountRepository.FindByAuctionAssignmentIdAsync(item.AuctionAssignmentId); + // } + + repo = FindByAuctionCustomerNoAndVinAsync(item.AuctionCustomerNo, item.VIN); + + if (repo == null) + { + throw new Exception("Repo Account not found for Individual/VIN " + item.AuctionCustomerNo); + } + + return repo; + } + + public IReadOnlyCollection ListReadyForFloorPrice() + { + var temp = (from x in _context.AuctionAssignments + where (x.FloorPrice ?? 0) == 0 && x.AutoIMS != null && x.AutoIMS.SoldDate == null && + (x.AutoIMS.StatedMileage ?? -1) > 1 && x.AutoIMS.ScheduledSaleDate != null && + x.AutoIMS.ScheduledSaleDate > DateTime.Now.Date && + x.RedeemedDate == null && + ((x.AutoIMS.ApprovedVehicleGrade ?? 0) > 0 || (x.AutoIMS.VehicleGrade ?? 0) > 0) + select x).OrderByDescending(x => x.ID); + + return temp.IncludeAll().ToList(); + } + + private List FindRepoByStatus(string auctionCustomerNo, string unformattedVin, string statusType) + { + return (from account in _context.RepoAccounts + join collateral in _context.Collaterals on account.RepoId equals collateral.RepoId + join auctionAssignment in _context.AuctionAssignments on account.RepoId equals auctionAssignment.RepoId + where GetFormattedVin(collateral.Vin) == GetFormattedVin(unformattedVin) + && (auctionAssignment.AuctionCustomerNo == auctionCustomerNo || string.IsNullOrWhiteSpace(auctionCustomerNo)) + && account.Status == statusType + select account).ToList(); + } + + private List FindAuctionByStatus(string auctionCustomerNo, string vin, string statusType) + { + return (from auctionAssignment in _context.AuctionAssignments + join account in _context.RepoAccounts on auctionAssignment.RepoId equals account.RepoId + join collateral in _context.Collaterals on account.RepoId equals collateral.RepoId + where GetFormattedVin(collateral.Vin) == GetFormattedVin(vin) + && (auctionAssignment.AuctionCustomerNo == auctionCustomerNo || string.IsNullOrWhiteSpace(auctionCustomerNo)) + && account.Status == statusType + select auctionAssignment).ToList(); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AutoIms/AutoImsAuctionProcessorService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AutoIms/AutoImsAuctionProcessorService.cs new file mode 100644 index 0000000..2524dcb --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AutoIms/AutoImsAuctionProcessorService.cs @@ -0,0 +1,121 @@ +using System; +using System.Collections.Generic; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.AutoIms; +using Serilog; + +namespace LCU.API.Collections.RepoApi.Services.AutoIms +{ + public class AutoImsAuctionProcessorService : IAutoImsAuctionProcessorService + { + private readonly IAuctionProcessorDao _auctionProcessorDao; + + public AutoImsAuctionProcessorService(IAuctionProcessorDao auctionProcessorDao) + { + _auctionProcessorDao = auctionProcessorDao; + } + + public ImportResultRow ImportSingleAutoImsAuction(ImsAutoFileData incomingAutoImsData) + { + AuctionAssignment auctionAssignment; + var result = new ImportResultRow() + { + Success = true, + Description = incomingAutoImsData.Description, + Messages = new List() + }; + + incomingAutoImsData.VIN = incomingAutoImsData.VIN.Trim(); + if (incomingAutoImsData.VIN.Length != 17) // must be 17. Auction may add as less than 17 characters. + { + Log.Error($"Vin Length Not Correct, {incomingAutoImsData.AuctionCustomerNo}, {incomingAutoImsData.VIN}, Skipping."); + result.Success = false; + result.Messages.Add("Invalid VIN, this row has been skipped."); + return result; + } + + bool requiresAutoImsUpdate = + string.IsNullOrWhiteSpace(incomingAutoImsData.AuctionCustomerNo) || + incomingAutoImsData.AuctionAssignmentId == 0; + + try + { + result.RepoAccount = _auctionProcessorDao.FindRepoForImsAuctionItem(incomingAutoImsData); + auctionAssignment = _auctionProcessorDao.FindAuctionAssignment(incomingAutoImsData); + } + catch (Exception ex) + { + result.Success = false; + result.Messages.Add("Failed to load required data => " + ex.Message); + return result; + } + + RepoAccount repo = result.RepoAccount; + // Always re-assign these fields, carried from previous system. + incomingAutoImsData.RepoId = auctionAssignment.RepoId ?? 0; + incomingAutoImsData.AuctionCustomerNo = auctionAssignment.AuctionCustomerNo; + incomingAutoImsData.AuctionAssignmentId = auctionAssignment.ID; + + ImsAutoFileData existingAuctionFile = auctionAssignment.AutoIMS; + if (existingAuctionFile == null) + { + existingAuctionFile = _auctionProcessorDao.FindImsAuctionFileData(auctionAssignment.ID, + incomingAutoImsData.AuctionCustomerNo, + incomingAutoImsData.VIN); + } + + if (existingAuctionFile == null) + { + result.Messages.Add("New Entry Created."); + existingAuctionFile = _auctionProcessorDao.CreateImsAuctionFileData(incomingAutoImsData); + if (existingAuctionFile.AssignmentAccepted != null) + { + result.Messages.Add("Auction accepted by Auto IMS on " + existingAuctionFile.AssignmentAccepted); + } + } + else + { + result.Messages.Add("Updated existing IMS Auction Entry."); + existingAuctionFile = _auctionProcessorDao.UpdateExistingFile(existingAuctionFile, incomingAutoImsData); + } + + result = CheckAuctionGates(existingAuctionFile, result); + + // update autoims with customer number and auction assignment id when not added through our interface. + if (requiresAutoImsUpdate) + { + result.Messages.Add( + _auctionProcessorDao.UpdateAutoImsFromAuctionData(existingAuctionFile)); + } + + result.Data = existingAuctionFile; + return result; + } + + public ImportResultRow CheckAuctionGates(ImsAutoFileData existingAuctionFile, ImportResultRow result) + { + if (existingAuctionFile.VehicleGrade > 0) + { + result.Messages.Add("Grade present: " + existingAuctionFile.VehicleGrade + "."); + } + + if (existingAuctionFile.FloorPriceAccepted > 0) + { + result.Messages.Add("Accepted Floor Price present: $" + + existingAuctionFile.FloorPriceAccepted + "."); + } + + if (existingAuctionFile.SoldDate != null) + { + result.Messages.Add("Auction Sold:" + existingAuctionFile.SoldDate + "."); + } + + if (existingAuctionFile.FundsSent != null) + { + result.Messages.Add("Funds Send Date received: " + existingAuctionFile.FundsSent + "."); + } + + return result; + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AutoIms/AutoImsDownloaderService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AutoIms/AutoImsDownloaderService.cs new file mode 100644 index 0000000..eddd903 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AutoIms/AutoImsDownloaderService.cs @@ -0,0 +1,67 @@ +using System.Collections.Generic; +using System.IO; +using System.Linq; +using LCU.API.Collections.RepoApi.Configuration; +using Serilog; + +namespace LCU.API.Collections.RepoApi.Services.AutoIms +{ + public class AutoImsDownloaderService : IAutoImsDownloaderService + { + private readonly RepoApiConfiguration _configuration; + private readonly IAuctionFtpClientService _auctionFtpClientService; + + public AutoImsDownloaderService(IAuctionFtpClientService auctionFtpClientService, + RepoApiConfiguration configuration) + { + _configuration = configuration; + _auctionFtpClientService = auctionFtpClientService; + } + + public Dictionary DownLoadAuctionFiles() + { + var fileResults = _auctionFtpClientService.Download(); + return fileResults; + } + + public Dictionary CombineWithLocalFiles(Dictionary fileResults) + { + // check if there are any files in the folder already that are not in our downloaded list. + string[] fileEntries = Directory.GetFiles(_configuration.LocalDirectoryPath); + + foreach (string file in fileEntries) + { + var newFile = new FileInfo(file); + Log.Information($"Auto IMS Job Added file: {file}"); + + if (fileResults.Keys.All(x => x.Name != newFile.Name)) + { + fileResults.Add(newFile, "success"); + } + } + + return fileResults; + } + + public IEnumerable ConvertToFileList(Dictionary fileResults) + { + if (fileResults.Any(x => x.Value != "success")) + { + foreach (var file in fileResults.Where(x => x.Value != "success")) + { + Log.Information($"File Downloads failed: {file.Key} - {file.Value}"); + } + } + + if (fileResults.Any(x => x.Value == "success")) + { + var ascendingOrderOfFiles = fileResults.Where(x => x.Value == "success") + .OrderBy(x => x.Key.LastWriteTime).Select(x => x.Key).ToList(); + return ascendingOrderOfFiles; + } + + Log.Information("No files found from AutoIMS."); + return new List(); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AutoIms/AutoImsImporterService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AutoIms/AutoImsImporterService.cs new file mode 100644 index 0000000..fd8c1d3 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AutoIms/AutoImsImporterService.cs @@ -0,0 +1,133 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.AutoIms; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using Serilog; + +namespace LCU.API.Collections.RepoApi.Services.AutoIms +{ + public class AutoImsImporterService : IAutoImsImporterService + { + private readonly IAuctionAssignmentRepository _auctionAssignmentRepository; + private readonly IAutoImsNoteProcessorService _autoImsNoteProcessorService; + private readonly IAutoImsAuctionProcessorService _autoImsAuctionProcessorService; + private readonly IFloorPricingService _floorPricingService; + private readonly IAuctionAssignmentService _auctionAssignmentService; + + public AutoImsImporterService( + IAuctionAssignmentRepository auctionAssignmentRepository, + IAutoImsNoteProcessorService autoImsNoteProcessorService, + IAutoImsAuctionProcessorService autoImsAuctionProcessorService, IFloorPricingService floorPricingService, + IAuctionAssignmentService auctionAssignmentService) + { + _autoImsAuctionProcessorService = autoImsAuctionProcessorService; + _floorPricingService = floorPricingService; + _auctionAssignmentService = auctionAssignmentService; + _autoImsNoteProcessorService = autoImsNoteProcessorService; + _auctionAssignmentRepository = auctionAssignmentRepository; + } + + /** + * A set of notes comes from AutoIMS and must be inserted (But not updated). + * Duplicates/Existing are checked for based on writer, time and text. + */ + public IReadOnlyCollection ImportNotesToDatabase(IEnumerable data) + { + List savedData = new List(); + foreach (var item in data) + { + try + { + var result = _autoImsNoteProcessorService.ImportSingleNoteRow(item); + if (result != null) + { + savedData.Add(result); + } + } + catch (Exception ex) + { + Log.Error(ex, $"Error processing notes for auction accountNo: {item.AuctionCustomerNo}"); + } + } + + return savedData; + } + + /** + * Each row in the Data file is an ImsAutoAuctionData row used to track the status of + * a Repo at auction and assist in setting the floor. + */ + public IReadOnlyCollection ImportDataFile(IEnumerable models) + { + List savedData = new List(); + foreach (var item in models) + { + try + { + var result = _autoImsAuctionProcessorService.ImportSingleAutoImsAuction(item); + if (result != null) + { + savedData.Add(result); + } + } + catch (Exception ex) + { + Log.Error(ex, $"Error processing data for auction account with repoId: {item.RepoId}"); + } + } + + return savedData; + } + + public IReadOnlyCollection SetAllAvailableFloors() + { + var list = new List(); + var auctionAssignments = + _auctionAssignmentRepository.ListReadyForFloorPriceAsync() + .ConfigureAwait(continueOnCapturedContext: false).GetAwaiter().GetResult(); + + if (auctionAssignments.Items != null && auctionAssignments.Items.Any()) + { + foreach (var auctionAssignment in auctionAssignments.Items) + { + var result = new ImportResultRow() {Messages = new List()}; + var floorPriceCalculationResultSet = _floorPricingService.DetermineFloorPrice(auctionAssignment.ID); + + if (floorPriceCalculationResultSet?.PrimaryResult != null) + { + result.Messages.Add("Floor Price Results Generated for Account " + auctionAssignment.RepoId); + if (floorPriceCalculationResultSet.PrimaryResult.Success) + { + result.Messages.Add("Floor Price Results SUCCESS for Account " + auctionAssignment.RepoId); + auctionAssignment.FloorPrice = floorPriceCalculationResultSet.PrimaryResult.FloorPrice; + auctionAssignment.FloorPriceValuesUsed = + floorPriceCalculationResultSet.FloorPriceValuesUsed; + var updated = _auctionAssignmentService.UpdateAsync(auctionAssignment).GetAwaiter() + .GetResult(); + Log.Information($"Auction Floor Set Id:{updated.ID}, FloorPrice:{updated.FloorPrice}, Skipping."); + result.Messages.Add( + $"Floor price set for {auctionAssignment.RepoId} to {auctionAssignment.FloorPrice}"); + result.Success = true; + } + else + { + result.Messages.Add("Floor Price Results FAILURE for Account " + auctionAssignment.RepoId); + result.Messages.Add("Reason: " + + floorPriceCalculationResultSet.PrimaryResult.FailureReason); + } + } + + list.Add(result); + } + } + else + { + Log.Information("SetAllAvailableFloors: No floors to set."); + } + + return list; + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AutoIms/AutoImsNoteProcessorService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AutoIms/AutoImsNoteProcessorService.cs new file mode 100644 index 0000000..bf68c18 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AutoIms/AutoImsNoteProcessorService.cs @@ -0,0 +1,44 @@ +using System; +using System.Linq; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using Serilog; + +namespace LCU.API.Collections.RepoApi.Services.AutoIms +{ + public class AutoImsNoteProcessorService : IAutoImsNoteProcessorService + { + private readonly IAuctionAssignmentNoteRepository _auctionAssignmentNoteRepository; + private readonly IUnitOfWork _unitOfWork; + + public AutoImsNoteProcessorService(IAuctionAssignmentNoteRepository auctionAssignmentNoteRepository, + IUnitOfWork unitOfWork + ) + { + _unitOfWork = unitOfWork; + _auctionAssignmentNoteRepository = auctionAssignmentNoteRepository; + } + + public AuctionAssignmentNote ImportSingleNoteRow(AuctionAssignmentNote item) + { + var dateWritten = item.DateWritten ?? DateTime.Now; + var existing = + _auctionAssignmentNoteRepository.FindConflictingNotes(dateWritten, item.Text, item.Writer) + .GetAwaiter().GetResult(); + + if (!existing.Any()) + { + item.DateWritten = dateWritten; + Log.Information("Saving Note."); + _auctionAssignmentNoteRepository.AddAsync(item); + _unitOfWork.CompleteAsync().GetAwaiter().GetResult(); + } + else + { + Log.Information($"Note already exists, customerNo: {item.AuctionCustomerNo} on writeDate: {item.DateWritten}"); + } + + return item; + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AutoIms/IAuctionFtpClientService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AutoIms/IAuctionFtpClientService.cs new file mode 100644 index 0000000..ab279f5 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AutoIms/IAuctionFtpClientService.cs @@ -0,0 +1,10 @@ +using System.Collections.Generic; +using System.IO; + +namespace LCU.API.Collections.RepoApi.Services.AutoIms +{ + public interface IAuctionFtpClientService + { + Dictionary Download(); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AutoIms/IAuctionProcessorDao.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AutoIms/IAuctionProcessorDao.cs new file mode 100644 index 0000000..8e20c31 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AutoIms/IAuctionProcessorDao.cs @@ -0,0 +1,25 @@ +using System.Collections.Generic; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.API.Collections.RepoApi.Services.AutoIms +{ + public interface IAuctionProcessorDao + { + string UpdateAutoImsFromAuctionData(ImsAutoFileData item); + + RepoAccount FindByAuctionCustomerNoAndVinAsync(string auctionCustomerNo, + string unformattedVin); + + ImsAutoFileData UpdateExistingFile(ImsAutoFileData existingAuctionFile, ImsAutoFileData imsAutoFileData); + ImsAutoFileData CreateImsAuctionFileData(ImsAutoFileData imsAutoFileData); + void Add(ImsAutoFileData assignment); + ImsAutoFileData FindByAuctionAssignmentIdAsync(int auctionAssignmentId); + ImsAutoFileData GetNonConformingImsFileRecord(string vin, string auctionCustomerNo); + ImsAutoFileData FindImsAuctionFileData(int auctionAssignmentId, string customerNo, string VIN); + AuctionAssignment FindByIdAsync(int id); + AuctionAssignment FindByAuctionCustomerNoAndVin(string auctionCustomerNo, string vin); + AuctionAssignment FindAuctionAssignment(ImsAutoFileData item); + RepoAccount FindRepoForImsAuctionItem(ImsAutoFileData item); + IReadOnlyCollection ListReadyForFloorPrice(); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AutoIms/IAutoImsAuctionProcessorService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AutoIms/IAutoImsAuctionProcessorService.cs new file mode 100644 index 0000000..26053ca --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AutoIms/IAutoImsAuctionProcessorService.cs @@ -0,0 +1,10 @@ +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.AutoIms; + +namespace LCU.API.Collections.RepoApi.Services.AutoIms +{ + public interface IAutoImsAuctionProcessorService + { + ImportResultRow ImportSingleAutoImsAuction(ImsAutoFileData item); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AutoIms/IAutoImsDownloaderService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AutoIms/IAutoImsDownloaderService.cs new file mode 100644 index 0000000..4b3a5a1 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AutoIms/IAutoImsDownloaderService.cs @@ -0,0 +1,12 @@ +using System.Collections.Generic; +using System.IO; + +namespace LCU.API.Collections.RepoApi.Services.AutoIms +{ + public interface IAutoImsDownloaderService + { + Dictionary DownLoadAuctionFiles(); + Dictionary CombineWithLocalFiles(Dictionary fileResults); + IEnumerable ConvertToFileList(Dictionary fileResults); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AutoIms/IAutoImsImporterService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AutoIms/IAutoImsImporterService.cs new file mode 100644 index 0000000..9940d81 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AutoIms/IAutoImsImporterService.cs @@ -0,0 +1,13 @@ +using System.Collections.Generic; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.AutoIms; + +namespace LCU.API.Collections.RepoApi.Services.AutoIms +{ + public interface IAutoImsImporterService + { + IReadOnlyCollection ImportNotesToDatabase(IEnumerable data); + IReadOnlyCollection ImportDataFile(IEnumerable models); + IReadOnlyCollection SetAllAvailableFloors(); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AutoIms/IAutoImsNoteProcessorService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AutoIms/IAutoImsNoteProcessorService.cs new file mode 100644 index 0000000..b384f10 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AutoIms/IAutoImsNoteProcessorService.cs @@ -0,0 +1,9 @@ +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.API.Collections.RepoApi.Services.AutoIms +{ + public interface IAutoImsNoteProcessorService + { + AuctionAssignmentNote ImportSingleNoteRow(AuctionAssignmentNote item); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AutoIms/IImsAutoFileDataConverter.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AutoIms/IImsAutoFileDataConverter.cs new file mode 100644 index 0000000..f35e0b5 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AutoIms/IImsAutoFileDataConverter.cs @@ -0,0 +1,12 @@ +using System.Collections.Generic; +using System.IO; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.API.Collections.RepoApi.Services.AutoIms +{ + public interface IImsAutoFileDataConverter + { + ImsAutoFileData SetFieldByName(ImsAutoFileData input, string fieldName, string value); + IReadOnlyCollection CsvToImsAutoFileData(Stream file); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AutoIms/IImsAutoFileNoteConverter.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AutoIms/IImsAutoFileNoteConverter.cs new file mode 100644 index 0000000..4046fee --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AutoIms/IImsAutoFileNoteConverter.cs @@ -0,0 +1,13 @@ +using System.Collections.Generic; +using System.IO; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.API.Collections.RepoApi.Services.AutoIms +{ + public interface IImsAutoFileNoteConverter + { + IEnumerable CsvToImsAutoFileNotes(Stream file); + IEnumerable CompressIdentifyingRows(IEnumerable csvNotes); + AuctionAssignmentNote SetFieldByName(AuctionAssignmentNote input, string fieldName, string value); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AutoIms/ImsAutoFileDataConverter.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AutoIms/ImsAutoFileDataConverter.cs new file mode 100644 index 0000000..86c0099 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AutoIms/ImsAutoFileDataConverter.cs @@ -0,0 +1,311 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text.RegularExpressions; +using LCU.API.Collections.RepoApi.Configuration; +using LCU.Shared.Collections.RepoApiLib.Models; +using NotVisualBasic.FileIO; +using Serilog; + +namespace LCU.API.Collections.RepoApi.Services.AutoIms +{ + public class ImsAutoFileDataConverter : IImsAutoFileDataConverter + { + private readonly RepoApiConfiguration _configuration; + + public ImsAutoFileDataConverter( RepoApiConfiguration configuration) + { + _configuration = configuration; + } + + public IReadOnlyCollection CsvToImsAutoFileData(Stream file) + { + List listOfObjects = new List(); + using (CsvTextFieldParser tfp = new CsvTextFieldParser(file)) + { + // Get Some Column Names + string[] columns = tfp.ReadFields(); + + while (!tfp.EndOfData) + { + var fields = tfp.ReadFields(); + + if (!fields[0].Contains("------") && (fields.Any(x => x.Trim().Length > 0))) + { + var obj = new ImsAutoFileData(); + + for (var i = 0; i < fields.Length; i++) + { + obj = SetFieldByName(obj, columns[i].Trim(), fields[i]); + } + + listOfObjects.Add(obj); + } + } + } + return listOfObjects; + } + + public ImsAutoFileData SetFieldByName(ImsAutoFileData input, string fieldName, string value) + { + try + { + switch (fieldName) + { + case "Announced Conditions": + input.AnnouncedConditions = value.Trim(); + break; + case "Arbitration Reason": + input.ArbitrationReason = value.Trim(); + break; + case "As Is 100K Miles": + input.AsIs100KMiles = (value.Trim() == "Yes"); + break; + case "Assignment Accepted": + input.AssignmentAccepted = + !string.IsNullOrWhiteSpace(value) ? DateTime.Parse(value) : (DateTime?) null; + break; + case "Auction Age": + input.AuctionAge = !string.IsNullOrWhiteSpace(value) ? NumbersOnly(value) : (int?) null; + break; + case "Auction Guide Book Price": + input.AuctionGuideBookPrice = !string.IsNullOrWhiteSpace(value) + ? NumbersOnly(value) + : (decimal?) null; + break; + case "Buyer ID": + input.BuyerId = value.Trim(); + break; + case "Buyer Name": + input.BuyerName = value.Trim(); + break; + case "Charge Amount": + input.ChargeAmount = !string.IsNullOrWhiteSpace(value) + ? NumbersOnly(value) + : (decimal?) null; + break; + case "Check Amount": + input.CheckAmount = !string.IsNullOrWhiteSpace(value) + ? NumbersOnly(value) + : (decimal?) null; + break; + case "Client Age": + input.ClientAge = !string.IsNullOrWhiteSpace(value) ? NumbersOnly(value) : (int?) null; + break; + case "Client Cancelled": + input.ClientCancelled = + !string.IsNullOrWhiteSpace(value) ? DateTime.Parse(value) : (DateTime?) null; + break; + case "Collision Damage": + input.CollisionDamage = value.Trim(); + break; + case "Inspected Date": + input.InspectedDate = !string.IsNullOrEmpty(value) ? DateTime.Parse(value) : (DateTime?) null; + break; + case "Date of Loss": + input.DateofLoss = !string.IsNullOrEmpty(value) ? DateTime.Parse(value) : (DateTime?) null; + break; + case "Date Picked Up": + input.DatePickedUp = !string.IsNullOrEmpty(value) ? DateTime.Parse(value) : (DateTime?) null; + break; + case "Date Entered AutoIMS": + input.DateEnteredAutoIMS = !string.IsNullOrEmpty(value) + ? DateTime.Parse(value.Substring(0, value.Trim().Length - 4)) + : (DateTime?) null; + break; + case "Days Run": + input.DaysRun = !string.IsNullOrWhiteSpace(value) ? NumbersOnly(value) : (int?) null; + break; + case "Days Run/Highest Bid Recorded by Auction": + input.DaysRunHighestBidRecordedbyAuction = value; + break; + case "Days to Delivery": + input.DaystoDelivery = + !string.IsNullOrWhiteSpace(value) ? NumbersOnly(value) : (int?) null; + break; + case "Description": + input.Description = value.Trim(); + break; + case "Drivable": + input.IsDrivable = !string.IsNullOrWhiteSpace(value) + ? value == "Yes" ? true : false + : (bool?) null; + break; + case "Floor Price (Accepted)": + input.FloorPriceAccepted = !string.IsNullOrWhiteSpace(value) + ? NumbersOnly(value) + : (decimal?) null; + break; + case "Funds Sent": + input.FundsSent = !string.IsNullOrEmpty(value) ? DateTime.Parse(value) : (DateTime?) null; + break; + case "Gross % Floor": + input.GrossPercentFloor = + !string.IsNullOrWhiteSpace(value) ? NumbersOnly(value) : (decimal?) null; + break; + case "Highest Bid": + input.HighestBid = !string.IsNullOrWhiteSpace(value) + ? NumbersOnly(value) + : (decimal?) null; + break; + case "Mileage": + input.StatedMileage = !string.IsNullOrWhiteSpace(value) + ? int.Parse(value.Replace(",", "")) + : (int?) null; + break; + case "Net % Floor": + input.NetPercentFloor = !string.IsNullOrWhiteSpace(value) + ? NumbersOnly(value) + : (decimal?) null; + break; + case "Other Advance Fees": + input.OtherAdvanceFees = !string.IsNullOrWhiteSpace(value) + ? NumbersOnly(value) + : (decimal?) null; + break; + case "OTHER Total": + input.OTHERTotal = value.Trim(); + break; + case "OTHER: Advanced Other(72)": + input.OTHERAdvancedOther = value.Trim(); + break; + case "OTHER: Advanced Storage(71)": + input.OTHERAdvancedStorage = value.Trim(); + break; + case "OTHER: Advanced Tow(70)": + input.OTHERAdvancedTow = value.Trim(); + break; + case "OTHER: Miscellaneous(41)": + input.OTHERMiscellaneous = value.Trim(); + break; + case "Sale Price": + input.SalePrice = !string.IsNullOrWhiteSpace(value) + ? NumbersOnly(value) + : (decimal?) null; + break; + case "Scheduled Sale Date": + input.ScheduledSaleDate = + !string.IsNullOrWhiteSpace(value) ? DateTime.Parse(value) : (DateTime?) null; + break; + case "Sold Date": + input.SoldDate = !string.IsNullOrWhiteSpace(value) ? DateTime.Parse(value) : (DateTime?) null; + break; + case "Title #": + input.TitleNumber = value.Trim(); + break; + case "Title Received": + input.TitleReceived = + !string.IsNullOrWhiteSpace(value) ? DateTime.Parse(value) : (DateTime?) null; + break; + case "Title Returned": + input.TitleReturned = + !string.IsNullOrWhiteSpace(value) ? DateTime.Parse(value) : (DateTime?) null; + break; + case "Title State": + input.TitleState = value.Trim(); + break; + case "Title Status": + input.TitleStatus = value.Trim(); + break; + case "Title Status from Auction": + input.TitleStatusfromAuction = value.Trim(); + break; + case "Total Charges": + input.TotalCharges = !string.IsNullOrWhiteSpace(value) + ? NumbersOnly(value) + : (decimal?) null; + break; + case "Vehicle Grade (Approved CR)": + input.ApprovedVehicleGrade = !string.IsNullOrWhiteSpace(value) + ? NumbersOnly(value) + : (decimal?) null; + break; + case "Operable": + input.IsOperable = !string.IsNullOrWhiteSpace(value) + ? value == "Yes" ? true : false + : (bool?) null; + break; + case "Shipment Date": + input.ShipmentDate = + !string.IsNullOrWhiteSpace(value) ? DateTime.Parse(value) : (DateTime?) null; + break; + case "Status": + input.Status = value.Trim(); + break; + case "VIN": + input.VIN = value.Trim(); + break; + case "Storage Cost": + input.StorageCost = !string.IsNullOrWhiteSpace(value) + ? NumbersOnly(value) + : (decimal?) null; + break; + case "Storage Rate Per Day": + input.StorageRatePerDay = !string.IsNullOrWhiteSpace(value) + ? NumbersOnly(value) + : (decimal?) null; + break; + case "Tow Cost": + input.TowCost = !string.IsNullOrWhiteSpace(value) + ? NumbersOnly(value) + : (decimal?) null; + break; + case "Cn. Acc. #": + input.AuctionCustomerNo = value.Trim(); + break; + case "Auction ID": + break; + case "Vehicle Decimal Grade Code": + input.VehicleDecimalGradeCode = !string.IsNullOrWhiteSpace(value) + ? NumbersOnly(value) + : (decimal?) null; + break; + case "Vehicle Grade": + input.VehicleGrade = !string.IsNullOrWhiteSpace(value) + ? NumbersOnly(value) + : (decimal?) null; + break; + case "Most Recent National Adjusted MMR Price": + input.MMRNationalAdjustedPrice = !string.IsNullOrWhiteSpace(value) + ? NumbersOnly(value) + : (decimal?) null; + break; + case "Most Recent Regional Adjusted MMR Price": + input.MMRRegionalAdjustedPrice = !string.IsNullOrWhiteSpace(value) + ? NumbersOnly(value) + : (decimal?) null; + break; + case "MMR": + input.MMR = value.Trim(); + break; + case "External CR Link": + input.ConditionReportLink = _configuration.ConditionReportUrl + value; + break; + case "Open Text 1": + input.AuctionAssignmentId = + !string.IsNullOrWhiteSpace(value) ? int.Parse(value.Replace(",", "")) : -1; + break; + default: + Log.Error("Got unknown field {0} with value {1} for ImsAutoFileData", fieldName, + value); + break; + } + } + catch (Exception ex) + { + Log.Error(ex, $"Failed to set field {fieldName} with value {value} for ImsAutoFileData"); + } + + return input; + } + + private static T NumbersOnly(string val) + { + var formattedStr = Regex.Replace(val.Trim(), "[^0-9\\.]", ""); + if (string.IsNullOrWhiteSpace(formattedStr)) + formattedStr = "-1"; + return (T) Convert.ChangeType(formattedStr, typeof(T)); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AutoIms/ImsAutoFileNoteConverter.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AutoIms/ImsAutoFileNoteConverter.cs new file mode 100644 index 0000000..48926a2 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AutoIms/ImsAutoFileNoteConverter.cs @@ -0,0 +1,129 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using LCU.Shared.Collections.RepoApiLib.Models; +using NotVisualBasic.FileIO; +using Serilog; + +namespace LCU.API.Collections.RepoApi.Services.AutoIms +{ + public class ImsAutoFileNoteConverter : IImsAutoFileNoteConverter + { + public ImsAutoFileNoteConverter() + { + } + + public IEnumerable CsvToImsAutoFileNotes(Stream file) + { + List listOfObjects = new List(); + + using (CsvTextFieldParser tfp = new CsvTextFieldParser(file)) + { + // Get Some Column Names + string[] columns = tfp.ReadFields(); + + while (!tfp.EndOfData) + { + var fields = tfp.ReadFields(); + + if (!fields[0].Contains("------") && (fields.Any(x => x.Trim().Length > 0))) + { + var obj = new AuctionAssignmentNote(); + + for (var i = 0; i < fields.Length; i++) + { + obj = SetFieldByName(obj, columns[i].Trim(), fields[i].Trim()); + } + + listOfObjects.Add(obj); + } + } + } + + return listOfObjects; + } + + /** + * Take the rows with only account and discard them, using the account no to update the other rows. + * Each row in the CSV does not have CustomerAccountNo, only the first row of each set. + * Further, if a row has a customer account no, it has nothing else. + */ + public IEnumerable CompressIdentifyingRows(IEnumerable csvNotes) + { + List data = new List(); + string accountNo = String.Empty; + + foreach (var item in csvNotes) + { + try + { + if (!string.IsNullOrWhiteSpace(item.AuctionCustomerNo) && item.AuctionCustomerNo != accountNo) + { + accountNo = item.AuctionCustomerNo; + // Skip account rows, unless they start showing up with data. + if (string.IsNullOrWhiteSpace(item.Text)) + { + continue; + } + } + + if (string.IsNullOrWhiteSpace(accountNo)) + { + Log.Error($"No Account Number when processing notes row, {item.Text}"); + return null; + } + + item.AuctionCustomerNo = accountNo; + data.Add(item); + } + catch (Exception ex) + { + Log.Error(ex, $"Error compressing notes for auction accountNo: {accountNo}"); + } + } + + return data; + } + + public AuctionAssignmentNote SetFieldByName(AuctionAssignmentNote input, string fieldName, string value) + { + try + { + switch (fieldName) + { + case "Cn. Acc. #": + input.AuctionCustomerNo = value; + break; + case "Origin": + input.Origin = value; + break; + case "Writer": + input.Writer = value; + break; + case "Type": + input.Type = value; + break; + case "Text": + input.Text = value; + break; + case "Date Written": + input.DateWritten = !string.IsNullOrWhiteSpace(value) + ? DateTime.Parse(value.Substring(0, value.Trim().Length - 4)) + : (DateTime?) null; + break; + + default: + Log.Error("Got unknown field {fieldName} with value {value} for AuctionAssignmentNote"); + break; + } + } + catch (Exception ex) + { + Log.Error(ex, "Failed to set field {fieldName} with value {value} for AuctionAssignmentNote."); + } + + return input; + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AutoImsService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AutoImsService.cs new file mode 100644 index 0000000..1ffa7c1 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/AutoImsService.cs @@ -0,0 +1,158 @@ +using System; +using System.Collections.Generic; +using System.IO; +using LCU.API.Collections.RepoApi.Configuration; +using LCU.API.Collections.RepoApi.Services.AutoIms; +using LCU.Shared.Collections.RepoApiLib.Models; +using Serilog; + +namespace LCU.API.Collections.RepoApi.Services +{ + public class AutoImsService + { + private readonly IImsAutoFileDataConverter _imsAutoFileDataConverter; + private readonly IImsAutoFileNoteConverter _imsAutoFileNoteConverter; + private readonly IEmailer _emailer; + private readonly IAutoImsDownloaderService _downloaderService; + private readonly RepoApiConfiguration _config; + private readonly IAutoImsImporterService _autoImsImporterService; + + public AutoImsService( + IAutoImsDownloaderService downloaderService, + RepoApiConfiguration config, + IAutoImsImporterService autoImsImporterService, + IImsAutoFileDataConverter imsAutoFileDataConverter, + IImsAutoFileNoteConverter imsAutoFileNoteConverter, IEmailer emailer) + { + _downloaderService = downloaderService; + _config = config; + _emailer = emailer; + _autoImsImporterService = autoImsImporterService; + _imsAutoFileDataConverter = imsAutoFileDataConverter; + _imsAutoFileNoteConverter = imsAutoFileNoteConverter; + } + + public IEnumerable Download() + { + Log.Information("Starting AutoIMS Download Process."); + var files = new Dictionary(); + + try + { + if (_config.DownloadNewFiles) + { + Log.Debug("Downloading auction files."); + files = _downloaderService.DownLoadAuctionFiles(); + } + + if (_config.CheckForLocalFiles) + { + Log.Debug("Checking for local files."); + files = _downloaderService.CombineWithLocalFiles(files); + } + } + catch (Exception ex) + { + Log.Error(ex,"AutoIms File Downloader Failure"); + } + + Log.Information("Finished AutoIMS Download Process."); + return _downloaderService.ConvertToFileList(files); + } + + public void ProcessDownloadedFiles(IEnumerable ascendingOrderOfFiles) + { + Log.Debug("Starting AutoIMS Entry Processing."); + + if (ascendingOrderOfFiles == null) + { + throw new Exception("Must pass a valid IEnumerable of FileInfo to ProcessDownloads."); + } + + foreach (var file in ascendingOrderOfFiles) + { + ProcessSingleFile(file); + } + } + + public void ProcessSingleFile(FileInfo file) + { + Log.Debug("Processing Single Auto IMS File. {0}", file.FullName); + string fileName = file.Name; + FileStream stream = null; + try + { + stream = File.OpenRead(Path.Combine(_config.LocalDirectoryPath, fileName)); + } + catch (IOException ioException) + { + Log.Error(ioException, "Failed to open AutoIMS file {0}, got exception.", file.FullName); + return; + } + + if (file.Name.ToLower().Contains("notes")) + { + ProcessSingleAutoImsNotesFile(file, stream); + } + else + { + ProcessSingleAutoImsFile(file, stream); + } + + if (_config.MoveProcessedFiles) + { + Log.Debug("Moving Files for AutoIMS Process."); + + // create current month folder + if (!Directory.Exists( + Path.Combine(_config.LocalDirectoryPath, DateTime.Now.ToString("MMM yyyy")))) + { + var newDir = Path.Combine(_config.LocalDirectoryPath, DateTime.Now.ToString("MMM yyyy")); + Log.Information("Creating folder {0}", newDir); + Directory.CreateDirectory(newDir); + } + + var sourceFileName = Path.Combine(_config.LocalDirectoryPath, fileName); + var destFileName = + Path.Combine(_config.LocalDirectoryPath, DateTime.Now.ToString("MMM yyyy"), fileName); + Log.Information("Moving File {0} to Folder {1}.", sourceFileName, destFileName); + File.Move(sourceFileName, destFileName); + } + } + + public void ProcessSingleAutoImsNotesFile(FileInfo file, FileStream stream) + { + Log.Debug("Processing notes file {0}.", file); + + try + { + IEnumerable data = + _imsAutoFileNoteConverter.CsvToImsAutoFileNotes(stream); + data = _imsAutoFileNoteConverter.CompressIdentifyingRows(data); + _autoImsImporterService.ImportNotesToDatabase(data); + } + catch (Exception ex) + { + Log.Error(ex,"AutoIMS Note Import Failure"); + } + } + + public void ProcessSingleAutoImsFile(FileInfo file, FileStream stream) + { + Log.Debug("Processing data file {0}.", file); + + try + { + IReadOnlyCollection models = _imsAutoFileDataConverter.CsvToImsAutoFileData(stream); + var imported = _autoImsImporterService.ImportDataFile(models); + var floors = _autoImsImporterService.SetAllAvailableFloors(); + _emailer.SendRefundProcessStartEmails(imported); + _emailer.SendSummaryEmail(imported, floors); + } + catch (Exception ex) + { + Log.Error(ex,"AutoIMS Data Import Failure"); + } + } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/CollateralService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/CollateralService.cs new file mode 100644 index 0000000..f573476 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/CollateralService.cs @@ -0,0 +1,123 @@ +using System; +using System.Collections.Generic; +using System.Data.SqlClient; +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Exceptions; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using Serilog; + +namespace LCU.API.Collections.RepoApi.Services +{ + public class CollateralService : ICollateralService + { + private readonly ICollateralRepository _collateralRepository; + private readonly IUnitOfWork _unitOfWork; + + public CollateralService( + ICollateralRepository collateralRepository, + IUnitOfWork unitOfWork) + { + _collateralRepository = collateralRepository; + _unitOfWork = unitOfWork; + } + + public async Task> ListAll() + { + try + { + return await _collateralRepository.ListAllAsync(); + } + catch (Exception ex) + { + Log.Error(ex, "Failure retrieving Collaterals"); + throw new ServerErrorException(); + } + } + + public async Task SaveAsync(Collateral collateral) + { + try + { + await _collateralRepository.AddAsync(collateral); + await _unitOfWork.CompleteAsync(); + + return collateral; + } + catch (Exception ex) + { + Log.Error(ex, $"Failure saving Collateral: {collateral}", collateral); + throw new ServerErrorException(); + } + } + + public async Task Get(int id) + { + Collateral collateral; + try + { + collateral = await _collateralRepository.FindByIdAsync(id); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure retrieving Collateral with id: {id}"); + throw new ServerErrorException(); + } + + if (collateral == null) + { + throw new NotFoundException($"Collateral with id {id} not found."); + } + + return collateral; + } + + public async Task UpdateAsync(Collateral collateral) + { + Collateral existing = null; + + try + { + existing = await _collateralRepository.FindByIdAsync(collateral.CollateralId); + }catch(Exception ex) + { + Log.Error(ex, $"Failure retrieving existing collateral with collateralId: {collateral.CollateralId}",collateral); + throw new ServerErrorException(); + } + + + if (existing == null) + { + throw new NotFoundException($"Collateral with id {collateral.CollateralId} not found."); + } + + existing.Vin = collateral.Vin; + existing.Make = collateral.Make; + existing.Model = collateral.Model; + existing.Year = collateral.Year; + existing.Description = collateral.Description; + existing.VehicleType = collateral.VehicleType; + existing.BodyStyle = collateral.BodyStyle; + existing.Inoperable = collateral.Inoperable; + existing.CollateralTypeId = collateral.CollateralTypeId; + existing.RetitledInLandmarkName = collateral.RetitledInLandmarkName; + + try + { + _collateralRepository.Update(existing); + await _unitOfWork.CompleteAsync(); + return (existing); + } + catch (SqlException ex) + { + Log.Error(ex, $"SQL Failure updating Collateral: {collateral}", collateral); + throw new ServerErrorException(); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure updating Collateral: {collateral}", collateral); + throw new ServerErrorException(); + } + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/Emailer.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/Emailer.cs new file mode 100644 index 0000000..f9d74fb --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/Emailer.cs @@ -0,0 +1,203 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Text; +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Configuration; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.AutoIms; +using LCU.Shared.Collections.RepoApiLib.Models.Consumer; +using LCU.Shared.Common.NotificationApiLib.Models; +using Microsoft.EntityFrameworkCore.Internal; +using Newtonsoft.Json; +using Serilog; + +namespace LCU.API.Collections.RepoApi.Services +{ + public class Emailer : IEmailer + { + private readonly IHttpClientFactory _httpClientFactory; + private readonly RepoApiConfiguration _configuration; + private readonly IEventAlertService _eventAlertService; + private const string O4RStatus = "O4R"; + + public Emailer(IHttpClientFactory httpClientFactory, RepoApiConfiguration configuration, IEventAlertService eventAlertService) + { + _httpClientFactory = httpClientFactory; + _configuration = configuration; + _eventAlertService = eventAlertService; + } + + public async Task SendMessageAsync(List recipient, string subject, string body) + { + var emailRequest = new EmailRequest + { + Recipient = recipient, + Subject = subject, + Body = body + }; + var encoded = JsonConvert.SerializeObject(emailRequest); + + try + { + var client = _httpClientFactory.CreateClient(); + var c = new StringContent(encoded, Encoding.UTF8, "application/json"); + HttpResponseMessage response = await client.PostAsync(_configuration.NotificationsEmailUrl, c); + + response.EnsureSuccessStatusCode(); + + return response; + } + catch (Exception ex) + { + Log.Error(ex, "An exception was caught trying to send an email via Notifications API."); + + return null; + } + } + + public async Task SendFloorPriceAcceptedEmail(bool isManual, string accountNo, decimal? oldFloorPrice, decimal? newFloorPrice) + { + var subject = isManual ? "Manual Floor Price Set" : "Automated Floor Price Set"; + var body = string.Format(subject + " for account {0} from {1} to {2}.", accountNo, oldFloorPrice?.ToString("C2", CultureInfo.CurrentCulture), newFloorPrice?.ToString("C2", CultureInfo.CurrentCulture)); + + return await SendMessageAsync(_configuration.FloorPriceAcceptedRecipients, subject, body); + } + + public async Task SendSurplusDeficiencyLetterEmailAsync(RepoAccount repoAccount) + { + var message = "Please Send the Surplus Deficiency letter. Please notify the Repo Specialists when the letter has been sent, so that this account can be closed in Repo Manager.

"; + var member = repoAccount.Borrowers?.First(b => b.OwnershipType == 6); + var memberName = "Member Name: " + member?.IndividualName + "
"; + var accountNo = "Account No: " + repoAccount.AccountNo + "
"; + + return await SendMessageAsync(_configuration.CollectionsClerkRecipients, "Refunds Recieved", string.Concat(message, memberName, accountNo)); + } + + public async Task MaybeSendO4rNoCollateralEmail(RepoAccount repoAccount) + { + if (repoAccount != null && repoAccount.DateClosed == null && repoAccount.Status == O4RStatus) + { + var subject = "O4R No Collateral"; + var body = string.Format("Account {0} set to O4R with no collateral.", repoAccount.AccountNo); + + return await SendMessageAsync(_configuration.RepoManagerAdminRecipients, subject, body); + } + + return new HttpResponseMessage { StatusCode = HttpStatusCode.OK }; + } + + public async Task SendAlertSummaryEmailWithEndTime(DateTime endTime) + { + var startTime = endTime.AddHours(-1); + var eventAlerts = _eventAlertService.ListWithinDateRange(startTime, endTime).GetAwaiter().GetResult(); + var subject = "Repo Manager Alerts " + endTime.ToString("MM-dd-yyyy HH:mm:ss"); + var body = "

" + subject + "


"; + + foreach (var eventAlert in eventAlerts) + { + var entry = CreateAlertEmailEntry(eventAlert); + if (!string.IsNullOrEmpty(entry)) + { + body += CreateAlertEmailEntry(eventAlert) + "

"; + } + } + + if (!eventAlerts.Any()) + { + body += "No new alerts."; + } + + return await SendMessageAsync(_configuration.CollectionsRecipients, subject, body); + } + + private string CreateAlertEmailEntry(EventAlert eventAlert) + { + var accountNo = "Account No: " + eventAlert.AccountNo + "
"; + var alert = "Alert: " + eventAlert.Message + "
"; + var url = eventAlert.RepoId != null + ? _configuration.RepoManagerAccountUrl + eventAlert.RepoId + : ""; + var link = eventAlert.RepoId != null + ? string.Format("{0}", url) + "
" + : ""; + + return string.Concat(accountNo, alert, link); + } + + public void SendSummaryEmail(IReadOnlyCollection imported, IReadOnlyCollection floors) + { + Log.Debug("Sending AutoIMS Import Email"); + var subject = "Landmark Auto IMS Import " + DateTime.Now; + var reports = new List(); + + if (imported == null || floors == null) + { + Log.Error("Null result sets passed to SendSummaryEmail"); + return; + } + + foreach (var importResultRow in imported) + { + reports.Add(importResultRow.BuildStatusReport(_configuration.RepoManagerAccountUrl)); + reports.Add("=====================================================================================================
"); + } + + foreach (var importResultRow in floors) + { + reports.Add(importResultRow.BuildStatusReport(_configuration.RepoManagerAccountUrl)); + } + + var result = reports.Join("
"); + SendMessageAsync(_configuration.CreditDebitsRecipients, subject, result).GetAwaiter().GetResult(); + Log.Debug("AutoIMS Import Email Sent"); + } + + public void SendRefundProcessStartEmails(IReadOnlyCollection models) + { + if (models == null || !models.Any()) + { + Log.Warning("No models to process sold emails for."); + return; + } + var soldResults = models.Where(x => x.Data?.SoldDate?.Date == DateTime.Now.Date).ToList(); + + foreach (var sale in soldResults) + { + SendMessageAsync(_configuration.CollectionsClerkRecipients, "Auction sold, please start the refund process", CreateRefundProcessEmailBody(sale)).GetAwaiter().GetResult(); + } + } + + public string CreateRefundProcessEmailBody(ImportResultRow sale) + { + if (sale?.RepoAccount == null || sale.Data == null || sale.RepoAccount.Borrowers == null) + { + Log.Error("Invalid data, can't create email body for account."); + return ""; + } + var member = sale.RepoAccount.Borrowers?.First(b => b.OwnershipType == 6); + var individualName = member != null ? member.IndividualName : "No Primary Owner!"; + + var memberName = "Member Name: " + individualName + "
"; + var accountNo = "Account No: " + sale.RepoAccount.AccountNo + "
"; + var collateralVin = "VIN: " + sale.Data.VIN + "
"; + + return string.Concat(memberName, accountNo, collateralVin); + } + + public async Task SendProccessSummary(RepoRunInfo runInfo) + { + + string subject = $"Repo Processor Run Receipt [{runInfo.Receipts.Count}]"; + var receiptList = runInfo.Receipts.Select(receipt => receipt.Pretty()); + string bodyData = string.Join("
", receiptList); + string body = $"Process Started: {runInfo.StartDateTime} and completed at {runInfo.CompleteDateTime}

"; + + return await SendMessageAsync(_configuration.RepoManagerAdminRecipients, subject, body + bodyData); + + } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/EventAlertService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/EventAlertService.cs new file mode 100644 index 0000000..d2782f0 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/EventAlertService.cs @@ -0,0 +1,297 @@ +using System; +using System.Collections.Generic; +using System.Data.SqlClient; +using System.Linq; +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Exceptions; +using LCU.API.Collections.RepoApi.Models; +using LCU.Shared.Collections.RepoApiLib.Exceptions; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using Serilog; + +namespace LCU.API.Collections.RepoApi.Services +{ + public class EventAlertService : IEventAlertService + { + private readonly IEventAlertRepository _eventAlertRepository; + private readonly IUnitOfWork _unitOfWork; + private const string RedeemedStatus = "REDEEMED"; + private const string CancelledStatus = "RECA"; + private readonly IRepoAccountRepository _accountRepository; + + public EventAlertService( + IEventAlertRepository eventAlertRepository, + IUnitOfWork unitOfWork, + IRepoAccountRepository accountRepository) + { + _eventAlertRepository = eventAlertRepository; + _unitOfWork = unitOfWork; + _accountRepository = accountRepository; + } + + public async Task> ListAll() + { + try + { + return await _eventAlertRepository.ListAllAsync(); + } + catch (Exception ex) + { + Log.Error(ex, "Failure retrieving All Event Alerts"); + throw new ServerErrorException(); + } + } + + public async Task> ListUnread() + { + try + { + return await _eventAlertRepository.ListUnreadAsync(); + } + catch (Exception ex) + { + Log.Error(ex, "Failure retrieving Unread Event Alerts"); + throw new ServerErrorException(); + } + } + + public async Task> ListWithinDateRange(DateTime start, DateTime end) + { + try + { + return await _eventAlertRepository.ListWithinDateRangeAsync(start, end); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure retrieving Event Alerts between {start} and {end}"); + throw new ServerErrorException(); + } + } + + public async Task> ListActionNeeded() + { + try + { + var repoNoAuction = await _eventAlertRepository.ListRepoNoAuctionAsync(); + var repoNoCompany = await _eventAlertRepository.ListRepoNoCompanyAsync(); + var o4rNoCompany = await _eventAlertRepository.ListO4rNoCompanyAsync(); + var retitle = await _eventAlertRepository.ListReadyForRetitleAsync(); + var floorUpdateFail = await _eventAlertRepository.ListFloorUpdateFailedAsync(); + var setFloor = await _eventAlertRepository.ListFloorNeedsSettingAsync(); + + return repoNoAuction.Concat(repoNoCompany).Concat(o4rNoCompany).Concat(retitle).Concat(floorUpdateFail).Concat(setFloor).ToList(); + } + catch (Exception ex) + { + Log.Error(ex, "Failure retrieving Action Needed Event Alerts"); + throw new ServerErrorException(); + } + } + + public async Task SaveAsync(EventAlert eventAlert) + { + try + { + if (IsStatusCancelledOrRedeemed(eventAlert.RepoId.Value).Result) + { + throw new UnwantedStatusException(eventAlert.RepoId.Value, eventAlert.AccountNo); + } + await _eventAlertRepository.AddAsync(eventAlert); + await _unitOfWork.CompleteAsync(); + return eventAlert; + } + catch (DuplicateResourceException ex) + { + Log.Debug(ex, $"SaveAsync: Valid Alert Already Exists eventAlert:{eventAlert}", eventAlert); + throw ex; + } + catch(UnwantedStatusException ex) + { + Log.Error(ex, $"SaveAsync: Status of Repo is Redeemed or Cancelled. Event Alert: {eventAlert} not created", eventAlert); + throw; + } + catch (Exception ex) + { + Log.Error(ex, $"SaveAsync: Failure saving Event Alert: {eventAlert}", eventAlert); + throw new ServerErrorException(); + } + } + + public async Task> SaveRangeAsync(List eventAlerts) + { + IEnumerable addedEventAlerts = new List(); + try + { + addedEventAlerts = await _eventAlertRepository.AddRangeAsync(eventAlerts); + await _unitOfWork.CompleteAsync(); + } + catch (Exception ex) + { + Log.Error(ex, $"EventAlertService: Failure Saving Range Of Event Alerts: {eventAlerts}", eventAlerts); + } + + return addedEventAlerts; + } + + + + public async Task Get(int id) + { + EventAlert eventAlert; + try + { + eventAlert = await _eventAlertRepository.FindByIdAsync(id); + await _unitOfWork.CompleteAsync(); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure retrieving Event Alert with id: {id}"); + throw new ServerErrorException(); + } + + if (eventAlert == null) + { + throw new NotFoundException($"EventAlert with id {id} not found."); + } + + return eventAlert; + } + + public async Task UpdateAsync(EventAlert eventAlert, AppUser user) + { + + EventAlert existingEventAlert = null; + try + { + existingEventAlert = await _eventAlertRepository.FindByIdAsync(eventAlert.Id); + } + catch(Exception ex) + { + Log.Error(ex, $"Failed to find existing event alert with Id: {eventAlert.Id}, user: {user}", eventAlert, user); + throw new ServerErrorException(); + } + + if (existingEventAlert == null) + { + throw new NotFoundException($"EventAlert with id {eventAlert.Id} not found."); + } + + existingEventAlert.Message = eventAlert.Message; + existingEventAlert.SubMessage = eventAlert.SubMessage; + if (existingEventAlert.DateMarkedRead == null && eventAlert.DateMarkedRead != null) + { + existingEventAlert.MarkedReadBy = user.FirstName + " " + user.LastName; + existingEventAlert.DateMarkedRead = eventAlert.DateMarkedRead; + } + + try + { + _eventAlertRepository.Update(existingEventAlert); + await _unitOfWork.CompleteAsync(); + return (existingEventAlert); + } + catch (SqlException ex) + { + Log.Error(ex, $"SQL Failure updating Event Alert: {eventAlert}", eventAlert); + throw new ServerErrorException(); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure updating Event Alert {eventAlert}", eventAlert); + throw new ServerErrorException(); + } + } + + public async Task DeleteAsync(int id) + { + EventAlert existingEventAlert = null; + try + { + existingEventAlert = await _eventAlertRepository.FindByIdAsync(id); + } + catch(Exception ex) + { + Log.Error(ex, $"Failed to find existing event alert with Id: {id}."); + throw new ServerErrorException(); + } + if (existingEventAlert == null) + { + throw new NotFoundException($"EventAlert with id {id} not found."); + } + + try + { + _eventAlertRepository.Remove(existingEventAlert); + await _unitOfWork.CompleteAsync(); + return existingEventAlert; + } + catch (SqlException ex) + { + Log.Error(ex, $"SQL Failure deleting Event Alert with id {id}"); + throw new ServerErrorException(); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure deleting Event Alert with id {id}"); + throw new ServerErrorException(); + } + } + + public async Task> MarkAllAsRead(string accountNo) + { + IEnumerable existingEventAlerts = null; + try + { + existingEventAlerts = await _eventAlertRepository.ListUnreadByAccountNoAsync(accountNo); + } + catch (Exception ex) + { + Log.Error(ex, $"Failed to find existing event alerts with accountNo: {accountNo}"); + throw new ServerErrorException(); + } + + if (existingEventAlerts == null) + { + throw new NotFoundException($"EventAlerts for accountNo: {accountNo} not found."); + } + + var ret = new List(); + + foreach (EventAlert eventAlert in existingEventAlerts) + { + eventAlert.MarkedReadBy = "System"; + eventAlert.DateMarkedRead = DateTime.Now; + + try + { + _eventAlertRepository.Update(eventAlert); + ret.Add(eventAlert); + } + catch (SqlException ex) + { + Log.Error(ex, $"SQL Failure updating Event Alert: {eventAlert} in the list {existingEventAlerts}. Will not commit any changes.", eventAlert); + throw new ServerErrorException(); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure updating Event Alert {eventAlert} in the list {existingEventAlerts}. Will not commit any changes", eventAlert); + throw new ServerErrorException(); + } + } + await _unitOfWork.CompleteAsync(); + return ret; + } + + private async Task IsStatusCancelledOrRedeemed(int repoId) + { + var repo = await _accountRepository.FindByIdAsync(repoId); + if (repo == null) + { + return false; + } + + return repo.Status.Equals(CancelledStatus) || repo.Status.Equals(RedeemedStatus); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/FactoidService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/FactoidService.cs new file mode 100644 index 0000000..c74b0c4 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/FactoidService.cs @@ -0,0 +1,253 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Models.Responses; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using Serilog; + +namespace LCU.API.Collections.RepoApi.Services +{ + public class FactoidService : IFactoidService + { + private readonly IReportingRepository _reportingRepository; + private readonly IRepoAccountRepository _repoAccountRepository; + private readonly IImsAutoFileDataRepository _imsAutoFileDataRepository; + private const string O4RStatus = "O4R"; + private const string RepoStatus = "REPO"; + private const string RedeemedStatus = "REDEEMED"; + + public FactoidService( + IReportingRepository reportingRepository, + IRepoAccountRepository repoAccountRepository, + IImsAutoFileDataRepository imsAutoFileDataRepository) + { + _reportingRepository = reportingRepository; + _repoAccountRepository = repoAccountRepository; + _imsAutoFileDataRepository = imsAutoFileDataRepository; + } + + public int FindAuctionIndex(IReadOnlyCollection auctionHouses, string auctionId) + { + if (auctionId != null) + { + foreach (var item in auctionHouses.Select((value, index) => new {index, value})) + { + if (item.value == auctionId.Trim().ToLower()) + { + return item.index; + } + } + } + + return auctionHouses.Count - 1; + } + + + public async Task GetCurrentInventory() + { + var accountsInRepo = await _repoAccountRepository.FindByCurrentStatus(RepoStatus); + + var numCollateral = accountsInRepo.Aggregate(0, (total, curAccount) => + total += curAccount.Collaterals.Count()); + + return new FactoidResponse + { + CumulativeValue = numCollateral.ToString(), + Name = "Vehicles", + Description = "Current Inventory (REPO)", + FontAwesomeIcon = "fa-car", + Records = accountsInRepo + }; + } + + public async Task GetAllAccountsO4R() + { + var filteredRepoAccounts = await _reportingRepository.GetAllAccountsInO4R(); + return new FactoidResponse + { + CumulativeValue = filteredRepoAccounts.Count().ToString(), + Name = "Accounts", + Description = "Total Accounts in O4R", + FontAwesomeIcon = "fa-car", + Records = filteredRepoAccounts + }; + } + + public async Task GetPercentFloorPrice(DateTime lowDateTime, + DateTime highDateTime) + { + var soldImsAccounts = await _imsAutoFileDataRepository.GetImsSoldRecordsForPeriod(lowDateTime, highDateTime); + + decimal? percentFloor = 0m; + if (soldImsAccounts.Count() != 0) + { + percentFloor = soldImsAccounts.Select(x => x.GrossPercentFloor).Sum() / soldImsAccounts.Count; + } + + var records = await _repoAccountRepository.FindByRepoIdAsync(soldImsAccounts.Select(x => x.RepoId.ToString()).ToList()); + return new FactoidResponse + { + CumulativeValue = percentFloor?.ToString("#.#") + "%", + Name = "Percentage of Floor", + Description = "Last 30 Days", + FontAwesomeIcon = "fa-money", + Records = records + }; + } + + public async Task GetRecentlyRedeemed(DateTime lowDate, DateTime highDate) + { + var filteredRepoAccounts = await _repoAccountRepository.FindByStatusChangeInPeriod(RedeemedStatus, lowDate, highDate); + return new FactoidResponse + { + CumulativeValue = filteredRepoAccounts.Count().ToString(), + Name = "Recently Redeemed", + Description = "Last 30 Days", + FontAwesomeIcon = "fa-calendar", + Records = filteredRepoAccounts + }; + } + + public async Task GetAvgDaysO4RToREPO(DateTime lowDate, DateTime highDate) + { + var recentAccountsInREPO = await _repoAccountRepository.FindByStatusChangeInPeriod(RepoStatus, lowDate, highDate); + var avgDaysO4RtoRepo = GetAverageDaysBetweenStatuses(recentAccountsInREPO, RepoStatus, O4RStatus); + return new FactoidResponse + { + CumulativeValue = avgDaysO4RtoRepo != null ? avgDaysO4RtoRepo.ToString() : "N/A", + Name = "Avg. Days O4R to Repo", + Description = "Last 30 Days", + FontAwesomeIcon = "fa-calendar", + Records = recentAccountsInREPO + }; + } + + public async Task GetGetAvgDaysDelqToO4R(DateTime lowDate, DateTime highDate) + { + IEnumerable recentAccountsInO4R = await _repoAccountRepository.FindByStatusChangeInPeriod(O4RStatus, lowDate, highDate); + + var accountsWithoutDateDelinquent = recentAccountsInO4R.Where(account => account.DaysDelinquent == null); + if (accountsWithoutDateDelinquent.Count() > 0) + { + Log.Error($"Accounts found without DaysDelinquent when added: {accountsWithoutDateDelinquent} ", accountsWithoutDateDelinquent); + recentAccountsInO4R = recentAccountsInO4R.Except(accountsWithoutDateDelinquent); + } + + var totalAccounts = recentAccountsInO4R.Count(); + var avgDaysDelqToO4R = 0; + if (totalAccounts > 0) + { + var delqToO4RSum = recentAccountsInO4R.Aggregate(0, (sum, repoAccount) => sum += repoAccount.DaysDelinquent ?? 0); + avgDaysDelqToO4R = delqToO4RSum / totalAccounts; + } + + return new FactoidResponse() + { + CumulativeValue = avgDaysDelqToO4R.ToString(), + Name = "Avg. Days Dlqt To O4R", + Description = "Last 30 Days", + FontAwesomeIcon = "fa-calendar", + Records = recentAccountsInO4R.ToList() + }; + } + + public async Task GetGetAvgDaysRepoToSold(DateTime lowDate, DateTime highDate) + { + var recentAccountsSold = await _repoAccountRepository.FindByStatusChangeInPeriod("SOLD", lowDate, highDate); + var avgDaysRepoToSold = GetAverageDaysBetweenStatuses(recentAccountsSold, "SOLD", RepoStatus); + return new FactoidResponse + { + CumulativeValue = avgDaysRepoToSold != null ? avgDaysRepoToSold.ToString() : "N/A", + Name = "Avg. Days Repo to Sold", + Description = "Last 30 Days", + FontAwesomeIcon = "fa-calendar", + Records = recentAccountsSold + }; + } + + public async Task GetCurrentlyOnHold() + { + var accountsOnHold = await _repoAccountRepository.GetCurrentAccountsOnHoldAtAuction(); + + return new FactoidResponse + { + CumulativeValue = accountsOnHold.Count().ToString(), + Name = "On Hold at Auction", + Description = "Accounts", + FontAwesomeIcon = "fa-car", + Records = accountsOnHold + }; + } + + public async Task GetRecentlyRepoed(DateTime lowDate, DateTime highDate) + { + var accountsRecentlyRepoed = await _repoAccountRepository.FindByStatusChangeInPeriod(RepoStatus, lowDate, highDate); + + return new FactoidResponse + { + CumulativeValue = accountsRecentlyRepoed.Count().ToString(), + Name = "Recently Repoed", + Description = "Last 30 Days", + FontAwesomeIcon = "fa-car", + Records = accountsRecentlyRepoed + }; + } + + public async Task GetRecentlySold(DateTime lowDate, DateTime highDate) + { + var accountsRecentlySold = await _repoAccountRepository.FindByStatusChangeInPeriod("SOLD", lowDate, highDate); + + return new FactoidResponse + { + CumulativeValue = accountsRecentlySold.Count().ToString(), + Name = "Recently Sold", + Description = "Last 30 Days", + FontAwesomeIcon = "fa-car", + Records = accountsRecentlySold + }; + } + + // Get the average day difference between two status changes. + // If the accounts given don't have valid to and from status, those accounts are ignored from the calulcation. + // However, if calling this array, the accounts SHOULD have valid status changes. + private int? GetAverageDaysBetweenStatuses(IEnumerable repoAccount, string statusTo, string statusFrom) + { + IEnumerable daysBetweenStatuses = repoAccount.Select( + (account) => GetDaysBetweenStatuses(account, statusTo, statusFrom)); + + var validRepos = daysBetweenStatuses.Aggregate(0, (sum, days) => sum += days != null ? 1 : 0); + var sumOfDays = daysBetweenStatuses.Aggregate(0, (sum, days) => sum += days != null ? days.Value : 0); + + if (validRepos == 0) + { + return null; + } + return sumOfDays / validRepos; + } + + // If either status cannot be found, return null, indicating an that days could not be calculated. + // If both the from status and to status are found, floor their difference of dates. + private int? GetDaysBetweenStatuses(RepoAccount repoAccount, string newStatus, string oldStatus) + { + var fromStatusDate = GetLatestStatusChange(repoAccount, oldStatus)?.ChangedDate; + var toStatusDate = GetLatestStatusChange(repoAccount, newStatus)?.ChangedDate; + + if (toStatusDate != null && fromStatusDate != null) + { + return (int) Math.Floor(toStatusDate.Value.Subtract(fromStatusDate.Value).TotalDays); + } + + return null; + } + + private RepoStatusChange GetLatestStatusChange(RepoAccount repoAccount, string status) + { + return ( + from statusChange in repoAccount.RepoStatusChanges + where string.Equals(statusChange.StatusTo, status, StringComparison.CurrentCultureIgnoreCase) + select statusChange).LastOrDefault(); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/FloorPricingService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/FloorPricingService.cs new file mode 100644 index 0000000..baa72c5 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/FloorPricingService.cs @@ -0,0 +1,164 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using LCU.API.Collections.RepoApi.Domain.FloorPricing; +using LCU.API.Collections.RepoApi.Domain.FloorPricing.Strategies; +using LCU.API.Collections.RepoApi.Exceptions; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.WebServices.NADA; +using Serilog; + +namespace LCU.API.Collections.RepoApi.Services +{ + public class FloorPricingService : IFloorPricingService + { + private readonly IFloorPricingStrategyFactory _floorFloorPricingStrategyFactory; + private readonly IImsAutoFileDataService _imsAutoFileDataService; + private readonly IVehicleFloorPricingParametersService _vehicleFloorPricingParametersService; + private readonly ICollateralValueService _collateralValueService; + + + public FloorPricingService( + IFloorPricingStrategyFactory floorFloorPricingStrategyFactory, + IVehicleFloorPricingParametersService vehicleFloorPricingParametersService, + IImsAutoFileDataService imsAutoFileDataService, + ICollateralValueService collateralValueService) + { + _floorFloorPricingStrategyFactory = floorFloorPricingStrategyFactory; + _vehicleFloorPricingParametersService = vehicleFloorPricingParametersService; + _imsAutoFileDataService = imsAutoFileDataService; + _collateralValueService = collateralValueService; + } + + public FloorPriceCalculationResultSet DetermineFloorPrice(int auctionAssignmentId) + { + CollateralValuation collateralValuation = new CollateralValuation { }; + ImsAutoFileData imsAutoFileData = new ImsAutoFileData { }; + var floorPricingParams = _vehicleFloorPricingParametersService.ListAll().GetAwaiter().GetResult(); + try + { + imsAutoFileData = _imsAutoFileDataService.GetByAuctionAssignmentId(auctionAssignmentId).GetAwaiter().GetResult(); + collateralValuation = GetCollateralValuation(imsAutoFileData.VIN, imsAutoFileData.StatedMileage ?? 0, 0); + } + catch (Exception ex) + { + Log.Error(ex, $"Error when trying to Determine Floor Price for auctionAssignment with id: ${auctionAssignmentId}"); + } + FloorPriceCalculationParams fpcParams = new FloorPriceCalculationParams() + { + VehicleFloorPricingParameters = floorPricingParams, + ImsAutoFileData = imsAutoFileData, + CollateralValuation = collateralValuation + }; + + var prices = GetCalculatedFloorPrices(fpcParams); + var price = SelectBestFloorPrice(prices); + var floorPriceValuesUsed = PopulateFloorPriceValuesUsed(auctionAssignmentId, fpcParams, prices, price); + FloorPriceCalculationResultSet strategicResultSet = new FloorPriceCalculationResultSet { }; + strategicResultSet.AllResults = prices; + strategicResultSet.PrimaryResult = price; + strategicResultSet.FloorPriceValuesUsed = floorPriceValuesUsed; + return strategicResultSet; + } + + public CollateralValuation GetCollateralValuation(string VIN, int StatedMileage, int vehichleTypeKey) + { + CollateralValuation collateralValuation = new CollateralValuation { }; + try + { + collateralValuation = _collateralValueService.GetCollateralValue(VIN, StatedMileage, vehichleTypeKey); + } + catch (Exception ex) + { + if (ex.Message.Contains("license")) + { + Log.Error(ex, "Your collateral value service license may be invalid/expired, please notify the collections department administration."); + } + Log.Error(ex, "NADA ERROR when getting Collateral Value"); + } + return collateralValuation; + } + + public IReadOnlyCollection GetCalculatedFloorPrices(FloorPriceCalculationParams fpcParams) + { + IReadOnlyCollection strategies = + _floorFloorPricingStrategyFactory.GetFloorPricingStrategies(); + + List calculationResults = new List(); + + foreach (var floorPricingStrategy in strategies) + { + calculationResults.Add(floorPricingStrategy.CalculateFloorPrice(fpcParams)); + } + + return calculationResults; + } + + public FloorPriceCalculationResult SelectBestFloorPrice(IReadOnlyCollection results) + { + var successWeight = -1; + FloorPriceCalculationResult successResult = null; + foreach (var result in results) + { + if (result.ResultWeight > successWeight && result.Success) + { + successWeight = result.ResultWeight; + successResult = result; + } + } + + if (successResult == null) + { + return new FloorPriceCalculationResult() + { + ResultWeight = -1, + Success = false, + StrategyName = "Manual", + FloorPrice = -1 + }; + } + + return successResult; + } + + public FloorPriceValuesUsed PopulateFloorPriceValuesUsed(int auctionAssignmentId, FloorPriceCalculationParams fpcParams, IReadOnlyCollection prices, + FloorPriceCalculationResult bestPrice) + { + var result = new FloorPriceValuesUsed + { + AuctionAssignmentId = auctionAssignmentId, + RepoId = fpcParams.ImsAutoFileData.RepoId, + CollateralValuation = fpcParams.CollateralValuation + }; + result.AuctionGuideBookPrice = fpcParams.ImsAutoFileData.AuctionGuideBookPrice; + var autoImsResult = prices.FirstOrDefault(x => x.StrategyName.Equals(typeof(AutoImsSuggestedValue).FullName)); + result.WasAuctionGuideBookPriceUsed = autoImsResult != null && autoImsResult.Success && autoImsResult.FloorPrice == bestPrice.FloorPrice; + var nadaMmrResult = prices.FirstOrDefault(x => x.StrategyName.Equals(typeof(NadaMmrConditionValue).FullName)); + result.MMRNationalAdjustedPrice = fpcParams.ImsAutoFileData.MMRNationalAdjustedPrice; + result.MMRRegionalAdjustedPrice = fpcParams.ImsAutoFileData.MMRRegionalAdjustedPrice; + result.NADALowAdjustedAuctionValue = fpcParams.CollateralValuation.LowAdjustedAuctionValue; + result.NADAAverageAdjustedAuctionValue = fpcParams.CollateralValuation.AverageAdjustedAuctionValue; + result.NADAHighAdjustedAuctionValue = fpcParams.CollateralValuation.HighAdjustedAuctionValue; + result.Condition = fpcParams.ImsAutoFileData.ApprovedVehicleGrade ?? fpcParams.ImsAutoFileData.VehicleGrade; + if (result.Condition == null || result.Condition <= 0) + { + return result; + } + + var vfpParams = Enumerable.First(Enumerable.Where(fpcParams.VehicleFloorPricingParameters, + x => result.Condition >= x.LowCondition && result.Condition <= x.HighCondition)); + result.LowParam = vfpParams.LowCondition; + result.HighParam = vfpParams.HighCondition; + result.PercentageOf = vfpParams.PercentageOf; + var hasMmrPrice = fpcParams.ImsAutoFileData.MMRNationalAdjustedPrice != null || fpcParams.ImsAutoFileData.MMRRegionalAdjustedPrice != null; + result.WasAuctionGuideBookPriceUsed = autoImsResult != null && autoImsResult.Success && autoImsResult.StrategyName == bestPrice.StrategyName || (!hasMmrPrice && autoImsResult.FloorPrice > 0); + result.WasMMRNationalAdjustedPriceUsed = nadaMmrResult != null && nadaMmrResult.Success && vfpParams.MMRAdjustedValue.ToLower().StartsWith("national") && hasMmrPrice; + result.WasMMRRegionalAdjustedPriceUsed = nadaMmrResult != null && nadaMmrResult.Success && vfpParams.MMRAdjustedValue.ToLower().StartsWith("regional") && hasMmrPrice; + result.WasNADALowAdjustedAuctionValueUsed = nadaMmrResult != null && nadaMmrResult.Success && vfpParams.NADAFirstValue.ToLower().StartsWith("low") || vfpParams.NADASecondValue.ToLower().StartsWith("low"); + result.WasNADAAverageAdjustedAuctionValueUsed = nadaMmrResult != null && nadaMmrResult.Success && vfpParams.NADAFirstValue.ToLower().StartsWith("avg") || vfpParams.NADASecondValue.ToLower().StartsWith("avg"); + result.WasNADAHighAdjustedAuctionValueUsed = nadaMmrResult != null && nadaMmrResult.Success && vfpParams.NADAFirstValue.ToLower().StartsWith("high") || vfpParams.NADASecondValue.ToLower().StartsWith("high"); + + return result; + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/IAuctionAssignmentService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/IAuctionAssignmentService.cs new file mode 100644 index 0000000..1b06546 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/IAuctionAssignmentService.cs @@ -0,0 +1,20 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Models.Filters; +using LCU.API.Collections.RepoApi.Models.Requests; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.Results; + +namespace LCU.API.Collections.RepoApi.Services +{ + public interface IAuctionAssignmentService + { + Task> ListByFilterAsync(AuctionAssignmentFilter filter); + Task GetByIdAsync(int id); + Task> GetByRepoIdAsync(int repoId); + Task SaveAsync(AuctionAssignmentPostRequest auctionAssignmentPostRequest); + Task UpdateAsync(AuctionAssignment auctionAssignment); + Task RemoveAuction(int id); + Task> GetListByIdsAsync(IReadOnlyCollection idSet); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/IAuctionHouseService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/IAuctionHouseService.cs new file mode 100644 index 0000000..61cc3aa --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/IAuctionHouseService.cs @@ -0,0 +1,15 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.API.Collections.RepoApi.Services +{ + public interface IAuctionHouseService + { + Task> ListAllAsync(); + Task GetAsync(string id); + Task SaveAsync(AuctionHouse auction); + Task UpdateAsync(AuctionHouse auction); + Task DeleteAsync(string id); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/IAuditRecordService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/IAuditRecordService.cs new file mode 100644 index 0000000..90f7efa --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/IAuditRecordService.cs @@ -0,0 +1,16 @@ +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Models.Filters; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.Results; + +namespace LCU.API.Collections.RepoApi.Services +{ + public interface IAuditRecordService + { + Task> ListAll(PageFilter filter); + Task SaveAsync(AuditRecord repoAccount); + Task Get(int id); + Task UpdateAsync(AuditRecord auditRecord); + Task DeleteAsync(int id); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/ICollateralService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/ICollateralService.cs new file mode 100644 index 0000000..7d33e6b --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/ICollateralService.cs @@ -0,0 +1,14 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.API.Collections.RepoApi.Services +{ + public interface ICollateralService + { + Task> ListAll(); + Task Get(int id); + Task SaveAsync(Collateral Collateral); + Task UpdateAsync(Collateral Collateral); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/IEmailer.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/IEmailer.cs new file mode 100644 index 0000000..d087bfe --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/IEmailer.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Net.Http; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.AutoIms; +using LCU.Shared.Collections.RepoApiLib.Models.Consumer; + +namespace LCU.API.Collections.RepoApi.Services +{ + public interface IEmailer + { + Task SendFloorPriceAcceptedEmail(bool isManual, string accountNo, decimal? oldFloorPrice, decimal? newFloorPrice); + Task SendSurplusDeficiencyLetterEmailAsync(RepoAccount repoAccount); + Task MaybeSendO4rNoCollateralEmail(RepoAccount repoAccount); + Task SendAlertSummaryEmailWithEndTime(DateTime endTime); + Task SendProccessSummary(RepoRunInfo runInfo); + void SendSummaryEmail(IReadOnlyCollection imported, IReadOnlyCollection floors); + void SendRefundProcessStartEmails(IReadOnlyCollection imported); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/IEventAlertService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/IEventAlertService.cs new file mode 100644 index 0000000..ce5b115 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/IEventAlertService.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Models; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.API.Collections.RepoApi.Services +{ + public interface IEventAlertService + { + Task> ListAll(); + Task> ListUnread(); + Task> ListActionNeeded(); + Task> ListWithinDateRange(DateTime start, DateTime end); + Task Get(int id); + Task SaveAsync(EventAlert eventAlert); + Task> SaveRangeAsync(List eventAlerts); + Task UpdateAsync(EventAlert eventAlert, AppUser user); + Task DeleteAsync(int id); + Task> MarkAllAsRead(string eventAlert); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/IFactoidService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/IFactoidService.cs new file mode 100644 index 0000000..e150b65 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/IFactoidService.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Models.Responses; + +namespace LCU.API.Collections.RepoApi.Services +{ + public interface IFactoidService + { + Task GetAllAccountsO4R(); + Task GetCurrentInventory(); + int FindAuctionIndex(IReadOnlyCollection auctionHouses, string auctionId); + Task GetPercentFloorPrice(DateTime lowDateTime, DateTime highDateTime); + Task GetRecentlyRedeemed(DateTime lowDate, DateTime highDate); + Task GetAvgDaysO4RToREPO(DateTime lowDate, DateTime highDate); + Task GetGetAvgDaysDelqToO4R(DateTime lowDate, DateTime highDate); + Task GetGetAvgDaysRepoToSold(DateTime lowDate, DateTime highDate); + Task GetRecentlyRepoed(DateTime lowDate, DateTime highDate); + Task GetRecentlySold(DateTime lowDate, DateTime highDate); + Task GetCurrentlyOnHold(); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/IFloorPricingService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/IFloorPricingService.cs new file mode 100644 index 0000000..a001200 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/IFloorPricingService.cs @@ -0,0 +1,12 @@ +using System.Collections.Generic; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.API.Collections.RepoApi.Services +{ + public interface IFloorPricingService + { + FloorPriceCalculationResultSet DetermineFloorPrice(int auctionAssignmentId); + IReadOnlyCollection GetCalculatedFloorPrices(FloorPriceCalculationParams fpcParams); + FloorPriceCalculationResult SelectBestFloorPrice(IReadOnlyCollection results); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/IImsAutoFileDataService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/IImsAutoFileDataService.cs new file mode 100644 index 0000000..c817f4a --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/IImsAutoFileDataService.cs @@ -0,0 +1,16 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.API.Collections.RepoApi.Services +{ + public interface IImsAutoFileDataService + { + Task> ListAll(); + Task SaveAsync(ImsAutoFileData imsAutoFileData); + Task Get(string vin, int repoId); + Task GetByAuctionAssignmentId(int auctionAssignmentId); + Task UpdateAsync(ImsAutoFileData imsAutoFileData); + Task DeleteAsync(string vin, int repoId); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/IProcessingReceiptService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/IProcessingReceiptService.cs new file mode 100644 index 0000000..0d5d7e4 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/IProcessingReceiptService.cs @@ -0,0 +1,17 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.API.Collections.RepoApi.Services +{ + public interface IProcessingReceiptService + { + Task> FindReceiptsAsync(string accountNo, + string accountId = "", string caseId = ""); + + Task> GetReceiptsByAccountNoAsync(string accountNo); + Task> GetRetryListAsync(); + Task SaveAsync(ProcessingReceipt receipt); + Task SaveAllAsync(IReadOnlyCollection receipts); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/IRefundStatusService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/IRefundStatusService.cs new file mode 100644 index 0000000..3ab3650 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/IRefundStatusService.cs @@ -0,0 +1,14 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.API.Collections.RepoApi.Services +{ + public interface IRefundStatusService + { + Task> ListAllAsync(); + Task GetAsync(int repoId); + Task SaveAsync(RefundStatus refundStatus); + Task UpdateAsync(RefundStatus refundStatus); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/IRepoAccountService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/IRepoAccountService.cs new file mode 100644 index 0000000..f9d1492 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/IRepoAccountService.cs @@ -0,0 +1,27 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Models; +using LCU.API.Collections.RepoApi.Models.Filters; +using LCU.API.Collections.RepoApi.Models.Requests; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.Producer; +using LCU.Shared.Collections.RepoApiLib.Models.Results; + +namespace LCU.API.Collections.RepoApi.Services +{ + public interface IRepoAccountService + { + Task> ListAll(PageFilter pageFilter, RepoAccountPostFilter repoAccountFilter = null); + Task FindByAuctionAssignmentId(int auctionAssignmentId); + Task SaveAsync(RepoAccount repoAccount); + Task Get(int id); + Task> GetByAccountNo(string accountNo); + Task GetNewestOpenAccount(string accountNo); + Task> SearchRepoAccounts(string searchPhrase, int maxSearchResults); + Task UpdateAsync(RepoAccount repoAccount, AppUser currentUser); + Task DeleteAsync(int id); + Task> GetItemsForProcessing(); + + RepoAccount SelectFirstOpenAccount(IReadOnlyCollection repoAccounts); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/IRepoCompanySelectionService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/IRepoCompanySelectionService.cs new file mode 100644 index 0000000..1faa042 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/IRepoCompanySelectionService.cs @@ -0,0 +1,13 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.API.Collections.RepoApi.Services +{ + public interface IRepoCompanySelectionService + { + Task> ListAllAsync(); + Task GetAsync(int id); + Task SaveChangesAsync(IList repoCompanySelections); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/IRepoCompanyService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/IRepoCompanyService.cs new file mode 100644 index 0000000..dd2e78f --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/IRepoCompanyService.cs @@ -0,0 +1,16 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Models; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.API.Collections.RepoApi.Services +{ + public interface IRepoCompanyService + { + Task> ListAll(); + Task Save(RepoCompany repoCompany); + Task Get(int id); + Task Update(RepoCompany repoCompany, AppUser user); + Task Delete(int id); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/IRepoLetterService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/IRepoLetterService.cs new file mode 100644 index 0000000..f403b5f --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/IRepoLetterService.cs @@ -0,0 +1,11 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.API.Collections.RepoApi.Services +{ + public interface IRepoLetterService + { + Task> ListByAccountIdAsync(int accountId); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/IRepoStatusChangeService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/IRepoStatusChangeService.cs new file mode 100644 index 0000000..0755560 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/IRepoStatusChangeService.cs @@ -0,0 +1,11 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.API.Collections.RepoApi.Services +{ + public interface IRepoStatusChangeService + { + Task> ListByAccount(int repoId); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/ISavedLocationService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/ISavedLocationService.cs new file mode 100644 index 0000000..46884e6 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/ISavedLocationService.cs @@ -0,0 +1,15 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.API.Collections.RepoApi.Services +{ + public interface ISavedLocationService + { + Task> ListAllAsync(); + Task SaveAsync(SavedLocation savedLocation); + Task GetAsync(int id); + Task UpdateAsync(SavedLocation savedLocation); + Task DeleteAsync(int id); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/ISettingsService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/ISettingsService.cs new file mode 100644 index 0000000..8a5fed3 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/ISettingsService.cs @@ -0,0 +1,34 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.Settings; + +namespace LCU.API.Collections.RepoApi.Services +{ + public interface ISettingsService + { + Task GetCachedRepoSettingsAsync(); + Task ListAllSettingsAsync(); + Task SaveAsync(AccountType accountType); + Task SaveAsync(AllowedStatusChange statusChange); + Task SaveAsync(BodyStyle bodyStyle); + Task SaveAsync(CleaningLevel cleaningLevel); + Task SaveAsync(CollateralType collateralType); + Task SaveAsync(CollateralTypeToVehicleType collateralToVehicle); + Task SaveAsync(HoldStatus holdStatus); + Task SaveAsync(LoanCategory loanCategory); + Task SaveAsync(LocationType locationType); + Task SaveAsync(VehicleType vehicleType); + Task UpdateAsync(AccountType accountType); + Task UpdateAsync(AllowedStatusChange statusChange); + Task UpdateAsync(BodyStyle bodyStyle); + Task UpdateAsync(CleaningLevel cleaningLevel); + Task UpdateAsync(CollateralType collateralType); + Task UpdateAsync(CollateralTypeToVehicleType collateralToVehicle); + Task UpdateAsync(HoldStatus holdStatus); + Task UpdateAsync(LoanCategory loanCategory); + Task UpdateAsync(LocationType locationType); + Task UpdateAsync(VehicleType vehicleType); + Task SyncExternalUsersAsync(IReadOnlyCollection users); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/IVehicleFloorPricingParametersService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/IVehicleFloorPricingParametersService.cs new file mode 100644 index 0000000..f770034 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/IVehicleFloorPricingParametersService.cs @@ -0,0 +1,13 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.API.Collections.RepoApi.Services +{ + public interface IVehicleFloorPricingParametersService + { + Task> ListAll(); + Task Get(int id); + Task UpdateAsync(VehicleFloorPricingParameters parameters); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/ImsAutoFileDataService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/ImsAutoFileDataService.cs new file mode 100644 index 0000000..ea42109 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/ImsAutoFileDataService.cs @@ -0,0 +1,170 @@ +using System; +using System.Collections.Generic; +using System.Data.SqlClient; +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Exceptions; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using Serilog; + +namespace LCU.API.Collections.RepoApi.Services +{ + public class ImsAutoFileDataService : IImsAutoFileDataService + { + private readonly IImsAutoFileDataRepository _imsAutoFileDataRepository; + private readonly IUnitOfWork _unitOfWork; + + public ImsAutoFileDataService( + IImsAutoFileDataRepository imsAutoFileDataRepository, + IUnitOfWork unitOfWork) + { + _imsAutoFileDataRepository = imsAutoFileDataRepository; + _unitOfWork = unitOfWork; + } + + public async Task> ListAll() + { + try + { + return await _imsAutoFileDataRepository.ListAllAsync(); + } + catch (Exception ex) + { + Log.Error(ex, "Failure retrieving ImsAutoFileData Set"); + throw new ServerErrorException(); + } + } + + public async Task SaveAsync(ImsAutoFileData imsAutoFileData) + { + try + { + await _imsAutoFileDataRepository.AddAsync(imsAutoFileData); + await _unitOfWork.CompleteAsync(); + + return imsAutoFileData; + } + catch (Exception ex) + { + Log.Error(ex, $"Failure saving IMS Auto File Data: {imsAutoFileData}", imsAutoFileData); + throw new ServerErrorException(); + } + } + + public async Task Get(string vin, int repoId) + { + ImsAutoFileData imsAutoFileData; + try + { + imsAutoFileData = await _imsAutoFileDataRepository.FindByIdAsync(vin, repoId); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure retrieving IMS Auto File Data with vin: {vin} repoId: {repoId}"); + throw new ServerErrorException(); + } + + if (imsAutoFileData == null) + { + throw new NotFoundException($"IMS Auto File Data id {vin} / {repoId} not found."); + } + + return imsAutoFileData; + } + + public async Task GetByAuctionAssignmentId(int auctionAssignmentId) + { + ImsAutoFileData imsAutoFileData; + try + { + imsAutoFileData = await _imsAutoFileDataRepository.FindByAuctionAssignmentIdAsync(auctionAssignmentId); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure retrieving IMS Auto File Data by AuctionAssignmentId: {auctionAssignmentId}", auctionAssignmentId); + throw new ServerErrorException(); + } + + if (imsAutoFileData == null) + { + throw new NotFoundException($"IMS Auto File Data id {auctionAssignmentId} not found."); + } + + return imsAutoFileData; + } + + public async Task UpdateAsync(ImsAutoFileData imsAutoFileData) + { + ImsAutoFileData existingImsAutoFileData = null; + try + { + existingImsAutoFileData = await _imsAutoFileDataRepository.FindByIdAsync(imsAutoFileData.VIN, imsAutoFileData.RepoId); + } + catch(Exception ex) + { + Log.Error(ex, $"Failed to retreive existingImsAutoFileData with vin: {imsAutoFileData.VIN} and {imsAutoFileData.RepoId}",imsAutoFileData); + throw new ServerErrorException(); + } + + + if (existingImsAutoFileData == null) + { + throw new NotFoundException($"IMS Auto File Data with id {imsAutoFileData.VIN} / {imsAutoFileData.RepoId} not found."); + } + + try + { + _imsAutoFileDataRepository.Update(imsAutoFileData); + await _unitOfWork.CompleteAsync(); + return (existingImsAutoFileData); + } + catch (SqlException ex) + { + Log.Error(ex, $"SQL Failure updating IMS Auto File Data: {imsAutoFileData}", imsAutoFileData); + throw new ServerErrorException(); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure updating IMS Auto File Data: {imsAutoFileData}", imsAutoFileData); + throw new ServerErrorException(); + } + } + + public async Task DeleteAsync(string vin, int repoId) + { + ImsAutoFileData existingimsAutoFileData = null; + try + { + existingimsAutoFileData = await _imsAutoFileDataRepository.FindByIdAsync(vin, repoId); + } + catch(Exception ex) + { + Log.Error(ex, $"Failed to retreive existingImsAutoFileData with vin: {vin} and {repoId}"); + throw new ServerErrorException(); + + } + + if (existingimsAutoFileData == null) + { + throw new NotFoundException($"IMS Auto File Data with id {vin} / {repoId} not found."); + } + + try + { + _imsAutoFileDataRepository.Remove(existingimsAutoFileData); + await _unitOfWork.CompleteAsync(); + return existingimsAutoFileData; + } + catch (SqlException ex) + { + Log.Error(ex, $"SQL Failure deleting IMS Auto File Data with vin: {vin}, repoId: {repoId}"); + throw new ServerErrorException(); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure deleting IMS Auto File Data with vin: {vin}, repoId: {repoId}"); + throw new ServerErrorException(); + } + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/ProcessingReceiptService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/ProcessingReceiptService.cs new file mode 100644 index 0000000..61d025e --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/ProcessingReceiptService.cs @@ -0,0 +1,97 @@ +using System; +using System.Collections.Generic; +using System.Data.SqlClient; +using System.Linq; +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Exceptions; +using LCU.API.Collections.RepoApi.Models; +using LCU.Shared.Collections.RepoApiLib.Exceptions; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using Serilog; + +namespace LCU.API.Collections.RepoApi.Services +{ + public class ProcessingReceiptService : IProcessingReceiptService + { + private readonly IProcessingReceiptRepository _repository; + private readonly IUnitOfWork _unitOfWork; + + public ProcessingReceiptService( + IProcessingReceiptRepository repository, + IUnitOfWork unitOfWork) + { + _repository = repository; + _unitOfWork = unitOfWork; + } + + public async Task> FindReceiptsAsync(string accountNo, + string accountId = "", string caseId = "") + { + try + { + return await _repository.FindReceiptsAsync(accountNo, accountId, caseId); + } + catch (Exception ex) + { + Log.Error(ex, "Failure retrieving receipts"); + throw new ServerErrorException(); + } + } + + public async Task> GetReceiptsByAccountNoAsync(string accountNo) + { + try + { + return await _repository.GetReceiptsByAccountNoAsync(accountNo); + } + catch (Exception ex) + { + Log.Error(ex, "Failure retrieving receipts by accountNo"); + throw new ServerErrorException(); + } + } + + public async Task> GetRetryListAsync() + { + try + { + return await _repository.GetRetryListAsync(); + } + catch (Exception ex) + { + Log.Error(ex, "Failure retrieving retry list of receipts"); + throw new ServerErrorException(); + } + } + + public async Task SaveAsync(ProcessingReceipt receipt) + { + try + { + await _repository.AddOrUpdateAsync(receipt); + await _unitOfWork.CompleteAsync(); + } + catch (Exception ex) + { + Log.Error(ex, "Failure saving receipt"); + throw new ServerErrorException(); + } + } + + public async Task SaveAllAsync(IReadOnlyCollection receipts) + { + try + { + await _repository.SaveAllAsync(receipts); + await _unitOfWork.CompleteAsync(); + } + catch (Exception ex) + { + Log.Error(ex, "Failure saving receipts"); + throw new ServerErrorException(); + } + } + + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/Producer/AccountAlertCheckService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/Producer/AccountAlertCheckService.cs new file mode 100644 index 0000000..747ef72 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/Producer/AccountAlertCheckService.cs @@ -0,0 +1,128 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using LCU.API.Collections.CollectionsApiLib.Models; +using LCU.API.Collections.RepoApi.Domain.AlertChecker; +using LCU.API.Collections.RepoApi.Domain.Processing; +using LCU.Shared.Collections.RepoApiLib.Models; +using Serilog; + +namespace LCU.API.Collections.RepoApi.Services.Producer +{ + public class AccountAlertCheckService : IAccountAlertCheckService + { + private const string O4RStatus = "O4R"; + private const string NoStatus = ""; + private const string RepoStatus = "REPO"; + private const string RecaStatus = "RECA"; + private const string RehoStatus = "REHO"; + private const string RedeemedStatus = "REDEEMED"; + private readonly IEventAlertService _eventAlertService; + + private readonly IEnumerable _accountAlertPreStatusCheckers; + private readonly IEnumerable _accountAlertPrimaryCheckers; + private readonly IEnumerable _accountAlertPrimaryIgnoreWrittenOffCheckers; + + public AccountAlertCheckService( IEventAlertService eventAlertService) + { + _eventAlertService = eventAlertService; + _accountAlertPreStatusCheckers = new List() + { + new SkipPaidChecker() + }; + _accountAlertPrimaryCheckers = new List() + { + new RepoNotMovedChecker( 7), + new RepoNotSoldChecker( 60, 30), + new StatusChangeChecker( RecaStatus), + new StatusChangeChecker( RehoStatus), + new TimeInStatusChecker( RehoStatus, 30, 30), + new StatusChangeChecker( O4RStatus, new List() { NoStatus, RedeemedStatus, RehoStatus, RecaStatus}), + new O4rNoRepoChecker(RepoType.Voluntary), + new O4rNoRepoChecker(RepoType.Involuntary), + new O4rNoRepoChecker(RepoType.PreSkip), + new SkipEndChecker( 91), + new SkipNotPaidChecker( 106, 15), + new DocumentNotFoundChecker("Notice of Plan to Sell", "LTR35", "701", RepoStatus), + new DocumentNotFoundChecker("Notice of Repossession", "LTR34", "701", RepoStatus), + new RtcLetterNotFoundChecker("RTC Letter", new List { "RTC 1", "RTC 3" }), + new SoldNoProceedsChecker(), + new AuctionOnHoldChecker(), + new AuctionVinDifferentChecker(), + new RedemptionEndedNoTitleOrderedChecker() + }; + _accountAlertPrimaryIgnoreWrittenOffCheckers = new List() + { + new DebitAdjustmentChecker(), + new PaymentReceivedChecker(), + new CreditAdjustmentChecker(), + new SaleFundsReceivedChecker() + }; + } + + public Task AlertChecksPreStatusReject(RepoAccountProcessingSlip slip) + { + return CheckForAlerts(_accountAlertPreStatusCheckers, slip); + } + + public async Task ManualAlert(EventAlert alert) + { + return await _eventAlertService.SaveAsync(alert); + } + + public async Task MaybeAlertOnInvalidStatus(RepoAccountProcessingSlip slip) + { + var allowedStatuses = slip.CurrentSettings?.AllowedStatusChanges.Select(x => x.CurrentStatus); + if (slip.UpdatedRepoAccount != null && allowedStatuses != null && + !allowedStatuses.Contains(slip.UpdatedRepoAccount.Status)) + { + await _eventAlertService.SaveAsync(new EventAlert() + { + RepoId = slip.UpdatedRepoAccount.RepoId, + AccountNo = slip.UpdatedRepoAccount.AccountNo, + CreatedBy = "Importer", + DateAdded = DateTime.Now, + Message = $"Collections System Status {slip.UpdatedRepoAccount.Status} Not Valid" + }); + } + } + + public async Task AlertChecksPrimary( RepoAccountProcessingSlip slip) + { + if (slip.TransactionHistory != null && slip.TransactionHistory.Any()) + { + await CheckForAlerts(_accountAlertPrimaryIgnoreWrittenOffCheckers, slip); + } + else + { + Log.Error($"No Transactions Available, skipping Transaction Alerts for {slip.AccountNo}"); + } + + await CheckForAlerts(_accountAlertPrimaryCheckers, slip); + } + + private async Task CheckForAlerts(IEnumerable alertCheckers, RepoAccountProcessingSlip slip) + { + var eventAlerts = new List(); + foreach (var alertChecker in alertCheckers) + { + try + { + var createdAlerts = alertChecker.CheckForAlert(slip); + if (createdAlerts != null) + { + eventAlerts.AddRange(createdAlerts); + } + } + catch (Exception ex) + { + var accountNumber = slip.AccountNo ?? "Account Number Not Found"; + Log.Error(ex, $"Error Checking Alert {alertChecker.GetType()} For Account: {accountNumber}"); + } + } + + await _eventAlertService.SaveRangeAsync(eventAlerts); + } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/Producer/IAccountAlertCheckService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/Producer/IAccountAlertCheckService.cs new file mode 100644 index 0000000..7d85f4a --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/Producer/IAccountAlertCheckService.cs @@ -0,0 +1,23 @@ +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Domain.Processing; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.API.Collections.RepoApi.Services.Producer +{ + public interface IAccountAlertCheckService + { + /** + * These alerts run before the account is checked to see if it was moved to an un-allowed status. + * What is this moves the status to an un-allowed status? + */ + Task AlertChecksPreStatusReject(RepoAccountProcessingSlip slip); + + /** + * These alerts run after the account has been updated or created and is the primary set of alert checks. + */ + Task AlertChecksPrimary(RepoAccountProcessingSlip slip); + + Task ManualAlert(EventAlert alert); + Task MaybeAlertOnInvalidStatus(RepoAccountProcessingSlip processingSlip); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/Producer/IRepoAccountProcessor.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/Producer/IRepoAccountProcessor.cs new file mode 100644 index 0000000..ea92351 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/Producer/IRepoAccountProcessor.cs @@ -0,0 +1,11 @@ +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Domain.Processing; +using LCU.Shared.Collections.RepoApiLib.Models.Producer; + +namespace LCU.API.Collections.RepoApi.Services.Producer +{ + public interface IRepoAccountProcessor + { + Task HandleAccount(ProcessingItem item); + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/Producer/IRepoAccountProcessorService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/Producer/IRepoAccountProcessorService.cs new file mode 100644 index 0000000..970b9bb --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/Producer/IRepoAccountProcessorService.cs @@ -0,0 +1,23 @@ +using System.Collections.Generic; +using LCU.API.Collections.CollectionsApiLib.Models; +using LCU.API.Collections.RepoApi.Domain.Processing; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.Consumer; +using LCU.Shared.Collections.RepoApiLib.Models.Settings; + +namespace LCU.API.Collections.RepoApi.Services.Producer +{ + public interface IRepoAccountProcessorService + { + RepoAccount CreateRepoAccount(TemenosAccount account, TemenosCase recoveryCase, LoanDetail detail); + void CheckForRejectedStatusChange(RepoAccount originalRepoAccount, RepoAccount updatedRepoAccount, Settings settings); + RepoAccount UpdateRepoAccountFromParts(RepoAccountProcessingSlip slip); + void UpdateRepoAccountDateClosed(RepoAccount repoAccount); + void TryUpdateCollateralRetitleDate(RepoAccount repo, TemenosCase temenosCase); + void AddAccountUpdateRecord(RepoAccountProcessingSlip slip); + RepoCompanySelection CreateNewRepoCompanyAssignment(Collateral collateral, TemenosCase temenosCase, int? newRepoCompanyId); + void TryUpdateOrCreateRepoCompanyAssignment(RepoAccount repoAccount, + TemenosCase temenosCase, Settings settings); + int? MapRepoAgentIdToRepoCompanyId(string repoAgentId, IReadOnlyCollection repoCompanies); + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/Producer/RepoAccountProcessor.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/Producer/RepoAccountProcessor.cs new file mode 100644 index 0000000..bc0bc21 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/Producer/RepoAccountProcessor.cs @@ -0,0 +1,331 @@ +using System; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.DataAccess; +using LCU.API.Collections.RepoApi.Domain.Extensions; +using LCU.API.Collections.RepoApi.Domain.Processing; +using LCU.API.Collections.RepoApi.Exceptions; +using LCU.API.Collections.RepoApi.Models; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.Producer; +using Serilog; + +namespace LCU.API.Collections.RepoApi.Services.Producer +{ + public class RepoAccountProcessor : IRepoAccountProcessor + { + private readonly IRepoAccountProcessorService _repoAccountProcessorService; + private readonly IAccountAlertCheckService _accountAlertCheckService; + private readonly IEmailer _emailer; + private readonly ISettingsService _settingsService; + private readonly ICollectionsDao _collectionsDao; + private readonly ICoreDao _coreDao; + private readonly IRepoAccountService _repoAccountService; + private readonly IRepoLetterService _repoLetterService; + private readonly IAuctionAssignmentService _auctionAssignmentService; + public const string UserStatusFieldOld = "User Status Code 1"; + public const int CaseTypeRepo = 7; // Source: collections API configuration call + private const string O4RStatus = "O4R"; + private const string NoStatus = ""; + private const string RepoStatus = "REPO"; + private const string RecaStatus = "RECA"; + private const string RehoStatus = "REHO"; + private const string RedeemedStatus = "REDEEMED"; + private const string TemenosQueuedBy = "Temenos"; + + public RepoAccountProcessor( + IRepoAccountProcessorService repoAccountProcessorService, + IAccountAlertCheckService accountAlertCheckService, + ICollectionsDao collectionsDao, + IEmailer emailer, + ISettingsService settingsService, + IRepoAccountService repoAccountService, + IRepoLetterService repoLetterService, ICoreDao coreDao, + IAuctionAssignmentService auctionAssignmentService) + { + _repoAccountProcessorService = repoAccountProcessorService; + _accountAlertCheckService = accountAlertCheckService; + _collectionsDao = collectionsDao; + _emailer = emailer; + _settingsService = settingsService; + _repoAccountService = repoAccountService; + _repoLetterService = repoLetterService; + _coreDao = coreDao; + _auctionAssignmentService = auctionAssignmentService; + } + + public async Task HandleAccount(ProcessingItem item) + { + var processingSlip = await CreateProcessingSlip(item); + if (IsAutoCloseAccount(processingSlip)) + { + Log.Debug($"Auto-Closing account {processingSlip.AccountNo} due to no Temenos Account."); + await AutoCloseAccount(processingSlip); + return RepoProcessingResult.Autoclosed; + } + + processingSlip.AssertReadyForPreChecks(); + + // 9640 Attempt to pre-check for a matching status when case is missing. + // If no found case, and the status hasn't changed; instead of failing just skip the unconverted account. + if (IsUnconvertedIntellectAccount(processingSlip)) + { + Log.Debug($"Repo Processor: {item.AccountNo} is not updated for Temenos; skipping."); + return RepoProcessingResult.Unconverted; + } + + processingSlip.RecoveryCase = processingSlip.RecoveryAccount.FindRecoveryCaseOrDefault(processingSlip.CaseId); + + if (!IsPossiblyRepossessionCase(processingSlip)) + { + return RepoProcessingResult.Ineligible; + } + + processingSlip.AssertReadyForFullProcessing(); + + if (ShouldCreateNewAccount(processingSlip)) + { + Log.Debug($"Creating new repo account for {item.AccountNo} : {item.CaseId} "); + processingSlip.UpdatedRepoAccount = await CreateNewRepoAccount(processingSlip); + await _accountAlertCheckService.MaybeAlertOnInvalidStatus(processingSlip); + processingSlip = await AddAlertDataToProcessingSlip(processingSlip); + processingSlip.AssertReadyForAlertChecks(); + await _accountAlertCheckService.AlertChecksPrimary(processingSlip); + return RepoProcessingResult.Created; + } + + if (!processingSlip.ExistingRepoAccount.HasAnyCollateral()) + { + await _emailer.MaybeSendO4rNoCollateralEmail(processingSlip.ExistingRepoAccount); + throw new MissingRequirementException("Existing Account Collateral", + $"{processingSlip.AccountNo} did not have collateral on existing account."); + } + + Log.Debug($"Updating Repo account for {item.AccountNo} : {item.CaseId}"); + processingSlip.UpdatedRepoAccount = await UpdateExistingRepoAccount(processingSlip); + + //Add check for recent account repo closing when in RECA status to prevent reprocessing and new repo account creation with a DateClosed date = null + //The DateClosed date = null will ensure the account gets reprocessed, we don't want alert checks with these accounts + + if (processingSlip.ExistingRepoAccount.DateClosed == null && processingSlip.UpdatedRepoAccount.DateClosed != null) + { + return RepoProcessingResult.Updated; + } + + processingSlip = await AddAlertDataToProcessingSlip(processingSlip); + processingSlip.AssertReadyForAlertChecks(); + await _accountAlertCheckService.AlertChecksPrimary(processingSlip); + return RepoProcessingResult.Updated; + } + + // New method to give a chance to filter out non-repo cases and mark ineligible + private bool IsPossiblyRepossessionCase(RepoAccountProcessingSlip slip) + { + if (slip.RecoveryCase == null) return true; + try + { + if (slip.RecoveryCase.CaseTypeId != CaseTypeRepo) + { + return false; + } + + StatusService.ConvertStatus(slip.RecoveryCase.RepoStatus); + } + catch (IneligibleAccountException) + { + return false; + } + + return true; + } + + private async Task AutoCloseAccount(RepoAccountProcessingSlip processingSlip) + { + AppUser appUser = new AppUser() + { + Email = processingSlip.RequestedBy.QueuedBy, + FirstName = "System", + LastName = "System" + }; + processingSlip.ExistingRepoAccount.DateClosed = DateTime.Now; + processingSlip.ExistingRepoAccount.AccountLastProcessed = DateTime.Now; + await _repoAccountService.UpdateAsync(processingSlip.ExistingRepoAccount, appUser); + } + + private bool IsAutoCloseAccount(RepoAccountProcessingSlip processingSlip) + { + // If recovery account couldn't be fetched, that would have been an exception. + // If recovery account is null, it means "not there", so close the RepoAccount. + // This means close the RepoAccount because the account + // was likely not brought over from Intellect. If something DOES happen, just create + // a new account later.... + return (processingSlip.RecoveryAccount == null + && processingSlip.ExistingRepoAccount != null + && processingSlip.ExistingRepoAccount.DateClosed == null); + } + + public async Task CreateProcessingSlip(ProcessingItem item) + { + var accountNo = VerifyAccountNo(item); + + var slip = new RepoAccountProcessingSlip + { + AccountNo = accountNo, + CurrentSettings = await _settingsService.GetCachedRepoSettingsAsync(), + RecoveryAccount = await _collectionsDao.RetrieveAccountAsync(accountNo), + ExistingRepoAccount = await _repoAccountService.GetNewestOpenAccount(accountNo), + Loan = await _coreDao.RetrieveLoanAsync(accountNo), + CaseId = VerifyCaseId(item.CaseId), + RequestedBy = item + }; + + if (slip.RecoveryAccount != null) + { + slip.Letters = await _repoLetterService.ListByAccountIdAsync(slip.RecoveryAccount.AccountId); + } + + return slip; + } + + public async Task AddAlertDataToProcessingSlip(RepoAccountProcessingSlip slip) + { + slip.TransactionHistory = await _coreDao.RetrieveTransactionsAsync(slip.AccountNo); + slip.Member = await _coreDao.RetrieveMemberAsync(slip.AccountNo); + var uniqueIds = slip.UpdatedRepoAccount.GetUniqueAuctionAssignmentIds(); + slip.AuctionAssignments = await _auctionAssignmentService.GetListByIdsAsync(uniqueIds); + return slip; + } + + public bool IsUnconvertedIntellectAccount(RepoAccountProcessingSlip repoAccountSlip) + { + var recoveryAccount = repoAccountSlip.RecoveryAccount; + var caseId = repoAccountSlip.CaseId; + var originalRepoAccount = repoAccountSlip.ExistingRepoAccount; + if (!recoveryAccount.HasRecoveryCase(caseId) && recoveryAccount.HasOldIntellectStatus()) + { + Log.Information( + $"Repo Processor: {repoAccountSlip.AccountNo} has no case, but user status code. Running pre-check."); + return (originalRepoAccount.Status == recoveryAccount.CustomFieldMap[UserStatusFieldOld]); + } + + return false; + } + + public int VerifyCaseId(string itemCaseId) + { + try + { + return string.IsNullOrWhiteSpace(itemCaseId) ? 0 : Int32.Parse(itemCaseId); + } + catch (Exception) + { + throw new IneligibleAccountException( + $"Bad CaseId {itemCaseId}", + $"The CaseId is present, but in a non-integer format."); + } + } + + public string VerifyAccountNo(ProcessingItem item) + { + if (item == null) + { + throw new IneligibleAccountException("Processing Item", "The processing item was null."); + } + + if (item.AccountNo == null) + { + throw new IneligibleAccountException( + "Null AccountNo", + "There should never be null accounts on the queue."); + } + + // if (Regex.IsMatch(item.AccountNo, "^[a-zA-Z0-9]*$")) + // { + // throw new IneligibleAccountException( + // "AccountNo", + // "AccountNo contains alphabetical or symbol characters"); + // } + + return item.AccountNo; + } + + public async Task UpdateExistingRepoAccount(RepoAccountProcessingSlip slip) + { + AppUser appUser = new AppUser() + { + Email = slip.RequestedBy.QueuedBy, + FirstName = "System", + LastName = "System" + }; + + if (ShouldRunCompleteUpdate(slip)) + { + RepoAccount updatedRepoAccount = + _repoAccountProcessorService.UpdateRepoAccountFromParts(slip); + await _accountAlertCheckService.AlertChecksPreStatusReject(slip); + + _repoAccountProcessorService.CheckForRejectedStatusChange(slip.ExistingRepoAccount, updatedRepoAccount, + slip.CurrentSettings); + _repoAccountProcessorService.TryUpdateOrCreateRepoCompanyAssignment(updatedRepoAccount, + slip.RecoveryCase, slip.CurrentSettings); + _repoAccountProcessorService.TryUpdateCollateralRetitleDate(updatedRepoAccount, slip.RecoveryCase); + await _repoAccountService.UpdateAsync(updatedRepoAccount, appUser); + + return updatedRepoAccount; + } + + _repoAccountProcessorService.TryUpdateOrCreateRepoCompanyAssignment(slip.ExistingRepoAccount, + slip.RecoveryCase, slip.CurrentSettings); + _repoAccountProcessorService.AddAccountUpdateRecord(slip); + _repoAccountProcessorService.TryUpdateCollateralRetitleDate(slip.ExistingRepoAccount, slip.RecoveryCase); + _repoAccountProcessorService.UpdateRepoAccountDateClosed(slip.ExistingRepoAccount); + await _repoAccountService.UpdateAsync(slip.ExistingRepoAccount, appUser); + return slip.ExistingRepoAccount; + } + + public bool ShouldRunCompleteUpdate(RepoAccountProcessingSlip slip) + { + if (slip.ExistingRepoAccount == null) + { + throw new MissingRequirementException("Existing Repo Account", + $"Existing Repo Account required for update check, {slip.AccountNo}"); + } + + var newStatus = StatusService.ConvertStatus(slip.RecoveryCase.RepoStatus); + + var dateLastPaid = slip.RecoveryAccount.DateLastPaid != null + ? DateTime.Parse(slip.RecoveryAccount.DateLastPaid) + : slip.ExistingRepoAccount.LastPaymentDate; + var refStatusChanged = slip.RecoveryAccount.AccountStatus != slip.ExistingRepoAccount.ReferenceStatus; + + // This is a special case, it picked up the written off flag, before there was a written off date. + if (string.Equals(slip.ExistingRepoAccount.ReferenceStatus, RepoAccountProcessorService.WrittenOff, + StringComparison.CurrentCultureIgnoreCase) + && slip.ExistingRepoAccount.WrittenOffDate == null) + { + return true; + } + + var needsRedemptionExpired = slip.ExistingRepoAccount.RedemptionExpiredDate == null + && (slip.RecoveryCase.RedemptionExpiredDateIl != null || + slip.RecoveryCase.RedemptionExpiredDateWi != null); + + return !string.Equals(newStatus, slip.ExistingRepoAccount.Status, StringComparison.CurrentCultureIgnoreCase) + || slip.ExistingRepoAccount.LastPaymentDate != dateLastPaid || + slip.ExistingRepoAccount.Balance != slip.RecoveryAccount.Balance + || needsRedemptionExpired || refStatusChanged; + } + + public async Task CreateNewRepoAccount(RepoAccountProcessingSlip slip) + { + var repoAccount = _repoAccountProcessorService.CreateRepoAccount(slip.RecoveryAccount, slip.RecoveryCase, slip.Loan); + var newRepoAccount = await _repoAccountService.SaveAsync(repoAccount); + return newRepoAccount; + } + + public bool ShouldCreateNewAccount(RepoAccountProcessingSlip slip) + { + return slip != null && (slip.ExistingRepoAccount == null || slip.ExistingRepoAccount.DateClosed != null); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/Producer/RepoAccountProcessorService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/Producer/RepoAccountProcessorService.cs new file mode 100644 index 0000000..b4a0646 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/Producer/RepoAccountProcessorService.cs @@ -0,0 +1,585 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using LCU.API.Collections.CollectionsApiLib.Models; +using LCU.API.Collections.RepoApi.DataAccess; +using LCU.API.Collections.RepoApi.Domain.Processing; +using LCU.API.Collections.RepoApi.Exceptions; +using LCU.API.Collections.RepoApi.Models.Results; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.Consumer; +using LCU.Shared.Collections.RepoApiLib.Models.Settings; +using Serilog; + +namespace LCU.API.Collections.RepoApi.Services.Producer +{ + public class RepoAccountProcessorService : IRepoAccountProcessorService + { + private const string RedeemedStatus = "REDEEMED"; + private const string PaidSkipStatus = "PSKP"; + private const string RepoCancelledStatus = "RECA"; + public const string WrittenOff = "Written Off"; + public const string SixtyPLusUserAssignedLabel = "SixtyPlus User Assigned"; + private readonly ICoreDao _coreDao; + private readonly IRedemptionExpiredDateCalculator _redemptionExpiredDateCalculator; + private readonly IAccountAlertCheckService _accountAlertCheckService; + private readonly IEventAlertService _eventAlertService; + private readonly IRepoCompanySelectionService _repoCompanySelectionService; + + public RepoAccountProcessorService(ICoreDao coreDao, + IRedemptionExpiredDateCalculator redemptionExpiredDateCalculator, + IAccountAlertCheckService accountAlertCheckService, + IEventAlertService eventAlertService, IRepoCompanySelectionService repoCompanySelectionService) + { + _coreDao = coreDao; + _redemptionExpiredDateCalculator = redemptionExpiredDateCalculator; + _accountAlertCheckService = accountAlertCheckService; + _eventAlertService = eventAlertService; + _repoCompanySelectionService = repoCompanySelectionService; + } + + // This process determined from the original batch code. (LCU.CollectionRepossessionTracking::IntellecRepoImport) + // -> A) Get XP/Core/Apex Account + // -> B) Get XP/Core/Apex Loan + // -> B.1) Fields needed: Branch, Next due date + // ---> If it can't find a loan, it does nothing... what do we WANT do? + // -> C) Get XP/Core/Apex Loan Collateral + // ---> If there is no collateral, it does nothing... what do we WANT do? + // -> D) Get XP/Core/Apex Borrowers (Individuals) + // ---> No borrowers throws an exception? ... what do we WANT do? + // -> E) Create Repo Account from Loan, Collateral, Borrowers and Temenos Account + public RepoAccount CreateRepoAccount(TemenosAccount account, TemenosCase recoveryCase, LoanDetail loanDetail) + { + var collateralDetailRequest = _coreDao.RetrieveCollateralAsync(account.AccountIdentifier); + + var collateralDetail = collateralDetailRequest.GetAwaiter().GetResult(); + if (collateralDetail == null || !collateralDetail.Any()) + { + throw new AccountCreationFailed( + $"Repo-Account Not Created using Account with AccountNo: {account.AccountIdentifier}. No Collateral."); + } + + var borrowers = ConstructRepoAccountBorrowers(loanDetail); + if (borrowers == null || !borrowers.Any()) + { + throw new AccountCreationFailed( + $"Repo-Account Not Created using Account with AccountNo: {account.AccountIdentifier}. No Borrowers."); + } + + var repoAccount = ConstructRepoAccountFromParts(loanDetail, account, recoveryCase); + repoAccount.Borrowers = borrowers; + repoAccount.Collaterals = ConstructCollateralFromDetails(collateralDetail); + TryUpdateCollateralRetitleDate(repoAccount, recoveryCase); + + Log.Information($"Created Repo-Account for Not-Found Account. AccountNo: {account.AccountIdentifier}"); + return repoAccount; + } + + public List ConstructRepoAccountBorrowers(LoanDetail coreAccount) + { + List borrowers = new List(); + try + { + foreach (var coreAccountBorrower in coreAccount.Borrowers) + { + var borrower = new Borrower() + { + IndividualName = coreAccountBorrower.Name, + IndividualId = coreAccountBorrower.IndividualId.ToString(), + OwnershipType = (int)ConvertBorrowerType(coreAccountBorrower.Type) + }; + borrowers.Add(borrower); + } + } + catch (Exception ex) + { + Log.Error(ex, "Error in ConstructRepoAccountBorrowers"); + } + + return borrowers; + } + + public List ConstructCollateralFromDetails(IReadOnlyCollection collateralDetail) + { + List collateralList = new List(); + foreach (var detail in collateralDetail) + { + var collateral = new Collateral() + { + BodyStyle = null, + CollateralTypeId = null, + Description = detail.Description, + Inoperable = null, + RefCollateralId = detail.CollateralId.ToString() + }; + if (detail.Other != null) + { + collateral.Vin = detail.Other.MiscellaneousInformation; + } + + if (detail.Vehicle != null) + { + collateral.Make = detail.Vehicle.Make; + collateral.Model = detail.Vehicle.Model; + collateral.Vin = detail.Vehicle.VIN; + collateral.Year = detail.Vehicle.Year; + collateral.BodyStyle = detail.Vehicle.BodyStyle; + } + + collateralList.Add(collateral); + } + + return collateralList; + } + + public RepoAccount ConstructRepoAccountFromParts(LoanDetail coreAccount, TemenosAccount account, + TemenosCase recoveryCase) + { + DateTime? lastPaymentDate = null; + DateTime? dateFirstDelinquent = null; + + var lastPaymentResult = GetDateTimeFromString(account.DateLastPaid); + if (lastPaymentResult.IsSuccess) + { + lastPaymentDate = lastPaymentResult.Value; + } + else + { + Log.Warning( + $"Construct Repo Account from temenos accountNo: {account.AccountNumber}. Could not parse last payment result : {account.DateLastPaid}.", + lastPaymentResult, account); + } + + + var dateFirstDelinquentResult = GetDateTimeFromString(account.DateFirstDelinquent); + if (dateFirstDelinquentResult.IsSuccess) + { + dateFirstDelinquent = dateFirstDelinquentResult.Value; + } + else + { + Log.Warning( + $"Construct Repo Account from temenos accountNo: {account.AccountNumber}. failed parsing dateFirstDelinquent {account.DateFirstDelinquent}", + dateFirstDelinquentResult, account); + // This is no longer a "MissingRequirementException", per Bill Johns. + } + + var sixtyPlusUserAssignedNumber = GetSixtyPlusUserNumber(account); + + var repoAccount = new RepoAccount() + { + DueToPayDate = coreAccount.NextDueDate, + Balance = account.Balance, + AccountTypeCode = account.AccountType.Code, + OrigAccountTypeCode = account.AccountType.Code, + LoanNo = long.Parse(account.AccountIdentifier), + MemberNo = MemberIdFromAccountId(account.AccountIdentifier), + Branch = account.Branch != null ? int.Parse(account.Branch) : 0, + AccountNo = account.AccountIdentifier, + Status = StatusService.ConvertStatus(recoveryCase.RepoStatus), + O4RDate = recoveryCase.CreatedDate, + Collector = account.LoanOfficer, + DateFirstDelinquent = dateFirstDelinquent, + DelinquentAmount = account.DQAmount, + CurrentDelinquentAmount = account.DQAmount, + SubStatus = "", + DaysDelinquent = account.DaysDq, + LastPaymentDate = lastPaymentDate, + LstPmtAmt = account.AmountLastPaid, + OrigAmount = account.OriginalLoanAmount, + RequiredPaymentAmount = account.DQAmount, + PrimaryIndividualId = coreAccount.IndividualId[0].ToString(), + Bankruptcy = $"{account.BankruptcyFlag}", + DateFirstIntellect = recoveryCase.CreatedDate, + ReferenceId = account.AccountId, + ReferenceCaseId = recoveryCase.CaseId, + AccountLastProcessed = DateTime.Now, + ReferenceStatus = account.AccountStatus, + WrittenOffDate = coreAccount.Status == WrittenOff ? coreAccount.WrittenOffDate : (DateTime?)null, + SixtyPlusCollectorId = sixtyPlusUserAssignedNumber + }; + + return repoAccount; + } + + public long MemberIdFromAccountId(string accountId) + { + return _coreDao.RetrieveMemberAsync(accountId).GetAwaiter().GetResult().MemberId; + } + + public RepoAccount UpdateRepoAccountFromParts(RepoAccountProcessingSlip slip) + { + RepoAccount originalRepoAccount = slip.ExistingRepoAccount; + TemenosAccount account = slip.RecoveryAccount; + TemenosCase recoveryCase = slip.RecoveryCase; + IReadOnlyCollection letters = slip.Letters; + var redemptionExpiredDate = _redemptionExpiredDateCalculator.CalculateAsync(recoveryCase, letters); + + DateTime? lastPaymentDate = null; + DateTime? dateFirstDelinquent = originalRepoAccount.DateFirstDelinquent; + + var lastPaymentResult = GetDateTimeFromString(account.DateLastPaid); + if (lastPaymentResult.IsSuccess) + { + lastPaymentDate = lastPaymentResult.Value; + } + else + { + Log.Warning( + $"Repo account {originalRepoAccount.RepoId} ({originalRepoAccount.AccountNo}). Could not parse last payment result : {account.DateLastPaid}.", + lastPaymentResult); + } + + var dateFirstDelinquentResult = GetDateTimeFromString(account.DateFirstDelinquent); + if (dateFirstDelinquentResult.IsSuccess) + { + dateFirstDelinquent = dateFirstDelinquentResult.Value; + } + else + { + Log.Error( + $"Repo account {originalRepoAccount.RepoId} ({originalRepoAccount.AccountNo}) failed parsing dateFirstDelinquent {account.DateFirstDelinquent}", + dateFirstDelinquentResult); + // This is no longer a "MissingRequirementException", per Bill Johns. + } + + var sixtyPlusUserAssignedNumber = GetSixtyPlusUserNumber(account); + + var repoAccount = new RepoAccount() + { + RepoId = originalRepoAccount.RepoId, + DueToPayDate = account.DueDate, + Balance = account.Balance, + AccountTypeCode = account.AccountType.Code, + OrigAccountTypeCode = originalRepoAccount.OrigAccountTypeCode, + LoanNo = originalRepoAccount.LoanNo, + MemberNo = originalRepoAccount.MemberNo, + Branch = originalRepoAccount.Branch, + AccountNo = originalRepoAccount.AccountNo, + Status = StatusService.ConvertStatus(recoveryCase.RepoStatus), + O4RDate = originalRepoAccount.O4RDate, + Collector = account.LoanOfficer, + DateFirstDelinquent = dateFirstDelinquent, + DelinquentAmount = account.DQAmount, + CurrentDelinquentAmount = account.DQAmount, + SubStatus = "", + DaysDelinquent = originalRepoAccount.DaysDelinquent, //leave this set to days delinquent when added. + LastPaymentDate = lastPaymentDate, + LstPmtAmt = account.AmountLastPaid ?? 0, + OrigAmount = account.OriginalLoanAmount ?? 0, + RedemptionExpiredDate = redemptionExpiredDate, + RequiredPaymentAmount = account.DQAmount, + PrimaryIndividualId = originalRepoAccount.PrimaryIndividualId, + Bankruptcy = $"{account.BankruptcyFlag}", + Collaterals = originalRepoAccount.Collaterals, + RepoStatusChanges = originalRepoAccount.RepoStatusChanges, + ManualRedemptionDate = originalRepoAccount.ManualRedemptionDate, + DateFirstIntellect = originalRepoAccount.DateFirstIntellect, + Borrowers = originalRepoAccount.Borrowers, + PaidSkipAmount = originalRepoAccount.PaidSkipAmount, + RefundStatus = originalRepoAccount.RefundStatus, + ReferenceId = account.AccountId, + ReferenceCaseId = recoveryCase.CaseId, + AccountLastProcessed = DateTime.Now, + ReferenceStatus = account.AccountStatus, + WrittenOffDate = slip.Loan.Status == WrittenOff ? slip.Loan.WrittenOffDate : (DateTime?)null, + SixtyPlusCollectorId = sixtyPlusUserAssignedNumber + }; + + return repoAccount; + } + + /** + * High Risk function because of string comparison and unknown mapping. + * The old system got the integer from the database. + * The new system gets a string from the web service. + * This maps the new string to the old integer, if borrower types start + * showing up wrong, look here... + */ + public OwnershipType ConvertBorrowerType(string type) + { + if (type != null && string.Equals(type.Trim(), "Borrower", StringComparison.OrdinalIgnoreCase)) + { + return OwnershipType.Borrower; + } + + if (type != null && string.Equals(type.Trim(), "Co-Borrower", StringComparison.OrdinalIgnoreCase)) + { + return OwnershipType.Coborrower; + } + + return OwnershipType.Other; + } + + public void CheckForRejectedStatusChange(RepoAccount originalRepoAccount, RepoAccount updatedRepoAccount, + Settings settings) + { + if (!IsStatusMatch(originalRepoAccount, updatedRepoAccount.Status) && + !IsStatusChangeAllowed(originalRepoAccount.Status, updatedRepoAccount.Status, + settings.AllowedStatusChanges)) + { + Log.Warning( + $"Status Change Reverted for Account {updatedRepoAccount.AccountNo} from {originalRepoAccount.Status} to {updatedRepoAccount.Status}"); + + _accountAlertCheckService.ManualAlert(new EventAlert() + { + RepoId = updatedRepoAccount.RepoId, + AccountNo = updatedRepoAccount.AccountNo, + CreatedBy = "Importer", + DateAdded = DateTime.Now, + Message = "Collections System Status Does Not Match Repo Management", + SubMessage = + $"Invalid Status Change from {originalRepoAccount.Status} to {updatedRepoAccount.Status}" + }); + updatedRepoAccount.Status = originalRepoAccount.Status; + } + } + + public bool IsStatusChangeAllowed(string oldStatus, string newStatus, + IEnumerable settingsAllowedStatusChanges) + { + foreach (var allowedStatusChange in settingsAllowedStatusChanges) + { + if (IsStringMatch(allowedStatusChange.CurrentStatus, oldStatus) && + IsStringMatch(allowedStatusChange.AllowedChangeStatus, newStatus)) + { + return true; + } + } + + return false; + } + + public bool IsStatusMatch(RepoAccount repo, string status) + { + if (repo?.Status == null || status == null) + { + return false; + } + + return string.Equals(repo.Status.Trim(), status.Trim(), StringComparison.OrdinalIgnoreCase); + } + + public bool IsStringMatch(string x, string y) + { + if (x == null || y == null) + { + return false; + } + + return string.Equals(x.Trim(), y.Trim(), StringComparison.OrdinalIgnoreCase); + } + + public void UpdateRepoAccountDateClosed(RepoAccount repoAccount) + { + // Close the account after four days in certain statuses + if ((repoAccount.Status == PaidSkipStatus || repoAccount.Status == RedeemedStatus || repoAccount.Status == RepoCancelledStatus) + && repoAccount.RepoStatusChanges.LastOrDefault(x => x.StatusTo == repoAccount.Status)?.ChangedDate < + DateTime.Now.AddDays(-3).Date) + { + repoAccount.DateClosed = DateTime.Now; + repoAccount.AccountLastProcessed = DateTime.Now; + // TODO calling this still has a side effect. + _eventAlertService.MarkAllAsRead(repoAccount.AccountNo).GetAwaiter().GetResult(); + } + } + + public void TryUpdateCollateralRetitleDate(RepoAccount repo, TemenosCase temenosCase) + { + DateTime? retitledDate = (temenosCase.TitleOrdered) ? temenosCase.TitleOrderedDate : null; + + foreach (Collateral collateral in repo.Collaterals) + { + collateral.RetitledInLandmarkName = retitledDate; + } + } + + // This exists to update accounts not originally created from Temenos + public void AddAccountUpdateRecord(RepoAccountProcessingSlip slip) + { + slip.ExistingRepoAccount.ReferenceId = slip.RecoveryAccount.AccountId; + slip.ExistingRepoAccount.ReferenceCaseId = slip.RecoveryCase.CaseId; + slip.ExistingRepoAccount.AccountLastProcessed = DateTime.Now; + } + + public void TryUpdateOrCreateRepoCompanyAssignment(RepoAccount repoAccount, TemenosCase temenosCase, + Settings settings) + { + //Temenos may send blank string instead of null + var repoCompanyIdFromCase = string.IsNullOrEmpty(temenosCase.RepoAgentId) + ? null + : MapRepoAgentIdToRepoCompanyId(temenosCase.RepoAgentId, settings.RepoCompanies); + + foreach (var collateral in repoAccount.Collaterals) + { + var mostRecent = collateral.RepoCompanySelections.OrderByDescending(x => x.DateTimeCreated) + .FirstOrDefault(); + + // TODO, move to Slip, save elsewhere. + var updated = + UpdateOrCreateRepoCompanyAssignment(collateral, mostRecent, temenosCase, repoCompanyIdFromCase); + + // This can no longer happen, but watch for it anyway. + if (updated.Any(repoCompanySelection => + repoCompanySelection.DateRepoed != null && + repoCompanySelection.RepoCompanyAssignmentDate == null)) + { + Log.Error( + $"Tried to set DateRepoed before RepoCompanyAssignment for accountNo {repoAccount.AccountNo}. Please Investigate."); + throw new MissingRequirementException( + $"RepoCompanyAssignment for repo account {repoAccount.AccountNo} Missing RepoCompanyAssignmentDate", + $"Cannot assign a DateRepoed before a RepoCompanyAssignment Date."); + } + + if (updated.Any()) + { + _repoCompanySelectionService.SaveChangesAsync(updated).GetAwaiter().GetResult(); + } + } + } + + public List UpdateOrCreateRepoCompanyAssignment(Collateral collateral, RepoCompanySelection mostRecentSelection, + TemenosCase temenosCase, int? repoCompanyIdFromCase) + { + var selectionUpdates = new List(); + //If this is the first repoCompanySelection create when temenos has data + if (mostRecentSelection == null) + { + if (temenosCase.RepoAgentId != null && temenosCase.RepoType != null && + temenosCase.DateRepoAssigned != null) + { + var newRepoCompanyEntry = CreateNewRepoCompanyAssignment(collateral, temenosCase, repoCompanyIdFromCase); + collateral.RepoCompanySelections = collateral.RepoCompanySelections.Append(newRepoCompanyEntry).ToList(); + selectionUpdates.Add(newRepoCompanyEntry); + } + + return selectionUpdates; + } + + //If the repoCompany has changed update with temenos data + if (mostRecentSelection.RepoCompanyId != repoCompanyIdFromCase || + mostRecentSelection.RepoType != temenosCase.RepoType || + mostRecentSelection.RepoCompanyAssignmentDate != temenosCase.DateRepoAssigned) + { + if (mostRecentSelection.DateRepoed == null) + { + mostRecentSelection.DateRepoed = DateTime.Now; + if (mostRecentSelection.RepoCompanyAssignmentDate == null) + { + mostRecentSelection.RepoCompanyAssignmentDate = mostRecentSelection.DateTimeCreated ?? DateTime.Now; + } + + selectionUpdates.Add(mostRecentSelection); + } + + var newRepoCompanyEntry = CreateNewRepoCompanyAssignment(collateral, temenosCase, repoCompanyIdFromCase); + collateral.RepoCompanySelections = collateral.RepoCompanySelections.Append(newRepoCompanyEntry).ToList(); + selectionUpdates.Add(newRepoCompanyEntry); + + return selectionUpdates; + } + + //If no need to update or create, sync Repoed Date + mostRecentSelection.DateRepoed = temenosCase.DateRepossessed; + selectionUpdates.Add(mostRecentSelection); + + return selectionUpdates; + } + + public RepoCompanySelection CreateNewRepoCompanyAssignment(Collateral collateral, TemenosCase temenosCase, int? newRepoCompanyId) + { + // DateRepoAssigned is defaulted to Today. The business (Bill) doesn't want it to throw, if they start having trouble + // with the dates; change this to throw a MissingRequirementException on the field. + var newRepoCompanySelection = new RepoCompanySelection() + { + RepoCompanyId = newRepoCompanyId, + RepoType = temenosCase.RepoType ?? RepoType.Unknown, + RepoCompanyAssignmentDate = temenosCase.DateRepoAssigned ?? DateTime.Now, + DateRepoed = temenosCase.DateRepossessed, + CollateralId = collateral.CollateralId, + DateTimeCreated = DateTime.Now, + Id = null + }; + + return newRepoCompanySelection; + } + + public int? MapRepoAgentIdToRepoCompanyId(string repoAgentId, IReadOnlyCollection repoCompanies) + { + try + { + var repoCompany = + repoCompanies.FirstOrDefault(company => company.ReferenceId == int.Parse(repoAgentId)); + + if (repoCompany != null) + { + return repoCompany.ID; + } + } + catch (Exception ex) + { + Log.Error(ex, $"Error when trying to map RepoAgentID: {repoAgentId} to a RepoCompany ReferenceID", repoCompanies); + } + + // If you get this error, ensure there is a matching RepoCompany and that it has a RepoAgentID that matches the config call in Collections API. + throw new MissingRequirementException("RepoCompanyAssignment - RepoCompanyID", $"Ensure a RepoCompany with RepoAgentID: {repoAgentId} is present"); + } + + public IResult GetDateTimeFromString(string dtString) + { + if (string.IsNullOrEmpty(dtString)) + { + Log.Error("Cannot parse null or empty date string"); + return new DateTimeResult() + { + IsSuccess = false, + ErrorMessage = "Cannot Parse Empty Date String", + }; + } + + try + { + return new DateTimeResult() + { + IsSuccess = true, + Value = DateTime.Parse(dtString) + }; + } + catch (Exception ex) + { + Log.Error(ex, $"Cannot Parse Date String {dtString}"); + return new DateTimeResult() + { + IsSuccess = false, + ErrorMessage = $"There was an Exception when processing the date string: {dtString}" + }; + } + } + + public int? GetSixtyPlusUserNumber(TemenosAccount account) + { + try + { + account.CustomFieldMap.TryGetValue(SixtyPLusUserAssignedLabel, out string sixtyPlusUser); + if (String.IsNullOrWhiteSpace(sixtyPlusUser)) + { + return null; + } + + Int32.TryParse(sixtyPlusUser, out int sixtyPlusUserNumber); + + return sixtyPlusUserNumber; + } + catch(NullReferenceException nullEx) + { + Log.Warning($"60+ Collector key not found in Temenos Account for Account Number: {account.AccountNumber}. Error: {nullEx}"); + return null; + } + catch(Exception ex) + { + Log.Error($"Error while attempting to Parse 60+ Collector ID for Account Number: {account.AccountNumber}. Error: {ex}"); + return null; + } + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/RefundStatusService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/RefundStatusService.cs new file mode 100644 index 0000000..92b4f6d --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/RefundStatusService.cs @@ -0,0 +1,106 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Exceptions; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using Serilog; + + +namespace LCU.API.Collections.RepoApi.Services +{ + public class RefundStatusService : IRefundStatusService + { + private IRefundStatusRepository _refundStatusRepository; + private IUnitOfWork _unitOfWork; + private IRepoAccountService _repoAccountService; + private IEmailer _emailer; + + public RefundStatusService( + IRefundStatusRepository refundStatusRepository, + IUnitOfWork unitOfWork, + IRepoAccountService repoAccountService, + IEmailer emailer) + { + _refundStatusRepository = refundStatusRepository; + _unitOfWork = unitOfWork; + _repoAccountService = repoAccountService; + _emailer = emailer; + } + + public async Task> ListAllAsync() + { + return await _refundStatusRepository.ListAsync(); + } + + public async Task GetAsync(int repoId) + { + RefundStatus refundStatus; + try + { + refundStatus = await _refundStatusRepository.FindByRepoIdAsync(repoId); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure retrieving Refund Status for repoId: {repoId}"); + throw new NotFoundException($"Refund Status with repoId {repoId} not found"); + } + + if (refundStatus == null) + { + throw new NotFoundException($"Refund Status with repoId {repoId} not found"); + } + + return refundStatus; + } + + public async Task SaveAsync(RefundStatus refundStatus) + { + await _repoAccountService.Get(refundStatus.RepoId.Value); + + try + { + var newRefundStatus = await _refundStatusRepository.AddAsync(refundStatus); + await _unitOfWork.CompleteAsync(); + return newRefundStatus; + } + catch (Exception ex) + { + Log.Error(ex, $"Failure saving Refund Status: {refundStatus}", refundStatus); + throw new ServerErrorException(); + } + } + + public async Task UpdateAsync(RefundStatus refundStatus) + { + var existingRefundStatus = await GetAsync(refundStatus.RepoId.Value); + var existingRepoAccount = await _repoAccountService.Get(refundStatus.RepoId.Value); + var isInBankruptcy = existingRepoAccount.Bankruptcy != null; + var isEmailNeeded = refundStatus.RefundsReceivedDate != null && existingRefundStatus.RefundsReceivedDate != refundStatus.RefundsReceivedDate && !isInBankruptcy; + + try + { + existingRefundStatus.WarrantyRefundStatus = refundStatus.WarrantyRefundStatus; + existingRefundStatus.InsuranceRefundStatus = refundStatus.InsuranceRefundStatus; + existingRefundStatus.PremiumDefiRefundStatus = refundStatus.PremiumDefiRefundStatus; + existingRefundStatus.CPIRefundStatus = refundStatus.CPIRefundStatus; + existingRefundStatus.RefundsReceivedDate = refundStatus.RefundsReceivedDate; + + _refundStatusRepository.Update(existingRefundStatus); + await _unitOfWork.CompleteAsync(); + + if (isEmailNeeded) + { + await _emailer.SendSurplusDeficiencyLetterEmailAsync(existingRepoAccount); + } + + return existingRefundStatus; + } + catch (Exception ex) + { + Log.Error(ex, $"Failure saving Refund Status: {refundStatus}", refundStatus); + throw new ServerErrorException(); + } + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/RepoAccountService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/RepoAccountService.cs new file mode 100644 index 0000000..a73d6cc --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/RepoAccountService.cs @@ -0,0 +1,356 @@ +using System; +using System.Collections.Generic; +using System.Data.SqlClient; +using System.Linq; +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Exceptions; +using LCU.API.Collections.RepoApi.Models; +using LCU.API.Collections.RepoApi.Models.Filters; +using LCU.API.Collections.RepoApi.Models.Requests; +using LCU.Shared.Collections.RepoApiLib.Exceptions; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.Producer; +using LCU.Shared.Collections.RepoApiLib.Models.Results; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using Serilog; + +namespace LCU.API.Collections.RepoApi.Services +{ + public class RepoAccountService : IRepoAccountService + { + private readonly IRepoAccountRepository _repoAccountRepository; + private readonly IRepoStatusChangeRepository _repoStatusChangeRepository; + private readonly IRepoManualStatusRepository _repoManualStatusRepository; + private readonly IUnitOfWork _unitOfWork; + + public RepoAccountService( + IRepoAccountRepository repoAccountRepository, + IRepoStatusChangeRepository repoStatusChangeRepository, + IRepoManualStatusRepository repoManualStatusRepository, + IUnitOfWork unitOfWork) + { + _repoAccountRepository = repoAccountRepository; + _repoStatusChangeRepository = repoStatusChangeRepository; + _repoManualStatusRepository = repoManualStatusRepository; + _unitOfWork = unitOfWork; + } + + public async Task> ListAll(PageFilter pageFilter, RepoAccountPostFilter repoAccountFilter) + { + try + { + return await _repoAccountRepository.ListAsync( + repoAccountFilter != null ? repoAccountFilter.RepoIdList : new List(), + pageFilter.Page, + pageFilter.Limit, + repoAccountFilter?.Status, + repoAccountFilter?.AuctionHouseId, + repoAccountFilter?.RepoCompanyId, + repoAccountFilter?.OnlyOpenAccounts); + } + catch (Exception ex) + { + Log.Error(ex, "Failure retrieving RepoAccounts"); + throw new ServerErrorException(); + } + } + + public async Task FindByAuctionAssignmentId(int auctionAssignmentId) + { + try + { + return await _repoAccountRepository.FindByAuctionAssignmentIdAsync(auctionAssignmentId); + } + catch (Exception ex) + { + Log.Error(ex, "Failure retrieving RepoAccount"); + throw new ServerErrorException(); + } + } + + public async Task SaveAsync(RepoAccount repoAccount) + { + try + { + var newAccount = await _repoAccountRepository.AddAsync(repoAccount); + RepoStatusChange change = new RepoStatusChange() + { + RepoId = newAccount.RepoId, + ChangedBy = "System", + StatusFrom = "None", + StatusTo = repoAccount.Status, + ChangedDate = DateTime.Now + }; + await _repoStatusChangeRepository.AddAsync(change); + await _unitOfWork.CompleteAsync(); + + return repoAccount; + } + catch (Exception ex) + { + Log.Error(ex, $"Failure saving Repo Account: {repoAccount}", repoAccount); + throw new ServerErrorException(); + } + } + + public async Task Get(int id) + { + RepoAccount repoAccount; + try + { + repoAccount = await _repoAccountRepository.FindByIdAsync(id); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure retrieving Repo Account with id: {id}"); + throw new ServerErrorException(); + } + + if (repoAccount == null) + { + throw new NotFoundException($" Repo Accounts with id {id} not found."); + } + + return repoAccount; + } + + public async Task> GetByAccountNo(string accountNo) + { + IReadOnlyCollection repoAccounts; + try + { + repoAccounts = await _repoAccountRepository.FindByAccountNoAsync(accountNo); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure retrieving Repo Account by accountNo with accountNo: {accountNo}"); + throw new ServerErrorException(); + } + + if (repoAccounts == null || !repoAccounts.Any()) + { + throw new NotFoundException($" Repo Accounts with id {accountNo} not found."); + } + + return repoAccounts; + } + + public async Task UpdateAsync(RepoAccount repoAccount, AppUser currentUser) + { + var existingRepoAccount = await _repoAccountRepository.FindByIdAsync(repoAccount.RepoId); + + if (existingRepoAccount == null) + { + throw new NotFoundException($"Repo Account with repoId {repoAccount.RepoId} not found."); + } + + var originalStatus = existingRepoAccount.Status; + + existingRepoAccount.AccountLastProcessed = repoAccount.AccountLastProcessed; + existingRepoAccount.AccountNo = repoAccount.AccountNo; + existingRepoAccount.AccountTypeCode = repoAccount.AccountTypeCode; + existingRepoAccount.Balance = repoAccount.Balance; + existingRepoAccount.Bankruptcy = repoAccount.Bankruptcy; + existingRepoAccount.Borrowers = repoAccount.Borrowers; + existingRepoAccount.Branch = repoAccount.Branch; + // Only one field can change in collaterals when updating the account. + if (existingRepoAccount.Collaterals != null) + { + foreach (var collateral in existingRepoAccount.Collaterals) + { + var newCollateral = + repoAccount.Collaterals.FirstOrDefault(x => x.CollateralId == collateral.CollateralId); + if (newCollateral != null) + { + collateral.RetitledInLandmarkName = newCollateral.RetitledInLandmarkName; + } + } + } + + // existingRepoAccount.Collaterals = repoAccount.Collaterals; This will fail, save separately. + existingRepoAccount.Collector = repoAccount.Collector; + existingRepoAccount.CurrentDelinquentAmount = repoAccount.CurrentDelinquentAmount; + existingRepoAccount.DateClosed = repoAccount.DateClosed; + existingRepoAccount.DateFirstDelinquent = repoAccount.DateFirstDelinquent; + existingRepoAccount.DateFirstIntellect = repoAccount.DateFirstIntellect; + existingRepoAccount.DaysDelinquent = repoAccount.DaysDelinquent; + existingRepoAccount.DelinquentAmount = repoAccount.DelinquentAmount; + existingRepoAccount.DueToPayDate = repoAccount.DueToPayDate; + existingRepoAccount.LastPaymentDate = repoAccount.LastPaymentDate; + existingRepoAccount.LoanNo = repoAccount.LoanNo; + existingRepoAccount.LstPmtAmt = repoAccount.LstPmtAmt; + existingRepoAccount.ManualRedemptionDate = repoAccount.ManualRedemptionDate; + existingRepoAccount.MemberNo = repoAccount.MemberNo; + existingRepoAccount.O4RDate = repoAccount.O4RDate; + existingRepoAccount.OrigAmount = repoAccount.OrigAmount; + existingRepoAccount.OrigAccountTypeCode = repoAccount.OrigAccountTypeCode; + existingRepoAccount.PaidSkipAmount = repoAccount.PaidSkipAmount; + existingRepoAccount.PrimaryIndividualId = repoAccount.PrimaryIndividualId; + existingRepoAccount.RedemptionExpiredDate = repoAccount.RedemptionExpiredDate; + existingRepoAccount.RefundStatus = repoAccount.RefundStatus; + existingRepoAccount.RequiredPaymentAmount = repoAccount.RequiredPaymentAmount; + existingRepoAccount.ReferenceId = repoAccount.ReferenceId; + existingRepoAccount.ReferenceCaseId = repoAccount.ReferenceCaseId; + existingRepoAccount.ReferenceStatus = repoAccount.ReferenceStatus; + existingRepoAccount.Status = repoAccount.Status; + existingRepoAccount.SubStatus = repoAccount.SubStatus; + existingRepoAccount.WrittenOffDate = repoAccount.WrittenOffDate; + existingRepoAccount.SixtyPlusCollectorId = repoAccount.SixtyPlusCollectorId; + + try + { + _repoAccountRepository.Update(existingRepoAccount); + if (originalStatus != repoAccount.Status) + { + var change = new RepoStatusChange() + { + RepoId = repoAccount.RepoId, + ChangedBy = currentUser.FirstName + " " + currentUser.LastName, + StatusFrom = originalStatus, + StatusTo = repoAccount.Status, + ChangedDate = DateTime.Now + }; + await _repoStatusChangeRepository.AddAsync(change); + } + await _unitOfWork.CompleteAsync(); + return await _repoAccountRepository.FindByIdAsync(repoAccount.RepoId); + } + catch (SqlException ex) + { + Log.Error(ex, $"SQL Failure updating Repo Account: {repoAccount}", repoAccount); + throw new ServerErrorException(); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure updating Repo Account: {repoAccount}", repoAccount); + throw new ServerErrorException(); + } + } + + public async Task DeleteAsync(int id) + { + RepoAccount existingRepoAccount; + try + { + existingRepoAccount = await _repoAccountRepository.FindByIdAsync(id); + } + catch(Exception ex) + { + Log.Error(ex, $"Error finding an existing repo to delete with account ID: {id}"); + throw new ServerErrorException(); + } + + if (existingRepoAccount == null) + { + throw new NotFoundException($" Repo Account with id {id} not found."); + } + + try + { + _repoAccountRepository.Remove(existingRepoAccount); + await _unitOfWork.CompleteAsync(); + return existingRepoAccount; + } + catch (SqlException ex) + { + Log.Error(ex, $"SQL Failure deleting Repo Account with id: {id}", id); + throw new ServerErrorException(); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure deleting Repo Account with id: {id}", id); + throw new ServerErrorException(); + } + } + + public async Task> GetItemsForProcessing() + { + try + { + var watchStatus = await _repoManualStatusRepository.ListWatchStatusesAsync(); + var repoAccountNos = await _repoAccountRepository.GetItemsForProcessing(watchStatus); + return repoAccountNos; + } + catch (Exception ex) + { + Log.Error(ex, "Failure getting Repo Account Nos for polling"); + throw new ServerErrorException(); + } + } + + public async Task> SearchRepoAccounts(string searchPhrase, int maxAllowedResults) + { + try + { + var matchedRepoAccounts = await _repoAccountRepository.SearchRepoAccounts(searchPhrase, maxAllowedResults); + return matchedRepoAccounts; + } + catch (MaxItemException ex) + { + Log.Error(ex, $"Search Phrase Returned More Items Than Max (${maxAllowedResults}) searchPhrase:{searchPhrase}", searchPhrase); + throw new MaxItemException(ex.ItemCount); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure Searching For Repo Accounts searchPhrase: {searchPhrase}", searchPhrase); + throw new ServerErrorException(); + } + } + + public async Task GetNewestOpenAccount(string accountNo) + { + IReadOnlyCollection repoAccounts; + try + { + repoAccounts = await _repoAccountRepository.FindByAccountNoAsync(accountNo); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure retrieving Repo Account by accountNo with accountNo: {accountNo}"); + throw new ServerErrorException(); + } + + if (repoAccounts == null || !repoAccounts.Any()) + { + // You can't throw here, it's not an exception case, there simply isn't an account. (404) + Log.Debug($" Repo Accounts with id {accountNo} not found."); + return null; + } + + return SelectFirstOpenAccount(repoAccounts); + } + + /** + * Attempts to select the repo account that should be updated. Since we have to go by AccountNo and there + * may be more than one. Try to return an open account, and log if it detects more than one. + */ + public RepoAccount SelectFirstOpenAccount(IReadOnlyCollection repoAccounts) + { + if (repoAccounts.Count == 1) + { + return repoAccounts.First(); + } + + RepoAccount openAccount = null; + foreach (var repoAccount in repoAccounts.OrderBy(x => x.RepoId)) + { + if (repoAccount.DateClosed == null) + { + if (openAccount != null) + { + Log.Fatal($"Multiple -OPEN- Repos with AccountNo: {openAccount.AccountNo}, {openAccount.RepoId} / {repoAccount.RepoId}"); + return openAccount; + } + openAccount = repoAccount; + } + } + + if (openAccount != null) + { + return openAccount; + } + + return repoAccounts.OrderByDescending(x => x.DateClosed).ToList().FirstOrDefault(); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/RepoCompanySelectionService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/RepoCompanySelectionService.cs new file mode 100644 index 0000000..82ffd58 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/RepoCompanySelectionService.cs @@ -0,0 +1,65 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Exceptions; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using Serilog; + +namespace LCU.API.Collections.RepoApi.Services +{ + public class RepoCompanySelectionService : IRepoCompanySelectionService + { + private readonly IRepoCompanySelectionRepository _repoCompanySelectionRepository; + private readonly IUnitOfWork _unitOfWork; + + public RepoCompanySelectionService( + IRepoCompanySelectionRepository repoCompanySelectionRepository, + IUnitOfWork unitOfWork) + { + _repoCompanySelectionRepository = repoCompanySelectionRepository; + _unitOfWork = unitOfWork; + } + + public async Task> ListAllAsync() + { + try + { + return await _repoCompanySelectionRepository.ListAllAsync(); + } + catch (Exception ex) + { + Log.Error(ex, "Failure retrieving Repo Companies"); + throw new ServerErrorException(); + } + } + + public async Task GetAsync(int id) + { + RepoCompanySelection repoCompanySelection; + try + { + repoCompanySelection = await _repoCompanySelectionRepository.FindByIdAsync(id); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure retrieving Repo Company Selection with id: {id}"); + throw new NotFoundException($"Repo Company Selection with id {id} not found"); + } + + if (repoCompanySelection == null) + { + throw new NotFoundException($"Repo Company Selection with id {id} not found"); + } + + return repoCompanySelection; + } + + public async Task SaveChangesAsync(IList repoCompanySelections) + { + _repoCompanySelectionRepository.SaveRange(repoCompanySelections); + await _unitOfWork.CompleteAsync(); + } + + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/RepoCompanyService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/RepoCompanyService.cs new file mode 100644 index 0000000..6fe667e --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/RepoCompanyService.cs @@ -0,0 +1,158 @@ +using System; +using System.Collections.Generic; +using System.Data.SqlClient; +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Exceptions; +using LCU.API.Collections.RepoApi.Models; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using Serilog; + +namespace LCU.API.Collections.RepoApi.Services +{ + public class RepoCompanyService : IRepoCompanyService + { + private IRepoCompanyRepository _repoCompanyRepository; + private IUnitOfWork _unitOfWork; + + public RepoCompanyService( + IRepoCompanyRepository repoCompanyRepository, + IUnitOfWork unitOfWork) + { + _repoCompanyRepository = repoCompanyRepository; + _unitOfWork = unitOfWork; + } + + public async Task> ListAll() + { + try + { + return await _repoCompanyRepository.ListAsync(); + } + catch (Exception ex) + { + Log.Error(ex, "Failure retrieving Repo Companies"); + throw new ServerErrorException(); + } + } + + public async Task Get(int id) + { + RepoCompany repoCompany; + try + { + repoCompany = await _repoCompanyRepository.FindByIdAsync(id); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure retrieving Repo Company with id: {id}"); + throw new NotFoundException($"Repo Company with id {id} not found"); + } + + if (repoCompany == null) + { + throw new NotFoundException($"Repo Company with id {id} not found"); + } + + return repoCompany; + } + + + public async Task Update(RepoCompany repoCompany, AppUser user) + { + var existing = await _repoCompanyRepository.FindByIdAsync(repoCompany.ID); + + if (existing == null) + { + throw new NotFoundException($"Repo Company with id {repoCompany.ID} not found"); + } + + existing.Name = repoCompany.Name; + existing.Email = repoCompany.Email; + existing.Address_Line_1 = repoCompany.Address_Line_1; + existing.Address_Line_2 = repoCompany.Address_Line_2; + existing.City = repoCompany.City; + existing.State = repoCompany.State; + existing.ZIP = repoCompany.ZIP; + existing.Country = repoCompany.Country; + existing.Phone = repoCompany.Phone; + existing.Fax = repoCompany.Fax; + existing.ReferenceId = repoCompany.ReferenceId; + + if (existing.DisabledDate != repoCompany.DisabledDate) + { + if (repoCompany.DisabledDate == null) + { + existing.DisabledDate = null; + existing.DisabledBy = null; + } else + { + existing.DisabledDate = repoCompany.DisabledDate; + existing.DisabledBy = user.FirstName + " " + user.LastName; + } + + } + + try + { + _repoCompanyRepository.Update(existing); + await _unitOfWork.CompleteAsync(); + return existing; + } + catch (SqlException ex) + { + Log.Error(ex, $"SQL Filure updating Repo Company: {repoCompany}", repoCompany); + throw new ServerErrorException(); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure updating Repo Repo Company: {repoCompany}", repoCompany); + throw new ServerErrorException(); + } + } + + public async Task Save(RepoCompany repoCompany) + { + try + { + var newCompany = await _repoCompanyRepository.AddAsync(repoCompany); + await _unitOfWork.CompleteAsync(); + return newCompany; + } + catch (Exception ex) + { + Log.Error(ex, $"Failure saving Repo Company: {repoCompany}", repoCompany); + throw new ServerErrorException(); + } + } + + + public async Task Delete(int id) + { + var existingRepoCompany = await _repoCompanyRepository.FindByIdAsync(id); + + if (existingRepoCompany == null) + { + throw new NotFoundException($" Repo Company with id {id} not found."); + } + + try + { + _repoCompanyRepository.Remove(existingRepoCompany); + await _unitOfWork.CompleteAsync(); + return existingRepoCompany; + } + catch (SqlException ex) + { + Log.Error(ex, $"SQL Failure deleting Repo Company with id: {id}"); + throw new ServerErrorException(); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure deleting Repo Company with id: {id}"); + throw new ServerErrorException(); + } + } + + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/RepoLetterService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/RepoLetterService.cs new file mode 100644 index 0000000..8365711 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/RepoLetterService.cs @@ -0,0 +1,92 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using LCU.API.Collections.CollectionsApiLib.Models; +using LCU.API.Collections.RepoApi.DataAccess; +using LCU.API.Collections.RepoApi.Exceptions; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using Serilog; + +namespace LCU.API.Collections.RepoApi.Services +{ + public class RepoLetterService : IRepoLetterService + { + private readonly ILetterRepository _letterRepository; + private readonly ICollectionsDao _collectionsDao; + + public RepoLetterService(ILetterRepository letterRepository, + ICollectionsDao collectionsDao) + { + _letterRepository = letterRepository; + _collectionsDao = collectionsDao; + } + + public async Task> ListByAccountIdAsync(int accountId) + { + try + { + var collectionsHistory = await _collectionsDao.RetrieveHistoryAsync(accountId); + var collectionsLetters = + collectionsHistory.Where(history => history.Type == HistoryType.Letter).ToList(); + + if (!collectionsLetters.Any()) + { + return new List(); + } + + var letters = await _letterRepository.ListAsync(); + return ProcessLetters(collectionsLetters, letters.ToList()); + } + catch (MissingRequirementException ex) + { + throw; + } + catch (Exception ex) + { + Log.Error(ex, "Failure retrieving Letter List"); + throw new ServerErrorException(); + } + } + + public static IReadOnlyCollection ProcessLetters(List collectionsLetters, + List letters) + { + // GJF: Are you here to fix a bug? Probably. These don't match up, who wrote this?!?! This code is fueled by hope. + // Ok, so you really need to fix it. Go out to Temenos, go to System Management (the button is labelled 'tools'!) + // Find the Communication section, expand it and choose 'letters & forms'. Now find the right Letter and + // update the LetterDescription column in the Letters table of RepoDb for the correct letter. + var resultList = new List(); + foreach (var letter in letters) + { + foreach (var collectionsLetter in collectionsLetters) + { + if (string.IsNullOrWhiteSpace(letter.LetterDescription)) + { + // If this exception is happening, see LetterUpdate.sql. Also See Above. + throw new MissingRequirementException("LetterDescription", "Letter table requires LetterDescription Column entry."); + } + + if (collectionsLetter.Message.Trim().ToUpper() + .Contains(letter.LetterDescription.Trim().ToUpper())) + { + resultList.Add(new RepoLetter + { + NoticeType = collectionsLetter.Message, + DateSent = collectionsLetter.Created, + DateExpired = collectionsLetter.Created.AddDays(letter.DaysToWait ?? 0), + DaysToRedeem = letter.DaysToWait ?? 0, + ActionCode = letter.ActionCode.Trim() + }); + } + } + } + + return resultList + .GroupBy(x => x.NoticeType.Trim(), + (key, g) => g.OrderByDescending(x => x.DateSent).FirstOrDefault()) + .OrderByDescending(x => x.DateSent).ToList(); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/RepoStatusChangeService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/RepoStatusChangeService.cs new file mode 100644 index 0000000..649972c --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/RepoStatusChangeService.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Exceptions; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using Serilog; + +namespace LCU.API.Collections.RepoApi.Services +{ + public class RepoStatusChangeService : IRepoStatusChangeService + { + private readonly IRepoStatusChangeRepository _repoStatusChangeRepository; + + public RepoStatusChangeService( + IRepoStatusChangeRepository repoStatusChangeRepository) + { + _repoStatusChangeRepository = repoStatusChangeRepository; + } + + public async Task> ListByAccount(int repoId) + { + try + { + return await _repoStatusChangeRepository.ListForAccountAsync(repoId); + } + catch (Exception ex) + { + Log.Error(ex, "Failure retrieving Repo Account Status Change List"); + throw new ServerErrorException(); + } + } + + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/Reporting/AuctionReportingService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/Reporting/AuctionReportingService.cs new file mode 100644 index 0000000..738fae5 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/Reporting/AuctionReportingService.cs @@ -0,0 +1,282 @@ +using System; +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Exceptions; +using LCU.API.Collections.RepoApi.Factories; +using LCU.Shared.Collections.RepoApiLib.Formatting; +using LCU.Shared.Collections.RepoApiLib.Models.Reporting.Responses; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using Serilog; + +namespace LCU.API.Collections.RepoApi.Services.Reporting +{ + public class AuctionReportingService : IAuctionReportingService + { + private readonly IReportingRepository _reportingRepository; + + public AuctionReportingService(IReportingRepository reportingRepository) + { + _reportingRepository = reportingRepository; + } + + public async Task GetAssignedBalance(DateTime lowDateTime, DateTime highDateTime) + { + try + { + var reportData = await _reportingRepository.GetAccountsByDateRepoed(lowDateTime, highDateTime); + + return new ReportTableResponse() + { + ReportTable = ReportTableFactory.CreateHistoricalSummationTable( + ReportSumType.Currency, + reportData, + "Auctions", + lowDateTime, + highDateTime, + (reportEntry) => reportEntry.Balance, + (reportEntry) => reportEntry.AuctionName, + (reportEntry) => reportEntry.DateRepoed, + (reportEntry) => reportEntry.RepoId), + DataTable = DataTableFormatting.CreateDataTable( + reportData, + (entry) => entry.RepoId, + StdReportEntryColumns.AccountNo(), + StdReportEntryColumns.Balance(), + StdReportEntryColumns.Auction(), + StdReportEntryColumns.Collateral(), + StdReportEntryColumns.RepoCompany(), + StdReportEntryColumns.DateRepoed(), + StdReportEntryColumns.DateEnteredAutoIMS(), + StdReportEntryColumns.ScheduledSaleDate()) + }; + } + catch (Exception ex) + { + Log.Error(ex, "Failure retrieving Gross Active Balance Report"); + throw new ServerErrorException(); + } + } + + public async Task GetAssignedCollateralCount(DateTime lowDateTime, DateTime highDateTime) + { + try + { + var reportData = await _reportingRepository.GetAccountsByDateRepoed(lowDateTime, highDateTime); + + return new ReportTableResponse() + { + ReportTable = ReportTableFactory.CreateHistoricalSummationTable( + ReportSumType.WholeNumber, + reportData, + "Auctions", + lowDateTime, + highDateTime, + (reportEntry) => 1, + (reportEntry) => reportEntry.AuctionName, + (reportEntry) => reportEntry.DateRepoed, + (reportEntry) => reportEntry.RepoId), + DataTable = DataTableFormatting.CreateDataTable( + reportData, + (entry) => entry.RepoId, + StdReportEntryColumns.Member(), + StdReportEntryColumns.AccountNo(), + StdReportEntryColumns.Status(), + StdReportEntryColumns.DaysInStatus(), + StdReportEntryColumns.Balance(), + StdReportEntryColumns.AccountCode(), + StdReportEntryColumns.Bankruptcy(), + StdReportEntryColumns.Collateral(), + StdReportEntryColumns.DateRepoed(), + StdReportEntryColumns.Grade(), + StdReportEntryColumns.FloorPrice(), + StdReportEntryColumns.Auction()) + }; + } + catch (Exception ex) + { + Log.Error(ex, "Failure retrieving Active Inventory Report"); + throw new ServerErrorException(); + } + } + + public async Task GetSalePriceReport(DateTime lowDateTime, DateTime highDateTime) + { + try + { + var reportData = await _reportingRepository.GetAccountsByDateSoldInAutoIMS(lowDateTime, highDateTime); + + return new ReportTableResponse() + { + ReportTable = ReportTableFactory.CreateHistoricalSummationTable( + ReportSumType.Currency, + reportData, + "Auctions", + lowDateTime, + highDateTime, + (reportEntry) => reportEntry.GrossSalePrice, + (reportEntry) => reportEntry.AuctionName, + (reportEntry) => reportEntry.SoldDate, + (reportEntry) => reportEntry.RepoId, + false), + DataTable = DataTableFormatting.CreateDataTable( + reportData, + (entry) => entry.RepoId, + StdReportEntryColumns.Member(), + StdReportEntryColumns.AccountNo(), + StdReportEntryColumns.Status(), + StdReportEntryColumns.DaysInStatus(), + StdReportEntryColumns.Balance(), + StdReportEntryColumns.AccountCode(), + StdReportEntryColumns.Bankruptcy(), + StdReportEntryColumns.Collateral(), + StdReportEntryColumns.Grade(), + StdReportEntryColumns.FloorPrice(), + StdReportEntryColumns.Auction(), + StdReportEntryColumns.DateSold(), + StdReportEntryColumns.GrossSalePrice(), + StdReportEntryColumns.GrossPercentFloor(), + StdReportEntryColumns.NetPercentFloor(), + StdReportEntryColumns.TotalCharges()) + }; + } + catch (Exception ex) + { + Log.Error(ex, "Failture Retrieving Sold Price Report."); + throw new ServerErrorException(); + } + } + + public async Task GetAuctionFeeReport(DateTime lowDateTime, DateTime highDateTime) + { + try + { + var reportData = await _reportingRepository.GetAccountsByDateSoldInAutoIMS(lowDateTime, highDateTime); + + return new ReportTableResponse() + { + ReportTable = ReportTableFactory.CreateHistoricalSummationTable( + ReportSumType.Currency, + reportData, + "Auctions", + lowDateTime, + highDateTime, + (reportEntry) => reportEntry.TotalCharges, + (reportEntry) => reportEntry.AuctionName, + (reportEntry) => reportEntry.SoldDate, + (reportEntry) => reportEntry.RepoId, + false), + DataTable = DataTableFormatting.CreateDataTable( + reportData, + (entry) => entry.RepoId, + StdReportEntryColumns.Member(), + StdReportEntryColumns.AccountNo(), + StdReportEntryColumns.Status(), + StdReportEntryColumns.DaysInStatus(), + StdReportEntryColumns.Balance(), + StdReportEntryColumns.AccountCode(), + StdReportEntryColumns.Bankruptcy(), + StdReportEntryColumns.Collateral(), + StdReportEntryColumns.Auction(), + StdReportEntryColumns.DateSold(), + StdReportEntryColumns.TotalCharges()) + }; + } + catch (Exception ex) + { + Log.Error(ex, "Failture Retrieving Auction Fee Report."); + throw new ServerErrorException(); + } + } + + public async Task GetAvgDaysAssignedToSold(DateTime lowDateTime, DateTime highDateTime) + { + try + { + var reportData = await _reportingRepository.GetAccountsByDateSoldInAutoIMS(lowDateTime, highDateTime); + + return new ReportTableResponse() + { + ReportTable = ReportTableFactory.CreateHistoricalSummationTable( + ReportSumType.WholeNumberAvg, + reportData, + "Auctions", + lowDateTime, + highDateTime, + (reportEntry) => + { + if (reportEntry.SoldDate != null && reportEntry.DateEnteredAutoIMS != null) + { + return (decimal) (reportEntry.SoldDate.Value - reportEntry.DateEnteredAutoIMS.Value).TotalDays; + } + return null; + }, + (reportEntry) => reportEntry.AuctionName, + (reportEntry) => reportEntry.SoldDate, + (reportEntry) => reportEntry.RepoId, + false), + DataTable = DataTableFormatting.CreateDataTable( + reportData, + (entry) => entry.RepoId, + StdReportEntryColumns.Member(), + StdReportEntryColumns.AccountNo(), + StdReportEntryColumns.Status(), + StdReportEntryColumns.DaysInStatus(), + StdReportEntryColumns.Balance(), + StdReportEntryColumns.AccountCode(), + StdReportEntryColumns.Bankruptcy(), + StdReportEntryColumns.Collateral(), + StdReportEntryColumns.Auction(), + StdReportEntryColumns.DateEnteredAutoIMS("Date Assigned"), + StdReportEntryColumns.DateSold(), + StdReportEntryColumns.AutoIMSAssignmentToSold("Days Assigned to Sold")) + }; + } + catch (Exception ex) + { + Log.Error(ex, "Failture Retrieving Avg. Days Assigned to Sold Report."); + throw new ServerErrorException(); + } + } + + public async Task GetAvgNetOfFloor(DateTime lowDateTime, DateTime highDateTime) + { + try + { + var reportData = await _reportingRepository.GetAccountsByDateSoldInAutoIMS(lowDateTime, highDateTime); + + return new ReportTableResponse() + { + ReportTable = ReportTableFactory.CreateHistoricalSummationTable( + ReportSumType.PercentageAvg, + reportData, + "Auctions", + lowDateTime, + highDateTime, + (reportEntry) => reportEntry.NetPercentFloor, + (reportEntry) => reportEntry.AuctionName, + (reportEntry) => reportEntry.SoldDate, + (reportEntry) => reportEntry.RepoId, + false), + DataTable = DataTableFormatting.CreateDataTable( + reportData, + (entry) => entry.RepoId, + StdReportEntryColumns.Member(), + StdReportEntryColumns.AccountNo(), + StdReportEntryColumns.Status(), + StdReportEntryColumns.DaysInStatus(), + StdReportEntryColumns.Balance(), + StdReportEntryColumns.AccountCode(), + StdReportEntryColumns.Bankruptcy(), + StdReportEntryColumns.Collateral(), + StdReportEntryColumns.Auction(), + StdReportEntryColumns.NetPercentFloor(), + StdReportEntryColumns.DateSold()) + }; + } + catch (Exception ex) + { + Log.Error(ex, "Failture Retrieving Avg. Days Assigned to Sold Report."); + throw new ServerErrorException(); + } + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/Reporting/IAuctionReportingService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/Reporting/IAuctionReportingService.cs new file mode 100644 index 0000000..854d6ac --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/Reporting/IAuctionReportingService.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models.Reporting.Responses; + +namespace LCU.API.Collections.RepoApi.Services.Reporting +{ + public interface IAuctionReportingService + { + Task GetAssignedBalance(DateTime lowDateTime, DateTime highDateTime); + Task GetAssignedCollateralCount(DateTime lowDateTime, DateTime highDateTime); + Task GetSalePriceReport(DateTime lowDateTime, DateTime highDateTime); + Task GetAuctionFeeReport(DateTime lowDateTime, DateTime highDateTime); + Task GetAvgDaysAssignedToSold(DateTime lowDateTime, DateTime highDateTime); + Task GetAvgNetOfFloor(DateTime lowDateTime, DateTime highDateTime); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/Reporting/ILandmarkReportingService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/Reporting/ILandmarkReportingService.cs new file mode 100644 index 0000000..19559d0 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/Reporting/ILandmarkReportingService.cs @@ -0,0 +1,19 @@ +using System; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models.Reporting.Responses; + +namespace LCU.API.Collections.RepoApi.Services.Reporting +{ + public interface ILandmarkReportingService + { + Task GetIsActiveAccountReport(DateTime reportingRequestLowDate, DateTime reportingRequestHighDate); + Task GetIsClosedAccountReport(DateTime lowDateTime, DateTime highDateTime); + Task GetAvgDaysRepoToSoldReport(DateTime lowDateTime, DateTime highDateTime); + Task GetRedemptionCountReport(DateTime lowDateTime, DateTime highDateTime); + Task GetAvgDaysDelqWhenAddedReport(DateTime lowDateTime, DateTime highDateTime); + Task GetCountOfSalesReport(DateTime lowDateTime, DateTime highDateTime); + Task GetAvgSurplusReport(DateTime lowDateTime, DateTime highDateTime); + Task GetRepoBalanceReport(DateTime lowDateTime, DateTime highDateTime); + Task GetRedemptionBalanceReport(DateTime lowDateTime, DateTime highDateTime); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/Reporting/IRepoCompanyReportingService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/Reporting/IRepoCompanyReportingService.cs new file mode 100644 index 0000000..e734236 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/Reporting/IRepoCompanyReportingService.cs @@ -0,0 +1,14 @@ +using System; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models.Reporting.Responses; + +namespace LCU.API.Collections.RepoApi.Services.Reporting +{ + public interface IRepoCompanyReportingService + { + Task GetAssignmentCountReport(DateTime lowDateTime, DateTime highDateTime); + Task GetRepoedCountReport(DateTime lowDateTime, DateTime highDateTime); + Task GetAvgDaysAssignedToRepoed(DateTime lowDateTime, DateTime highDateTime); + Task GetAssignedBalance(DateTime lowDateTime, DateTime highDateTime); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/Reporting/LandmarkReportingService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/Reporting/LandmarkReportingService.cs new file mode 100644 index 0000000..e5518cc --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/Reporting/LandmarkReportingService.cs @@ -0,0 +1,474 @@ +using System; +using System.Linq; +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Exceptions; +using LCU.API.Collections.RepoApi.Factories; +using LCU.Shared.Collections.RepoApiLib.Formatting; +using LCU.Shared.Collections.RepoApiLib.Models.Reporting.Responses; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using Serilog; + +namespace LCU.API.Collections.RepoApi.Services.Reporting +{ + public class LandmarkReportingService : ILandmarkReportingService + { + private readonly IReportingRepository _reportingRepository; + private const string RedeemedStatus = "REDEEMED"; + + public LandmarkReportingService(IReportingRepository reportingRepository) + { + _reportingRepository = reportingRepository; + } + + public async Task GetIsActiveAccountReport(DateTime lowDateTime, DateTime highDateTime) + { + try + { + var reportData = await _reportingRepository.GetActiveAccounts(); + + return new ReportTableResponse() + { + DataTable = new DataTable() + { + Headers = new string[] + { + "Member Name", "Account No", "Status", "Days In Status", "Days Delinquent", "Last Payment Amount", "Last Payment Date", + "Delinquent Amount", "Repo Type", "Balance", "Account Code", "Bankruptcy", "Collector", "Year", "Make", "Model", + "Grade", "Floor Price", "Auction House", "Date Entered AutoIMS","Sold Date", "Gross % Floor", "Net % Floor", "Gross Sale Price", + "Total Charges", "Repo Company", "Date Assigned", "Date Repoed", "Scheduled Sale Date" + }, + Rows = reportData.Select(reportRow => new RepoAccountReferenceRow() + { + RepoId = reportRow.RepoId, + Cells = new ReportCell[] + { + ReportCellFormatting.CreateStringCell(reportRow.IndividualName), + ReportCellFormatting.CreateStringCell(reportRow.AccountNo), + ReportCellFormatting.CreateStringCell(reportRow.Status), + ReportCellFormatting.CreateIntCell(reportRow.DaysInStatus), + ReportCellFormatting.CreateIntCell(reportRow.DaysDelinquent), + ReportCellFormatting.CreateCurrencyCell(reportRow.LastPaymentAmount), + ReportCellFormatting.CreateDateCell(reportRow.LastPaymentDate), + ReportCellFormatting.CreateCurrencyCell(reportRow.DelinquentAmount), + ReportCellFormatting.CreateStringCell(reportRow.RepoType), + ReportCellFormatting.CreateCurrencyCell(reportRow.Balance), + ReportCellFormatting.CreateStringCell(reportRow.AccountTypeCode), + ReportCellFormatting.CreateStringCell(reportRow.Bankruptcy), + ReportCellFormatting.CreateStringCell(reportRow.Collector), + ReportCellFormatting.CreateIntCell(reportRow.Year), + ReportCellFormatting.CreateStringCell(reportRow.Make), + ReportCellFormatting.CreateStringCell(reportRow.Model), + ReportCellFormatting.CreateDecimalCell(reportRow.Grade), + ReportCellFormatting.CreateCurrencyCell(reportRow.FloorPrice), + ReportCellFormatting.CreateStringCell(reportRow.AuctionHouse), + ReportCellFormatting.CreateDateCell(reportRow.DateEnteredAutoIMS), + ReportCellFormatting.CreateDateCell(reportRow.SoldDate), + ReportCellFormatting.CreatePercentageCell(reportRow.GrossPercentFloor), + ReportCellFormatting.CreatePercentageCell(reportRow.NetPercentFloor), + ReportCellFormatting.CreateCurrencyCell(reportRow.GrossSalePrice), + ReportCellFormatting.CreateCurrencyCell(reportRow.TotalCharges), + ReportCellFormatting.CreateStringCell(reportRow.RepoCompany), + ReportCellFormatting.CreateDateCell(reportRow.DateAssigned), + ReportCellFormatting.CreateDateCell(reportRow.DateRepoed), + ReportCellFormatting.CreateDateCell(reportRow.ScheduledSaleDate) + } + }) + } + }; + } + catch (Exception ex) + { + Log.Error(ex, "Failure retrieving Is Active Account Report"); + throw new ServerErrorException(); + } + } + + public async Task GetIsClosedAccountReport(DateTime lowDateTime, DateTime highDateTime) + { + try + { + var reportData = await _reportingRepository.GetClosedAccounts(lowDateTime, highDateTime); + + return new ReportTableResponse() + { + DataTable = new DataTable() + { + Headers = new string[] + { + "Member Name", "Account No", "Date Closed", "Status", "Days In Status", "Days Delinquent", "Last Payment Amount", "Last Payment Date", + "Delinquent Amount", "Repo Type", "Balance", "Account Code", "Bankruptcy", "Collector", "Year", "Make", "Model", + "Grade", "Floor Price", "Auction House", "Date Entered AutoIMS","Sold Date", "Gross % Floor", "Net % Floor", "Gross Sale Price", + "Total Charges", "Repo Company", "Date Assigned", "Date Repoed", "Scheduled Sale Date" + }, + Rows = reportData.Select(reportRow => new RepoAccountReferenceRow() + { + RepoId = reportRow.RepoId, + Cells = new ReportCell[] + { + ReportCellFormatting.CreateStringCell(reportRow.IndividualName), + ReportCellFormatting.CreateStringCell(reportRow.AccountNo), + ReportCellFormatting.CreateDateCell(reportRow.DateClosed), + ReportCellFormatting.CreateStringCell(reportRow.Status), + ReportCellFormatting.CreateIntCell(reportRow.DaysInStatus), + ReportCellFormatting.CreateIntCell(reportRow.DaysDelinquent), + ReportCellFormatting.CreateCurrencyCell(reportRow.LastPaymentAmount), + ReportCellFormatting.CreateDateCell(reportRow.LastPaymentDate), + ReportCellFormatting.CreateCurrencyCell(reportRow.DelinquentAmount), + ReportCellFormatting.CreateStringCell(reportRow.RepoType), + ReportCellFormatting.CreateCurrencyCell(reportRow.Balance), + ReportCellFormatting.CreateStringCell(reportRow.AccountTypeCode), + ReportCellFormatting.CreateStringCell(reportRow.Bankruptcy), + ReportCellFormatting.CreateStringCell(reportRow.Collector), + ReportCellFormatting.CreateIntCell(reportRow.Year), + ReportCellFormatting.CreateStringCell(reportRow.Make), + ReportCellFormatting.CreateStringCell(reportRow.Model), + ReportCellFormatting.CreateDecimalCell(reportRow.Grade), + ReportCellFormatting.CreateCurrencyCell(reportRow.FloorPrice), + ReportCellFormatting.CreateStringCell(reportRow.AuctionHouse), + ReportCellFormatting.CreateDateCell(reportRow.DateEnteredAutoIMS), + ReportCellFormatting.CreateDateCell(reportRow.SoldDate), + ReportCellFormatting.CreatePercentageCell(reportRow.GrossPercentFloor), + ReportCellFormatting.CreatePercentageCell(reportRow.NetPercentFloor), + ReportCellFormatting.CreateCurrencyCell(reportRow.GrossSalePrice), + ReportCellFormatting.CreateCurrencyCell(reportRow.TotalCharges), + ReportCellFormatting.CreateStringCell(reportRow.RepoCompany), + ReportCellFormatting.CreateDateCell(reportRow.DateAssigned), + ReportCellFormatting.CreateDateCell(reportRow.DateRepoed), + ReportCellFormatting.CreateDateCell(reportRow.ScheduledSaleDate) + } + }) + } + }; + } + catch (Exception ex) + { + Log.Error(ex, "Failure retrieving Is Closed Account Report"); + throw new ServerErrorException(); + } + } + + public async Task GetAvgDaysRepoToSoldReport(DateTime lowDateTime, DateTime highDateTime) + { + try + { + var reportData = await _reportingRepository.GetAccountsByStatusChangeInPeriod("SOLD", lowDateTime, highDateTime); + + return new ReportTableResponse() + { + ReportTable = ReportTableFactory.CreateHistoricalSummationTable( + ReportSumType.WholeNumberAvg, + reportData, + "Sold Accounts", + lowDateTime, + highDateTime, + (reportEntry) => + { + if (reportEntry.FilteredStatusChangeDate != null && reportEntry.DateRepoed != null) + { + return (decimal)(reportEntry.FilteredStatusChangeDate.Value - reportEntry.DateRepoed.Value).TotalDays; + } + return null; + }, + (reportEntry) => null, + (reportEntry) => reportEntry.FilteredStatusChangeDate, + (reportEntry) => reportEntry.RepoId, + false), + DataTable = DataTableFormatting.CreateDataTable( + reportData, + (entry) => entry.RepoId, + StdReportEntryColumns.Member(), + StdReportEntryColumns.AccountNo(), + StdReportEntryColumns.Status(), + StdReportEntryColumns.DaysCurrentDelq(), + StdReportEntryColumns.DaysDelqWhenAdded(), + StdReportEntryColumns.LastPaymentAmount(), + StdReportEntryColumns.LastPaymentDate(), + StdReportEntryColumns.DelinquentAmount(), + StdReportEntryColumns.RepoType(), + StdReportEntryColumns.Balance(), + StdReportEntryColumns.AccountCode(), + StdReportEntryColumns.Bankruptcy(), + StdReportEntryColumns.Collector(), + StdReportEntryColumns.Collateral(), + StdReportEntryColumns.RepoCompany(), + StdReportEntryColumns.RepoDuration(), + StdReportEntryColumns.DateAssigned(), + StdReportEntryColumns.DateRepoed(), + StdReportEntryColumns.FilteredStatusChangeDate("Date Sold")) + }; + } + catch (Exception ex) + { + Log.Error(ex, "Failure retrieving Avg Days Repot to Sold Report"); + throw new ServerErrorException(); + } + } + + public async Task GetRedemptionCountReport(DateTime lowDateTime, DateTime highDateTime) + { + try + { + var reportData = await _reportingRepository.GetAccountsByStatusChangeInPeriod(RedeemedStatus, lowDateTime, highDateTime); + + return new ReportTableResponse() + { + ReportTable = ReportTableFactory.CreateHistoricalSummationTable( + ReportSumType.WholeNumber, + reportData, + "Redemptions", + lowDateTime, + highDateTime, + (reportEntry) => 1, + (reportEntry) => null, + (reportEntry) => reportEntry.FilteredStatusChangeDate, + (reportEntry) => $"{reportEntry.RepoId}_{reportEntry.FilteredStatusChangeDate}", + false), + DataTable = DataTableFormatting.CreateDataTable( + reportData, + (entity) => entity.RepoId, + StdReportEntryColumns.Member(), + StdReportEntryColumns.AccountNo(), + StdReportEntryColumns.Status(), + StdReportEntryColumns.DaysInStatus(), + StdReportEntryColumns.DaysCurrentDelq(), + StdReportEntryColumns.LastPaymentDate(), + StdReportEntryColumns.LastPaymentDate(), + StdReportEntryColumns.DelinquentAmount(), + StdReportEntryColumns.RepoType(), + StdReportEntryColumns.Balance(), + StdReportEntryColumns.AccountCode(), + StdReportEntryColumns.Bankruptcy(), + StdReportEntryColumns.Collector(), + StdReportEntryColumns.Collateral(), + StdReportEntryColumns.Grade(), + StdReportEntryColumns.FloorPrice(), + StdReportEntryColumns.Auction(), + StdReportEntryColumns.DateEnteredAutoIMS(), + StdReportEntryColumns.TotalCharges(), + StdReportEntryColumns.DateAssigned(), + StdReportEntryColumns.RepoDuration(), + StdReportEntryColumns.DateRepoed()) + }; + } + catch (Exception ex) + { + Log.Error(ex, "Failure retrieving Redemption Count Report"); + throw new ServerErrorException(); + } + } + + public async Task GetAvgDaysDelqWhenAddedReport(DateTime lowDateTime, DateTime highDateTime) + { + try + { + var reportData = await _reportingRepository.GetAccountsByO4RDate(lowDateTime, highDateTime); + + return new ReportTableResponse() + { + ReportTable = ReportTableFactory.CreateHistoricalSummationTable( + ReportSumType.WholeNumberAvg, + reportData, + "Accounts", + lowDateTime, + highDateTime, + (reportEntry) => reportEntry.DaysDelqWhenAdded, + (reportEntry) => null, + (reportEntry) => reportEntry.O4RDate, + (reportEntry) => reportEntry.RepoId, + false), + DataTable = DataTableFormatting.CreateDataTable( + reportData, + (reportRow) => reportRow.RepoId, + StdReportEntryColumns.Member(), + StdReportEntryColumns.AccountNo(), + StdReportEntryColumns.Status(), + StdReportEntryColumns.DaysCurrentDelq(), + StdReportEntryColumns.DaysDelqWhenAdded(), + StdReportEntryColumns.LastPaymentDate(), + StdReportEntryColumns.Balance(), + StdReportEntryColumns.AccountCode(), + StdReportEntryColumns.Bankruptcy(), + StdReportEntryColumns.Collector(), + StdReportEntryColumns.Collateral(), + StdReportEntryColumns.O4RDate()) + }; + } + catch (Exception ex) + { + Log.Error(ex, "Failure retrieving Avg Days Delq When Added Report"); + throw new ServerErrorException(); + } + } + + public async Task GetCountOfSalesReport(DateTime lowDateTime, DateTime highDateTime) + { + try + { + var reportData = await _reportingRepository.GetAccountsByStatusChangeInPeriod("SOLD", lowDateTime, highDateTime); + + return new ReportTableResponse() + { + ReportTable = ReportTableFactory.CreateHistoricalSummationTable( + ReportSumType.WholeNumber, + reportData, + "Sold Accounts", + lowDateTime, + highDateTime, + (reportEntry) => 1, + (reportEntry) => null, + (reportEntry) => reportEntry.FilteredStatusChangeDate, + (reportEntry) => reportEntry.RepoId, + false), + DataTable = DataTableFormatting.CreateDataTable( + reportData, + (entry) => entry.RepoId, + StdReportEntryColumns.Member(), + StdReportEntryColumns.AccountNo(), + StdReportEntryColumns.Status(), + StdReportEntryColumns.DaysInStatus(), + StdReportEntryColumns.Balance(), + StdReportEntryColumns.AccountCode(), + StdReportEntryColumns.Bankruptcy(), + StdReportEntryColumns.Collector(), + StdReportEntryColumns.Collateral(), + StdReportEntryColumns.Auction(), + StdReportEntryColumns.GrossSalePrice(), + StdReportEntryColumns.GrossPercentFloor(), + StdReportEntryColumns.NetPercentFloor(), + StdReportEntryColumns.TotalCharges(), + StdReportEntryColumns.FilteredStatusChangeDate("Date Sold")) + }; + } + catch (Exception ex) + { + Log.Error(ex, "Failure retrieving Avg Days Repot to Sold Report"); + throw new ServerErrorException(); + } + } + + public async Task GetAvgSurplusReport(DateTime lowDateTime, DateTime highDateTime) + { + try + { + var reportData = await _reportingRepository.GetAccountsByDateSoldInAutoIMS(lowDateTime, highDateTime); + + return new ReportTableResponse() + { + ReportTable = ReportTableFactory.CreateHistoricalSummationTable( + ReportSumType.CurrencyAvg, + reportData, + "Sold Accounts", + lowDateTime, + highDateTime, + (reportEntry) => reportEntry.GrossSalePrice - reportEntry.Balance, + (reportEntry) => reportEntry.AuctionName, + (reportEntry) => reportEntry.SoldDate, + (reportEntry) => reportEntry.RepoId, + false), + DataTable = DataTableFormatting.CreateDataTable( + reportData, + (reportRow) => reportRow.RepoId, + StdReportEntryColumns.Member(), + StdReportEntryColumns.AccountNo(), + StdReportEntryColumns.Status(), + StdReportEntryColumns.DaysInStatus(), + StdReportEntryColumns.GrossSalePrice(), + StdReportEntryColumns.Balance(), + StdReportEntryColumns.SurplusDeficiency(), + StdReportEntryColumns.AccountCode(), + StdReportEntryColumns.Bankruptcy(), + StdReportEntryColumns.Collector(), + StdReportEntryColumns.Collateral(), + StdReportEntryColumns.Auction(), + StdReportEntryColumns.DateSold()) + }; + } + catch (Exception ex) + { + Log.Error(ex, "Failure retrieving Avg Surplus or Defiency Report"); + throw new ServerErrorException(); + } + } + + public async Task GetRepoBalanceReport(DateTime lowDateTime, DateTime highDateTime) + { + try + { + var reportData = await _reportingRepository.GetAccountsByDateRepoed(lowDateTime, highDateTime); + + return new ReportTableResponse() + { + ReportTable = ReportTableFactory.CreateHistoricalSummationTable( + ReportSumType.Currency, + reportData, + "Companies", + lowDateTime, + highDateTime, + (reportEntry) => reportEntry.Balance, + (reportEntry) => reportEntry.RepoCompany, + (reportEntry) => reportEntry.DateRepoed, + (reportEntry) => reportEntry.RepoId), + DataTable = DataTableFormatting.CreateDataTable( + reportData, + (reportRow) => reportRow.RepoId, + StdReportEntryColumns.Member(), + StdReportEntryColumns.AccountNo(), + StdReportEntryColumns.Status(), + StdReportEntryColumns.DaysInStatus(), + StdReportEntryColumns.RepoType(), + StdReportEntryColumns.Balance(), + StdReportEntryColumns.AccountCode(), + StdReportEntryColumns.Bankruptcy(), + StdReportEntryColumns.Collector(), + StdReportEntryColumns.Collateral()) + }; + } + catch (Exception ex) + { + Log.Error(ex, "Failure retrieving Repo Balance Report"); + throw new ServerErrorException(); + } + } + + public async Task GetRedemptionBalanceReport(DateTime lowDateTime, DateTime highDateTime) + { + try + { + var reportData = await _reportingRepository.GetAccountsByStatusChangeInPeriod(RedeemedStatus, lowDateTime, highDateTime); + + return new ReportTableResponse() + { + ReportTable = ReportTableFactory.CreateHistoricalSummationTable( + ReportSumType.Currency, + reportData, + "Redeemed Accounts", + lowDateTime, + highDateTime, + (reportEntry) => reportEntry.Balance, + (reportEntry) => null, + (reportEntry) => reportEntry.FilteredStatusChangeDate, + (reportEntry) => reportEntry.RepoId, + false), + DataTable = DataTableFormatting.CreateDataTable( + reportData, + (reportRow) => reportRow.RepoId, + StdReportEntryColumns.Member(), + StdReportEntryColumns.AccountNo(), + StdReportEntryColumns.Status(), + StdReportEntryColumns.DaysInStatus(), + StdReportEntryColumns.Balance(), + StdReportEntryColumns.AccountCode(), + StdReportEntryColumns.Bankruptcy(), + StdReportEntryColumns.Collector(), + StdReportEntryColumns.Collateral(), + StdReportEntryColumns.FilteredStatusChangeDate("Redeemed On")) + }; + } + catch (Exception ex) + { + Log.Error(ex, "Failure retrieving Redemption Balance Report"); + throw new ServerErrorException(); + } + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/Reporting/RepoCompanyReportingService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/Reporting/RepoCompanyReportingService.cs new file mode 100644 index 0000000..0eea14b --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/Reporting/RepoCompanyReportingService.cs @@ -0,0 +1,188 @@ +using System; +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Exceptions; +using LCU.API.Collections.RepoApi.Factories; +using LCU.Shared.Collections.RepoApiLib.Formatting; +using LCU.Shared.Collections.RepoApiLib.Models.Reporting.Responses; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using Serilog; + +namespace LCU.API.Collections.RepoApi.Services.Reporting +{ + public class RepoCompanyReportingService : IRepoCompanyReportingService + { + private readonly IReportingRepository _reportingRepository; + + public RepoCompanyReportingService(IReportingRepository reportingRepository) + { + _reportingRepository = reportingRepository; + } + + public async Task GetAssignedBalance(DateTime lowDateTime, DateTime highDateTime) + { + try + { + var reportData = await _reportingRepository.GetAccountsByDateAssigned(lowDateTime, highDateTime); + + return new ReportTableResponse() + { + ReportTable = ReportTableFactory.CreateHistoricalSummationTable( + ReportSumType.Currency, + reportData, + "Repo Companies", + lowDateTime, + highDateTime, + (reportEntry) => reportEntry.Balance, + (reportEntry) => reportEntry.RepoCompany, + (reportEntry) => reportEntry.RepoCompanyAssignmentDate, + (reportEntry) => reportEntry.CollateralId), + DataTable = DataTableFormatting.CreateDataTable( + reportData, + (entry) => entry.RepoId, + StdReportEntryColumns.Member(), + StdReportEntryColumns.AccountNo(), + StdReportEntryColumns.Status(), + StdReportEntryColumns.DaysInStatus(), + StdReportEntryColumns.Balance(), + StdReportEntryColumns.AccountCode(), + StdReportEntryColumns.Bankruptcy(), + StdReportEntryColumns.Collateral(), + StdReportEntryColumns.RepoCompany(), + StdReportEntryColumns.DateAssigned()) + }; + } + catch (Exception ex) + { + Log.Error(ex, "Failure retrieving Repo Company Active Count Report"); + throw new ServerErrorException(); + } + } + + public async Task GetAssignmentCountReport(DateTime lowDateTime, DateTime highDateTime) + { + try + { + var reportData = await _reportingRepository.GetAccountsByDateAssigned(lowDateTime, highDateTime); + + return new ReportTableResponse() + { + ReportTable = ReportTableFactory.CreateHistoricalSummationTable( + ReportSumType.WholeNumber, + reportData, + "Repo Companies", + lowDateTime, + highDateTime, + (reportEntry) => 1, + (reportEntry) => reportEntry.RepoCompany, + (reportEntry) => reportEntry.RepoCompanyAssignmentDate, + (reportEntry) => reportEntry.CollateralId), + DataTable = DataTableFormatting.CreateDataTable( + reportData, + (entry) => entry.RepoId, + StdReportEntryColumns.Member(), + StdReportEntryColumns.AccountNo(), + StdReportEntryColumns.Status(), + StdReportEntryColumns.DaysInStatus(), + StdReportEntryColumns.RepoType(), + StdReportEntryColumns.Balance(), + StdReportEntryColumns.AccountCode(), + StdReportEntryColumns.Bankruptcy(), + StdReportEntryColumns.Collector(), + StdReportEntryColumns.Collateral(), + StdReportEntryColumns.RepoCompany(), + StdReportEntryColumns.DateAssigned()) + }; + } + catch (Exception ex) + { + Log.Error(ex, "Failure retrieving Repo Company Active Count Report"); + throw new ServerErrorException(); + } + } + + public async Task GetAvgDaysAssignedToRepoed(DateTime lowDateTime, DateTime highDateTime) + { + try + { + var reportData = await _reportingRepository.GetAccountsByDateRepoed(lowDateTime, highDateTime); + + return new ReportTableResponse() + { + ReportTable = ReportTableFactory.CreateHistoricalSummationTable( + ReportSumType.WholeNumberAvg, + reportData, + "Repo Companies", + lowDateTime, + highDateTime, + (reportEntry) => reportEntry.RepoDuration, + (reportEntry) => reportEntry.RepoCompany, + (reportEntry) => reportEntry.DateRepoed, + (reportEntry) => reportEntry.CollateralId, + false), + DataTable = DataTableFormatting.CreateDataTable( + reportData, + (reportRow) => reportRow.RepoId, + StdReportEntryColumns.Member(), + StdReportEntryColumns.AccountNo(), + StdReportEntryColumns.Status(), + StdReportEntryColumns.DaysInStatus(), + StdReportEntryColumns.RepoType(), + StdReportEntryColumns.Balance(), + StdReportEntryColumns.AccountCode(), + StdReportEntryColumns.Bankruptcy(), + StdReportEntryColumns.Collateral(), + StdReportEntryColumns.RepoCompany(), + StdReportEntryColumns.RepoDuration(), + StdReportEntryColumns.DateAssigned(), + StdReportEntryColumns.DateRepoed()) + }; + } + catch (Exception ex) + { + Log.Error(ex, "Failure retrieving Avg Days Assigned to Repoed Report"); + throw new ServerErrorException(); + } + } + + public async Task GetRepoedCountReport(DateTime lowDateTime, DateTime highDateTime) + { + try + { + var reportData = await _reportingRepository.GetAccountsByDateRepoed(lowDateTime, highDateTime); + + return new ReportTableResponse() + { + ReportTable = ReportTableFactory.CreateHistoricalSummationTable( + ReportSumType.WholeNumber, + reportData, + "Repo Companies", + lowDateTime, + highDateTime, + (reportEntry) => 1, + (reportEntry) => reportEntry.RepoCompany, + (reportEntry) => reportEntry.DateRepoed, + (reportEntry) => reportEntry.CollateralId), + DataTable = DataTableFormatting.CreateDataTable( + reportData, + (entry) => entry.RepoId, + StdReportEntryColumns.Member(), + StdReportEntryColumns.AccountNo(), + StdReportEntryColumns.Status(), + StdReportEntryColumns.DaysInStatus(), + StdReportEntryColumns.RepoType(), + StdReportEntryColumns.Balance(), + StdReportEntryColumns.AccountCode(), + StdReportEntryColumns.Bankruptcy(), + StdReportEntryColumns.Collateral(), + StdReportEntryColumns.RepoCompany(), + StdReportEntryColumns.RepoDuration()) + }; + } + catch (Exception ex) + { + Log.Error(ex, "Failure retrieving Repo Company Active Count Report"); + throw new ServerErrorException(); + } + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/SavedLocationService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/SavedLocationService.cs new file mode 100644 index 0000000..1b09d75 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/SavedLocationService.cs @@ -0,0 +1,140 @@ +using System; +using System.Collections.Generic; +using System.Data.SqlClient; +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Exceptions; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using Serilog; + +namespace LCU.API.Collections.RepoApi.Services +{ + public class SavedLocationService : ISavedLocationService + { + private ISavedLocationRepository _savedLocationRepository; + private IUnitOfWork _unitOfWork; + + public SavedLocationService( + ISavedLocationRepository savedLocationRepository, + IUnitOfWork unitOfWork) + { + _savedLocationRepository = savedLocationRepository; + _unitOfWork = unitOfWork; + } + + public async Task> ListAllAsync() + { + try + { + return await _savedLocationRepository.ListAsync(); + } + catch (Exception ex) + { + Log.Error(ex, "Failure retrieving Saved Locations"); + throw new ServerErrorException(); + } + } + + public async Task GetAsync(int id) + { + SavedLocation savedLocation; + try + { + savedLocation = await _savedLocationRepository.FindByIdAsync(id); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure retrieving Saved Location with id: {id}"); + throw new NotFoundException($"Saved Location with id {id} not found"); + } + + if (savedLocation == null) + { + throw new NotFoundException($"Saved Location with id {id} not found"); + } + + return savedLocation; + } + + public async Task SaveAsync(SavedLocation savedLocation) + { + try + { + var newSavedLocation = await _savedLocationRepository.AddAsync(savedLocation); + await _unitOfWork.CompleteAsync(); + return newSavedLocation; + } + catch (Exception ex) + { + Log.Error(ex, $"Failure saving Saved Location {savedLocation}", savedLocation); + throw new ServerErrorException(); + } + } + + public async Task UpdateAsync(SavedLocation savedLocation) + { + var existing = await _savedLocationRepository.FindByIdAsync(savedLocation.ID); + + if (existing == null) + { + throw new NotFoundException($"Saved Location with id {savedLocation.ID} not found"); + } + + existing.Name = savedLocation.Name; + existing.LocationType = savedLocation.LocationType; + existing.Address_Line_1 = savedLocation.Address_Line_1; + existing.Address_Line_2 = savedLocation.Address_Line_2; + existing.City = savedLocation.City; + existing.State = savedLocation.State; + existing.ZIP = savedLocation.ZIP; + existing.Country = savedLocation.Country; + existing.Phone = savedLocation.Phone; + existing.Fax = savedLocation.Fax; + + try + { + _savedLocationRepository.Update(existing); + await _unitOfWork.CompleteAsync(); + return existing; + } + catch (SqlException ex) + { + Log.Error(ex, $"SQL Filure updating Saved Location: {savedLocation}", savedLocation); + throw new ServerErrorException(); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure updating Saved Location {savedLocation}", savedLocation); + throw new ServerErrorException(); + } + } + + public async Task DeleteAsync(int id) + { + var existingSavedLocation = await _savedLocationRepository.FindByIdAsync(id); + + if (existingSavedLocation == null) + { + throw new NotFoundException($" Saved Location with id {id} not found."); + } + + try + { + _savedLocationRepository.Remove(existingSavedLocation); + await _unitOfWork.CompleteAsync(); + return existingSavedLocation; + } + catch (SqlException ex) + { + Log.Error(ex, $"SQL Failure deleting Saved Location with id: {id}"); + throw new ServerErrorException(); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure deleting Saved Location with id: {id}"); + throw new ServerErrorException(); + } + } + + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/SettingsService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/SettingsService.cs new file mode 100644 index 0000000..b2b6e98 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/SettingsService.cs @@ -0,0 +1,592 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models.Settings; +using LCU.Shared.Collections.RepoApiLib.Repositories.Settings; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using Serilog; +using LCU.API.Collections.RepoApi.Exceptions; +using System.Data.SqlClient; +using System.Linq; +using LCU.API.Collections.CollectionsApiLib.Models; +using Microsoft.Extensions.Caching.Memory; +using LCU.API.Collections.RepoApi.Configuration; +using LCU.API.Collections.RepoApi.DataAccess; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.API.Collections.RepoApi.Services +{ + public class SettingsService : ISettingsService + { + private readonly IAccountTypeRepository _accountTypeRepository; + private readonly IAllowedStatusChangeRepository _allowedStatusChangeRepository; + private readonly IBodyStyleRepository _bodyStyleRepository; + private readonly ICleaningLevelRepository _cleaningLevelRepository; + private readonly ICollateralTypeRepository _collateralTypeRepository; + private readonly ICollateralTypeToVehicleTypeRepository _collateralTypeToVehicleTypeRepository; + private readonly IHoldStatusRepository _holdStatusRepository; + private readonly ILoanCategoryRepository _loanCategoryRepository; + private readonly ILocationTypeRepository _locationTypeRepository; + private readonly IVehicleTypeRepository _vehicleTypeRepository; + private readonly IExternalUserRepository _externalUserRepository; + private readonly IRepoCompanyRepository _repoCompanyRepository; + private readonly IUnitOfWork _unitOfWork; + private readonly IMemoryCache _memoryCache; + private readonly ICollectionsDao _collectionsDao; + private readonly RepoApiConfiguration _config; + + public SettingsService( + IAccountTypeRepository accountTypeCodesRepository, + IAllowedStatusChangeRepository allowedStatusChangesRepository, + IBodyStyleRepository bodyStyleCodesRepository, + ICleaningLevelRepository cleaningLevelCodesRepository, + ICollateralTypeRepository collateralTypesRepository, + ICollateralTypeToVehicleTypeRepository collateralTypesToVehicleTypesRepository, + IHoldStatusRepository holdStatusCodesRepository, + ILoanCategoryRepository loanCategoriesRepository, + ILocationTypeRepository locationTypeCodesRepository, + IVehicleTypeRepository vehicleTypeCodesRepository, + IExternalUserRepository externalUserRepository, + IRepoCompanyRepository repoCompanyRepository, + IUnitOfWork unitOfWork, IMemoryCache memoryCache, + ICollectionsDao collectionsDao, + RepoApiConfiguration configuration) + { + _accountTypeRepository = accountTypeCodesRepository; + _allowedStatusChangeRepository = allowedStatusChangesRepository; + _bodyStyleRepository = bodyStyleCodesRepository; + _cleaningLevelRepository = cleaningLevelCodesRepository; + _collateralTypeRepository = collateralTypesRepository; + _collateralTypeToVehicleTypeRepository = collateralTypesToVehicleTypesRepository; + _holdStatusRepository = holdStatusCodesRepository; + _loanCategoryRepository = loanCategoriesRepository; + _locationTypeRepository = locationTypeCodesRepository; + _vehicleTypeRepository = vehicleTypeCodesRepository; + _externalUserRepository = externalUserRepository; + _repoCompanyRepository = repoCompanyRepository; + _unitOfWork = unitOfWork; + _memoryCache = memoryCache; + _collectionsDao = collectionsDao; + _config = configuration; + } + + public async Task GetCachedRepoSettingsAsync() + { + return await _memoryCache.GetOrCreateAsync("repoSettings", factory: (ICacheEntry entry) => + { + entry.AbsoluteExpiration = DateTime.Now.AddSeconds(_config.SettingsCacheExpirationSeconds); + return ListAllSettingsAsync(); + }); + } + + public async Task ListAllSettingsAsync() + { + try + { + var result = new Settings + { + AccountTypes = await _accountTypeRepository.ListAllAsync(), + AllowedStatusChanges = await _allowedStatusChangeRepository.ListAllAsync(), + BodyStyles = await _bodyStyleRepository.ListAllAsync(), + CleaningLevels = await _cleaningLevelRepository.ListAllAsync(), + CollateralTypes = await _collateralTypeRepository.ListAllAsync(), + CollateralTypesToVehicleTypes = await _collateralTypeToVehicleTypeRepository.ListAllAsync(), + HoldStatuses = await _holdStatusRepository.ListAllAsync(), + LoanCategories = await _loanCategoryRepository.ListAllAsync(), + LocationTypes = await _locationTypeRepository.ListAllAsync(), + VehicleTypes = await _vehicleTypeRepository.ListAllAsync(), + BranchSet = await _collectionsDao.RetrieveBranchSetAsync(), + ExternalUsers = await _externalUserRepository.ListAsync(), + RepoCompanies = await _repoCompanyRepository.ListAsync() as IReadOnlyCollection, + TransactionTypeCodes = _config.TransactionTypeCodes, + TransactionTypeCodeQueryPrefix = _config.TransactionTypeCodeQueryPrefix, + // Convert DateTime format to uppercase for React/Moment JS ToString use + TransactionHistoryParameterDateFormat = _config.TransactionHistoryParameterDateFormat.ToUpper(), + TransactionHistoryStartDateOffset = _config.TransactionHistoryStartDateOffset, + RepoTypeMap = GetRepoTypes() + }; + + return result; + } + catch (Exception ex) + { + Log.Error(ex, "Failure retrieving Settings."); + throw new ServerErrorException(); + } + } + + public async Task SaveAsync(AccountType accountType) + { + try + { + await _accountTypeRepository.AddAsync(accountType); + await _unitOfWork.CompleteAsync(); + + return accountType; + } + catch (Exception ex) + { + Log.Error(ex, $"Failure saving Account Type: {accountType}", accountType); + throw new ServerErrorException(); + } + } + + public async Task SaveAsync(AllowedStatusChange statusChange) + { + try + { + await _allowedStatusChangeRepository.AddAsync(statusChange); + await _unitOfWork.CompleteAsync(); + + return statusChange; + } + catch (Exception ex) + { + Log.Error(ex, $"Failure saving Allowed Status Change: {statusChange}", statusChange); + throw new ServerErrorException(); + } + } + + public async Task SaveAsync(BodyStyle bodyStyle) + { + try + { + await _bodyStyleRepository.AddAsync(bodyStyle); + await _unitOfWork.CompleteAsync(); + + return bodyStyle; + } + catch (Exception ex) + { + Log.Error(ex, $"Failure saving Body Style: {bodyStyle}", bodyStyle); + throw new ServerErrorException(); + } + } + + public async Task SaveAsync(CleaningLevel cleaningLevel) + { + try + { + await _cleaningLevelRepository.AddAsync(cleaningLevel); + await _unitOfWork.CompleteAsync(); + + return cleaningLevel; + } + catch (Exception ex) + { + Log.Error(ex, $"Failure saving Cleaning Level: {cleaningLevel}", cleaningLevel); + throw new ServerErrorException(); + } + } + + public async Task SaveAsync(CollateralType collateralType) + { + try + { + await _collateralTypeRepository.AddAsync(collateralType); + await _unitOfWork.CompleteAsync(); + + return collateralType; + } + catch (Exception ex) + { + Log.Error(ex, $"Failure saving Collateral: {collateralType}", collateralType); + throw new ServerErrorException(); + } + } + + public async Task SaveAsync(CollateralTypeToVehicleType collateralToVehicle) + { + try + { + await _collateralTypeToVehicleTypeRepository.AddAsync(collateralToVehicle); + await _unitOfWork.CompleteAsync(); + + return collateralToVehicle; + } + catch (Exception ex) + { + Log.Error(ex, $"Failure saving Collateral Type to Vehicle Type: {collateralToVehicle}", + collateralToVehicle); + throw new ServerErrorException(); + } + } + + public async Task SaveAsync(HoldStatus holdStatus) + { + try + { + await _holdStatusRepository.AddAsync(holdStatus); + await _unitOfWork.CompleteAsync(); + + return holdStatus; + } + catch (Exception ex) + { + Log.Error(ex, $"Failure saving Hold Status: {holdStatus}", holdStatus); + throw new ServerErrorException(); + } + } + + public async Task SaveAsync(LoanCategory loanCategory) + { + try + { + await _loanCategoryRepository.AddAsync(loanCategory); + await _unitOfWork.CompleteAsync(); + + return loanCategory; + } + catch (Exception ex) + { + Log.Error(ex, $"Failure saving Loan Category: {loanCategory}", loanCategory); + throw new ServerErrorException(); + } + } + + public async Task SaveAsync(LocationType locationType) + { + try + { + await _locationTypeRepository.AddAsync(locationType); + await _unitOfWork.CompleteAsync(); + + return locationType; + } + catch (Exception ex) + { + Log.Error(ex, $"Failure saving Location Type: {locationType}", locationType); + throw new ServerErrorException(); + } + } + + public async Task SaveAsync(VehicleType vehicleType) + { + try + { + await _vehicleTypeRepository.AddAsync(vehicleType); + await _unitOfWork.CompleteAsync(); + + return vehicleType; + } + catch (Exception ex) + { + Log.Error(ex, $"Failure saving Vehicle Type: {vehicleType}", vehicleType); + throw new ServerErrorException(); + } + } + + public async Task UpdateAsync(AccountType accountType) + { + var existingAccountType = await _accountTypeRepository.FindByIdAsync(accountType.ID); + + if (existingAccountType == null) + { + throw new NotFoundException($" Account Type with id {accountType.ID} not found."); + } + + existingAccountType.AccountTypeCode = accountType.AccountTypeCode; + existingAccountType.Description = accountType.Description; + existingAccountType.IsVisible = accountType.IsVisible; + + try + { + _accountTypeRepository.Update(existingAccountType); + await _unitOfWork.CompleteAsync(); + return (existingAccountType); + } + catch (SqlException ex) + { + Log.Error(ex, $"SQL Failure updating Account Type: {accountType}", accountType); + throw new ServerErrorException(); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure updating Account Type: {accountType}", accountType); + throw new ServerErrorException(); + } + } + + public async Task UpdateAsync(AllowedStatusChange allowedStatusChange) + { + var existingStatusChange = await _allowedStatusChangeRepository.FindByIdAsync(allowedStatusChange.ID); + + if (existingStatusChange == null) + { + throw new NotFoundException($" Allowed Status Change with id {allowedStatusChange.ID} not found."); + } + + existingStatusChange.CurrentStatus = allowedStatusChange.CurrentStatus; + existingStatusChange.AllowedChangeStatus = allowedStatusChange.AllowedChangeStatus; + + try + { + _allowedStatusChangeRepository.Update(existingStatusChange); + await _unitOfWork.CompleteAsync(); + return (existingStatusChange); + } + catch (SqlException ex) + { + Log.Error(ex, $"SQL Failure updating Allowed Status Change: {allowedStatusChange}", + allowedStatusChange); + throw new ServerErrorException(); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure updating Allowed Status Change {allowedStatusChange}", allowedStatusChange); + throw new ServerErrorException(); + } + } + + public async Task UpdateAsync(BodyStyle bodyStyle) + { + var existingBodyStyle = await _bodyStyleRepository.FindByIdAsync(bodyStyle.Code); + + if (existingBodyStyle == null) + { + throw new NotFoundException($" Body Style with code {bodyStyle.Code} not found."); + } + + existingBodyStyle.Description = bodyStyle.Description; + + try + { + _bodyStyleRepository.Update(existingBodyStyle); + await _unitOfWork.CompleteAsync(); + return (existingBodyStyle); + } + catch (SqlException ex) + { + Log.Error(ex, $"SQL Failure updating Body Style: {bodyStyle}", bodyStyle); + throw new ServerErrorException(); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure updating Body Style: {bodyStyle}", bodyStyle); + throw new ServerErrorException(); + } + } + + public async Task UpdateAsync(CleaningLevel cleaningLevel) + { + var existingCleaningLevel = await _cleaningLevelRepository.FindByIdAsync(cleaningLevel.Code); + + if (existingCleaningLevel == null) + { + throw new NotFoundException($" Cleaning Level with code {cleaningLevel.Code} not found."); + } + + existingCleaningLevel.Description = cleaningLevel.Description; + + try + { + _cleaningLevelRepository.Update(existingCleaningLevel); + await _unitOfWork.CompleteAsync(); + return (existingCleaningLevel); + } + catch (SqlException ex) + { + Log.Error(ex, $"SQL Failure updating Cleaning Level: {cleaningLevel}", cleaningLevel); + throw new ServerErrorException(); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure updating Cleaning Level: {cleaningLevel}", cleaningLevel); + throw new ServerErrorException(); + } + } + + public async Task UpdateAsync(CollateralType collateralType) + { + var existingCollateralType = await _collateralTypeRepository.FindByIdAsync(collateralType.ID); + + if (existingCollateralType == null) + { + throw new NotFoundException($" Collateral Type with code {collateralType.ID} not found."); + } + + existingCollateralType.Description = collateralType.Description; + existingCollateralType.LookupHandler = collateralType.LookupHandler; + + try + { + _collateralTypeRepository.Update(existingCollateralType); + await _unitOfWork.CompleteAsync(); + return (existingCollateralType); + } + catch (SqlException ex) + { + Log.Error(ex, $"SQL Failure updating Collateral Type: {collateralType}", collateralType); + throw new ServerErrorException(); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure updating Collateral Type: {collateralType}", collateralType); + throw new ServerErrorException(); + } + } + + public async Task UpdateAsync(CollateralTypeToVehicleType collateralToVehicle) + { + var existingCollateralToVehicle = + await _collateralTypeToVehicleTypeRepository.FindByIdAsync(collateralToVehicle.ID); + + if (existingCollateralToVehicle == null) + { + throw new NotFoundException( + $" Collateral Type To Vehicle Type with id {collateralToVehicle.ID} not found."); + } + + existingCollateralToVehicle.CollateralTypeId = collateralToVehicle.CollateralTypeId; + existingCollateralToVehicle.VehicleTypeId = collateralToVehicle.VehicleTypeId; + + try + { + _collateralTypeToVehicleTypeRepository.Update(existingCollateralToVehicle); + await _unitOfWork.CompleteAsync(); + return (existingCollateralToVehicle); + } + catch (SqlException ex) + { + Log.Error(ex, $"SQL Failure updating Collateral Type To Vehicle Type: {collateralToVehicle}", + collateralToVehicle); + throw new ServerErrorException(); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure updating Collateral Type To Vehicle Type: {collateralToVehicle}", + collateralToVehicle); + throw new ServerErrorException(); + } + } + + public async Task UpdateAsync(HoldStatus holdStatus) + { + var existingHoldStatus = await _holdStatusRepository.FindByIdAsync(holdStatus.Code); + + if (existingHoldStatus == null) + { + throw new NotFoundException($" Hold Status with code {holdStatus.Code} not found."); + } + + existingHoldStatus.Description = holdStatus.Description; + + try + { + _holdStatusRepository.Update(existingHoldStatus); + await _unitOfWork.CompleteAsync(); + return (existingHoldStatus); + } + catch (SqlException ex) + { + Log.Error(ex, $"SQL Failure updating Hold Status: {holdStatus}", holdStatus); + throw new ServerErrorException(); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure updating Hold Status: {holdStatus}", holdStatus); + throw new ServerErrorException(); + } + } + + public async Task UpdateAsync(LoanCategory loanCategory) + { + var existingLoanCategory = await _loanCategoryRepository.FindByIdAsync(loanCategory.ID); + + if (existingLoanCategory == null) + { + throw new NotFoundException($" Loan Category with code {loanCategory.ID} not found."); + } + + existingLoanCategory.CategoryName = loanCategory.CategoryName; + + try + { + _loanCategoryRepository.Update(existingLoanCategory); + await _unitOfWork.CompleteAsync(); + return (existingLoanCategory); + } + catch (SqlException ex) + { + Log.Error(ex, $"SQL Failure updating Loan Category: {loanCategory}", loanCategory); + throw new ServerErrorException(); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure updating Loan Category: {loanCategory}", loanCategory); + throw new ServerErrorException(); + } + } + + public async Task UpdateAsync(LocationType locationType) + { + var existingLocationType = await _locationTypeRepository.FindByIdAsync(locationType.Code); + + if (existingLocationType == null) + { + throw new NotFoundException($" Location Type with code {locationType.Code} not found."); + } + + existingLocationType.Description = locationType.Description; + + try + { + _locationTypeRepository.Update(existingLocationType); + await _unitOfWork.CompleteAsync(); + return (existingLocationType); + } + catch (SqlException ex) + { + Log.Error(ex, $"SQL Failure updating Location Type: {locationType}", locationType); + throw new ServerErrorException(); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure updating Location Type: {locationType}", locationType); + throw new ServerErrorException(); + } + } + + public async Task UpdateAsync(VehicleType vehicleType) + { + var existingVehicleType = await _vehicleTypeRepository.FindByIdAsync(vehicleType.Code); + + if (existingVehicleType == null) + { + throw new NotFoundException($" Vehicle Type with code {vehicleType.Code} not found."); + } + + existingVehicleType.Description = vehicleType.Description; + + try + { + _vehicleTypeRepository.Update(existingVehicleType); + await _unitOfWork.CompleteAsync(); + return (existingVehicleType); + } + catch (SqlException ex) + { + Log.Error(ex, $"SQL Failure updating Vehicle Type: {vehicleType}", vehicleType); + throw new ServerErrorException(); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure updating Vehicle Type: {vehicleType}", vehicleType); + throw new ServerErrorException(); + } + } + + public async Task SyncExternalUsersAsync(IReadOnlyCollection users) + { + await _externalUserRepository.SynchronizeSet(users); + await _unitOfWork.CompleteAsync(); + } + + private static Dictionary GetRepoTypes() + { + return Enum.GetValues(typeof(RepoType)) + .Cast() + .ToDictionary(type => (int)type, type => type.ToString() ); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/StatusService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/StatusService.cs new file mode 100644 index 0000000..c050e3b --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/StatusService.cs @@ -0,0 +1,36 @@ +using LCU.API.Collections.CollectionsApiLib.Models; +using LCU.API.Collections.RepoApi.Exceptions; +using Serilog; + +namespace LCU.API.Collections.RepoApi.Services +{ + public class StatusService + { + /** + * Convert a Stage from a case to a RepoAccount status. + */ + public static string ConvertStatus(RepoStatus oldStage) + { + switch (oldStage) + { + case RepoStatus.PSKP: return "PSKP"; + case RepoStatus.REHO: return "REHO"; + case RepoStatus.RECA: return "RECA"; + case RepoStatus.O4R: return "O4R"; + case RepoStatus.REPO: return "REPO"; + case RepoStatus.REDEEMED: return "REDEEMED"; + case RepoStatus.SOLD: return "SOLD"; + case RepoStatus.NOTACTIVE: return "SOLD"; + case RepoStatus.INELIGIBLE: throw new IneligibleAccountException("CaseStage", "Not a Repo Case Stage."); + // case RepoStatus.UNKNOWN is meant to fall through to below. + } + + Log.Fatal($"Attempt to convert status {oldStage}, but was not known."); + // The account is not necessarily ineligible, but is missing a requirement, the stage. + // This covers the problem of Temenos not providing a Case Stage Change event, and only + // a Case Creation event. The stage won't be available yet, so throw a MissingRequirement + // causing it to be retried on the hour - it should then run fine. + throw new MissingRequirementException("Case Stage", $"A valid case stage is required, {oldStage} is not valid."); + } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/VehicleFloorPricingParametersService.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/VehicleFloorPricingParametersService.cs new file mode 100644 index 0000000..e084e38 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Services/VehicleFloorPricingParametersService.cs @@ -0,0 +1,104 @@ +using System; +using System.Collections.Generic; +using System.Data.SqlClient; +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Exceptions; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using Serilog; + +namespace LCU.API.Collections.RepoApi.Services +{ + public class VehicleFloorPricingParametersService : IVehicleFloorPricingParametersService + { + private readonly IVehicleFloorPricingParametersRepository _parametersRepository; + private readonly IUnitOfWork _unitOfWork; + + public VehicleFloorPricingParametersService( + IVehicleFloorPricingParametersRepository parametersRepository, + IUnitOfWork unitOfWork) + { + _parametersRepository = parametersRepository; + _unitOfWork = unitOfWork; + } + + public async Task> ListAll() + { + try + { + return await _parametersRepository.ListAllAsync(); + } + catch (Exception ex) + { + Log.Error(ex, "Failure retrieving VehicleFloorPricingParameters"); + throw new ServerErrorException(); + } + } + + public async Task Get(int id) + { + VehicleFloorPricingParameters parameters; + try + { + parameters = await _parametersRepository.FindByIdAsync(id); + await _unitOfWork.CompleteAsync(); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure retrieving VehicleFloorPricingParameters: {id}", id); + throw new ServerErrorException(); + } + + if (parameters == null) + { + throw new NotFoundException($"VehicleFloorPricingParameters with id {id} not found."); + } + + return parameters; + } + + public async Task UpdateAsync(VehicleFloorPricingParameters parameters) + { + VehicleFloorPricingParameters existing = null; + try + { + existing = await _parametersRepository.FindByIdAsync(parameters.Id); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure retrieving existing VehicleFloorPricingParameters with Id: {parameters.Id}", parameters.Id); + throw new ServerErrorException(); + } + + if (existing == null) + { + throw new NotFoundException($"Vehicle Floor Pricing Parameters with id {parameters.Id} not found."); + } + + existing.LowCondition = parameters.LowCondition; + existing.HighCondition = parameters.HighCondition; + existing.NADAFirstValue = parameters.NADAFirstValue; + existing.NADASecondValue = parameters.NADASecondValue; + existing.MMRAdjustedValue = parameters.MMRAdjustedValue; + existing.PercentageOf = parameters.PercentageOf; + existing.ValuationServiceType = parameters.ValuationServiceType; + + try + { + _parametersRepository.Update(existing); + await _unitOfWork.CompleteAsync(); + return (existing); + } + catch (SqlException ex) + { + Log.Error(ex, $"SQL Failure updating Vehicle Floor Pricing Parameters: {parameters}", parameters); + throw new ServerErrorException(); + } + catch (Exception ex) + { + Log.Error(ex, $"Failure updating Vehicle Floor Pricing Parameters: {parameters}", parameters); + throw new ServerErrorException(); + } + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Startup.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Startup.cs new file mode 100644 index 0000000..4ad55ab --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/Startup.cs @@ -0,0 +1,240 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.IO; +using System.Linq; +using System.Reflection; +using LCU.API.Collections.RepoApi.Configuration; +using LCU.API.Collections.RepoApi.DataAccess; +using LCU.API.Collections.RepoApi.Domain; +using LCU.API.Collections.RepoApi.Domain.FloorPricing; +using LCU.API.Collections.RepoApi.Extensions; +using LCU.API.Collections.RepoApi.HostedServices; +using LCU.API.Collections.RepoApi.MockServices; +using LCU.API.Collections.RepoApi.Services; +using LCU.API.Collections.RepoApi.Services.AutoIms; +using LCU.API.Collections.RepoApi.Services.Producer; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Persistence; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using LCU.Shared.Collections.RepoApiLib.Security; +using LCU.Shared.Collections.RepoApiLib.WebServices.AutoIMS; +using LCU.Shared.Collections.RepoApiLib.WebServices.NADA; +using Microsoft.AspNetCore.Authentication.JwtBearer; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Identity; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Newtonsoft.Json; +using Swashbuckle.AspNetCore.Swagger; +using LCU.API.Collections.RepoApi.Models; +using LCU.Shared.Realtime.QueueLib.Models; +using LCU.Shared.Realtime.QueueLib.Scheduler; +using Microsoft.FeatureManagement; +using LCU.Shared.Collections.RepoApiLib.Utilities; + +namespace LCU.API.Collections.RepoApi +{ + [ExcludeFromCodeCoverage] + public class Startup + { + public Startup(IConfiguration configuration) + { + Configuration = configuration; + } + + public IConfiguration Configuration { get; } + readonly string MyAllowSpecificOrigins = "_myAllowSpecificOrigins"; + + // This method gets called by the runtime. Use this method to add services to the container. + public void ConfigureServices(IServiceCollection services) + { + SqlOptionsConfig sqlOptionsConfig = new SqlOptionsConfig(); + Configuration.GetSection("Connections").GetSection("SQL").GetSection("SQLOptions").Bind(sqlOptionsConfig); + + services.AddDbContext(options => + { + options.UseSqlServer( + Configuration.GetSection("Connections").GetSection("SQL").GetSection("RepoDB").Value, + sqlServerOptionsAction: sqlOptions => + { + sqlOptions.EnableRetryOnFailure( + maxRetryCount: sqlOptionsConfig.MaxRetryCount, + maxRetryDelay: sqlOptionsConfig.MaxRetryDelay, + errorNumbersToAdd: sqlOptionsConfig.ErrorNumbersToAdd); + }); + options.EnableDetailedErrors(sqlOptionsConfig.EnableDetailedErrors); + }); + + AppCorsConfig appConnections = new AppCorsConfig(); + Configuration.GetSection("Connections").Bind(appConnections); + + var environment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"); + var isDevelopment = environment == EnvironmentName.Development || environment == EnvironmentName.Staging; + + services.AddCors(options => + { + options.AddPolicy(MyAllowSpecificOrigins, + builder => + { + builder.WithOrigins( + appConnections.CORS_AllowedOrigins + ).AllowAnyHeader().AllowAnyMethod(); + }); + }); + + services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2); + services.AddMvc().AddJsonOptions(options => + { + options.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore; + }); + + IQueueConnectionConfig queueConnectionConfig = new QueueConnectionConfig(); + Configuration.GetSection("Connections").GetSection("Queue").Bind(queueConnectionConfig); + + CollateralValueServiceConfig nadaServiceConfig = new CollateralValueServiceConfig(); + Configuration.GetSection("NadaService").Bind(nadaServiceConfig); + + AutoImsServiceConfig autoImsConfig = new AutoImsServiceConfig(); + Configuration.GetSection("AutoIms").Bind(autoImsConfig); + + var repoApiConfig = new RepoApiConfiguration(); + Configuration.GetSection("primary").Bind(repoApiConfig); + var taskConfigs = Configuration.GetSection("Schedule:Configs") + .GetChildren() + .ToList() + .Select(x => new ScheduledTaskConfig() + { + Name = x.GetValue("Name"), + CronTab = x.GetValue("Crontab"), + Subject = x.GetValue("Subject"), + User = x.GetValue("User") + }); + repoApiConfig.TaskConfigs = taskConfigs.ToList().AsReadOnly(); + + services.AddSingleton(autoImsConfig); + services.AddSingleton(nadaServiceConfig); + services.AddSingleton(repoApiConfig); + + services.AddScoped(); + services.AddScoped(); + + services.UseRepoServices(); + services.UseRepoRepositories(); + + // DAO's, Producers, Factories. + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + + + /* This is not the right way to do feature flags, as this cannot be dynamically changed after startup. + Until we add IFeatureManager to the queue lib, we will be unable to disable the HostedTaskScheduler + With feature flags. + */ + if (Configuration.GetSection("FeatureFlags").GetValue(FeatureFlags.RunAutoImsHostedService)) + { + // Hosted, Queues Configurations + services.AddSingleton(queueConnectionConfig); + services.AddSingleton(repoApiConfig); + + // The Hosted Task Scheduler (Should eventually move out of this project) + services.AddHostedService(); + services.AddHostedService(); + } + + + if (Configuration.GetSection("FeatureFlags").GetValue(FeatureFlags.RunRepoHostedService)) + { + services.AddHostedService(); + services.AddHostedService(); + } + + if (isDevelopment) + { + services.AddScoped(); + } + else + { + services.AddScoped(); + } + + // Register the Swagger generator, defining 1 or more Swagger documents + services.AddSwaggerGen(c => + { + c.SwaggerDoc("v1", new Info { Title = "Repo Management API", Version = "v1" }); + c.DescribeAllEnumsAsStrings(); + // For this to work, I also had to check the generate xml box in build options. + var xmlFile = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml"; + var xmlPath = Path.Combine(AppContext.BaseDirectory, xmlFile); + c.IncludeXmlComments(xmlPath); + + c.AddSecurityDefinition("Bearer", new ApiKeyScheme + { + Description = "JWT Authorization header using the Bearer scheme. Example: \"Authorization: Bearer {token}\"", + Name = "Authorization", + In = "header", + Type = "apiKey" + }); + + c.AddSecurityRequirement(new Dictionary> + { + { "Bearer", Enumerable.Empty() } + }); + }); + + services.Configure(options => + { + options.SuppressModelStateInvalidFilter = true; + }); + + //Set up Authentication + services + .AddAuthentication(JwtBearerDefaults.AuthenticationScheme) + // AzureAD config + .AddAzureAdBearer(options => Configuration.GetSection("AzureActiveDirectory").Bind( options)); + + services.AddIdentity() + .AddDefaultTokenProviders(); + + services.AddHttpClient(); + + //https://docs.microsoft.com/en-us/azure/azure-app-configuration/use-feature-flags-dotnet-core?tabs=core5x + services.AddFeatureManagement(Configuration.GetSection("FeatureFlags")); + } + + // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + public void Configure(IApplicationBuilder app, IHostingEnvironment env) + { + app.UseSwagger(); + app.UseSwaggerUI(c => + { + c.SwaggerEndpoint("/swagger/v1/swagger.json", "Repo Management API"); + }); + + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + else + { + // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. + app.UseHsts(); + } + + app.UseAuthentication(); + app.UseCors(MyAllowSpecificOrigins); + app.UseHttpsRedirection(); + app.UseMvc(); + } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/appsettings.Development.json b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/appsettings.Development.json new file mode 100644 index 0000000..6fb18cf --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/appsettings.Development.json @@ -0,0 +1,153 @@ +{ + "Serilog": { + "WriteTo": [ + { + "Name": "Async", + "Args": { + "configure": [ + { + "Name": "Console" + }, + { + "Name": "Seq", + "Args": { + "serverUrl": "https://qa-seq.lcu-internal.com", + "apiKey": "azlYSsLzk3XoYTsi2Pbr" + } + } + ] + } + } + ], + "Enrich": [ + "FromLogContext", + "WithMachineName", + "WithThreadId" + ], + "Properties": { + "Application": "Repo API", + "Environment": "Development" + } + }, + "Connections": { + "SQL": { + "RepoDB": "data source=DAZCDTBWEB01Q;initial catalog=RepoDB;user id=Srv_RepoAPI_Q;password=2sfg5W7GAfmfvyUQU9yz;MultipleActiveResultSets=True;App=EntityFramework", + "SQLOptions": { + "MaxRetryCount": 5, + "MaxRetryDelay": "0.00:00:30", + "ErrorNumbersToAdd": [], + "EnableDetailedErrors": true + } + }, + "Queue": { + "url": "d1msg01q.lcu-internal.com", + "port": 5672, + "username": "collections", + "password": "p@ssW0rd" + }, + "CORS_AllowedOrigins": [ + "http://localhost:3000", + "http://lcu-internal.com", + "https://lcu-internal.com", + "https://qa-repomanage.lcu-internal.com", + "https://uat-repomanage.lcu-internal.com", + "https://repomanage.lcu-internal.com" + ] + }, + "NadaService": { + "DefaultVehicleAndValuesByVinEndpoint": "https://cloud.jdpower.ai/data-api/UAT/valuationservices/valuation/defaultVehicleAndValuesByVin", + "WeeklyAuctionValuesByVehicleIdEndPoint": "https://cloud.jdpower.ai/data-api/UAT/valuationservices/valuation/weeklyAuctionValuesByVinAndVehicleId", + "ApiKey": "7c099480-c007-4804-895e-df72b32728d3" + }, + "Primary": { + "exchangeName": "LCU.TaskTokenExchange", + "settingsCacheExpirationSeconds": 90, + "programmingRecipients": [ + "programming@landmarkcu.com" + ], + "repoManagerAdminRecipients": [ + "programming@landmarkcu.com" + ], + "floorPriceAcceptedRecipients": [ + "programming@landmarkcu.com" + ], + "collectionsClerkRecipients": [ + "programming@landmarkcu.com" + ], + "creditDebitsRecipients": [ + "programming@landmarkcu.com" + ], + "collectionsRecipients": [ + "programming@landmarkcu.com" + ], + "collectionAccountUrl": "https://qa-collectionsapi.lcu-internal.com/api/account/ByAccountNo/", + "collectionsConfigUrl": "https://qa-collectionsapi.lcu-internal.com/api/Configuration", + "collectionsLetterUrl": "https://qa-collectionsapi.lcu-internal.com/api/account/:accountId/history", + "coreBranchSetUrl": "https://qa-core-api-wrapper-api.apps.azure.lcu-internal.com/api/core/branch", + "coreCollateralUrl": "https://qa-core-api-wrapper-api.apps.azure.lcu-internal.com/api/core/Loan/GetLoanCollateral/:loanId", + "coreLoanUrl": "https://qa-core-api-wrapper-api.apps.azure.lcu-internal.com/api/core/Loan/GetLoanDetails/:loanId", + "coreLoanTransactions": "https://qa-core-api-wrapper-api.apps.azure.lcu-internal.com/api/core/Transaction/GetTransactionHistory?accountNumber=:accountNo&startDateRange=:startDate&endDateRange=:endDate", + "coreMemberUrl": "https://qa-core-api-wrapper-api.apps.azure.lcu-internal.com/api/core/members/GetMemberByAccountNumber/:loanId", + "notificationsEmailUrl": "https://qa-notificationsapi.lcu-internal.com/api/Email", + "repoManagerAccountUrl": "https://qa-repomanage.lcu-internal.com/#/Account/", + "organizationCode": "", + "ftpConfiguration": { + "hostName": "sftp9.autoims.com", + "userName": "LAND", + "port": 2222, + "sshHostKeyFingerprint": "ssh-rsa 4096 8b:1e:e5:1a:28:e4:81:d8:7e:f7:01:0f:86:ed:09:57", + "sshPrivateKeyPath": "privateKey.ppk", + "ExecutablePath": "C:\\dev\\WinSCP-5.15.3-Automation\\WinSCP.exe" + }, + "remoteFilePath": "/reports", + "localDirectoryPath": "C:\\dev\\autoimstestfiles\\", + "conditionReportUrl": "http://Ecr.autoims.com", + "moveProcessedFiles": false, + "downloadNewFiles": false, + "checkForLocalFiles": true, + "queueConsumerConfigs": { + "AutoImsTask": { + "QueueName": "LCU.Tasks.AutoImsSync", + "ExchangeName": "LCU.TaskTokenExchange", + "Subject": "LCU.Tasks.AutoImsSync" + }, + "RepoProcessorTask": { + "QueueName": "LCU.Tasks.RepoAccountProduce", + "ExchangeName": "LCU.TaskTokenExchange", + "Subject": "LCU.Tasks.RepoAccountProduce" + }, + "RepoAccountQueue": { + "QueueName": "LCU.Queue.RepoAccount", + "ExchangeName": "LCU.ProcessingExchange", + "Subject": "LCU.Process.RepoAccount" + } + } + }, + "Schedule": { + "Configs": [ + { + "name": "TestConfig", + "subject": "LCU.Tasks.Test", + "cronTab": "* * * * *", + "user": "System" + }, + { + "name": "RepoQueueProducer", + "subject": "LCU.Tasks.RepoAccountProduce", + "cronTab": "1 5-18 * * mon-fri", + "user": "System" + }, + { + "name": "AutoImsSync", + "subject": "LCU.Tasks.AutoImsSync", + "cronTab": "1 8,13 * * *", + "user": "System" + } + ] + }, + "FeatureFlags" : { + "EnableControllers" : true, + "RunRepoHostedService": false, + "RunAutoImsHostService": false + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/appsettings.Production.json b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/appsettings.Production.json new file mode 100644 index 0000000..6c65a08 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/appsettings.Production.json @@ -0,0 +1,150 @@ +{ + "Serilog": { + "WriteTo": [ + { + "Name": "Async", + "Args": { + "configure": [ + { + "Name": "Console" + }, + { + "Name": "Seq", + "Args": { + "serverUrl": "https://seq.lcu-internal.com", + "apiKey": "5ZATqn3jiszH2koTosj2" + } + } + ] + } + } + ], + "Enrich": [ + "FromLogContext", + "WithMachineName", + "WithThreadId" + ], + "Properties": { + "Application": "Repo API", + "Environment": "Production" + } + }, + "Connections": { + "SQL": { + "RepoDB": "data source=D1CLS01P;initial catalog=RepoDB;user id=Srv_RepoAPI;password=ZFwh9YAx6RYT5FtxNF5q;MultipleActiveResultSets=True;App=EntityFramework", + "SQLOptions": { + "MaxRetryCount": 5, + "MaxRetryDelay": "0.00:00:30", + "ErrorNumbersToAdd": [], + "EnableDetailedErrors": false + } + }, + "Queue": { + "url": "d1msgEnt01p.lcu-internal.com", + "port": 5672, + "username": "collections", + "password": "p@ssW0rd" + }, + "CORS_AllowedOrigins": [ + "http://localhost:3000", + "http://lcu-internal.com", + "https://lcu-internal.com", + "https://qa-repomanage.lcu-internal.com", + "https://uat-repomanage.lcu-internal.com", + "https://repomanage.lcu-internal.com" + ] + }, + "NadaService": { + "DefaultVehicleAndValuesByVinEndpoint": "https://cloud.jdpower.ai/data-api/valuationservices/valuation/defaultVehicleAndValuesByVin", + "WeeklyAuctionValuesByVehicleIdEndPoint": "https://cloud.jdpower.ai/data-api/valuationservices/valuation/weeklyAuctionValuesByVinAndVehicleId", + "ApiKey": "104e2d3d-4025-4d2b-a04b-44200f9b8478" + }, + "primary": { + "exchangeName": "LCU.TaskTokenExchange", + "settingsCacheExpirationSeconds": 90, + "programmingRecipients": [ + "programming@landmarkcu.com" + ], + "repoManagerAdminRecipients": [ + "RepoManagerAdmin@landmarkcu.com" + ], + "floorPriceAcceptedRecipients": [ + "DeanBerendt@landmarkcu.com", + "BillJohns@landmarkcu.com", + "BenardJohnson@landmarkcu.com" + ], + "collectionsClerkRecipients": [ + "CollectionClerks@landmarkcu.com" + ], + "collectionsRecipients": [ + "membersolutions@landmarkcu.com" + ], + "creditDebitsRecipients": [ + "programming@landmarkcu.com", + "RepoManagerCreditDebits@landmarkcu.com" + ], + "collectionAccountUrl": "https://collectionsapi.lcu-internal.com/api/account/ByAccountNo/", + "collectionsConfigUrl": "https://collectionsapi.lcu-internal.com/api/Configuration", + "collectionsLetterUrl": "https://collectionsapi.lcu-internal.com/api/account/:accountId/history", + "coreBranchSetUrl": "https://prd-core-api-wrapper-api.apps.azure.lcu-internal.com/api/core/branch", + "coreCollateralUrl": "https://prd-core-api-wrapper-api.apps.azure.lcu-internal.com/api/core/Loan/GetLoanCollateral/:loanId", + "coreLoanUrl": "https://prd-core-api-wrapper-api.apps.azure.lcu-internal.com/api/core/Loan/GetLoanDetails/:loanId", + "coreLoanTransactions": "https://prd-core-api-wrapper-api.apps.azure.lcu-internal.com/api/core/Transaction/GetTransactionHistory?accountNumber=:accountNo&startDateRange=:startDate&endDateRange=:endDate", + "coreMemberUrl": "https://prd-core-api-wrapper-api.apps.azure.lcu-internal.com/api/core/members/GetMemberByAccountNumber/:loanId", + "notificationsEmailUrl": "https://notificationsapi.lcu-internal.com/api/Email", + "repoManagerAccountUrl": "https://repomanage.lcu-internal.com/#/Account/", + "organizationCode": "", + "ftpConfiguration": { + "hostName": "sftp9.autoims.com", + "userName": "LAND", + "port": 2222, + "sshHostKeyFingerprint": "ssh-rsa 4096 8b:1e:e5:1a:28:e4:81:d8:7e:f7:01:0f:86:ed:09:57", + "sshPrivateKeyPath": "privateKey.ppk", + "ExecutablePath": "D:\\NonWebApps\\WinSCP-5.15.3-Automation\\WinSCP.exe" + }, + "remoteFilePath": "/reports", + "localDirectoryPath": "\\\\DCB0201\\NB_COMMON\\Collections Department\\Repossession\\RepoDatabaseAutoIMSDailyFiles", + "conditionReportUrl": "http://Ecr.autoims.com", + "moveProcessedFiles": true, + "downloadNewFiles": true, + "checkForLocalFiles": true, + "queueConsumerConfigs": { + "AutoImsTask": { + "QueueName": "LCU.Tasks.AutoImsSync", + "ExchangeName": "LCU.TaskTokenExchange", + "Subject": "LCU.Tasks.AutoImsSync" + }, + "RepoProcessorTask": { + "QueueName": "LCU.Tasks.RepoAccountProduce", + "ExchangeName": "LCU.TaskTokenExchange", + "Subject": "LCU.Tasks.RepoAccountProduce" + }, + "RepoAccountQueue": { + "QueueName": "LCU.Queue.RepoAccount", + "ExchangeName": "LCU.ProcessingExchange", + "Subject": "LCU.Process.RepoAccount" + } + } + }, + "Schedule": { + "Configs": [ + { + "name": "RepoQueueProducer", + "subject": "LCU.Tasks.RepoAccountProduce", + "cronTab": "1 5-18 * * mon-fri", + "user": "System" + }, + { + "name": "AutoImsSync", + "subject": "LCU.Tasks.AutoImsSync", + "cronTab": "1 8,13 * * *", + "user": "System" + } + ] + }, + "FeatureFlags": { + "EnableControllers": true, + "RunRepoHostedService": false, + "RunAutoImsHostService": true + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/appsettings.Staging.json b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/appsettings.Staging.json new file mode 100644 index 0000000..91c013d --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/appsettings.Staging.json @@ -0,0 +1,148 @@ +{ + "Serilog": { + "WriteTo": [ + { + "Name": "Async", + "Args": { + "configure": [ + { + "Name": "Console" + }, + { + "Name": "Seq", + "Args": { + "serverUrl": "https://uat-seq.lcu-internal.com", + "apiKey": "k00DkjmfKMjgNPHvgRcz" + } + } + ] + } + } + ], + "Enrich": [ + "FromLogContext", + "WithMachineName", + "WithThreadId" + ], + "Properties": { + "Application": "Repo API", + "Environment": "Release" + } + }, + "Connections": { + "SQL": { + "RepoDB": "data source=WEBCLSU.lcu-internal.com;initial catalog=RepoDB;user id=svc_repoapi_U;password=JolmnuIRfDC83GJy5sIE;MultipleActiveResultSets=True;App=EntityFramework;Encrypt=False;MultiSubnetFailover=True;", + "SQLOptions": { + "MaxRetryCount": 5, + "MaxRetryDelay": "0.00:00:30", + "ErrorNumbersToAdd": [], + "EnableDetailedErrors": true + } + }, + "Queue": { + "url": "d1msg01u.lcu-internal.com", + "port": 5672, + "username": "collections", + "password": "p@ssW0rd" + }, + "CORS_AllowedOrigins": [ + "http://localhost:3000", + "http://lcu-internal.com", + "https://lcu-internal.com", + "https://qa-repomanage.lcu-internal.com", + "https://uat-repomanage.lcu-internal.com", + "https://repomanage.lcu-internal.com" + ] + }, + "NadaService": { + "DefaultVehicleAndValuesByVinEndpoint": "https://cloud.jdpower.ai/data-api/UAT/valuationservices/valuation/defaultVehicleAndValuesByVin", + "WeeklyAuctionValuesByVehicleIdEndPoint": "https://cloud.jdpower.ai/data-api/UAT/valuationservices/valuation/weeklyAuctionValuesByVinAndVehicleId", + "ApiKey": "7c099480-c007-4804-895e-df72b32728d3" + }, + "primary": { + "exchangeName": "LCU.TaskTokenExchange", + "settingsCacheExpirationSeconds": 90, + "programmingRecipients": [ + "programming@landmarkcu.com" + ], + "repoManagerAdminRecipients": [ + "programming@landmarkcu.com" + ], + "floorPriceAcceptedRecipients": [ + "programming@landmarkcu.com" + ], + "collectionsClerkRecipients": [ + "programming@landmarkcu.com" + ], + "collectionsRecipients": [ + "programming@landmarkcu.com" + ], + "creditDebitsRecipients": [ + "programming@landmarkcu.com" + ], + "collectionAccountUrl": "https://uat-collectionsapi.lcu-internal.com/api/account/ByAccountNo/", + "collectionsConfigUrl": "https://uat-collectionsapi.lcu-internal.com/api/Configuration", + "collectionsLetterUrl": "https://uat-collectionsapi.lcu-internal.com/api/account/:accountId/history", + "coreBranchSetUrl": "https://uat-core-api-wrapper-api.apps.azure.lcu-internal.com/api/core/branch", + "coreCollateralUrl": "https://uat-core-api-wrapper-api.apps.azure.lcu-internal.com/api/core/Loan/GetLoanCollateral/:loanId", + "coreLoanUrl": "https://uat-core-api-wrapper-api.apps.azure.lcu-internal.com/api/core/Loan/GetLoanDetails/:loanId", + "coreLoanTransactions": "https://uat-core-api-wrapper-api.apps.azure.lcu-internal.com/api/core/Transaction/GetTransactionHistory?accountNumber=:accountNo&startDateRange=:startDate&endDateRange=:endDate", + "coreMemberUrl": "https://uat-core-api-wrapper-api.apps.azure.lcu-internal.com/api/core/members/GetMemberByAccountNumber/:loanId", + "notificationsEmailUrl": "https://uat-notificationsapi.lcu-internal.com/api/Email", + "repoManagerAccountUrl": "https://uat-repomanage.lcu-internal.com/#/Account/", + "organizationCode": "", + "ftpConfiguration": { + "hostName": "sftp9.autoims.com", + "userName": "LAND", + "port": 2222, + "sshHostKeyFingerprint": "ssh-rsa 4096 8b:1e:e5:1a:28:e4:81:d8:7e:f7:01:0f:86:ed:09:57", + "sshPrivateKeyPath": "privateKey.ppk", + "ExecutablePath": "C:\\dev\\WinSCP-5.15.3-Automation\\WinSCP.exe" + }, + "remoteFilePath": "/reports", + "localDirectoryPath": "C:\\dev\\autoimstestfiles\\", + "localDirectoryPathReal": "\\\\DCB0201\\NB_COMMON\\Collections Department\\Repossession\\RepoDatabaseAutoIMSDailyFiles", + "conditionReportUrl": "http://Ecr.autoims.com", + "moveProcessedFiles": false, + "downloadNewFiles": false, + "checkForLocalFiles": true, + "queueConsumerConfigs": { + "AutoImsTask": { + "QueueName": "LCU.Tasks.AutoImsSync", + "ExchangeName": "LCU.TaskTokenExchange", + "Subject": "LCU.Tasks.AutoImsSync" + }, + "RepoProcessorTask": { + "QueueName": "LCU.Tasks.RepoAccountProduce", + "ExchangeName": "LCU.TaskTokenExchange", + "Subject": "LCU.Tasks.RepoAccountProduce" + }, + "RepoAccountQueue": { + "QueueName": "LCU.Queue.RepoAccount", + "ExchangeName": "LCU.ProcessingExchange", + "Subject": "LCU.Process.RepoAccount" + } + } + }, + "Schedule": { + "Configs": [ + { + "name": "RepoQueueProducer", + "subject": "LCU.Tasks.RepoAccountProduce", + "cronTab": "1 5-18 * * mon-fri", + "user": "System" + }, + { + "name": "AutoImsSync", + "subject": "LCU.Tasks.AutoImsSync", + "cronTab": "1 8,13 * * *", + "user": "System" + } + ] + }, + "FeatureFlags": { + "EnableControllers": true, + "RunRepoHostedService": false, + "RunAutoImsHostService": false + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/appsettings.json b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/appsettings.json new file mode 100644 index 0000000..0275403 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/appsettings.json @@ -0,0 +1,58 @@ +{ + "Serilog": { + "MinimumLevel": { + "Default": "Debug", + "Override": { + "Microsoft": "Information", + "System": "Warning" + } + } + }, + "AzureActiveDirectory": { + "Instance": "https://login.microsoftonline.com/", + "Domain": "landmarkcu.com", + "TenantId": "63cd1554-2783-4a86-ae50-b9e6c21c9499", + /** the azure id of the backend **/ + "ClientId": "3035f950-c4e4-420f-8d89-327a2dfb1e3a", + /** the azure id of the front end **/ + "ValidAudience": "60f721aa-75bf-4195-ae48-d42cbfd8326b" + }, + "AllowedHosts": "*", + "Bing": { + "BingMapsKey": "Arx3eMqGmSxPePFWAwePj4OPyZLGAmTNvw9ctVBUyvNpwj2CWXvFyuYfOlverIVt" + }, + "AutoIms": { + "URL": "https://webservices.autoims.com/ClientWebservice?clientId={0}", + "Login": "lcu_ws", + "Password": "x4512197e3i7", + "ClientId": "LAND" + }, + "NadaService": { + "Region": 4, + "Period": 0 + }, + "Primary": { + "TransactionTypeCodes": [ + "CHAS", + "CHST", + "COBR", + "COFR", + "EXT", + "FLCO", + "FLCR", + "LCAP", + "LRCT", + "LTCG", + "LTCW", + "PDSB", + "POFF", + "PRCT", + "RPMT", + "SPMT", + "XPMT" + ], + "TransactionTypeCodeQueryPrefix": "&transactionTypeCodes=", + "TransactionHistoryParameterDateFormat": "MM-dd-yyyy", + "TransactionHistoryStartDateOffset": -120 + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/privatekey.ppk b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/privatekey.ppk new file mode 100644 index 0000000..ddd8521 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/privatekey.ppk @@ -0,0 +1,26 @@ +PuTTY-User-Key-File-2: ssh-rsa +Encryption: none +Comment: rsa-key-20170525 +Public-Lines: 6 +AAAAB3NzaC1yc2EAAAABJQAAAQEArK1x1LHnEBUEk9FT2tYxIzfb+Twi7j5WgHww +LXlunhrLEPkRwlMhh6gJLzsCDfVVr++L2Uc8eQmDC0tVb3VIJCDeJODdwwa+rmBD +A3aRtt9iEtQNZNxCNkWma2H2KsSHoBP/9uvrxsOhaUiszH03YHuUcx8LU5Q1v/tj +zDlwJmsWWDMOr+APD6RM4oAWBKSfLa7naa8Cz+wL1nTsn5QWLYocKDxol7koZoCp +PYzw9FraYToddYcbzyxsZa3JcNdjlvm1QatNVZBW5eZQd390noV2eBcEp9M9z+y2 +J0mjgUDOsbnxEhnH0Gg7PqNKtQjtxU4I9ivBPlIKLyrLEbpZIw== +Private-Lines: 14 +AAABACoArPxin/z+MYu9S7+b4nBZsgwxOO3Xz9oQXr70BiZ1OFA8lZ34i52JvQt9 +DlZsG8MC6qp5HIwk6IY060Sf/MqEiQ/jq5BNv63gEEzzU+Bf2ZXgjaLpd+OwE7lB +V43cxwtDIpYCCOsoqri+ppKa/6HY3uuR7f+SwPdY0xYAIjLbX0vssN1fzLghxIIA +YBZL31xQymksD1j3dvYKJZ/rWxXQJUtL7ivri46qdVhkGFJBYi7yPJzlCTQ4alhm +LBoWUfkTvwj+Fj/t/TJeYp0f84VbTWuYNkrovJtHTuEHdbB0DSkyZMsZNEPq8WIr ++h5PV+dDmHr/aGTw6YS3IHPRL+0AAACBAPqnL2EvHELf06Pxt3l7AYgjKLBMCfDd +3vg8jLl1D/6Hw1Ljh/lq6BOhp/6sfekflEhYjA56+qWuYkRIU2PKahBbnwOTTOH2 +AhRrRPC3P+/ZTEfHsd5ldeEyHEcU/QhmUHeSEop/aNlM1AMd6mSRyRstYyyRdDeS +YXSfcROcPBBDAAAAgQCwXG+BDx2CkClkoXG8LflkVh2hpijS2aHxpmkmtYOhL6f3 +DybxW8/XCI2rs+VOgp1TuXTc51Cln3By6tLMyWblyZe8wknXA2aG5HKt5PUNaBcp +S2UqnKCOH3JjrhF+YfbLry2PT7sXpUAe4nXh34fa/ZwUMivADPW5GMjctcz1oQAA +AIBEzatIYkJQzHfOnk+/Cr0MQyBvNfbN6UFXex83vmEMRPyrpOXku55XDFfz6Npo +RX88MyCffFZ/hnhy3zw94dui8niGMUxhd7ciGMX7je7QuanKCXdsqRpE57g3mrdM +XnaNyY2rb5aKniNaDcArIQDF5Q9jyZNK2CcsBEcGuRDsug== +Private-MAC: 148adc98b92e17d27a6d9178bd2dc0b097a8398b diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/LCU.API.Collections.RepoApiSql.refactorlog b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/LCU.API.Collections.RepoApiSql.refactorlog new file mode 100644 index 0000000..5704a9c --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/LCU.API.Collections.RepoApiSql.refactorlog @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/LCU.API.Collections.RepoApiSql.sqlproj b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/LCU.API.Collections.RepoApiSql.sqlproj new file mode 100644 index 0000000..59e663b --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/LCU.API.Collections.RepoApiSql.sqlproj @@ -0,0 +1,114 @@ + + + + + Debug + AnyCPU + LCU.API.Collections.RepoApiSql + 2.0 + 4.1 + {33a79137-9040-4749-b89d-1055657c3745} + Microsoft.Data.Tools.Schema.Sql.Sql130DatabaseSchemaProvider + Database + + + LCU.API.Collections.RepoApiSql + LCU.API.Collections.RepoApiSql + 1033,CI + BySchemaAndSchemaType + True + v4.5 + CS + Properties + False + True + True + SQL_Latin1_General_CP1_CI_AS + PRIMARY + + + bin\Release\ + $(MSBuildProjectName).sql + False + pdbonly + true + false + true + prompt + 4 + + + bin\Debug\ + $(MSBuildProjectName).sql + false + true + full + false + true + true + prompt + 4 + + + 11.0 + + True + 11.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/Old/Script.GoLive.Deprecated.txt b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/Old/Script.GoLive.Deprecated.txt new file mode 100644 index 0000000..85a5c4a --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/Old/Script.GoLive.Deprecated.txt @@ -0,0 +1,995 @@ +/* +Post-Deployment Script Template +-------------------------------------------------------------------------------------- + This file contains SQL statements that will be appended to the build script. + Use SQLCMD syntax to include a file in the post-deployment script. + Example: :r .\myfile.sql + Use SQLCMD syntax to reference a variable in the post-deployment script. + Example: :setvar TableName MyTable + SELECT * FROM [$(TableName)] +-------------------------------------------------------------------------------------- +*/ + +/* + * There are 29 tables. + * This script migrates 13 tables from RepoDb to Repo Manager + * @Deprecated this script is only needed if you are starting over and should be run manually... + +delete from RepoManualStatus; +delete from VehicleFloorPricingParameters; +delete from IMSAutoFileData; +delete from AuctionAssignmentsToCollaterals; +delete from RepoCompanySelections; +delete from AuctionAssignments; +delete from Auctions; +delete from AllowedStatusChanges; +delete from Collaterals; +delete from BodyStyleCodes; +delete from CleaningLevelCodes; +delete from HoldStatusCodes; +delete from Letters; +delete from LocationTypeCodes; +delete from CollateralTypesToVehicleTypes; +delete from VehicleTypeCodes; +delete from CollateralTypes; +delete from AccountTypeCodes; +delete from LoanCategories; + +delete from Borrowers; +delete from Repos; +delete from EventAlert; +delete from RepoStatusChanges; +delete from RepoCompany; + +SET IDENTITY_INSERT [RepoManualStatus] ON + +INSERT [RepoManualStatus] ([ID], [Description], [IsActiveStatus], [WatchForStatusChanges]) VALUES (1, 'PSKP', 0, 0) +INSERT [RepoManualStatus] ([ID], [Description], [IsActiveStatus], [WatchForStatusChanges]) VALUES (2, 'NOT ACTIVE', 0, 0) +INSERT [RepoManualStatus] ([ID], [Description], [IsActiveStatus], [WatchForStatusChanges]) VALUES (3, 'SOLD', 0, 0) +INSERT [RepoManualStatus] ([ID], [Description], [IsActiveStatus], [WatchForStatusChanges]) VALUES (4, 'REDEEMED', 0, 1) +INSERT [RepoManualStatus] ([ID], [Description], [IsActiveStatus], [WatchForStatusChanges]) VALUES (5, 'O4R', 1, 1) +INSERT [RepoManualStatus] ([ID], [Description], [IsActiveStatus], [WatchForStatusChanges]) VALUES (6, 'REPO', 1, 1) +INSERT [RepoManualStatus] ([ID], [Description], [IsActiveStatus], [WatchForStatusChanges]) VALUES (7, 'RECA', 1, 1) +INSERT [RepoManualStatus] ([ID], [Description], [IsActiveStatus], [WatchForStatusChanges]) VALUES (8, 'REHO', 1, 1) +SET IDENTITY_INSERT [RepoManualStatus] OFF + +SET IDENTITY_INSERT [VehicleFloorPricingParameters] ON + +INSERT [VehicleFloorPricingParameters] ([ID], [LowCondition], [HighCondition], [NADAFirstValue], [NADASecondValue], [MMRAdjustedValue], [PercentageOf], [ValuationServiceType]) VALUES (4, CAST(0.0 AS Decimal(18, 1)), CAST(1.5 AS Decimal(18, 1)), N'low', N'low', N'regional', CAST(95.00 AS Decimal(18, 2)), 0) +INSERT [VehicleFloorPricingParameters] ([ID], [LowCondition], [HighCondition], [NADAFirstValue], [NADASecondValue], [MMRAdjustedValue], [PercentageOf], [ValuationServiceType]) VALUES (5, CAST(1.6 AS Decimal(18, 1)), CAST(2.5 AS Decimal(18, 1)), N'low', N'avg', N'regional', CAST(95.00 AS Decimal(18, 2)), 0) +INSERT [VehicleFloorPricingParameters] ([ID], [LowCondition], [HighCondition], [NADAFirstValue], [NADASecondValue], [MMRAdjustedValue], [PercentageOf], [ValuationServiceType]) VALUES (6, CAST(2.6 AS Decimal(18, 1)), CAST(3.5 AS Decimal(18, 1)), N'avg', N'avg', N'regional', CAST(95.00 AS Decimal(18, 2)), 0) +INSERT [VehicleFloorPricingParameters] ([ID], [LowCondition], [HighCondition], [NADAFirstValue], [NADASecondValue], [MMRAdjustedValue], [PercentageOf], [ValuationServiceType]) VALUES (7, CAST(3.6 AS Decimal(18, 1)), CAST(4.5 AS Decimal(18, 1)), N'avg', N'high', N'regional', CAST(95.00 AS Decimal(18, 2)), 0) +INSERT [VehicleFloorPricingParameters] ([ID], [LowCondition], [HighCondition], [NADAFirstValue], [NADASecondValue], [MMRAdjustedValue], [PercentageOf], [ValuationServiceType]) VALUES (8, CAST(4.6 AS Decimal(18, 1)), CAST(5.0 AS Decimal(18, 1)), N'high', N'high', N'regional', CAST(95.00 AS Decimal(18, 2)), 0) +SET IDENTITY_INSERT [VehicleFloorPricingParameters] OFF + +SET IDENTITY_INSERT [RepoCompany] ON + +INSERT [RepoCompany] ([ID], [Name], [Email]) VALUES (1, N'Par', N'testemail@test.com') +INSERT [RepoCompany] ([ID], [Name], [Email]) VALUES (2, N'Surrender', N'Email@email.com') +INSERT [RepoCompany] ([ID], [Name], [Email]) VALUES (4, N'Repossessors', N'test@gmail.com') +INSERT [RepoCompany] ([ID], [Name], [Email]) VALUES (5, N'Allied Skip Claim', N'dianavandebogert@landmarkcu.com') +INSERT [RepoCompany] ([ID], [Name], [Email]) VALUES (7, N'Badgerland', N'test@gmail.com') +INSERT [RepoCompany] ([ID], [Name], [Email]) VALUES (8, N'No Repo Company Assigned', N'none@none.com') +INSERT [RepoCompany] ([ID], [Name], [Email]) VALUES (9, N'All City Towing', N'morgan@allcitytowing@yahoo.com') +INSERT [RepoCompany] ([ID], [Name], [Email]) VALUES (10, N'National Asset Solutions,Inc. ', N'dennis@nas-now.com') +INSERT [RepoCompany] ([ID], [Name], [Email]) VALUES (11, N'Location Services', N'Jodie.Selby@location-services.com') +INSERT [RepoCompany] ([ID], [Name], [Email]) VALUES (12, N'Insurance Company', N'billjohns@landmarkcu.com') +SET IDENTITY_INSERT [RepoCompany] OFF + +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'2CUV', N'2 Door Crossover Utility Vehicle') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'2D', N'2 Door Vehicle') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'2DCP', N'2 Door Coupe') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'2DCV', N'2 Door Convertible') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'2DHB', N'2 Door Hatch Back') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'2DHT', N'2 Door Hard Top') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'2DLB', N'2 Door Lift Back') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'2DSN', N'2 Door Sedan') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'2DST', N'2 Door Soft Top') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'2MPV', N'2 Door Multi-Purpose Vehicle') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'2PUT', N'2 Door Pickup Truck') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'2STK', N'Stake Bed Truck') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'2SUT', N'2 Door Sport Utility Truck') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'2SUV', N'2 Door Sport Utility Vehicle') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'2VAN', N'2 Door Van') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'3APV', N'3 Door All Purpose Vehicle') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'3D', N'3 Door Vehicle') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'3DCP', N'3 Door Coupe') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'3DHB', N'3 Door Hatch Back') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'3DLB', N'3 Door Lift Back') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'3DSN', N'3 Door Sedan') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'3DTT', N'3 Door T-Top') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'3DVN', N'3 Door Van') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'3MPV', N'3 Door Multi-Purpose Vehicle') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'3PUT', N'3 Door Extended Cab Pickup Truck') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'3TRK', N'3 Door Truck') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'3VAN', N'3 Door Cargo Van') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'3WGN', N'3 Door Wagon') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'4APV', N'4 Door All Purpose Vehicle') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'4CAB', N'Crew Cab') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'4CUV', N'4 Door Crossover Utility Vehicle') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'4D', N'4 Door Vehicle') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'4DCP', N'4 Door Coupe') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'4DHB', N'4 Door Hatch Back') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'4DHT', N'4 Door Hard Top') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'4DLB', N'4 Door Lift Back') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'4DSN', N'4 Door Sedan') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'4MPV', N'4 Door Multi-Purpose Vehicle') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'4PUT', N'4 Door Pickup Truck') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'4SUT', N'4 Door Sport Utility Truck') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'4SUV', N'4 Door Sport Utility Vehicle') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'4VAN', N'4 Door Van') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'4WGN', N'4 Door Wagon') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'5DHB', N'5 Door Hatch Back') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'5DLB', N'5 Door Lift Back') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'5DSN', N'5 Door Sedan') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'5MPV', N'5 Door Multi-Purpose Vehicle') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'5WHL', N'5th Wheel') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'APV', N'All Purpose Vehicle') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'ATV', N'All Terrain Vehicle') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'BBOW', N'Bowrider') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'BCAB', N'Cabin/Cuddy') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'BDCK', N'Deck') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'BDIN', N'Canoe/Dinghie') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'BFIS', N'Fishing') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'BHOU', N'House Boat') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'BOAT', N'Boat') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'BPER', N'Performance') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'BPON', N'Pontoon') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'BSAI', N'Sail Boat') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'BSKI', N'Skiboat') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'BUS', N'Bus') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'CABO', N'Cabover Tractor') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'CAMP', N'Camper') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'CBKT', N'Bucket Truck') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'CCMP', N'Air Compressor') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'CCRN', N'Crane') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'CDD', N'Digger Derrick') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'CDOZ', N'Bulldozer') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'CEXE', N'Excavator') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'CFRK', N'Forklift') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'CGEN', N'Generator') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'CLOD', N'Loader') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'CONS', N'Construction Equip.') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'CONV', N'Conventional Tractor') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'CPAC', N'Packer Truck') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'CREW', N'4 Door Full Rear Door Cab') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'CTRN', N'Trencher') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'CVAN', N'Cargo Van') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'CWLD', N'Welder') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'DCAB', N'Double Cab Truck') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'FARM', N'Farm Equip.') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'GOLF', N'Golf Cart') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'HBOX', N'Box Truck') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'HC3', N'Class 3') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'HC4', N'Class 4') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'HC5', N'Class 5') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'HC6', N'Class 6') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'HC7', N'Class 7') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'HC8', N'Class 8') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'HCAB', N'Cab/Chassis') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'HCR', N'Car Carrier') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'HDMP', N'Dump') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'HFLT', N'Flatbed') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'HLFT', N'Lift Platform') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'HSTP', N'Stepvan') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'HTNK', N'Tanker') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'HTRK', N'Heavy Truck') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'HTRL', N'Horse Trailer') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'HUSV', N'Cutaway Chassis w/UB') +GO +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'HUTL', N'Utility Truck') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'INC', N'Incomplete Truck') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'JSKI', N'Jet Ski') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'KOMB', N'Volkswagen Bus (Truck)') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'LIMO', N'Limousine') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'M/C', N'Motorcycle') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'MEGA', N'Mega Body') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'MH', N'Motor Home') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'MIC', N'Motorcycle') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'MPV', N'Multi-Purpose Vehicle') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'OTH', N'Other') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'PART', N'Parts') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'PDIR', N'Dirt Bike') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'PDUN', N'Dune Buggy') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'PMTR', N'Park Model Trailer') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'PS', N'Powersports') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'PUT', N'Pickup Truck') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'PWTR', N'Personal Watercraft') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'QUAD', N'Quad Cab') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'RCAB', N'Regular Cab') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'RMOB', N'Mobile Home') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'RV', N'Recreation Vehicle') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'RVCA', N'RV Class A') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'RVCB', N'RV Class B') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'RVCC', N'RV Class C') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'RVFD', N'Fold Down') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'RVFW', N'Fifth Wheel') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'RVHT', N'Horse Trailer w/Living') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'RVSU', N'SURV-w/Garage') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'RVTC', N'Truck Camper') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'SEMI', N'Semi Tractor') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'SNOW', N'Snowmobile') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'SUV', N'Sport Utility Vehicle') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'SW2D', N'2 Door Station Wagon') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'SW4D', N'4 Door Station Wagon') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'SW5D', N'5 Door Station Wagon') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'TNTR', N'Tent Trailer') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'TRAC', N'Tractor Trailer') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'TRB', N'Boat Trailer') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'TRCM', N'Truck Camper') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'TREN', N'Utility Enclosed') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'TRK', N'Truck') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'TRLR', N'Trailer') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'TRMC', N'Rail Motorcycle') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'TROP', N'Utility Open') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'TRSE', N'Semi Trailer') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'TTRL', N'Travel Trailer') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'UTIL', N'Heavy Equipment') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'VAN', N'Van') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'WGN', N'Wagon') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'XC2D', N'Extended Cab - 2 Doors') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'XC3D', N'Extended Cab - 3 Doors') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'XC4D', N'Extended Cab - 4 Doors (Not Crew)') +INSERT [BodyStyleCodes] ([Code], [Description]) VALUES (N'XCAB', N'Extended Cab') +INSERT [CleaningLevelCodes] ([Code], [Description]) VALUES (1, N'No Cleaning') +INSERT [CleaningLevelCodes] ([Code], [Description]) VALUES (2, N'Full Detail') +INSERT [CleaningLevelCodes] ([Code], [Description]) VALUES (3, N'Wash and Vacuum Only') +INSERT [CleaningLevelCodes] ([Code], [Description]) VALUES (4, N'Value/Standard') +INSERT [CleaningLevelCodes] ([Code], [Description]) VALUES (5, N'Deluxe/Front Line Ready') +INSERT [CleaningLevelCodes] ([Code], [Description]) VALUES (6, N'Deluxe/High Line Detail') +INSERT [CleaningLevelCodes] ([Code], [Description]) VALUES (7, N'Deluxe/Sponsored Plus') +INSERT [CleaningLevelCodes] ([Code], [Description]) VALUES (8, N'Deluxe/Extra Step') +INSERT [CleaningLevelCodes] ([Code], [Description]) VALUES (9, N'Partial Detail') +INSERT [CleaningLevelCodes] ([Code], [Description]) VALUES (10, N'Ultra Detail') +SET IDENTITY_INSERT [CollateralTypes] ON + +INSERT [CollateralTypes] ([ID], [Description], [LookupHandler]) VALUES (2, N'Vehicle', N'NADAValueLookup') +INSERT [CollateralTypes] ([ID], [Description], [LookupHandler]) VALUES (6, N'Motorcycle', N'') +INSERT [CollateralTypes] ([ID], [Description], [LookupHandler]) VALUES (7, N'Boat', N'') +INSERT [CollateralTypes] ([ID], [Description], [LookupHandler]) VALUES (8, N'Motor', N'') +INSERT [CollateralTypes] ([ID], [Description], [LookupHandler]) VALUES (9, N'Trailer', N'') +INSERT [CollateralTypes] ([ID], [Description], [LookupHandler]) VALUES (10, N'Powersport', N'') +INSERT [CollateralTypes] ([ID], [Description], [LookupHandler]) VALUES (11, N'Other', N'') +INSERT [CollateralTypes] ([ID], [Description], [LookupHandler]) VALUES (12, N'Camper', N'') +SET IDENTITY_INSERT [CollateralTypes] OFF +SET IDENTITY_INSERT [CollateralTypesToVehicleTypes] ON + +INSERT [CollateralTypesToVehicleTypes] ([ID], [CollateralTypeId], [VehicleTypeId]) VALUES (1, 2, 0) +INSERT [CollateralTypesToVehicleTypes] ([ID], [CollateralTypeId], [VehicleTypeId]) VALUES (2, 2, 1) +INSERT [CollateralTypesToVehicleTypes] ([ID], [CollateralTypeId], [VehicleTypeId]) VALUES (3, 2, 8) +INSERT [CollateralTypesToVehicleTypes] ([ID], [CollateralTypeId], [VehicleTypeId]) VALUES (4, 6, 4) +INSERT [CollateralTypesToVehicleTypes] ([ID], [CollateralTypeId], [VehicleTypeId]) VALUES (5, 7, 3) +INSERT [CollateralTypesToVehicleTypes] ([ID], [CollateralTypeId], [VehicleTypeId]) VALUES (6, 8, 3) +INSERT [CollateralTypesToVehicleTypes] ([ID], [CollateralTypeId], [VehicleTypeId]) VALUES (7, 9, 3) +INSERT [CollateralTypesToVehicleTypes] ([ID], [CollateralTypeId], [VehicleTypeId]) VALUES (8, 9, 7) +INSERT [CollateralTypesToVehicleTypes] ([ID], [CollateralTypeId], [VehicleTypeId]) VALUES (9, 6, 13) +INSERT [CollateralTypesToVehicleTypes] ([ID], [CollateralTypeId], [VehicleTypeId]) VALUES (10, 10, 11) +INSERT [CollateralTypesToVehicleTypes] ([ID], [CollateralTypeId], [VehicleTypeId]) VALUES (11, 10, 12) +INSERT [CollateralTypesToVehicleTypes] ([ID], [CollateralTypeId], [VehicleTypeId]) VALUES (12, 10, 14) +INSERT [CollateralTypesToVehicleTypes] ([ID], [CollateralTypeId], [VehicleTypeId]) VALUES (13, 10, 6) +INSERT [CollateralTypesToVehicleTypes] ([ID], [CollateralTypeId], [VehicleTypeId]) VALUES (14, 2, 9) +INSERT [CollateralTypesToVehicleTypes] ([ID], [CollateralTypeId], [VehicleTypeId]) VALUES (15, 11, 5) +INSERT [CollateralTypesToVehicleTypes] ([ID], [CollateralTypeId], [VehicleTypeId]) VALUES (16, 11, 10) +INSERT [CollateralTypesToVehicleTypes] ([ID], [CollateralTypeId], [VehicleTypeId]) VALUES (17, 12, 2) +INSERT [CollateralTypesToVehicleTypes] ([ID], [CollateralTypeId], [VehicleTypeId]) VALUES (18, 9, 6) +SET IDENTITY_INSERT [CollateralTypesToVehicleTypes] OFF +INSERT [HoldStatusCodes] ([Code], [Description]) VALUES (0, N'No Hold') +INSERT [HoldStatusCodes] ([Code], [Description]) VALUES (1, N'Bankruptcy') +INSERT [HoldStatusCodes] ([Code], [Description]) VALUES (2, N'Insurance') +INSERT [HoldStatusCodes] ([Code], [Description]) VALUES (3, N'Legal') +INSERT [HoldStatusCodes] ([Code], [Description]) VALUES (4, N'Other Buyer') +INSERT [HoldStatusCodes] ([Code], [Description]) VALUES (5, N'Repo') +INSERT [HoldStatusCodes] ([Code], [Description]) VALUES (6, N'Special Promotion') +INSERT [HoldStatusCodes] ([Code], [Description]) VALUES (7, N'Moved') +INSERT [HoldStatusCodes] ([Code], [Description]) VALUES (9, N'Other') +INSERT [HoldStatusCodes] ([Code], [Description]) VALUES (10, N'Error') +INSERT [HoldStatusCodes] ([Code], [Description]) VALUES (11, N'Inspection') +INSERT [HoldStatusCodes] ([Code], [Description]) VALUES (12, N'Title Problem') +INSERT [HoldStatusCodes] ([Code], [Description]) VALUES (13, N'Redemption') +INSERT [HoldStatusCodes] ([Code], [Description]) VALUES (14, N'Dealer Repurchase') +INSERT [HoldStatusCodes] ([Code], [Description]) VALUES (15, N'Keys') +INSERT [HoldStatusCodes] ([Code], [Description]) VALUES (16, N'Mechanical') +INSERT [HoldStatusCodes] ([Code], [Description]) VALUES (17, N'Paint & Body') +INSERT [HoldStatusCodes] ([Code], [Description]) VALUES (18, N'Transportation Delay') +INSERT [HoldStatusCodes] ([Code], [Description]) VALUES (19, N'Corrections') +INSERT [HoldStatusCodes] ([Code], [Description]) VALUES (20, N'Military') +INSERT [HoldStatusCodes] ([Code], [Description]) VALUES (21, N'Notice Of Intent') +INSERT [HoldStatusCodes] ([Code], [Description]) VALUES (22, N'Notice Of Sale') +INSERT [HoldStatusCodes] ([Code], [Description]) VALUES (23, N'Upstream/Online Sale') +INSERT [HoldStatusCodes] ([Code], [Description]) VALUES (24, N'Recall') +INSERT [Letters] ([ActionCode], [Description], [DaysToWait], [WhenLetterIsSent]) VALUES (N'700 ', N'RTC-Illinois', 15, N'BeforeO4R') +INSERT [Letters] ([ActionCode], [Description], [DaysToWait], [WhenLetterIsSent]) VALUES (N'701 ', N'Right to Reinstate/Redeem-Illinois', 22, N'AfterO4R') +INSERT [Letters] ([ActionCode], [Description], [DaysToWait], [WhenLetterIsSent]) VALUES (N'702 ', N'Affidavit of Defense-Illinois', 22, N'AfterO4R') +INSERT [Letters] ([ActionCode], [Description], [DaysToWait], [WhenLetterIsSent]) VALUES (N'703 ', N'Notice of Plan to Sell-Illinois', 22, N'AfterO4R') +INSERT [Letters] ([ActionCode], [Description], [DaysToWait], [WhenLetterIsSent]) VALUES (N'704 ', N'Repo: Surplus-Deficiency Notice', 0, N'AfterSale') +INSERT [Letters] ([ActionCode], [Description], [DaysToWait], [WhenLetterIsSent]) VALUES (N'ILLSU', N'ILLINOIS SURRENDER', 0, N'BeforeO4R') +INSERT [Letters] ([ActionCode], [Description], [DaysToWait], [WhenLetterIsSent]) VALUES (N'LTR34', N'Repo-Notice of Repossession', 15, N'AfterO4R') +INSERT [Letters] ([ActionCode], [Description], [DaysToWait], [WhenLetterIsSent]) VALUES (N'LTR35', N'WI Repo-Notice of Sale', 15, N'AfterO4R') +INSERT [Letters] ([ActionCode], [Description], [DaysToWait], [WhenLetterIsSent]) VALUES (N'LTR36', N'WI Repo-Sale of Collateral Notice', 15, N'AfterO4R') +INSERT [Letters] ([ActionCode], [Description], [DaysToWait], [WhenLetterIsSent]) VALUES (N'RTC ', N'Notice to repossess/prior expired RTC', 0, N'BeforeO4R') +INSERT [Letters] ([ActionCode], [Description], [DaysToWait], [WhenLetterIsSent]) VALUES (N'RTC 1', N'RTC Non Auto & Non Cycle', 15, N'BeforeO4R') +INSERT [Letters] ([ActionCode], [Description], [DaysToWait], [WhenLetterIsSent]) VALUES (N'RTC 3', N'RTC-AUTO LOANS-WI', 15, N'BeforeO4R') +INSERT [Letters] ([ActionCode], [Description], [DaysToWait], [WhenLetterIsSent]) VALUES (N'RTC2 ', N'RTC New Law', 15, N'BeforeO4R') +INSERT [Letters] ([ActionCode], [Description], [DaysToWait], [WhenLetterIsSent]) VALUES (N'RTCSP', N'SPANISH RTC WI AUTO LOANS', 15, N'BeforeO4R') +INSERT [Letters] ([ActionCode], [Description], [DaysToWait], [WhenLetterIsSent]) VALUES (N'VOL', N'Wisconsin Surrender', 0, N'BeforeO4R') +INSERT [LocationTypeCodes] ([Code], [Description]) VALUES (1, N'Business') +INSERT [LocationTypeCodes] ([Code], [Description]) VALUES (2, N'Residence') +INSERT [LocationTypeCodes] ([Code], [Description]) VALUES (3, N'Marshalling Yard') +INSERT [LocationTypeCodes] ([Code], [Description]) VALUES (4, N'Auction') +INSERT [LocationTypeCodes] ([Code], [Description]) VALUES (5, N'Dealership') +INSERT [LocationTypeCodes] ([Code], [Description]) VALUES (6, N'Impound Lot') +INSERT [LocationTypeCodes] ([Code], [Description]) VALUES (7, N'Repo Agent') +INSERT [LocationTypeCodes] ([Code], [Description]) VALUES (8, N'Body Shop') +INSERT [LocationTypeCodes] ([Code], [Description]) VALUES (9, N'Repair Shop') +INSERT [LocationTypeCodes] ([Code], [Description]) VALUES (10, N'Government') +INSERT [LocationTypeCodes] ([Code], [Description]) VALUES (11, N'Tow Company') +INSERT [LocationTypeCodes] ([Code], [Description]) VALUES (12, N'Street') +INSERT [LocationTypeCodes] ([Code], [Description]) VALUES (13, N'Unknown') +INSERT [VehicleTypeCodes] ([Code], [Description]) VALUES (N'0', N'Car or Light Truck') +INSERT [VehicleTypeCodes] ([Code], [Description]) VALUES (N'1', N'Medium or Heavy Truck') +INSERT [VehicleTypeCodes] ([Code], [Description]) VALUES (N'10', N'Yellow Steel') +INSERT [VehicleTypeCodes] ([Code], [Description]) VALUES (N'11', N'jet Ski') +INSERT [VehicleTypeCodes] ([Code], [Description]) VALUES (N'12', N'ATV') +INSERT [VehicleTypeCodes] ([Code], [Description]) VALUES (N'13', N'Moped') +INSERT [VehicleTypeCodes] ([Code], [Description]) VALUES (N'14', N'Snowmobile') +INSERT [VehicleTypeCodes] ([Code], [Description]) VALUES (N'2', N'RV') +INSERT [VehicleTypeCodes] ([Code], [Description]) VALUES (N'3', N'Boat') +INSERT [VehicleTypeCodes] ([Code], [Description]) VALUES (N'4', N'Motorcycle') +INSERT [VehicleTypeCodes] ([Code], [Description]) VALUES (N'5', N'Other') +INSERT [VehicleTypeCodes] ([Code], [Description]) VALUES (N'6', N'Powersport') +INSERT [VehicleTypeCodes] ([Code], [Description]) VALUES (N'7', N'Trailer') +INSERT [VehicleTypeCodes] ([Code], [Description]) VALUES (N'8', N'Box Truck') +INSERT [VehicleTypeCodes] ([Code], [Description]) VALUES (N'9', N'Tractor Trailer') + +SET IDENTITY_INSERT [LoanCategories] ON + +INSERT [LoanCategories] ([ID], [CategoryName]) VALUES (1, N'Vehicle') +INSERT [LoanCategories] ([ID], [CategoryName]) VALUES (2, N'Marine') +INSERT [LoanCategories] ([ID], [CategoryName]) VALUES (3, N'Recreation') +INSERT [LoanCategories] ([ID], [CategoryName]) VALUES (4, N'Motorcycle') +SET IDENTITY_INSERT [LoanCategories] OFF + +SET IDENTITY_INSERT [AccountTypeCodes] ON + +INSERT [AccountTypeCodes] ([ID], [AccountTypeCode], [Description], [IsVisible], [CategoryId]) VALUES (10, N'L-A3 ', N'36 MO USED AUTO RPM LOAN', 1, 1) +INSERT [AccountTypeCodes] ([ID], [AccountTypeCode], [Description], [IsVisible], [CategoryId]) VALUES (11, N'L-A4 ', N'48 MO USED AUTO RPM LOAN', 1, 1) +INSERT [AccountTypeCodes] ([ID], [AccountTypeCode], [Description], [IsVisible], [CategoryId]) VALUES (12, N'L-A5 ', N'60 MO USED AUTO RPM LOAN', 1, 1) +INSERT [AccountTypeCodes] ([ID], [AccountTypeCode], [Description], [IsVisible], [CategoryId]) VALUES (13, N'L-AB ', N'NEW AUTOS/TRUCKS', 1, 1) +INSERT [AccountTypeCodes] ([ID], [AccountTypeCode], [Description], [IsVisible], [CategoryId]) VALUES (14, N'L-AC ', N'USED AUTO/TRUCK', 1, 1) +INSERT [AccountTypeCodes] ([ID], [AccountTypeCode], [Description], [IsVisible], [CategoryId]) VALUES (15, N'L-AD ', N'MOTORCYCLES NEW', 1, 4) +INSERT [AccountTypeCodes] ([ID], [AccountTypeCode], [Description], [IsVisible], [CategoryId]) VALUES (16, N'L-AE ', N'RECREATIONAL VEHICLE', 1, 3) +INSERT [AccountTypeCodes] ([ID], [AccountTypeCode], [Description], [IsVisible], [CategoryId]) VALUES (17, N'L-AF ', N'MOTORCYCLES USED', 1, 4) +INSERT [AccountTypeCodes] ([ID], [AccountTypeCode], [Description], [IsVisible], [CategoryId]) VALUES (18, N'L-AN ', N'NEW INDIRECT REC VEHICLE', 1, 3) +INSERT [AccountTypeCodes] ([ID], [AccountTypeCode], [Description], [IsVisible], [CategoryId]) VALUES (19, N'L-AU ', N'USED INDIRECT REC VEHICLE', 1, 3) +INSERT [AccountTypeCodes] ([ID], [AccountTypeCode], [Description], [IsVisible], [CategoryId]) VALUES (20, N'L-B4 ', N'NEW BOAT DEALER', 1, 2) +INSERT [AccountTypeCodes] ([ID], [AccountTypeCode], [Description], [IsVisible], [CategoryId]) VALUES (21, N'L-B5 ', N'BOAT LOAN', 1, 2) +INSERT [AccountTypeCodes] ([ID], [AccountTypeCode], [Description], [IsVisible], [CategoryId]) VALUES (23, N'L-BN ', N'DEALER NEW MOTORCYCLE', 1, 4) +INSERT [AccountTypeCodes] ([ID], [AccountTypeCode], [Description], [IsVisible], [CategoryId]) VALUES (24, N'L-BO ', N'BOATS', 1, 2) +INSERT [AccountTypeCodes] ([ID], [AccountTypeCode], [Description], [IsVisible], [CategoryId]) VALUES (25, N'L-BU ', N'DEALER USED MOTORCYCLE', 1, 4) +INSERT [AccountTypeCodes] ([ID], [AccountTypeCode], [Description], [IsVisible], [CategoryId]) VALUES (26, N'L-CA ', N'CENTRIX AUTO', 1, 1) +INSERT [AccountTypeCodes] ([ID], [AccountTypeCode], [Description], [IsVisible], [CategoryId]) VALUES (36, N'L-H1 ', N'FIXED AUTO/TRUCK', 1, 1) +INSERT [AccountTypeCodes] ([ID], [AccountTypeCode], [Description], [IsVisible], [CategoryId]) VALUES (50, N'L-HT ', N'HARTFORD-USED AUTO/TRUCK', 1, 1) +INSERT [AccountTypeCodes] ([ID], [AccountTypeCode], [Description], [IsVisible], [CategoryId]) VALUES (61, N'L-NB ', N'DEALER BUS NEW VEHICLE', 1, 1) +INSERT [AccountTypeCodes] ([ID], [AccountTypeCode], [Description], [IsVisible], [CategoryId]) VALUES (62, N'L-NF ', N'DEALER NEW FRESH START', 1, 1) +INSERT [AccountTypeCodes] ([ID], [AccountTypeCode], [Description], [IsVisible], [CategoryId]) VALUES (63, N'L-NR ', N'Dealer New Rec. Vehicle-IL', 1, 3) +INSERT [AccountTypeCodes] ([ID], [AccountTypeCode], [Description], [IsVisible], [CategoryId]) VALUES (69, N'L-P1 ', N'DEALER USED 1YR OLD', 1, 1) +INSERT [AccountTypeCodes] ([ID], [AccountTypeCode], [Description], [IsVisible], [CategoryId]) VALUES (70, N'L-P2 ', N'DEALER USED 2YRS OLD', 1, 1) +INSERT [AccountTypeCodes] ([ID], [AccountTypeCode], [Description], [IsVisible], [CategoryId]) VALUES (71, N'L-P3 ', N'DEALER USED 3YRS OLD', 1, 1) +INSERT [AccountTypeCodes] ([ID], [AccountTypeCode], [Description], [IsVisible], [CategoryId]) VALUES (72, N'L-P4 ', N'DEALER USED 4YRS OLD', 1, 1) +INSERT [AccountTypeCodes] ([ID], [AccountTypeCode], [Description], [IsVisible], [CategoryId]) VALUES (73, N'L-P5 ', N'DEALER USED 5 +YRS OLD', 1, 1) +INSERT [AccountTypeCodes] ([ID], [AccountTypeCode], [Description], [IsVisible], [CategoryId]) VALUES (74, N'L-P6 ', N'Dealer 1st Time Buyer New-IL', 1, 1) +INSERT [AccountTypeCodes] ([ID], [AccountTypeCode], [Description], [IsVisible], [CategoryId]) VALUES (75, N'L-P7 ', N'Dealer 1st Time Buyer Used-IL', 1, 1) +INSERT [AccountTypeCodes] ([ID], [AccountTypeCode], [Description], [IsVisible], [CategoryId]) VALUES (76, N'L-P8 ', N'Dealer College Grad New-IL', 1, 1) +INSERT [AccountTypeCodes] ([ID], [AccountTypeCode], [Description], [IsVisible], [CategoryId]) VALUES (77, N'L-P9 ', N'Dealer College Grad Used-IL', 1, 1) +INSERT [AccountTypeCodes] ([ID], [AccountTypeCode], [Description], [IsVisible], [CategoryId]) VALUES (80, N'L-PN ', N'DEALER NEW', 1, 1) +INSERT [AccountTypeCodes] ([ID], [AccountTypeCode], [Description], [IsVisible], [CategoryId]) VALUES (113, N'L-UB ', N'DEALER BUS USED VEHICLE', 1, 1) +INSERT [AccountTypeCodes] ([ID], [AccountTypeCode], [Description], [IsVisible], [CategoryId]) VALUES (114, N'L-UF ', N'DEALER USER FRESH START', 1, 1) +INSERT [AccountTypeCodes] ([ID], [AccountTypeCode], [Description], [IsVisible], [CategoryId]) VALUES (115, N'L-UM ', N'Dealer Used Motorcycle-IL', 1, 4) +INSERT [AccountTypeCodes] ([ID], [AccountTypeCode], [Description], [IsVisible], [CategoryId]) VALUES (116, N'L-UV ', N'BRANCH USED DEALER', 1, 1) +INSERT [AccountTypeCodes] ([ID], [AccountTypeCode], [Description], [IsVisible], [CategoryId]) VALUES (120, N'L-X4 ', N'DEALER USED RPM LOAN', 1, 1) +INSERT [AccountTypeCodes] ([ID], [AccountTypeCode], [Description], [IsVisible], [CategoryId]) VALUES (121, N'L-XB ', N'DEALER NEW 1ST TIME BUYER', 1, 1) +INSERT [AccountTypeCodes] ([ID], [AccountTypeCode], [Description], [IsVisible], [CategoryId]) VALUES (123, N'L-XL ', N'USED DEALER 1ST TIME BUYER', 1, 1) +INSERT [AccountTypeCodes] ([ID], [AccountTypeCode], [Description], [IsVisible], [CategoryId]) VALUES (178, N'L-NI', N'Dealer New Auto-IL', 1, 1) +SET IDENTITY_INSERT [AccountTypeCodes] OFF + +GO +SET IDENTITY_INSERT [AllowedStatusChanges] ON + +INSERT [AllowedStatusChanges] ([ID], [CurrentStatus], [AllowedChangeStatus]) VALUES (1, N'REPO', N'SOLD') +INSERT [AllowedStatusChanges] ([ID], [CurrentStatus], [AllowedChangeStatus]) VALUES (3, N'O4R', N'REPO') +INSERT [AllowedStatusChanges] ([ID], [CurrentStatus], [AllowedChangeStatus]) VALUES (4, N'O4R', N'REHO') +INSERT [AllowedStatusChanges] ([ID], [CurrentStatus], [AllowedChangeStatus]) VALUES (5, N'O4R', N'RECA') +INSERT [AllowedStatusChanges] ([ID], [CurrentStatus], [AllowedChangeStatus]) VALUES (6, N'O4R', N'PSKP') +INSERT [AllowedStatusChanges] ([ID], [CurrentStatus], [AllowedChangeStatus]) VALUES (7, N'REDEEMED', N'O4R') +INSERT [AllowedStatusChanges] ([ID], [CurrentStatus], [AllowedChangeStatus]) VALUES (8, N'RECA', N'O4R') +INSERT [AllowedStatusChanges] ([ID], [CurrentStatus], [AllowedChangeStatus]) VALUES (9, N'REHO', N'O4R') +INSERT [AllowedStatusChanges] ([ID], [CurrentStatus], [AllowedChangeStatus]) VALUES (10, N'REHO', N'O4R') +INSERT [AllowedStatusChanges] ([ID], [CurrentStatus], [AllowedChangeStatus]) VALUES (12, N'REPO', N'REDEEMED') +INSERT [AllowedStatusChanges] ([ID], [CurrentStatus], [AllowedChangeStatus]) VALUES (15, N'REDEEMED', N'REPO') +SET IDENTITY_INSERT [AllowedStatusChanges] OFF + +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1060', N'Dealers Auto Auction Southwest', N'yes', N'1433 South 19th Avenue', N'-', N'Phoenix', N'AZ', '85009', N'USA', N'(602) 253-7766', N'(602) 253-4646', 33.4337272644043, -112.09916687011719) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1061', N'ADESA Portland', N'yes', N'23585 NE Sandy Blvd.', N'-', N'Wood Village', N'OR', '97060', N'USA', N'(800) 300-3200', N'(503) 661-7286', 45.545101165771484, -122.41893005371094) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1062', N'ADESA Northwest', N'yes', N'90485 Auction Way', N'-', N'Eugene', N'OR', '97402', N'USA', N'(800) 905-3901', N'(541) 689-6049', 44.122535705566406, -123.17698669433594) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1063', N'ADESA Sacramento Brasher`s', N'yes', N'6233 Blacktop Road', N'PO Box 73000', N'Rio Linda', N'CA', '95673', N'USA', N'(800) 288-6882', N'(916) 992-8764', 38.67979, -121.48175) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1064', N'Carolina Auto Auction', N'yes', N'140 Webb Road', N'-', N'Williamston', N'SC', '29697', N'USA', N'(864) 231-7000', N'(864) 622-0003', 34.64129738509655, -82.58376382291317) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1066', N'Columbus Fair Auto Auction', N'yes', N'4700 Groveport Road', N'-', N'Obetz', N'OH', '43207', N'USA', N'(614) 497-2000', N'(614) 497-1711', 39.873294830322266, -82.941635131835938) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1067', N'Dealers Auto Auction of Oklahoma City, Inc.', N'yes', N'1028 South Portland Avenue', N'-', N'Oklahoma City', N'OK', '73108', N'USA', N'(405) 947-2886', N'(405)947-7642', 35.455406188964844, -97.580070495605469) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1068', N'Greater Quad City Auto Auction', N'yes', N'4015 78th Avenue', N'P.O. Box 409', N'Milan', N'IL', '61264', N'USA', N'(309) 787-6300', N'(309) 787-4541', 41.439964, -90.53186) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1069', N'Indiana Auto Auction', N'yes', N'4425 W. Washington Center Road', N'-', N'Fort Wayne', N'IN', '46818', N'USA', N'(260) 489-2776', N'(260) 489 5476', 41.128410339355469, -85.2020034790039) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1071', N'ADESA Little Rock', N'yes', N'8700 Highway 70', N'-', N'North Little Rock', N'AR', '72117', N'USA', N'(501) 945-2444', N'501-945-2605', 34.76812744140625, -92.1676254272461) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1073', N'Port City Auto Auction', N'yes', N'28 Port City Lane', N'P.O. Box 220', N'Richmond', N'ME', NULL, N'USA', N'(207) 737-8331', N'(207) 737-8346', 44.098858237266541, -69.86102856695652) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1074', N'Rawls Auto Auction Inc.', N'yes', N'2818 Pond Branch Rd.', N'-', N'Leesville', N'SC', '29070', N'USA', N'(803) 657-5111', N'(803) 657-6763', 33.8741340637207, -81.415969848632812) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1075', N'State Line Auto Auction Inc.', N'yes', N'830 Talmadge Hill Road South', N'-', N'Waverly', N'NY', '14892', N'USA', N'(607) 565-8151', N'(607) 565-8659', 42.010963, -76.504127) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1076', N'ADESA Fargo', N'yes', N'1650 East Main Ave.', N'PO Box 772', N'West Fargo', N'ND', '58078', N'USA', N'(701) 282-8203', N'(701) 281-0888', 46.877986907958984, -96.872528076171875) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1078', N'Central Pennsylvania Auto Auction', N'yes', N'PO Box 41', N'EXIT 178 OFF I-80 AIRSTRIP DR', N'Lock Haven', N'PA', '17745', N'USA', N'(570) 726-4300', N'(570) 726-7841', 41.236843109130859, -77.47662353515625) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1079', N'Dealers Auto Auction of Chattanooga, LLC', N'yes', N'2120 Stein Drive', N'-', N'Chattanooga', N'TN', '37421', N'USA', N'(423) 499-0015', N'(423) 499-0304', 35.059501647949219, -85.183555603027344) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1080', N'Corry Auto Dealers Exchange', N'yes', N'12141 Route 6', N'P.O. Box 317', N'Corry', N'PA', '16407', N'USA', N'(814) 664-7721', N'(814) 664-7724', 41.916713714599609, -79.717788696289062) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1081', N'ADESA Pittsburgh', N'yes', N'378 Hunker Waltz Mill Road', N'P.O. Box 431', N'New Stanton', N'PA', '15672', N'USA', N'(724)925-4700', N'(724) 925-4702', 40.219378173351288, -79.638031795620918) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1082', N'Dyer Auto Auction', N'yes', N'P.O. Box 115', N'-', N'Dyer', N'IN', NULL, N'USA', N'(219) 865-2361', N'(219) 865-4472', 39.210121154785156, -86.857940673828125) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1083', N'Flint Auto Auction, Inc.', N'yes', N'3711 Western Road', N'-', N'Flint', N'MI', NULL, N'USA', N'(800) 284-0034', N'(810) 736-3351', 43.049087524414062, -83.657241821289062) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1084', N'Greater Kalamazoo Auto Auction', N'yes', N'900 North U.S. 131', N'P.O. Box 697', N'Schoolcraft', N'MI', '49087', N'USA', N'(800) 536-2047', N'(269) 679-4542', 42.145351409912109, -85.6377182006836) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1085', N'ADESA Boise', N'yes', N'7355 S. Eisenman Road', N'-', N'Boise', N'ID', '83716', N'USA', N'(800)346-7839', N'(208) 395-3126', 43.535114288330078, -116.16232299804688) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1086', N'Kesler Schaefer Auto Auction', N'yes', N'5333 West 46th Street', N'-', N'Indianapolis', N'IN', '46254', N'USA', N'(317) 297-2300', N'(317) 297-6234', 39.838397204875946, -86.25303715467453) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1087', N'ADESA San Diego', N'yes', N'2175 Cactus Road', N'-', N'San Diego', N'CA', '92154', N'USA', N'(619) 661-5565', N'866-926-4281', 32.558074, -116.986175) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1088', N'Morton Auto Auction', N'yes', N'410 Erie Ave', N'P.O. Box 442', N'Morton', N'IL', '61550', N'USA', N'(309) 263-7467', N'(309) 266-5414', 40.607376, -89.48001) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1089', N'KCI Auto Auction', N'yes', N'11101 North Congress', N'-', N'Kansas City', N'MO', '64153', N'USA', N'(816) 502-3318', N'(816) 801-8924', 39.294700622558594, -94.665802001953125) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1092', N'Southern Auto Auction', N'yes', N'161-164 South Main Street', N'-', N'East Windsor', N'CT', NULL, N'USA', N'(860) 292-7500', N'(860) 292-7599', 41.88697, -72.613151) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1094', N'ABC Virginia', N'yes', N'656 S MILITARY HWY', N'-', N'Virginia Beach', N'VA', '23464', N'USA', N'(757)-487-3464', N'(757)-485-2227', 36.823005676269531, -76.2085952758789) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1095', N'Acadia Auto Auction', N'yes', N'8 Murray Rd', NULL, N'Carmel', N'ME',' 4419', N'USA', N'(207) 848-2848', N'(207) 848-2080', 44.762305, -68.992913) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1096', N'Airport Auto Auction, Inc.', N'yes', N'PO Box 420', N'', N'Alcoa', N'TN', '37701', N'USA', N'(865) 970-9600', N'(865) 970-9603', 35.799949645996094, -83.977188110351562) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1097', N'ADESA Sarasota', N'yes', N'6005 24TH ST EAST', N'-', N'BRADENTON', N'FL', '34203', N'USA', N'(941) 756-8478', N'941-756-7546', 27.435420155525208, -82.5339337438345) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1098', N'Corpus Christi Auto Auction', N'yes', N'2149 IH 69 Access Rd.', N'-', N'Robstown', N'TX', '78380', N'USA', N'(800) 733-2133', N'(361) 767-9840', 27.78729248046875, -97.754470825195312) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1099', N'DAA Northwest', N'yes', N'2215 South Hayford Road', N'PO Box 19190', N'Spokane', N'WA', '99224', N'USA', N'(509) 244-4500', N'(509) 244-8244', 47.634048461914062, -117.55593109130859) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1100', N'America`s Auto Auction - Harrisburg', N'yes', N'1100 South York Street', N'-', N'Mechanicsburg', N'PA', '17055', N'USA', N'(717) 697-2222', N'(717) 697-2234', 40.197174072265625, -77.009918212890625) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1101', N'Poplar Bluff Auto Auction', N'yes', N'Route 7, Box 587', N'-', N'Poplar Bluff', N'MO', '63901', N'USA', N'(573) 686-1188', N'(573) 686-1870', 36.7733154296875, -90.4489974975586) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1102', N'ADESA Sioux Falls', N'yes', N'46893 271st Street', N'-', N'Tea', N'SD', '57064', N'USA', N'(605) 368-5364', N'(605) 368-2808', 43.460903167724609, -96.827133178710938) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1103', N'ADESA Syracuse', N'yes', N'5930 Route 31', N'-', N'Cicero', N'NY', '13039', N'USA', N'(315)699-2792', N'(315) 699-9620', 43.175739794969559, -76.112033352255821) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1104', N'Memphis Auto Auction', N'yes', N'3719 Old Getwell Road', N'-', N'Memphis', N'TN', '38118', N'USA', N'901-433-2302', N'901-334-4702', 35.046817779541016, -89.938682556152344) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1109', N'Manheim Knottingley', N'yes', N'Tadcaster Road, Brotherton', N'-', N'Knottingley', N'West Yorkshire', NULL, N'England', N'(101144) 1977-674151', N'(101144) 1977-607192', 53.738134, -1.263747) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1117', N'Manheim Bristol', N'yes', N'Ashton Vale Road', N'-', N'Ashton Vale', N'Bristol', NULL, N'England', N'(101144) 117-300-4400', N'(101144) 117-300-4444', 51.43916, -2.625) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1118', N'Manheim Rotherham', N'yes', N'Canklow Meadows Ind. Estate', N'West Bawtry Road', N'Rotherham', N'Rotherham', NULL, N'England', N'(101144) 1709-378989', N'(101144) 1709-369256', 53.405568, -1.352908) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1119', N'Manheim Birmingham United Kingdom', N'yes', N'Whitworth Close', N'Heath Road', N'Darlaston', N'AB', NULL, N'England', N'(101144) 0121-568-7500', N'(101144) 0121-568-7501', 55.1693954467773, -114.511039733887) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1120', N'Manheim Colchester', N'yes', N'Colchester Road', N'Frating', N'Colchester', N'Essex', NULL, N'England', N'(101144) 1206-250230', N'(101144) 1206-251190', 51.87098, 1.047389) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1121', N'Manheim Haydock', N'yes', N'Yewtee Trading Estate', N'Kilbuck Lane', N'Haydock', N'Lancashire', NULL, N'England', N'(101144) 1942-721245', N'9101144) 1942-271138', 53.4678, -2.6609) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1122', N'Manheim Mansfield', N'yes', N'Fulwood Industrial Estate', N'Common Road', N'Huthwaite', N'Sutton in Ashfield', NULL, N'England', N'(101144) 1623-554232', N'(101144) 1623-440285', 53.113551042643273, -1.3012484752668228) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1123', N'Manheim Northampton', N'yes', N'Salthouse Road', N'Brackmills Indistrial Estate', N'Northampton', N'-', NULL, N'England', N'(101144) 1604-764041', N'(101144) 1604-701749', 52.220713, -0.862687) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1124', N'Manheim Washington', N'yes', N'District 15', N'Pattinson Road', N'Washington', N'Tyne and Wear', NULL, N'England', N'(101144) 191-419-0000', N'(10144) 191-419-0033', 54.903955, -1.488957) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1129', N'ADESA Winnipeg', N'yes', N'Highway 7 North', N'PO Box 19, Group 242, RR 2', N'Winnipeg', N'MB', NULL, N'Canada', N'204-697-4400; 888-531-7653', N'204-694-4942', 49.95332, -97.2296999) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1130', N'ADESA Moncton', N'yes', N'47 Edinburgh Drive', N'-', N'Moncton', N'NB', NULL, N'Canada', N'(506) 857-0198', N'(506) 857-8258', 46.07162, -64.83233) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1131', N'ADESA Edmonton', N'yes', N'1701 9th Street', N'-', N'Nisku', N'AB', NULL, N'Canada', N'(780) 955-4400', N'780-955-4344', 53.3308104, -113.5127651) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1132', N'ADESA Toronto', N'yes', N'55 Auction Lane', N'-', N'Brampton', N'ON', NULL, N'Canada', N'(905) 790-7653', N'(905) 790-9454', 43.74926, -79.68764) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1135', N'ADESA Saskatoon', N'yes', N'618 48th Street East', N'-', N'Saskatoon', N'SK', NULL, N'Canada', N'306-242-8771; 800-667-1162', N'306-934-4630', 52.16917, -106.65918) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1137', N'Decatur Auto Auction, Inc.', N'yes', N'1991 W. Mound Rd.', N'-', N'Decatur', N'IL', '62526', N'USA', N'(217) 875-4220', N'(217) 875-2927', 39.889949798583984, -88.989761352539062) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1143', N'ADESA Tampa', N'yes', N'3225 North 50th Street', N'-', N'Tampa', N'FL', '33619', N'USA', N'(813) 620-3600', N'(813) 621-3199', 27.972984313964844, -82.398483276367188) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1145', N'ADESA Colorado Springs', N'yes', N'10680 Charter Oak Ranch Road', N'-', N'Fountain', N'CO', '80817', N'USA', N'(719) 391-6673', N'(719) 392-9385', 38.678710609674454, -104.71517868340015) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1151', N'ADESA Golden Gate', N'yes', N'18501 W. STANFORD RD.', N'-', N'TRACY', N'CA', '95377', N'USA', N'(209) 839-3972', N'(209) 834-2946', 37.731395, -121.537841) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1154', N'ADESA Kansas City', N'yes', N'15511 ADESA Dr.', N'-', N'Belton', N'MO', '64012', N'USA', N'816-348-7200', N'(816) 348-7331', 38.789482116699219, -94.551910400390625) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1160', N'ADESA Seattle', N'yes', N'621 - 37th Street NW', N'-', N'Auburn', N'WA', '98001', N'USA', N'(253) 735-1600', N'(253) 939-7875', 47.341682434082031, -122.23735046386719) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1163', N'ADESA Atlanta', N'yes', N'5055 Oakley Industrial Blvd', N'-', N'Fairburn', N'GA', '30213', N'USA', N'(770) 357-2277', N'(770) 357-2109', 33.5431022644043, -84.550567626953125) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1165', N'ADESA Shreveport', N'yes', N'7666 Highway 80 West', N'P.O. Box 19040 (71149)', N'Shreveport', N'LA', '71119', N'USA', N'(318) 938-4400', N'(318) 938-7960', 32.446987, -93.923194) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1166', N'ADESA Austin', N'yes', N'2108 Ferguson Lane', N'-', N'Austin', N'TX', '78754', N'USA', N'(512) 873-4000', N'(512) 873-4022', 30.346481323242188, -97.665718078613281) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1167', N'ADESA Birmingham', N'yes', N'804 Sollie Drive', N'-', N'Moody', N'AL', '35004', N'USA', N'(205) 640-1010', N'(205) 640-2585', 33.5791090875864, -86.511187702417374) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1168', N'ADESA Boston', N'yes', N'63 Western Avenue', NULL, N'Framingham', N'MA',' 1702', N'USA', N'(508) 626-7000', N'(508) 626-7111', 42.26317, -71.411078) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1169', N'ADESA Buffalo', N'yes', N'12200 Main Street', N'-', N'Akron', N'NY', '14001', N'USA', N'(716) 542-3300', N'716-542-3448', 43.020210266113281, -78.5027084350586) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1170', N'ADESA Charlotte', N'yes', N'11600 Fruehauf Drive', N'-', N'Charlotte', N'NC', '28273', N'USA', N'(704) 587-7653', N'(704) 587-9831', 35.129165649414062, -80.960258483886719) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1171', N'ADESA Cincinnati/Dayton', N'yes', N'4400 William C. Good Boulevard', N'-', N'Franklin', N'OH', '45005', N'USA', N'(937) 746-4000', N'(937) 746-1140', 39.542690277099609, -84.286376953125) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1172', N'ADESA Cleveland', N'yes', N'210 East Twinsburg Road', N'-', N'Northfield', N'OH', '44067', N'USA', N'(330) 467-8280', N'(330) 468-3196', 41.277317047119141, -81.504302978515625) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1173', N'ADESA Dallas', N'yes', N'3501 Lancaster-Hutchins Rd', N'-', N'Hutchins', N'TX', '75141', N'USA', N'972-225-6000', N'972-284-4799', 32.624584, -96.735504) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1174', N'ADESA Halifax', N'yes', N'300 Bell Boulevard', N'-', N'Enfield', N'NS', NULL, N'Canada', N'(902) 873-4400', N'(902) 873-3622', 44.88035, -63.52234) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1175', N'ADESA Houston', N'yes', N'4526 North Sam Houston', N'Parkway West', N'Houston', N'TX', '77086', N'USA', N'(281) 580-1800', N'(281) 885-5269', 29.940837860107422, -95.492240905761719) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1176', N'ADESA Indianapolis', N'yes', N'2950 East Main Street', N'-', N'Plainfield', N'IN', '46168', N'USA', N'317-838-8000', N'317-838-7809', 39.724506378173828, -86.352607727050781) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1177', N'ADESA Jacksonville', N'yes', N'11700 New Kings Road', N'-', N'Jacksonville', N'FL', '32219', N'USA', N'(904) 764-1004', N'(904) 766-0406', 30.445795, -81.770812) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1178', N'ADESA Knoxville', N'yes', N'1011 ADESA Parkway', N'-', N'Lenoir City', N'TN', '37771', N'USA', N'(865) 988-8000', N'(865) 988-5674', 35.821281433105469, -84.284736633300781) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1179', N'ADESA Lansing', N'yes', N'PO Box 359', N'6956 Lansing Road', N'Dimondale', N'MI', '48821', N'USA', N'517 322-2444', N'(517) 646-9160', 42.670719146728516, -84.660896301269531) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1180', N'ADESA Lexington', N'yes', N'672 Blue Sky Parkway', N'-', N'Lexington', N'KY', '40509', N'USA', N'(859) 263-5163', N'(859) 263-5693', 37.959514617919922, -84.378890991210938) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1181', N'ADESA Memphis', N'yes', N'5400 Getwell at Holmes Road', N'-', N'Memphis', N'TN', '38118', N'USA', N'(901) 365-6300', N'(901) 365-7716', 35.000778, -89.947647) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1183', N'ADESA Montreal', N'yes', N'300 Albert Mondou Boulevard', N'-', N'St-Eustache', N'QC', NULL, N'Canada', N'450-974-5746', N'-', 45.5473118, -73.9314186) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1184', N'ADESA New Jersey', N'yes', N'200 North Main St', NULL, N'Manville', N'NJ',' 8835', N'USA', N'(908) 725-2200', N'(908)725-3446', 40.54649, -74.58644) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1185', N'ADESA Ottawa', N'yes', N'1717 Burton Road', N'-', N'Vars', N'ON', NULL, N'Canada', N'(613) 443-4400', N'(613) 443-0523', 45.33391, -75.35299) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1186', N'ADESA Mercer', N'yes', N'758 Franklin Road', N'-', N'Mercer', N'PA', '16137', N'USA', N'(724) 662-4500', N'(724) 662-4513', 41.262695789337158, -80.178905948996544) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1187', N'ADESA Sacramento', N'yes', N'8649 Kiefer Boulevard', N'-', N'Sacramento', N'CA', '95826', N'USA', N'(916) 388-8899', N'(916) 388-0838', 38.547996520996094, -121.3841552734375) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1188', N'ADESA San Antonio', N'yes', N'200 South Callaghan Road', N'-', N'San Antonio', N'TX', '78227', N'USA', N'210-434-4999', N'(210) 431-0645', 29.433109283447266, -98.592521667480469) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1191', N'ADESA St. Louis', N'yes', N'7858 Highway 61-67', N'-', N'Barnhart', N'MO', '63012', N'USA', N'(636) 475-1320', N'(636) 479-7778', 38.319454193115234, -90.396072387695312) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1192', N'Iginite Portage', N'yes', N'W 10415 State Road 33', NULL, N'Portage', N'WI', '53901', NULL, N'(608) 742-8245', NULL, 43.51585, -89.518913) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1194', N'America`s Auto Auction - Greenville', N'yes', N'2415 Highway 101 South', N'-', N'Greer', N'SC', '29651', N'USA', N'(864) 801-1199', N'(864) 801-1085', 34.869384765625, -82.139106750488281) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1196', N'ADESA Minneapolis', N'yes', N'18270 Territorial Road', N'P.O. Box 360', N'Dayton', N'MN', '55369', N'USA', N'(763) 428-8777', N'(763) 428-6906', 45.16407, -93.513366) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1197', N'Auto Auction of Montana', N'yes', N'4432 S Frontage Road', N'P.O. Box 1433', N'Billings', N'MT', '59101', N'USA', N'(406) 252-6332', N'(406) 252-8126', 45.749431, -108.527832) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1198', N'Houston`s 1st Choice Auto Auction', N'yes', N'825 Rankin Road', N'-', N'Houston', N'TX', '77073', N'USA', N'(281) 821-2300', N'(281)821-2977', 29.968757629394531, -95.397880554199219) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1201', N'Auto Dealers Exchange - Indianapolis', N'yes', N'8635 Brookville Road', N'P O Box 39069', N'Indianapolis', N'IN', '46239', N'USA', N'(317) 352-0121', N'(317) 356-6597', 39.744422, -86.013336) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1202', N'ADESA Calgary', N'yes', N'1621 Veterans Blvd. NE', N'-', N'Airdrie', N'AB', NULL, N'Canada', N'403-912-4400', N'403-912-2018', 51.2986099, -113.98036) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1208', N'ADESA Des Moines', N'yes', N'1800 SE Gateway Drive', N'-', N'Grimes', N'IA', '50111', N'USA', N'(515) 986-1200', N'(515) 986-1260', 41.673925369977951, -93.7776754796505) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1209', N'Central Mass Auto Auction', N'yes', N'12 Industrial Park East', N'-', N'OXFORD', N'MA', NULL, N'USA', N'(508) 987-8396', N'(508) 987-6430', 42.087780833244324, -71.858730465173721) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1211', N'Mid-State Auto Auction', N'yes', N'310 Bach Avenue', N'PO Box 100', N'New York Mills', N'MN', '56567', N'USA', N'(218) 385-3777', N'(218) 385-3232', 46.522376909852028, -95.364027097821236) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1213', N'Auto Auction of New England', N'yes', N'8 Action Blvd', NULL, N'Londonderry', N'NH',' 3053', N'USA', N'603-437-5700', N'603-437-5858', 42.8720805004944, -71.337659320127) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1216', N'ADESA Concord', N'yes', N'77 HOSMER ST', NULL, N'ACTON', N'MA',' 1720', N'USA', N'(978) 263-7400', N'(978)263-7842', 42.4697093442174, -71.426227976053) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1225', N'Rochester-Syracuse Auto Auction, L.P.', N'yes', N'PO Box 129', N'1826 Route 414', N'Waterloo', N'NY', NULL, N'USA', N'(315) 539-5006', N'(315) 539-9508', 42.93634794652462, -76.8414144963026) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1227', N'ABC Detroit/Toledo', N'yes', N'9797 Fremont Pike', N'-', N'Perrysburg', N'OH', '43551', N'USA', N'(419) 872-0872', N'(419) 872-8617', 41.539768218994141, -83.582901000976562) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1228', N'ADESA Los Angeles', N'yes', N'11625 Nino Way', N'-', N'Mira Loma', N'CA', '91752', N'USA', N'951-361-9400', N'951-361-0595', 34.0059814453125, -117.53770446777344) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1229', N'ADESA Ocala', N'yes', N'540 SW 38th Avenue', N'-', N'Ocala', N'FL', '34474', N'USA', N'352-351-5100', N'352-390-2023', 29.181507110595703, -82.188896179199219) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1236', N'Indianapolis Car Exchange', N'yes', N'5161 South Indianapolis Road', N'Suite A', N'Whitestown', N'IN', '46075', N'USA', N'(317) 769-7777', N'(317) 769-7070', 39.96586, -86.37919) +GO +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1237', N'Greensboro Auto Auction', N'yes', N'3907 West Wendover Avenue', N'-', N'Greensboro', N'NC', '27407', N'USA', N'(336) 299-7777', N'(336) 854-2689', 36.059242248535156, -79.878158569335938) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1238', N'ADESA Tulsa', N'yes', N'16015 East Admiral Place', N'-', N'Tulsa', N'OK', '74116', N'USA', N'(918) 437-9044', N'(918) 437-9027', 36.161464691162109, -95.798110961914062) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1239', N'ADESA Nashville', N'yes', N'631 Burnett Road', N'-', N'Old Hickory', N'TN', '37188', N'USA', N'615-847-7400', N'(615) 847-0100', 36.281364440917969, -86.668220520019531) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1240', N'ADESA Great Lakes', N'yes', N'573 South Tuscola Road', N'-', N'Bay City', N'MI', '48708', N'USA', N'(989) 891-9570', N'(989) 891-9575', 43.548130035400391, -83.828033447265625) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1244', N'Mountain State Auto Auction', N'yes', N'5546 Benedum Drive', N'Interstate I-79, Exit 125', N'Shinnston', N'WV', '26431', N'USA', N'(304) 592-5300', N'(304) 592-2286', 39.35746, -80.21433) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1245', N'ADESA Washington D. C.', N'yes', N'43375 Old Ox Road', N'-', N'Dulles', N'VA', '20166', N'USA', N'(703) 996-1100', N'(703) 996-8812', 38.954814910888672, -77.501678466796875) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1246', N'West Michigan Auto Auction LLC', N'yes', N'4758 Division Street', N'-', N'Wayland', N'MI', '49348', N'USA', N'(800) 577-2886', N'(616) 877-2040', 42.682098388671875, -85.643539428710938) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1247', N'Norwalk Auto Auction', N'yes', N'12405 East Rosecrans Avenue', N'-', N'Norwalk', N'CA', '90650', N'USA', N'(562) 864-7464', N'(562) 863-6133', 33.902976, -118.068161) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1248', N'ADESA Reno', N'yes', N'6000 Echo Avenue', N'-', N'Reno', N'NV', '89506', N'USA', N'(775) 828-2437', N'(775) 828-2438', 39.653938293457031, -119.88975524902344) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1249', N'Rea Family Auction dba Rea Brothers Mid South Auc', N'yes', N'1657 Old Whitfield Road', N'PO Box 97509', N'Pearl', N'MS', NULL, N'USA', N'(800) 261-2671', N'(601) 956-5603', 32.260036, -90.089126) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1250', N'America`s Auto Auction - Chicago', N'yes', N'14001 South Karlov Avenue', N'-', N'Crestwood', N'IL', '60445', N'USA', N'(708) 389-4488', N'(708) 389-4558', 41.640579, -87.720458) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1251', N'Quincy Auto Auction', N'yes', N'196 Ricciuti Drive', N'PO BOX 690535', N'Quincy', N'MA',' 2269', N'USA', N'(617) 773-5000', N'(617)-472-8204', 42.24024, -71.03837) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1252', N'ADESA Vancouver', N'yes', N'7111 No. 8 Road', N'-', N'Richmond', N'BC', NULL, N'Canada', N'604-232-4403; 800-822-9882', N'604-232-4461', 49.1634851, -123.0244085) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1257', N'Greater Rockford Auto Auction', N'yes', N'5937 Sandy Hollow Road', N'-', N'Rockford', N'IL', '61109', N'USA', N'(815) 874-7800', N'(815) 874-7009', 42.224202677607536, -88.999971225857735) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1259', N'Wisconsin State Auto Auction', N'yes', N'N11577 Industrial Drive', N'-', N'Lomira', N'WI', '53048', N'USA', N'(920) 269-1129', N'(920) 269-1116', 43.610122, -88.439537) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1260', N'Dealers Auto Auction of the Rockies', N'yes', N'7175 York Street', N'-', N'Denver', N'CO', NULL, N'USA', N'(303) 289-7716', N'(303) 289-8653', 39.826099395751953, -104.96135711669922) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1261', N'Long Beach Auto Auction', N'yes', N'8494 County Farm Road', N'PO Box 958', N'Long Beach', N'MS', NULL, N'USA', N'(228) 452-2030', N'(228) 452-9588', 30.411161422729492, -89.188774108886719) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1263', N'Missouri Auto Auction', N'yes', N'421 N. Rangeline Road', N'-', N'Columbia', N'MO', '65201', N'USA', N'(573) 886-0032', N'-', 38.95330810546875, -92.2060775756836) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1264', N'Expressway Auto Auction', N'yes', N'10010 Main Street', N'-', N'Dansville', N'NY', '14437', N'USA', N'(585) 335-6071', N'(585) 335-3486', 42.545829, -77.680656) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1265', N'Oak View Auto Auction', N'yes', N'13451 Florida Blvd', N'-', N'Baton Rouge', N'LA', '70815', N'USA', N'(225) 272-5139', N'(225) 272-5314', 30.463291, -91.036132) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1266', N'Auction Training Demo', N'yes', N'50 Glenlake Pkwy', N'-', N'Atlanta', N'GA', '30328', N'-', N'678.597.3900', N'-', 33.940643310546875, -84.3619384765625) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1268', N'Lubbock Auto Auction', N'yes', N'1122 E. 34th Street', N'-', N'Lubbock', N'TX', '79404', N'USA', N'(806) 744-1444', N'(806) 763-1214', 33.563343062996864, -101.82234384119511) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1270', N'Carriage Trade Auto Auction', N'yes', N'1200 Ridge Pike', N'-', N'Conshohocken', N'PA', '19428', N'USA', N'215-CAR-SALE', N'(610) 834-8274', 40.103263854980469, -75.306343078613281) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1271', N'Alliance Auto Auction of Abilene', N'yes', N'6657 Highway 80 West', N'-', N'Abilene', N'TX', '79605', N'USA', N'(325) 698-4391', N'(325) 691-0263', 32.453262329101562, -99.813980102539062) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1272', N'Capital City Auto Auction', N'yes', N'600 Winfield Rd', N'-', N'St. Albans', N'WV', '25177', N'USA', N'(304) 201-2270', N'(304)201-2284', 38.398265540599823, -81.855732500553131) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1273', N'Greater Cleveland Auto Auction', N'yes', N'5801 Engle Road', N'-', N'Cleveland', N'OH', '44142', N'USA', N'(800) 929-4222 x 201', N'(216) 676-4200', 41.405735, -81.819145) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1274', N'America`s Auto Auction - Pensacola, Inc', N'yes', N'6615 Mobile Highway', N'-', N'Pensacola', N'FL', NULL, N'USA', N'(850) 944-1945', N'(850) 944-8482', 30.472261428833008, -87.312828063964844) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1275', N'Charleston Auto Auction-SC', N'yes', N'651 Precast Lane', N'-', N'Monck`s Corner', N'SC', '29461', N'USA', N'(843) 719-1900', N'(843) 719-1909', 33.102447688579559, -80.073434114456177) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1276', N'ADESA Long Island', N'yes', N'425 Patchogue Yaphank Road', N'-', N'Yaphank', N'NY', '11980', N'USA', N'(631) 205-5000', N'(631) 205-5508', 40.816108703613281, -72.946075439453125) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1277', N'Ocean State Auto Auction', N'yes', N'10 Industrial Drive', NULL, N'Exeter', N'RI',' 2822', N'USA', N'(401) 397-2801', N'(401) 397-2474', 41.57091, -71.65622) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1280', N'ADESA East Tennessee', N'yes', N'195 Joe McCrary Road', N'PO Box 247', N'Fall Branch', N'TN', NULL, N'USA', N'(423) 348-8419', N'(423) 348-5117', 36.417530059814453, -82.622726440429688) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1281', N'AAAG-MI, LLC dba Grand Rapids Auto Auction', N'yes', N'2380 Port Sheldon Court', N'-', N'Jenison', N'MI', '49428', N'USA', N'(616) 669-1050', N'(616) 669-5522', 42.884521, -85.84037) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1282', N'Akron Auto Auction', N'yes', N'2471 Ley Drive', N'-', N'Akron', N'OH', '44319', N'USA', N'3304365818', N'(330) 773-3921', 41.025070190429688, -81.538497924804688) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1283', N'North East Pennsylvania Auto Auction', N'yes', N'860 North Keyser Avenue', N'-', N'Scranton', N'PA', '18504', N'USA', N'(570) 207-2277', N'(570) 558-0959', 41.432004868984222, -75.688910186290741) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1284', N'Clarksville Auto Auction', N'yes', N'247 Needmore Road', N'PO Box 30485', N'Clarksville', N'TN', NULL, N'USA', N'800-969-4920', N'931-645-3973', 36.584419, -87.302772) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1289', N'North Bay Auto Auction', N'yes', N'250 Dittmer Road', N'-', N'Fairfield', N'CA', '94534', N'USA', N'707-646-7178', N'707-864-2518', 38.210624, -122.141021) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1290', N'Louisiana`s 1st Choice Auto Auction', N'yes', N'18310 Woodscale Road', N'-', N'Hammond', N'LA', '70401', N'USA', N'(985) 345-3302', N'(985) 345-5735', 30.517592802643776, -90.431617051362991) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1291', N'Dealer Direct', N'yes', N'1620 S. Stapley Drive', N'Ste. 232', N'Mesa', N'AZ', '85204', N'USA', N'877-522-3372', N'866-924-9420', 33.384059906005859, -111.80847930908203) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1292', N'Orlando Longwood Auto Auction', N'yes', N'2800 N Highway 17-92', N'-', N'Longwood', N'FL', '32750', N'USA', N'(407)324-3339', N'(321)275-0028', 28.725849151611328, -81.316215515136719) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1293', N'Dealers Auto Auction of Idaho', N'yes', N'3323 Port Street', N'-', N'Nampa', N'ID', '83687', N'USA', N'(208) 463-8250', N'(208) 463-7617', 43.5809440612793, -116.52721405029297) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1294', N'ABC Bowling Green', N'yes', N'555 Bluegrass Farms Blvd', N'-', N'Bowling Green', N'KY', '42104', N'USA', N'270-781-2422', N'270-781-5361', 36.926612854003906, -86.4209213256836) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1295', N'ABC Birmingham', N'yes', N'1046 A E Moore Rd', N'-', N'Moody', N'AL', '35004', N'USA', N'205 640-4040', N'205 640-3071', 33.566371947526932, -86.52554489672184) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1296', N'ADESA Orlando', N'yes', N'2851 Saint Johns Parkway', N'-', N'Sanford', N'FL', '32771', N'USA', N'407-328-7300', N'407-936-1326', 28.803495407104492, -81.300033569335938) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1297', N'Dixie Auto Auction', N'yes', N'15673 Highway 8W', N'-', N'Grenada', N'MS', '38901', N'USA', N'6622265637', N'662-227-9060', 33.768337249755859, -89.7842025756836) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1298', N'Oklahoma Auto Exchange', N'yes', N'2728 SW 25th Street', N'-', N'Oklahoma City', N'OK', '73108', N'USA', N'(405) 680-8660', N'(405) 680-9020', 35.438217163085938, -97.562744140625) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1299', N'Lone Star Auto Auction', N'yes', N'2706 Slaton Highway', N'-', N'Lubbock', N'TX', '79404', N'USA', N'888-299-6606', N'806-745-9280', 33.525558471679688, -101.80677795410156) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1300', N'America`s Auto Auction - Atlanta', N'yes', N'444 Joe Frank Harris Parkway', N'-', N'Cartersville', N'GA', '30120', N'USA', N'(770) 382-1010', N'-', 34.146915435791016, -84.746078491210938) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1301', N'Greater Erie Auto Auction', N'yes', N'7700 Avonia Road', N'PO Box 916', N'Fairview', N'PA', '16415', N'USA', N'(814) 474-3900', N'(814) 474-4969', 42.005489, -80.242523) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1303', N'CNY Auto Auction', N'yes', N'3181 US Route 11', N'POB 527', N'Lafayette', N'NY', NULL, N'USA', N'315-677-5201', N'315-677-9321', 42.925071, -76.121139) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1304', N'Plaza Auto Auction', N'yes', N'320 Highway 30 West', N'PO Box 147', N'Mt Vernon', N'IA', NULL, N'USA', N'319-895-6232', N'319-895-6727', 41.917129516601562, -91.4477310180664) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1305', N'America`s Auto Auction - Jacksonville', N'yes', N'11982 New Kings Rd', N'-', N'Jacksonville', N'FL', '32219', N'USA', N'904-764-7653', N'904-764-9528', 30.451816558837891, -81.771957397460938) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1307', N'Hartford Springfield Auction Co-op LLC', N'yes', N'49 Russell Road', N'PO box 1380', N'East Granby', N'CT', NULL, N'USA', N'860-784-1950', N'860-784-1952', 41.994888, -72.805877) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1308', N'Deanco Auto Auction of Dothan', N'yes', N'3664 South Oates Street', N'-', N'Dothan', N'AL', '36301', N'USA', N'334-792-1116', N'334-792-1575', 31.16566276550293, -85.404975891113281) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1310', N'Metro Phoenix Auto Auction', N'yes', N'2475 S. 59th Avenue', N'-', N'Phoenix', N'AZ', '85043', N'USA', N'602-279-9500', N'-', 33.426116943359375, -112.18428802490234) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1311', N'KASP', N'yes', N'5921 Athens Boonesboro Rd', N'-', N'Lexington', N'KY', '40509', N'USA', N'859-263-2129', N'859-263-9564', 37.957950592041016, -84.374862670898438) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1312', N'Abingdon Auto Auction', N'yes', N'20216 Auction Drive', N'-', N'Bristol', N'VA', '24202', N'USA', N'276-644-1684', N'276-644-9594', 36.65892206132412, -82.073769271373749) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1313', N'Augusta Auto Auction', N'yes', N'1200 E. Buena Vista Drive', N'-', N'North Augusta', N'SC', '29841', N'USA', N'803-279-3234', N'803-279-7191', 33.482070922851562, -81.9466781616211) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1316', N'Lincoln Auto Auction', N'yes', N'11909 US Hwy 6', N'-', N'Waverly', N'NE', '68462', N'USA', N'402-475-5500; 800-830-3191', N'402-475-5508', 40.8974494934082, -96.561065673828125) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1317', N'Greenville Auto Auction, Inc.', N'yes', N'4330 Dickinson Ave', N'-', N'Greenville', N'NC', '27834', N'USA', N'252-355-4111', N'252-355-2011', 35.576801300048828, -77.438911437988281) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1318', N'Insurance Auto Auctions Austin', N'yes', N'2191 Highway 21 W', N'-', N'Dale', N'TX', '78616', N'USA', N'512-321-8075', N'512-321-8303', 30.068012326955795, -97.581063956022263) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1319', N'Insurance Auto AuctionsNational Remarketing Center', N'yes', N'69 Hinckley Road', NULL, N'Clinton', N'ME',' 4927', N'USA', N'888-839-4220', N'207-426-9034', 44.63813, -69.51607) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1320', N'Insurance Auto Auctions Central NJ', N'yes', N'426 Texas Road', NULL, N'Morganville', N'NJ',' 7751', N'USA', N'732-591-8173', N'732-591-8393', 40.374846, -74.271223) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1321', N'Insurance Auto Auctions Dallas/Ft.Worth', N'yes', N'4226 E. Main St', N'-', N'Grand Prairie', N'TX', '75050', N'USA', N'972-522-5000', N'-', 32.749955132603645, -96.936435252428055) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1322', N'Insurance Auto Auctions Dallas', N'yes', N'204 MArs Road', N'-', N'Wilmer', N'TX', '75172', N'USA', N'972-525-6401', N'972-525-6403', 32.579318359494209, -96.670941486954689) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1323', N'Insurance Auto Auctions Denver', N'yes', N'409 W 66th Avenue', N'-', N'Denver', N'CO', '80221', N'USA', N'303-428-3024', N'303-428-3502', 39.816384986042976, -104.98972423374653) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1324', N'Insurance Auto Auctions Fontana', N'yes', N'13901 San Bernardino Avenue', N'-', N'Fontana', N'CA', '92335', N'USA', N'909-355-9400', N'909-822-9311', 34.075832366943359, -117.49990081787109) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1325', N'Insurance Auto Auctions Fremont', N'yes', N'6700 Stevenson Blvd', N'-', N'Fremont', N'CA', '94538', N'USA', N'510-668-1665', N'510-668-0106', 37.506160736083984, -121.99204254150391) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1326', N'Insurance Auto Auctions Houston', N'yes', N'2535 W Mt Houston Rd', N'-', N'Houston', N'TX', '77038', N'USA', N'281-847-4700', N'281-847-4799', 29.89448356628418, -95.4505615234375) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1327', N'Insurance Auto Auctions Houston-North', N'yes', N'16602 E HArdy', N'-', N'Houston', N'TX', '77032', N'USA', N'281-443-1300', N'281-443-4433', 29.958946, -95.384483) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1328', N'Insurance Auto Auctions Kansas City', N'yes', N'2663 S 88th Street', N'-', N'Kansas City', N'KS', '66111', N'USA', N'913-422-9303', N'913-422-7421', 39.054969787597656, -94.778114318847656) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1329', N'Insurance Auto Auctions Miami-North', N'yes', N'5901 205th Ave', N'-', N'Pembroke Pine', N'FL', '33332', N'USA', N'954-680-4370', N'954-680-4372', 26.047386, -80.422698) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1330', N'Insurance Auto Auctions Milwaukee', N'yes', N'N70 W26277 Indian Grass Lane', N'-', N'Sussex', N'WI', '53089', N'USA', N'262-246-8822', N'262-246-4411', 43.129592895507812, -88.209281921386719) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1331', N'Insurance Auto Auctions No. Hollywood', N'yes', N'7245 Laurel Canyon Blvd', N'-', N'North Hollywood', N'CA', '91605', N'USA', N'818-487-2222', N'818-487-2402', 37.878952026367188, -122.27028656005859) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1332', N'Insurance Auto Auctions Northern NJ', N'yes', N'700 Federal Blvd', NULL, N'Carteret', N'NJ',' 7008', N'USA', N'732-634-5601', N'732-602-0259', 40.58381, -74.24725) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1333', N'Insurance Auto Auctions Orlando', N'yes', N'151 Taft Vineland Road', N'-', N'Orlando', N'FL', '32824', N'USA', N'407-438-7191', N'407-816-4294', 28.422496795654297, -81.378402709960938) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1334', N'Insurance Auto Auctions Phoenix', N'yes', N'2299 W Broadway Road', N'-', N'Phoenix', N'AZ', '85041', N'USA', N'602-305-5300', N'602-268-5242', 33.403514, -112.10588) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1335', N'Insurance Auto Auctions Portland', N'yes', N'4415 NE 158th Avenue', N'-', N'Portland', N'OR', '97230', N'USA', N'503-253-1500', N'503-253-9359', 45.557243347167969, -122.50673675537109) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1336', N'Insurance Auto Auctions San Antonio-South.', N'yes', N'11275 South Zarzamora', N'-', N'San Antonio', N'TX', '78224', N'USA', N'210-628-6770', N'210-628-6778', 29.308429718017578, -98.537345886230469) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1337', N'Insurance Auto Auctions San Diego', N'yes', N'2380 Britannia Blvd', N'-', N'San Diego', N'CA', '92154', N'USA', N'619-710-2876', N'619-710-2878', 32.554939761757851, -116.97998709976673) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1338', N'Insurance Auto Auctions Seattle', N'yes', N'8801 E Marginal Way S', N'-', N'Tukwila', N'WA', '98108', N'USA', N'206-658-6900', N'206-658-6990', 47.521995544433594, -122.30352020263672) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1339', N'ADESA PA', N'yes', N'30 Industrial Road', N'-', N'York', N'PA', '17406', N'USA', N'(717) 266-7627', N'(717) 266-7600', 40.084841921925545, -76.764396876096725) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1340', N'ADESA Kitchener', N'yes', N'55 Waydom Drive', N'RR # 1, Wayadom Drive', N'Ayr', N'ON', NULL, N'Canada', N'519-622-9500; 800-661-2598', N'519-621-2361', 43.33489, -80.4458) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1341', N'ADESA Raleigh', N'yes', N'30 Sadisco Highway', N'-', N'Clayton', N'NC', '27520', N'USA', N'919-550-4092', N'919-262-0399', 35.592078119516373, -78.4067764878273) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1343', N'South Bend Mishawaka Auto Auction', N'yes', N'55920 Maplehurst Ave', N'-', N'Mishawaka', N'IN', '46545', N'USA', N'574-256-5625', N'574-256-5655', 41.682529449462891, -86.16448974609375) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1344', N'ADESA St. John`s', N'yes', N'80- Clyde Ave', N'P.O. Box 13157', N'Mount Pearl', N'NL', NULL, N'Canada', N'709-364-3250; 877-364-3250', N'709-364-3251', 47.5221487, -52.8393149) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1348', N'Dealers Auto Auction of Huntsville', N'yes', N'26125 US Highway 72', N'-', N'Athens', N'AL', '35613', N'USA', N'256-232-0201', N'-', 34.7647819519043, -86.8624496459961) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1349', N'Farmington Auto Auction', N'yes', N'1661 W Murray Dr.', N'-', N'Farmington', N'NM', '87401', N'USA', N'505-326-1005', N'505-326-1007', 36.729221343994141, -108.23280334472656) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1350', N'South Bay Auto Auction', N'yes', N'13210 S. Normandie Ave', N'-', N'Gardena', N'CA', '90249', N'USA', N'310-719-2000', N'310-243-1240', 33.912113189697266, -118.29947662353516) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1351', N'Albany Auto Auction', N'yes', N'1421 Liberty Exp SE', N'P O BOX 1622', N'Albany', N'GA', '31702', N'USA', N'229-435-7708', N'229-888-8035', 31.556060791015625, -84.1151123046875) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1352', N'Dealers Auto Auction of Memphis', N'yes', N'2560 RENTAL RD', N'-', N'MEMPHIS', N'TN', '38118', N'USA', N'901-480-4250', N'800-915-9985', 35.069428905844688, -89.978604689240456) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1353', N'Loveland Auto Auction', N'yes', N'4660 Chapman Road', N'-', N'Loveland', N'CO', '80534', N'USA', N'970-669-4994', N'-', 40.392749786376953, -105.07392120361328) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1354', N'Insurance Auto Auctions Albany', N'yes', N'1210 Kings Road', N'-', N'Schenectady', N'NY', '12303', N'USA', N'(518) 347-3810', N'(518) 346-0351', 42.741920471191406, -73.8863296508789) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1355', N'Insurance Auto Auctions Albuquerque', N'yes', N'4400 Broadway Blvd SE', N'-', N'Albuquerque', N'NM', '87105', N'USA', N'(505) 873-2081', N'(505) 873-3029', 35.01267671585083, -106.64868660271168) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1356', N'Insurance Auto Auctions Appleton', N'yes', N'2591 S Casaloma Drive', N'-', N'Appleton', N'WI', '54914', N'USA', N'(920) 734-1446', N'(920) 734-3603', 44.240116119384766, -88.474288940429688) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1357', N'Insurance Auto Auctions Atlanta-South', N'yes', N'1930 Rex Road', N'-', N'Lake City', N'GA', '30260', N'USA', N'(404) 366-2298', N'(404) 366-1011', 33.600720316171646, -84.326421171426773) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1358', N'Insurance Auto Auctions Baltimore', N'yes', N'3131 Hawkins Point Rd', N'-', N'Baltimore', N'MD', '21226', N'USA', N'(410) 354-3344', N'(410) 354-1340', 39.202829003334045, -76.558717712759972) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1359', N'Insurance Auto Auctions Baton Rouge', N'yes', N'29000 S Frost Rd', N'-', N'Livingston', N'LA', '70754', N'USA', N'(225) 686-9197', N'(225) 686-8197', 30.477354973554611, -90.74805736541748) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1360', N'Insurance Auto Auctions Birmingham', N'yes', N'1600 Highway 150', N'-', N'Birmingham', N'AL', '35022', N'USA', N'(205) 426-2300', N'(205) 428-5332', 33.355018615722656, -86.841072082519531) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1361', N'Insurance Auto Auctions Boise', N'yes', N'3707 E. Linden St', N'-', N'Caldwell', N'ID', '83605', N'USA', N'(208) 455-1642', N'(208) 455-1622', 43.649692535400391, -116.65222930908203) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1362', N'Insurance Auto Auctions Boston Shirley', N'yes', N'2 Going Rd', NULL, N'Shirley', N'MA',' 1464', N'USA', N'978-425-0990', N'-', 42.58543, -71.664) +GO +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1363', N'Insurance Auto Auctions Buffalo', N'yes', N'366 Vulcan Street', N'-', N'Buffalo', N'NY', '14204', N'USA', N'(716) 874-9890', N'(716) 874-9605', 42.963603213429451, -78.902724981307983) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1364', N'Insurance Auto Auctions Burlington', N'yes', N'304 Colchester Road', NULL, N'Essex', N'VT',' 5451', N'USA', N'(802) 872-7838', N'(802) 878-8353', 44.52666, -73.12947) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1365', N'Insurance Auto Auctions Miami', N'yes', N'12700 NW 42nd Avenue', N'-', N'Opa Locka', N'FL', '33054', N'USA', N'(800) 526-8402', N'(305) 685-9215', 25.88776969909668, -80.269500732421875) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1366', N'Insurance Auto Auctions Charleston', N'yes', N'430 Tannenbaum Rd', N'-', N'Ravenel', N'SC', '29470', N'USA', N'(843) 556-7620', N'(843) 571-3006', 32.8443603515625, -80.2373275756836) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1367', N'Insurance Auto Auctions Charlotte', N'yes', N'1710 Starita Rd', N'-', N'Charlotte', N'NC', '28206', N'USA', N'(704) 596-5854', N'(704) 596-7492', 35.271232604980469, -80.817390441894531) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1368', N'Insurance Auto Auctions Chicago North', N'yes', N'605 Healy Road', N'-', N'East Dundee', N'IL', '60118', N'USA', N'847.426.5913', N'847.426.8595', 42.085151672363281, -88.235099792480469) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1369', N'Insurance Auto Auctions Chicago South', N'yes', N'16425 S Crawford Ave', N'-', N'Markham', N'IL', '60426', N'USA', N'708-333-5700', N'(708) 333-5756', 41.590564, -87.71257) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1370', N'Insurance Auto Auctions Chicago West', N'yes', N'280 E Sullivan Road', N'-', N'Aurora', N'IL', '60504', N'USA', N'(630) 896-5300', N'(630) 896-5699', 41.790313720703125, -88.307540893554688) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1371', N'Insurance Auto Auctions Clearwater', N'yes', N'5152 126 Avenue North', N'-', N'Clearwater', N'FL', '33760', N'USA', N'(727) 572-4050', N'(727) 572-4065', 27.884408950805664, -82.7034912109375) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1373', N'Insurance Auto Auctions Cleveland', N'yes', N'7437 Deer Trail Lane', N'-', N'Lorain', N'OH', '44053', N'USA', N'(877) 917-6877', N'(440) 960-1093', 41.411849975585938, -82.277008056640625) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1374', N'Insurance Auto Auctions Greenville', N'yes', N'422 Scuffletown Rd', N'-', N'Simpsonville', N'SC', '29681', N'USA', N'(864) 242-3093', N'(864) 271-6510', 34.7992218285799, -82.222437411546707) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1375', N'Insurance Auto Auctions Concord', N'yes', N'5100 Merle Road', N'-', N'Concord', N'NC', '28025', N'USA', N'(704) 788-4421', N'(704) 784-2414', 35.465682983398438, -80.493293762207031) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1376', N'Insurance Auto Auctions Corpus Christi', N'yes', N'4701 Agnes St', N'-', N'Corpus Christi', N'TX', '78405', N'USA', N'(361) 881-9555', N'(361) 887-8880', 27.783945083618164, -97.44915771484375) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1377', N'Insurance Auto Auctions Detroit', N'yes', N'8251 Rawsonville Road', N'-', N'Belleville', N'MI', '48111', N'USA', N'(734) 461-9441', N'(734) 461-9419', 42.172046661376953, -83.5377197265625) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1378', N'Insurance Auto Auctions East Bay', N'yes', N'2780 Willow Pass Road', N'-', N'Bay Point', N'CA', '94565', N'USA', N'(925) 458-7610', N'(925) 458-7615', 38.032478, -121.944656) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1379', N'Insurance Auto Auctions Erie', N'yes', N'261 Hamilton Road', N'-', N'Garland', N'PA', '16416', N'USA', N'(814) 563-3113', N'(814) 563-4921', 41.817504, -79.454986) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1380', N'Insurance Auto Auctions Eugene', N'yes', N'1000 Bethel Drive', N'-', N'Eugene', N'OR', '97402', N'USA', N'(541) 689-4000', N'(541) 689-0083', 44.071796417236328, -123.14012145996094) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1381', N'Insurance Auto Auctions Fargo', N'yes', N'1650 E. Main Ave.', N'-', N'West Fargo', N'ND', '58078', N'USA', N'(701) 492-4501', N'(701) 492-2950', 46.877986907958984, -96.872528076171875) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1382', N'Insurance Auto Auctions Grand Rapids', N'yes', N'700 100th Street SW', N'-', N'Byron Center', N'MI', '49315', N'USA', N'(616) 877-1000', N'(616) 877-0300', 42.7826613932848, -85.680529028177261) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1383', N'Insurance Auto Auctions Greensboro', N'yes', N'171 Carden Road', N'-', N'Graham', N'NC', '27253', N'USA', N'(336) 226-4224', N'(336) 226-4254', 36.007419586181641, -79.38751220703125) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1384', N'Insurance Auto Auctions Lincoln', N'yes', N'301 Madigan Dr', N'-', N'Lincoln', N'IL', '62656', N'USA', N'(217) 732-8555', N'(217) 732-7555', 40.154411718249321, -89.408243000507355) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1385', N'Insurance Auto Auctions Hartford', N'yes', N'47 Newberry Road', NULL, N'East Windsor', N'CT',' 6088', N'USA', N'(860) 623-9760', N'(860) 623-3873', 41.91915, -72.60241) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1386', N'Insurance Auto Auctions Hartford-South', N'yes', N'1462 Saybrook Rd.', NULL, N'Middletown', N'CT',' 6457', N'USA', N'(860) 854-6761', N'(860) 347-6236', 41.52144, -72.60226) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1387', N'Insurance Auto Auctions Honolulu', N'yes', N'91-445A Komohana St', N'-', N'Kapolei', N'HI', '96707', N'USA', N'(808) 682-2858', N'(808) 682-3988', 21.334220886230469, -158.08192443847656) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1388', N'Insurance Auto Auctions Indianapolis', N'yes', N'3302 S. Harding Street', N'-', N'Indianapolis', N'IN', '46217', N'USA', N'(317) 787-3202', N'(317)783-0586', 39.715614318847656, -86.19580078125) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1389', N'Insurance Auto Auctions Jackson', N'yes', N'100 Beasley Rd', N'-', N'Jackson', N'MS', '39206', N'USA', N'(601) 956-2787', N'(601) 957-8814', 32.385799661278725, -90.15824094414711) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1390', N'Insurance Auto Auctions Jacksonville', N'yes', N'14492 New Kings Rd', N'-', N'Jacksonville', N'FL', '32219', N'USA', N'(904) 768-6500', N'(904) 768-6499', 30.496864318847656, -81.7900390625) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1391', N'Insurance Auto Auctions Knoxville', N'yes', N'3634 E. Gov. John Seveir Hwy.', N'-', N'Knoxville', N'TN', '37914', N'USA', N'(865) 525-7349', N'(865) 522-8813', 35.980083465576172, -83.799667358398438) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1392', N'Insurance Auto Auctions Las Vegas', N'yes', N'1239 North Boulder Hwy Ste 900', N'-', N'Henderson', N'NV', '89011', N'USA', N'(702) 564-6553', N'(702) 565-8795', 36.052108, -114.998924) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1393', N'Insurance Auto Auctions Laurel', N'yes', N'7131 Virginia Manor Ct', N'-', N'Laurel', N'MD', '20707', N'USA', N'(301) 419-2865', N'(301) 470-7079', 39.078060150146484, -76.882858276367188) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1395', N'Insurance Auto Auctions Little Rock', N'yes', N'4900 S Kerr Rd', N'-', N'Scott', N'AR', '72142', N'USA', N'(501) 961-2886', N'(501) 961-1805', 34.794122949242592, -92.0589280128479) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1396', N'Insurance Auto Auctions Long Island', N'yes', N'66 Peconic Avenue', N'-', N'Medford', N'NY', '11763', N'USA', N'(631) 207-3477', N'(631) 207-3386', 40.816429138183594, -72.973251342773438) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1397', N'Insurance Auto Auctions Manchester', N'yes', N'75 Lowell Road', NULL, N'Salem', N'NH',' 3079', N'USA', N'(603) 893-2300', N'(603) 898-3870', 42.76327, -71.24803) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1398', N'Insurance Auto Auctions Memphis', N'yes', N'5400 Getwell Rd.', N'-', N'Memphis', N'TN', '38118', N'USA', N'(901) 794-9901', N'(901) 794-9914', 35.000213623046875, -89.933708190917969) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1399', N'Insurance Auto Auctions Metro DC', N'yes', N'14149 Brandywine Rd', N'-', N'Brandywine', N'MD', '20613', N'USA', N'(301) 372-8876', N'(301) 372-8285', 38.694995880126953, -76.846763610839844) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1400', N'Insurance Auto Auctions Minneapolis/St. Paul', N'yes', N'1280 Jackson Street', N'-', N'St. Paul', N'MN', '55117', N'USA', N'(651) 488-0581', N'(651) 488-3644', 44.978603363037109, -93.094512939453125) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1401', N'Insurance Auto Auctions Missoula', N'yes', N'10131 Garrymore Lane', N'-', N'Missoula', N'MT', '59802', N'USA', N'(406) 542-3442', N'(406) 549-8933', 46.939884185791016, -114.13915252685547) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1402', N'Insurance Auto Auctions Nashville', N'yes', N'3896 Stewarts Lane', N'-', N'Nashville', N'TN', '37218', N'USA', N'(615) 742-0006', N'(615) 726-4008', 36.196334838867188, -86.857330322265625) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1403', N'Insurance Auto Auctions Newburgh', N'yes', N'39 Stone Castle Road', N'-', N'Rock Tavern', N'NY', '12575', N'USA', N'(845) 567-6360', N'(845) 567-6366', 41.538295745849609, -74.136299133300781) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1404', N'Insurance Auto Auctions North Virginia', N'yes', N'15 Le Way Drive', N'-', N'Fredericksburg', N'VA', '22406', N'USA', N'(540) 373-7800', N'(540) 371-4123', 38.351856231689453, -77.514091491699219) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1405', N'Insurance Auto Auctions Oklahoma City', N'yes', N'5555 SW 44th St', N'-', N'Oklahoma City', N'OK', '73179', N'USA', N'(405) 680-9211', N'(405) 680-9204', 35.421859741210938, -97.611625671386719) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1406', N'Insurance Auto Auctions Omaha', N'yes', N'14749 Meredythe Plaza', N'-', N'Springfield', N'NE', '68059', N'USA', N'(402) 733-2424', N'(402) 733-0483', 41.064769744873047, -96.160400390625) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1407', N'Insurance Auto Auctions Orlando-North', N'yes', N'2500 ADESA Drive', N'-', N'Sanford', N'FL', '32773', N'USA', N'(407) 323-4090', N'(407) 323-4557', 28.784786224365234, -81.216400146484375) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1408', N'Insurance Auto Auctions Pensacola', N'yes', N'11221 Highway 90 East', N'-', N'Milton', N'FL', '32583', N'USA', N'(850) 623-2993', N'(850) 626-7973', 30.596855163574219, -86.9754867553711) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1409', N'Insurance Auto Auctions Philadelphia', N'yes', N'100 Industrial Way', N'-', N'Conshohocken', N'PA', '19428', N'USA', N'(610) 277-0894', N'(610) 277-9276', 40.102576017379761, -75.308788865804672) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1410', N'Insurance Auto Auctions Pittsburgh-North', N'yes', N'49 Bairdford Road', N'-', N'Gibsonia', N'PA', '15044', N'USA', N'(724) 443-7881', N'(724) 443-7888', 40.650802612304688, -79.895378112792969) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1411', N'Insurance Auto Auctions Pulaski', N'yes', N'1250 E Main St', N'-', N'Pulaski', N'VA', '24301', N'USA', N'(540) 994-6490', N'(540) 994-6495', 37.045253753662109, -80.761344909667969) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1412', N'Insurance Auto Auctions Raleigh', N'yes', N'60 Sadisco Road', N'-', N'Clayton', N'NC', '27520', N'USA', N'(919) 553-6148', N'(919) 553-2857', 35.589534759521484, -78.399421691894531) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1413', N'Insurance Auto Auctions Richmond', N'yes', N'10390 Sadisco Drive', N'-', N'Ashland', N'VA', '23005', N'USA', N'(804) 798-6091', N'(804) 798-9327', 37.720127105712891, -77.465118408203125) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1414', N'Insurance Auto Auctions Rochester', N'yes', N'522 Trolley Blvd', N'-', N'Rochester', N'NY', '14606', N'USA', N'(585) 426-5420', N'(585) 426-5413', 43.173114776611328, -77.685264587402344) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1415', N'Insurance Auto Auctions Sacramento', N'yes', N'11499 Dougals Road', N'-', N'Rancho Cordova', N'CA', '95742', N'USA', N'(916) 635-4271', N'(916) 635-1637', 38.560012817382812, -121.25255584716797) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1416', N'Insurance Auto Auctions Salt Lake City', N'yes', N'1800 South 1100 West', N'-', N'West Haven', N'UT', '84401', N'USA', N'(801) 399-2818', N'(801) 393-2325', 41.233524084091187, -112.00638704001904) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1417', N'Insurance Auto Auctions Southern NJ', N'yes', N'250 Blackwood Barnsboro Rd', NULL, N'Turnersville', N'NJ',' 8012', N'USA', N'(856) 227-8760', N'(856) 227-8943', 39.7889053497052, -75.0880893522219) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1418', N'Insurance Auto Auctions Scranton', N'yes', N'103 Thompson Street', N'-', N'Pittston', N'PA', '18640', N'USA', N'(570) 654-1709', N'(570) 654-5010', 41.3089714050293, -75.805419921875) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1419', N'Insurance Auto Auctions Spokane', N'yes', N'8018 W. Sunset Hgwy', N'-', N'Spokane', N'WA', '99224', N'USA', N'(509) 458-3244', N'(509) 458-4112', 47.643168121576309, -117.52401888370514) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1420', N'Insurance Auto Auctions St. Louis', N'yes', N'4460 Highway 162', N'-', N'Granite City', N'IL', '62040', N'USA', N'(618) 797-0200', N'(618) 797-0001', 38.726328536868095, -90.057689622044563) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1421', N'Insurance Auto Auctions Syracuse', N'yes', N'8459 Brewerton Road', N'-', N'Cicero', N'NY', '13039', N'USA', N'(315) 699-2622', N'(315) 699-5481', 43.181224912405014, -76.121611520648) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1422', N'Insurance Auto Auctions Tampa', N'yes', N'1208 17th Street East', N'-', N'Palmetto', N'FL', '34221', N'USA', N'(941) 729-9393', N'(941) 723-3934', 27.529575347900391, -82.551597595214844) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1423', N'Insurance Auto Auctions Taunton', N'yes', N'580 Myricks Street', NULL, N'East Taunton', N'MA',' 2718', N'USA', N'(508) 823-7440', N'(508) 822-7938', 41.8494203820286, -70.9917747126342) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1424', N'Insurance Auto Auctions Wilmington', N'yes', N'415 Madeline Trask Dr', N'-', N'Castle Hayne', N'NC', '28429', N'USA', N'(910) 675-2311', N'(910) 675-1619', 34.330131530761719, -77.905731201171875) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1427', N'Copart Sacramento', N'yes', N'8600 Morrison Creek Dr', N'-', N'Sacramento', N'CA', '95828', N'USA', N'916-381-3999', N'916 381 4159', 38.505634307861328, -121.38424682617188) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1428', N'Copart Fresno', N'yes', N'1255 East Central', N'-', N'Fresno', N'CA', '93725', N'USA', N'559-266-6400', N'559 266 5202', 36.676010131835938, -119.76742553710938) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1429', N'Copart Bakersfield', N'yes', N'2216 Coy Avenue', N'-', N'Bakersfield', N'CA', '93307', N'USA', N'661-834-2556', N'661 834 1563', 35.322261810302734, -119.00022888183594) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1430', N'Copart Portland', N'yes', N'6900 N.E. Cornfoot Drive', N'-', N'Portland', N'OR', '97218', N'USA', N'503-281-0848', N'503 281 2019', 45.573764801025391, -122.59199523925781) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1431', N'Copart Houston', N'yes', N'1655 Rankin Road', N'-', N'Houston', N'TX', '77073', N'USA', N'281-214-7800', N'281 443 0753', 29.96830940246582, -95.373908996582031) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1432', N'Copart Dallas', N'yes', N'505 Idlewild Road', N'-', N'Grand Prairie', N'TX', '75051', N'USA', N'972-263-2711', N'972 263 9137', 32.741608768701553, -96.953269466757774) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1433', N'Copart Longview', N'yes', N'3046 Highway 322 South', N'-', N'Longview', N'TX', '75603', N'USA', N'903-643-9705', N'903 643 9958', 32.403656005859375, -94.71087646484375) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1434', N'Copart Atlanta West', N'yes', N'2568 Old Alabama Road', N'-', N'Austell', N'GA', '30168', N'USA', N'770-941-9775', N'(770) 944-7289', 33.796840667724609, -84.62847900390625) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1435', N'Copart Kansas City', N'yes', N'6211 Kansas Ave.', N'-', N'Kansas City', N'KS', '66111', N'USA', N'913-287-6200', N'913 287 4665', 39.082965850830078, -94.7246322631836) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1436', N'Copart Oklahoma City', N'yes', N'2829 Se 15th St', N'-', N'Oklahoma City', N'OK', '73129', N'USA', N'405-672-5674', N'405 672 9523', 35.452190399169922, -97.460678100585938) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1437', N'Copart St. Louis', N'yes', N'13033 Taussig Ave', N'-', N'Bridgeton', N'MO', '63044', N'USA', N'314-291-8400', N'314 291 6287', 38.779037296772, -90.421834364533424) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1438', N'Copart Memphis', N'yes', N'5545 Swinnea Rd', N'-', N'Memphis', N'TN', '38118', N'USA', N'901-398-8989', N'901 398 2377', 35.000789642333984, -89.974212646484375) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1439', N'Copart Hartford', N'yes', N'138 Christian Lane', NULL, N'New Britain', N'CT',' 6051', N'USA', N'860-666-1183', N'860 667 2630', 41.65041, -72.75101) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1440', N'Copart Newburgh', N'yes', N'Route 9w North', N'P.O. BOX 615', N'Marlboro', N'NY', '12542', N'USA', N'845-236-3371', N'845 236 7544', 41.462581634521484, -74.021087646484375) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1441', N'Copart Syracuse', N'yes', N'46 Zuk-Pierce Rd', N'-', N'Central Square', N'NY', '13036', N'USA', N'315-676-7153', N'315 676 5147', 43.246589660644531, -76.145500183105469) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1442', N'Copart Philadelphia', N'yes', N'2704 Geryville Pike', N'-', N'Pennsburg', N'PA', '18073', N'USA', N'215-679-3164', N'215 679 4322', 40.399772644042969, -75.471595764160156) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1443', N'Copart Long Island', N'yes', N'1983 Montauk Highway', N'-', N'Brookhaven', N'NY', '11719', N'USA', N'631-776-0994', N'631 776 1724', 40.77775776386261, -72.928082942962646) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1444', N'Copart Glassboro East', N'yes', N'200 Grove St.', NULL, N'Glassboro', N'NJ',' 8028', N'USA', N'856-881-6700', N'856 863 1683', 39.69481, -75.10625) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1445', N'Copart Washington Dc', N'yes', N'11055 Billingsley Road', N'-', N'Waldorf', N'MD', '20602', N'USA', N'301-870-7844', N'301 870 7490', 38.589458465576172, -76.933189392089844) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1446', N'Copart Tampa South', N'yes', N'12020 Us Highway 301 South', N'-', N'Riverview', N'FL', '33578', N'USA', N'813-671-5550', N'813 671 5452', 27.823944091796875, -82.328575134277344) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1447', N'Copart Rochester', N'yes', N'4 West Ave', N'-', N'Leroy', N'NY', '14482', N'USA', N'585-768-8160', N'585 768 9391', 42.981510162353516, -78.003715515136719) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1448', N'Copart Milwaukee', N'yes', N'4825 S. Whitnall Ave', N'-', N'Cudahy', N'WI', '53110', N'USA', N'414-769-7665', N'414 769 0885', 42.956382751464844, -87.874229431152344) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1449', N'Copart Jackson', N'yes', N'205 S. Rankin Industrial Drive', N'-', N'Florence', N'MS', '39073', N'USA', N'601-939-7941', N'601 939 6438', 32.185405731201172, -90.13226318359375) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1450', N'Copart China Grove', N'yes', N'1081 Recovery Road', N'-', N'China Grove', N'NC', '28023', N'USA', N'704-857-5177', N'704 857 5186', 35.5784912109375, -80.559097290039062) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1451', N'Copart Jacksonville West', N'yes', N'450 Hammond Blvd', N'-', N'Jacksonville', N'FL', '32220', N'USA', N'904-781-3141', N'904 781 3654', 30.318880081176758, -81.788284301757812) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1452', N'Copart Van Nuys', N'yes', N'7519 Woodman Ave.', N'-', N'Van Nuys', N'CA', '91405', N'USA', N'818-782-5315', N'818 782 5318', 34.207592010498047, -118.43097686767578) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1453', N'Copart Indianapolis', N'yes', N'4040 Office Plaza Blvd', N'-', N'Indianapolis', N'IN', '46254', N'USA', N'317-216-2186', N'317 216 2185', 39.828085452318192, -86.244633793830872) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1454', N'Copart El Paso', N'yes', N'501 Valley Chili Road', N'-', N'El Paso', N'TX', '79821', N'USA', N'915-886-5556', N'915 886 6113', 31.974055096507072, -106.59019365906715) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1455', N'Copart Phoenix', N'yes', N'615 So. 51st Avenue', N'-', N'Phoenix', N'AZ', '85043', N'USA', N'602-484-7075', N'602 484 7074', 33.439345210790634, -112.16916896402836) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1456', N'Copart North Seattle', N'yes', N'16701 51st Ave Ne', N'-', N'Arlington', N'WA', '98223', N'USA', N'360-651-6299', N'360 651 8403', 48.146796450018883, -122.16160923242569) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1457', N'Copart North Boston', N'yes', N'55r High St', NULL, N'North Billerica', N'MA',' 1862', N'USA', N'978-667-6787', N'978 667 0073', 42.578256, -71.272952) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1458', N'Copart Raleigh', N'yes', N'310 Copart Road', N'-', N'Dunn', N'NC', '28334', N'USA', N'910-891-1252', N'910 891 1858', 35.266799926757812, -78.620903015136719) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1459', N'Copart Orlando', N'yes', N'8100 Mccoy Rd', N'-', N'Orlando', N'FL', '32822', N'USA', N'407-888-2424', N'407 888 2223', 28.451524749398232, -81.272014081478119) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1460', N'Copart Columbia', N'yes', N'4324 Highway 321 South', N'-', N'Gaston', N'SC', '29053', N'USA', N'803-794-3252', N'803 794 3718', 33.8638523966074, -81.0794898122549) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1461', N'Copart Las Vegas', N'yes', N'4810 N. Lamb Blvd', N'-', N'Las Vegas', N'NV', '89115', N'USA', N'702-638-9300', N'702 638 9494', 36.248855590820312, -115.07749938964844) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1462', N'Copart San Diego', N'yes', N'7847 Airway Rd', N'-', N'San Diego', N'CA', '92154', N'USA', N'619 671-0900', N'619 671 0965', 32.5570068359375, -116.97223663330078) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1463', N'Copart Des Moines', N'yes', N'3300 Vandalia Road', N'-', N'Des Moines', N'IA', '50317', N'USA', N'515-262-1900', N'515 262 1990', 41.571163177490234, -93.550643920898438) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1464', N'Copart Detroit', N'yes', N'21000 Hayden Drive', N'-', N'Woodhaven', N'MI', '48183', N'USA', N'734-365-0070', N'734 365 0080', 42.122192904353142, -83.236244022846222) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1465', N'Copart Nashville', N'yes', N'865 Stumpy Lane', N'-', N'Lebanon', N'TN', '37090', N'USA', N'615-449-6195', N'615 449 6936', 36.167392730712891, -86.295745849609375) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1466', N'Copart McAllen', N'yes', N'301 Mile 1 East', N'-', N'Mercedes', N'TX', '78570', N'USA', N'956-514-4840', N'956 565 5078', 26.113518923521042, -97.893246933817863) +GO +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1467', N'Copart Denver', N'yes', N'1281 County Road 27', N'-', N'Brighton', N'CO', '80603', N'USA', N'303-659-0066', N'303 659 8113', 40.016487166285515, -104.81168791651726) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1468', N'Copart West Palm Beach', N'yes', N'7876 Belvedere Road', N'-', N'West Palm Beach', N'FL', '33411', N'USA', N'561-798-5158', N'561 798 3750', 26.690938949584961, -80.1731185913086) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1469', N'Copart San Antonio', N'yes', N'11130 Applewhite Rd', N'-', N'San Antonio', N'TX', '78224', N'USA', N'210-628-1690', N'210 628 1077', 29.308361053466797, -98.545669555664062) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1470', N'Copart Albuquerque', N'yes', N'7705 Broadway SE', N'-', N'Albuquerque', N'NM', '87105', N'USA', N'505-877-2424', N'(505) 873-1152', 34.985279083251953, -106.65862274169922) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1471', N'Copart Martinez', N'yes', N'2701 Waterfront Road', N'-', N'Martinez', N'CA', '94553', N'USA', N'925-370-3900', N'925 370 3925', 38.030784606933594, -122.09603118896484) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1472', N'Copart New Orleans', N'yes', N'14600 Gentilly Highway', N'-', N'New Orleans', N'LA', '70129', N'USA', N'504-254-3944', N'504 254 9875', 30.033399760723114, -89.9099387973547) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1473', N'Copart Minneapolis North', N'yes', N'1526 Bunker Lake Blvd', N'-', N'Ham Lake', N'MN', '55304', N'USA', N'763-772-0700', N'763 772 0800', 45.218759626150131, -93.229107409715652) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1474', N'Copart Chicago South', N'yes', N'89 E. Sauk Trail', N'-', N'Chicago Heights', N'IL', '60411', N'USA', N'708-755-0506', N'708 755 0116', 41.483055114746094, -87.627029418945312) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1475', N'Copart Pittsburgh South', N'yes', N'526 Thompson Run Rd', N'-', N'West Mifflin', N'PA', '15122', N'USA', N'412-464-4340', N'412 464 4343', 40.367099761962891, -79.894447326660156) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1476', N'Copart Charleston', N'yes', N'2481, Rte. 60', N'-', N'Hurricane', N'WV', '25526', N'USA', N'304-562-2088', N'304 562 2231', 38.418817296624184, -82.034501060843468) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1477', N'Copart Somerville', N'yes', N'2124 West Camplain Road', NULL, N'Hillsborough', N'NJ',' 8844', N'USA', N'908-541-2200', N'908 541 2270', 40.536733, -74.604936) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1478', N'Copart Springfield', N'yes', N'2889 E. Us Highway 60', N'-', N'Rogersville', N'MO', '65742', N'USA', N'417-225-7000', N'417 753 3443', 37.120479583740234, -93.199790954589844) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1479', N'Copart Rancho Cucamonga', N'yes', N'12167 Arrow Route', N'-', N'Rancho Cucamonga', N'CA', '91739', N'USA', N'909-581-3595', N'909 581 3564', 34.0956916809082, -117.53875732421875) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1480', N'Copart Baltimore', N'yes', N'2251 Old Westminster Pike', N'-', N'Finksburg', N'MD', '21048', N'USA', N'410-871-9080', N'410 871 9515', 39.519677683711052, -76.917264685034752) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1481', N'Copart Eugene', N'yes', N'29815 Enid Road East', N'-', N'Eugene', N'OR', '97402', N'USA', N'541-689-3533', N'541 689 0379', 44.117473602294922, -123.17357635498047) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1482', N'Copart Miami Central', N'yes', N'11858 Nw 36th Ave', N'-', N'Miami', N'FL', '33167', N'USA', N'305-685-6608', N'305 685 9921', 25.88177002966404, -80.258210152387619) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1483', N'Copart Lexington East', N'yes', N'5801 Kasp Ct', N'-', N'Lexington', N'KY', '40509', N'USA', N'859-264-7401', N'859 264 7750', 37.96014404296875, -84.371818542480469) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1484', N'Copart Spokane', N'yes', N'11019 West Mcfarlane Road', N'-', N'Airway Heights', N'WA', '99001', N'USA', N'509-244-8585', N'509 244 8788', 47.626716, -117.566574) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1485', N'Copart York Haven', N'yes', N'795 Sipe Rd', N'-', N'York Haven', N'PA', '17370', N'USA', N'717-938-1879', N'717 938 2851', 40.111286163330078, -76.789741516113281) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1486', N'Copart Richmond', N'yes', N'5701 Whiteside Rd', N'-', N'Sandston', N'VA', '23150', N'USA', N'804-328-1023', N'804 737 8482', 37.522365570068359, -77.289741516113281) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1487', N'Dealers Auto Auction of Alaska, INC.', N'yes', N'8400 Arlon Street', N'-', N'Anchorage', N'AK', '99507', N'USA', N'907-563-8343', N'907-563-8307', 61.144382476806641, -149.83731079101563) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1488', N'Central Auto Auction', N'yes', N'185 Welton St.', NULL, N'Hamden', N'CT',' 6517', N'USA', N'203-787-2277', N'203-787-6564', 41.329427, -72.895923) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1489', N'Dealers Auto Auction of Murfreesboro', N'yes', N'1815 Old Fort Parkway', N'-', N'Murfreesboro', N'TN', '37129', N'USA', N'615-439-7187', N'615-217-6994', 35.843204498291016, -86.421127319335938) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1490', N'South Georgia Auto Auction', N'yes', N'1407 Silica Road', N'-', N'Albany', N'GA', '31705', N'USA', N'229-439-0005, 229-733-1350', N'229-878-1005', 31.567058563232422, -84.120719909667969) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1491', N'Wolfe`s Evansville Auto Auction', N'yes', N'2229 S. Kentucky Ave.', N'-', N'Evansville', N'IN', '47714', N'USA', N'812-492-3525', N'812-425-4570', 37.946002960205078, -87.549575805664062) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1492', N'ADESA Las Vegas', N'yes', N'1000 E Gowan Road', N'-', N'N. Las Vegas', N'NV', '89030', N'USA', N'702-800-8000', N'702-800-8149', 36.226856, -115.127372) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1493', N'Des Moines Auto Auction', N'yes', N'1530 SE Mckinley', N'-', N'Des Moines', N'IA', '50320', N'USA', N'515-285-8911', N'515-256-9161', 41.541732, -93.594223) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1494', N'America`s Auto Auction - Pittsburgh', N'yes', N'55 East Buffalo Church Road', N'-', N'Washington', N'PA', '15301', N'USA', N'724-225-1777', N'724-225-7223', 40.130893439054489, -80.3304836153984) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1495', N'America`s Auto Auction - Dallas', N'yes', N'219 North Loop 12', N'-', N'Irving', N'TX', '75061', N'USA', N'972-445-1044', N'972-591-2742 & 2743', 32.816471099853516, -96.923835754394531) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1496', N'America`s Auto Auction - North Houston, Inc.', N'yes', N'1440 FM 3083', N'-', N'Conroe', N'TX', '77301', N'USA', N'936-441-2882', N'936-788-2842', 30.340014472603798, -95.427547842264175) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1497', N'Copart Columbus', N'yes', N'1680 Williams Road', N'-', N'Columbus', N'OH', '43207', N'USA', N'614-497-1590', N'614 497 3698', 39.892505645751953, -82.946815490722656) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1498', N'Copart Birmingham', N'yes', N'3101 Davey Allison Blvd', N'PO Box 3533', N'Hueytown', N'AL', '35023', N'USA', N'205-424-0257', N'205 424 0955', 33.438411, -86.966735) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1499', N'Insurance Auto Auctions Portland/Gorham', N'yes', N'9 Moodys Dr', NULL, N'Gorham', N'ME',' 4038', N'USA', N'207 839-2045', N'2078392701', 43.66524, -70.46072) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1500', N'Insurance Auto Auctions Columbus', N'yes', N'1601 Thrailkill Road', N'-', N'Grove City', N'OH', '43123', N'-', N'614-875-7484', N'-', 39.886909484863281, -83.035804748535156) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1502', N'Insurance Auto Auctions South Bend', N'yes', N'25631 SR2', N'-', N'South Bend', N'IN', '46619', N'US', N'574-287-6212', N'-', 41.659507751464844, -86.35333251953125) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1504', N'America`s Auto Auction - Tulsa', N'yes', N'8544 East Admiral Place', N'-', N'Tulsa', N'OK', '74115', N'USA', N'918-832-1050', N'918-832-1676', 36.16071380674839, -95.881601572036743) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1505', N'America`s Auto Auction - Austin', N'yes', N'16611 S Interstate Highway 35', N'-', N'Buda', N'TX', '78610', N'USA', N'512-268-6600', N'(512) 295-6666', 30.069538116455078, -97.826416015625) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1506', N'All Valley Dealer Auto Auction', N'yes', N'7331 Laurel Canyon Blvd.', N'-', N'North Hollywood', N'CA', '91605', N'USA', N'818-381-8333', N'818-381-8338', 37.878952026367188, -122.27028656005859) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1508', N'Insurance Auto Auctions Billings', N'yes', N'75 Cerise Road', N'-', N'Billlings', N'MT', '59101', N'USA', N'4062592377', N'4062592302', 45.797854587435722, -108.46670933067799) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1509', N'Insurance Auto Auctions Bridgeport', N'yes', N'396 River Rd', N'-', N'Bridgeport', N'PA', '19405', N'USA', N'610-279-7123', N'610-279-3346', 40.104198455810547, -75.328079223632812) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1510', N'Insurance Auto Auctions Buckhannon', N'yes', N'200 Auction Lane', N'-', N'Buckhannon', N'WV', '26201', N'USA', N'304-472-3900', N'304-472-0871', 38.997915610671043, -80.256493538618088) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1511', N'Insurance Auto Auctions Cincinnati', N'yes', N'10100 Windisch Road', N'-', N'West Chester', N'OH', '45069', N'USA', N'513-779-0075', N'513-779-4267', 39.30154, -84.435546) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1512', N'Insurance Auto Auctions Des Moines', N'yes', N'1914 East Euclid', N'-', N'Des Moines', N'IA', '50313', N'USA', N'515-262-3710', N'515-262-7903', 41.631927490234375, -93.583938598632812) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1513', N'Insurance Auto Auctions El Paso', N'yes', N'14651 Gateway West', N'-', N'El Paso', N'TX', '79927', N'USA', N'915-852-2489', N'915-852-2235', 31.700080871582031, -106.28225708007813) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1514', N'Insurance Auto Auctions Fresno', N'yes', N'1805 N Lafayette', N'-', N'Fresno', N'CA', '93705', N'USA', N'559-264-5033', N'559-264-4251', 36.767555236816406, -119.84036254882813) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1515', N'Insurance Auto Auctions Los Angeles', N'yes', N'18300 S Vermont Ave', N'-', N'Gardena', N'CA', '90248', N'USA', N'310-965-0499', N'310-965-0455', 33.864238739013672, -118.28898620605469) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1516', N'Insurance Auto Auctions Paducah', N'yes', N'1701 Land Road', N'-', N'Paducah', N'KY', '42003', N'USA', N'270-443-8565', N'270-443-8549', 37.009456634521484, -88.586799621582031) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1517', N'Insurance Auto Auctions Savannah', N'yes', N'348 Commerce Dr.', N'-', N'Rincon', N'GA', '31326', N'USA', N'912-826-1219', N'912-826-1387', 32.246645987033844, -81.201188340783119) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1518', N'Insurance Auto Auctions Sioux Falls', N'yes', N'1700 E. 34th St N', N'-', N'Sioux Falls', N'SD', '57104', N'USA', N'605-271-8855', N'605-271-4662', 43.580749, -96.70578) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1519', N'Insurance Auto Auctions Springfield', N'yes', N'1155 North Eldon, Bldg B', N'-', N'Springfield', N'MO', '65803', N'USA', N'417-863-8976', N'417-865-5466', 37.221675872802734, -93.360137939453125) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1520', N'ABC St. Louis', N'yes', N'721 S. 45th', N'-', N'Centreville', N'IL', NULL, N'USA', N'618-332-1227', N'618-332-2227', 38.578147888183594, -90.1253662109375) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1521', N'South Florida Auto Auction of Ft Lauderdale', N'yes', N'3500 NW 21st Street', N'-', N'Lauderdale Lakes', N'FL', '33311', N'USA', N'954-739-9996', N'954-739-3359', 26.152622222900391, -80.194366455078125) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1523', N'Greater Milwaukee Auto Auction', N'yes', N'8711 W. Brown Deer Road', N'-', N'Milwaukee', N'WI', '53224', N'USA', N'414-365-3500', N'414-362-0391', 43.176456451416016, -88.019363403320312) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1525', N'Lynnway Auto Auction', N'yes', N'400 Charter Way', N'-', N'North Billerica', N'MA',' 1862', N'USA', N'781-596-8500', N'781-667-2343', NULL, NULL) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1526', N'Prime Auto Auction', N'yes', N'777 w. 190th Street', N'-', N'Gardena', N'CA', '90248', N'USA', N'310-380-4686', N'-', 33.860492929816246, -118.28695379197598) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1528', N'Houston Auto Auction', N'yes', N'6767 North Freeway', N'-', N'Houston', N'TX', '77076', N'USA', N'713-644-5566', N'713-644-4036', 29.861097, -95.406661) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1529', N'San Antonio Auto Auction', N'yes', N'13510 Toepperwein Road', N'-', N'San Antonio', N'TX', '78233', N'USA', N'210-298-5477', N'210-298-5484', 29.561416625976562, -98.348876953125) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1530', N'Wolfe`s Terre Haute Auto Auction Inc.', N'yes', N'1717 E Margaret Dr.', N'-', N'Terre Haute', N'IN', NULL, N'USA', N'812-238-1431', N'812-235-6257', 39.432830810546875, -87.392120361328125) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1531', N'Wolfe`s South Bend Auto Auction', N'yes', N'25784 State Road 2', N'-', N'South Bend', N'IN', '46619', N'USA', N'574-289-7767', N'574-288-2731', 41.6715087890625, -86.366813659667969) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1532', N'El Paso Independent Auto Auction', N'yes', N'7930 Artcraft Rd.', N'-', N'El Paso', N'TX', '79932', N'USA', N'915 587 6700', N'915 496 6060', 31.880897521972656, -106.58445739746094) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1533', N'Insurance Auto Auctions Pittsburgh', N'yes', N'57 Woodlawn Rd.', N'-', N'Aliquippa', N'PA', '15001', N'USA', N'(724) 375-6130', N'(724) 375-6975', 40.623146057128906, -80.2409439086914) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1534', N'Statewide Auto Auction', N'yes', N'1756 North Broad St', N'-', N'Meriden', N'CT',' 6450', N'USA', N'2032371975', N'2032371975', NULL, NULL) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1536', N'ADESA San Jose', N'yes', N'344 B Tully Rd', N'-', N'San Jose', N'CA', '95111', N'USA', N'408-890-2990', N'408-890-2991', 37.300121307373047, -121.8515625) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1537', N'Insurance Auto Auctions Ashland', N'yes', N'123 Four Wheel Drive', N'-', N'Ashland', N'KY', NULL, N'USA', N'(606) 928-1234', N'-', 38.438583374023438, -82.72283935546875) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1538', N'Insurance Auto Auctions Longview', N'yes', N'5577 Hwy 80 East', N'-', N'Longview', N'TX', '75605', N'USA', N'(903) 553-9248', N'-', 32.505160644650459, -94.643938466906548) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1539', N'Insurance Auto Auctions Permian Basin', N'yes', N'701 W 81st St', N'-', N'Odessa', N'TX', '79764', N'US', N'(432) 550-7277', N'-', 31.921186447143555, -102.41138458251953) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1540', N'Dealers Auto Auction of Mobile', N'yes', N'3030 McVay Drive North', N'-', N'Mobile', N'AL', '36606', N'USA', N'251-338-7653', N'-', 30.653472900390625, -88.11346435546875) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1541', N'Copart Hammond', N'yes', N'1849 Summer Street', N'-', N'Hammond', N'IN', '46320', N'USA', N'563-823-6955', N'-', 41.602504730224609, -87.48309326171875) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1542', N'Insurance Auto Auctions Tidewater', N'yes', N'211 Production Drive', N'-', N'Yorktown', N'VA', '23693', N'USA', N'757-595-8493', N'757-595-8691', 37.111793518066406, -76.464126586914062) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1544', N'Texas Lone Star Auto Auction', N'yes', N'2205 Country Club Drive', N'-', N'Carrollton', N'TX', '75006', N'USA', N'214-483-3597', N'-', 32.961627960205078, -96.8797378540039) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1545', N'166 Auto Auction', N'yes', N'2944 W. Sunshine Street', N'-', N'Springfield', N'MO', '65807', N'USA', N'4172279364', N'-', 37.182687744498253, -93.3368369936943) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1546', N'Central Maine Auction Center', N'yes', N'44 Concord Drive', N'-', N'Hermon', N'ME',' 4401', N'USA', N'207-848-7027', N'207-848-0739', NULL, NULL) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1547', N'Nebraska Auto Auction, Inc.', N'yes', N'7500 North 56th Street', N'-', N'Lincoln', N'NE', '68514', N'USA', N'402-466-8477', N'402-466-7932', 40.88641357421875, -96.639572143554688) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1548', N'ABC Lancaster, LLC', N'yes', N'1040 Commercial Ave.', N'-', N'East Peterburg', N'PA', '17520', N'USA', N'717-569-5220', N'-', 40.084171295166016, -76.34783935546875) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1549', N'WSM Auctions, LLC', N'yes', N'2701 Auto Mall Dr.', N'-', N'Bakersfield', N'CA', '93313', N'USA', N'661-829-6924', N'-', 35.300266265869141, -119.0325927734375) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1550', N'Western Wisconsin Auto Auction LLC', N'yes', N'3272 County Highway P', N'-', N'Chippewa Falls', N'WI', '54729', N'USA', N'715-723-1100', N'-', 44.890787824988365, -91.388871967792511) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1552', N'ADESA Quebec City', N'yes', N'500 1st Avenue', N'-', N'St- Romuald', N'QC', NULL, N'Canada', N'905-896-4400', N'905-896-3244', 46.7457804, -71.2414715) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1553', N'Insurance Auto Auctions Specialty Salvage', N'yes', N'2040 E ALGONQUIN RD', N'STE 501', N'SHAUMBURG', N'IL', '60173', N'USA', N'847-221-0901', N'847-221-0891', 42.0641274885869, -88.0336206925713) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1554', N'Fort Wayne Auto and Truck Auction LLC', N'yes', N'3600 E Washington Blvd.', N'-', N'Fort Wayne', N'IN', '46803', N'USA', N'260-748-2000', N'-', 41.07220458984375, -85.094047546386719) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1555', N'Insurance Auto Auctions Gulf Coast', N'yes', N'8209 Old Stage Rd.', N'-', N'Moss Point', N'MS', '39562', N'USA', N'228-474-5559', N'228-474-5551', 30.418205261230469, -88.469642639160156) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1557', N'Insurance Auto Auctions Dothan', N'yes', N'15994 US Hwy 431', N'-', N'Headland', N'AL', '36345', N'USA', N'334-693-4910', N'334-693-4920', 31.3639497756958, -85.327290818095207) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1558', N'Insurance Auto Auctions Avenel New Jersey', N'yes', N'87 Randolph Ave.', N'-', N'Avenel', N'NJ',' 7001', N'USA', N'732-499-6802', N'732-499-6807', NULL, NULL) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1559', N'Crosspoint NW Dealer Auctions', N'yes', N'6803 SE Johnson Creek Blvd.', N'-', N'Portland', N'OR', '97206', N'USA', N'503-594-2800', N'503-654-2225', 45.457687377929688, -122.59140014648438) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1560', N'Insurance Auto Auctions Anchorage', N'yes', N'221 E. Centaur', N'-', N'Wasilla', N'AK', '99654', N'USA', N'907-376-5364', N'(907)376-3749', 61.57586669921875, -149.44651794433594) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1561', N'Insurance Auto Auctions Louisville', N'yes', N'1825 S. Preston Highway', N'-', N'Shepherdsville', N'KY', '40165', N'USA', N'502-543-0831', N'(502) 543-1289', 37.969535827636719, -85.7109603881836) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1562', N'Alliance Auto Auction of Waco', N'yes', N'15735 N. I35', N'-', N'Elm Mott', N'TX', '76640', N'USA', N'254-829-0123', N'-', 31.689729690551758, -97.071250915527344) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1563', N'Insurance Auto Auctions Asheville', N'yes', N'4900 Hendersonville Hwy.', N'-', N'Fletcher', N'NC', '28732', N'USA', N'828-684-1564', N'-', 35.414432525634766, -82.505691528320312) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1564', N'Insurance Auto Auctions Columbia', N'yes', N'1416 Atlas Rd.', N'-', N'Columbia', N'SC', '29209', N'USA', N'803-217-0109', N'-', 33.953140258789062, -80.955856323242188) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1565', N'Insurance Auto Auctions Lafayette', N'yes', N'301 Malapart Rd.', N'-', N'Lafayette', N'LA', '70507', N'USA', N'337-896-3829', N'-', 30.28839111328125, -92.056427001953125) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1566', N'Badger State Auto Auction', N'yes', N'215 N. Pioneer Road', N'-', N'North Fond du Lac', N'WI', '54935', N'USA', N'800-554-1126 ext 112', N'1566', 43.800380706787109, -88.487800598144531) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1567', N'Alpine Auto Auction of Gaylord, LLC.', N'yes', N'5216 Old 27 N.', N'-', N'Gaylord', N'MI', '49735', N'USA', N'989-966-2060', N'989-966-2064', 45.10235595703125, -84.6629638671875) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1568', N'Auto Auction of Montgomery LLC', N'yes', N'6142 Troy Hwy', N'-', N'Pike Road', N'AL', '36064', N'USA', N'334-288-3399', N'334-288-4875', 32.284206300973892, -86.184001788496971) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1569', N'Metro Auto Auction Dallas, Inc.', N'yes', N'1836 Midway Road', N'-', N'Lewisville', N'TX', '75056', N'USA', N'972-492-0900', N'972-492-0944', 33.046724796295166, -96.939348801970482) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1570', N'South Bay Auto Auction of Stockton', N'yes', N'4101 Airport Way', N'-', N'Stockton', N'CA', '95206', N'USA', N'209-690-9191', N'209-944-7725', 37.909011840820312, -121.25974273681641) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1572', N'Big Valley Auto Auction, LP', N'yes', N'4315 N Hutto Rd', N'-', N'Donna', N'TX', '78537', N'USA', N'956-461-9000', N'956-461-9005', 26.197065711021423, -98.063609451055527) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1573', N'Insurance Auto Auctions New Orleans East', N'yes', N'6600 Almonaster Avenue', N'-', N'New Orleans', N'LA', '70126', N'USA', N'504 240-2298', N'9858921039', 30.002780914306641, -90.010581970214844) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1574', N'Midland Odessa Auto Auction', N'yes', N'2521 N Marco Avenue', N'-', N'Odessa', N'TX', '79762', N'USA', N'432-367-3063', N'432-367-3358', 31.883092880249023, -102.294921875) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1575', N'ABC Baton Rouge, LLC', N'yes', N'3960 Blount Road', N'-', N'Baton Rouge', N'LA', '70807', N'USA', N'225 778-3737', N'-', 30.544628128409386, -91.1518357694149) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1576', N'DAA Seattle', N'yes', N'3130 D Street SE', N'-', N'Auburn', N'WA', '98002', N'USA', N'253-737-2200', N'509-244-8244', 47.280676290392876, -122.22398668527603) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1577', N'Skipco Auto Auction', N'yes', N'700 Elm Ridge Avenue', N'-', N'Canal Fulton', N'OH', '44614', N'USA', N'800-824-7881', N'330-854-3005', 40.886058807373047, -81.567619323730469) +GO +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1578', N'Richmond Auto Auction of Virginia, Inc.', N'yes', N'3600 Deepwater Terminal Road', N'-', N'Richmond', N'VA', '23234', N'USA', N'804-232-7355', N'804-232-1818', 37.4753532409668, -77.425987243652344) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1579', N'Mason Dixon Auto Auction', N'yes', N'12876 Molly Pitcher Highway', N'-', N'Greencastle', N'PA', '17225', N'USA', N'717-597-3121', N'717-597-0220', 39.759323671460152, -77.727190554142) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1580', N'National Powersport Auctions', N'yes', N'12400 Stowe Drive', N'-', N'Poway', N'CA', '92064', N'USA', N'404-348-8709', N'-', 32.942489624023438, -117.05381774902344) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1581', N'Clark County Auto Auction', N'yes', N'1611 Highway 62', N'-', N'Jeffersonville', N'IN', '47130', N'USA', N'812-283-5555', N'812-288-0834', 38.352699279785156, -85.703628540039062) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1582', N'Southeastern Auto Auction of Savannah', N'yes', N'1712 Dean Forest Road', N'-', N'Savannah', N'GA', '31408', N'USA', N'912-965-9901', N'912-965-0525', 32.086719, -81.195419) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1585', N'Insurance Auto Auctions Akron/Canton', N'yes', N'2932 State Route 259SE', N'-', N'New Philadelphia', N'OH', '44663', N'USA', N'303-339-1995', N'303-339-5773', 40.45581, -81.401473) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1587', N'Insurance Auto Auctions Culpeper', N'yes', N'15201 Review Rd', N'-', N'Culpeper', N'VA', '22701', N'USA', N'540-825-2229', N'540-825-2258', 38.492706298828125, -77.9278793334961) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1588', N'Insurance Auto Auctions Dayton', N'yes', N'400 Cherokee Drive', N'-', N'Dayton', N'OH', '45417', N'USA', N'937-268-6666', N'937-268-0852', 39.739753723144531, -84.29217529296875) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1589', N'Insurance Auto Auctions New Castle', N'yes', N'417 Old Airport Rd', N'-', N'New Castle', N'DE', '19720', N'USA', N'302-322-1808', N'302-322-5165', 39.698451995849609, -75.617446899414062) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1590', N'Insurance Auto Auctions Wichita', N'yes', N'270 W 53rd ST North', N'-', N'Wichita', N'KS', '67204', N'USA', N'316-832-1101', N'316-832-1226', 37.782497406005859, -97.339935302734375) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1591', N'Winchester Auto Auction', N'yes', N'12828 Winchester Ave.', N'-', N'Bunker Hill', N'WV', '25413', N'USA', N'304 229-4400', N'304 229-9067', 39.295180812478065, -78.079226464033127) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1592', N'Z66 Auto Auction', N'yes', N'66 North Mingo', N'-', N'Tulsa', N'OK', '74116', N'USA', N'918.794.0660', N'918 794-0740', 36.162815093994141, -95.8711166381836) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1593', N'ABC Cincinnati', N'yes', N'120 Citycentre Drive', N'-', N'Cincinnati', N'OH', '45216', N'USA', N'513-679-7910', N'513-679-7913', 39.200519561767578, -84.470748901367188) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1596', N'Insurance Auto Auctions Denver East', N'yes', N'8510 Brighton Rd.', N'-', N'Commerce City', N'CO', '80022', N'USA', N'303-287-9737', N'303-287-1214', 39.85094390809536, -104.91712421178818) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1597', N'Western Canada Remarketing', N'yes', N'1623 Cliveden Avenue', N'-', N'Delta', N'BC', NULL, N'Canada', N'604 540-8422', N'604 540-8423', 49.16295, -122.97281) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1599', N'Insurance Auto Auctions Amarillo', N'yes', N'11150 S. FM 1541', N'-', N'Amarillo', N'TX', '79118', N'USA', N'806-622-1322', N'806-622-2678', 35.096538543701172, -101.84954833984375) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1600', N'Speedway Auto Auction of Charlotte', N'yes', N'224 Highway 49', N'-', N'South Concord', N'NC', '28025', N'USA', N'(980) 781-4700', N'(980) 781-4192', 35.367274805903435, -80.578815266489983) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1601', N'Your Auction of Tampa Bay', N'yes', N'3010 Scherer Dr, North', N'-', N'St. Petersburg', N'FL', '33716', N'USA', N'(727) 572-8850', N'(727) 556-2898', 27.885547801852226, -82.67511248588562) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1602', N'ADESA Fresno', N'yes', N'3260 E. Annadale Ave.', N'-', N'Fresno', N'CA', '93725', N'USA', N'(559) 549-6576', N'-', 36.700031280517578, -119.77001190185547) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1603', N'Insurance Auto Auctions National Network', N'yes', N'69 Hinckley Road', N'-', N'Clinton', N'ME',' 4927', N'USA', N'800-872-1501', N'207-426-2010', NULL, NULL) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1604', N'Copart Toronto', N'yes', N'175 OSBORNE ROAD', N'-', N'COURTICE', N'ON', NULL, N'Canada', N'(905) 436-2045', N'-', 43.87257, -78.74925) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1605', N'Copart Hampton', N'yes', N'16 NETTLES LANE', N'-', N'HAMPTON', N'VA', '23666', N'USA', N'(757) 766-2750', N'-', 37.070167064666748, -76.3860934227705) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1606', N'Copart Montgomery', N'yes', N'6044 TROY HIGHWAY', N'-', N'MONTGOMERY', N'AL', '36116', N'USA', N'(334) 281-7264', N'-', 32.285467609763145, -86.185297295451164) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1607', N'Copart Greer', N'yes', N'2465 HIGHWAY 101 SOUTH', N'GREER', N'GREER', N'SC', '29651', N'USA', N'(864) 877-9113', N'-', 34.867618560791016, -82.139122009277344) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1608', N'Copart Louisville', N'yes', N'3100 POND STATION ROAD', N'-', N'LOUISVILLE', N'KY', '40272', N'USA', N'(502) 361-1881', N'-', 38.112087249755859, -85.819175720214844) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1609', N'Copart Salisbury', N'yes', N'26029 BETHEL CONCORD ROAD', N'-', N'SEAFORD', N'DE', '19973', N'USA', N'(302) 628-5412', N'-', 38.6302604675293, -75.5628890991211) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1610', N'Copart Columbia', N'yes', N'8485 RICHLAND RD', N'-', N'COLUMBIA', N'MO', '65201', N'USA', N'(573) 814-0070', N'-', 38.949932098388672, -92.2078857421875) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1611', N'Copart Lincoln', N'yes', N'13603 238TH ST', N'-', N'GREENWOOD', N'NE', '68366', N'USA', N'(402) 944-3255', N'-', 40.974891662597656, -96.39154052734375) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1612', N'Copart Tallahassee', N'yes', N'1825 Commerce Blvd.', N'-', N'Midway', N'FL', '32343', N'USA', N'850-575-2075', N'-', 30.498054921627045, -84.408170878887177) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1613', N'Copart Knoxville', N'yes', N'6355 B HIGHWAY 411', N'-', N'MADISONVILLE', N'TN', '37354', N'USA', N'(423) 442-5866', N'-', 35.455901026725769, -84.4363608956337) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1614', N'Copart Anchorage', N'yes', N'401 W Chipperfield Dr', N'-', N'Anchorage', N'AK', '99501', N'USA', N'(907) 278-2221', N'-', 61.218994140625, -149.8287353515625) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1615', N'Copart Cleveland West', N'yes', N'34417 E. ROYALTON ROAD', N'-', N'COLUMBIA STATION', N'OH', '44028', N'USA', N'(440) 748-8100', N'-', 41.310607, -81.98545) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1616', N'Copart Honolulu', N'yes', N'91-542 AWAKUMOKU ST', N'-', N'KAPOLEI', N'HI', '96707', N'USA', N'(808) 682-8770', N'-', 21.317626610398293, -158.11629787087441) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1617', N'Copart Atlanta East', N'yes', N'6089 HIGHWAY 20', N'-', N'LOGANVILLE', N'GA', '30052', N'USA', N'770-554-6366', N'-', 33.804505169391632, -83.951904326677322) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1618', N'Copart Helena', N'yes', N'3333 Bozeman Avenue', N'-', N'Helena', N'MT', '59601', N'USA', N'(406) 443-5060', N'-', 46.597072601318359, -111.97350311279297) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1619', N'Copart Lansing', N'yes', N'3902 South Canal Road', N'-', N'Lansing', N'MI', '48917', N'USA', N'(517) 322-2455', N'-', 42.691696166992188, -84.66412353515625) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1620', N'Copart Reno', N'yes', N'9915 N. Virginia Street', N'-', N'Reno', N'NV', '89506', N'USA', N'(775) 322-4377', N'-', 39.615032196044922, -119.88481903076172) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1621', N'Copart Amarillo', N'yes', N'3999 S Loop 335 E', N'-', N'Amarillo', N'TX', '79118', N'USA', N'(806) 335-3701', N'-', 35.120822712779045, -101.79081246256828) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1622', N'Copart Albany', N'yes', N'1916 Central Ave', N'-', N'Albany', N'NY', '12205', N'USA', N'(518) 452-9313', N'-', 42.735668182373047, -73.8563232421875) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1623', N'Copart Tucson', N'yes', N'5600 S. Arcadia Ave', N'-', N'Tucson', N'AZ', '85706', N'USA', N'(520) 663-1900', N'-', 32.150173187255859, -110.88906097412109) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1624', N'Copart Lyman', N'yes', N'136 Kennebunk Pond Road', N'-', N'Lyman', N'ME',' 4002', N'USA', N'(207) 499-7255', N'-', NULL, NULL) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1625', N'Copart Boise', N'yes', N'3716 North Middleton Road', N'-', N'Nampa', N'ID', '83651', N'USA', N'(208) 463-4040', N'-', 43.618644, -116.614463) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1626', N'Copart Wichita', N'yes', N'4510 S Madison', N'-', N'Wichita', N'KS', '67216', N'USA', N'(316) 554-0123', N'-', 37.611289978027344, -97.308341979980469) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1627', N'Copart Mobile', N'yes', N'4763 Lott Road', N'-', N'Eight Mile', N'AL', '36613', N'USA', N'(251) 649-5011', N'-', 30.788215, -88.218269) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1628', N'Copart Peoria', N'yes', N'14417 VFW Road', N'-', N'Pekin', N'IL', '61554', N'USA', N'(309) 347-4196', N'-', 40.527996063232422, -89.656509399414062) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1629', N'Copart Baton Rouge', N'yes', N'21595 Greenwell Springs Road', N'-', N'Greenwell Springs', N'LA', '70739', N'USA', N'(225) 261-0102', N'-', 30.559904098510742, -90.996505737304688) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1630', N'Copart Salt Lake City', N'yes', N'170 W. Center Street', N'-', N'North Salt Lake', N'UT', '84054', N'USA', N'(801) 294-3000', N'-', 40.841911509633064, -111.91717810928822) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1631', N'Copart Little Rock', N'yes', N'703 Main Street', N'-', N'Conway', N'AR', '72032', N'USA', N'(501) 796-2812', N'-', 35.0836067199707, -92.28961181640625) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1632', N'Copart Tulsa', N'yes', N'2408 W 21st Street', N'-', N'Tulsa', N'OK', '74107', N'USA', N'918-582-3828', N'-', 36.1315803527832, -96.021232604980469) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1633', N'Copart San Jose', N'yes', N'13895 LLAGAS AVE', N'-', N'San Martin', N'CA', '95046', N'USA', N'(408) 683-9393', N'-', 37.093673706054688, -121.61157989501953) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1635', N'Music City Auto Auction of Nashville', N'yes', N'3639 Royal Park Blvd,', N'-', N'Spring Hill', N'TN', '37174', N'USA', N'(931) 674-8000', N'(931) 674-8004', 35.727392882108688, -86.920372769236565) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1637', N'Alliance Auto Auction of Dallas', N'yes', N'9426 Lakefield Blvd.', N'-', N'Dallas', N'TX', '75220', N'USA', N'(214) 646-3136', N'(469) 828-8225', 32.8585319519043, -96.862838745117188) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1638', N'135 Auto Auction', N'yes', N'4716 S Santa Fe Street', N'-', N'Wichita', N'KS', '67216', N'USA', N'316-351-5001', N'316-522-7032', 37.609153747558594, -97.327743530273438) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1639', N'Insurance Auto Auctions McAllen', N'yes', N'900 N. Hutto Road', N'-', N'Donna', N'TX', '78537', N'USA', N'(956) 464-8393', N'(956) 464-8510', 26.182461082935333, -98.066010028123856) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1640', N'Insurance Auto Auctions Abilene', N'yes', N'7700 US Hwy 277', N'-', N'Hawley', N'TX', '79601', N'USA', N'(325) 675-0699', N'(325) 675-5073', 32.671507224440575, -99.856866672635078) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1641', N'Insurance Auto Auctions Shreveport', N'yes', N'4836 McGee Rd.', N'-', N'Greenwood', N'LA', '71033', N'USA', N'(318) 938-5108', N'(318) 938-5838', 32.447151184082031, -93.97210693359375) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1642', N'Insurance Auto Auctions Davenport', N'yes', N'5403 Rockingham Rd.', N'-', N'Davenport', N'IA', '52802', N'USA', N'(563) 322-8562', N'(563) 322-8896', 41.485019683837891, -90.65057373046875) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1643', N'Insurance Auto Auctions Tifton', N'yes', N'368 Oak Ridge Church Rd.', N'-', N'Tifton', N'GA', '31794', N'USA', N'(229) 386-2640', N'(229-386-2650)', 31.400556564331055, -83.490196228027344) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1644', N'Insurance Auto Auctions Huntsville', N'yes', N'16326 Ennis Road', N'-', N'Athens', N'AL', '35613', N'USA', N'(256) 233-5899', N'(256) 233-2366', 34.79376220703125, -86.872055053710938) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1645', N'America`s Auto Auction - Houston', N'yes', N'1826 Almeda-Genoa Road', N'-', N'Houston', N'TX', '77047', N'USA', N'(281) 819-3600', N'(281) 819-3601', 29.613801687955856, -95.395094454288483) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1646', N'Detroit Distribution Center', N'yes', N'6301 Wyoming Ave', N'-', N'Dearborn', N'MI', '48126', N'USA', N'810-736-8174', N'(810) 736-3351', 42.336300909519196, -83.157016262412071) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1647', N'Insurance Auto Auctions Lubbock', N'yes', N'5311 N. Country Road 2000', N'-', N'Lubbock', N'TX', '79415', N'USA', N'(806) 747-5458', N'(806) 747-5472', 33.648868, -101.906509) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1648', N'Insurance Auto Auctions Macon', N'yes', N'2200 Trade Ave.', N'-', N'Macon', N'GA', '31217', N'-', N'(478) 314-0031', N'(478) 314-0040', 32.8480339050293, -83.5848159790039) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1649', N'Insurance Auto Auctions Reno', N'yes', N'4086 Peru Drive', N'-', N'McCarran', N'NV', '89434', N'USA', N'(775) 636-8829', N'(775) 636-7280', 36.083145141601562, -115.14917755126953) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1650', N'Insurance Auto Auctions Riverside', N'yes', N'3760 Pyrite Street', N'-', N'Riverside', N'CA', NULL, N'USA', N'(909)355-9400', N'(909)822-9311', 34.018917083740234, -117.46300506591797) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1651', N'Insurance Auto Auctions Suffolk', N'yes', N'1389 Portsmouth Blvd.', N'-', N'Suffolk', N'VA', '23434', N'USA', N'(757) 539-0571', N'(757) 539-0573', 36.749214172363281, -76.5201416015625) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1652', N'Insurance Auto Auctions Tulsa', N'yes', N'5311 W. 46th Street S', N'-', N'Tulsq', N'OK', '74107', N'USA', N'(918) 445-4691', N'(918) 445-4905', 36.099376, -96.052215) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1653', N'Insurance Auto Auctions York Springs', N'yes', N'10 Auction Dr', N'-', N'York Springs', N'PA', '17372', N'USA', N'(717) 528-4336', N'(717) 528-4346', 40.020839691162109, -77.095733642578125) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1655', N'Insurance Auto Auctions Atlanta-North', N'yes', N'6242 Black Acre Trail', N'-', N'Acworth', N'GA', '30101', N'USA', N'(770) 975-1107', N'(770) 975-1250', 34.079168736934662, -84.732352048158646) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1656', N'Dealers Auto Auction of Las Vegas', N'yes', N'3038 Losee Rd', N'-', N'North Las Vegas', N'NV', '89030', N'USA', N'702-255-0990', N'702-255-0991', 36.215164, -115.127944) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1657', N'ADESA Chicago', N'yes', N'2785 Beverly Road', N'-', N'Hoffman Estates', N'IL', '60169', N'USA', N'847-636-7985', N'-', 42.075476199388504, -88.223549500107765) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1658', N'Auctions In Motion', N'yes', N'1901 East Edinger', N'-', N'Santa Ana', N'CA', '92705', N'USA', N'(805) 499-7640', N'(805) 426-8114', 33.726912885904312, -117.83978663384914) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1659', N'ADESA Windsor', N'yes', N'18800 County Road 42', N'-', N'Tilbury', N'ON', NULL, N'Canada', N'519-682-9500', N'519-682-9814', NULL, NULL) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1660', N'CrashedToys', N'yes', N'7777 John Carpenter Fwy', N'-', N'Dallas', N'TX', '75247', N'USA', N'(214) 920-9664', N'(214) 920-9668', 32.818576812744141, -96.87451171875) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1661', N'Insurance Auto Auctions Louisville North', N'yes', N'891 Ballardsville Road', N'-', N'Eminence', N'KY', '40019', N'USA', N'(502) 215-4804', N'-', 38.370294123888016, -85.192626491189) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1662', N'Value Auto Auction', N'yes', N'3776 S.R. 93 N. E.', N'-', N'Crooksville', N'OH', '43731', N'USA', N'(740) 982-3030', N'(740) 982-3055', 39.736516177654266, -82.099933549761772) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1663', N'Lake Charles Auto Auction', N'yes', N'2435 BROAD ST', N'-', N'Lake Charles', N'LA', '70601', N'USA', N'337-433-8664', N'337-436-7197', 30.227977752685547, -93.181526184082031) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1664', N'Insurance Auto Auctions Shady Spring', N'yes', N'4163 Pluto Road', N'-', N'Shady Spring', N'WV', '25918', N'USA', N'(304) 253-4970', N'-', 37.75385744869709, -80.983975678682327) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1665', N'Bar None Auction - Portland', N'yes', N'1501 N. Schmeer Road', N'-', N'Portland', N'OR', '97217', N'USA', N'916-246-2156', N'916-638-8961', 45.590789794921875, -122.68500518798828) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1666', N'Bar None Auction - Riverside', N'yes', N'9400 Galena Street', N'-', N'Riverside', N'CA', '92509', N'USA', N'916-246-2156', N'916-638-8961', 34.004467874765396, -117.48855002224445) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1667', N'Bar None Auction - Sacramento', N'yes', N'4751 Power Inn Road', N'-', N'Sacramento', N'CA', '95826', N'USA', N'916-246-2156', N'916-638-8961', 38.532817840576172, -121.40796661376953) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1668', N'Mid Kansas Auto Auction', N'yes', N'700 W. 48th Street', N'-', N'Hays', N'KS', '67601', N'United States', N'785-621-2100', N'785-621-2101', 38.905391693115234, -99.328910827636719) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'1669', N'Ken Porter Auctions', N'yes', N'21140 S. Avalon Blvd.', N'-', N'Carson', N'CA', '90745', N'USA', N'310-353-7140', N'310-353-5740', 33.8844108581543, -118.26509094238281) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'2003', N'Manheim Leicester', N'yes', N'Charnwood Road', N'-', N'Shepshed', N'Leicestershire', NULL, N'England', N'(101144) 1509-502171', N'(101144) 1509-507570', 52.765161, -1.295592) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'2005', N'TRA - Casper', N'yes', N'1998 N Oil Field Center Road', N'-', N'Casper', N'WY', '82604', N'USA', N'303-395-8366', N'303-470-5447', 42.874477, -106.427871) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'3512', N'TRA - Springfield', N'yes', N'1619 S Golden', N'-', N'Springfield', N'MO', '65807', N'USA', N'417-447-9742', N'417-447-9743', 37.186206817626953, -93.340904235839844) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'4444', N'ADESA.com', N'yes', N'-', N'-', N'-', N'AZ', NULL, N'USA', N'480-556-5236', N'480-291-9618', 34.292964935302734, -111.66469573974609) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'5555', N'Demonstration Auction', N'yes', N'50 Glenlake Parkway', N'Suite 400', N'Atlanta', N'GA', NULL, N'USA', N'(678) 597-3900', N'(678) 597-3939', 33.940643310546875, -84.3619384765625) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'6777', N'Copart National Network', N'yes', N'14185 Dallas Parkway, Suite 300', N'-', N'Dallas', N'TX', '75254', N'USA', N'800-269-4885', N'(800) 269-4880', 32.939014, -96.822944) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'7777', N'Demo Salvage Auction', N'yes', N'-', N'-', N'-', N'GA', NULL, N'-', N'-', N'-', 32.648323059082031, -83.444534301757812) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'AAA', N'Manheim Atlanta', N'yes', N'4900 Buffington Rd', N'-', N'College Park', N'GA', '30349', N'USA', N'-', N'-', 33.621177, -84.495666) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'AAAI', N'Manheim New England', N'yes', N'123 Williams Street', N'-', N'North Dighton', N'MA',' 2764', N'USA', N'(508) 823-6600', N'(508) 821 3432', NULL, NULL) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'AAAW', N'Manheim Georgia', N'yes', N'7205 Campbellton Rd SW', N'-', N'Atlanta', N'GA', '30331', N'USA', N'404-349-5555', N'-', 33.695892333984375, -84.62249755859375) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'ALBA', N'Manheim New Mexico', N'yes', N'3411 Broadway BLVD SE', N'-', N'Albuquerque', N'NM', '87105', N'USA', N'(505) 242-9191', N'(505) 247-7415', 35.037357330322266, -106.64808654785156) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'ALOH', N'Manheim Hawaii', N'yes', N'1001 Ahua St', N'-', N'Honolulu', N'HI', '96819', N'USA', N'(808) 840-8900', N'(808) 840-8999', 21.342338562011719, -157.89483642578125) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'AREN', N'Manheim Arena Illinois', N'yes', N'200 West Old Chicago Drive', N'-', N'Bolingbrook', N'IL', '60440', N'USA', N'630-759-3800', N'630-679-8321', 41.679855, -88.068267) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'AYCA', N'Manheim North Carolina', N'yes', N'318 Bagley Road', N'P O Box 760', N'Kenly', N'NC', '27542', N'USA', N'(919) 284-4052', N'(919) 284-5706', 35.574802, -78.163902) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'BAA', N'Manheim Pittsburgh', N'yes', N'21095 Route 19 North', N'-', N'Cranberry Township', N'PA', NULL, N'USA', N'(724) 452-5555', N'(724) 452-2046', 40.728466, -80.109886) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'BCAA', N'Manheim San Francisco Bay', N'yes', N'29900 Auction Way', N'-', N'Hayward', N'CA', '94544', N'USA', N'(510) 786-4500', N'(510) 786-2338', 37.615676879882812, -122.06822967529297) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'BELA', N'Bel Air Auto Auction, Inc.', N'yes', N'803 Bel Air Rd. U.S. Rte.1', N'P.O. BOX 516', N'Bel Air', N'MD', '21014', N'USA', N'(410) 879-7950', N'(410) 893-1515', 39.519593194127083, -76.360890045762062) +GO +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'BELS', N'Bel Air Auto Auction, Inc. (Salvage)', N'yes', N'803 Bel Air Rd. U.S. Rte.1', N'P.O. BOX 516', N'Bel Air', N'MD', '21014', N'USA', N'(410) 879-7950', N'(410) 893-1515', 39.519593194127083, -76.360890045762062) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'BIGH', N'Manheim Houston', N'yes', N'14450 West Road', N'-', N'Houston', N'TX', NULL, N'USA', N'281-955-4650', N'(281) 955-4626', 29.901294, -95.618049) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'BWAE', N'Manheim Balt Wash', N'yes', N'7120 Dorsey Run Road', N'-', N'Elkridge', N'MD', '21075', N'USA', N'(800) 533-2923', N'(410) 799-0512', 39.175437927246094, -76.759140014648438) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'CAAI', N'Manheim Darlington', N'yes', N'1111 Harry Byrd Highway', N'-', N'Darlington', N'SC', NULL, N'USA', N'(843) 395-5696', N'(843) 395-5663', 34.294353485107422, -79.8949966430664) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'CADE', N'Manheim California', N'yes', N'1320 N. Tustin Avenue', N'-', N'Anaheim', N'CA', NULL, N'USA', N'714 996 2400', N'714-985-8351', 33.865203857421875, -117.84103393554688) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'CANM', N'Manheim Vancouver', N'yes', N'400-628 Sixth Avenue', N'-', N'New Westminster', N'BC', NULL, N'Canada', N'604-545-2277', N'-', 49.2127713, -122.9207721) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'CINA', N'Manheim Cincinnati', N'yes', N'4969 Mulhauser Road', N'-', N'Hamilton', N'OH', NULL, N'USA', N'(800) 489-7253', N'5138741531', 39.316280364990234, -84.4549789428711) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'CLEV', N'Manheim Cleveland', N'yes', N'4720 Brookpark Road', N'-', N'Cleveland', N'OH', '44134', N'USA', N'216-539-1701', N'-', 41.419589996337891, -81.7196273803711) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'DAA', N'Manheim Denver', N'yes', N'17500 E. 32nd Avenue', N'-', N'Aurora', N'CO', NULL, N'USA', N'(800) 822-1177', N'(303) 343-6466', 39.7588005065918, -104.78585815429688) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'DAAE', N'Manheim El Paso', N'yes', N'485 Coates Drive', N'-', N'El Paso', N'TX', NULL, N'USA', N'915-585-5230', N'915-581-9645', 31.869251251220703, -106.58005523681641) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'DADE', N'Manheim Daytona Beach', N'yes', N'1305 Indian Lake Road', N'-', N'Daytona Beach', N'FL', NULL, N'USA', N'800-881-3233', N'(386)255-1249 FAX', 29.144857406616211, -81.142669677734375) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'DALA', N'Manheim Dallas', N'yes', N'5333 West Kiest Boulevard', N'-', N'Dallas', N'TX', NULL, N'USA', N'(214) 330-1800', N'(214) 339-9361', 32.708354949951172, -96.913093566894531) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'DETA', N'Manheim Detroit', N'yes', N'600 Will Carleton Rd', N'-', N'Carleton', N'MI', '48117', N'USA', N'(734) 654-7100', N'(734) 654-7146', 42.088588714599609, -83.370887756347656) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'DFWA', N'Manheim DFW', N'yes', N'12101 Trinity Blvd', N'-', N'Euless', N'TX', '76040', N'USA', N'(817) 399-4000', N'(817) 399-4251', 32.816577911376953, -97.1060562133789) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'DRIV', N'Manheim DRIVE Center', N'yes', N'3000 Walter Way', N'-', N'Stockbridge', N'GA', '30281', N'USA', N'(678) 284-4188', N'-', 33.540401458740234, -84.260917663574219) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'EDMO', N'Manheim Edmonton', N'yes', N'12866 153 St. NW', N'-', N'Edmonton', N'AB', NULL, N'Canada', N'780-784-5555', N'780-784-5565', 53.5869, -113.58635) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'FAA', N'Manheim Fredericksburg', N'yes', N'120 Auction Drive', N'-', N'Fredericksburg', N'VA', '22406', N'USA', N'(540) 368-3400', N'(540) 368-3618', 38.350517272949219, -77.488037109375) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'FAAO', N'Manheim Orlando', N'yes', N'11801 West Colonial Drive', N'-', N'Ocoee', N'FL', NULL, N'USA', N'(800) 337-8491', N'(407) 656-7846', 28.555801391601562, -81.553024291992188) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'FADA', N'Manheim Central California', N'yes', N'278 North Marks Avenue', N'-', N'Fresno', N'CA', NULL, N'USA', N'(559) 268-8051', N'(559)-459-5248', 36.740097045898438, -119.84201049804688) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'GCAA', N'Manheim Chicago', N'yes', N'20401 Cox Avenue', N'-', N'Matteson', N'IL', '60443', N'USA', N'815 806 4222', N'815 806 4228', 41.518272399902344, -87.778282165527344) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'GOAA', N'Manheim Central Florida', N'yes', N'9800 Bachman Road', N'-', N'Orlando', N'FL', '32824', N'USA', N'(407)438-1000', N'(407) 438-2828', 28.426340103149414, -81.39373779296875) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'HAA', N'Manheim Harrisonburg', N'yes', N'3560 Early Rd.', N'-', N'Harrisonburg', N'VA', NULL, N'USA', N'(540) 434-5991', N'(540) 433-7348', 38.399169921875, -78.903961181640625) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'HATA', N'Manheim Philadelphia', N'yes', N'2280 Bethlehem Pike, Route 309', N'-', N'Hatfield', N'PA', '19440', N'USA', N'(215) 822-1935', N'2679541058', 40.295291900634766, -75.2833023071289) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'HLFX', N'Manheim Halifax', N'yes', N'376 Lower Sackville Dr.', N'-', N'Lower Sackville', N'NS', NULL, N'Canada', N'902-865-8650', N'902-865-9948', 44.76306, -63.67581) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'IBSL', N'ADESA Salt Lake', N'yes', N'780 South 5600 West', N'-', N'Salt Lake City', N'UT', NULL, N'USA', N'(801) 322-1234', N'(801) 322-1315', 40.754661560058594, -112.02791595458984) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'INDY', N'Manheim Indianapolis', N'yes', N'3110 South Post Road', N'-', N'Indianapolis', N'IN', '46239', N'USA', N'(317) 862-8622', N'(317) 862-8623', 39.722957611083984, -86.009071350097656) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'JAX', N'Manheim Jacksonville', N'yes', N'10817 New Kings Rd', N'-', N'Jacksonville', N'FL', '32219', N'USA', N'(904) 768-9981', N'(904) 768-9989', 30.432090759277344, -81.757728576660156) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'KCAA', N'Manheim Kansas City', N'yes', N'3901 Skiles Avenue', N'-', N'Kansas City', N'MO', '64161', N'USA', N'816-459-2454', N'(816) 459-2612', 39.166412353515625, -94.4857177734375) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'KEYA', N'Manheim Keystone PA', N'yes', N'488 Firehouse Road', N'PO Box 608', N'Grantville', N'PA', '17028', N'USA', N'(717) 469-7900', N'(717) 469-2842', 40.385042130947113, -76.650227308273315) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'LAA', N'Manheim Lakeland', N'yes', N'8025 State Road 33 North', N'Exit 20', N'Lakeland', N'FL', '33809', N'USA', N'(800) 967-2886', N'(863) 984-3029', 28.144853, -81.890625) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'LATL', N'Manheim Metro Atlanta', N'yes', N'2244 Metropolitan Parkway', N'-', N'Atlanta', N'GA', '30315', N'USA', N'(404) 464-4567', N'(404) 464-4568', 33.692138671875, -84.405921936035156) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'LHST', N'Manheim South Houston', N'yes', N'9605 Galveston Road', N'-', N'Houston', N'TX', '77034', N'USA', N'(713) 948-0001', N'(713) 948-0300', 29.626176834106445, -95.198051452636719) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'LMAA', N'Manheim Ft. Lauderdale', N'yes', N'5353 South State Road 7', N'RE: 200182', N'Davie', N'FL', '33314', N'USA', N'(954) 791-3520', N'(954) 453-8435', 26.0656795501709, -80.234733581542969) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'LOUA', N'Manheim Louisville', N'yes', N'5425 Highway 31 East', N'-', N'Clarksville', N'IN', '47129', N'USA', N'(800) 489-2886', N'(812) 283-1731', 38.341991, -85.750793) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'LPHX', N'Manheim Arizona', N'yes', N'3420 South 48th Street', N'-', N'Phoenix', N'AZ', '85040', N'USA', N'602-794-2575', N'602-794-2585', 33.415821075439453, -111.98167419433594) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'MAA', N'Manheim PA', N'yes', N'1190 Lancaster Road', N'-', N'Manheim', N'PA', '17545', N'USA', N'(717) 665-3571', N'(717) 665-9265', 40.139694213867188, -76.396820068359375) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'MAAI', N'Manheim Minneapolis', N'yes', N'8001 Jefferson Highway', N'PO Box 408', N'Maple Grove', N'MN', '55369', N'USA', N'(763) 425-7653', N'(763) 493-0307', 45.099945, -93.405792) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'MISS', N'Manheim Mississippi', N'yes', N'7510 U.S. Hwy 49', N'-', N'Hattiesburg', N'MS', NULL, N'USA', N'(601) 268-7550', N'(601) 579-7202', 31.40849494934082, -89.389419555664062) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'MLRA', N'Manheim Little Rock', N'yes', N'5809 S. University Avenue', N'-', N'Little Rock', N'AR', '72209', N'USA', N'314-739-1300', N'-', 34.697349548339844, -92.344497680664062) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'MMAA', N'Manheim Milwaukee', N'yes', N'561 27th Street', N'-', N'Caledonia', N'WI', '53108', N'USA', N'(800) 662-2947', N'(262) 824-2552', 42.834582924842834, -87.953261956572533) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'MONC', N'Manheim Moncton', N'yes', N'43 Somers Dr.', N'-', N'Moncton', N'NB', NULL, N'Canada', N'506-389-3890', N'-', 46.12872, -64.76421) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'MTRL', N'Manheim Montreal', N'yes', N'715 Rue Dubois', N'-', N'Saint Eustache', N'QC', NULL, N'Canada', N'450-974-4600; 866-668-5610', N'450-974-4601', 45.5928867, -73.8691547) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'NAA', N'Manheim New York', N'yes', N'2000 Dealer Drive', N'PO Box 10900', N'Newburgh', N'NY', NULL, N'USA', N'845-567-8400', N'845-567-8410', 41.511132717132568, -74.095185175538063) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'NADE', N'Manheim New Jersey', N'yes', N'730 Route 68', N'PO Box 188', N'Bordentown', N'NJ',' 8505', N'USA', N'(609) 298-3400', N'(609) 291-7918', 40.10759, -74.69391) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'NASH', N'Manheim Nashville', N'yes', N'8400 Eastgate Blvd.', N'-', N'Mt. Juliet', N'TN', '37122', N'USA', N'(615) 773-3800', N'(615) 773-4856', 36.184944, -86.445945) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'NOAA', N'Manheim New Orleans', N'yes', N'61077 Saint Tammany Ave.', N'-', N'Slidell', N'LA', NULL, N'USA', N'(985) 643-2061', N'(985) 6051245', 30.31743161380291, -89.779652506113052) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'NSAA', N'Manheim Northstar Minnesota', N'yes', N'4908 Valley Ind. Blvd. N', N'-', N'Shakopee', N'MN', '55379', N'USA', N'(952)-445-5544', N'952-445-6188', 44.753520965576172, -93.51812744140625) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'NVAA', N'Manheim Nevada', N'yes', N'6600 Auction Lane', N'-', N'North Las Vegas', N'NV', '89165', N'USA', N'(702) 730-1400', N'(702) 730-1541', 36.289543, -115.016311) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'NWE', N'Manheim Albany', N'yes', N'459 Route 146', N'P.O. Box 440', N'Clifton Park', N'NY', NULL, N'USA', N'(518) 371-7500', N'(518) 373-0392', 42.864795, -73.759559) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'OAA', N'Manheim Ohio', N'yes', N'3905 Jackson Pike', N'-', N'Grove City', N'OH', NULL, N'USA', N'(614) 801-6909', N'(614) 871-6894', 39.8809926956892, -83.027727082371712) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'OMAA', N'Manheim Omaha', N'yes', N'9201 S. 144th St.', N'-', N'Omaha', N'NE', '68138', N'USA', N'402-896-8000', N'(402) 896-0475', 41.167610168457031, -96.1346206665039) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'PAA', N'Manheim Portland', N'yes', N'3000 North Hayden Island Drive', N'-', N'Portland', N'OR', NULL, N'USA', N'(503) 286-3000', N'(503) 286-5226', 45.6178092956543, -122.6962890625) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'PCAA', N'Manheim Pensacola', N'yes', N'6359 North W Street', N'-', N'Pensacola', N'FL', '32505', N'USA', N'(888) 477-3063', N'(850) 479-4762', 30.4780216217041, -87.259140014648438) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'PRAA', N'Manheim Caribbean', N'yes', N'Carrettera #865 - KM 4.7', N'Barrio Candelaria', N'Toa Baja', N'PR', 949, N'-', N'(787) 261-7300', N'(787) 261-7260', NULL, NULL) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'PTAF', N'Manheim Flint', N'yes', N'4109 Holiday Drive', N'-', N'Flint', N'MI', '48507', N'USA', N'(810) 341-5206', N'(810) 341-5206', 42.97094039618969, -83.719590157270432) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'PXAA', N'Manheim Phoenix', N'yes', N'201 North 83rd Avenue', N'-', N'Tolleson', N'AZ', '85353', N'USA', N'(800) 449-4749', N'(623) 907-7097', 33.450245037674904, -112.2382814437151) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'RAA', N'Manheim Riverside', N'yes', N'6446 Fremont St.', N'', N'Riverside', N'CA', NULL, N'USA', N'(951) 689-6000', N'-', 33.955402374267578, -117.438232421875) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'RSAA', N'Manheim Digital Marketplace', N'yes', N'6325 Peachtree Dunwoody Road, NE', N'-', N'Atlanta', N'GA', '30328', N'USA', N'678-645-6716', N'-', 32.648323059082031, -83.444534301757812) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'SAAA', N'Manheim San Antonio', N'yes', N'2042 Ackerman Road', N'-', N'San Antonio', N'TX', '78219', N'USA', N'(800) 874-2897', N'(210) 662-3196', 29.449121475219727, -98.378692626953125) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'SAPL', N'Manheim Lafayette', N'yes', N'1611 St. Mary Street', N'-', N'Scott', N'LA', '70583', N'USA', N'(337) 237-5620', N'(337) 237-0762', 30.24073600769043, -92.101493835449219) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'SAPT', N'Manheim Tulsa', N'yes', N'9101 Frankoma Rd.', N'-', N'Sapulpa', N'OK', '74066', N'USA', N'918-227-3542', N'918-227-3644', 36.03106689453125, -96.096687316894531) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'SCAA', N'Manheim Southern Cal', N'yes', N'10700 Beech Avenue', N'-', N'Fontana', N'CA', NULL, N'USA', N'(909) 829-7467', N'-', 34.057846069335938, -117.47371673583984) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'SDAA', N'Manheim San Diego', N'yes', N'4691 Calle Joven', N'-', N'Oceanside', N'CA', '92057', N'USA', N'(760)754-3600', N'(760)754-3690', 33.242889, -117.309089) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'SKYA', N'Manheim NY Metro Skyline', N'yes', N'100 U.S. Highway 46', NULL, N'Fairfield', N'NJ',' 7004', N'USA', N'(973) 227-0100 ext. 245', N'973-227-3047', 40.86689, -74.30435) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'SLAA', N'Manheim St. Louis', N'yes', N'13813 St. Charles Rock Road', N'-', N'Bridgeton', N'MO', NULL, N'USA', N'(314) 298-3365', N'(314) 298-3365', 38.781665802001953, -90.452720642089844) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'SMRT', N'SmartAuction', N'yes', N'-', N'-', N'-', N'MI', NULL, N'-', N'877-273-5572', N'-', 44.862617492675781, -85.735137939453125) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'SONB', N'Manheim Birmingham', N'yes', N'5750 Highway 78 East', N'-', N'Birmingham', N'AL', '35210', N'USA', N'(205) 956-4700', N'(205) 956-8688', 33.552406311035156, -86.628250122070312) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'SPAA', N'Manheim St. Pete', N'yes', N'14950 Roosevelt Blvd', N'-', N'Clearwater', N'FL', NULL, N'USA', N'(727)531-7717', N'(727)524-1937', 27.906791687011719, -82.6987075805664) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'SSAA', N'Manheim Seattle', N'yes', N'19711 77th Avenue South', N'-', N'Kent', N'WA', '98032', N'USA', N'206-762-1600', N'253-395-2275', 47.424569427967072, -122.23890446126461) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'SVAA', N'Manheim Statesville', N'yes', N'145 Auction Lane', N'-', N'Statesville', N'NC', '28625', N'USA', N'(704) 876-1111', N'(704) 978-2539', 35.842212677001953, -80.857872009277344) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'SWAA', N'ADESA Phoenix', N'yes', N'400 N. Beck Avenue', N'-', N'Chandler', N'AZ', NULL, N'USA', N'(480) 961-1161', N'(480) 940-9008', 33.309661865234375, -111.95646667480469) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'SWFL', N'Manheim Ft. Myers', N'yes', N'2100 Rockfill Road', N'-', N'Ft. Myers', N'FL', '33916', N'USA', N'239-476-9846', N'239-476-9809', 26.64006233215332, -81.830741882324219) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'TAA', N'Manheim Toronto', N'yes', N'8277 Lawson Road', N'-', N'Milton', N'ON', NULL, N'Canada', N'(905) 275-3000', N'(905) 875-2910', 43.5419555, -79.8828761) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'TALA', N'Tallahassee Auto Auction', N'yes', N'5249 Capital Circle SW', N'-', N'Tallahassee', N'FL', '32305', N'USA', N'(850) 878-6200', N'(850) 942-9830', 30.376922607421875, -84.282821655273438) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'TBAA', N'Manheim Tampa', N'yes', N'401 South 50th Street', N'-', N'Tampa', N'FL', NULL, N'USA', N'(800) 622-7292', N'(813) 247-1714', 27.948028564453125, -82.406875610351562) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'TCAA', N'Manheim Tucson', N'yes', N'7090 South Craycroft', N'-', N'Tucson', N'AZ', '85706', N'USA', N'(520) 574 2222', N'(520) 574-2554', 32.143989562988281, -110.87503051757813) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'THAA', N'Manheim Texas Hobby', N'yes', N'8215 kopman dr', N'-', N'Houston', N'TX', NULL, N'USA', N'(713) 649-8233', N'(713) 640-8382', 29.636899948120117, -95.303863525390625) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'UAA', N'Manheim Utah', N'yes', N'1650 West 500 South', N'-', N'West Bountiful', N'UT', NULL, N'USA', N'(801) 298-7900', N'(801) 951-4111', 40.885097, -111.926437) +INSERT [Auctions] ([AuctionID], [Name], [Active], [Address_Line_1], [Address_Line_2], [City], [State], [ZIP], [Country], [Phone], [Fax], [Latitude], [Longitude]) VALUES (N'WPBA', N'Manheim Palm Beach', N'yes', N'600 SANSBURY WAY', N'-', N'WEST PALM BEACH', N'FL', '33411', N'USA', N'561-333-3511', N'(561) 753-1893', 26.687171936035156, -80.182647705078125) +*/ diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/CoreConversionUpdates.sql b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/CoreConversionUpdates.sql new file mode 100644 index 0000000..b22df67 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/CoreConversionUpdates.sql @@ -0,0 +1,17 @@ +/* + * LoanNo Must Become A BIGINT To Match DNA/Temenos + */ + +USE REPODB; +BEGIN TRANSACTION; +-- ROLLBACK TRANSACTION; +-- COMMIT TRANSACTION; + +ALTER TABLE Repos ALTER COLUMN LoanNo BIGINT WITH(ONLINE=ON); +-- ALTER TABLE Repos ALTER COLUMN LoanNo BIGINT NOT NULL; +-- ^ Backup in case 'ONLINE is not allowed because MSFT paywalled ONLINE to enterprise, but it doesn't always work on enterprise because of it..' + +UPDATE Repos SET AccountNo = REPLACE(AccountNo, '-', ''); +UPDATE Repos SET LoanNo = AccountNo; +UPDATE EventAlert SET AccountNo = REPLACE(AccountNo, '-', ''); +UPDATE ProcessingReceipt SET AccountNo = REPLACE(AccountNo, '-', ''); \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/LetterUpdate.sql b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/LetterUpdate.sql new file mode 100644 index 0000000..88d6d52 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/LetterUpdate.sql @@ -0,0 +1,12 @@ +/* + * The letterdescription must match the letters in Temenos. If the business changes the letters + * you'll need to update and deploy this to match so that the alerts continue to function. + */ +update letters set LetterDescription = 'None' +update letters set LetterDescription = 'Right to Reinstate/Redeem' where ActionCode = '701' +update letters set LetterDescription = 'Surrender (Illinois)' where ActionCode = 'ILLSU' +update letters set LetterDescription = 'Notice of Repossession' where ActionCode = 'LTR34' +update letters set LetterDescription = 'Notice of Plan to Sell - WI' where ActionCode = 'LTR35' +update letters set LetterDescription = 'WI Unsecured RTC' where ActionCode = 'RTC 1' +update letters set LetterDescription = 'WI Auto RTC' where ActionCode = 'RTC 3' +update letters set LetterDescription = 'Surrender (Wisconsin)' where ActionCode = 'VOL' \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/AccountTypeCodes.sql b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/AccountTypeCodes.sql new file mode 100644 index 0000000..bcebe84 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/AccountTypeCodes.sql @@ -0,0 +1,10 @@ +CREATE TABLE [dbo].[AccountTypeCodes] ( + [ID] INT IDENTITY (1, 1) NOT NULL, + [AccountTypeCode] NVARCHAR (50) NOT NULL, + [Description] NVARCHAR (100) NOT NULL, + [IsVisible] BIT NOT NULL, + [CategoryId] INT NULL, + CONSTRAINT [PK_AccountTypeCodes] PRIMARY KEY CLUSTERED ([ID] ASC), + CONSTRAINT [FK_AccountTypeCodes_LoanCategories] FOREIGN KEY ([CategoryId]) REFERENCES [dbo].[LoanCategories] ([ID]) +); + diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/AllowedStatusChanges.sql b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/AllowedStatusChanges.sql new file mode 100644 index 0000000..c509ef8 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/AllowedStatusChanges.sql @@ -0,0 +1,7 @@ +CREATE TABLE [dbo].[AllowedStatusChanges] ( + [ID] INT IDENTITY (1, 1) NOT NULL, + [CurrentStatus] NVARCHAR (100) NOT NULL, + [AllowedChangeStatus] NVARCHAR (100) NOT NULL, + CONSTRAINT [PK_AllowedStatusChanges] PRIMARY KEY CLUSTERED ([ID] ASC) +); + diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/AuctionAssignmentNotes.sql b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/AuctionAssignmentNotes.sql new file mode 100644 index 0000000..ee06ee7 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/AuctionAssignmentNotes.sql @@ -0,0 +1,14 @@ +CREATE TABLE [dbo].[AuctionAssignmentNotes] ( + [Id] INT IDENTITY (1, 1) NOT NULL, + [AuctionAssignmentId] INT NOT NULL, + [AuctionCustomerNo] NVARCHAR (100) NOT NULL, + [Origin] NVARCHAR (100) NOT NULL, + [Writer] NVARCHAR (100) NULL, + [Type] NVARCHAR (100) NULL, + [Text] NVARCHAR (1024) NULL, + [DateWritten] DATETIME NULL, + CONSTRAINT [PK_AuctionAssignmentNotes] PRIMARY KEY CLUSTERED ([Id] ASC) +); + + + diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/AuctionAssignments.sql b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/AuctionAssignments.sql new file mode 100644 index 0000000..2002e7b --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/AuctionAssignments.sql @@ -0,0 +1,42 @@ +CREATE TABLE [dbo].[AuctionAssignments] ( + [ID] INT IDENTITY (1, 1) NOT NULL, + [AuctionId] NVARCHAR (50) NOT NULL, + [AuctionNotes] NVARCHAR (1024) NULL, + [AvailablePickupDate] DATETIME NULL, + [LegalSaleDate] DATETIME NULL, + [CleaningLevel] INT NULL, + [SubmissionResponseCode] INT NULL, + [DateSubmitted] DATETIME NULL, + [SubmissionResponseDescription] NVARCHAR (255) NULL, + [SubmissionErrors] NVARCHAR (1024) NULL, + [AuctionCustomerNo] NVARCHAR (100) NULL, + [FloorPrice] DECIMAL (18, 2) NULL, + [SentTitleDocsDate] DATETIME NULL, + [FloorPriceResponseCode] INT NULL, + [FloorPriceResponseDescription] NVARCHAR (255) NULL, + [FloorPriceSubmissionErrors] NVARCHAR (1024) NULL, + [TitleSentResponseCode] INT NULL, + [TitleSentResponseDescription] NVARCHAR (255) NULL, + [TitleSentSubmissionErrors] NVARCHAR (1024) NULL, + [HoldStatus] INT NULL, + [HoldUntil] DATETIME NULL, + [RedeemedDate] DATETIME NULL, + [CollateralVIN] NVARCHAR (50) NULL, + [AddedThroughRepoDatabase] BIT NULL, + [VehicleType] INT NULL, + [BodyStyle] NVARCHAR (50) NULL, + [Inoperable] BIT NULL, + [RetailValue] DECIMAL (18, 2) NULL, + [RepoId] INT NULL, + [IsActive] BIT NOT NULL DEFAULT 1, + CONSTRAINT [PK_CollateralToAuction] PRIMARY KEY CLUSTERED ([ID] ASC) +); + + + + + + +GO + + diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/AuctionAssignmentsToCollaterals.sql b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/AuctionAssignmentsToCollaterals.sql new file mode 100644 index 0000000..88ecec8 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/AuctionAssignmentsToCollaterals.sql @@ -0,0 +1,6 @@ +CREATE TABLE [dbo].[AuctionAssignmentsToCollaterals] ( + [AuctionAssignmentId] INT NOT NULL, + [CollateralId] INT NOT NULL, + CONSTRAINT [PK_AuctionAssignmentsToCollaterals] PRIMARY KEY CLUSTERED ([AuctionAssignmentId] ASC, [CollateralId] ASC) +); + diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/Auctions.sql b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/Auctions.sql new file mode 100644 index 0000000..13b949d --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/Auctions.sql @@ -0,0 +1,19 @@ +CREATE TABLE [dbo].[Auctions] ( + [AuctionID] NVARCHAR (50) NOT NULL, + [Name] NVARCHAR (255) NULL, + [Active] NVARCHAR (255) NULL, + [Address_Line_1] NVARCHAR (255) NULL, + [Address_Line_2] NVARCHAR (255) NULL, + [City] NVARCHAR (255) NULL, + [State] NVARCHAR (255) NULL, + [ZIP] NVARCHAR (10) NULL, + [Country] NVARCHAR (255) NULL, + [Phone] NVARCHAR (255) NULL, + [Fax] NVARCHAR (255) NULL, + [Latitude] DECIMAL (16, 13) NULL, + [Longitude] DECIMAL (16, 13) NULL, + CONSTRAINT [PK_Auctions] PRIMARY KEY CLUSTERED ([AuctionID] ASC) +); + + + diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/AuditTable.sql b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/AuditTable.sql new file mode 100644 index 0000000..886a50c --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/AuditTable.sql @@ -0,0 +1,26 @@ +CREATE TABLE [dbo].[AuditTable] ( + [ID] INT IDENTITY (1, 1) NOT NULL, + [ClassName] NVARCHAR (100) NOT NULL, + [Action] NVARCHAR (50) NOT NULL, + [Description] NVARCHAR (100) NOT NULL, + [PerformedBy] NVARCHAR (100) NOT NULL, + [DatePerformed] DATETIME NOT NULL, + [KeyRepresentation] NVARCHAR (100) NOT NULL, + [PropertyValues] NVARCHAR (1024) NULL, + CONSTRAINT [PK_AuditTable] PRIMARY KEY CLUSTERED ([ID] ASC) +); + + + + +GO + + + +GO + + + +GO + + diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/BodyStyleCodes.sql b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/BodyStyleCodes.sql new file mode 100644 index 0000000..53d7ad2 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/BodyStyleCodes.sql @@ -0,0 +1,6 @@ +CREATE TABLE [dbo].[BodyStyleCodes] ( + [Code] NVARCHAR (50) NOT NULL, + [Description] NVARCHAR (100) NOT NULL, + CONSTRAINT [PK_BodyStyleCodes] PRIMARY KEY CLUSTERED ([Code] ASC) +); + diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/Borrowers.sql b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/Borrowers.sql new file mode 100644 index 0000000..4d70c1d --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/Borrowers.sql @@ -0,0 +1,8 @@ +CREATE TABLE [dbo].[Borrowers] ( + [RepoId] INT NOT NULL, + [IndividualId] NVARCHAR (50) NOT NULL, + [OwnershipType] INT NULL, + [IndividualName] NVARCHAR (100) NOT NULL, + PRIMARY KEY CLUSTERED ([RepoId] ASC, [IndividualId] ASC) +); + diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/CleaningLevelCodes.sql b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/CleaningLevelCodes.sql new file mode 100644 index 0000000..1b7d2b8 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/CleaningLevelCodes.sql @@ -0,0 +1,6 @@ +CREATE TABLE [dbo].[CleaningLevelCodes] ( + [Code] INT NOT NULL, + [Description] NVARCHAR (100) NOT NULL, + CONSTRAINT [PK_CleaningLevelCodes] PRIMARY KEY CLUSTERED ([Code] ASC) +); + diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/CollateralTypes.sql b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/CollateralTypes.sql new file mode 100644 index 0000000..6884dff --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/CollateralTypes.sql @@ -0,0 +1,7 @@ +CREATE TABLE [dbo].[CollateralTypes] ( + [ID] INT IDENTITY (1, 1) NOT NULL, + [Description] NVARCHAR (100) NOT NULL, + [LookupHandler] NVARCHAR (100) NOT NULL, + CONSTRAINT [PK_CollateralTypes] PRIMARY KEY CLUSTERED ([ID] ASC) +); + diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/CollateralTypesToVehicleTypes.sql b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/CollateralTypesToVehicleTypes.sql new file mode 100644 index 0000000..1e07258 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/CollateralTypesToVehicleTypes.sql @@ -0,0 +1,7 @@ +CREATE TABLE [dbo].[CollateralTypesToVehicleTypes] ( + [ID] INT IDENTITY (1, 1) NOT NULL, + [CollateralTypeId] INT NOT NULL, + [VehicleTypeId] INT NOT NULL, + CONSTRAINT [PK_CollateralTypesToVehicleTypes] PRIMARY KEY CLUSTERED ([ID] ASC) +); + diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/CollateralValuations.sql b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/CollateralValuations.sql new file mode 100644 index 0000000..9fb3569 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/CollateralValuations.sql @@ -0,0 +1,50 @@ +CREATE TABLE [dbo].[CollateralValuations] ( + [ID] INT IDENTITY (1, 1) NOT NULL, + [Year] INT NOT NULL, + [Make] NVARCHAR (100) NOT NULL, + [Model] NVARCHAR (100) NOT NULL, + [Uid] NVARCHAR (50) NULL, + [UcgVehicleId] NVARCHAR (50) NULL, + [LookupDate] DATETIME NULL, + [LowAdjustedAuctionValue] INT NULL, + [AverageAdjustedAuctionValue] INT NULL, + [HighAdjustedAuctionValue] INT NULL, + [AvgTradeIn] DECIMAL (18, 2) NULL, + [AvgTradeInPlusVinAcc] DECIMAL (18, 2) NULL, + [AvgTradeInPlusVinAccMileage] DECIMAL (18, 2) NULL, + [PercentOf] DECIMAL (5, 2) NULL, + [Condition] DECIMAL (5, 2) NULL, + [CalculatedFloorPrice] DECIMAL (18, 2) NULL, + [Mileage_Hours] NVARCHAR (100) NULL, + [CalculatedMMRValue] DECIMAL (18, 2) NULL, + [MakeCode] INT NULL, + [MakeDescription] VARCHAR (100) NULL, + [SeriesCode] INT NULL, + [SeriesDescription] VARCHAR (50) NULL, + [BodyCode] INT NULL, + [BodyDescription] VARCHAR (50) NULL, + [Weight] INT NULL, + [Msrp] DECIMAL (18, 2) NULL, + [AveMileage] INT NULL, + [MileageAdjustment] DECIMAL (18, 2) NULL, + [TradeIn] DECIMAL (18, 2) NULL, + [TradeInPlusVinAcc] DECIMAL (18, 2) NULL, + [TradeInPlusVinAccMileage] DECIMAL (18, 2) NULL, + [Loan] DECIMAL (18, 2) NULL, + [LoanPlusVinAcc] DECIMAL (18, 2) NULL, + [LoanPlusVinAccMileage] DECIMAL (18, 2) NULL, + [Retail] DECIMAL (18, 2) NULL, + [RetailPlusVinAcc] DECIMAL (18, 2) NULL, + [RetailPlusVinAccMileage] DECIMAL (18, 2) NULL, + [RoughTradeIn] DECIMAL (18, 2) NULL, + [RoughTradeInPlusVinAcc] DECIMAL (18, 2) NULL, + [RoughTradeInPlusVinAccMileage] DECIMAL (18, 2) NULL, + [LookupErrors] NVARCHAR (1024) NULL, + [ServiceTypeName] VARCHAR (100) NULL, + [AuctionInfoUnavailable] BIT NULL, + [DateRange] NCHAR(50) NULL, + CONSTRAINT [PK_CollateralValuations] PRIMARY KEY ([ID]) +); + + + diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/Collaterals.sql b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/Collaterals.sql new file mode 100644 index 0000000..6fdb08e --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/Collaterals.sql @@ -0,0 +1,26 @@ +CREATE TABLE [dbo].[Collaterals] ( + [CollateralId] INT IDENTITY (1, 1) NOT NULL, + [RepoId] INT NOT NULL, + [VIN] NVARCHAR (100) NULL, + [Make] NVARCHAR (100) NULL, + [Model] NVARCHAR (100) NULL, + [Year] INT NULL, + [Description] NVARCHAR (255) NULL, + [VehicleType] INT NULL, + [BodyStyle] NVARCHAR (50) NULL, + [Inoperable] BIT NULL, + [RetitledInLandmarkName] DATETIME NULL, + [RefCollateralId] NVARCHAR (25) NULL, + [CollateralTypeId] INT NULL, + CONSTRAINT [PK_dbo.Collaterals] PRIMARY KEY CLUSTERED ([CollateralId] ASC), + CONSTRAINT [FK_dbo.Collaterals_dbo.Repoes_RepoId] FOREIGN KEY ([RepoId]) REFERENCES [dbo].[Repos] ([RepoId]) ON DELETE CASCADE +); + + + + + + +GO + + diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/DefinedServiceFloorPricingParams.sql b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/DefinedServiceFloorPricingParams.sql new file mode 100644 index 0000000..948775b --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/DefinedServiceFloorPricingParams.sql @@ -0,0 +1,11 @@ +CREATE TABLE [dbo].[DefinedServiceFloorPricingParams] ( + [ID] INT IDENTITY (1, 1) NOT NULL, + [LowCondition] DECIMAL (18, 2) NOT NULL, + [HighCondition] DECIMAL (18, 2) NOT NULL, + [FirstValueRange] VARCHAR (50) NOT NULL, + [SecondValueRange] VARCHAR (50) NOT NULL, + [PercentageOf] DECIMAL (18, 2) NOT NULL, + [ServiceType] INT NOT NULL, + CONSTRAINT [PK_DefinedServiceFloorPricingParams] PRIMARY KEY CLUSTERED ([ID] ASC) +); + diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/EventAlert.sql b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/EventAlert.sql new file mode 100644 index 0000000..4b52e11 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/EventAlert.sql @@ -0,0 +1,15 @@ +CREATE TABLE [dbo].[EventAlert] ( + [ID] INT IDENTITY (1, 1) NOT NULL, + [RepoId] INT NULL, + [AccountNo] NVARCHAR (50) NULL, + [DateAdded] DATETIME NOT NULL, + [DateMarkedRead] DATETIME NULL, + [CreatedBy] NVARCHAR (25) NOT NULL, + [MarkedReadBy] NVARCHAR (25) NULL, + [DayCount] INT NULL, + [Message] NVARCHAR (150) NULL, + [SubMessage] NVARCHAR (500) NULL, + [EmailRecipient] NVARCHAR(150) NULL, + [EmailBody] NVARCHAR(500) NULL +); + diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/ExternalUser.sql b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/ExternalUser.sql new file mode 100644 index 0000000..6315247 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/ExternalUser.sql @@ -0,0 +1,10 @@ +CREATE TABLE [dbo].[UserCache] ( + [Id] INT IDENTITY (1, 1) NOT NULL, + [ReferenceId] INT NOT NULL UNIQUE, + [Name] NVARCHAR (100) NOT NULL, + [Code] NVARCHAR (100) NOT NULL, + CONSTRAINT [PK_UserCache] PRIMARY KEY CLUSTERED ([ID] ASC) +); + + + diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/FloorPriceValuesUsed.sql b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/FloorPriceValuesUsed.sql new file mode 100644 index 0000000..23bdb68 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/FloorPriceValuesUsed.sql @@ -0,0 +1,24 @@ +CREATE TABLE [dbo].[FloorPriceValuesUsed] ( + [AuctionAssignmentId] INT NOT NULL, + [CollateralValuationId] INT NOT NULL, + [RepoId] INT NULL, + [Condition] DECIMAL NULL, + [LowParam] DECIMAL(18, 1) NOT NULL, + [HighParam] DECIMAL(18, 1) NOT NULL, + [PercentageOf] DECIMAL(18, 2) NOT NULL, + [AuctionGuideBookPrice] DECIMAL(18, 2) NULL, + [WasAuctionGuideBookPriceUsed] BIT NULL, + [MMRNationalAdjustedPrice] DECIMAL(18, 2) NULL, + [MMRRegionalAdjustedPrice] DECIMAL(18, 2) NULL, + [WasMMRNationalAdjustedPriceUsed] BIT NULL, + [WasMMRRegionalAdjustedPriceUsed] BIT NULL, + [NADALowAdjustedAuctionValue] INT NOT NULL, + [NADAAverageAdjustedAuctionValue] INT NOT NULL, + [NADAHighAdjustedAuctionValue] INT NOT NULL, + [WasNADALowAdjustedAuctionValueUsed] BIT NOT NULL, + [WasNADAAverageAdjustedAuctionValueUsed] BIT NOT NULL, + [WasNADAHighAdjustedAuctionValueUsed] BIT NOT NULL, + [NADAMMRFloorPrice] DECIMAL(18, 2) NULL, + CONSTRAINT [PK_FloorPriceValuesUsed] PRIMARY KEY CLUSTERED ([AuctionAssignmentId], [CollateralValuationId]) +); + diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/HoldStatusCodes.sql b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/HoldStatusCodes.sql new file mode 100644 index 0000000..daeb278 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/HoldStatusCodes.sql @@ -0,0 +1,6 @@ +CREATE TABLE [dbo].[HoldStatusCodes] ( + [Code] INT NOT NULL, + [Description] NVARCHAR (50) NOT NULL, + CONSTRAINT [PK_HoldStatusCodes] PRIMARY KEY CLUSTERED ([Code] ASC) +); + diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/IMSAutoFileData.sql b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/IMSAutoFileData.sql new file mode 100644 index 0000000..5131fd8 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/IMSAutoFileData.sql @@ -0,0 +1,69 @@ +CREATE TABLE [dbo].[IMSAutoFileData] ( + [RepoId] INT NOT NULL, + [VIN] NVARCHAR (50) NOT NULL, + [AuctionAssignmentId] INT CONSTRAINT [DF_IMSAutoFileData_AuctionAssignmentID] DEFAULT ((0)) NULL, + [AnnouncedConditions] VARCHAR (1024) NULL, + [ArbitrationReason] VARCHAR (255) NULL, + [AsIs100KMiles] BIT NULL, + [AssignmentAccepted] DATETIME NULL, + [AuctionAge] INT NULL, + [AuctionGuideBookPrice] DECIMAL (18, 2) NULL, + [BuyerId] VARCHAR (100) NULL, + [BuyerName] VARCHAR (255) NULL, + [ChargeAmount] DECIMAL (18, 2) NULL, + [CheckAmount] DECIMAL (18, 2) NULL, + [ClientAge] INT NULL, + [ClientCancelled] DATETIME NULL, + [CollisionDamage] VARCHAR (255) NULL, + [AuctionCustomerNo] NVARCHAR (100) NOT NULL, + [InspectedDate] DATETIME NULL, + [DateofLoss] DATETIME NULL, + [DatePickedUp] DATETIME NULL, + [DateEnteredAutoIMS] DATETIME NULL, + [DaysRun] INT NULL, + [DaysRunHighestBidRecordedbyAuction] VARCHAR (255) NULL, + [DaystoDelivery] INT NULL, + [Description] VARCHAR (1024) NULL, + [IsDrivable] BIT NULL, + [FloorPriceAccepted] DECIMAL (18, 2) NULL, + [FundsSent] DATETIME NULL, + [GrossPercentFloor] DECIMAL (18, 2) NULL, + [HighestBid] DECIMAL (18, 2) NULL, + [StatedMileage] INT NULL, + [NetPercentFloor] DECIMAL (18, 2) NULL, + [OtherAdvanceFees] DECIMAL (18, 2) NULL, + [OTHERTotal] NVARCHAR (255) NULL, + [OTHERAdvancedOther] NVARCHAR (255) NULL, + [OTHERAdvancedStorage] NVARCHAR (255) NULL, + [OTHERAdvancedTow] NVARCHAR (255) NULL, + [OTHERMiscellaneous] NVARCHAR (255) NULL, + [SalePrice] DECIMAL (18, 2) NULL, + [ScheduledSaleDate] DATETIME NULL, + [SoldDate] DATETIME NULL, + [TitleNumber] VARCHAR (100) NULL, + [TitleReceived] DATETIME NULL, + [TitleReturned] DATETIME NULL, + [TitleState] NVARCHAR (50) NULL, + [TitleStatus] NVARCHAR (100) NULL, + [TitleStatusfromAuction] NVARCHAR (100) NULL, + [TotalCharges] DECIMAL (18, 2) NULL, + [ApprovedVehicleGrade] DECIMAL (5, 2) NULL, + [IsOperable] BIT NULL, + [ShipmentDate] DATETIME NULL, + [Status] NVARCHAR (100) NULL, + [StorageCost] DECIMAL (18, 2) NULL, + [StorageRatePerDay] DECIMAL (18, 2) NULL, + [TowCost] DECIMAL (18, 2) NULL, + [DateReceivedFromAutoIMS] DATETIME NULL, + [VehicleDecimalGradeCode] DECIMAL (18, 2) NULL, + [VehicleGrade] DECIMAL (18, 2) NULL, + [MMR] NVARCHAR (100) NULL, + [ConditionReportLink] NVARCHAR (255) NULL, + [CollateralImagePath] NVARCHAR (255) NULL, + [MMRNationalAdjustedPrice] DECIMAL (18, 2) NULL, + [MMRRegionalAdjustedPrice] DECIMAL (18, 2) NULL, + CONSTRAINT [PK_IMSAutoFileData_1] PRIMARY KEY CLUSTERED ([VIN] ASC, [RepoId] ASC) +); + + + diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/Letters.sql b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/Letters.sql new file mode 100644 index 0000000..ff0f2e3 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/Letters.sql @@ -0,0 +1,10 @@ +CREATE TABLE [dbo].[Letters] ( + [ActionCode] NVARCHAR (50) NOT NULL, + [LetterCode] NVARCHAR (10) NULL, + [Description] NVARCHAR (100) NOT NULL, + [DaysToWait] INT NULL, + [WhenLetterIsSent] NVARCHAR (50) NULL, + [LetterDescription] NVARCHAR (50) NULL, + CONSTRAINT [PK_Letters] PRIMARY KEY CLUSTERED ([ActionCode] ASC) +); + diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/LoanCategories.sql b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/LoanCategories.sql new file mode 100644 index 0000000..1f5b7d5 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/LoanCategories.sql @@ -0,0 +1,6 @@ +CREATE TABLE [dbo].[LoanCategories] ( + [ID] INT IDENTITY (1, 1) NOT NULL, + [CategoryName] NVARCHAR (50) NOT NULL, + CONSTRAINT [PK_LoanCategories] PRIMARY KEY CLUSTERED ([ID] ASC) +); + diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/LocationTypeCodes.sql b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/LocationTypeCodes.sql new file mode 100644 index 0000000..9f97d1f --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/LocationTypeCodes.sql @@ -0,0 +1,6 @@ +CREATE TABLE [dbo].[LocationTypeCodes] ( + [Code] INT NOT NULL, + [Description] NVARCHAR (100) NOT NULL, + CONSTRAINT [PK_LocationTypeCodes] PRIMARY KEY CLUSTERED ([Code] ASC) +); + diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/ProcessingReceipt.sql b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/ProcessingReceipt.sql new file mode 100644 index 0000000..4d037b8 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/ProcessingReceipt.sql @@ -0,0 +1,12 @@ +/* columns are wide to accomodate bad data such as a CC number as a accountNo */ +CREATE TABLE [dbo].[ProcessingReceipt] ( + [AccountNo] NVARCHAR (20) NOT NULL, + [AccountId] NVARCHAR (20) NOT NULL DEFAULT '', + [CaseId] NVARCHAR (20) NOT NULL DEFAULT '', + [QueuedBy] NVARCHAR (40) NOT NULL, + [Outcome] NVARCHAR (25) NOT NULL, + [Message] NVARCHAR (125) NOT NULL, + [Processed] DATETIME NOT NULL, + CONSTRAINT [PK_PROCESSINGRECEIPT] PRIMARY KEY CLUSTERED ([AccountNo],[AccountId],[CaseId] ASC) +); + diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/RefundStatuses.sql b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/RefundStatuses.sql new file mode 100644 index 0000000..a4f9b23 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/RefundStatuses.sql @@ -0,0 +1,10 @@ +CREATE TABLE [dbo].[RefundStatuses] ( + [RepoId] INT NOT NULL, + [WarrantyRefundStatus] NVARCHAR (50) NULL, + [InsuranceRefundStatus] NVARCHAR (50) NULL, + [PremiumDefiRefundStatus] NVARCHAR (50) NULL, + [CPIRefundStatus] NVARCHAR (50) NULL, + [RefundsReceivedDate] DATETIME NULL, + CONSTRAINT [PK_RefundStatuses] PRIMARY KEY CLUSTERED ([RepoId] ASC) +); + diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/RepoCompany.sql b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/RepoCompany.sql new file mode 100644 index 0000000..5f92548 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/RepoCompany.sql @@ -0,0 +1,20 @@ +CREATE TABLE [dbo].[RepoCompany] ( + [ID] INT IDENTITY (1, 1) NOT NULL, + [Name] NVARCHAR (100) NOT NULL, + [Email] NVARCHAR (255) NULL, + [Address_Line_1] NVARCHAR (255) NULL, + [Address_Line_2] NVARCHAR (255) NULL, + [City] NVARCHAR (255) NULL, + [State] NVARCHAR (255) NULL, + [ZIP] NVARCHAR (10) NULL, + [Country] NVARCHAR (255) NULL, + [Phone] NVARCHAR (255) NULL, + [Fax] NVARCHAR (255) NULL, + [DisabledDate] DATETIME NULL, + [DisabledBy] NVARCHAR (255) NULL, + [ReferenceId] INT NULL, + CONSTRAINT [PK_RepoCompany] PRIMARY KEY CLUSTERED ([ID] ASC) +); + + + diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/RepoCompanySelections.sql b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/RepoCompanySelections.sql new file mode 100644 index 0000000..3bac99e --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/RepoCompanySelections.sql @@ -0,0 +1,13 @@ +CREATE TABLE [dbo].[RepoCompanySelections] ( + [Id] INT IDENTITY (1, 1) NOT NULL, + [CollateralId] INT NULL, + [RepoType] NVARCHAR (25) NULL, + [RepoCompanyId] INT NULL, + [RepoCompanyAssignmentDate] DATETIME NULL, + [DateRepoed] DATETIME NULL, + [DateTimeCreated] DATETIME DEFAULT (getdate()) NULL, + CONSTRAINT [PK_RepoCompanySelections] PRIMARY KEY CLUSTERED ([Id] ASC) +); + + + diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/RepoManualStatus.sql b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/RepoManualStatus.sql new file mode 100644 index 0000000..2a5bee2 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/RepoManualStatus.sql @@ -0,0 +1,8 @@ +CREATE TABLE [dbo].[RepoManualStatus] ( + [ID] INT IDENTITY (1, 1) NOT NULL, + [Description] NVARCHAR (50) NOT NULL, + [IsActiveStatus] BIT NULL, + [WatchForStatusChanges] BIT NULL, + CONSTRAINT [PK_RepoManualStatus] PRIMARY KEY CLUSTERED ([ID] ASC) +); + diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/RepoStatusChanges.sql b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/RepoStatusChanges.sql new file mode 100644 index 0000000..8b68822 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/RepoStatusChanges.sql @@ -0,0 +1,10 @@ +CREATE TABLE [dbo].[RepoStatusChanges] ( + [Id] INT IDENTITY (1, 1) NOT NULL, + [RepoId] INT NOT NULL, + [StatusFrom] VARCHAR (20) NOT NULL, + [StatusTo] VARCHAR (20) NOT NULL, + [ChangedBy] VARCHAR (50) NOT NULL, + [ChangedDate] DATETIME NOT NULL, + CONSTRAINT [PK_RepoStatusChanges] PRIMARY KEY CLUSTERED ([Id] ASC) +); + diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/Repos.sql b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/Repos.sql new file mode 100644 index 0000000..75a2a4b --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/Repos.sql @@ -0,0 +1,44 @@ +CREATE TABLE [dbo].[Repos] ( + [RepoId] INT IDENTITY (1, 1) NOT NULL, + [AccountNo] NVARCHAR (100) NOT NULL, + [MemberNo] BIGINT NOT NULL, + [LoanNo] BIGINT NOT NULL, + [AccountTypeCode] NVARCHAR (50) NULL, + [Branch] INT NULL, + [Collector] NVARCHAR (50) NULL, + [Status] NVARCHAR (50) NULL, + [Balance] DECIMAL (18, 2) NULL, + [DueToPayDate] DATETIME NULL, + [O4RDate] DATETIME NULL, + [DateFirstDelinquent] DATETIME NULL, + [DelinquentAmount] DECIMAL (18, 2) NULL, + [DaysDelinquent] INT NULL, + [PaidSkipAmount] DECIMAL (18, 2) NULL, + [SubStatus] NVARCHAR (50) NULL, + [RequiredPaymentAmount] DECIMAL (18, 2) NULL, + [CurrentDelinquentAmount] DECIMAL (18, 2) NULL, + [LstPmtAmt] DECIMAL (18, 2) NULL, + [OrigAmount] DECIMAL (18, 2) NULL, + [LastPaymentDate] DATETIME NULL, + [DateFirstIntellect] DATETIME NULL, + [PrimaryIndividualId] NVARCHAR (100) NULL, + [Bankruptcy] NVARCHAR (50) NULL, + [ManualRedemptionDate] DATETIME NULL, + [RedemptionExpiredDate] DATETIME NULL, + [DateClosed] DATETIME NULL, + [WrittenOffDate] DATETIME NULL, + [ReferenceStatus] NVARCHAR (50) NULL, + [ReferenceId] INT NULL, + [ReferenceCaseId] INT NULL, + [AccountLastProcessed] DATETIME NULL, + [OrigAccountTypeCode] NVARCHAR(50) NULL, + [SixtyPlusCollectorId] INT NULL, + CONSTRAINT [PK_dbo.Repoes] PRIMARY KEY CLUSTERED ([RepoId] ASC), + CONSTRAINT [FK_dbo.Repos_dbo.SixtyPlusCollector_SixtyPlusCollectorId] FOREIGN KEY ([SixtyPLusCollectorId]) REFERENCES [SixtyPlusCollector]([SixtyPLusCollectorId]) +); + + +GO +CREATE NONCLUSTERED INDEX [NonClusteredIndex-20170405-122422] + ON [dbo].[Repos]([AccountNo] ASC); + diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/SavedLocations.sql b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/SavedLocations.sql new file mode 100644 index 0000000..dee0977 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/SavedLocations.sql @@ -0,0 +1,15 @@ +CREATE TABLE [dbo].[SavedLocations] ( + [ID] INT IDENTITY (1, 1) NOT NULL, + [Name] NVARCHAR (255) NULL, + [LocationType] INT NULL, + [Address_Line_1] NVARCHAR (255) NULL, + [Address_Line_2] NVARCHAR (255) NULL, + [City] NVARCHAR (255) NULL, + [State] NVARCHAR (255) NULL, + [ZIP] NVARCHAR (10) NULL, + [Country] NVARCHAR (255) NULL, + [Phone] NVARCHAR (255) NULL, + [Fax] NVARCHAR (255) NULL, + CONSTRAINT [PK_SavedLocations] PRIMARY KEY CLUSTERED ([ID] ASC) +); + diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/SixtyPlusCollector.sql b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/SixtyPlusCollector.sql new file mode 100644 index 0000000..d207278 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/SixtyPlusCollector.sql @@ -0,0 +1,5 @@ +CREATE TABLE [dbo].[SixtyPlusCollector] ( + [SixtyPlusCollectorId] INT IDENTITY NOT NULL, + [SixtyPlusCollectorName] NVARCHAR(50) NOT NULL + PRIMARY KEY (SixtyPlusCollectorId) + ); \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/VehicleFloorPricingParameters.sql b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/VehicleFloorPricingParameters.sql new file mode 100644 index 0000000..a309579 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/VehicleFloorPricingParameters.sql @@ -0,0 +1,12 @@ +CREATE TABLE [dbo].[VehicleFloorPricingParameters] ( + [ID] INT IDENTITY (1, 1) NOT NULL, + [LowCondition] DECIMAL (18, 1) NOT NULL, + [HighCondition] DECIMAL (18, 1) NOT NULL, + [NADAFirstValue] NVARCHAR (50) NOT NULL, + [NADASecondValue] NVARCHAR (50) NOT NULL, + [PercentageOf] DECIMAL (18, 2) NOT NULL, + [ValuationServiceType] INT CONSTRAINT [DF_VehicleFloorPricingParameters_ValueationServiceType] DEFAULT ((0)) NOT NULL, + [MMRAdjustedValue] NVARCHAR (50) NULL, + CONSTRAINT [PK_VehiclePricingParameters] PRIMARY KEY CLUSTERED ([ID] ASC) +); + diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/VehicleTypeCodes.sql b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/VehicleTypeCodes.sql new file mode 100644 index 0000000..9db2141 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/VehicleTypeCodes.sql @@ -0,0 +1,6 @@ +CREATE TABLE [dbo].[VehicleTypeCodes] ( + [Code] NVARCHAR (100) NOT NULL, + [Description] NVARCHAR (100) NOT NULL, + CONSTRAINT [PK_VehicleTypeCodes] PRIMARY KEY CLUSTERED ([Code] ASC) +); + diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/VehiclesReturnedFromLookup.sql b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/VehiclesReturnedFromLookup.sql new file mode 100644 index 0000000..29e5491 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/Tables/VehiclesReturnedFromLookup.sql @@ -0,0 +1,55 @@ +CREATE TABLE [dbo].[VehiclesReturnedFromLookup] ( + [ID] INT IDENTITY (1, 1) NOT NULL, + [Year] INT NOT NULL, + [Make] NVARCHAR (100) NOT NULL, + [Model] NVARCHAR (100) NOT NULL, + [Options] NVARCHAR (100) NOT NULL, + [Uid] NVARCHAR (50) NULL, + [UcgVehicleId] NVARCHAR (50) NULL, + [CollateralId] INT NOT NULL, + [LookupDate] DATETIME NULL, + [NADA_Auction_Value_One] DECIMAL (18, 2) NULL, + [NADA_Auction_Value_Two] DECIMAL (18, 2) NULL, + [NADA_Auction_Value_Three] DECIMAL (18, 2) NULL, + [NADA_Trade_Prices_One] DECIMAL (18, 2) NULL, + [NADA_Trade_Prices_Two] DECIMAL (18, 2) NULL, + [NADA_Trade_Prices_three] DECIMAL (18, 2) NULL, + [MMR_First_Value_Type] NVARCHAR (50) NULL, + [Price_Type_Used] NVARCHAR (50) NULL, + [NADA_First_Value_Type] NVARCHAR (50) NULL, + [NADA_Second_Value_Type] NVARCHAR (50) NULL, + [PercentOf] DECIMAL (5, 2) NULL, + [Condition] DECIMAL (5, 2) NULL, + [CalculatedFloorPrice] DECIMAL (18, 2) NULL, + [Mileage_Hours] NVARCHAR (100) NULL, + [MMR_Second_Value_Type] NVARCHAR (50) NULL, + [CalculatedMMRValue] DECIMAL (18, 2) NULL, + [MakeCode] INT NULL, + [MakeDescription] VARCHAR (100) NULL, + [SeriesCode] INT NULL, + [SeriesDescription] VARCHAR (50) NULL, + [BodyCode] INT NULL, + [BodyDescription] VARCHAR (50) NULL, + [Weight] INT NULL, + [Msrp] DECIMAL (18, 2) NULL, + [AveMileage] INT NULL, + [MileageAdjustment] DECIMAL (18, 2) NULL, + [TradeIn] DECIMAL (18, 2) NULL, + [TradeInPlusVinAcc] DECIMAL (18, 2) NULL, + [TradeInPlusVinAccMileage] DECIMAL (18, 2) NULL, + [Loan] DECIMAL (18, 2) NULL, + [LoanPlusVinAcc] DECIMAL (18, 2) NULL, + [LoanPlusVinAccMileage] DECIMAL (18, 2) NULL, + [Retail] DECIMAL (18, 2) NULL, + [RetailPlusVinAcc] DECIMAL (18, 2) NULL, + [ReteailPlusVinAccMileage] DECIMAL (18, 2) NULL, + [RoughTradeIn] DECIMAL (18, 2) NULL, + [RoughTradeInVinAcc] DECIMAL (18, 2) NULL, + [RoughTradeInAccMileage] DECIMAL (18, 2) NULL, + [LookupErrors] NVARCHAR (1024) NULL, + [ServiceTypeName] VARCHAR (100) NULL, + CONSTRAINT [PK_VehiclesReturnedFromLookup] PRIMARY KEY CLUSTERED ([ID] ASC) +); + + + diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/UpdateRepoCompanies.sql b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/UpdateRepoCompanies.sql new file mode 100644 index 0000000..e2319b2 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiSql/dbo/UpdateRepoCompanies.sql @@ -0,0 +1,11 @@ +/* + * The referenceID must match the repo company id in Temenos. If the business changes the companies + * these need to be updated. They can actually be updated from the editor in the Repo Manager, this is just + * a go-live convenience. To quickly find the IDs, use swagger and retrieve the Temenos Configuration. + */ +update RepoCompany set ReferenceId = 2000397 where ID = 1 +update RepoCompany set ReferenceId = 2000069 where ID = 5 +update RepoCompany set ReferenceId = 2000067 where ID = 7 +update RepoCompany set ReferenceId = 2000396 where ID = 10 +update RepoCompany set ReferenceId = 2000068 where ID = 11 +update RepoCompany set ReferenceId = 2000398 where ID = 13 \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/AuctionOnHoldCheckerTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/AuctionOnHoldCheckerTest.cs new file mode 100644 index 0000000..14e05c4 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/AuctionOnHoldCheckerTest.cs @@ -0,0 +1,169 @@ +using System; +using System.Collections.Generic; +using LCU.API.Collections.RepoApi.Domain.AlertChecker; +using LCU.API.Collections.RepoApi.Domain.Processing; +using LCU.Shared.Collections.RepoApiLib.Models; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.AlertCheckers +{ + public class AuctionOnHoldCheckerTest + { + readonly AuctionOnHoldChecker _auctionOnHoldChecker; + + public AuctionOnHoldCheckerTest() + { + _auctionOnHoldChecker = new AuctionOnHoldChecker(); + } + + [Fact] + public void Auction_On_Hold_Created_Ok() + { + var updatedAccount = new RepoAccount() + { + Status = "REHO", + Collaterals = new List() + { + new Collateral() + { + AuctionAssignmentToCollaterals = new List() + { + new AuctionAssignmentToCollateral() + { + AuctionAssignmentId = 1, + CollateralId = 1 + } + } + } + } + }; + + var slip = new RepoAccountProcessingSlip() + { + AuctionAssignments = new List() + { + new AuctionAssignment() + { + HoldStatus = 1 + } + }, + ExistingRepoAccount = new RepoAccount(), + UpdatedRepoAccount = updatedAccount + }; + var result = _auctionOnHoldChecker.CheckForAlert(slip); + + Assert.NotNull(result); + Assert.Equal("Auction On Hold", result[0].Message); + } + + [Fact] + public void Auction_On_Hold_Not_Created_RepoRedeemed() + { + var updatedAccount = new RepoAccount() + { + Status = "REDEEMED", + Collaterals = new List() + { + new Collateral() + { + AuctionAssignmentToCollaterals = new List() + { + new AuctionAssignmentToCollateral() + { + AuctionAssignmentId = 1, + CollateralId = 1 + } + } + } + } + }; + + var slip = new RepoAccountProcessingSlip() + { + AuctionAssignments = new List() + { + new AuctionAssignment() + { + HoldStatus = 0 + } + }, + ExistingRepoAccount = new RepoAccount(), + UpdatedRepoAccount = updatedAccount + }; + var result = _auctionOnHoldChecker.CheckForAlert(slip); + + Assert.Null(result); + } + + [Fact] + public void Auction_On_Hold_Not_Created_Sold() + { + var updatedAccount = new RepoAccount() + { + Status = "SOLD", + Collaterals = new List() + { + new Collateral() + { + AuctionAssignmentToCollaterals = new List() + { + new AuctionAssignmentToCollateral() + { + AuctionAssignmentId = 1, + CollateralId = 1 + } + } + } + } + }; + + var slip = new RepoAccountProcessingSlip() + { + AuctionAssignments = new List() + { + new AuctionAssignment() + { + HoldStatus = 0 + } + }, + ExistingRepoAccount = new RepoAccount(), + UpdatedRepoAccount = updatedAccount + }; + var result = _auctionOnHoldChecker.CheckForAlert(slip); + + Assert.Null(result); + } + + [Fact] + public void Auction_On_Hold_Not_Created_No_AuctionAssignments() + { + var updatedAccount = new RepoAccount() + { + Status = "REHO", + Collaterals = new List() + { + new Collateral() + } + }; + + var slip = new RepoAccountProcessingSlip() + { + AuctionAssignments = new List() + { + new AuctionAssignment() + { + AutoIMS = new ImsAutoFileData() + { + FundsSent = DateTime.Now.AddDays(-2) + } + } + }, + ExistingRepoAccount = new RepoAccount(), + UpdatedRepoAccount = updatedAccount + }; + var result = _auctionOnHoldChecker.CheckForAlert(slip); + + Assert.Null(result); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/AuctionVinDifferentCheckerTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/AuctionVinDifferentCheckerTest.cs new file mode 100644 index 0000000..d46c665 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/AuctionVinDifferentCheckerTest.cs @@ -0,0 +1,295 @@ +using System.Collections.Generic; +using LCU.API.Collections.RepoApi.Domain.AlertChecker; +using LCU.API.Collections.RepoApi.Domain.Processing; +using LCU.Shared.Collections.RepoApiLib.Models; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.AlertCheckers +{ + public class AuctionVinDifferentCheckerTest + { + readonly AuctionVinDifferentChecker _auctionVinDifferentChecker; + + public AuctionVinDifferentCheckerTest() + { + _auctionVinDifferentChecker = new AuctionVinDifferentChecker(); + } + + [Fact] + public void Auction_Vin_Different_Single_Created_Ok() + { + var updatedAccount = new RepoAccount() + { + Collaterals = new List() + { + new Collateral() + { + AuctionAssignmentToCollaterals = new List() + { + new AuctionAssignmentToCollateral() + { + AuctionAssignmentId = 1, + CollateralId = 1 + } + }, + Vin = "OurVin" + } + } + }; + + var slip = new RepoAccountProcessingSlip() + { + AuctionAssignments = new List() + { + new AuctionAssignment() + { + AutoIMS = new ImsAutoFileData() + { + VIN = "TheirVin" + } + } + }, + ExistingRepoAccount = new RepoAccount(), + UpdatedRepoAccount = updatedAccount + }; + var result = _auctionVinDifferentChecker.CheckForAlert(slip); + + Assert.NotNull(result); + Assert.Equal("Auction VIN Different", result[0].Message); + Assert.Equal("Auction Assignment VIN: THEIRVIN differs from RepoManager VIN: OURVIN", result[0].SubMessage); + } + + [Fact] + public void Auction_Vin_Different_Multiple_Created_Ok() + { + var updatedAccount = new RepoAccount() + { + Collaterals = new List() + { + new Collateral() + { + AuctionAssignmentToCollaterals = new List() + { + new AuctionAssignmentToCollateral() + { + AuctionAssignmentId = 1, + CollateralId = 1 + } + }, + Vin = "OurFirstVin" + }, + new Collateral() + { + AuctionAssignmentToCollaterals = new List() + { + new AuctionAssignmentToCollateral() + { + AuctionAssignmentId = 1, + CollateralId = 1 + } + }, + Vin = "OurSecondVin" + }, + new Collateral() + { + AuctionAssignmentToCollaterals = new List() + { + new AuctionAssignmentToCollateral() + { + AuctionAssignmentId = 1, + CollateralId = 1 + } + }, + Vin = "OurThirdVin" + } + } + }; + + var slip = new RepoAccountProcessingSlip() + { + AuctionAssignments = new List() + { + new AuctionAssignment() + { + AutoIMS = new ImsAutoFileData() + { + VIN = "TheirVin" + } + } + }, + ExistingRepoAccount = new RepoAccount(), + UpdatedRepoAccount = updatedAccount + }; + var result = _auctionVinDifferentChecker.CheckForAlert(slip); + + Assert.NotNull(result); + Assert.Equal("Auction VIN Different", result[0].Message); + Assert.Equal( + "Auction Assignment VIN: THEIRVIN is not among RepoManager VINs: OURFIRSTVIN, OURSECONDVIN, OURTHIRDVIN", + result[0].SubMessage); + } + + [Fact] + public void Auction_Vin_Different_Not_Created_Single_Vins_Match() + { + var updatedAccount = new RepoAccount() + { + Collaterals = new List() + { + new Collateral() + { + AuctionAssignmentToCollaterals = new List() + { + new AuctionAssignmentToCollateral() + { + AuctionAssignmentId = 1, + CollateralId = 1 + } + }, + Vin = "OurVin" + } + } + }; + + var slip = new RepoAccountProcessingSlip() + { + AuctionAssignments = new List() + { + new AuctionAssignment() + { + AutoIMS = new ImsAutoFileData() + { + VIN = "OurVin" + } + } + }, + ExistingRepoAccount = new RepoAccount(), + UpdatedRepoAccount = updatedAccount + }; + var result = _auctionVinDifferentChecker.CheckForAlert(slip); + + Assert.Null(result); + } + + [Fact] + public void Auction_Vin_Different_Not_Created_Multiple_Vins_Match() + { + var updatedAccount = new RepoAccount() + { + Collaterals = new List() + { + new Collateral() + { + AuctionAssignmentToCollaterals = new List() + { + new AuctionAssignmentToCollateral() + { + AuctionAssignmentId = 1, + CollateralId = 1 + } + }, + Vin = "OurFirstVin" + }, + new Collateral() + { + AuctionAssignmentToCollaterals = new List() + { + new AuctionAssignmentToCollateral() + { + AuctionAssignmentId = 1, + CollateralId = 1 + } + }, + Vin = "OurSecondVin" + } + } + }; + + var slip = new RepoAccountProcessingSlip() + { + AuctionAssignments = new List() + { + new AuctionAssignment() + { + AutoIMS = new ImsAutoFileData() + { + VIN = "OurSecondVin" + } + } + }, + ExistingRepoAccount = new RepoAccount(), + UpdatedRepoAccount = updatedAccount + }; + var result = _auctionVinDifferentChecker.CheckForAlert(slip); + + Assert.Null(result); + } + + [Fact] + public void Auction_Vin_Different_Not_Created_Vin_Null() + { + var updatedAccount = new RepoAccount() + { + Collaterals = new List() + { + new Collateral() + { + AuctionAssignmentToCollaterals = new List() + { + new AuctionAssignmentToCollateral() + { + AuctionAssignmentId = 1, + CollateralId = 1 + } + }, + Vin = "OurVin" + } + } + }; + + var slip = new RepoAccountProcessingSlip() + { + AuctionAssignments = new List() + { + new AuctionAssignment() + { + AutoIMS = new ImsAutoFileData() + } + }, + ExistingRepoAccount = new RepoAccount(), + UpdatedRepoAccount = updatedAccount + }; + var result = _auctionVinDifferentChecker.CheckForAlert(slip); + + Assert.Null(result); + } + + [Fact] + public void Auction_Vin_Different_Not_Created_No_AuctionAssignments() + { + var updatedAccount = new RepoAccount() + { + Collaterals = new List() + { + new Collateral() + } + }; + + var slip = new RepoAccountProcessingSlip() + { + AuctionAssignments = new List() + { + new AuctionAssignment() + { + AutoIMS = new ImsAutoFileData() + } + }, + ExistingRepoAccount = new RepoAccount(), + UpdatedRepoAccount = updatedAccount + }; + var result = _auctionVinDifferentChecker.CheckForAlert(slip); + + Assert.Null(result); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/CreditAdjustmentCheckerTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/CreditAdjustmentCheckerTest.cs new file mode 100644 index 0000000..f45e4e6 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/CreditAdjustmentCheckerTest.cs @@ -0,0 +1,95 @@ +using System; +using System.Collections.Generic; +using LCU.API.Collections.RepoApi.Domain.AlertChecker; +using LCU.API.Collections.RepoApi.Domain.Processing; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.Consumer; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.AlertCheckers +{ + public class CreditAdjustmentCheckerTest + { + private readonly CreditAdjustmentChecker _creditAdjustmentChecker; + private readonly List _transactions; + + public CreditAdjustmentCheckerTest() + { + _transactions = new List() + { + new CoreTransaction() + { + postingDate = DateTime.Now.AddDays(-2), + transactionTypeCode = "PDSB", + amount = 500, + runningBalance = 2000, + transactionTypeDescription = "Test" + } + }; + _creditAdjustmentChecker = new CreditAdjustmentChecker(); + } + + [Fact] + public void Creates_Alert_With_Recent_Transactions_Present_And_O4R_Status() + { + var slip = new RepoAccountProcessingSlip() + { + TransactionHistory = _transactions, + ExistingRepoAccount = new RepoAccount(), + UpdatedRepoAccount = new RepoAccount { Status = "O4R" } + }; + + var result = _creditAdjustmentChecker.CheckForAlert(slip); + + Assert.NotNull(result); + Assert.Equal("Credit Adjustment Received", result[0].Message); + } + + [Fact] + public void Creates_Alert_With_Recent_Transactions_Present_And_REPO_Status() + { + var slip = new RepoAccountProcessingSlip() + { + TransactionHistory = _transactions, + ExistingRepoAccount = new RepoAccount(), + UpdatedRepoAccount = new RepoAccount { Status = "REPO" } + }; + + var result = _creditAdjustmentChecker.CheckForAlert(slip); + + Assert.NotNull(result); + Assert.Equal("Credit Adjustment Received", result[0].Message); + } + + [Fact] + public void Creates_Alert_With_Recent_Transactions_Present_And_SOLD_Status() + { + var slip = new RepoAccountProcessingSlip() + { + TransactionHistory = _transactions, + ExistingRepoAccount = new RepoAccount(), + UpdatedRepoAccount = new RepoAccount { Status = "SOLD" } + }; + + var result = _creditAdjustmentChecker.CheckForAlert(slip); + + Assert.NotNull(result); + Assert.Equal("Credit Adjustment Received", result[0].Message); + } + + [Fact] + public void Does_Not_Create_Alert_For_Unwatched_Statuses() + { + var slip = new RepoAccountProcessingSlip() + { + TransactionHistory = _transactions, + ExistingRepoAccount = new RepoAccount(), + UpdatedRepoAccount = new RepoAccount { Status = "RECA" } + }; + + var result = _creditAdjustmentChecker.CheckForAlert(slip); + + Assert.Null(result); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/DebitAdjustmentCheckerTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/DebitAdjustmentCheckerTest.cs new file mode 100644 index 0000000..063a3d0 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/DebitAdjustmentCheckerTest.cs @@ -0,0 +1,95 @@ +using System; +using System.Collections.Generic; +using LCU.API.Collections.RepoApi.Domain.AlertChecker; +using LCU.API.Collections.RepoApi.Domain.Processing; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.Consumer; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.AlertCheckers +{ + public class DebitAdjustmentCheckerTest + { + private readonly DebitAdjustmentChecker _debitAdjustmentChecker; + private readonly List _transactions; + + public DebitAdjustmentCheckerTest() + { + _transactions = new List() + { + new CoreTransaction() + { + postingDate = DateTime.Now.AddDays(-2), + transactionTypeCode = "PRCT", + amount = 500, + runningBalance = 2000, + transactionTypeDescription = "Test" + } + }; + _debitAdjustmentChecker = new DebitAdjustmentChecker(); + } + + [Fact] + public void Creates_Alert_With_Recent_Transactions_Present_And_O4R_Status() + { + var slip = new RepoAccountProcessingSlip() + { + TransactionHistory = _transactions, + ExistingRepoAccount = new RepoAccount(), + UpdatedRepoAccount = new RepoAccount { Status = "O4R" } + }; + + var result = _debitAdjustmentChecker.CheckForAlert(slip); + + Assert.NotNull(result); + Assert.Equal("Debit Adjustment Received", result[0].Message); + } + + [Fact] + public void Creates_Alert_With_Recent_Transactions_Present_And_REPO_Status() + { + var slip = new RepoAccountProcessingSlip() + { + TransactionHistory = _transactions, + ExistingRepoAccount = new RepoAccount(), + UpdatedRepoAccount = new RepoAccount { Status = "REPO" } + }; + + var result = _debitAdjustmentChecker.CheckForAlert(slip); + + Assert.NotNull(result); + Assert.Equal("Debit Adjustment Received", result[0].Message); + } + + [Fact] + public void Creates_Alert_With_Recent_Transactions_Present_And_SOLD_Status() + { + var slip = new RepoAccountProcessingSlip() + { + TransactionHistory = _transactions, + ExistingRepoAccount = new RepoAccount(), + UpdatedRepoAccount = new RepoAccount { Status = "SOLD" } + }; + + var result = _debitAdjustmentChecker.CheckForAlert(slip); + + Assert.NotNull(result); + Assert.Equal("Debit Adjustment Received", result[0].Message); + } + + [Fact] + public void Does_Not_Create_Alert_For_Unwatched_Statuses() + { + var slip = new RepoAccountProcessingSlip() + { + TransactionHistory = _transactions, + ExistingRepoAccount = new RepoAccount(), + UpdatedRepoAccount = new RepoAccount { Status = "RECA" } + }; + + var result = _debitAdjustmentChecker.CheckForAlert(slip); + + Assert.Null(result); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/DocumentNotFoundCheckerTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/DocumentNotFoundCheckerTest.cs new file mode 100644 index 0000000..7ba3c48 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/DocumentNotFoundCheckerTest.cs @@ -0,0 +1,436 @@ +using System; +using System.Collections.Generic; +using LCU.API.Collections.RepoApi.Domain.AlertChecker; +using LCU.API.Collections.RepoApi.Domain.Processing; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.Consumer; +using Moq; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.AlertCheckers +{ + public class DocumentNotFoundCheckerTest + { + public DocumentNotFoundCheckerTest() + { + } + + private MemberDetail MakeMemberWithAddressInState(string state) + { + return new MemberDetail + { + Address = new AddressDetail + { + State = state + } + }; + } + + [Fact] + public void Create_NoticeOfSaleBankruptcy_Ok() + { + var slip = new RepoAccountProcessingSlip() + { + Letters = new List(), + Member = MakeMemberWithAddressInState("WI"), + ExistingRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "REPO" + }, + UpdatedRepoAccount = new RepoAccount() + { + Bankruptcy = "B13", + AccountNo = "123456-789", + Status = "REPO" + } + }; + var checker = new DocumentNotFoundChecker("Notice of Sale", "LTR35", "701", "REPO"); + + var result = checker.CheckForAlert(slip); + + Assert.Null(result); + } + + [Fact] + public void Create_NoticeOfSaleWiFound_Ok() + { + var slip = new RepoAccountProcessingSlip() + { + Letters = new List + { + new RepoLetter + { + ActionCode = "LTR35", + NoticeType = "WI Repo-Notice of Plan to Sell" + } + }, + Member = MakeMemberWithAddressInState("WI"), + ExistingRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "RECA" + }, + UpdatedRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "RECA" + } + }; + var checker = new DocumentNotFoundChecker("Notice of Sale", "LTR35", "701", "REPO"); + + var result = checker.CheckForAlert(slip); + + Assert.Null(result); + } + + [Fact] + public void Create_NoticeOfSaleIlFound_Ok() + { + var slip = new RepoAccountProcessingSlip() + { + Letters = new List + { + new RepoLetter + { + ActionCode = "701", + NoticeType = "Right to Reinstate/Redeem-Illinois" + } + }, + Member = MakeMemberWithAddressInState("IL"), + ExistingRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "RECA" + }, + UpdatedRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "RECA" + } + }; + var checker = new DocumentNotFoundChecker("Notice of Sale", "LTR35", "701", "REPO"); + + var result = checker.CheckForAlert(slip); + + Assert.Null(result); + } + + [Fact] + public void Create_NoticeOfSaleWrongStatus_Ok() + { + var slip = new RepoAccountProcessingSlip() + { + Letters = new List(), + Member = MakeMemberWithAddressInState("WI"), + ExistingRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "RECA" + }, + UpdatedRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "RECA" + } + }; + var checker = new DocumentNotFoundChecker("Notice of Sale", "LTR35", "701", "REPO"); + + var result = checker.CheckForAlert(slip); + + Assert.Null(result); + } + + [Fact] + public void Create_NoticeOfSaleNotFound_Ok() + { + var slip = new RepoAccountProcessingSlip() + { + Letters = new List(), + Member = MakeMemberWithAddressInState("WI"), + ExistingRepoAccount = new RepoAccount() + { + RepoId = 5, + AccountNo = "123456-789", + Status = "REPO" + }, + UpdatedRepoAccount = new RepoAccount() + { + RepoId = 5, + AccountNo = "123456-789", + Status = "REPO" + } + }; + + var checker = new DocumentNotFoundChecker("Notice of Plan to Sell", "LTR35", "701", "REPO"); + + var result = checker.CheckForAlert(slip); + + Assert.NotNull(result); + Assert.Equal("Notice of Plan to Sell Not Found", result[0].Message); + Assert.Equal("123456-789", result[0].AccountNo); + Assert.Equal("Batch", result[0].CreatedBy); + Assert.InRange(result[0].DateAdded, DateTime.Now.AddSeconds(-1), DateTime.Now.AddSeconds(1)); + Assert.Equal(5, result[0].RepoId); + Assert.Null(result[0].MarkedReadBy); + Assert.Null(result[0].DateMarkedRead); + } + + [Fact] + public void Create_NoticeOfRepossessionBankruptcy_Ok() + { + var slip = new RepoAccountProcessingSlip() + { + Letters = new List(), + Member = MakeMemberWithAddressInState("WI"), + ExistingRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "REPO" + }, + UpdatedRepoAccount = new RepoAccount() + { + Bankruptcy = "B13", + AccountNo = "123456-789", + Status = "REPO" + } + }; + var checker = new DocumentNotFoundChecker("Notice of Repossession", "LTR34", "701", "REPO"); + + var result = checker.CheckForAlert(slip); + + Assert.Null(result); + } + + [Fact] + public void Create_NoticeOfRepossessionWiFound_Ok() + { + var slip = new RepoAccountProcessingSlip() + { + Letters = new List + { + new RepoLetter + { + ActionCode = "LTR34", + NoticeType = "Repo-WI Notice of Repossession" + } + }, + Member = MakeMemberWithAddressInState("WI"), + ExistingRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "REPO" + }, + UpdatedRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "REPO" + } + }; + var checker = new DocumentNotFoundChecker("Notice of Repossession", "LTR34", "701", "REPO"); + + var result = checker.CheckForAlert(slip); + + Assert.Null(result); + } + + [Fact] + public void Create_NoticeOfRepossessionIlFound_Ok() + { + var slip = new RepoAccountProcessingSlip() + { + Letters = new List + { + new RepoLetter + { + ActionCode = "701", + NoticeType = "Right to Reinstate/Redeem-Illinois" + } + }, + Member = MakeMemberWithAddressInState("IL"), + ExistingRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "REPO" + }, + UpdatedRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "REPO" + } + }; + var checker = new DocumentNotFoundChecker("Notice of Repossession", "LTR34", "701", "REPO"); + + var result = checker.CheckForAlert(slip); + + Assert.Null(result); + } + + [Fact] + public void Create_NoticeOfRepossessionWrongStatus_Ok() + { + var slip = new RepoAccountProcessingSlip() + { + Letters = new List(), + Member = MakeMemberWithAddressInState("WI"), + ExistingRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "RECA" + }, + UpdatedRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "RECA" + } + }; + var checker = new DocumentNotFoundChecker("Notice of Repossession", "LTR34", "701", "REPO"); + + var result = checker.CheckForAlert(slip); + + Assert.Null(result); + } + + [Fact] + public void Create_NoticeOfRepossessionNotFound_Ok() + { + var slip = new RepoAccountProcessingSlip() + { + Letters = new List(), + Member = MakeMemberWithAddressInState("WI"), + ExistingRepoAccount = new RepoAccount() + { + RepoId = 5, + AccountNo = "123456-789", + Status = "REPO" + }, + UpdatedRepoAccount = new RepoAccount() + { + RepoId = 5, + AccountNo = "123456-789", + Status = "REPO" + } + }; + var checker = new DocumentNotFoundChecker("Notice of Repossession", "LTR34", "701", "REPO"); + + var result = checker.CheckForAlert(slip); + + Assert.NotNull(result[0]); + Assert.Equal("Notice of Repossession Not Found", result[0].Message); + Assert.Equal("123456-789", result[0].AccountNo); + Assert.Equal("Batch", result[0].CreatedBy); + Assert.InRange(result[0].DateAdded, DateTime.Now.AddSeconds(-1), DateTime.Now.AddSeconds(1)); + Assert.Equal(5, result[0].RepoId); + Assert.Null(result[0].MarkedReadBy); + Assert.Null(result[0].DateMarkedRead); + } + + [Fact] + public void Null_Letters_Dont_Throw_Exception() + { + var slip = new RepoAccountProcessingSlip() + { + Letters = null, + Member = MakeMemberWithAddressInState("WI"), + ExistingRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "REPO" + }, + UpdatedRepoAccount = new RepoAccount() + { + Bankruptcy = "B13", + AccountNo = "123456-789", + Status = "REPO" + } + }; + + var checker = new DocumentNotFoundChecker("RTC Letter", "RTC 3"); + + List result = null; + + try + { + result = checker.CheckForAlert(slip); + } + catch (Exception) + { + Assert.True(false, "Null letters should not have thrown an exception."); + } + + Assert.Null(result); + } + + [Fact] + public void Null_Member_Does_Not_Throw_Exception() + { + var slip = new RepoAccountProcessingSlip() + { + Letters = new List(), + Member = null, + ExistingRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "REPO" + }, + UpdatedRepoAccount = new RepoAccount() + { + Bankruptcy = "B13", + AccountNo = "123456-789", + Status = "REPO" + } + }; + + var checker = new DocumentNotFoundChecker("RTC Letter", "RTC 3"); + + List result = null; + + try + { + result = checker.CheckForAlert(slip); + } + catch (Exception) + { + Assert.True(false, "A null member should not have thrown an exception."); + } + + Assert.Null(result); + } + + [Fact] + public void Null_Member_Address_Does_Not_Throw_Exception() + { + var slip = new RepoAccountProcessingSlip() + { + Letters = new List(), + Member = MakeMemberWithAddressInState(null), + ExistingRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "REPO" + }, + UpdatedRepoAccount = new RepoAccount() + { + Bankruptcy = "B13", + AccountNo = "123456-789", + Status = "REPO" + } + }; + + var checker = new DocumentNotFoundChecker("RTC Letter", "RTC 3"); + + List result = null; + + try + { + result = checker.CheckForAlert(slip); + } + catch (Exception) + { + Assert.True(false, "A null member address should not have thrown an exception."); + } + + Assert.Null(result); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/NoticeOfSurplusDeficiencyNotSentCheckerTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/NoticeOfSurplusDeficiencyNotSentCheckerTest.cs new file mode 100644 index 0000000..2a95531 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/NoticeOfSurplusDeficiencyNotSentCheckerTest.cs @@ -0,0 +1,169 @@ +using System; +using LCU.API.Collections.RepoApi.Domain.AlertChecker; +using LCU.API.Collections.RepoApi.Domain.Processing; +using LCU.Shared.Collections.RepoApiLib.Models; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.AlertCheckers +{ + public class NoticeOfSurplusDeficiencyNotSentCheckerTest + { + private readonly NoticeOfSurplusDeficiencyNotSentChecker _checker; + + public NoticeOfSurplusDeficiencyNotSentCheckerTest() + { + _checker = new NoticeOfSurplusDeficiencyNotSentChecker(); + } + + [Fact] + public void Does_Not_Create_Alert_When_Refunds_Received_Date_Is_Null() + { + var slip = new RepoAccountProcessingSlip() + { + ExistingRepoAccount = new RepoAccount() + { + RepoId = 1, + AccountNo = "123456-789", + Status = "REPO" + }, + UpdatedRepoAccount = new RepoAccount() + { + RepoId = 1, + AccountNo = "123456-789", + Status = "REPO", + RefundStatus = new RefundStatus + { + RepoId = 1, + RefundsReceivedDate = null + } + } + }; + + var result = _checker.CheckForAlert(slip); + Assert.Null(result); + } + + [Fact] + public void Does_Not_Create_Alert_When_Refunds_Received_Date_Two_Days_Ago_And_Account_Not_Closed() + { + var originalRepoAccount = new RepoAccount() + { + RepoId = 1, + AccountNo = "123456-789", + Status = "REPO" + }; + var updatedRepoAccount = new RepoAccount() + { + RepoId = 1, + AccountNo = "123456-789", + Status = "REPO", + RefundStatus = new RefundStatus + { + RepoId = 1, + RefundsReceivedDate = DateTime.Now.AddDays(-2).Date + } + }; + var slip = new RepoAccountProcessingSlip() + { + ExistingRepoAccount = originalRepoAccount, + UpdatedRepoAccount = updatedRepoAccount + }; + + var result = _checker.CheckForAlert(slip); + Assert.Null(result); + } + + [Fact] + public void Creates_Alert_When_Refunds_Received_Date_Three_Days_Ago_And_Account_Not_Closed() + { + var originalRepoAccount = new RepoAccount() + { + RepoId = 1, + AccountNo = "123456-789", + Status = "REPO" + }; + var updatedRepoAccount = new RepoAccount() + { + RepoId = 1, + AccountNo = "123456-789", + Status = "REPO", + RefundStatus = new RefundStatus + { + RepoId = 1, + RefundsReceivedDate = DateTime.Now.AddDays(-3).Date + } + }; + var slip = new RepoAccountProcessingSlip() + { + ExistingRepoAccount = originalRepoAccount, + UpdatedRepoAccount = updatedRepoAccount + }; + + var result = _checker.CheckForAlert(slip); + Assert.NotNull(result); + } + + [Fact] + public void Does_Not_Create_Alert_When_Refunds_Received_Date_Three_Days_Ago_And_Account_Not_Closed_And_Bankruptcy_Not_Null() + { + var originalRepoAccount = new RepoAccount() + { + RepoId = 1, + AccountNo = "123456-789", + Status = "REPO", + Bankruptcy = "B7" + }; + var updatedRepoAccount = new RepoAccount() + { + RepoId = 1, + AccountNo = "123456-789", + Status = "REPO", + Bankruptcy = "B7", + RefundStatus = new RefundStatus + { + RepoId = 1, + RefundsReceivedDate = DateTime.Now.AddDays(-3).Date + } + }; + var slip = new RepoAccountProcessingSlip() + { + ExistingRepoAccount = originalRepoAccount, + UpdatedRepoAccount = updatedRepoAccount + }; + + var result = _checker.CheckForAlert(slip); + Assert.Null(result); + } + + [Fact] + public void Does_Not_Create_Alert_When_Refunds_Received_Date_Three_Days_Ago_And_Account_Is_Closed() + { + var originalRepoAccount = new RepoAccount() + { + RepoId = 1, + AccountNo = "123456-789", + Status = "REPO" + }; + var updatedRepoAccount = new RepoAccount() + { + RepoId = 1, + AccountNo = "123456-789", + Status = "REPO", + DateClosed = DateTime.Now.Date, + RefundStatus = new RefundStatus + { + RepoId = 1, + RefundsReceivedDate = DateTime.Now.AddDays(-3).Date + } + }; + var slip = new RepoAccountProcessingSlip() + { + ExistingRepoAccount = originalRepoAccount, + UpdatedRepoAccount = updatedRepoAccount + }; + + var result = _checker.CheckForAlert(slip); + Assert.Null(result); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/O4rNoRepoCheckerTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/O4rNoRepoCheckerTest.cs new file mode 100644 index 0000000..229cc07 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/O4rNoRepoCheckerTest.cs @@ -0,0 +1,517 @@ +using System; +using System.Collections.Generic; +using LCU.API.Collections.CollectionsApiLib.Models; +using LCU.API.Collections.RepoApi.Domain.AlertChecker; +using LCU.API.Collections.RepoApi.Domain.Processing; +using LCU.Shared.Collections.RepoApiLib.Models; +using Moq; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.AlertCheckers +{ + public class O4rNoRepoCheckerTest + { + [Fact] + public void Create_TooFewDays_Ok() + { + var checker = new O4rNoRepoChecker(RepoType.Voluntary); + var originalRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "O4R" + }; + var updatedRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "O4R", + Collaterals = new List() + { + new Collateral + { + RepoCompanySelections = new List() + { + new RepoCompanySelection() + { + RepoType = RepoType.Voluntary + } + } + } + }, + RepoStatusChanges = new List() + { + new RepoStatusChange() + { + StatusFrom = "None", + StatusTo = "O4R", + ChangedDate = DateTime.Now.AddDays(-1) + } + } + }; + var slip = new RepoAccountProcessingSlip() + { + ExistingRepoAccount = originalRepoAccount, + UpdatedRepoAccount = updatedRepoAccount + }; + + + var result = checker.CheckForAlert(slip); + + Assert.Null(result); + } + + [Fact] + public void Create_Voluntary_Ok() + { + var checker = new O4rNoRepoChecker(RepoType.Voluntary); + var originalRepoAccount = new RepoAccount() + { + RepoId = 5, + AccountNo = "123456-789", + Status = "O4R" + }; + var updatedRepoAccount = new RepoAccount() + { + RepoId = 5, + AccountNo = "123456-789", + Status = "O4R", + Collaterals = new List() + { + new Collateral + { + RepoCompanySelections = new List() + { + new RepoCompanySelection() + { + RepoType = RepoType.Voluntary, + RepoCompanyId = 10, + RepoCompanyAssignmentDate = DateTime.Today + } + } + } + }, + RepoStatusChanges = new List() + { + new RepoStatusChange() + { + StatusFrom = "None", + StatusTo = "O4R", + ChangedDate = DateTime.Now.AddDays(-2) + } + } + }; + + var slip = new RepoAccountProcessingSlip() + { + ExistingRepoAccount = originalRepoAccount, + UpdatedRepoAccount = updatedRepoAccount + }; + + + var result = checker.CheckForAlert(slip); + + Assert.NotNull(result); + Assert.Equal("O4R No Repo", result[0].Message); + Assert.Equal("123456-789", result[0].AccountNo); + Assert.Equal("Batch", result[0].CreatedBy); + Assert.InRange(result[0].DateAdded, DateTime.Now.AddSeconds(-1), DateTime.Now.AddSeconds(1)); + Assert.Equal(5, result[0].RepoId); + Assert.Null(result[0].MarkedReadBy); + Assert.Null(result[0].DateMarkedRead); + } + + [Fact] + public void Create_VoluntaryRepeat_Ok() + { + var checker = new O4rNoRepoChecker(RepoType.Voluntary); + var originalRepoAccount = new RepoAccount() + { + RepoId = 7, + AccountNo = "123456-789", + Status = "O4R" + }; + var updatedRepoAccount = new RepoAccount() + { + RepoId = 7, + AccountNo = "123456-789", + Status = "O4R", + Collaterals = new List() + { + new Collateral + { + RepoCompanySelections = new List() + { + new RepoCompanySelection() + { + RepoType = RepoType.Voluntary, + RepoCompanyAssignmentDate = DateTime.Today, + RepoCompanyId = 5 + } + } + } + }, + RepoStatusChanges = new List() + { + new RepoStatusChange() + { + StatusFrom = "None", + StatusTo = "O4R", + ChangedDate = DateTime.Now.AddDays(-3) + } + } + }; + + var slip = new RepoAccountProcessingSlip() + { + ExistingRepoAccount = originalRepoAccount, + UpdatedRepoAccount = updatedRepoAccount + }; + + + var result = checker.CheckForAlert(slip); + + Assert.NotNull(result); + Assert.Equal("O4R No Repo", result[0].Message); + Assert.Equal("123456-789", result[0].AccountNo); + Assert.Equal("Batch", result[0].CreatedBy); + Assert.InRange(result[0].DateAdded, DateTime.Now.AddSeconds(-1), DateTime.Now.AddSeconds(1)); + Assert.Equal(7, result[0].RepoId); + Assert.Null(result[0].MarkedReadBy); + Assert.Null(result[0].DateMarkedRead); + } + + [Fact] + public void Create_Involuntary_Ok() + { + var checker = new O4rNoRepoChecker(RepoType.Involuntary); + var originalRepoAccount = new RepoAccount() + { + RepoId = 4, + AccountNo = "123456-789", + Status = "O4R" + }; + var updatedRepoAccount = new RepoAccount() + { + RepoId = 4, + AccountNo = "123456-789", + Status = "O4R", + Collaterals = new List() + { + new Collateral + { + RepoCompanySelections = new List() + { + new RepoCompanySelection() + { + RepoType = RepoType.Involuntary, + RepoCompanyAssignmentDate = DateTime.Today, + RepoCompanyId = 5 + } + } + } + }, + RepoStatusChanges = new List() + { + new RepoStatusChange() + { + StatusFrom = "None", + StatusTo = "O4R", + ChangedDate = DateTime.Now.AddDays(-60) + } + } + }; + + var slip = new RepoAccountProcessingSlip() + { + ExistingRepoAccount = originalRepoAccount, + UpdatedRepoAccount = updatedRepoAccount + }; + + + var result = checker.CheckForAlert(slip); + + Assert.NotNull(result); + Assert.Equal("O4R No Repo", result[0].Message); + Assert.Equal("123456-789", result[0].AccountNo); + Assert.Equal("Batch", result[0].CreatedBy); + Assert.InRange(result[0].DateAdded, DateTime.Now.AddSeconds(-1), DateTime.Now.AddSeconds(1)); + Assert.Equal(4, result[0].RepoId); + Assert.Null(result[0].MarkedReadBy); + Assert.Null(result[0].DateMarkedRead); + } + + [Fact] + public void Create_InvoluntaryRepeat_Ok() + { + var checker = new O4rNoRepoChecker(RepoType.Involuntary); + var originalRepoAccount = new RepoAccount() + { + RepoId = 7, + AccountNo = "123456-789", + Status = "O4R" + }; + var updatedRepoAccount = new RepoAccount() + { + RepoId = 7, + AccountNo = "123456-789", + Status = "O4R", + Collaterals = new List() + { + new Collateral + { + RepoCompanySelections = new List() + { + new RepoCompanySelection() + { + RepoType = RepoType.Involuntary, + RepoCompanyAssignmentDate = DateTime.Today, + RepoCompanyId = 5 + } + } + } + }, + RepoStatusChanges = new List() + { + new RepoStatusChange() + { + StatusFrom = "None", + StatusTo = "O4R", + ChangedDate = DateTime.Now.AddDays(-90) + } + } + }; + + var slip = new RepoAccountProcessingSlip() + { + ExistingRepoAccount = originalRepoAccount, + UpdatedRepoAccount = updatedRepoAccount + }; + + + var result = checker.CheckForAlert(slip); + + Assert.NotNull(result); + Assert.Equal("O4R No Repo", result[0].Message); + Assert.Equal("123456-789", result[0].AccountNo); + Assert.Equal("Batch", result[0].CreatedBy); + Assert.InRange(result[0].DateAdded, DateTime.Now.AddSeconds(-1), DateTime.Now.AddSeconds(1)); + Assert.Equal(7, result[0].RepoId); + Assert.Null(result[0].MarkedReadBy); + Assert.Null(result[0].DateMarkedRead); + } + + [Fact] + public void Create_Preskip_Ok() + { + var checker = new O4rNoRepoChecker(RepoType.PreSkip); + var originalRepoAccount = new RepoAccount() + { + RepoId = 7, + AccountNo = "123456-789", + Status = "O4R" + }; + var updatedRepoAccount = new RepoAccount() + { + RepoId = 7, + AccountNo = "123456-789", + Status = "O4R", + Collaterals = new List() + { + new Collateral + { + RepoCompanySelections = new List() + { + new RepoCompanySelection() + { + RepoType = RepoType.PreSkip, + RepoCompanyAssignmentDate = DateTime.Today, + RepoCompanyId = 5 + } + } + } + }, + RepoStatusChanges = new List() + { + new RepoStatusChange() + { + StatusFrom = "None", + StatusTo = "O4R", + ChangedDate = DateTime.Now.AddDays(-31) + } + } + }; + + var slip = new RepoAccountProcessingSlip() + { + ExistingRepoAccount = originalRepoAccount, + UpdatedRepoAccount = updatedRepoAccount + }; + + + var result = checker.CheckForAlert(slip); + + Assert.NotNull(result); + Assert.Equal("O4R No Repo", result[0].Message); + Assert.Equal("123456-789", result[0].AccountNo); + Assert.Equal("Batch", result[0].CreatedBy); + Assert.InRange(result[0].DateAdded, DateTime.Now.AddSeconds(-1), DateTime.Now.AddSeconds(1)); + Assert.Equal(7, result[0].RepoId); + Assert.Null(result[0].MarkedReadBy); + Assert.Null(result[0].DateMarkedRead); + } + + [Fact] + public void Create_No_Repo_Ok() + { + var checker = new O4rNoRepoChecker(RepoType.PreSkip); + var originalRepoAccount = new RepoAccount() + { + RepoId = 7, + AccountNo = "123456-789", + Status = "O4R" + }; + var updatedRepoAccount = new RepoAccount() + { + RepoId = 7, + AccountNo = "123456-789", + Status = "O4R", + Collaterals = new List() + { + new Collateral + { + RepoCompanySelections = new List() + { + new RepoCompanySelection() + { + RepoType = RepoType.Unknown, + RepoCompanyAssignmentDate = null, + RepoCompanyId = 5 + } + } + } + }, + RepoStatusChanges = new List() + { + new RepoStatusChange() + { + StatusFrom = "None", + StatusTo = "O4R", + ChangedDate = DateTime.Now.AddDays(-31) + } + } + }; + + var slip = new RepoAccountProcessingSlip() + { + ExistingRepoAccount = originalRepoAccount, + UpdatedRepoAccount = updatedRepoAccount + }; + + + var result = checker.CheckForAlert(slip); + Assert.Null(result); + } + + [Theory] + [InlineData(15, 10, 5, true)] + [InlineData(20, 10, 10, true)] + [InlineData(16, 10, 5, false)] + [InlineData(8, 10, 5, false)] + [InlineData(10, 10, 5, false)] + public void ShouldSendRepeatedAlert_OK(int daysInStatus, int dayCount, int repeatCount, bool expected) + { + var checker = new O4rNoRepoChecker(RepoType.PreSkip); + + Assert.Equal(expected, checker.ShouldSendRepeatedAlert(daysInStatus, dayCount, repeatCount)); + } + + [Fact] + public void IsRepoAssigned_True_OK() + { + var updatedRepoAccount = new RepoAccount() + { + RepoId = 7, + AccountNo = "123456-789", + Status = "O4R", + Collaterals = new List() + { + new Collateral + { + RepoCompanySelections = new List() + { + new RepoCompanySelection() + { + RepoType = RepoType.PreSkip, + RepoCompanyAssignmentDate = DateTime.Now, + RepoCompanyId = 5 + } + } + } + } + }; + + var checker = new O4rNoRepoChecker(RepoType.PreSkip); + + Assert.True(checker.IsRepoAssigned(updatedRepoAccount)); + } + + [Fact] + public void IsRepoAssigned_No_Date_OK() + { + var updatedRepoAccount = new RepoAccount() + { + RepoId = 7, + AccountNo = "123456-789", + Status = "O4R", + Collaterals = new List() + { + new Collateral + { + RepoCompanySelections = new List() + { + new RepoCompanySelection() + { + RepoType = RepoType.PreSkip, + RepoCompanyAssignmentDate = null, + RepoCompanyId = 5 + } + } + } + } + }; + + var checker = new O4rNoRepoChecker(RepoType.PreSkip); + + Assert.False(checker.IsRepoAssigned(updatedRepoAccount)); + } + + [Fact] + public void IsRepoAssigned_No_Type_OK() + { + var updatedRepoAccount = new RepoAccount() + { + RepoId = 7, + AccountNo = "123456-789", + Status = "O4R", + Collaterals = new List() + { + new Collateral + { + RepoCompanySelections = new List() + { + new RepoCompanySelection() + { + RepoType = RepoType.Unknown, + RepoCompanyAssignmentDate = DateTime.Now, + RepoCompanyId = 5 + } + } + } + } + }; + + var checker = new O4rNoRepoChecker(RepoType.PreSkip); + + Assert.False(checker.IsRepoAssigned(updatedRepoAccount)); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/PaymentReceivedCheckerTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/PaymentReceivedCheckerTest.cs new file mode 100644 index 0000000..95497f1 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/PaymentReceivedCheckerTest.cs @@ -0,0 +1,92 @@ +using System; +using System.Collections.Generic; +using LCU.API.Collections.RepoApi.Domain.AlertChecker; +using LCU.API.Collections.RepoApi.Domain.Processing; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.Consumer; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.AlertCheckers +{ + public class PaymentReceivedCheckerTest + { + private readonly PaymentReceivedChecker _paymentReceivedChecker; + private readonly List _transactions; + + public PaymentReceivedCheckerTest() + { + _transactions = new List() + { + new CoreTransaction() + { + postingDate = DateTime.Now.AddDays(-2), + transactionTypeCode = "EXT", + amount = 500, + runningBalance = 2000, + transactionTypeDescription = "Test" + } + }; + + _paymentReceivedChecker = new PaymentReceivedChecker(); + } + + [Fact] + public void Creates_Alert_With_Recent_Transactions_Present_And_O4R_Status() + { + var slip = new RepoAccountProcessingSlip() + { + TransactionHistory = _transactions, + ExistingRepoAccount = new RepoAccount(), + UpdatedRepoAccount = new RepoAccount { Status = "O4R" } + }; + var result = _paymentReceivedChecker.CheckForAlert(slip); + + Assert.NotNull(result); + Assert.Equal("Payment Received", result[0].Message); + } + + [Fact] + public void Creates_Alert_With_Recent_Transactions_Present_And_REPO_Status() + { + var slip = new RepoAccountProcessingSlip() + { + TransactionHistory = _transactions, + ExistingRepoAccount = new RepoAccount(), + UpdatedRepoAccount = new RepoAccount { Status = "REPO" } + }; + var result = _paymentReceivedChecker.CheckForAlert(slip); + + Assert.NotNull(result); + Assert.Equal("Payment Received", result[0].Message); + } + + [Fact] + public void Creates_Alert_With_Recent_Transactions_Present_And_SOLD_Status() + { + var slip = new RepoAccountProcessingSlip() + { + TransactionHistory = _transactions, + ExistingRepoAccount = new RepoAccount(), + UpdatedRepoAccount = new RepoAccount { Status = "SOLD" } + }; + var result = _paymentReceivedChecker.CheckForAlert(slip); + + Assert.NotNull(result); + Assert.Equal("Payment Received", result[0].Message); + } + + [Fact] + public void Does_Not_Create_Alert_For_Unwatched_Statuses() + { + var slip = new RepoAccountProcessingSlip() + { + TransactionHistory = _transactions, + ExistingRepoAccount = new RepoAccount(), + UpdatedRepoAccount = new RepoAccount { Status = "RECA" } + }; + var result = _paymentReceivedChecker.CheckForAlert(slip); + + Assert.Null(result); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/RedemptionEndedNoTitleOrderedCheckerTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/RedemptionEndedNoTitleOrderedCheckerTest.cs new file mode 100644 index 0000000..af69c93 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/RedemptionEndedNoTitleOrderedCheckerTest.cs @@ -0,0 +1,180 @@ +using System; +using System.Collections.Generic; +using LCU.API.Collections.RepoApi.Domain.AlertChecker; +using LCU.API.Collections.RepoApi.Domain.Processing; +using LCU.Shared.Collections.RepoApiLib.Models; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.AlertCheckers +{ + public class RedemptionEndedNoTitleOrderedCheckerTest + { + private readonly RedemptionEndedNoTitleOrderedChecker _checker; + + public RedemptionEndedNoTitleOrderedCheckerTest() + { + _checker = new RedemptionEndedNoTitleOrderedChecker(); + } + + [Fact] + public void Create_TooFewDays_Ok() + { + var originalRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "REPO" + }; + var updatedRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "REPO", + RedemptionExpiredDate = DateTime.Now.AddDays(-7), + Collaterals = new List() + { + new Collateral() + { + AuctionAssignmentToCollaterals = new List() + { + new AuctionAssignmentToCollateral() + { + AuctionAssignmentId = 1, + CollateralId = 1 + } + } + } + } + }; + var slip = new RepoAccountProcessingSlip() + { + ExistingRepoAccount = originalRepoAccount, + UpdatedRepoAccount = updatedRepoAccount + }; + + var result = _checker.CheckForAlert(slip); + + Assert.Null(result); + } + + [Fact] + public void Create_StatusNotRepo_Ok() + { + var originalRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "O4R" + }; + var updatedRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "O4R", + RedemptionExpiredDate = DateTime.Now.AddDays(-8), + Collaterals = new List() + { + new Collateral() + { + AuctionAssignmentToCollaterals = new List() + { + new AuctionAssignmentToCollateral() + { + AuctionAssignmentId = 1, + CollateralId = 1 + } + } + } + } + }; + + var slip = new RepoAccountProcessingSlip() + { + ExistingRepoAccount = originalRepoAccount, + UpdatedRepoAccount = updatedRepoAccount + }; + + var result = _checker.CheckForAlert(slip); + + Assert.Null(result); + } + + [Fact] + public void Create_RedemptionEndedNoTitleOrdered_Ok() + { + var originalRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "REPO" + }; + var updatedRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "REPO", + RedemptionExpiredDate = DateTime.Now.AddDays(-8), + Collaterals = new List() + { + new Collateral() + { + AuctionAssignmentToCollaterals = new List() + { + new AuctionAssignmentToCollateral() + { + AuctionAssignmentId = 1, + CollateralId = 1 + } + } + } + } + }; + + var slip = new RepoAccountProcessingSlip() + { + ExistingRepoAccount = originalRepoAccount, + UpdatedRepoAccount = updatedRepoAccount + }; + + var result = _checker.CheckForAlert(slip); + + Assert.NotNull(result); + Assert.Equal("Redemption Ended No Title Ordered", result[0].Message); + } + + [Fact] + public void Create_RedemptionEndedTitleOrdered_Ok() + { + var originalRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "REPO" + }; + var updatedRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "REPO", + RedemptionExpiredDate = DateTime.Now.AddDays(-8), + Collaterals = new List() + { + new Collateral() + { + AuctionAssignmentToCollaterals = new List() + { + new AuctionAssignmentToCollateral() + { + AuctionAssignmentId = 1, + CollateralId = 1 + } + }, + RetitledInLandmarkName = DateTime.Now.AddDays(-5) + } + } + }; + + var slip = new RepoAccountProcessingSlip() + { + ExistingRepoAccount = originalRepoAccount, + UpdatedRepoAccount = updatedRepoAccount + }; + + var result = _checker.CheckForAlert(slip); + + Assert.Null(result); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/RepoNotSoldCheckerTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/RepoNotSoldCheckerTest.cs new file mode 100644 index 0000000..a71547a --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/RepoNotSoldCheckerTest.cs @@ -0,0 +1,173 @@ +using System; +using System.Collections.Generic; +using LCU.API.Collections.RepoApi.Domain.AlertChecker; +using LCU.API.Collections.RepoApi.Domain.Processing; +using LCU.Shared.Collections.RepoApiLib.Models; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.AlertCheckers +{ + public class RepoNotSoldCheckerTest + { + private readonly RepoNotSoldChecker _checker; + + public RepoNotSoldCheckerTest() + { + _checker = new RepoNotSoldChecker(60, 30); + } + + [Fact] + public void Create_TooFewDays_Ok() + { + var originalRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "REPO" + }; + var updatedRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "REPO", + RepoStatusChanges = new List() + { + new RepoStatusChange() + { + StatusFrom = "None", + StatusTo = "REPO", + ChangedDate = DateTime.Now.AddDays(-59) + } + } + }; + + var slip = new RepoAccountProcessingSlip() + { + ExistingRepoAccount = originalRepoAccount, + UpdatedRepoAccount = updatedRepoAccount + }; + + var result = _checker.CheckForAlert(slip); + + Assert.Null(result); + } + + [Fact] + public void Create_RepoNotSold_Ok() + { + var originalRepoAccount = new RepoAccount() + { + RepoId = 3, + AccountNo = "123456-789", + Status = "REPO" + }; + var updatedRepoAccount = new RepoAccount() + { + RepoId = 3, + AccountNo = "123456-789", + Status = "REPO", + RepoStatusChanges = new List() + { + new RepoStatusChange() + { + StatusFrom = "None", + StatusTo = "REPO", + ChangedDate = DateTime.Now.AddDays(-60) + } + } + }; + + var slip = new RepoAccountProcessingSlip() + { + ExistingRepoAccount = originalRepoAccount, + UpdatedRepoAccount = updatedRepoAccount + }; + + var result = _checker.CheckForAlert(slip); + + Assert.NotNull(result); + Assert.Equal("Repo Not Sold", result[0].Message); + Assert.Equal("123456-789", result[0].AccountNo); + Assert.Equal("Batch", result[0].CreatedBy); + Assert.InRange(result[0].DateAdded, DateTime.Now.AddSeconds(-1), DateTime.Now.AddSeconds(1)); + Assert.Equal(3, result[0].RepoId); + Assert.Null(result[0].MarkedReadBy); + Assert.Null(result[0].DateMarkedRead); + } + + [Fact] + public void Create_RepoNotSoldRepeat_Ok() + { + var originalRepoAccount = new RepoAccount() + { + RepoId = 6, + AccountNo = "123456-789", + Status = "REPO" + }; + var updatedRepoAccount = new RepoAccount() + { + RepoId = 6, + AccountNo = "123456-789", + Status = "REPO", + RepoStatusChanges = new List() + { + new RepoStatusChange() + { + StatusFrom = "None", + StatusTo = "REPO", + ChangedDate = DateTime.Now.AddDays(-90) + } + } + }; + + var slip = new RepoAccountProcessingSlip() + { + ExistingRepoAccount = originalRepoAccount, + UpdatedRepoAccount = updatedRepoAccount + }; + + var result = _checker.CheckForAlert(slip); + + Assert.NotNull(result); + Assert.Equal("Repo Not Sold", result[0].Message); + Assert.Equal("123456-789", result[0].AccountNo); + Assert.Equal("Batch", result[0].CreatedBy); + Assert.InRange(result[0].DateAdded, DateTime.Now.AddSeconds(-1), DateTime.Now.AddSeconds(1)); + Assert.Equal(6, result[0].RepoId); + Assert.Null(result[0].MarkedReadBy); + Assert.Null(result[0].DateMarkedRead); + } + + [Fact] + public void Create_61DaysInRepoNull_Ok() + { + var originalRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "REPO" + }; + var updatedRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "REPO", + RepoStatusChanges = new List() + { + new RepoStatusChange() + { + StatusFrom = "None", + StatusTo = "REPO", + ChangedDate = DateTime.Now.AddDays(-61) + } + } + }; + + var slip = new RepoAccountProcessingSlip() + { + ExistingRepoAccount = originalRepoAccount, + UpdatedRepoAccount = updatedRepoAccount + }; + + var result = _checker.CheckForAlert(slip); + + Assert.Null(result); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/RtcLetterIsNullCheckerTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/RtcLetterIsNullCheckerTest.cs new file mode 100644 index 0000000..475f445 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/RtcLetterIsNullCheckerTest.cs @@ -0,0 +1,227 @@ +using System.Collections.Generic; +using LCU.API.Collections.CollectionsApiLib.Models; +using LCU.API.Collections.RepoApi.Domain.AlertChecker; +using LCU.API.Collections.RepoApi.Domain.Processing; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.Consumer; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.AlertCheckers +{ + public class RtcLetterIsNullCheckerTest + { + public RtcLetterIsNullCheckerTest() + { + } + + private MemberDetail MakeMemberWithAddressInState(string state) + { + return new MemberDetail + { + Address = new AddressDetail + { + State = state + } + }; + } + + [Fact] + public void Create_RtcLetterWiAutoLoansFound_Ok() + { + var slip = new RepoAccountProcessingSlip() + { + Letters = new List + { + new RepoLetter + { + ActionCode = "RTC 3", + NoticeType = "RTC-WI-AUTO LOANS" + } + }, + Member = MakeMemberWithAddressInState("WI"), + ExistingRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "RECA" + }, + UpdatedRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "RECA", + Collaterals = new List + { + new Collateral + { + CollateralId = 1 + } + } + } + }; + var checker = new RtcLetterNotFoundChecker("RTC Letter", new List { "RTC 1", "RTC 3" }); + + var result = checker.CheckForAlert(slip); + + Assert.Null(result); + } + + [Fact] + public void Create_RtcLetterWiNonAutoFound_Ok() + { + var slip = new RepoAccountProcessingSlip() + { + Letters = new List + { + new RepoLetter + { + ActionCode = "RTC 1", + NoticeType = "RTC WI- ATV,Boat, Snowmobile" + } + }, + Member = MakeMemberWithAddressInState("WI"), + ExistingRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "RECA" + }, + UpdatedRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "RECA", + Collaterals = new List + { + new Collateral + { + CollateralId = 1 + } + } + } + }; + var checker = new RtcLetterNotFoundChecker("RTC Letter", new List { "RTC 1", "RTC 3" }); + + var result = checker.CheckForAlert(slip); + + Assert.Null(result); + } + + [Fact] + public void Create_RtcLetterIlNotApplicable_Ok() + { + var slip = new RepoAccountProcessingSlip() + { + Letters = new List(), + Member = MakeMemberWithAddressInState("IL"), + ExistingRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "RECA" + }, + UpdatedRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "RECA", + Collaterals = new List + { + new Collateral + { + CollateralId = 1 + } + } + } + }; + var checker = new RtcLetterNotFoundChecker("RTC Letter", new List { "RTC 1", "RTC 3" }); + + var result = checker.CheckForAlert(slip); + + Assert.Null(result); + } + + [Fact] + public void Create_RtcLetterWiVoluntary_Ok() + { + var slip = new RepoAccountProcessingSlip() + { + Letters = new List(), + Member = MakeMemberWithAddressInState("WI"), + ExistingRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "RECA", + Collaterals = new List + { + new Collateral + { + CollateralId = 1, + RepoCompanySelections = new List + { + new RepoCompanySelection + { + Id = 1, + RepoType = RepoType.Voluntary + } + } + } + } + }, + UpdatedRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "RECA", + Collaterals = new List + { + new Collateral + { + CollateralId = 1, + RepoCompanySelections = new List + { + new RepoCompanySelection + { + Id = 1, + RepoType = RepoType.Voluntary + } + } + } + } + } + }; + var checker = new RtcLetterNotFoundChecker("RTC Letter", new List { "RTC 1", "RTC 3" }); + + var result = checker.CheckForAlert(slip); + + Assert.Null(result); + } + + [Fact] + public void Create_RtcLetterNotFound_Ok() + { + var slip = new RepoAccountProcessingSlip() + { + Letters = new List(), + Member = MakeMemberWithAddressInState("WI"), + ExistingRepoAccount = new RepoAccount() + { + RepoId = 5, + AccountNo = "123456-789", + Status = "RECA" + }, + UpdatedRepoAccount = new RepoAccount() + { + RepoId = 5, + AccountNo = "123456-789", + Status = "RECA", + Collaterals = new List + { + new Collateral + { + CollateralId = 1 + } + } + } + }; + var checker = new RtcLetterNotFoundChecker("RTC Letter", new List { "RTC 1", "RTC 3" }); + + var result = checker.CheckForAlert(slip); + + Assert.Null(result); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/RtcLetterNotFoundCheckerTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/RtcLetterNotFoundCheckerTest.cs new file mode 100644 index 0000000..81edfdd --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/RtcLetterNotFoundCheckerTest.cs @@ -0,0 +1,235 @@ +using System; +using System.Collections.Generic; +using LCU.API.Collections.CollectionsApiLib.Models; +using LCU.API.Collections.RepoApi.Domain.AlertChecker; +using LCU.API.Collections.RepoApi.Domain.Processing; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.Consumer; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.AlertCheckers +{ + public class RtcLetterNotFoundCheckerTest + { + public RtcLetterNotFoundCheckerTest() + { + } + + private MemberDetail MakeMemberWithAddressInState(string state) + { + return new MemberDetail + { + Address = new AddressDetail + { + State = state + } + }; + } + + [Fact] + public void Create_RtcLetterWiAutoLoansFound_Ok() + { + var slip = new RepoAccountProcessingSlip() + { + Letters = new List + { + new RepoLetter + { + ActionCode = "RTC 3", + NoticeType = "RTC-WI-AUTO LOANS" + } + }, + Member = MakeMemberWithAddressInState("WI"), + ExistingRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "O4R" + }, + UpdatedRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "O4R", + Collaterals = new List + { + new Collateral + { + CollateralId = 1 + } + } + } + }; + var checker = new RtcLetterNotFoundChecker("RTC Letter", new List { "RTC 1", "RTC 3" }); + + var result = checker.CheckForAlert(slip); + + Assert.Null(result); + } + + [Fact] + public void Create_RtcLetterWiNonAutoFound_Ok() + { + var slip = new RepoAccountProcessingSlip() + { + Letters = new List + { + new RepoLetter + { + ActionCode = "RTC 1", + NoticeType = "RTC WI- ATV,Boat, Snowmobile" + } + }, + Member = MakeMemberWithAddressInState("WI"), + ExistingRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "O4R" + }, + UpdatedRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "O4R", + Collaterals = new List + { + new Collateral + { + CollateralId = 1 + } + } + } + }; + var checker = new RtcLetterNotFoundChecker("RTC Letter", new List { "RTC 1", "RTC 3" }); + + var result = checker.CheckForAlert(slip); + + Assert.Null(result); + } + + [Fact] + public void Create_RtcLetterIlNotApplicable_Ok() + { + var slip = new RepoAccountProcessingSlip() + { + Letters = new List(), + Member = MakeMemberWithAddressInState("IL"), + ExistingRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "O4R" + }, + UpdatedRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "O4R", + Collaterals = new List + { + new Collateral + { + CollateralId = 1 + } + } + } + }; + var checker = new RtcLetterNotFoundChecker("RTC Letter", new List { "RTC 1", "RTC 3" }); + + var result = checker.CheckForAlert(slip); + + Assert.Null(result); + } + + [Fact] + public void Create_RtcLetterWiVoluntary_Ok() + { + var slip = new RepoAccountProcessingSlip() + { + Letters = new List(), + Member = MakeMemberWithAddressInState("WI"), + ExistingRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "O4R", + Collaterals = new List + { + new Collateral + { + CollateralId = 1, + RepoCompanySelections = new List + { + new RepoCompanySelection + { + Id = 1, + RepoType = RepoType.Voluntary + } + } + } + } + }, + UpdatedRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "O4R", + Collaterals = new List + { + new Collateral + { + CollateralId = 1, + RepoCompanySelections = new List + { + new RepoCompanySelection + { + Id = 1, + RepoType = RepoType.Voluntary + } + } + } + } + } + }; + var checker = new RtcLetterNotFoundChecker("RTC Letter", new List { "RTC 1", "RTC 3" }); + + var result = checker.CheckForAlert(slip); + + Assert.Null(result); + } + + [Fact] + public void Create_RtcLetterNotFound_Ok() + { + var slip = new RepoAccountProcessingSlip() + { + Letters = new List(), + Member = MakeMemberWithAddressInState("WI"), + ExistingRepoAccount = new RepoAccount() + { + RepoId = 5, + AccountNo = "123456-789", + Status = "O4R" + }, + UpdatedRepoAccount = new RepoAccount() + { + RepoId = 5, + AccountNo = "123456-789", + Status = "O4R", + Collaterals = new List + { + new Collateral + { + CollateralId = 1 + } + } + } + }; + var checker = new RtcLetterNotFoundChecker("RTC Letter", new List { "RTC 1", "RTC 3" }); + + var result = checker.CheckForAlert(slip); + + Assert.NotNull(result); + Assert.Equal("RTC Letter Not Found", result[0].Message); + Assert.Equal("123456-789", result[0].AccountNo); + Assert.Equal("Batch", result[0].CreatedBy); + Assert.InRange(result[0].DateAdded, DateTime.Now.AddSeconds(-1), DateTime.Now.AddSeconds(1)); + Assert.Equal(5, result[0].RepoId); + Assert.Null(result[0].MarkedReadBy); + Assert.Null(result[0].DateMarkedRead); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/SaleFundsReceivedCheckerTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/SaleFundsReceivedCheckerTest.cs new file mode 100644 index 0000000..09114e9 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/SaleFundsReceivedCheckerTest.cs @@ -0,0 +1,87 @@ +using System; +using System.Collections.Generic; +using LCU.API.Collections.RepoApi.DataAccess; +using LCU.API.Collections.RepoApi.Domain.AlertChecker; +using LCU.API.Collections.RepoApi.Domain.Processing; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.Consumer; +using Moq; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.AlertCheckers +{ + public class SaleFundsReceivedCheckerTest + { + private SaleFundsReceivedChecker _saleFundsReceivedChecker; + private List _transactions; + private readonly Mock _mockCoreDao; + + public SaleFundsReceivedCheckerTest() + { + _mockCoreDao = new Mock(); + } + + [Fact] + public void Creates_Alert_When_Description_Contains_Sub_string() + { + _mockCoreDao.Setup(service => service.RetrieveMemberAsync(It.IsAny())) + .ReturnsAsync( + new MemberDetail() + { + MemberId = 8675309 + } + ); + + _transactions = new List() + { + new CoreTransaction() + { + postingDate = DateTime.Now.AddDays(-2), + transactionTypeCode = "PRCT", + amount = 500, + runningBalance = 2000, + transactionTypeDescription = "Sale Of Test" + } + }; + _saleFundsReceivedChecker = new SaleFundsReceivedChecker(); + var slip = new RepoAccountProcessingSlip() + { + TransactionHistory = _transactions, + ExistingRepoAccount = new RepoAccount(), + UpdatedRepoAccount = new RepoAccount() + }; + + var result = _saleFundsReceivedChecker.CheckForAlert(slip); + + Assert.NotNull(result); + Assert.Equal("Sale Funds Received", result[0].Message); + } + + [Fact] + public void Does_Not_Create_Alert_When_Description_Does_Not_Contain_Sub_String() + { + _transactions = new List() + { + new CoreTransaction() + { + postingDate = DateTime.Now.AddDays(-2), + transactionTypeCode = "SHOULDFAILTYPECODE", + amount = 500, + runningBalance = 2000, + transactionTypeDescription = "Test" + } + }; + _saleFundsReceivedChecker = new SaleFundsReceivedChecker(); + var slip = new RepoAccountProcessingSlip() + { + TransactionHistory = _transactions, + ExistingRepoAccount = new RepoAccount(), + UpdatedRepoAccount = new RepoAccount() + }; + + var result = _saleFundsReceivedChecker.CheckForAlert(slip); + + Assert.Null(result); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/SkipEndCheckerTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/SkipEndCheckerTest.cs new file mode 100644 index 0000000..cf7b5f6 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/SkipEndCheckerTest.cs @@ -0,0 +1,115 @@ +using System; +using System.Collections.Generic; +using LCU.API.Collections.CollectionsApiLib.Models; +using LCU.API.Collections.RepoApi.Domain.AlertChecker; +using LCU.API.Collections.RepoApi.Domain.Processing; +using LCU.Shared.Collections.RepoApiLib.Models; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.AlertCheckers +{ + public class SkipEndCheckerTest + { + [Fact] + public void Create_SkipNotEnded_Ok() + { + var checker = new SkipEndChecker(91); + var originalRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "O4R" + }; + var updatedRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "O4R", + Collaterals = new List() + { + new Collateral + { + RepoCompanySelections = new List() + { + new RepoCompanySelection() + { + RepoType = RepoType.Skip + } + } + } + }, + RepoStatusChanges = new List() + { + new RepoStatusChange() + { + StatusFrom = "None", + StatusTo = "O4R", + ChangedDate = DateTime.Now.AddDays(-90) + } + } + }; + var slip = new RepoAccountProcessingSlip() + { + ExistingRepoAccount = originalRepoAccount, + UpdatedRepoAccount = updatedRepoAccount + }; + var result = checker.CheckForAlert(slip); + + Assert.Null(result); + } + + [Fact] + public void Create_SkipEnded_Ok() + { + var checker = new SkipEndChecker(91); + var originalRepoAccount = new RepoAccount() + { + RepoId = 1, + AccountNo = "123456-789", + Status = "O4R" + }; + var updatedRepoAccount = new RepoAccount() + { + RepoId = 1, + AccountNo = "123456-789", + Status = "O4R", + Collaterals = new List() + { + new Collateral + { + RepoCompanySelections = new List() + { + new RepoCompanySelection() + { + RepoType = RepoType.Skip + } + } + } + }, + RepoStatusChanges = new List() + { + new RepoStatusChange() + { + StatusFrom = "None", + StatusTo = "O4R", + ChangedDate = DateTime.Now.AddDays(-91) + } + } + }; + var slip = new RepoAccountProcessingSlip() + { + ExistingRepoAccount = originalRepoAccount, + UpdatedRepoAccount = updatedRepoAccount + }; + + var result = checker.CheckForAlert(slip); + + Assert.NotNull(result); + Assert.Equal("Skip Claim Ended", result[0].Message); + Assert.Equal("123456-789", result[0].AccountNo); + Assert.Equal("Batch", result[0].CreatedBy); + Assert.InRange(result[0].DateAdded, DateTime.Now.AddSeconds(-1), DateTime.Now.AddSeconds(1)); + Assert.Equal(1, result[0].RepoId); + Assert.Null(result[0].MarkedReadBy); + Assert.Null(result[0].DateMarkedRead); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/SkipNotPaidCheckerTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/SkipNotPaidCheckerTest.cs new file mode 100644 index 0000000..886798f --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/SkipNotPaidCheckerTest.cs @@ -0,0 +1,220 @@ +using System; +using System.Collections.Generic; +using LCU.API.Collections.CollectionsApiLib.Models; +using LCU.API.Collections.RepoApi.Domain.AlertChecker; +using LCU.API.Collections.RepoApi.Domain.Processing; +using LCU.Shared.Collections.RepoApiLib.Models; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.AlertCheckers +{ + public class SkipNotPaidCheckerTest + { + [Fact] + public void Create_TooFewDays_Ok() + { + var checker = new SkipNotPaidChecker(106, 15); + var originalRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "O4R" + }; + var updatedRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "O4R", + Collaterals = new List() + { + new Collateral + { + RepoCompanySelections = new List() + { + new RepoCompanySelection() + { + RepoType = RepoType.Skip + } + } + } + }, + RepoStatusChanges = new List() + { + new RepoStatusChange() + { + StatusFrom = "None", + StatusTo = "O4R", + ChangedDate = DateTime.Now.AddDays(-105) + } + } + }; + var slip = new RepoAccountProcessingSlip() + { + ExistingRepoAccount = originalRepoAccount, + UpdatedRepoAccount = updatedRepoAccount + }; + + var result = checker.CheckForAlert(slip); + + Assert.Null(result); + } + + [Fact] + public void Create_PaidSkip_Ok() + { + var checker = new SkipNotPaidChecker(106, 15); + var originalRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "O4R" + }; + var updatedRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "O4R", + SubStatus = "PSKP", + Collaterals = new List() + { + new Collateral + { + RepoCompanySelections = new List() + { + new RepoCompanySelection() + { + RepoType = RepoType.Skip + } + } + } + }, + RepoStatusChanges = new List() + { + new RepoStatusChange() + { + StatusFrom = "None", + StatusTo = "O4R", + ChangedDate = DateTime.Now.AddDays(-106) + } + } + }; + var slip = new RepoAccountProcessingSlip() + { + ExistingRepoAccount = originalRepoAccount, + UpdatedRepoAccount = updatedRepoAccount + }; + + var result = checker.CheckForAlert(slip); + + Assert.Null(result); + } + + [Fact] + public void Create_SkipNotPaid_Ok() + { + var checker = new SkipNotPaidChecker(106); + var originalRepoAccount = new RepoAccount() + { + RepoId = 4, + AccountNo = "123456-789", + Status = "O4R" + }; + var updatedRepoAccount = new RepoAccount() + { + RepoId = 4, + AccountNo = "123456-789", + Status = "O4R", + Collaterals = new List() + { + new Collateral + { + RepoCompanySelections = new List() + { + new RepoCompanySelection() + { + RepoType = RepoType.Skip + } + } + } + }, + RepoStatusChanges = new List() + { + new RepoStatusChange() + { + StatusFrom = "None", + StatusTo = "O4R", + ChangedDate = DateTime.Now.AddDays(-106) + } + } + }; + var slip = new RepoAccountProcessingSlip() + { + ExistingRepoAccount = originalRepoAccount, + UpdatedRepoAccount = updatedRepoAccount + }; + + var result = checker.CheckForAlert(slip); + + Assert.NotNull(result); + Assert.Equal("Skip Not Paid", result[0].Message); + Assert.Equal("123456-789", result[0].AccountNo); + Assert.Equal("Batch", result[0].CreatedBy); + Assert.InRange(result[0].DateAdded, DateTime.Now.AddSeconds(-1), DateTime.Now.AddSeconds(1)); + Assert.Equal(4, result[0].RepoId); + Assert.Null(result[0].MarkedReadBy); + Assert.Null(result[0].DateMarkedRead); + } + + [Fact] + public void Create_SkipNotPaidRepeating_Ok() + { + var checker = new SkipNotPaidChecker(106, 15); + var originalRepoAccount = new RepoAccount() + { + RepoId = 5, + AccountNo = "123456-789", + Status = "O4R" + }; + var updatedRepoAccount = new RepoAccount() + { + RepoId = 5, + AccountNo = "123456-789", + Status = "O4R", + Collaterals = new List() + { + new Collateral + { + RepoCompanySelections = new List() + { + new RepoCompanySelection() + { + RepoType = RepoType.Skip + } + } + } + }, + RepoStatusChanges = new List() + { + new RepoStatusChange() + { + StatusFrom = "None", + StatusTo = "O4R", + ChangedDate = DateTime.Now.AddDays(-121) + } + } + }; + var slip = new RepoAccountProcessingSlip() + { + ExistingRepoAccount = originalRepoAccount, + UpdatedRepoAccount = updatedRepoAccount + }; + + var result = checker.CheckForAlert(slip); + + Assert.NotNull(result); + Assert.Equal("Skip Not Paid", result[0].Message); + Assert.Equal("123456-789", result[0].AccountNo); + Assert.Equal("Batch", result[0].CreatedBy); + Assert.InRange(result[0].DateAdded, DateTime.Now.AddSeconds(-1), DateTime.Now.AddSeconds(1)); + Assert.Equal(5, result[0].RepoId); + Assert.Null(result[0].MarkedReadBy); + Assert.Null(result[0].DateMarkedRead); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/SkipPaidCheckerTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/SkipPaidCheckerTest.cs new file mode 100644 index 0000000..49acc9f --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/SkipPaidCheckerTest.cs @@ -0,0 +1,69 @@ +using System; +using System.Collections.Generic; +using LCU.API.Collections.RepoApi.Domain.AlertChecker; +using LCU.API.Collections.RepoApi.Domain.Processing; +using LCU.Shared.Collections.RepoApiLib.Models; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.AlertCheckers +{ + public class SkipPaidCheckerTest + { + [Fact] + public void Create_Ok() + { + var checker = new SkipPaidChecker(); // 106, 15 + var originalRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "O4R" + }; + var updatedRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + SubStatus = SkipPaidChecker.RepoSubStatusPaidSkip, + Status = "O4R", + Collaterals = new List(), + RepoStatusChanges = new List() + { + new RepoStatusChange() + { + StatusFrom = "None", + StatusTo = "O4R", + ChangedDate = DateTime.Now.AddDays(-105) + } + } + }; + var slip = new RepoAccountProcessingSlip() + { + ExistingRepoAccount = originalRepoAccount, + UpdatedRepoAccount = updatedRepoAccount + }; + + var result = checker.CheckForAlert(slip); + + Assert.Equal(updatedRepoAccount.SubStatus, updatedRepoAccount.Status); + Assert.NotNull(result); + } + + [Fact] + public void DoNotThrowOnNull() + { + var checker = new SkipPaidChecker(); // 106, 15 + var originalRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "O4R" + }; + + var slip = new RepoAccountProcessingSlip() + { + ExistingRepoAccount = originalRepoAccount, + UpdatedRepoAccount = null + }; + + var result = checker.CheckForAlert(slip); + Assert.Null(result); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/SoldNoProceedsCheckerTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/SoldNoProceedsCheckerTest.cs new file mode 100644 index 0000000..f7b12f8 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/SoldNoProceedsCheckerTest.cs @@ -0,0 +1,175 @@ +using System; +using System.Collections.Generic; +using LCU.API.Collections.RepoApi.Domain.AlertChecker; +using LCU.API.Collections.RepoApi.Domain.Processing; +using LCU.Shared.Collections.RepoApiLib.Models; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.AlertCheckers +{ + public class SoldNoProceedsCheckerTest + { + private readonly SoldNoProceedsChecker _soldNoProceedsChecker; + + public SoldNoProceedsCheckerTest() + { + _soldNoProceedsChecker = new SoldNoProceedsChecker(); + } + + [Fact] + public void Sold_No_Proceeds_Created_Ok() + { + var updatedRepoAccount = new RepoAccount() + { + Collaterals = new List() + { + new Collateral() + { + AuctionAssignmentToCollaterals = new List() + { + new AuctionAssignmentToCollateral() + { + AuctionAssignmentId = 1, + CollateralId = 1 + } + } + } + } + }; + var slip = new RepoAccountProcessingSlip() + { + AuctionAssignments = new List() + { + new AuctionAssignment() + { + AutoIMS = new ImsAutoFileData() + { + SoldDate = DateTime.Now.AddDays(-6) + } + } + }, + ExistingRepoAccount = new RepoAccount(), + UpdatedRepoAccount = updatedRepoAccount + }; + + var result = _soldNoProceedsChecker.CheckForAlert(slip); + + Assert.NotNull(result); + Assert.Equal("Sold No Proceeds", result[0].Message); + } + + [Fact] + public void Sold_No_Proceeds_Not_Created_Funds_Sent() + { + var updatedRepoAccount = new RepoAccount() + { + Collaterals = new List() + { + new Collateral() + { + AuctionAssignmentToCollaterals = new List() + { + new AuctionAssignmentToCollateral() + { + AuctionAssignmentId = 1, + CollateralId = 1 + } + } + } + } + }; + var slip = new RepoAccountProcessingSlip() + { + AuctionAssignments = new List() + { + new AuctionAssignment() + { + AutoIMS = new ImsAutoFileData() + { + SoldDate = DateTime.Now.AddDays(-6), + FundsSent = DateTime.Now.AddDays(-2) + } + } + }, + ExistingRepoAccount = new RepoAccount(), + UpdatedRepoAccount = updatedRepoAccount + }; + + var result = _soldNoProceedsChecker.CheckForAlert(slip); + + Assert.Null(result); + } + + [Fact] + public void Sold_No_Proceeds_Not_Created_SoldDate_Null() + { + var updatedRepoAccount = new RepoAccount() + { + Collaterals = new List() + { + new Collateral() + { + AuctionAssignmentToCollaterals = new List() + { + new AuctionAssignmentToCollateral() + { + AuctionAssignmentId = 1, + CollateralId = 1 + } + } + } + } + }; + var slip = new RepoAccountProcessingSlip() + { + AuctionAssignments = new List() + { + new AuctionAssignment() + { + AutoIMS = new ImsAutoFileData() + { + FundsSent = DateTime.Now.AddDays(-2) + } + } + }, + ExistingRepoAccount = new RepoAccount(), + UpdatedRepoAccount = updatedRepoAccount + }; + + var result = _soldNoProceedsChecker.CheckForAlert(slip); + + Assert.Null(result); + } + + [Fact] + public void Sold_No_Proceeds_Not_Created_No_AuctionAssignments() + { + var updatedRepoAccount = new RepoAccount() + { + Collaterals = new List() + { + new Collateral() + } + }; + var slip = new RepoAccountProcessingSlip() + { + AuctionAssignments = new List() + { + new AuctionAssignment() + { + AutoIMS = new ImsAutoFileData() + { + FundsSent = DateTime.Now.AddDays(-2) + } + } + }, + ExistingRepoAccount = new RepoAccount(), + UpdatedRepoAccount = updatedRepoAccount + }; + + var result = _soldNoProceedsChecker.CheckForAlert(slip); + + Assert.Null(result); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/StatusChangeCheckerTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/StatusChangeCheckerTest.cs new file mode 100644 index 0000000..9fd5c66 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/StatusChangeCheckerTest.cs @@ -0,0 +1,148 @@ +using System; +using System.Collections.Generic; +using LCU.API.Collections.RepoApi.Domain.AlertChecker; +using LCU.API.Collections.RepoApi.Domain.Processing; +using LCU.Shared.Collections.RepoApiLib.Models; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.AlertCheckers +{ + public class StatusChangeCheckerTest + { + [Fact] + public void Create_StatusIsUnchanged_Ok() + { + var checker = new StatusChangeChecker("RECA"); + var originalRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "RECA" + }; + var updatedRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "RECA" + }; + var slip = new RepoAccountProcessingSlip() + { + ExistingRepoAccount = originalRepoAccount, + UpdatedRepoAccount = updatedRepoAccount + }; + + var result = checker.CheckForAlert(slip); + + Assert.Null(result); + } + + [Fact] + public void Create_StatusIsReca_Ok() + { + var checker = new StatusChangeChecker("RECA"); + var originalRepoAccount = new RepoAccount() + { + RepoId = 2, + AccountNo = "123456-789", + Status = "REPO" + }; + var updatedRepoAccount = new RepoAccount() + { + RepoId = 2, + AccountNo = "123456-789", + Status = "RECA" + }; + var slip = new RepoAccountProcessingSlip() + { + ExistingRepoAccount = originalRepoAccount, + UpdatedRepoAccount = updatedRepoAccount + }; + + var result = checker.CheckForAlert(slip); + + Assert.NotNull(result); + Assert.Equal("Status Changed to RECA", result[0].Message); + Assert.Equal("Previously REPO. I confirm that I have updated the Status to RECA in RDN.", + result[0].SubMessage); + Assert.Equal("123456-789", result[0].AccountNo); + Assert.Equal("Batch", result[0].CreatedBy); + Assert.InRange(result[0].DateAdded, DateTime.Now.AddSeconds(-1), DateTime.Now.AddSeconds(1)); + Assert.Equal(2, result[0].RepoId); + Assert.Null(result[0].MarkedReadBy); + Assert.Null(result[0].DateMarkedRead); + } + + [Fact] + public void Create_StatusIsReho_Ok() + { + var checker = new StatusChangeChecker("REHO"); + var originalRepoAccount = new RepoAccount() + { + RepoId = 2, + AccountNo = "123456-789", + Status = "REPO" + }; + var updatedRepoAccount = new RepoAccount() + { + RepoId = 2, + AccountNo = "123456-789", + Status = "REHO" + }; + var slip = new RepoAccountProcessingSlip() + { + ExistingRepoAccount = originalRepoAccount, + UpdatedRepoAccount = updatedRepoAccount + }; + + var result = checker.CheckForAlert(slip); + + Assert.NotNull(result); + Assert.Equal("Status Changed to REHO", result[0].Message); + Assert.Equal("Previously REPO. I confirm that I have updated the Status to REHO in RDN.", + result[0].SubMessage); + Assert.Equal("123456-789", result[0].AccountNo); + Assert.Equal("Batch", result[0].CreatedBy); + Assert.InRange(result[0].DateAdded, DateTime.Now.AddSeconds(-1), DateTime.Now.AddSeconds(1)); + Assert.Equal(2, result[0].RepoId); + Assert.Null(result[0].MarkedReadBy); + Assert.Null(result[0].DateMarkedRead); + } + + [Fact] + public void Create_StatusFromO4rToBlank_Ok() + { + var DefaultNoStatusIntellec = "NO STATUS INTELLEC"; + + + var checker = new StatusChangeChecker(DefaultNoStatusIntellec, new List() { "O4R", "REPO" }); + var originalRepoAccount = new RepoAccount() + { + RepoId = 2, + AccountNo = "123456-789", + Status = "O4R" + }; + var updatedRepoAccount = new RepoAccount() + { + RepoId = 2, + AccountNo = "123456-789", + Status = DefaultNoStatusIntellec + }; + var slip = new RepoAccountProcessingSlip() + { + ExistingRepoAccount = originalRepoAccount, + UpdatedRepoAccount = updatedRepoAccount + }; + + var result = checker.CheckForAlert(slip); + + Assert.NotNull(result); + Assert.Equal("Status Changed to " + DefaultNoStatusIntellec, result[0].Message); + Assert.Equal("Previously O4R. I confirm that I have updated the Status to NO STATUS INTELLEC in RDN.", + result[0].SubMessage); + Assert.Equal("123456-789", result[0].AccountNo); + Assert.Equal("Batch", result[0].CreatedBy); + Assert.InRange(result[0].DateAdded, DateTime.Now.AddSeconds(-1), DateTime.Now.AddSeconds(1)); + Assert.Equal(2, result[0].RepoId); + Assert.Null(result[0].MarkedReadBy); + Assert.Null(result[0].DateMarkedRead); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/TimeInStatusCheckerTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/TimeInStatusCheckerTest.cs new file mode 100644 index 0000000..6f2d7a5 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/TimeInStatusCheckerTest.cs @@ -0,0 +1,168 @@ +using System; +using System.Collections.Generic; +using LCU.API.Collections.RepoApi.Domain.AlertChecker; +using LCU.API.Collections.RepoApi.Domain.Processing; +using LCU.Shared.Collections.RepoApiLib.Models; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.AlertCheckers +{ + public class TimeInStatusCheckerTest + { + [Fact] + public void Create_TooFewDays_Ok() + { + var checker = new TimeInStatusChecker("REHO", 30, 30); + var originalRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "REHO" + }; + var updatedRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "REHO", + RepoStatusChanges = new List() + { + new RepoStatusChange() + { + StatusFrom = "None", + StatusTo = "REHO", + ChangedDate = DateTime.Now.AddDays(-29) + } + } + }; + var slip = new RepoAccountProcessingSlip() + { + ExistingRepoAccount = originalRepoAccount, + UpdatedRepoAccount = updatedRepoAccount + }; + + + var result = checker.CheckForAlert(slip); + + Assert.Null(result); + } + + [Fact] + public void Create_30DaysInReho_Ok() + { + var checker = new TimeInStatusChecker("REHO", 30, 30); + var originalRepoAccount = new RepoAccount() + { + RepoId = 9, + AccountNo = "123456-789", + Status = "REHO" + }; + var updatedRepoAccount = new RepoAccount() + { + RepoId = 9, + AccountNo = "123456-789", + Status = "REHO", + RepoStatusChanges = new List() + { + new RepoStatusChange() + { + StatusFrom = "None", + StatusTo = "REHO", + ChangedDate = DateTime.Now.AddDays(-30) + } + } + }; + var slip = new RepoAccountProcessingSlip() + { + ExistingRepoAccount = originalRepoAccount, + UpdatedRepoAccount = updatedRepoAccount + }; + + + var result = checker.CheckForAlert(slip); + + Assert.NotNull(result); + Assert.Equal("30 days in REHO", result[0].Message); + Assert.Equal("123456-789", result[0].AccountNo); + Assert.Equal("Batch", result[0].CreatedBy); + Assert.InRange(result[0].DateAdded, DateTime.Now.AddSeconds(-1), DateTime.Now.AddSeconds(1)); + Assert.Equal(9, result[0].RepoId); + Assert.Null(result[0].MarkedReadBy); + Assert.Null(result[0].DateMarkedRead); + } + + [Fact] + public void Create_30DaysInRehoRepeat_Ok() + { + var checker = new TimeInStatusChecker("REHO", 30, 30); + var originalRepoAccount = new RepoAccount() + { + RepoId = 9, + AccountNo = "123456-789", + Status = "REHO" + }; + var updatedRepoAccount = new RepoAccount() + { + RepoId = 9, + AccountNo = "123456-789", + Status = "REHO", + RepoStatusChanges = new List() + { + new RepoStatusChange() + { + StatusFrom = "None", + StatusTo = "REHO", + ChangedDate = DateTime.Now.AddDays(-60) + } + } + }; + var slip = new RepoAccountProcessingSlip() + { + ExistingRepoAccount = originalRepoAccount, + UpdatedRepoAccount = updatedRepoAccount + }; + + var result = checker.CheckForAlert(slip); + + Assert.NotNull(result); + Assert.Equal("60 days in REHO", result[0].Message); + Assert.Equal("123456-789", result[0].AccountNo); + Assert.Equal("Batch", result[0].CreatedBy); + Assert.InRange(result[0].DateAdded, DateTime.Now.AddSeconds(-1), DateTime.Now.AddSeconds(1)); + Assert.Equal(9, result[0].RepoId); + Assert.Null(result[0].MarkedReadBy); + Assert.Null(result[0].DateMarkedRead); + } + + [Fact] + public void Create_45DaysInRehoNull_Ok() + { + var checker = new TimeInStatusChecker("REHO", 30, 30); + var originalRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "REHO" + }; + var updatedRepoAccount = new RepoAccount() + { + AccountNo = "123456-789", + Status = "REHO", + RepoStatusChanges = new List() + { + new RepoStatusChange() + { + StatusFrom = "None", + StatusTo = "REHO", + ChangedDate = DateTime.Now.AddDays(-45) + } + } + }; + var slip = new RepoAccountProcessingSlip() + { + ExistingRepoAccount = originalRepoAccount, + UpdatedRepoAccount = updatedRepoAccount + }; + + var result = checker.CheckForAlert(slip); + + Assert.Null(result); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/TransactionHistoryCheckerTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/TransactionHistoryCheckerTest.cs new file mode 100644 index 0000000..f9e6662 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/TransactionHistoryCheckerTest.cs @@ -0,0 +1,96 @@ +using System; +using System.Collections.Generic; +using LCU.API.Collections.RepoApi.Domain.AlertChecker; +using LCU.API.Collections.RepoApi.Domain.Processing; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.Consumer; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.AlertCheckers +{ + public class TransactionHistoryCheckerTest + { + private DummyTransactionChecker _transactionHistoryChecker; + + [Fact] + public void Does_Not_Create_Alert_When_Posting_Date_Is_Too_old() + { + var transactions = new List() + { + new CoreTransaction() + { + postingDate = DateTime.Now.AddDays(-5), + transactionTypeCode = "TEST" + } + }; + _transactionHistoryChecker = new DummyTransactionChecker(); + var slip = new RepoAccountProcessingSlip() + { + TransactionHistory = transactions, + ExistingRepoAccount = new RepoAccount(), + UpdatedRepoAccount = new RepoAccount() + }; + + var result = _transactionHistoryChecker.CheckForAlert(slip); + + Assert.Null(result); + } + + [Fact] + public void Does_Not_Create_Alert_When_Transaction_Type_Is_Wrong() + { + var transactions = new List() + { + new CoreTransaction() + { + postingDate = DateTime.Now.AddDays(-1), + transactionTypeCode = "WRONGTYPE", + } + }; + _transactionHistoryChecker = new DummyTransactionChecker(); + var slip = new RepoAccountProcessingSlip() + { + TransactionHistory = transactions, + ExistingRepoAccount = new RepoAccount(), + UpdatedRepoAccount = new RepoAccount() + }; + var result = _transactionHistoryChecker.CheckForAlert(slip); + + Assert.Null(result); + } + + [Fact] + public void Test_Formatted_Message() + { + var transactions = new List() + { + new CoreTransaction() + { + postingDate = DateTime.Now.AddDays(-5), + } + }; + _transactionHistoryChecker = new DummyTransactionChecker(); + var result = TransactionHistoryChecker.FormatTransactionMessage(new CoreTransaction() + { + postingDate = DateTime.Parse("1941-12-07"), + amount = 248.49M, + runningBalance = 2398.05M, + transactionTypeDescription = "Test", + transactionTypeCode = "TEST" + }); + + var expectedMessage = + "Transaction Type: \"TEST\" | Posting: 12/7/1941 12:00:00 AM | Transaction: $248.49 | Balance: $2,398.05 | Description: \"Test\""; + Assert.Equal(expectedMessage, result); + } + } + + internal class DummyTransactionChecker : TransactionHistoryChecker + { + public override List CheckForAlert(RepoAccountProcessingSlip slip) + { + var result = GetRecentTransactionsFromType(new List { "TEST TRANSACTION" }, slip.TransactionHistory); + return result != null ? new List { new EventAlert() } : null; + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/CollectionsJsonFileDataAttribute.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/CollectionsJsonFileDataAttribute.cs new file mode 100644 index 0000000..092d5a0 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/CollectionsJsonFileDataAttribute.cs @@ -0,0 +1,75 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Reflection; +using LCU.API.Collections.CollectionsApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using Xunit.Sdk; + +namespace LCU.API.Collections.RepoApiTests +{ + public class RepoUpdateTestRow + { + public TemenosAccount CollectionAccount { get; set; } + public TemenosCase CollectionCase { get; set; } + public RepoAccount ExistingRepoAccount { get; set; } + public RepoAccount NewRepoAccount { get; set; } + + } + + public class CollectionsJsonFileDataAttribute : DataAttribute + { + private readonly string _filePath; + private readonly string _propertyName; + + /// + /// Load data from a JSON file as the data source for a theory + /// + /// The absolute or relative path to the JSON file to load + public CollectionsJsonFileDataAttribute(string filePath) + : this(filePath, null) { } + + /// + /// Load data from a JSON file as the data source for a theory + /// + /// The absolute or relative path to the JSON file to load + /// The name of the property on the JSON file that contains the data for the test + public CollectionsJsonFileDataAttribute(string filePath, string propertyName) + { + _filePath = filePath; + _propertyName = propertyName; + } + + /// + public override IEnumerable GetData(MethodInfo testMethod) + { + if (testMethod == null) { throw new ArgumentNullException(nameof(testMethod)); } + + // Get the absolute path to the JSON file + var path = Path.IsPathRooted(_filePath) + ? _filePath + : Path.GetRelativePath(Directory.GetCurrentDirectory(), _filePath); + + if (!File.Exists(path)) + { + throw new ArgumentException($"Could not find file at path: {path}"); + } + + // Load the file + var fileData = File.ReadAllText(_filePath); + + if (string.IsNullOrEmpty(_propertyName)) + { + //whole file is the data + return JsonConvert.DeserializeObject>(fileData); + } + + // Only use the specified property as the data + var allData = JObject.Parse(fileData); + var data = allData[_propertyName]; + return data.ToObject>(); + } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Controllers/AuctionAssignmentControllerTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Controllers/AuctionAssignmentControllerTest.cs new file mode 100644 index 0000000..2a892cd --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Controllers/AuctionAssignmentControllerTest.cs @@ -0,0 +1,120 @@ +using System.Collections.Generic; +using LCU.API.Collections.RepoApi.Controllers; +using LCU.API.Collections.RepoApi.Models.Filters; +using LCU.API.Collections.RepoApi.Models.Requests; +using LCU.API.Collections.RepoApi.Models.Responses; +using LCU.API.Collections.RepoApi.Services; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.Results; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Moq; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.Controllers +{ + public class AuctionAssignmentControllerTest + { + private readonly AuctionAssignmentController controller; + private readonly Mock mockAuctionAssignmentServiceService; + private readonly Mock mockloorPricingService; + private readonly Mock mockHttpContextAccessor; + + public AuctionAssignmentControllerTest() + { + mockAuctionAssignmentServiceService = new Mock(); + mockloorPricingService = new Mock(); + mockHttpContextAccessor = new Mock(); + controller = new AuctionAssignmentController( + mockAuctionAssignmentServiceService.Object, + mockloorPricingService.Object, + mockHttpContextAccessor.Object + ); + } + + [Fact] + public async void Get_OK() + { + mockAuctionAssignmentServiceService.Setup(service => service.ListByFilterAsync(It.IsAny())).ReturnsAsync( + new PagedResult() + { + Total = 1, + Items = new List() + { + new AuctionAssignment() + } + }); + + var filter = new AuctionAssignmentFilter(); + var result = await controller.Get(filter); + Assert.NotNull(result); + + var okResult = result as OkObjectResult; + Assert.NotNull(okResult); + Assert.Equal(200, okResult.StatusCode); + + var okValue = okResult.Value as PagedResponse; + Assert.NotNull(okValue); + Assert.Equal(1, okValue.TotalItems); + mockAuctionAssignmentServiceService.Verify(x => x.ListByFilterAsync(It.IsAny()), Times.Once); + } + + [Fact] + public async void Post_OK() + { + mockAuctionAssignmentServiceService.Setup(service => service.SaveAsync(It.IsAny())).ReturnsAsync( + new AuctionAssignmentPostRequest() + { + AuctionAssignment = new AuctionAssignment() + { + CollateralVIN = "abcde", + } + }); + + //var controller = new AuctionAssignmentController(mockService.Object, mockAutoIms.Object); + var result = await controller.Post(new AuctionAssignmentPostRequest() + { + Collaterals = new List + { + new Collateral() + } + }); + Assert.NotNull(result); + + var okResult = result as OkObjectResult; + Assert.NotNull(okResult); + Assert.Equal(200, okResult.StatusCode); + + var okValue = okResult.Value as AuctionAssignmentPostRequest; + Assert.NotNull(okValue); + Assert.Equal("abcde", okValue.AuctionAssignment.CollateralVIN); + mockAuctionAssignmentServiceService.Verify(x => x.SaveAsync(It.IsAny()), Times.Once); + } + + [Fact] + public async void Bad_GetById_Fails() + { + var result = await controller.GetById(0); + Assert.NotNull(result); + + var badRequest = result as BadRequestObjectResult; + Assert.NotNull(badRequest); + Assert.Equal(400, badRequest.StatusCode); + } + + [Fact] + public async void Put_IdMismatch_Fails() + { + var auctionAssignmentToPut = new AuctionAssignment() + { + ID = 2 + }; + var result = await controller.Put(1, auctionAssignmentToPut); + Assert.NotNull(result); + + var badRequest = result as BadRequestObjectResult; + Assert.NotNull(badRequest); + Assert.Equal(400, badRequest.StatusCode); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Controllers/AuctionHouseControllerTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Controllers/AuctionHouseControllerTest.cs new file mode 100644 index 0000000..09184f9 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Controllers/AuctionHouseControllerTest.cs @@ -0,0 +1,105 @@ +using System.Collections.Generic; +using LCU.API.Collections.RepoApi.Controllers; +using LCU.API.Collections.RepoApi.Services; +using LCU.Shared.Collections.RepoApiLib.Models; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Moq; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.Controllers +{ + public class AuctionHouseControllerTest + { + private readonly Mock mockAuctionHouseService; + private readonly AuctionHouseController controller; + private readonly Mock mockHttpContextAccessor; + + public AuctionHouseControllerTest() + { + mockAuctionHouseService = new Mock(); + mockHttpContextAccessor = new Mock(); + controller = new AuctionHouseController(mockAuctionHouseService.Object, + mockHttpContextAccessor.Object); + } + + [Fact] + public async void Get_OK() + { + // arrange + mockAuctionHouseService.Setup(service => service.ListAllAsync()).ReturnsAsync(new List() + { + new AuctionHouse() + { + Name = "Auction House A" + } + }); + + // act + var result = await controller.Get(); + Assert.NotNull(result); + var okResult = result as OkObjectResult; + + // assert + Assert.NotNull(okResult); + Assert.Equal(200, okResult.StatusCode); + + var okValue = okResult.Value as IEnumerable; + Assert.NotNull(okValue); + + var enumerator = okValue.GetEnumerator(); + enumerator.MoveNext(); + Assert.NotNull(enumerator.Current); + Assert.Equal("Auction House A", enumerator.Current.Name); + } + + [Fact] + public async void Post_OK() + { + // arrange + mockAuctionHouseService.Setup(service => service.SaveAsync(It.IsAny())).ReturnsAsync( + new AuctionHouse() + { + Name = "Auction House A" + }); + + // act + var result = await controller.Post(new AuctionHouse() + { + Name = "Auction House A" + }); + Assert.NotNull(result); + var okResult = result as OkObjectResult; + + // assert + Assert.NotNull(okResult); + Assert.Equal(200, okResult.StatusCode); + + var okValue = okResult.Value as AuctionHouse; + Assert.NotNull(okValue); + Assert.Equal("Auction House A", okValue.Name); + } + + [Fact] + public async void Put_Bad_Request() + { + // arrange + mockAuctionHouseService.Setup(service => service.UpdateAsync(It.IsAny())) + .ReturnsAsync(new AuctionHouse()); + + // act + var result = await controller.Put("ID1", new AuctionHouse() + { + AuctionID = "ID2" + }); + + + // assert + Assert.NotNull(result); + var badRequestResult = result as BadRequestObjectResult; + + Assert.NotNull(badRequestResult); + Assert.Equal(StatusCodes.Status400BadRequest, badRequestResult.StatusCode); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Controllers/AuditRecordControllerTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Controllers/AuditRecordControllerTest.cs new file mode 100644 index 0000000..12a0299 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Controllers/AuditRecordControllerTest.cs @@ -0,0 +1,114 @@ +using System.Collections.Generic; +using LCU.API.Collections.RepoApi.Controllers; +using LCU.API.Collections.RepoApi.Models.Filters; +using LCU.API.Collections.RepoApi.Models.Responses; +using LCU.API.Collections.RepoApi.Services; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.Results; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Moq; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.Controllers +{ + public class AuditRecordControllerTest + { + private readonly Mock mockAuditRecordService; + private readonly AuditRecordController controller; + private readonly Mock mockHttpContextAccessor; + + public AuditRecordControllerTest() + { + mockAuditRecordService = new Mock(); + mockHttpContextAccessor = new Mock(); + controller = new AuditRecordController(mockAuditRecordService.Object, + mockHttpContextAccessor.Object); + } + + // Get tests + [Fact] + public async void Get_OK() + { + mockAuditRecordService.Setup(service => service.ListAll(It.IsAny())).ReturnsAsync( + new PagedResult() + { + Total = 1, + Items = new List() + { + new AuditRecord() + { + Action = "action", + ClassName = "Something", + Description = "changed something field 1", + PerformedBy = "Developer", + KeyRepresentation = "111" + } + } + }); + + // arrange + var filter = new PageFilter(); + + // act + var result = await controller.Get(filter); + Assert.NotNull(result); + var okResult = result as OkObjectResult; + + // assert + Assert.NotNull(okResult); + Assert.Equal(200, okResult.StatusCode); + + var okValue = okResult.Value as PagedResponse; + Assert.NotNull(okValue); + Assert.Equal(1, okValue.TotalItems); + } + + // Post tests + [Fact] + public async void Post_OK() + { + // arrange + var postAudit = new AuditRecord() + { + Action = "action", + ClassName = "Something", + Description = "changed something field 1", + PerformedBy = "Developer", + KeyRepresentation = "111" + }; + + // act + var result = await controller.Post(postAudit); + Assert.NotNull(result); + var okResult = result as OkObjectResult; + + // assert + Assert.NotNull(okResult); + Assert.Equal(200, okResult.StatusCode); + } + + [Fact] + public async void Post_Bad_Request() + { + // arrange + var postAudit = new AuditRecord() + { + Action = "action", + ClassName = "Something", + Description = "changed something field 1", + KeyRepresentation = "111" + }; + controller.ModelState.AddModelError("PerformedBy", "The performed by field is required."); + + // act + var result = await controller.Post(postAudit); + Assert.NotNull(result); + var badRequestResult = result as BadRequestObjectResult; + + // assert + Assert.NotNull(badRequestResult); + Assert.Equal(StatusCodes.Status400BadRequest, badRequestResult.StatusCode); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Controllers/CollateralControllerTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Controllers/CollateralControllerTest.cs new file mode 100644 index 0000000..fa80017 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Controllers/CollateralControllerTest.cs @@ -0,0 +1,125 @@ +using System.Collections.Generic; +using System.Linq; +using LCU.API.Collections.RepoApi.Controllers; +using LCU.API.Collections.RepoApi.Services; +using LCU.Shared.Collections.RepoApiLib.Models; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Moq; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.Controllers +{ + public class CollateralControllerTest + { + private readonly Mock mockCollateralService; + private readonly CollateralController controller; + private readonly Mock mockHttpContextAccessor; + + public CollateralControllerTest() + { + mockCollateralService = new Mock(); + mockHttpContextAccessor = new Mock(); + controller = new CollateralController(mockCollateralService.Object, + mockHttpContextAccessor.Object); + } + + // Get tests + [Fact] + public async void Get_OK() + { + // arrange + var collateral = new List + { + new Collateral() + { + CollateralId = 1234567, + RepoId = 2345678 + } + }; + mockCollateralService.Setup(x => x.ListAll()).ReturnsAsync(collateral); + + // act + var result = await controller.Get(); + Assert.NotNull(result); + var okResult = result as OkObjectResult; + + // assert + Assert.NotNull(okResult); + Assert.Equal(200, okResult.StatusCode); + + var okValue = okResult.Value as IEnumerable; + Assert.NotNull(okValue); + Assert.True(collateral.SequenceEqual(okValue)); + } + + [Fact] + public async void GetById_OK() + { + // arrange + var repos = new List + { + new Collateral() + { + CollateralId = 1234567, + RepoId = 2345678 + } + }; + mockCollateralService.Setup(x => x.Get(It.IsAny())).ReturnsAsync(repos.First()); + + // act + var result = await controller.GetById(1234567); + Assert.NotNull(result); + var okResult = result as OkObjectResult; + + // assert + Assert.NotNull(okResult); + Assert.Equal(200, okResult.StatusCode); + + var okValue = okResult.Value as Collateral; + Assert.NotNull(okValue); + Assert.Equal(2345678, okValue.RepoId); + } + + // Post tests + [Fact] + public async void Post_OK() + { + // arrange + var postCollateral = new Collateral() + { + CollateralId = 1234567, + RepoId = 2345678 + }; + + // act + var result = await controller.Post(postCollateral); + Assert.NotNull(result); + var okResult = result as OkObjectResult; + + // assert + Assert.NotNull(okResult); + Assert.Equal(200, okResult.StatusCode); + } + + [Fact] + public async void Post_Bad_Request() + { + // arrange + var postCollateral = new Collateral() + { + CollateralId = 1234567, + }; + controller.ModelState.AddModelError("Message", "The message field is required."); + + // act + var result = await controller.Post(postCollateral); + Assert.NotNull(result); + var badRequestResult = result as BadRequestObjectResult; + + // assert + Assert.NotNull(badRequestResult); + Assert.Equal(StatusCodes.Status400BadRequest, badRequestResult.StatusCode); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Controllers/EventAlertControllerTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Controllers/EventAlertControllerTest.cs new file mode 100644 index 0000000..de9b758 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Controllers/EventAlertControllerTest.cs @@ -0,0 +1,252 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Controllers; +using LCU.API.Collections.RepoApi.Services; +using LCU.Shared.Collections.RepoApiLib.Exceptions; +using LCU.Shared.Collections.RepoApiLib.Models; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Moq; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.Controllers +{ + public class EventAlertControllerTest + { + private readonly EventAlertController controller; + private readonly Mock mockEventAlertService; + private readonly Mock mockRepoService; + private readonly Mock mockHttpContextAccessor; + + public EventAlertControllerTest() + { + mockEventAlertService = new Mock(); + mockRepoService = new Mock(); + mockHttpContextAccessor = new Mock(); + controller = new EventAlertController(mockEventAlertService.Object, + mockRepoService.Object, mockHttpContextAccessor.Object); + } + + // Get tests + [Fact] + public async void Get_OK() + { + // arrange + var alerts = new List + { + new EventAlert() + { + AccountNo = "1234567-98", + Message = "Status is O4R" + } + }; + mockEventAlertService.Setup(x => x.ListAll()).ReturnsAsync(alerts); + + // act + var result = await controller.Get(); + Assert.NotNull(result); + var okResult = result as OkObjectResult; + + // assert + Assert.NotNull(okResult); + Assert.Equal(200, okResult.StatusCode); + + var okValue = okResult.Value as IEnumerable; + Assert.NotNull(okValue); + Assert.True(alerts.SequenceEqual(okValue)); + } + + [Fact] + public async void Get_UnreadOnly_OK() + { + // arrange + var expected = new EventAlert() + { + AccountNo = "1234567-99", + Message = "Status is O4R" + }; + mockEventAlertService.Setup(x => x.ListUnread()).ReturnsAsync(new List {expected}); + + // act + var result = await controller.Get(unreadOnly: true); + Assert.NotNull(result); + var okResult = result as OkObjectResult; + + // assert + Assert.NotNull(okResult); + Assert.Equal(200, okResult.StatusCode); + + var okValue = okResult.Value as IEnumerable; + Assert.NotNull(okValue); + Assert.Single(okValue); + Assert.Equal(expected, okValue.First()); + } + + [Fact] + public async void Get_ActionNeeded_OK() + { + // arrange + var expected = new EventAlert() + { + AccountNo = "1234567-90", + Message = "Status is O4R" + }; + mockEventAlertService.Setup(x => x.ListActionNeeded()).ReturnsAsync(new List {expected}); + + // act + var result = await controller.Get(actionNeeded: true); + Assert.NotNull(result); + var okResult = result as OkObjectResult; + + // assert + Assert.NotNull(okResult); + Assert.Equal(200, okResult.StatusCode); + + var okValue = okResult.Value as IEnumerable; + Assert.NotNull(okValue); + Assert.Single(okValue); + Assert.Equal(expected, okValue.First()); + } + + [Fact] + public async void Get_WithinDateRange_OK() + { + // arrange + var startDate = DateTime.Now.AddSeconds(-5); + var endDate = DateTime.Now.AddSeconds(5); + var expected = new EventAlert() + { + DateAdded = DateTime.Now, + AccountNo = "1234567-99", + Message = "Status is O4R" + }; + mockEventAlertService.Setup(x => x.ListWithinDateRange(startDate, endDate)) + .ReturnsAsync(new List {expected}); + + // act + var result = await controller.GetWithinDateRange(startDate, endDate); + Assert.NotNull(result); + var okResult = result as OkObjectResult; + + // assert + Assert.NotNull(okResult); + Assert.Equal(200, okResult.StatusCode); + + var okValue = okResult.Value as IEnumerable; + Assert.NotNull(okValue); + Assert.Single(okValue); + Assert.Equal(expected, okValue.First()); + } + + // Post tests + [Fact] + public async void Post_OK() + { + // arrange + var postAlert = new EventAlert() + { + AccountNo = "1234567-98", + Message = "Status is O4R" + }; + + // act + var result = await controller.Post(postAlert); + Assert.NotNull(result); + var okResult = result as OkObjectResult; + + // assert + Assert.NotNull(okResult); + Assert.Equal(200, okResult.StatusCode); + } + + [Fact] + public async void Post_By_Auction_ID_OK() + { + // arrange + mockRepoService.Setup(x => x.FindByAuctionAssignmentId(5)).ReturnsAsync(new RepoAccount() + { + RepoId = 10, + AccountNo = "12345" + }); + + var postAlert = new EventAlert() + { + AccountNo = "1234567-98", + Message = "Status is O4R" + }; + + // act + var result = await controller.CreateByAuctionAssignmentId(5, postAlert); + Assert.NotNull(result); + var okResult = result as OkObjectResult; + + // assert + Assert.NotNull(okResult); + Assert.Equal(200, okResult.StatusCode); + mockRepoService.Verify(x => x.FindByAuctionAssignmentId(5), Times.Once); + } + + [Fact] + public async void Post_Bad_Request() + { + // arrange + var postAlert = new EventAlert() + { + AccountNo = "1234567-98", + }; + controller.ModelState.AddModelError("Message", "The message field is required."); + + // act + var result = await controller.Post(postAlert); + Assert.NotNull(result); + var badRequestResult = result as BadRequestObjectResult; + + // assert + Assert.NotNull(badRequestResult); + Assert.Equal(StatusCodes.Status400BadRequest, badRequestResult.StatusCode); + } + + [Fact] + public async void Post_By_AuctionAssignment_Bad_Request() + { + // arrange + mockEventAlertService.Setup(x => x.SaveAsync(It.IsAny())).Verifiable(); + mockRepoService.Setup(x => x.FindByAuctionAssignmentId(5)).Returns(Task.FromResult(null)); + var postAlert = new EventAlert() + { + AccountNo = "1234567-98", + }; + + // act + var result = await controller.CreateByAuctionAssignmentId(5, postAlert); + Assert.NotNull(result); + var badRequestResult = result as BadRequestObjectResult; + + // assert + Assert.NotNull(badRequestResult); + Assert.Equal(StatusCodes.Status400BadRequest, badRequestResult.StatusCode); + mockRepoService.Verify(x => x.FindByAuctionAssignmentId(5), Times.Once); + mockEventAlertService.Verify(x => x.SaveAsync(It.IsAny()), Times.Never); + } + + [Fact] + public async void Duplicate_Add_Bad_Request() + { + // arrange + mockEventAlertService.Setup(x => x.SaveAsync(It.IsAny())).ThrowsAsync( + new DuplicateResourceException("EventAlert")); + + // act + var result = await controller.Post(new EventAlert()); + Assert.NotNull(result); + var requestResult = result as ObjectResult; + + // assert + Assert.NotNull(requestResult); + Assert.Equal(StatusCodes.Status409Conflict, requestResult.StatusCode); + Assert.Equal("A Duplicate Event Alert already exists.", requestResult.Value); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Controllers/FactoidControllerTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Controllers/FactoidControllerTest.cs new file mode 100644 index 0000000..64136ba --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Controllers/FactoidControllerTest.cs @@ -0,0 +1,55 @@ +using System.Collections.Generic; +using LCU.API.Collections.RepoApi.Controllers; +using LCU.API.Collections.RepoApi.Models.Responses; +using LCU.API.Collections.RepoApi.Services; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Moq; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.Controllers +{ + public class FactoidControllerTest + { + private readonly FactoidController controller; + private readonly Mock mockFactoidService; + private readonly Mock mockHttpContextAccessor; + + public FactoidControllerTest() + { + mockFactoidService = new Mock(); + mockHttpContextAccessor = new Mock(); + controller = new FactoidController(mockHttpContextAccessor.Object, + mockFactoidService.Object); + } + + [Fact] + public async void Get_All_Factoids_OK() + { + // act + var result = await controller.GetAllFactoids(); + Assert.NotNull(result); + var okResult = result as OkObjectResult; + + // assert + Assert.NotNull(okResult); + Assert.Equal(200, okResult.StatusCode); + + var factoidResponses = okResult.Value as IReadOnlyCollection; + Assert.Equal(10, factoidResponses.Count); + } + + [Fact] + public async void Get_Factoid_O4R_OK() + { + // act + var result = await controller.GetAllAccountsO4R(); + Assert.NotNull(result); + var okResult = result as OkObjectResult; + + // assert + Assert.NotNull(okResult); + Assert.Equal(200, okResult.StatusCode); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Controllers/ProcessingReceiptControllerTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Controllers/ProcessingReceiptControllerTest.cs new file mode 100644 index 0000000..8968328 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Controllers/ProcessingReceiptControllerTest.cs @@ -0,0 +1,81 @@ +using System; +using System.Collections.Generic; +using LCU.API.Collections.RepoApi.Controllers; +using LCU.API.Collections.RepoApi.Services; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.Producer; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Xunit; +using Moq; +namespace LCU.API.Collections.RepoApiTests.Controllers +{ + public class ProcessingReceiptControllerTest + { + List list = new List() + { + new ProcessingReceipt("123456-888") + { + Message = "x", + Outcome = RepoProcessingResult.Error, + Processed = DateTime.Now, + AccountId = "321", + CaseId = "", + QueuedBy = "Testing" + }, + new ProcessingReceipt("123456-888") + { + Message = "y", + Outcome = RepoProcessingResult.Created, + Processed = DateTime.Now, + AccountId = "", + CaseId = "", + QueuedBy = "Testing" + } + }; + private readonly Mock _mockReceiptService; + private readonly ProcessingReceiptController _controller; + + public ProcessingReceiptControllerTest() + { + _mockReceiptService = new Mock(); + var mockHttpContextAccessor = new Mock(); + _controller = new ProcessingReceiptController(_mockReceiptService.Object, mockHttpContextAccessor.Object); + } + + [Fact] + public async void GetByAccountNo_OK() + { + _mockReceiptService.Setup(service => service.GetReceiptsByAccountNoAsync(It.IsAny())) + .ReturnsAsync(list); + + var results = await _controller.GetByAccountNo("123456-888"); + var okresults = results as OkObjectResult; + Assert.NotNull(okresults); + Assert.Equal(200, okresults.StatusCode); + } + + [Fact] + public async void GetByAccountNo_NotFound() + { + _mockReceiptService.Setup(service => service.GetReceiptsByAccountNoAsync(It.IsAny())) + .ReturnsAsync(new List{}); + + var results = await _controller.GetByAccountNo("123456-888"); + var objectResult = results as ObjectResult; + Assert.NotNull(objectResult); + Assert.IsType(objectResult); + } + + [Fact] + public async void GetByAccountNo_ServerException() + { + _mockReceiptService.Setup(service => service.GetReceiptsByAccountNoAsync(It.IsAny())).ThrowsAsync(new Exception("oops")); + + var results = await _controller.GetByAccountNo("123456-888"); + var objectResult = results as StatusCodeResult; + Assert.NotNull(objectResult); + Assert.Equal(500, objectResult.StatusCode); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Controllers/QueueControllerTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Controllers/QueueControllerTest.cs new file mode 100644 index 0000000..280766b --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Controllers/QueueControllerTest.cs @@ -0,0 +1,96 @@ +using System; +using System.Security.Claims; +using LCU.API.Collections.RepoApi.Controllers; +using LCU.API.Collections.RepoApi.HostedServices; +using LCU.API.Collections.RepoApi.Models.Requests; +using LCU.Shared.Collections.RepoApiLib.Models.Producer; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Moq; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.Controllers +{ + public class QueueControllerTest + { + private readonly Mock _mockService; + private readonly Mock _mockHttpContextAccessor; + + public QueueControllerTest() + { + _mockService = new Mock(); + _mockHttpContextAccessor = new Mock(); + } + + [Fact] + public void PutSingleAccountOnQueue_OK() + { + //setup + _mockService.Setup(x => x.SendRequestToQueue(It.IsAny())); + QueueController controller = new QueueController(_mockService.Object, _mockHttpContextAccessor.Object); + + var context = new DefaultHttpContext(); + context.User = new ClaimsPrincipal(); + _mockHttpContextAccessor.Setup(_ => _.HttpContext).Returns(context); + + var request = new AccountQueueRequest() + { + AccountNo = "12345-123" + }; + + //act + var res = controller.PutSingleAccountOnQueue(request); + + Assert.IsType(res); + _mockService.Verify(x => x.SendRequestToQueue(It.IsAny()), Times.Once); + } + + [Fact] + public void PutSingleAccountOnQueue_Exception() + { + //setup + _mockService.Setup(x => x.SendRequestToQueue(It.IsAny())).Throws(new Exception("oops")); + QueueController controller = new QueueController(_mockService.Object, _mockHttpContextAccessor.Object); + var context = new DefaultHttpContext(); + context.User = new ClaimsPrincipal(); + _mockHttpContextAccessor.Setup(_ => _.HttpContext).Returns(context); + + var request = new AccountQueueRequest() + { + AccountNo = "12345-123" + }; + + //act + var res = controller.PutSingleAccountOnQueue(request); + var badres = res as ObjectResult; + + //asert + Assert.Equal(500, badres.StatusCode); + _mockService.Verify(x => x.SendRequestToQueue(It.IsAny()), Times.Once); + } + + [Fact] + public void PutSingleAccountOnQueue_BadFormat1() + { + //setup + _mockService.Setup(x => x.SendRequestToQueue(It.IsAny())); + QueueController controller = new QueueController(_mockService.Object, _mockHttpContextAccessor.Object); + var context = new DefaultHttpContext(); + context.User = new ClaimsPrincipal(); + _mockHttpContextAccessor.Setup(_ => _.HttpContext).Returns(context); + controller.ModelState.AddModelError("Message", "Some field is required."); + var request = new AccountQueueRequest() + { + AccountNo = "12345" + }; + + //act + var res = controller.PutSingleAccountOnQueue(request); + var badres = res as ObjectResult; + + //asert + Assert.Equal(400, badres.StatusCode); + _mockService.Verify(x => x.SendRequestToQueue(It.IsAny()), Times.Never); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Controllers/RefundStatusControllerTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Controllers/RefundStatusControllerTest.cs new file mode 100644 index 0000000..1cb25ae --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Controllers/RefundStatusControllerTest.cs @@ -0,0 +1,172 @@ +using LCU.API.Collections.RepoApi.Controllers; +using LCU.API.Collections.RepoApi.Exceptions; +using LCU.API.Collections.RepoApi.Services; +using LCU.Shared.Collections.RepoApiLib.Models; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Moq; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.Controllers +{ + public class RefundStatusControllerTest + { + private RefundStatusController _refundStatusController; + private Mock _refundStatusService; + private Mock _httpAccessor; + + public RefundStatusControllerTest() + { + _refundStatusService = new Mock(); + _httpAccessor = new Mock(); + _refundStatusController = new RefundStatusController( + _refundStatusService.Object, + _httpAccessor.Object); + } + + [Fact] + public async void GetById_Ok() + { + // Arrange + _refundStatusService.Setup(service => service.GetAsync(It.IsAny())).ReturnsAsync( + new RefundStatus()); + + // Act + var result = await _refundStatusController.GetById(123); + + // Assert + Assert.NotNull(result); + + var okResult = result as OkObjectResult; + Assert.NotNull(okResult); + + var okValue = okResult.Value; + Assert.NotNull(okValue); + + var refundStatus = okValue as RefundStatus; + Assert.NotNull(refundStatus); + } + + [Fact] + public async void GetById_Returns_Bad_Request_Invalid_ID_Equal_to_Zero() + { + // Act + var result = await _refundStatusController.GetById(0); + + // Assert + Assert.NotNull(result); + + var badResult = result as BadRequestObjectResult; + Assert.NotNull(badResult); + } + + [Fact] + public async void GetById_Returns_NotFound_On_NFE() + { + // Arrange + _refundStatusService.Setup(service => service.GetAsync(It.IsAny())).ThrowsAsync( + new NotFoundException("Refund Status Not Found Test")); + + // Act + var result = await _refundStatusController.GetById(123); + + // Assert + Assert.NotNull(result); + + var badResult = result as NotFoundObjectResult; + Assert.NotNull(badResult); + + var badResultValue = badResult.Value; + Assert.NotNull(badResultValue); + + var badResultMessage = badResultValue as string; + Assert.NotNull(badResultMessage); + Assert.Equal("Refund Status Not Found Test", badResultMessage); + } + + [Fact] + public async void Post_Ok() + { + // Arrange + _refundStatusService.Setup(service => service.SaveAsync(It.IsAny())).ReturnsAsync( + new RefundStatus()); + + // Act + var result = await _refundStatusController.Post(new RefundStatus() {RepoId = 123}); + + // Assert + Assert.NotNull(result); + + var okResult = result as OkObjectResult; + Assert.NotNull(okResult); + + var okValue = okResult.Value; + Assert.NotNull(okValue); + + var refundStatus = okValue as RefundStatus; + Assert.NotNull(refundStatus); + } + + [Fact] + public async void Post_Returns_Bad_Request_Invalid_ID_Equal_to_Zero() + { + // Act + var result = await _refundStatusController.Post(new RefundStatus() {RepoId = 0}); + + // Assert + Assert.NotNull(result); + + var badResult = result as BadRequestObjectResult; + Assert.NotNull(badResult); + } + + [Fact] + public async void Put_Ok() + { + // Arrange + _refundStatusService.Setup(service => service.UpdateAsync(It.IsAny())).ReturnsAsync( + new RefundStatus()); + + // Act + var result = await _refundStatusController.Put(123, new RefundStatus() {RepoId = 123}); + + // Assert + Assert.NotNull(result); + + var okResult = result as OkObjectResult; + Assert.NotNull(okResult); + + var okValue = okResult.Value; + Assert.NotNull(okValue); + + var refundStatus = okValue as RefundStatus; + Assert.NotNull(refundStatus); + } + + [Fact] + public async void Put_Returns_Bad_Request_Invalid_ID_Equal_to_Zero() + { + // Act + var result = await _refundStatusController.Put(0, new RefundStatus() {RepoId = 0}); + + // Assert + Assert.NotNull(result); + + var badResult = result as BadRequestObjectResult; + Assert.NotNull(badResult); + } + + [Fact] + public async void Put_Returns_Bad_Request_Invalid_ID_Mismatch() + { + // Act + var result = await _refundStatusController.Put(123, new RefundStatus() {RepoId = 1234}); + + // Assert + Assert.NotNull(result); + + var badResult = result as BadRequestObjectResult; + Assert.NotNull(badResult); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Controllers/RepoAccountControllerTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Controllers/RepoAccountControllerTest.cs new file mode 100644 index 0000000..991f840 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Controllers/RepoAccountControllerTest.cs @@ -0,0 +1,359 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using LCU.API.Collections.RepoApi.Controllers; +using LCU.API.Collections.RepoApi.Models.Filters; +using LCU.API.Collections.RepoApi.Models.Requests; +using LCU.API.Collections.RepoApi.Models.Responses; +using LCU.API.Collections.RepoApi.Services; +using LCU.Shared.Collections.RepoApiLib.Exceptions; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.Results; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Moq; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.Controllers +{ + public class RepoAccountControllerTest + { + private Mock mockService; + private Mock mockStatusService; + private Mock mockLetterService; + private RepoAccountController controller; + private readonly Mock mockHttpContextAccessor; + + public RepoAccountControllerTest() + { + mockService = new Mock(); + mockStatusService = new Mock(); + mockLetterService = new Mock(); + mockHttpContextAccessor = new Mock(); + controller = new RepoAccountController(mockService.Object, mockLetterService.Object, + mockStatusService.Object, mockHttpContextAccessor.Object); + } + + [Fact] + public async void Get_OK() + { + mockService.Setup(service => service.ListAll(It.IsAny(), It.IsAny())) + .ReturnsAsync( + new PagedResult() + { + Total = 1, + Items = new List + { + new RepoAccount() + { + RepoId = 5, + AccountNo = "1234567-98" + } + } + }); + + // arrange + var filter = new PageFilter(); + + // act + var result = await controller.Get(filter); + Assert.NotNull(result); + var okResult = result as OkObjectResult; + + // assert + Assert.NotNull(okResult); + Assert.Equal(200, okResult.StatusCode); + + var okValue = okResult.Value as PagedResponse; + Assert.NotNull(okValue); + Assert.Equal(1, okValue.TotalItems); + } + + [Fact] + public async void Get_Repo_Account_Status_Changes_OK() + { + // arrange + var statusChanges = new List + { + new RepoStatusChange() + { + Id = 1, + RepoId = 5, + StatusFrom = "None", + StatusTo = "O4R", + ChangedBy = "System", + ChangedDate = DateTime.Now + } + }; + mockStatusService.Setup(x => x.ListByAccount(It.IsAny())).ReturnsAsync(statusChanges); + + // act + var result = await controller.GetStatusChangesByRepoId(5); + Assert.NotNull(result); + var okResult = result as OkObjectResult; + + // assert + Assert.NotNull(okResult); + Assert.Equal(200, okResult.StatusCode); + + var okValue = okResult.Value as IEnumerable; + Assert.NotNull(okValue); + Assert.True(statusChanges.SequenceEqual(okValue)); + } + + [Fact] + public async void Get_Repo_Account_Letters_OK() + { + // arrange + var letters = new List + { + new RepoLetter + { + NoticeType = "Type", + DateSent = DateTime.Now, + DateExpired = DateTime.Now.AddDays(15), + DaysToRedeem = 15 + } + }; + mockLetterService.Setup(x => x.ListByAccountIdAsync(It.IsAny())).ReturnsAsync(letters); + + // act + var result = await controller.GetLettersByRepoId(5); + Assert.NotNull(result); + var okResult = result as OkObjectResult; + + // assert + Assert.NotNull(okResult); + Assert.Equal(200, okResult.StatusCode); + + var okValue = okResult.Value as IEnumerable; + Assert.NotNull(okValue); + Assert.True(letters.SequenceEqual(okValue)); + } + + + [Fact] + public async void GetByAccountNo_OK() + { + // arrange + var repos = new List + { + new RepoAccount() + { + RepoId = 5, + AccountNo = "1234567-98", + DateClosed = DateTime.Today + }, + new RepoAccount() + { + RepoId = 6, + AccountNo = "1234567-98", + DateClosed = DateTime.Today + } + }; + mockService.Setup(x => x.GetByAccountNo(It.IsAny())).ReturnsAsync(repos); + + // act + var result = await controller.GetByAccountNo("55555-123"); + Assert.NotNull(result); + var okResult = result as OkObjectResult; + + // assert + Assert.NotNull(okResult); + Assert.Equal(200, okResult.StatusCode); + + var okValue = okResult.Value as IReadOnlyCollection; + Assert.NotNull(okValue); + Assert.Equal(5, okValue.First().RepoId); + } + + [Fact] + public async void GetById_OK() + { + // arrange + var repos = new List + { + new RepoAccount() + { + RepoId = 5, + AccountNo = "1234567-98" + } + }; + mockService.Setup(x => x.Get(It.IsAny())).ReturnsAsync(repos.First()); + + // act + var result = await controller.GetById(5); + Assert.NotNull(result); + var okResult = result as OkObjectResult; + + // assert + Assert.NotNull(okResult); + Assert.Equal(200, okResult.StatusCode); + + var okValue = okResult.Value as RepoAccount; + Assert.NotNull(okValue); + Assert.Equal(5, okValue.RepoId); + } + + // Post tests + [Fact] + public async void Post_OK() + { + // arrange + var postAlert = new RepoAccount() + { + AccountNo = "1234567-98", + Borrowers = new List() + { + new Borrower() + { + RepoId = 0, + IndividualId = "123456", + OwnershipType = 6, + IndividualName = "John Doe" + } + }, + Collaterals = new List + { + new Collateral() + { + CollateralId = 1234567, + RepoId = 2345678 + } + } + }; + + // act + var result = await controller.Post(postAlert); + Assert.NotNull(result); + var okResult = result as OkObjectResult; + + // assert + Assert.NotNull(okResult); + Assert.Equal(200, okResult.StatusCode); + } + + [Fact] + public async void Post_Bad_Request() + { + // arrange + var postAlert = new RepoAccount() + { + AccountNo = "1234567-98", + }; + controller.ModelState.AddModelError("Message", "The message field is required."); + + // act + var result = await controller.Post(postAlert); + Assert.NotNull(result); + var badRequestResult = result as BadRequestObjectResult; + + // assert + Assert.NotNull(badRequestResult); + Assert.Equal(StatusCodes.Status400BadRequest, badRequestResult.StatusCode); + } + + [Fact] + public async void Search_Ok() + { + // arrange + var searchPhrase = "abcd123"; + mockService.Setup(service => service.SearchRepoAccounts(It.IsAny(), It.IsAny())).ReturnsAsync( + new List() + { + new RepoAccount(), + new RepoAccount(), + new RepoAccount() + }); + + // act + var result = await controller.SearchRepoAccounts(searchPhrase); + Assert.NotNull(result); + var okResult = result as OkObjectResult; + + // assert + Assert.NotNull(okResult); + + var okResultValue = okResult.Value as IReadOnlyCollection; + Assert.NotNull(okResultValue); + Assert.Equal(3, okResultValue.Count()); + } + + [Fact] + public async void Search_Empty_Bad_Request() + { + // arrange + var searchPhrase = ""; + + // act + var result = await controller.SearchRepoAccounts(searchPhrase); + Assert.NotNull(result); + var badRequestResult = result as BadRequestObjectResult; + + // assert + Assert.NotNull(badRequestResult); + Assert.Equal(StatusCodes.Status400BadRequest, badRequestResult.StatusCode); + Assert.Equal("Search Phrase Cannot Be Empty", badRequestResult.Value); + } + + [Fact] + public async void Search_Low_Characters_Bad_Request() + { + // arrange + var searchPhrase = "12"; + + // act + var result = await controller.SearchRepoAccounts(searchPhrase); + Assert.NotNull(result); + var badRequestResult = result as BadRequestObjectResult; + + // assert + Assert.NotNull(badRequestResult); + Assert.Equal(StatusCodes.Status400BadRequest, badRequestResult.StatusCode); + Assert.Equal("Search Phrase Must Be At Least Three (3) Characters Long", badRequestResult.Value); + } + + [Fact] + public async void Search_Max_Results_Bad_Request() + { + // arrange + var searchPhrase = "143"; + mockService.Setup(service => service.SearchRepoAccounts(It.IsAny(), It.IsAny())) + .ThrowsAsync(new MaxItemException(1492)); + + // act + var result = await controller.SearchRepoAccounts(searchPhrase); + Assert.NotNull(result); + var payloadTooLargeResult = result as ObjectResult; + + // assert + Assert.NotNull(payloadTooLargeResult); + Assert.Equal(StatusCodes.Status413PayloadTooLarge, payloadTooLargeResult.StatusCode); + Assert.Equal("Too Many Search Results. (Max: 100) (Found: 1492)", payloadTooLargeResult.Value); + } + + [Fact] + public async void DeleteAccountByID_Exception() + { + //arrange + mockService.Setup(service => service.DeleteAsync(It.IsAny())).ThrowsAsync(new Exception("oops")); + + var result = await controller.DeleteAccountById(5); + var badres = result as StatusCodeResult; + Assert.NotNull(result); + Assert.Equal(500, badres.StatusCode); + } + + [Fact] + public async void DeleteAccountByID_Ok() + { + //arrange + mockService.Setup(service => service.DeleteAsync(It.IsAny())).ReturnsAsync(new RepoAccount() { }); + + var result = await controller.DeleteAccountById(5); + var okres = result as OkObjectResult; + Assert.NotNull(result); + Assert.Equal(200, okres.StatusCode); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Controllers/RepoCompanyControllerTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Controllers/RepoCompanyControllerTest.cs new file mode 100644 index 0000000..71c6100 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Controllers/RepoCompanyControllerTest.cs @@ -0,0 +1,81 @@ +using System.Collections.Generic; +using LCU.API.Collections.RepoApi.Controllers; +using LCU.API.Collections.RepoApi.Services; +using LCU.Shared.Collections.RepoApiLib.Models; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Moq; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.Controllers +{ + public class RepoCompanyControllerTest + { + private Mock mockService; + private RepoCompanyController controller; + private readonly Mock mockHttpContextAccessor; + + public RepoCompanyControllerTest() + { + mockService = new Mock(); + mockHttpContextAccessor = new Mock(); + controller = + new RepoCompanyController(mockService.Object, mockHttpContextAccessor.Object); + } + + [Fact] + public async void Get_OK() + { + var repoCompanyList = getMockCompanyList(); + + mockService.Setup(service => service.ListAll()).ReturnsAsync(repoCompanyList); + + var result = await controller.Get(); + Assert.NotNull(result); + + var okResult = result as OkObjectResult; + Assert.NotNull(okResult); + Assert.Equal(200, okResult.StatusCode); + + var okValue = okResult.Value as IEnumerable; + Assert.NotNull(okValue); + + var repoEnum = okValue.GetEnumerator(); + + repoEnum.MoveNext(); + var firstValue = repoEnum.Current; + Assert.Equal(repoCompanyList[0], firstValue); + } + + [Fact] + public async void Post_Ok() + { + var repoCompanyList = getMockCompanyList(); + + mockService.Setup(service => service.Save(It.IsAny())).ReturnsAsync(repoCompanyList[0]); + + var result = await controller.Post(repoCompanyList[0]); + Assert.NotNull(result); + + var okResult = result as OkObjectResult; + Assert.NotNull(okResult); + Assert.Equal(200, okResult.StatusCode); + + var okValue = okResult.Value as RepoCompany; + Assert.Equal(repoCompanyList[0], okValue); + } + + private IList getMockCompanyList() + { + return new List + { + getMockCompany() + }; + } + + private RepoCompany getMockCompany() + { + return new RepoCompany() {ID = 1, Email = "test1@test1.com", Name = "A Inc."}; + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Controllers/RepoCompanySelectionControllerTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Controllers/RepoCompanySelectionControllerTest.cs new file mode 100644 index 0000000..56b10ad --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Controllers/RepoCompanySelectionControllerTest.cs @@ -0,0 +1,112 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using LCU.API.Collections.RepoApi.Controllers; +using LCU.API.Collections.RepoApi.Exceptions; +using LCU.API.Collections.RepoApi.Models.Responses; +using LCU.API.Collections.RepoApi.Services; +using LCU.Shared.Collections.RepoApiLib.Models; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Moq; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.Controllers +{ + public class RepoCompanySelectionControllerTest + { + private RepoCompanySelectionController _controller; + private Mock _mockService; + private Mock _mockHttpContextAccessor; + + public RepoCompanySelectionControllerTest() + { + _mockService = new Mock(); + _mockHttpContextAccessor = new Mock(); + _controller = new RepoCompanySelectionController( + _mockService.Object, + _mockHttpContextAccessor.Object); + } + + [Fact] + public async void Get_Ok() + { + // Arrange + _mockService.Setup(service => service.ListAllAsync()).ReturnsAsync(new List() + { + new RepoCompanySelection(), + new RepoCompanySelection() + }); + + // Act + var result = await _controller.Get(); + + // Assert + Assert.NotNull(result); + + var okResult = result as OkObjectResult; + Assert.NotNull(okResult); + Assert.NotNull(okResult.Value); + + var repoCompanySelectionList = okResult.Value as IEnumerable; + Assert.NotNull(repoCompanySelectionList); + Assert.Equal(2, repoCompanySelectionList.Count()); + } + + [Fact] + public async void Get_ById_Ok() + { + // Arrange + _mockService.Setup(service => service.GetAsync(It.IsAny())).ReturnsAsync(new RepoCompanySelection() + { + RepoCompanyId = 5 + }); + + // Act + var result = await _controller.Get(42); + + // Assert + Assert.NotNull(result); + + var okResult = result as OkObjectResult; + Assert.NotNull(okResult); + Assert.NotNull(okResult.Value); + + var repoCompanySelection = okResult.Value as RepoCompanySelection; + Assert.NotNull(repoCompanySelection); + Assert.Equal(5, repoCompanySelection.RepoCompanyId); + } + + [Fact] + public async void Get_ById_Invalid_ID() + { + // Act + var result = await _controller.Get(0); + + // Assert + Assert.NotNull(result); + + var badRequestResult = result as BadRequestObjectResult; + Assert.NotNull(badRequestResult); + Assert.Equal("Invalid ID", badRequestResult.Value); + } + + [Fact] + public async void Get_ById_Not_Found() + { + // Arrange + _mockService.Setup(service => service.GetAsync(It.IsAny())) + .ThrowsAsync(new NotFoundException("Not Found in Get")); + + // Act + var result = await _controller.Get(1); + + // Assert + Assert.NotNull(result); + + var notFoundRequest = result as NotFoundObjectResult; + Assert.NotNull(notFoundRequest); + Assert.Equal("Not Found in Get", notFoundRequest.Value); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Controllers/ReportingControllerTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Controllers/ReportingControllerTest.cs new file mode 100644 index 0000000..f59ea6d --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Controllers/ReportingControllerTest.cs @@ -0,0 +1,81 @@ +using LCU.API.Collections.RepoApi.Controllers; +using LCU.API.Collections.RepoApi.Models.Requests; +using LCU.API.Collections.RepoApi.Services.Reporting; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Moq; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.Controllers +{ + public class ReportingControllerTest + { + private readonly ReportingController controller; + private readonly Mock mockLandmarkReportingService; + private readonly Mock mockAuctionReportingService; + private readonly Mock mockRepoCompanyReportingService; + private readonly Mock mockHttpContextAccessor; + + public ReportingControllerTest() + { + mockLandmarkReportingService = new Mock(); + mockAuctionReportingService = new Mock(); + mockRepoCompanyReportingService = new Mock(); + mockHttpContextAccessor = new Mock(); + controller = new ReportingController( + mockHttpContextAccessor.Object, + mockLandmarkReportingService.Object, + mockAuctionReportingService.Object, + mockRepoCompanyReportingService.Object); + } + + [Fact] + public async void Get_Gross_Amount_OK() + { + // arrange + var request = new ReportingRequest(); + + // act + var result = await controller.GetAuctionAssignedBalance(request); + Assert.NotNull(result); + var okResult = result as OkObjectResult; + + // assert + Assert.NotNull(okResult); + Assert.Equal(200, okResult.StatusCode); + } + + [Fact] + public async void Get_Active_Account_OK() + { + // arrange + var request = new ReportingRequest(); + + // act + var result = await controller.GetIsActiveAccount(request); + Assert.NotNull(result); + var okResult = result as OkObjectResult; + + // assert + Assert.NotNull(okResult); + Assert.Equal(200, okResult.StatusCode); + } + + [Fact] + public async void Get_Closed_Account_OK() + { + // arrange + var request = new ReportingRequest(); + + // act + var result = await controller.GetIsClosedAccount(request); + Assert.NotNull(result); + var okResult = result as OkObjectResult; + + // assert + Assert.NotNull(okResult); + Assert.Equal(200, okResult.StatusCode); + } + + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Controllers/SettingsControllerTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Controllers/SettingsControllerTest.cs new file mode 100644 index 0000000..22c2b76 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Controllers/SettingsControllerTest.cs @@ -0,0 +1,370 @@ +using LCU.API.Collections.RepoApi.Controllers; +using LCU.API.Collections.RepoApi.Services; +using LCU.Shared.Collections.RepoApiLib.Models.Settings; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Moq; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.Controllers +{ + public class SettingsControllerTest + { + private readonly Mock mockSettingsService; + private readonly Settings settings; + private readonly SettingsController controller; + private readonly Mock mockHttpContextAccessor; + + public SettingsControllerTest() + { + mockSettingsService = new Mock(); + settings = new Settings(); + mockHttpContextAccessor = new Mock(); + controller = new SettingsController(mockSettingsService.Object, + mockHttpContextAccessor.Object); + } + + // Get tests + [Fact] + public async void Get_OK() + { + // arrange + mockSettingsService.Setup(x => x.ListAllSettingsAsync()).ReturnsAsync(settings); + + // act + var result = await controller.Get(); + Assert.NotNull(result); + var okResult = result as OkObjectResult; + + // assert + Assert.NotNull(okResult); + Assert.Equal(200, okResult.StatusCode); + + var okValue = okResult.Value as Settings; + Assert.NotNull(okValue); + Assert.Equal(settings, okValue); + } + + // Put tests + [Fact] + public async void Put_Account_Type_OK() + { + // arrange + var putAccountType = new AccountType(); + + // act + var result = await controller.PutAccountType(putAccountType); + Assert.NotNull(result); + var okResult = result as OkObjectResult; + + // assert + Assert.NotNull(okResult); + Assert.Equal(200, okResult.StatusCode); + } + + [Fact] + public async void Put_Allowed_Status_Change_OK() + { + // arrange + var putAllowedStatusChange = new AllowedStatusChange(); + + // act + var result = await controller.PutAllowedStatusChange(putAllowedStatusChange); + Assert.NotNull(result); + var okResult = result as OkObjectResult; + + // assert + Assert.NotNull(okResult); + Assert.Equal(200, okResult.StatusCode); + } + + [Fact] + public async void Put_Body_Style_OK() + { + // arrange + var putBodyStyle = new BodyStyle(); + + // act + var result = await controller.PutBodyStyle(putBodyStyle); + Assert.NotNull(result); + var okResult = result as OkObjectResult; + + // assert + Assert.NotNull(okResult); + Assert.Equal(200, okResult.StatusCode); + } + + [Fact] + public async void Put_Cleaning_Level_OK() + { + // arrange + var putCleaningLevel = new CleaningLevel(); + + // act + var result = await controller.PutCleaningLevel(putCleaningLevel); + Assert.NotNull(result); + var okResult = result as OkObjectResult; + + // assert + Assert.NotNull(okResult); + Assert.Equal(200, okResult.StatusCode); + } + + [Fact] + public async void Put_CollateralType_OK() + { + // arrange + var putCollateralType = new CollateralType(); + + // act + var result = await controller.PutCollateralType(putCollateralType); + Assert.NotNull(result); + var okResult = result as OkObjectResult; + + // assert + Assert.NotNull(okResult); + Assert.Equal(200, okResult.StatusCode); + } + + [Fact] + public async void Put_CollateralTypeToVehicleType_OK() + { + // arrange + var putCollateralToVehicle = new CollateralTypeToVehicleType(); + + // act + var result = await controller.PutCollateralTypeToVehicleType(putCollateralToVehicle); + Assert.NotNull(result); + var okResult = result as OkObjectResult; + + // assert + Assert.NotNull(okResult); + Assert.Equal(200, okResult.StatusCode); + } + + [Fact] + public async void Put_Hold_Status_OK() + { + // arrange + var putHoldStatus = new HoldStatus(); + + // act + var result = await controller.PutHoldStatus(putHoldStatus); + Assert.NotNull(result); + var okResult = result as OkObjectResult; + + // assert + Assert.NotNull(okResult); + Assert.Equal(200, okResult.StatusCode); + } + + [Fact] + public async void Put_Loan_Category_OK() + { + // arrange + var putLoanCategory = new LoanCategory(); + + // act + var result = await controller.PutLoanCategory(putLoanCategory); + Assert.NotNull(result); + var okResult = result as OkObjectResult; + + // assert + Assert.NotNull(okResult); + Assert.Equal(200, okResult.StatusCode); + } + + [Fact] + public async void Put_Location_Type_OK() + { + // arrange + var putLocationType = new LocationType(); + + // act + var result = await controller.PutLocationType(putLocationType); + Assert.NotNull(result); + var okResult = result as OkObjectResult; + + // assert + Assert.NotNull(okResult); + Assert.Equal(200, okResult.StatusCode); + } + + [Fact] + public async void Put_Vehicle_Type_OK() + { + // arrange + var putVehicleType = new VehicleType(); + + // act + var result = await controller.PutVehicleType(putVehicleType); + Assert.NotNull(result); + var okResult = result as OkObjectResult; + + // assert + Assert.NotNull(okResult); + Assert.Equal(200, okResult.StatusCode); + } + + // Post tests + [Fact] + public async void Post_Account_Type_OK() + { + // arrange + var postAccountType = new AccountType(); + + // act + var result = await controller.PostAccountType(postAccountType); + Assert.NotNull(result); + var okResult = result as OkObjectResult; + + // assert + Assert.NotNull(okResult); + Assert.Equal(200, okResult.StatusCode); + } + + [Fact] + public async void Post_Allowed_Status_Change_OK() + { + // arrange + var postStatusChange = new AllowedStatusChange(); + + // act + var result = await controller.PostAllowedStatusChange(postStatusChange); + Assert.NotNull(result); + var okResult = result as OkObjectResult; + + // assert + Assert.NotNull(okResult); + Assert.Equal(200, okResult.StatusCode); + } + + [Fact] + public async void Post_Body_Style_OK() + { + // arrange + var postBodyStyle = new BodyStyle(); + + // act + var result = await controller.PostBodyStyle(postBodyStyle); + Assert.NotNull(result); + var okResult = result as OkObjectResult; + + // assert + Assert.NotNull(okResult); + Assert.Equal(200, okResult.StatusCode); + } + + [Fact] + public async void Post_Cleaning_Level_OK() + { + // arrange + var postCleaningLevel = new CleaningLevel(); + + // act + var result = await controller.PostCleaningLevel(postCleaningLevel); + Assert.NotNull(result); + var okResult = result as OkObjectResult; + + // assert + Assert.NotNull(okResult); + Assert.Equal(200, okResult.StatusCode); + } + + [Fact] + public async void Post_Collateral_Type_OK() + { + // arrange + var postCollateralType = new CollateralType(); + + // act + var result = await controller.PostCollateralType(postCollateralType); + Assert.NotNull(result); + var okResult = result as OkObjectResult; + + // assert + Assert.NotNull(okResult); + Assert.Equal(200, okResult.StatusCode); + } + + [Fact] + public async void Post_Collateral_Type_To_Vehicle_Type_OK() + { + // arrange + var postCollateralTypeToVehicleType = new CollateralTypeToVehicleType(); + + // act + var result = await controller.PostCollateralTypeToVehicleType(postCollateralTypeToVehicleType); + Assert.NotNull(result); + var okResult = result as OkObjectResult; + + // assert + Assert.NotNull(okResult); + Assert.Equal(200, okResult.StatusCode); + } + + [Fact] + public async void Post_Hold_Status_OK() + { + // arrange + var postHoldStatus = new HoldStatus(); + + // act + var result = await controller.PostHoldStatus(postHoldStatus); + Assert.NotNull(result); + var okResult = result as OkObjectResult; + + // assert + Assert.NotNull(okResult); + Assert.Equal(200, okResult.StatusCode); + } + + [Fact] + public async void Post_Loan_Category_OK() + { + // arrange + var postLoanCategory = new LoanCategory(); + + // act + var result = await controller.PostLoanCategory(postLoanCategory); + Assert.NotNull(result); + var okResult = result as OkObjectResult; + + // assert + Assert.NotNull(okResult); + Assert.Equal(200, okResult.StatusCode); + } + + [Fact] + public async void Post_Location_Type_OK() + { + // arrange + var postLocationType = new LocationType(); + + // act + var result = await controller.PostLocationType(postLocationType); + Assert.NotNull(result); + var okResult = result as OkObjectResult; + + // assert + Assert.NotNull(okResult); + Assert.Equal(200, okResult.StatusCode); + } + + [Fact] + public async void Post_Vehicle_Type_OK() + { + // arrange + var postVehicleType = new VehicleType(); + + // act + var result = await controller.PostVehicleType(postVehicleType); + Assert.NotNull(result); + var okResult = result as OkObjectResult; + + // assert + Assert.NotNull(okResult); + Assert.Equal(200, okResult.StatusCode); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Controllers/VehicleFloorPricingParametersControllerTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Controllers/VehicleFloorPricingParametersControllerTest.cs new file mode 100644 index 0000000..f73392f --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Controllers/VehicleFloorPricingParametersControllerTest.cs @@ -0,0 +1,92 @@ +using System.Collections.Generic; +using System.Linq; +using LCU.API.Collections.RepoApi.Controllers; +using LCU.API.Collections.RepoApi.Services; +using LCU.Shared.Collections.RepoApiLib.Models; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Moq; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.Controllers +{ + public class VehicleFloorPricingParametersControllerTest + { + // Get tests + [Fact] + public async void Get_OK() + { + var mockService = new Mock(); + var mockHttpContextAccessor = new Mock(); + var parameters = new List + { + new VehicleFloorPricingParameters() + { + Id = 1, + LowCondition = 0.0m, + HighCondition = 1.5m, + NADAFirstValue = "Low Value", + NADASecondValue = "Low Value", + MMRAdjustedValue = "Regional Value", + PercentageOf = 95.00m + } + }; + mockService.Setup(x => x.ListAll()).ReturnsAsync(parameters); + + // arrange + var controller = new VehicleFloorPricingParametersController(mockService.Object, + mockHttpContextAccessor.Object); + + // act + var result = await controller.Get(); + Assert.NotNull(result); + var okResult = result as OkObjectResult; + + // assert + Assert.NotNull(okResult); + Assert.Equal(200, okResult.StatusCode); + + var okValue = okResult.Value as IEnumerable; + Assert.NotNull(okValue); + Assert.True(parameters.SequenceEqual(okValue)); + } + + [Fact] + public async void GetById_OK() + { + var mockService = new Mock(); + var mockHttpContextAccessor = new Mock(); + var repos = new List + { + new VehicleFloorPricingParameters() + { + Id = 1, + LowCondition = 0.0m, + HighCondition = 1.5m, + NADAFirstValue = "Low Value", + NADASecondValue = "Low Value", + MMRAdjustedValue = "Regional Value", + PercentageOf = 95.00m + } + }; + mockService.Setup(x => x.Get(It.IsAny())).ReturnsAsync(repos.First()); + + // arrange + var controller = new VehicleFloorPricingParametersController(mockService.Object, + mockHttpContextAccessor.Object); + + // act + var result = await controller.GetById(1234567); + Assert.NotNull(result); + var okResult = result as OkObjectResult; + + // assert + Assert.NotNull(okResult); + Assert.Equal(200, okResult.StatusCode); + + var okValue = okResult.Value as VehicleFloorPricingParameters; + Assert.NotNull(okValue); + Assert.Equal(1, okValue.Id); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/DataTableFormattingTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/DataTableFormattingTest.cs new file mode 100644 index 0000000..f4ca0d8 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/DataTableFormattingTest.cs @@ -0,0 +1,84 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using LCU.API.Collections.RepoApi.Models.Reporting; +using LCU.Shared.Collections.RepoApiLib.Formatting; +using LCU.Shared.Collections.RepoApiLib.Models.Reporting.Responses; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests +{ + internal class DummyClass + { + public int RepoId { get; set; } + public string SomeString { get; set; } + } + + public class DataTableFormattingTest + { + [Fact] + public void CreateDataTable_Ok() + { + // Arrange + var dummyData = new List() + { + new DummyClass() + { + RepoId = 49, + SomeString = "String" + }, + new DummyClass() + { + RepoId = 51 + } + }; + + // Act + var dataTable = DataTableFormatting.CreateDataTable( + dummyData, + (entry) => entry.RepoId, + (entry) => new ReportHeaderCellMap() + { + Header = "First Header", + Cell = new ReportCell() + { + Display = entry?.SomeString, + Value = 123 + } + }, + (entry) => new ReportHeaderCellMap() + { + Header = "2nd Header", + Cell = new ReportCell() + { + Display = "Whatever I want", + Value = true + } + }); + + // Assert + Assert.NotNull(dataTable); + + Assert.Equal(2, dataTable.Headers.Length); + Assert.Equal("First Header", dataTable.Headers[0]); + Assert.Equal("2nd Header", dataTable.Headers[1]); + + Assert.Equal(2, dataTable.Rows.Count()); + + var firstRow = dataTable.Rows.ElementAt(0); + Assert.Equal(49, firstRow.RepoId); + Assert.Equal("String", firstRow.Cells[0].Display); + Assert.Equal(123, firstRow.Cells[0].Value); + Assert.Equal("Whatever I want", firstRow.Cells[1].Display); + Assert.Equal(true, firstRow.Cells[1].Value); + + var secondRow = dataTable.Rows.ElementAt(1); + Assert.Equal(51, secondRow.RepoId); + Assert.Null(secondRow.Cells[0].Display); + Assert.Equal(123, secondRow.Cells[0].Value); + Assert.Equal("Whatever I want", secondRow.Cells[1].Display); + Assert.Equal(true, secondRow.Cells[1].Value); + } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/DbContextFromJson.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/DbContextFromJson.cs new file mode 100644 index 0000000..633c444 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/DbContextFromJson.cs @@ -0,0 +1,105 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using LCU.API.Collections.RepoApiTests.Repository; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Persistence; +using Microsoft.EntityFrameworkCore; +using Newtonsoft.Json.Linq; + +namespace LCU.API.Collections.RepoApiTests +{ + public class DbContextTestSet + { + public IReadOnlyCollection RepoAccounts { get; set; } + public IReadOnlyCollection AuctionAssignments { get; set; } + public IReadOnlyCollection EventAlerts { get; set; } + public IReadOnlyCollection ManualStatuses { get; set; } + } + + public abstract class DbContextFromJson : TestWithSqlite + { + public DbContextTestSet GetTestAccounts(string filePath) + { + var testSet = new DbContextTestSet(); + + // Get the absolute path to the JSON file + var path = Path.IsPathRooted(filePath) + ? filePath + : Path.GetRelativePath(Directory.GetCurrentDirectory(), filePath); + + if (!File.Exists(path)) + { + throw new ArgumentException($"Could not find file at path: {path} + :: current Dir:{Directory.GetCurrentDirectory()}"); + } + + var fileData = File.ReadAllText(filePath); + var allData = JObject.Parse(fileData); + + var data = allData["repoAccounts"]; + testSet.RepoAccounts = data.ToObject>(); + + var assignments = allData["auctionAssignments"]; + testSet.AuctionAssignments = assignments.ToObject>(); + + var eventAlerts = allData["eventAlerts"]; + testSet.EventAlerts = eventAlerts.ToObject>(); + + var repoManualStatus = allData["repoManualStatus"]; + testSet.ManualStatuses = repoManualStatus.ToObject>(); + + return testSet; + } + + public static T GetTestObjectFromFile(string filePath) + { + // Get the absolute path to the JSON file + var path = Path.IsPathRooted(filePath) + ? filePath + : Path.GetRelativePath(Directory.GetCurrentDirectory(), filePath); + + if (!File.Exists(path)) + { + throw new ArgumentException($"Could not find file at path: {path} + :: current Dir:{Directory.GetCurrentDirectory()}"); + } + + var fileData = File.ReadAllText(filePath); + var data = JObject.Parse(fileData); + + return data.ToObject(); + } + + public AppDbContext GetContextWithData(string jsonFileName) + { + var options = new DbContextOptionsBuilder() + .UseInMemoryDatabase(Guid.NewGuid().ToString()) + .EnableSensitiveDataLogging(true) + .Options; + var context = new AppDbContext(options); + + var testData = GetTestAccounts(jsonFileName); + context.RepoAccounts.AddRange(testData.RepoAccounts); + context.AuctionAssignments.AddRange(testData.AuctionAssignments); + context.EventAlerts.AddRange(testData.EventAlerts); + context.RepoManualStatuses.AddRange(testData.ManualStatuses); + context.SaveChanges(); + + return context; + } + + public AppDbContext GetSqliteContextWithData(string jsonFileName) + { + var context = SqliteDbContext; + + var testData = GetTestAccounts(jsonFileName); + context.RepoAccounts.AddRange(testData.RepoAccounts); + context.AuctionAssignments.AddRange(testData.AuctionAssignments); + context.EventAlerts.AddRange(testData.EventAlerts); + context.RepoManualStatuses.AddRange(testData.ManualStatuses); + context.SaveChanges(); + + return context; + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Domain/Extensions/TemenosAccountExtensionTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Domain/Extensions/TemenosAccountExtensionTest.cs new file mode 100644 index 0000000..c56972b --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Domain/Extensions/TemenosAccountExtensionTest.cs @@ -0,0 +1,149 @@ +using Castle.DynamicProxy.Generators; +using LCU.API.Collections.CollectionsApiLib.Models; +using LCU.API.Collections.RepoApi.Domain.Extensions; +using Microsoft.AspNetCore.Mvc.ModelBinding; +using Microsoft.AspNetCore.Mvc.ViewFeatures.Internal; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Text; +using Xunit; +using Xunit.Sdk; + +namespace LCU.API.Collections.RepoApiTests.Extensions +{ + + public class TemenosAccountExtensionTest + { + + TemenosCase validCase = new TemenosCase() + { + CaseId = 1, + RepoStatus = RepoStatus.REPO, + CaseStatusId = 33 + }; + + TemenosCase invalidStatusCase = new TemenosCase() + { + CaseId = 2, + RepoStatus = RepoStatus.UNKNOWN, + CaseStatusId = 33 + }; + + TemenosCase invalidStatusIdCase = new TemenosCase() + { + CaseId = 3, + RepoStatus = RepoStatus.RECA, + CaseStatusId = 13 + }; + + public List validList, invalidStatusList, invalidStatusIdList, emptyList; + + TemenosAccount temenosAccount = new TemenosAccount(); + + public TemenosAccountExtensionTest() + { + validList = new List { validCase, invalidStatusCase, invalidStatusIdCase }; + invalidStatusIdList = new List { invalidStatusIdCase }; + invalidStatusList = new List { invalidStatusCase }; + emptyList = new List(); + } + [Fact] + public void HasOldIntellectStatus_Ok() + { + temenosAccount.CustomFieldMap = new Dictionary { }; + Assert.False(temenosAccount.HasOldIntellectStatus()); + + temenosAccount.CustomFieldMap = new Dictionary { { "User Status Code 1", null } }; + Assert.False(temenosAccount.HasOldIntellectStatus()); + + temenosAccount.CustomFieldMap = new Dictionary { { "User Status Code 1", "" } }; + Assert.False(temenosAccount.HasOldIntellectStatus()); + + temenosAccount.CustomFieldMap = new Dictionary { { "User Status Code 1", "OLDSTATUS" } }; + Assert.True(temenosAccount.HasOldIntellectStatus()); + + + } + + [Fact] + public void HasOpenRecoveryCase_OK() + { + temenosAccount.Cases = new ReadOnlyCollection(validList); + + Assert.True(temenosAccount.HasOpenRecoveryCase()); + + temenosAccount.Cases = new ReadOnlyCollection(invalidStatusIdList); + + Assert.False(temenosAccount.HasOpenRecoveryCase()); + + temenosAccount.Cases = new ReadOnlyCollection(invalidStatusList); + + Assert.False(temenosAccount.HasOpenRecoveryCase()); + + temenosAccount.Cases = new ReadOnlyCollection(emptyList); + + Assert.False(temenosAccount.HasOpenRecoveryCase()); + } + + [Fact] + public void HasSpecificCase_OK() + { + temenosAccount.Cases = new ReadOnlyCollection(emptyList); + + Assert.False(temenosAccount.HasSpecificCase(1)); + + temenosAccount.Cases = new ReadOnlyCollection(validList); + + Assert.True(temenosAccount.HasSpecificCase(1)); + Assert.False(temenosAccount.HasSpecificCase(99)); + } + + [Fact] + public void FindRecoveryCaseOrDefault_OK() + { + temenosAccount.Cases = new ReadOnlyCollection(validList); + + var res = temenosAccount.FindRecoveryCaseOrDefault(1); + + Assert.Equal(validCase, res); + } + + [Fact] + public void FindRecoveryCaseOrDefault_Empty_Cases() + { + temenosAccount.Cases = new ReadOnlyCollection(emptyList); + + var res = temenosAccount.FindRecoveryCaseOrDefault(1); + + Assert.Null(res); + + temenosAccount.Cases = null; + + res = temenosAccount.FindRecoveryCaseOrDefault(1); + + Assert.Null(res); + } + + [Fact] + public void FindRecoveryCaseOrDefault_Id_Not_Exist() + { + temenosAccount.Cases = new ReadOnlyCollection(validList); + var res = temenosAccount.FindRecoveryCaseOrDefault(22); + + Assert.Null(res); + } + + [Fact] + public void FindRecoveryCaseOrDefault_Id_Points_To_Bad_Case() + { + temenosAccount.Cases = new ReadOnlyCollection(validList); + var res = temenosAccount.FindRecoveryCaseOrDefault(2); + + Assert.Equal(invalidStatusCase, res); + } + + + } + +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Domain/ProcessorTestInput.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Domain/ProcessorTestInput.cs new file mode 100644 index 0000000..2fe853f --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Domain/ProcessorTestInput.cs @@ -0,0 +1,21 @@ +using System.Collections.Generic; +using LCU.API.Collections.CollectionsApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.Consumer; + +namespace LCU.API.Collections.RepoApiTests.Domain +{ + public class ProcessorTestInput + { + public List RepoLetters { get; set; } + public List TemenosHistory { get; set; } + public List CoreTransactions { get; set; } + public TemenosAccount TemenosAccount { get; set; } + public LoanDetail LoanDetail { get; set; } + public MemberDetail MemberDetail { get; set; } + + public RepoAccount RepoAccount { get; set; } + + public List CollateralDetails { get; set; } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/EmailerTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/EmailerTest.cs new file mode 100644 index 0000000..0bc3705 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/EmailerTest.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.Net.Http; +using LCU.API.Collections.RepoApi; +using LCU.API.Collections.RepoApi.Configuration; +using LCU.API.Collections.RepoApi.Services; +using LCU.Shared.Collections.RepoApiLib.Models; +using Moq; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests +{ + public class EmailerTest + { + private readonly Mock _mockHttpClientFactory; + private readonly Mock _mockEventAlertService; + private readonly IEmailer emailer; + + public EmailerTest() + { + var mockConsumerConfiguration = new Mock(); + _mockHttpClientFactory = new Mock(); + _mockEventAlertService = new Mock(); + emailer = new Emailer(_mockHttpClientFactory.Object, mockConsumerConfiguration.Object, + _mockEventAlertService.Object); + } + + [Fact] + public async System.Threading.Tasks.Task Update_Hourly_Alert_Email_SuccessAsync() + { + var testAlerts = new List() + { + new EventAlert() + { + DateAdded = DateTime.Now, + AccountNo = "123456-134", + RepoId = 777777, + Message = "Alert Message" + } + }; + + _mockEventAlertService.Setup(service => + service.ListWithinDateRange(It.IsAny(), It.IsAny())) + .ReturnsAsync(testAlerts); + + var endTime = DateTime.Now; + await emailer.SendAlertSummaryEmailWithEndTime(endTime); + + _mockEventAlertService.Verify( + foo => foo.ListWithinDateRange(It.IsAny(), It.IsAny()), Times.Once); + Assert.NotNull(emailer); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Extensions/ModelStateMessagesTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Extensions/ModelStateMessagesTest.cs new file mode 100644 index 0000000..54cef97 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Extensions/ModelStateMessagesTest.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Text; +using LCU.API.Collections.RepoApi.Extensions; +using Microsoft.AspNetCore.Mvc.ModelBinding; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.Extensions +{ + public class ModelStateMessagesTest + { + + [Fact] + public void GetErrorMessages_NoCrash() + { + var results = ModelStateMessages.GetErrorMessages(null); + Assert.NotNull(results); + } + + [Fact] + public void GetErrorMessages_Ok() + { + var dictionary = new ModelStateDictionary(); + var results = ModelStateMessages.GetErrorMessages(dictionary); + Assert.NotNull(results); + } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/HostedServices/RepoQueueConsumerServiceTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/HostedServices/RepoQueueConsumerServiceTest.cs new file mode 100644 index 0000000..84c0508 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/HostedServices/RepoQueueConsumerServiceTest.cs @@ -0,0 +1,39 @@ +using System.Collections.Generic; +using Xunit; +using Moq; +using LCU.API.Collections.RepoApi.HostedServices; +using LCU.API.Collections.RepoApi.Configuration; +using LCU.Shared.Realtime.QueueLib.Models; +using Microsoft.Extensions.DependencyInjection; + +namespace LCU.API.Collections.RepoApiTests.HostedServices +{ + public class RepoQueueConsumerServiceTest + { + private RepoApiConfiguration _repoApiConfig; + private Mock _mockQueueConnectionConfig; + private RepoQueueConsumerService _repoQueueConsumerService; + private Mock _mockScopeFactory; + + public RepoQueueConsumerServiceTest() + { + _repoApiConfig = new RepoApiConfiguration() + { + QueueConsumerConfigs = StaticTestConfigs.GetQueueConsumerConfigs() + }; + _mockQueueConnectionConfig = new Mock(); + _mockScopeFactory = new Mock(); + _repoQueueConsumerService = new RepoQueueConsumerService(_mockQueueConnectionConfig.Object, _repoApiConfig, _mockScopeFactory.Object ); + } + + + + [Fact] + public void BasicConstruction() + { + Assert.NotNull(_repoQueueConsumerService); + } + + + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/HostedServices/RepoQueueProducerServiceTests.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/HostedServices/RepoQueueProducerServiceTests.cs new file mode 100644 index 0000000..ca5474c --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/HostedServices/RepoQueueProducerServiceTests.cs @@ -0,0 +1,84 @@ +using System.Collections.Generic; +using Xunit; +using Moq; +using LCU.API.Collections.RepoApi.HostedServices; +using LCU.API.Collections.RepoApi.Services; +using LCU.API.Collections.RepoApi.Configuration; +using LCU.API.Collections.RepoApi.DataAccess; +using LCU.Shared.Collections.RepoApiLib.Models.Producer; +using LCU.API.Collections.RepoApi.Exceptions; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using LCU.Shared.Realtime.QueueLib.Models; +using LCU.Shared.Realtime.QueueLib.Queue; + +namespace LCU.API.Collections.RepoApiTests.HostedServices +{ + public class RepoQueueProducerServiceTests + { + private RepoApiConfiguration _repoApiConfig; + private Mock _mockRepoAccountService; + private Mock _mockQueueConnectionConfig; + private QueueItemProducer _mockQueueItemProducer; + private Mock _mockSettingsService; + private Mock _mockProcessingReceiptService; + private Mock _mockCollectionsDao; + private RepoQueueProducerService _repoQueueProducerService; + + public RepoQueueProducerServiceTests() + { + _repoApiConfig = new RepoApiConfiguration() + { + QueueConsumerConfigs = StaticTestConfigs.GetQueueConsumerConfigs() + }; + _mockRepoAccountService = new Mock(); + _mockQueueConnectionConfig = new Mock(); + _mockQueueItemProducer = new QueueItemProducer(_mockQueueConnectionConfig.Object); + _mockProcessingReceiptService = new Mock(); + _mockSettingsService = new Mock(); + _mockCollectionsDao = new Mock(); + _repoQueueProducerService = new RepoQueueProducerService(_mockQueueConnectionConfig.Object, + _mockRepoAccountService.Object, _repoApiConfig, _mockSettingsService.Object, + _mockCollectionsDao.Object, _mockProcessingReceiptService.Object); + } + + [Fact] + public async void RetrieveRepoAccountsOfInterest_OK() + { + //setup + _mockRepoAccountService.Setup(serv => serv.GetItemsForProcessing()).ReturnsAsync(new List() + { + new ProcessingItem() + { + AccountNo = "123456-789" + }, + new ProcessingItem() + { + AccountNo = "223456-789" + }, + new ProcessingItem() + { + AccountNo = "323456-789" + } + }); + + //act + var res = await _repoQueueProducerService.RetrieveRepoAccountsOfInterest(); + + //assert + Assert.Equal(3, res.Count); + } + + [Fact] + public async void RetrieveRepoAccountsOfInterest_Exception() + { + //setup + _mockRepoAccountService.Setup(serv => serv.GetItemsForProcessing()).ThrowsAsync(new ServerErrorException()); + + //act + var res = await _repoQueueProducerService.RetrieveRepoAccountsOfInterest(); + + //assert + Assert.Equal(0, res.Count); + } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/LCU.API.Collections.RepoApiTests.csproj b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/LCU.API.Collections.RepoApiTests.csproj new file mode 100644 index 0000000..ab0b6be --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/LCU.API.Collections.RepoApiTests.csproj @@ -0,0 +1,75 @@ + + + + netcoreapp2.2 + + false + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers + + + + + + + + + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + Always + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + + + + + + diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/NadaMmrConditionValueTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/NadaMmrConditionValueTest.cs new file mode 100644 index 0000000..c34f909 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/NadaMmrConditionValueTest.cs @@ -0,0 +1,172 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using LCU.API.Collections.RepoApi.Domain.FloorPricing; +using LCU.API.Collections.RepoApi.Domain.FloorPricing.Strategies; +using LCU.API.Collections.RepoApi.Services; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.WebServices.NADA; +using Moq; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests +{ + public class NadaMmrConditionValueTest + { + private IEnumerable GetFloorPricingParams() + { + return new List() + { + new VehicleFloorPricingParameters() + { + LowCondition = 0, + HighCondition = 1.5m, + PercentageOf = 95, + MMRAdjustedValue = "Regional Value", + NADAFirstValue = "Low Value", + NADASecondValue = "Low Value" + }, + new VehicleFloorPricingParameters() + { + LowCondition = 1.6m, + HighCondition = 2.5m, + PercentageOf = 95, + MMRAdjustedValue = "National Value", + NADAFirstValue = "Low Value", + NADASecondValue = "Avg Value" + }, + new VehicleFloorPricingParameters() + { + LowCondition = 2.6m, + HighCondition = 3.5m, + PercentageOf = 95, + MMRAdjustedValue = "Regional Value", + NADAFirstValue = "Avg Value", + NADASecondValue = "Avg Value" + }, + new VehicleFloorPricingParameters() + { + LowCondition = 3.6m, + HighCondition = 4.5m, + PercentageOf = 95, + MMRAdjustedValue = "Regional Value", + NADAFirstValue = "Avg Value", + NADASecondValue = "High Value" + }, + new VehicleFloorPricingParameters() + { + LowCondition = 4.6m, + HighCondition = 5.0m, + PercentageOf = 95, + MMRAdjustedValue = "National Value", + NADAFirstValue = "High Value", + NADASecondValue = "High Value" + } + }; + } + + [Fact] + public void Full_Calculate_Floor_Price_OK() + { + NadaMmrConditionValue calculator = new NadaMmrConditionValue(); + FloorPriceCalculationParams fpcParams = new FloorPriceCalculationParams() + { + ImsAutoFileData = new ImsAutoFileData() + { + VehicleGrade = 3.0m, + ApprovedVehicleGrade = 3.0m, + AuctionGuideBookPrice = 5004.0m + }, + CollateralValuation = new CollateralValuation() + { + LowAdjustedAuctionValue = 2000, + HighAdjustedAuctionValue = 3000, + AverageAdjustedAuctionValue = 2500 + }, + VehicleFloorPricingParameters = GetFloorPricingParams() + }; + var result = calculator.CalculateFloorPrice(fpcParams); + Assert.NotNull(result); + Assert.Equal(3565, result.FloorPrice); + Assert.True(result.Success); + } + + [Fact] + public void Full_Calculate_Floor_Price_NoNada() + { + NadaMmrConditionValue calculator = new NadaMmrConditionValue(); + FloorPriceCalculationParams fpcParams = new FloorPriceCalculationParams() + { + ImsAutoFileData = new ImsAutoFileData() + { + VehicleGrade = 3.0m, + ApprovedVehicleGrade = 3.0m, + AuctionGuideBookPrice = 5004.0m + }, + CollateralValuation = null, + VehicleFloorPricingParameters = GetFloorPricingParams() + }; + var result = calculator.CalculateFloorPrice(fpcParams); + Assert.NotNull(result); + + Assert.False(result.Success); + } + + [Fact] + public void Full_Calculate_Floor_Price_NoAutoIms() + { + NadaMmrConditionValue calculator = new NadaMmrConditionValue(); + FloorPriceCalculationParams fpcParams = new FloorPriceCalculationParams() + { + ImsAutoFileData = null, + CollateralValuation = new CollateralValuation() + { + LowAdjustedAuctionValue = 2000, + HighAdjustedAuctionValue = 3000, + AverageAdjustedAuctionValue = 2500 + }, + VehicleFloorPricingParameters = GetFloorPricingParams() + }; + var result = calculator.CalculateFloorPrice(fpcParams); + Assert.NotNull(result); + Assert.False(result.Success); + } + + [Fact] + public void Full_Calculate_Floor_Price_No_Prices() + { + NadaMmrConditionValue calculator = new NadaMmrConditionValue(); + FloorPriceCalculationParams fpcParams = new FloorPriceCalculationParams() + { + ImsAutoFileData = new ImsAutoFileData() + { + VehicleGrade = 3.0m, + ApprovedVehicleGrade = 3.0m, + AuctionGuideBookPrice = 5004.0m, + MMRNationalAdjustedPrice = 0m, + MMRRegionalAdjustedPrice = 0m + }, + CollateralValuation = new CollateralValuation() + { + LowAdjustedAuctionValue = 0, + HighAdjustedAuctionValue = 0, + AverageAdjustedAuctionValue = 0 + }, + VehicleFloorPricingParameters = GetFloorPricingParams() + }; + var result = calculator.CalculateFloorPrice(fpcParams); + Assert.NotNull(result); + Assert.Equal(-1, result.ResultWeight); + Assert.False(result.Success); + } + + [Fact] + public void Empty_Nada_Price_List_Wont_Throw() + { + NadaMmrConditionValue calculator = new NadaMmrConditionValue(); + List nadaValues = new List(); + var result = calculator.GetNadaAvgValue(nadaValues); + Assert.Equal(0, result); + } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Processor/AutoImsAuctionProcessorServiceTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Processor/AutoImsAuctionProcessorServiceTest.cs new file mode 100644 index 0000000..11404c2 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Processor/AutoImsAuctionProcessorServiceTest.cs @@ -0,0 +1,91 @@ +using LCU.API.Collections.RepoApi.Services.AutoIms; +using LCU.Shared.Collections.RepoApiLib.Models; +using Moq; +using Xunit; +using AuctionAssignment = LCU.Shared.Collections.RepoApiLib.Models.AuctionAssignment; + +namespace LCU.API.Collections.RepoApiTests.Processor +{ + public class AutoImsAuctionProcessorServiceTest + { + private readonly Mock mockAuctionProcessorDao; + + private readonly IAutoImsAuctionProcessorService autoImsAuctionProcessorService; + + public AutoImsAuctionProcessorServiceTest() + { + mockAuctionProcessorDao = new Mock(); + + autoImsAuctionProcessorService = + new AutoImsAuctionProcessorService( mockAuctionProcessorDao.Object); + } + + [Fact] + public void Basic_Construct_Test() + { + Assert.NotNull(autoImsAuctionProcessorService); + } + + [Fact] + public void ImportSingleAutoImsAuction_NO_VIN_Test() + { + var singleItem = new ImsAutoFileData() + { + VIN = "1FMCU93G-19KB115 " + }; + + Assert.NotNull(autoImsAuctionProcessorService); + var result = autoImsAuctionProcessorService.ImportSingleAutoImsAuction(singleItem); + Assert.NotNull(result); + Assert.False(result.Success); + } + + [Fact] + public void ImportSingleAutoImsAuction_Update_Test() + { + var incomingAutoFile = new ImsAutoFileData() + { + VIN = "1FMCU93G19KB11152", + AuctionCustomerNo = "12345-678", + AuctionAssignmentId = 99 + }; + var repoAccount = new RepoAccount() + { + RepoId = 1, + PrimaryIndividualId = "12345", + LoanNo = 678 + }; + var auctionAssignment = new AuctionAssignment() + { + ID = 99, + AutoIMS = new ImsAutoFileData() + { + + } + }; + var existingAutoFile = auctionAssignment.AutoIMS; + + mockAuctionProcessorDao + .Setup(x => x.FindRepoForImsAuctionItem(incomingAutoFile)) + .Returns(repoAccount); + mockAuctionProcessorDao.Setup(x => x.FindAuctionAssignment(incomingAutoFile)) + .Returns(auctionAssignment); + mockAuctionProcessorDao.Setup(x => x.FindImsAuctionFileData(auctionAssignment.ID, incomingAutoFile.AuctionCustomerNo, incomingAutoFile.VIN)) + .Returns( (ImsAutoFileData)null); + + mockAuctionProcessorDao.Setup(x => x.FindByAuctionAssignmentIdAsync(auctionAssignment.ID)) + .Returns(existingAutoFile); + + + mockAuctionProcessorDao.Setup( x =>x.UpdateExistingFile(existingAutoFile,incomingAutoFile)).Returns(incomingAutoFile); + mockAuctionProcessorDao.Setup( x =>x.Add(existingAutoFile)).Verifiable(); + + Assert.NotNull(autoImsAuctionProcessorService); + var result = autoImsAuctionProcessorService.ImportSingleAutoImsAuction(incomingAutoFile); + Assert.NotNull(result); + } + + + + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Processor/AutoImsDownloaderServiceTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Processor/AutoImsDownloaderServiceTest.cs new file mode 100644 index 0000000..7c0b61b --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Processor/AutoImsDownloaderServiceTest.cs @@ -0,0 +1,69 @@ +using System.Collections.Generic; +using System.IO; +using System.Linq; +using LCU.API.Collections.RepoApi.Configuration; +using LCU.API.Collections.RepoApi.Services.AutoIms; +using Moq; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.Processor +{ + public class AutoImsDownloaderServiceTest + { + private readonly RepoApiConfiguration configuration; + private readonly Mock mockAuctionFtpClientService; + private readonly IAutoImsDownloaderService autoImsDownloaderService; + + public AutoImsDownloaderServiceTest() + { + configuration = new RepoApiConfiguration() + { + LocalDirectoryPath = "./Processor/SampleData" + }; + mockAuctionFtpClientService = new Mock(); + autoImsDownloaderService = + new AutoImsDownloaderService(mockAuctionFtpClientService.Object, configuration); + } + + [Fact] + public void Basic_Construct_Test() + { + Assert.NotNull(autoImsDownloaderService); + } + + [Fact] + public void Basic_Download_Test() + { + mockAuctionFtpClientService.Setup(service => service.Download()) + .Verifiable("Call Download"); + var files = autoImsDownloaderService.DownLoadAuctionFiles(); + mockAuctionFtpClientService.VerifyAll(); + } + + [Fact] + public void Combine_Local_Test() + { + var existing = new Dictionary() + { + {new FileInfo("AutoImsDownloaderServiceTest.cs"), "success"} + }; + var files = autoImsDownloaderService.CombineWithLocalFiles(existing); + Assert.NotNull(files); + Assert.Equal(3, files.Keys.Count); + } + + [Fact] + public void Convert_To_File_List_Test() + { + var existing = new Dictionary() + { + {new FileInfo("AutoImsDownloaderServiceTest.cs"), "success"}, + {new FileInfo("LAND_DATA_TEST_FAIL.csv"), "error"}, + {new FileInfo("LAND_DATA_TEST.csv"), "success"} + }; + var files = autoImsDownloaderService.ConvertToFileList(existing); + Assert.NotNull(files); + Assert.Equal(2, files.Count()); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Processor/AutoImsImporterServiceTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Processor/AutoImsImporterServiceTest.cs new file mode 100644 index 0000000..5957a93 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Processor/AutoImsImporterServiceTest.cs @@ -0,0 +1,188 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using LCU.API.Collections.RepoApi.Services; +using LCU.API.Collections.RepoApi.Services.AutoIms; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.AutoIms; +using LCU.Shared.Collections.RepoApiLib.Models.Results; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using Moq; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.Processor +{ + public class AutoImsImporterServiceTest + { + private readonly IAutoImsImporterService autoImsImporterService; + private readonly Mock mockAuctionAssignmentRepository; + private readonly Mock mockAuctionAssignmentService; + private readonly Mock mockAutoImsNoteProcessorService; + private readonly Mock mockAutoImsAuctionProcessorService; + + private readonly Mock _mockFloorPricingService; + + public AutoImsImporterServiceTest() + { + mockAuctionAssignmentRepository = new Mock(); + + mockAutoImsNoteProcessorService = new Mock(); + mockAutoImsAuctionProcessorService = new Mock(); + _mockFloorPricingService = new Mock(); + mockAuctionAssignmentService = new Mock(); + + autoImsImporterService = + new AutoImsImporterService(mockAuctionAssignmentRepository.Object, + mockAutoImsNoteProcessorService.Object, + mockAutoImsAuctionProcessorService.Object, + _mockFloorPricingService.Object, + mockAuctionAssignmentService.Object); + } + + [Fact] + public void Basic_Construct_Test() + { + Assert.NotNull(autoImsImporterService); + } + + [Fact] + public void Import_Data_Files_Test() + { + mockAutoImsAuctionProcessorService.Setup(x => x.ImportSingleAutoImsAuction(It.IsAny())) + .Returns( + new ImportResultRow()); + + Assert.NotNull(autoImsImporterService); + var results = autoImsImporterService.ImportDataFile(CreateDummyImsData()); + Assert.NotNull(results); + Assert.Equal(2, results.Count()); + mockAutoImsAuctionProcessorService.Verify(x => x.ImportSingleAutoImsAuction(It.IsAny()), + Times.Exactly(2)); + } + + [Fact] + public void Import_Notes_Test() + { + mockAutoImsNoteProcessorService.Setup(x => x.ImportSingleNoteRow(It.IsAny())) + .Returns(new AuctionAssignmentNote()); + + Assert.NotNull(autoImsImporterService); + var results = autoImsImporterService.ImportNotesToDatabase(CreateDummyNotes()); + Assert.NotNull(results); + Assert.Equal(2, results.Count()); + mockAutoImsNoteProcessorService.Verify(x => x.ImportSingleNoteRow(It.IsAny()), + Times.Exactly(2)); + } + + [Fact] + public void Set_All_Floors_Test() + { + var mockReadyForFloor = new PagedResult() + { + Total = 0, + Items = new List() + { + new AuctionAssignment() + { + RepoId = 111, + CollateralVIN = "12312321312" + } + } + }; + var floorPriceResult = new FloorPriceCalculationResultSet() + { + PrimaryResult = new FloorPriceCalculationResult() + { + FloorPrice = 1000, + Success = true, + ResultWeight = 99, + StrategyName = "Guessing" + } + }; + mockAuctionAssignmentRepository.Setup(x => x.ListReadyForFloorPriceAsync()).ReturnsAsync(mockReadyForFloor); + _mockFloorPricingService.Setup(x => x.DetermineFloorPrice(It.IsAny())) + .Returns(floorPriceResult); + mockAuctionAssignmentService.Setup(x => x.UpdateAsync(It.IsAny())) + .ReturnsAsync(new AuctionAssignment()); + + Assert.NotNull(autoImsImporterService); + autoImsImporterService.SetAllAvailableFloors(); + mockAuctionAssignmentRepository.Verify(x => x.ListReadyForFloorPriceAsync(), Times.Exactly(1)); + _mockFloorPricingService.Verify(x => x.DetermineFloorPrice(It.IsAny()), + Times.Exactly(1)); + mockAuctionAssignmentService.Verify(x => x.UpdateAsync(It.IsAny()), + Times.Exactly(1)); + } + + [Fact] + public void Set_All_Floors_Test_NULL_AuctionAssignments() + { + var mockReadyForFloor = new PagedResult() + { + // null on purpose. + }; + var floorPriceResult = new FloorPriceCalculationResultSet() + { + PrimaryResult = new FloorPriceCalculationResult() + { + FloorPrice = 1000, + Success = true, + ResultWeight = 99, + StrategyName = "Guessing" + } + }; + mockAuctionAssignmentRepository.Setup(x => x.ListReadyForFloorPriceAsync()).ReturnsAsync(mockReadyForFloor); + _mockFloorPricingService.Setup(x => x.DetermineFloorPrice(It.IsAny())) + .Returns(floorPriceResult); + mockAuctionAssignmentService.Setup(x => x.UpdateAsync(It.IsAny())) + .ReturnsAsync(new AuctionAssignment()); + + Assert.NotNull(autoImsImporterService); + autoImsImporterService.SetAllAvailableFloors(); + mockAuctionAssignmentRepository.Verify(x => x.ListReadyForFloorPriceAsync(), Times.Exactly(1)); + _mockFloorPricingService.Verify(x => x.DetermineFloorPrice(It.IsAny()), + Times.Never); + mockAuctionAssignmentService.Verify(x => x.UpdateAsync(It.IsAny()), Times.Never); + } + + private IEnumerable CreateDummyImsData() + { + return new[] + { + new ImsAutoFileData() + { + }, + new ImsAutoFileData() + { + } + }; + } + + private IEnumerable CreateDummyNotes() + { + return new[] + { + new AuctionAssignmentNote() + { + Text = "test1", + AuctionCustomerNo = "123456-789", + DateWritten = DateTime.Today, + Origin = "testing", + Writer = "tester", + Type = "XX", + AuctionAssignmentId = 12345 + }, + new AuctionAssignmentNote() + { + Text = "test2", + AuctionCustomerNo = "223456-789", + DateWritten = DateTime.Today, + Origin = "testing", + Writer = "tester", + Type = "XX", + AuctionAssignmentId = 12346 + } + }; + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Processor/AutoImsNoteProcessorServiceTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Processor/AutoImsNoteProcessorServiceTest.cs new file mode 100644 index 0000000..c7a25dc --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Processor/AutoImsNoteProcessorServiceTest.cs @@ -0,0 +1,99 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Services.AutoIms; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using Moq; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.Processor +{ + public class AutoImsNoteProcessorServiceTest + { + private readonly IAutoImsNoteProcessorService autoImsNoteProcessorService; + + private readonly Mock mockAuctionAssignmentNoteRepository; + private readonly Mock mockUnitOfWork; + + public AutoImsNoteProcessorServiceTest() + { + mockAuctionAssignmentNoteRepository = new Mock(); + mockUnitOfWork = new Mock(); + + autoImsNoteProcessorService = + new AutoImsNoteProcessorService(mockAuctionAssignmentNoteRepository.Object, mockUnitOfWork.Object); + } + + [Fact] + public void Basic_Construct_Test() + { + Assert.NotNull(autoImsNoteProcessorService); + } + + [Fact] + public void Import_Notes_Test() + { + mockAuctionAssignmentNoteRepository.Setup(service => + service.FindConflictingNotes(It.IsAny(), "test1", It.IsAny())) + .Returns(Task.FromResult(CreateEmptyNotes())).Verifiable("Call find duplicate"); + mockAuctionAssignmentNoteRepository.Setup(service => + service.FindConflictingNotes(It.IsAny(), "test2", It.IsAny())) + .Returns(Task.FromResult(CreateDummyNotes())); + mockAuctionAssignmentNoteRepository.Setup(service => service.AddAsync(It.IsAny())) + .Verifiable("Call add note"); + + var notes = CreateDummyNotes(); + var results = new List(); + foreach (var auctionAssignmentNote in notes) + { + var result = autoImsNoteProcessorService.ImportSingleNoteRow(auctionAssignmentNote); + if (result != null) + { + results.Add(result); + } + } + + mockAuctionAssignmentNoteRepository.Verify( + foo => foo.FindConflictingNotes(It.IsAny(), It.IsAny(), It.IsAny()), + Times.Exactly(2)); + mockAuctionAssignmentNoteRepository.Verify(foo => foo.AddAsync(It.IsAny()), + Times.Exactly(1)); + Assert.NotNull(results); + Assert.Equal(2, results.Count()); + } + + private IEnumerable CreateEmptyNotes() + { + return new List(); + } + + private IEnumerable CreateDummyNotes() + { + return new[] + { + new AuctionAssignmentNote() + { + Text = "test1", + AuctionCustomerNo = "123456-789", + DateWritten = DateTime.Today, + Origin = "testing", + Writer = "tester", + Type = "XX", + AuctionAssignmentId = 12345 + }, + new AuctionAssignmentNote() + { + Text = "test2", + AuctionCustomerNo = "223456-789", + DateWritten = DateTime.Today, + Origin = "testing", + Writer = "tester", + Type = "XX", + AuctionAssignmentId = 12346 + } + }; + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Processor/ImsAutoFileDataConverterTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Processor/ImsAutoFileDataConverterTest.cs new file mode 100644 index 0000000..d94f152 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Processor/ImsAutoFileDataConverterTest.cs @@ -0,0 +1,32 @@ +using System.IO; +using System.Linq; +using LCU.API.Collections.RepoApi.Configuration; +using LCU.API.Collections.RepoApi.Services.AutoIms; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.Processor +{ + public class ImsAutoFileDataConverterTest + { + [Fact] + public void Convert_File_All_Fields() + { + string fileName = "Processor\\SampleData\\LAND_DATA_TEST.csv"; + + FileStream stream = null; + try + { + stream = File.OpenRead(fileName); + var config = new RepoApiConfiguration(); + var processor = new ImsAutoFileDataConverter(config); + var results = processor.CsvToImsAutoFileData(stream); + Assert.NotNull(results); + Assert.Equal(22, results.Count()); + } + catch (IOException ioException) + { + Assert.True(false, "FAiled to open file "); + } + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Processor/ImsAutoFileNoteConverterTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Processor/ImsAutoFileNoteConverterTest.cs new file mode 100644 index 0000000..7f2ee4f --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Processor/ImsAutoFileNoteConverterTest.cs @@ -0,0 +1,56 @@ +using System; +using System.IO; +using System.Linq; +using LCU.API.Collections.RepoApi.Services.AutoIms; +using LCU.Shared.Collections.RepoApiLib.Models; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.Processor +{ + public class ImsAutoFileNoteConverterTest + { + [Fact] + public void Convert_File_All_Fields() + { + string fileName = "Processor\\SampleData\\LAND_DATA_NOTES_TEST.csv"; + + FileStream stream = null; + try + { + stream = File.OpenRead(fileName); + + var processor = new ImsAutoFileNoteConverter(); + var results = processor.CsvToImsAutoFileNotes(stream); + Assert.NotNull(results); + Assert.Equal(104, results.Count()); + + var compressed = processor.CompressIdentifyingRows(results); + Assert.NotNull(compressed); + Assert.Equal(85, compressed.Count()); + } + catch (IOException ioException) + { + Assert.True(false, "FAiled to open file "); + } + } + + [Fact] + public void Convert_Sample_Fields() + { + var processor = new ImsAutoFileNoteConverter(); + var note = new AuctionAssignmentNote(); + processor.SetFieldByName(note, "Cn. Acc. #", ""); + processor.SetFieldByName(note, "Origin", "EDI"); + processor.SetFieldByName(note, "Writer", "CSCHMARJE(AUC)"); + processor.SetFieldByName(note, "Type", "Auction"); + processor.SetFieldByName(note, "Text", "ETA 9/18"); + processor.SetFieldByName(note, "Date Written", "09/11/2019 12:00 AM EDT"); + + Assert.Equal("EDI", note.Origin); + Assert.Equal("CSCHMARJE(AUC)", note.Writer); + Assert.Equal("Auction", note.Type); + Assert.Equal("ETA 9/18", note.Text); + Assert.Equal(DateTime.Parse("09/11/2019 12:00 AM"), note.DateWritten); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Processor/SampleData/LAND_DATA_NOTES_TEST.csv b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Processor/SampleData/LAND_DATA_NOTES_TEST.csv new file mode 100644 index 0000000..2879609 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Processor/SampleData/LAND_DATA_NOTES_TEST.csv @@ -0,0 +1,106 @@ +"Cn. Acc. #","Origin","Writer","Type","Text","Date Written" +"--------------------","------------","------------","--------","--------","------------------------" +"965536-143" +,"EDI",,"Auction","ASSIGNMENT DOWNLOADED TO AUCT SYSTEM ON 6/06/19 AT 15:40:50","06/06/2019 04:52 PM EDT" +,"EDI","CCESS(AUC)","Auction","INOP HAS KEYS BUT WON`T START","06/07/2019 12:00 AM EDT" +,"system","EDI Auction(AUC)","System","Mileage has been changed from to 186910","06/10/2019 03:22 PM EDT" +,"system","Web Service(CN)","Hold Change","This vehicle (VIN:3G5DA03EX5S513625) has been placed on Legal Hold by Web Service. This vehicle should NOT BE SOLD. This hold is scheduled to expire on 07/31/2019.","06/25/2019 10:33 AM EDT" +,"system","System(CN)","Hold Change","The Legal Hold on this vehicle (VIN:3G5DA03EX5S513625) has been released by System. No holds are currently active for this vehicle.","07/31/2019 06:46 AM EDT" +"980316-143" +,"EDI",,"Auction","ASSIGNMENT DOWNLOADED TO AUCT SYSTEM ON 6/14/19 AT 15:43:17","06/14/2019 04:51 PM EDT" +,"EDI","RSTAUGAITE(AUC)","Auction","PENDING KEY BY AGENT","06/18/2019 12:00 AM EDT" +,"system","EDI Auction(AUC)","System","Mileage has been changed from to 1","06/19/2019 08:42 AM EDT" +,"system","EDI Auction(AUC)","System","Mileage has been changed from 1 to 36389","07/15/2019 03:15 PM EDT" +,"system","EDI Auction(AUC)","Document Shipment","Manheim Arena Illinois received the Title from Landmark Credit Union on 07/16/2019.","07/16/2019 12:20 PM EDT" +,"system","Web Service(CN)","Floor Change","Floor Price (Requested) changed to $14,510.00","07/24/2019 02:36 PM EDT" +,"EDI","EDI Auction(AUC)","Bid History","Daysrun: - ; Highest Bid Recorded by Auction: $15600","07/30/2019 11:46 AM EDT" +"909002-143" +,"EDI","CSCHMARJE(AUC)","Auction","ETA 6/24","06/18/2019 12:00 AM EDT" +,"system","EDI Auction(AUC)","System","Mileage has been changed from to 72714","06/19/2019 04:28 PM EDT" +,"system","EDI Auction(AUC)","System","Mileage has been changed from 72714 to 72715","06/20/2019 09:41 AM EDT" +,"system","EDI Auction(AUC)","Document Shipment","Manheim Milwaukee received the Title from Landmark Credit Union on 07/09/2019.","07/09/2019 11:55 AM EDT" +,"system","Web Service(CN)","Floor Change","Floor Price (Requested) changed to $14,010.00","07/13/2019 04:06 PM EDT" +,"EDI","EDI Auction(AUC)","Bid History","Daysrun: - ; Highest Bid Recorded by Auction: $11300","07/17/2019 11:29 AM EDT" +,"EDI","EDI Auction(AUC)","Bid History","Daysrun: 1; Highest Bid Recorded by Auction: $11300","07/31/2019 04:09 AM EDT" +"889307-143" +,"EDI",,"Auction","ASSIGNMENT DOWNLOADED TO AUCT SYSTEM ON 6/19/19 AT 16:25:19","06/19/2019 05:37 PM EDT" +,"system","EDI Auction(AUC)","System","Mileage has been changed from to 87590","06/25/2019 12:25 PM EDT" +,"system","EDI Auction(AUC)","Document Shipment","Manheim Arena Illinois received the Title from Landmark Credit Union on 07/16/2019.","07/16/2019 12:20 PM EDT" +,"system","Web Service(CN)","Floor Change","Floor Price (Requested) changed to $9,270.00","07/22/2019 05:18 PM EDT" +,"EDI","EDI Auction(AUC)","Bid History","Daysrun: - ; Highest Bid Recorded by Auction: $9100","07/30/2019 03:07 PM EDT" +"1030690-143" +,"EDI",,"Auction","ASSIGNMENT DOWNLOADED TO AUCT SYSTEM ON 6/19/19 AT 16:25:19","06/19/2019 05:37 PM EDT" +,"system","EDI Auction(AUC)","System","Mileage has been changed from to 1","06/24/2019 04:53 PM EDT" +,"system","EDI Auction(AUC)","System","Mileage has been changed from 1 to 36910","06/25/2019 03:42 PM EDT" +,"system","EDI Auction(AUC)","Document Shipment","Manheim Arena Illinois received the Title from Landmark Credit Union on 07/16/2019.","07/16/2019 12:20 PM EDT" +,"system","Web Service(CN)","Floor Change","Floor Price (Requested) changed to $12,015.00","07/24/2019 02:49 PM EDT" +,"EDI","EDI Auction(AUC)","Bid History","Daysrun: - ; Highest Bid Recorded by Auction: $11200","07/30/2019 03:07 PM EDT" +"1078388-143" +,"EDI",,"Auction","ASSIGNMENT DOWNLOADED TO AUCT SYSTEM ON 6/26/19 AT 11:05:04","06/26/2019 12:19 PM EDT" +,"EDI","RSTAUGAITE(AUC)","Auction","PENDING KEY BY AGENT","06/27/2019 12:00 AM EDT" +,"EDI","RSTAUGAITE(AUC)","Auction","ETA 07/09","07/08/2019 12:00 AM EDT" +,"system","EDI Auction(AUC)","System","Mileage has been changed from to 1","07/08/2019 10:23 PM EDT" +,"system","EDI Auction(AUC)","System","Mileage has been changed from 1 to 16039","07/24/2019 08:44 AM EDT" +,"system","EDI Auction(AUC)","Document Shipment","Manheim Arena Illinois received the Title from Landmark Credit Union on 07/24/2019.","07/24/2019 11:34 AM EDT" +,"system","Web Service(CN)","Floor Change","Floor Price (Requested) changed to $35,000.00","07/24/2019 02:45 PM EDT" +,"system","EDI Auction(AUC)","System","Mileage has been changed from 16039 to 16139","07/24/2019 05:49 PM EDT" +,"EDI","EDI Auction(AUC)","Bid History","Daysrun: - ; Highest Bid Recorded by Auction: $33400","07/30/2019 11:46 AM EDT" +,"EDI","EDI Auction(AUC)","Bid History","Daysrun: 1; Highest Bid Recorded by Auction: $33400","07/31/2019 04:15 AM EDT" +"973697144" +,"EDI","CSCHMARJE(AUC)","Auction","ETA 7/8","07/05/2019 12:00 AM EDT" +,"system","EDI Auction(AUC)","System","Mileage has been changed from to 157606","07/08/2019 02:55 PM EDT" +,"system","Web Service(CN)","Document Shipment","Landmark Credit Union sent the Title to Manheim Milwaukee on 07/16/2019.","07/16/2019 12:45 PM EDT" +,"system","EDI Auction(AUC)","Document Shipment","Manheim Milwaukee received the Title from Landmark Credit Union on 07/17/2019.","07/17/2019 12:06 PM EDT" +,"system","Web Service(CN)","Floor Change","Floor Price (Requested) changed to $9,415.00","07/18/2019 11:31 AM EDT" +,"EDI","EDI Auction(AUC)","Bid History","Daysrun: - ; Highest Bid Recorded by Auction: $3200","07/24/2019 03:25 PM EDT" +,"EDI","EDI Auction(AUC)","Bid History","Daysrun: 1; Highest Bid Recorded by Auction: $3200","07/31/2019 04:09 AM EDT" +"817679144" +,"EDI",,"Auction","ASSIGNMENT DOWNLOADED TO AUCT SYSTEM ON 6/26/19 AT 11:45:57","06/26/2019 12:55 PM EDT" +,"system","EDI Auction(AUC)","System","Mileage has been changed from to 44535","07/02/2019 04:42 PM EDT" +,"system","EDI Auction(AUC)","Document Shipment","Manheim Arena Illinois received the Title from Landmark Credit Union on 07/24/2019.","07/24/2019 11:34 AM EDT" +,"system","Web Service(CN)","Floor Change","Floor Price (Requested) changed to $11,340.00","07/24/2019 02:53 PM EDT" +,"EDI","EDI Auction(AUC)","Bid History","Daysrun: - ; Highest Bid Recorded by Auction: $11200","07/30/2019 03:07 PM EDT" +"895537-143" +,"EDI",,"Auction","ASSIGNMENT DOWNLOADED TO AUCT SYSTEM ON 6/28/19 AT 14:38:56","06/28/2019 03:50 PM EDT" +,"system","EDI Auction(AUC)","System","Mileage has been changed from to 1","07/03/2019 06:51 PM EDT" +,"system","EDI Auction(AUC)","System","Mileage has been changed from 1 to 29870","07/08/2019 04:21 PM EDT" +,"system","Web Service(CN)","Floor Change","Floor Price (Requested) changed to $5,930.00","07/09/2019 09:40 AM EDT" +,"system","EDI Auction(AUC)","Document Shipment","Manheim Arena Illinois received the Title from Landmark Credit Union on 07/26/2019.","07/26/2019 10:34 AM EDT" +,"EDI","EDI Auction(AUC)","Bid History","Daysrun: - ; Highest Bid Recorded by Auction: $7600","07/30/2019 09:11 AM EDT" +"1015555-143" +,"EDI",,"Auction","ASSIGNMENT DOWNLOADED TO AUCT SYSTEM ON 6/28/19 AT 14:52:53","06/28/2019 04:06 PM EDT" +,"system","EDI Auction(AUC)","System","Mileage has been changed from to 14160","07/03/2019 12:38 PM EDT" +,"system","EDI Auction(AUC)","Auction","Arbitration Reason: Not Arbitrated; Sale Price: $0.00","07/03/2019 04:06 PM EDT" +,"system","Web Service(CN)","Floor Change","Floor Price (Requested) changed to $16,680.00","07/24/2019 02:29 PM EDT" +,"system","EDI Auction(AUC)","Document Shipment","Manheim Arena Illinois received the Title from Landmark Credit Union on 07/26/2019.","07/26/2019 10:34 AM EDT" +,"EDI","EDI Auction(AUC)","Bid History","Daysrun: - ; Highest Bid Recorded by Auction: $17500","07/30/2019 11:32 AM EDT" +"1028296144" +,"EDI","CCESS(AUC)","Auction","PENDING KEYS","07/15/2019 12:00 AM EDT" +,"EDI","CSCHMARJE(AUC)","Auction","ETA 8/2","07/26/2019 12:00 AM EDT" +,"system","EDI Auction(AUC)","System","Mileage has been changed from to 18290","07/30/2019 03:08 PM EDT" +"1040506-143" +,"EDI",,"Auction","ASSIGNMENT DOWNLOADED TO AUCT SYSTEM ON 7/12/19 AT 16:20:52","07/12/2019 05:29 PM EDT" +,"system","EDI Auction(AUC)","System","Mileage has been changed from to 16118","07/23/2019 11:06 AM EDT" +,"system","EDI Auction(AUC)","System","Mileage has been changed from 16118 to 16119","07/24/2019 12:53 PM EDT" +"580456-143" +,"EDI",,"Auction","ASSIGNMENT DOWNLOADED TO AUCT SYSTEM ON 7/17/19 AT 17:14:10","07/17/2019 06:30 PM EDT" +,"system","EDI Auction(AUC)","System","Mileage has been changed from to 135220","07/30/2019 12:42 PM EDT" +"798730-145" +,"EDI",,"Auction","ASSIGNMENT DOWNLOADED TO AUCT SYSTEM ON 7/23/19 AT 17:27:03","07/23/2019 06:33 PM EDT" +,"manual","James Edders(AUC)","Auction","Waiting on release per Kari","07/25/2019 11:21 AM EDT" +,"EDI","CSCHMARJE(AUC)","Auction","CONTACT REPO YARD DIRECT AND ADVISE.","07/25/2019 12:00 AM EDT" +,"EDI","CSCHMARJE(AUC)","Auction","FROM THE CLIENT TO RELEASE THE UNIT TO THE AUCTION. PLEASE","07/25/2019 12:00 AM EDT" +,"EDI","CSCHMARJE(AUC)","Auction","PER REPO YARD THEY ARE STILL WAITING FOR THE RELEASE DIRECT","07/25/2019 12:00 AM EDT" +,"manual","James Edders(AUC)","Auction","No keys, ready for pickup per Kari","07/29/2019 12:15 PM EDT" +,"system","EDI Auction(AUC)","System","Mileage has been changed from to 102843","07/30/2019 02:55 PM EDT" +"1062818-143" +,"EDI",,"Auction","ASSIGNMENT DOWNLOADED TO AUCT SYSTEM ON 7/29/19 AT 15:46:44","07/29/2019 05:05 PM EDT" +,"system","EDI Auction(AUC)","System","Mileage has been changed from to 11149","07/30/2019 11:49 PM EDT" +"1011369144" +,"system","EDI Auction(AUC)","System","Mileage has been changed from to 131307","07/30/2019 11:59 PM EDT" +"1001446-143" +,"system","EDI Auction(AUC)","System","Mileage has been changed from to 87963","07/30/2019 11:49 PM EDT" +"1065318-143" +,"EDI",,"Auction","ASSIGNMENT DOWNLOADED TO AUCT SYSTEM ON 7/30/19 AT 16:56:20","07/30/2019 06:04 PM EDT" +"808491-148" +,"EDI",,"Auction","ASSIGNMENT DOWNLOADED TO AUCT SYSTEM ON 7/30/19 AT 16:56:20","07/30/2019 06:04 PM EDT" diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Processor/SampleData/LAND_DATA_TEST.csv b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Processor/SampleData/LAND_DATA_TEST.csv new file mode 100644 index 0000000..3849b2b --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Processor/SampleData/LAND_DATA_TEST.csv @@ -0,0 +1,24 @@ +Announced Conditions,Arbitration Reason,As Is 100K Miles,Assignment Accepted,Auction Age,Auction Guide Book Price,Buyer ID,Buyer Name,Charge Amount,Check Amount,Client Age,Client Cancelled,Collision Damage,Inspected Date,Date of Loss,Date Picked Up,Date Entered AutoIMS,Days Run,Days Run/Highest Bid Recorded by Auction,Days to Delivery,Description,Drivable,Floor Price (Accepted),Funds Sent,Gross % Floor,Highest Bid,Mileage,Net % Floor,Other Advance Fees,OTHER Total,OTHER: Advanced Other(72),OTHER: Advanced Storage(71),OTHER: Advanced Tow(70),OTHER: Miscellaneous(41),Sale Price,Scheduled Sale Date,Sold Date,Title #,Title Received,Title Returned,Title State,Title Status,Title Status from Auction,Total Charges,Vehicle Grade (Approved CR),Operable,Shipment Date,Status,VIN,Storage Cost,Storage Rate Per Day,Tow Cost,Cn. Acc. #,Auction ID,Vehicle Decimal Grade Code,Vehicle Grade,Most Recent National Adjusted MMR Price,Most Recent Regional Adjusted MMR Price,MMR,External CR Link,Open Text 1 +----------------------------------------,------------------------------------,--------------------------------,--------------------------------------,----------------------,------------------------------------------------,----------------,--------------------,--------------------------,------------------------,--------------------,--------------------------------,--------------------------------,----------------------------,------------------------,----------------------------,----------------------------------------,----------------,--------------------------------------------------------------------------------,--------------------------------,----------------------,----------------,--------------------------------------------,--------------------,--------------------------,----------------------,--------------,----------------------,------------------------------------,----------------------,--------------------------------------------------,------------------------------------------------------,----------------------------------------------,------------------------------------------------,--------------------,--------------------------------------,------------------,--------------,----------------------------,----------------------------,----------------------,------------------------,--------------------------------------------------,--------------------------,------------------------------------------------------,----------------,--------------------------,------------,------,------------------------,----------------------------------------,----------------,--------------------,--------------------,----------------------------------------------------,--------------------------,----------------------------------------------------,----------------------------------------------------,------,--------------------------------,---------------------- +AS IS NO ARBS-NO START; STRUCTURAL DAMAGE; ,Not Arbitrated,Yes,6/6/2019,51,$725.00 ,9999999,John Doe,$163.68 ,"$14,999.00 ",55,xxx,xxx,6/13/2019,xxx,6/10/2019,06/06/2019 03:38 PM EDT,cxx,xxx,4,3G5DA03EX5S513625 2005 BUICK RENDEZVS FWD V6 SUV ,No,xxx,xxx,0.00%,xx,"186,910",0.00%,xxx,xx,x,x,x,x,x,x,x,x,x,x,x,Title Not Sent,x,$163.68 ,Grade 0.9,Yes,6/10/2019,Awaiting Clearance /Inspected,3G5DA03EX5S513625,,x,x,965536-143,MMAA,0.9,Grade 0.9,x,x,x,/jsp/ConditionReport.jsp?clientid=LAND&iid=7e1a8bf6beb769eb6a8ab56b1c2b3949,2444 +AS IS NO ARBS-NO START; STRUCTURAL DAMAGE; ,,Yes,6/6/2019,51,$725.00 ,,,$163.68 ,,55,,,6/13/2019,,6/10/2019,06/06/2019 03:38 PM EDT,,,4,3G5DA03EX5S513625 2005 BUICK RENDEZVS FWD V6 SUV ,No,,,0.00%,,"186,910",0.00%,,,,,,,,,,,,,,Title Not Sent,,$163.68 ,Grade 0.9,Yes,6/10/2019,Awaiting Clearance /Inspected,3G5DA03EX5S513625,,,,965536-143,MMAA,0.9,Grade 0.9,,,,/jsp/ConditionReport.jsp?clientid=LAND&iid=7e1a8bf6beb769eb6a8ab56b1c2b3949,2444 +,,No,6/14/2019,41,"$15,650.00 ",5006279,CARMAX # 7122,$601.00 ,"$14,999.00 ",45,,,6/21/2019,,6/19/2019,06/14/2019 04:39 PM EDT,,"$15,600.00 ",5,2HGFB6E52FH705805 2015 HONDA CIVIC 4DSN ,No,"$14,510.00 ",7/30/2019,107.51%,"$15,600.00 ","36,389",103.37%,,,,,,,"$15,600.00 ",7/30/2019,7/30/2019,1,7/16/2019,,IL,Title Received,Auction has Title,$601.00 ,Grade 2.6,Yes,6/19/2019,Sold / Funds Sent,2HGFB6E52FH705805,,,,980316-143,AREN,2.6,Grade 2.6,,,,/jsp/ConditionReport.jsp?clientid=LAND&iid=60e95e55bd1d943406bb319400735999,2465 +STRUCTURAL DMG B PILAR; pd; STRUCTURAL DAMAGE; ,,No,6/14/2019,28,"$14,950.00 ",5031985,WELKES AUTO SALES INC,$296.68 ,"$11,003.32 ",32,,,6/21/2019,,6/19/2019,06/14/2019 04:43 PM EDT,1,"$11,300.00 ",5,1GCWGAFF3G1135341 2016 CHEVROLET G2500 CARGO 4X2 VAN ,Yes,"$14,010.00 ",7/17/2019,80.66%,"$11,300.00 ","72,715",78.54%,,,,,,,"$11,300.00 ",7/17/2019,7/17/2019,1,7/9/2019,,IL,Title Received,Auction has Title,$296.68 ,Grade 2.5,Yes,6/19/2019,Sold / Funds Sent,1GCWGAFF3G1135341,,,,909002-143,MMAA,2.5,Grade 2.5,,,,/jsp/ConditionReport.jsp?clientid=LAND&iid=82690d27adda26b914e1681429200c20,2466 +,,No,6/19/2019,35,"$10,050.00 ",5349414,EPIC MOTORSPORTS INC,$321.00 ,"$8,779.00 ",40,,,6/26/2019,,6/25/2019,06/19/2019 05:00 PM EDT,,"$9,100.00 ",6,5N1AR2MM9DC665207 2013 NISSAN PATHFIND 4X4 SUV ,Yes,"$9,270.00 ",7/30/2019,98.17%,"$9,100.00 ","87,590",94.70%,,,,,,,"$9,100.00 ",7/30/2019,7/30/2019,1,7/16/2019,,IL,Title Received,Auction has Title,$321.00 ,Grade 1.7,Yes,6/25/2019,Sold / Funds Sent,5N1AR2MM9DC665207,,,,889307-143,AREN,1.7,Grade 1.7,,,,/jsp/ConditionReport.jsp?clientid=LAND&iid=a42d57908093306664f9ffc2877de5a5,2484 +,,No,6/19/2019,36,"$12,750.00 ",5164487,CRASE AUTO CONNECTION INC,$499.00 ,"$10,701.00 ",40,,,6/25/2019,,6/24/2019,06/19/2019 05:07 PM EDT,,"$11,200.00 ",5,2GNALBEK0F1176598 2015 CHEVROLET EQUINOX FWD 4C SUV ,Yes,"$12,015.00 ",7/30/2019,93.22%,"$11,200.00 ","36,910",89.06%,,,,,,,"$11,200.00 ",7/30/2019,7/30/2019,1,7/16/2019,,IL,Title Received,Auction has Title,$499.00 ,Grade 3.2,Yes,6/24/2019,Sold / Funds Sent,2GNALBEK0F1176598,,,,1030690-143,AREN,3.2,Grade 3.2,,,,/jsp/ConditionReport.jsp?clientid=LAND&iid=e90546c5f20dec2f06bb319400735999,2486 +GREEN LIGHT; ,,No,6/26/2019,23,,,,$481.00 ,,35,,,7/9/2019,,7/8/2019,06/26/2019 11:47 AM EDT,1,"$33,400.00 ",12,3LN6L5KU2KR605585 2019 LINCOLN MKZ FWD 4C 4DSN ,Yes,"$35,000.00 ",,,"$33,400.00 ","16,139",,,,,,,,,,,1,7/24/2019,,IL,Title Received,Auction has Title,$481.00 ,Grade 4.0,Yes,7/8/2019,Awaiting Clearance /Repaired,3LN6L5KU2KR605585,,,,1078388-143,AREN,4,Grade 4.0,,,,/jsp/ConditionReport.jsp?clientid=LAND&iid=cd580df9bb47ab2014e1681429200c20,2498 +AS IS NO ARBS-TRANS INOP; ,,Yes,6/26/2019,16,"$8,300.00 ",5410730,HIGHLINE AUTO LLC,$390.48 ,"$2,809.52 ",28,,,7/10/2019,,7/8/2019,06/26/2019 11:52 AM EDT,1,"$3,200.00 ",12,1GKFK63878J246014 2008 GMC YUKON AWD V8 SUV ,No,"$9,415.00 ",7/24/2019,33.99%,"$3,200.00 ","157,606",29.84%,,,,,,,"$3,200.00 ",7/24/2019,7/24/2019,1,7/17/2019,,WI,Title Received,Auction has Title,$390.48 ,Unknown,Yes,7/8/2019,Sold / Funds Sent,1GKFK63878J246014,,,,973697-144,MMAA,,Grade 2.0,,,,/jsp/ConditionReport.jsp?clientid=LAND&iid=21c904dc07872ef6b45fb7a114f6af71,2499 +,,No,6/26/2019,28,"$12,150.00 ",5349414,EPIC MOTORSPORTS INC,$246.00 ,"$10,954.00 ",33,,,7/3/2019,,7/2/2019,06/26/2019 12:44 PM EDT,,"$11,200.00 ",6,1G1ZE5ST0GF250271 2016 CHEVROLET MALIBU 4DSN ,Yes,"$11,340.00 ",7/30/2019,98.77%,"$11,200.00 ","44,535",96.60%,,,,,,,"$11,200.00 ",7/30/2019,7/30/2019,1,7/24/2019,,IL,Title Received,Auction has Title,$246.00 ,,Yes,7/2/2019,Sold / Funds Sent,1G1ZE5ST0GF250271,,,,817679-144,AREN,3.4,Grade 3.4,,,,/jsp/ConditionReport.jsp?clientid=LAND&iid=1c0734a2bca5df10666630e7f73f55e2,2507 +,,No,6/28/2019,27,$0.00 ,5387622,MOTORSPORTS OF CHICAGO INC,$332.00 ,"$7,268.00 ",31,,,7/8/2019,,7/3/2019,06/28/2019 03:23 PM EDT,,"$7,600.00 ",5,1HD1FC4488Y604392 2008 HARLEY FLHTCU M/C ,Yes,"$5,930.00 ",7/30/2019,128.16%,"$7,600.00 ","29,870",122.56%,,,,,,,"$7,600.00 ",7/30/2019,7/30/2019,1,7/26/2019,,IL,Title Received,Auction has Title,$332.00 ,Unknown,Yes,7/3/2019,Sold / Funds Sent,1HD1FC4488Y604392,,,,895537-143,AREN,,Grade 3.0,,,,/jsp/ConditionReport.jsp?clientid=LAND&iid=c7ca1a14b8566b7a666630e7f73f55e2,2514 +,Not Arbitrated,No,6/28/2019,27,"$16,000.00 ",5006279,CARMAX # 7122,$318.00 ,"$17,182.00 ",31,,,7/3/2019,,7/3/2019,06/28/2019 03:45 PM EDT,,"$17,500.00 ",5,JN1BJ1CR5HW144158 2017 NISSAN ROGUE SPORT AWD SUV ,Yes,"$16,680.00 ",7/30/2019,104.92%,"$17,500.00 ","14,160",103.01%,,,,,,,"$17,500.00 ",7/30/2019,7/30/2019,1,7/26/2019,,IL,Title Received,Auction has Title,$318.00 ,Grade 4.5,Yes,7/3/2019,Sold / Funds Sent,JN1BJ1CR5HW144158,,,,1015555-143,AREN,4.5,Grade 4.5,,,,/jsp/ConditionReport.jsp?clientid=LAND&iid=6983d197760613e506bb319400735999,2515 +,,No,7/12/2019,1,"$15,100.00 ",,,$8.00 ,,19,,,,,7/30/2019,07/12/2019 03:39 PM EDT,,,18,3N1AB7AP2JY227705 2018 NISSAN SENTRA 4DSN ,,,,0.00%,,"18,290",0.00%,,,,,,,,,,,,,,Title Not Sent,,$8.00 ,,Yes,7/30/2019,Awaiting Clearance /Secured,3N1AB7AP2JY227705,,,,1028296-144,MMAA,,,,,,/jsp/ConditionReport.jsp?clientid=LAND&iid=157dbaa52a13a8576a8ab56b1c2b3949,2539 +,,No,7/12/2019,8,"$17,750.00 ",,,$95.48 ,,19,,,7/24/2019,,7/23/2019,07/12/2019 04:28 PM EDT,,,11,4T1B11HK3JU632482 2018 TOYOTA CAMRY 4C 4DSN ,Yes,,,0.00%,,"16,119",0.00%,,,,,,,,,,,,,,Title Not Sent,,$95.48 ,Grade 4.2,Yes,7/23/2019,Awaiting Clearance /Inspected,4T1B11HK3JU632482,,,,1040506-143,MMAA,4.2,Grade 4.2,,,,/jsp/ConditionReport.jsp?clientid=LAND&iid=2ae8783d677205416a8ab56b1c2b3949,2549 +,,Yes,7/17/2019,1,"$4,425.00 ",,,$33.00 ,,14,,,7/30/2019,,7/30/2019,07/17/2019 05:14 PM EDT,,,13,1GKKVRED6BJ133891 2011 GMC ACADIA AWD 4SUV ,Yes,,,0.00%,,"135,220",0.00%,,,,,,,,,,,,,,Title Not Sent,,$33.00 ,Grade 1.4,Yes,7/30/2019,Awaiting Clearance /Inspected,1GKKVRED6BJ133891,,,,580456-143,MMAA,1.4,Grade 1.4,,,,/jsp/ConditionReport.jsp?clientid=LAND&iid=9c81c1141c27e8d6beb5cac1e64457f0,2556 +,,Yes,7/23/2019,1,"$7,275.00 ",,,$8.00 ,,8,,,,,7/30/2019,07/23/2019 05:24 PM EDT,,,7,3D7JB1EP1BG526247 2011 RAM 1500 4X2 RG RCAB ,,,,0.00%,,"102,843",0.00%,,,,,,,,,,,,,,Title Not Sent,,$8.00 ,,Yes,7/30/2019,Awaiting Clearance /Secured,3D7JB1EP1BG526247,,,,798730-145,MMAA,,,,,,/jsp/ConditionReport.jsp?clientid=LAND&iid=f8128fce0498144506bb319400735999,2571 +,,No,7/29/2019,1,"$13,150.00 ",,,$8.00 ,,2,,,,,7/30/2019,07/29/2019 03:17 PM EDT,,,1,3VW117AU5HM033092 2017 VW GOLF 4DHB ,,,,0.00%,,"11,149",0.00%,,,,,,,,,,,,,,Title Not Sent,,$8.00 ,,Yes,,Awaiting Clearance /Secured,3VW117AU5HM033092,,,,1062818-143,MMAA,,,,,,/jsp/ConditionReport.jsp?clientid=LAND&iid=385f95f3de17aa5f6a8ab56b1c2b3949,2577 +,,Yes,7/29/2019,1,"$3,975.00 ",,,$8.00 ,,2,,,,,7/30/2019,07/29/2019 05:48 PM EDT,,,1,WDDGF56X69R054206 2009 MERCEDES C350W 4DSN ,,,,0.00%,,"131,307",0.00%,,,,,,,,,,,,,,Title Not Sent,,$8.00 ,,Yes,,Awaiting Clearance /Secured,WDDGF56X69R054206,,,,1011369-144,MMAA,,,,,,/jsp/ConditionReport.jsp?clientid=LAND&iid=0bacc4905ea03ad906bb319400735999,2587 +,,No,7/29/2019,1,"$14,900.00 ",,,$8.00 ,,2,,,,,7/30/2019,07/29/2019 05:51 PM EDT,,,1,1C4AJWAG5EL307539 2014 JEEP WRANGLER SUV ,,,,0.00%,,"87,963",0.00%,,,,,,,,,,,,,,Title Not Sent,,$8.00 ,,Yes,,Awaiting Clearance /Secured,1C4AJWAG5EL307539,,,,1001446-143,MMAA,,,,,,/jsp/ConditionReport.jsp?clientid=LAND&iid=c05cfa54b292df1e6a8ab56b1c2b3949,2588 +,,,,,,,,,,1,,,,,,07/30/2019 04:28 PM EDT,,,,2C4RDGBG9ER103414 2014 DODGE TRUC Grand Cara 4DHT ,,,,0.00%,,,0.00%,,,,,,,,,,,,,,Title Not Sent,,,,Yes,,Assigned for Pickup,2C4RDGBG9ER103414,,,,968154-143,1259,,,,,,/jsp/ConditionReport.jsp?clientid=LAND&iid=5726729ca29686f396cdc8f318559314,2591 +,,No,7/30/2019,,"$11,000.00 ",,,,,1,,,,,,07/30/2019 04:39 PM EDT,,,,3FA6P0LU7HR367449 2017 FORD FUSION 4DHT ,,,,0.00%,,,0.00%,,,,,,,,,,,,,,Title Not Sent,,,,Yes,,Pickup Accepted,3FA6P0LU7HR367449,,,,1065318-143,MMAA,,,,,,/jsp/ConditionReport.jsp?clientid=LAND&iid=d94b6bd9c1a89d084828f535eca9aa1d,2592 +,,No,7/30/2019,,,,,,,1,,,,,,07/30/2019 04:43 PM EDT,,,,1HD1KED15JB667651 2018 HARLEY DAV FLHTK M/C ,,,,0.00%,,,0.00%,,,,,,,,,,,,,,Title Not Sent,,,,Yes,,Pickup Accepted,1HD1KED15JB667651,,,,808491-148,MMAA,,,,,,/jsp/ConditionReport.jsp?clientid=LAND&iid=a9663ec333566662b45fb7a114f6af71,2593 +,,,,,,,,,,1,,,,,,07/30/2019 05:53 PM EDT,,,,6G2VX12G34L272264 2004 PONTIAC GTO-V8 4DHT ,,,,0.00%,,,0.00%,,,,,,,,,,,,,,Title Not Sent,,,,Yes,,Assigned for Pickup,6G2VX12G34L272264,,,,850776-143,1259,,,,,,/jsp/ConditionReport.jsp?clientid=LAND&iid=fa3873ed125619f606bb319400735999,1870 diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/RedemptionExpiredDateCalculatorTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/RedemptionExpiredDateCalculatorTest.cs new file mode 100644 index 0000000..37fc751 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/RedemptionExpiredDateCalculatorTest.cs @@ -0,0 +1,123 @@ +using System; +using System.Collections.Generic; +using Castle.DynamicProxy.Generators; +using LCU.API.Collections.CollectionsApiLib.Models; +using LCU.API.Collections.RepoApi.Domain; +using LCU.API.Collections.RepoApi.Services; +using LCU.Shared.Collections.RepoApiLib.Models; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests +{ + public class RedemptionExpiredDateCalculatorTest + { + private readonly RedemptionExpiredDateCalculator _calculator; + + public RedemptionExpiredDateCalculatorTest() + { + _calculator = new RedemptionExpiredDateCalculator(); + + } + + [Fact] + public void Calculate_NoRepoLetters_NoDates_ReturnsNull() + { + + // act + var result = _calculator.CalculateAsync( new TemenosCase(), new List()); + + // assert + Assert.Null(result); + } + + [Fact] + public void Calculate_Null_ReturnsNull() + { + + // act + var result = _calculator.CalculateAsync( new TemenosCase(), null); + + // assert + Assert.Null(result); + } + + [Fact] + public void Calculate_OK_WI() + { + TemenosAccount temenosAccount = new TemenosAccount + { + }; + + TemenosCase temenosCase = new TemenosCase + { + RedemptionExpiredDateWi = DateTime.Parse("11/5/2018 12:00:00 AM") + }; + + // act + var result = _calculator.CalculateAsync( temenosCase, new List() + { + new RepoLetter() + { + ActionCode = "LTR34" + } + }); + + //assert + Assert.NotNull(result); + Assert.Equal(result, DateTime.Parse("11/5/2018 12:00:00 AM")); + } + + [Fact] + public void Calculate_OK_IL() + { + TemenosAccount temenosAccount = new TemenosAccount + { + }; + + TemenosCase temenosCase = new TemenosCase + { + RedemptionExpiredDateIl = DateTime.Parse("11/5/2018 12:00:00 AM") + }; + + // act + var result = _calculator.CalculateAsync( temenosCase, new List() + { + new RepoLetter() + { + ActionCode = "LTR34" + } + }); + + //assert + Assert.NotNull(result); + Assert.Equal(result, DateTime.Parse("11/5/2018 12:00:00 AM")); + } + + [Fact] + public void Calculate_OK_BOTH_USE_WI() + { + TemenosAccount temenosAccount = new TemenosAccount + { + }; + + TemenosCase temenosCase = new TemenosCase + { + RedemptionExpiredDateWi = DateTime.Parse("11/6/2018 12:00:00 AM"), + RedemptionExpiredDateIl = DateTime.Parse("11/5/2018 12:00:00 AM") + }; + + // act + var result = _calculator.CalculateAsync( temenosCase, new List() + { + new RepoLetter() + { + ActionCode = "LTR34" + } + }); + + //assert + Assert.NotNull(result); + Assert.Equal(result, DateTime.Parse("11/6/2018 12:00:00 AM")); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/ReportTableFactoryTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/ReportTableFactoryTest.cs new file mode 100644 index 0000000..9ef8d5c --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/ReportTableFactoryTest.cs @@ -0,0 +1,227 @@ +using System; +using System.Collections.Generic; +using System.Text; +using LCU.API.Collections.RepoApi.Factories; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests +{ + internal class DummyDataClass + { + public decimal? ValueField { get; set; } + public int KeyField { get; set; } + public DateTime DateField { get; set; } + public string SummationField { get; set; } + } + + public class ReportTableFactoryTest + { + + [Fact] + public void CreateHistoricalSummationTable_Currency_Ok() + { + // Arrange + var dummyData = new List() + { + new DummyDataClass() + { + KeyField = 1, + DateField = DateTime.Parse("11/15/2019"), + ValueField = 25.75m, + SummationField = "Row A" + }, + new DummyDataClass() + { + KeyField = 1, + DateField = DateTime.Parse("11/15/2019"), + ValueField = 25.75m, + SummationField = "Row A" + }, + new DummyDataClass() + { + KeyField = 2, + DateField = DateTime.Parse("11/05/2019"), + ValueField = 10.05m, + SummationField = "Row B" + }, + new DummyDataClass() + { + KeyField = 3, + DateField = DateTime.Parse("11/20/2019"), + ValueField = 7.50m, + SummationField = "Row A" + }, + new DummyDataClass() + { + KeyField = 4, + DateField = DateTime.Parse("12/10/2019"), + ValueField = 50.500001m, + SummationField = "Row B" + }, + new DummyDataClass() + { + KeyField = 5, + DateField = DateTime.Parse("12/25/2019"), + ValueField = 75.49m, + SummationField = "Row C" + }, + new DummyDataClass() + { + KeyField = 6, + DateField = DateTime.Parse("12/18/2019"), + ValueField = 32 + }, + }; + + // Act + var reportTable = ReportTableFactory.CreateHistoricalSummationTable( + ReportSumType.Currency, + dummyData, + "Data Items", + DateTime.Parse("11/01/2019"), + DateTime.Parse("12/31/2019"), + (x) => x.ValueField, + (x) => x.SummationField, + (x) => x.DateField, + (x) => x.KeyField); + + // Assert + Assert.NotNull(reportTable); + Assert.Equal(20, reportTable.Cells.Length); + + // Assert Table Display + Assert.Equal("All Data Items", reportTable.Cells[0, 0].Display); + Assert.Equal("$43.30", reportTable.Cells[0, 1].Display); + Assert.Equal("$157.99", reportTable.Cells[0, 2].Display); + Assert.Equal("$201.29", reportTable.Cells[0, 3].Display); + + Assert.Equal("Row A", reportTable.Cells[1, 0].Display); + Assert.Equal("$33.25", reportTable.Cells[1, 1].Display); + Assert.Equal("-", reportTable.Cells[1, 2].Display); + Assert.Equal("$33.25", reportTable.Cells[1, 3].Display); + + Assert.Equal("Row B", reportTable.Cells[2, 0].Display); + Assert.Equal("$10.05", reportTable.Cells[2, 1].Display); + Assert.Equal("$50.50", reportTable.Cells[2, 2].Display); + Assert.Equal("$60.55", reportTable.Cells[2, 3].Display); + + Assert.Equal("Row C", reportTable.Cells[3, 0].Display); + Assert.Equal("-", reportTable.Cells[3, 1].Display); + Assert.Equal("$75.49", reportTable.Cells[3, 2].Display); + Assert.Equal("$75.49", reportTable.Cells[3, 3].Display); + + Assert.Equal("No Data Items", reportTable.Cells[4, 0].Display); + Assert.Equal("-", reportTable.Cells[4, 1].Display); + Assert.Equal("$32.00", reportTable.Cells[4, 2].Display); + Assert.Equal("$32.00", reportTable.Cells[4, 3].Display); + } + + [Fact] + public void CreateHistoricalSummationTable_PercentageAvg_Ok() + { + // Arrange + var dummyData = new List() + { + new DummyDataClass() + { + KeyField = 1, + DateField = DateTime.Parse("11/15/2019"), + ValueField = 110m, + SummationField = "Row A" + }, + new DummyDataClass() + { + KeyField = 2, + DateField = DateTime.Parse("11/12/2019"), + ValueField = 50m, + SummationField = "Row A" + }, + new DummyDataClass() + { + KeyField = 3, + DateField = DateTime.Parse("12/10/2019"), + ValueField = 75m, + SummationField = "Row B" + }, + new DummyDataClass() + { + KeyField = 4, + DateField = DateTime.Parse("12/11/2019"), + SummationField = "Row B" + } + }; + + // Act + var reportTable = ReportTableFactory.CreateHistoricalSummationTable( + ReportSumType.PercentageAvg, + dummyData, + "Data Items", + DateTime.Parse("11/01/2019"), + DateTime.Parse("12/31/2019"), + (x) => x.ValueField, + (x) => x.SummationField, + (x) => x.DateField, + (x) => x.KeyField, + false); + + // Assert + Assert.NotNull(reportTable); + Assert.Equal(12, reportTable.Cells.Length); + + // Assert Table Display + Assert.Equal("All Data Items", reportTable.Cells[0, 0].Display); + Assert.Equal("80.00 %", reportTable.Cells[0, 1].Display); + Assert.Equal("75.00 %", reportTable.Cells[0, 2].Display); + Assert.Equal("78.33 %", reportTable.Cells[0, 3].Display); + + Assert.Equal("Row A", reportTable.Cells[1, 0].Display); + Assert.Equal("80.00 %", reportTable.Cells[1, 1].Display); + Assert.Equal("-", reportTable.Cells[1, 2].Display); + Assert.Equal("80.00 %", reportTable.Cells[1, 3].Display); + + Assert.Equal("Row B", reportTable.Cells[2, 0].Display); + Assert.Equal("-", reportTable.Cells[2, 1].Display); + Assert.Equal("75.00 %", reportTable.Cells[2, 2].Display); + Assert.Equal("75.00 %", reportTable.Cells[2, 3].Display); + } + + [Fact] + public void CreateHistoricalSummationTable_RenersSingleRow_Ok() + { + // Arrange + var dummyData = new List() + { + new DummyDataClass() + { + KeyField = 1, + DateField = DateTime.Parse("11/15/2019"), + ValueField = 1000 + } + }; + + // Act + var reportTable = ReportTableFactory.CreateHistoricalSummationTable( + ReportSumType.Currency, + dummyData, + "Data Items", + DateTime.Parse("11/01/2019"), + DateTime.Parse("12/31/2019"), + (x) => x.ValueField, + (x) => null, + (x) => x.DateField, + (x) => x.KeyField, + false); + + // Assert + Assert.NotNull(reportTable); + Assert.Equal(4, reportTable.Cells.Length); + + // Assert Table Display + Assert.Equal("All Data Items", reportTable.Cells[0, 0].Display); + Assert.Equal("$1,000.00", reportTable.Cells[0, 1].Display); + Assert.Equal("-", reportTable.Cells[0, 2].Display); + Assert.Equal("$1,000.00", reportTable.Cells[0, 3].Display); + } + + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Repository/EventAlertRepositoryTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Repository/EventAlertRepositoryTest.cs new file mode 100644 index 0000000..a08ed7d --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Repository/EventAlertRepositoryTest.cs @@ -0,0 +1,215 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using LCU.Shared.Collections.RepoApiLib.Exceptions; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Persistence; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using Microsoft.AspNetCore.Mvc.ModelBinding; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.Repository +{ + + public class EventAlertRepositoryTest : DbContextFromJson + { + private Shared.Collections.RepoApiLib.Repositories.EventAlertRepository _repository; + private readonly AppDbContext _dbContext; + public EventAlertRepositoryTest() + { + + _dbContext = GetSqliteContextWithData("event_alert_repository.json"); + _repository = new EventAlertRepository(_dbContext); + } + + [Fact] + public async void ListAllAsync_Test() + { + var resultsBasic = await _repository.ListAllAsync(); + Assert.NotNull(resultsBasic); + Assert.NotEmpty(resultsBasic); + Assert.Equal("Unit Test", resultsBasic.First().CreatedBy); + } + + [Fact] + public async void ListUnreadEventsAsync_Test() + { + var resultsBasic = await _repository.ListUnreadAsync(); + Assert.NotNull(resultsBasic); + Assert.NotEmpty(resultsBasic); + Assert.Equal(1, resultsBasic.Count()); + } + + [Fact] + public async void ListO4R_No_Company_Test() + { + var resultsBasic = await _repository.ListO4rNoCompanyAsync(); + Assert.NotNull(resultsBasic); + Assert.NotEmpty(resultsBasic); + Assert.Single(resultsBasic); + } + + [Fact] + public async void ListRepo_No_Company_Test() + { + var resultsBasic = await _repository.ListRepoNoCompanyAsync(); + Assert.NotNull(resultsBasic); + Assert.NotEmpty(resultsBasic); + Assert.Equal(1, resultsBasic.Count()); + } + + [Fact] + public async void ListRepo_No_Auction_Test() + { + var resultsBasic = await _repository.ListRepoNoAuctionAsync(); + Assert.NotNull(resultsBasic); + // There is 1, but it is closed. + Assert.Empty(resultsBasic); + } + + [Fact] + public async void ListReadyForRetitleAsync_Test() + { + var resultsBasic = await _repository.ListAllAsync(); + Assert.NotNull(resultsBasic); + Assert.NotEmpty(resultsBasic); + + IEnumerable results = await _repository.ListReadyForRetitleAsync(); + Assert.NotNull(results); + Assert.NotEmpty(results); + Assert.Equal(1, results.Count()); + } + + [Fact] + public async void AddAsync_DoesNotThrowWhenAlertShouldRepeat_Test() + { + var alert = new EventAlert + { + RepoId = 11688, + AccountNo = "6829620143", + Message = "test", + CreatedBy = "Unit Test", + DateAdded = DateTime.Parse("2019-06-29T00:00:00") + }; + + await _repository.AddAsync(alert); + await _dbContext.SaveChangesAsync(); + } + + [Fact] + public async void AddAsync_Invalid_Test() + { + var alert = new EventAlert + { + RepoId = 11688, + AccountNo = "6829620143", + Message = "test", + CreatedBy = "012345678901234567890123456789", + DateAdded = DateTime.Parse("2019-06-29T00:00:00") + }; + + await _repository.AddAsync(alert); + await _dbContext.SaveChangesAsync(); + } + + [Fact] + public async void AddAsync_ThrowsWhenAlertShouldNotRepeat_Test() + { + var alert = new EventAlert() + { + RepoId = 11688, + AccountNo = "6829620143", + Message = "RTC Letter Not Found", + CreatedBy = "Unit Test", + DateAdded = DateTime.Parse("2019-06-29T00:00:00") + }; + + await Assert.ThrowsAsync(() => _repository.AddAsync(alert)); + } + + [Fact] + public async void AddAsync_Empty_Test() + { + await _repository.AddRangeAsync(new List()); + await _dbContext.SaveChangesAsync(); + } + + [Theory] + [InlineData(14883, "9987149147", "test", true)] //This Data Already Exists in event_alert_repository.json + [InlineData(00001, "0000000001", "test", false)] + [InlineData(14883, "9987149147", "not test", false)] + public void IsDuplicateAlert_Ok(int RepoID, string AccountNo, string Message, bool expected) + { + var alert = new EventAlert + { + RepoId = RepoID, + AccountNo = AccountNo, + Message = Message, + CreatedBy = "Unit Test", + DateAdded = DateTime.Parse("2019-06-27T00:00:00"), + }; + + Assert.Equal(_repository.IsDuplicateAlert(alert), expected); + } + + [Fact] + public void IsDuplicateAlert_NonRepeatingAlerts_OK() + { + var alert = new EventAlert + { + RepoId = 11688, + AccountNo = "6829620143", + Message = "Payment Received", + CreatedBy = "Unit Test", + DateAdded = DateTime.Parse("2019-06-27T00:00:00"), + MarkedReadBy = "tester" + }; + + Assert.False(_repository.IsDuplicateAlert(alert)); + } + + [Fact] + public async void AddRangeAsync_Ignores_Duplicates_OK() + { + List eventAlerts = new List { + new EventAlert + { + RepoId = 11688, + AccountNo = "6829620143", + Message = "Payment Received", + CreatedBy = "Unit Test", + DateAdded = DateTime.Parse("2019-06-27T00:00:00"), + MarkedReadBy = "tester" + }, + new EventAlert() + { + RepoId = 1, + AccountNo = "6829627143", + CreatedBy = "Unit Test", + Message = "Payment Received", + DateAdded = DateTime.Parse("2019-06-27T00:00:00") + }, + new EventAlert() + { + RepoId = 2, + AccountNo = "6829628143", + CreatedBy = "Unit Test", + Message = "Payment Received", + DateAdded = DateTime.Parse("2019-06-27T00:00:00") + }, + }; + + var results = await _repository.AddRangeAsync(eventAlerts); + await _dbContext.SaveChangesAsync(); + Assert.Equal(3,results.Count()); + Assert.True(results.ToList().Exists(x => x.RepoId == 11688)); + } + + [Fact] + public async void ListUnreadByAccountNoAsync_Ok() + { + var results = await _repository.ListUnreadByAccountNoAsync("9987149147"); + Assert.Single(results); + } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Repository/ExternalUserRepositoryTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Repository/ExternalUserRepositoryTest.cs new file mode 100644 index 0000000..07d606a --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Repository/ExternalUserRepositoryTest.cs @@ -0,0 +1,112 @@ +using System; +using System.Collections.Generic; +using Xunit; +using System.Linq; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using LCU.Shared.Collections.RepoApiLib.Persistence; +using Microsoft.EntityFrameworkCore; + +namespace LCU.API.Collections.RepoApiTests.Repository +{ + public class ExternalUserRepository : DbContextFromJson + { + private readonly AppDbContext _dbContext; + + public ExternalUserRepository() + { + _dbContext = SqliteDbContext; + } + + [Fact] + public async void External_Users_Sync_Ok() + { + var repository = new Shared.Collections.RepoApiLib.Repositories.ExternalUserRepository(_dbContext); + // act + + var list = new List() + { + new ExternalUser() + { + ReferenceId = 100, + Code = "gfrick", + Name = "George Frick" + }, + new ExternalUser() + { + ReferenceId = 101, + Code = "astiyer", + Name = "Alex Stiyer" + }, + new ExternalUser() + { + ReferenceId = 102, + Code = "mfleming", + Name = "Mitchel Flemming" + } + }; + + await repository.SynchronizeSet(list); + await _dbContext.SaveChangesAsync(); + // fake restart the context / transaction + foreach (var user in list) + { + _dbContext.Entry(user).State = EntityState.Detached; + } + + //assert finds multiple + var results = await repository.ListAsync(); + Assert.NotNull(results); + Assert.NotEmpty(results); + Assert.Equal(3 , results.Count()); + + //assert finds one + var result = await repository.FindByReferenceIdAsync(101); + Assert.NotNull(result); + Assert.Equal("astiyer", result.Code); + + var list2 = new List() + { + new ExternalUser() + { + ReferenceId = 100, + Code = "gfrick", + Name = "George Frick" + }, + new ExternalUser() + { + ReferenceId = 101, + Code = "astiyer", + Name = "Alex Stiyer" + }, + new ExternalUser() + { + ReferenceId = 103, + Code = "kutley", + Name = "Kyle Utley" + }, + new ExternalUser() + { + ReferenceId = 102, + Code = "mfleming", + Name = "Mitchel Flemming" + } + }; + + await repository.SynchronizeSet(list2); + await _dbContext.SaveChangesAsync(); + + //assert finds multiple + results = await repository.ListAsync(); + Assert.NotNull(results); + Assert.NotEmpty(results); + Assert.Equal(4 , results.Count()); + + //assert finds one + result = await repository.FindByReferenceIdAsync(103); + Assert.NotNull(result); + Assert.Equal("kutley", result.Code); + } + + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Repository/ProcessingReceiptRepositoryTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Repository/ProcessingReceiptRepositoryTest.cs new file mode 100644 index 0000000..001eb4b --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Repository/ProcessingReceiptRepositoryTest.cs @@ -0,0 +1,289 @@ +using System; +using System.Collections.Generic; +using Xunit; +using System.Linq; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.Producer; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using LCU.Shared.Collections.RepoApiLib.Persistence; +using Microsoft.EntityFrameworkCore; + +namespace LCU.API.Collections.RepoApiTests.Repository +{ + public class ProcessingReceiptRepository : DbContextFromJson + { + private readonly AppDbContext _dbContext; + + public ProcessingReceiptRepository() + { + _dbContext = SqliteDbContext; + } + + [Fact] + public async void ProcessingReceipt_Basic_Flow_OK() + { + var repository = new Shared.Collections.RepoApiLib.Repositories.ProcessingReceiptRepository(_dbContext); + // act + var result = await repository.FindReceiptsAsync("123456-789"); + Assert.NotNull(result); + Assert.Empty(result); + + var receipt = new ProcessingReceipt("123456-789") + { + Message = "x", + Outcome = RepoProcessingResult.Error, + Processed = DateTime.Now, + AccountId = "", + CaseId = "", + QueuedBy = "Testing" + }; + + await repository.AddOrUpdateAsync(receipt); + await _dbContext.SaveChangesAsync(); + result = await repository.FindReceiptsAsync("123456-789"); + + // Assert + Assert.NotNull(result); + Assert.NotEmpty(result); + Assert.Equal(RepoProcessingResult.Error, result.First().Outcome); + } + + [Fact] + public async void ProcessingReceipt_Multi_Flow_OK() + { + var repository = new Shared.Collections.RepoApiLib.Repositories.ProcessingReceiptRepository(_dbContext); + // act + var results = await repository.GetRetryListAsync(); + Assert.NotNull(results); + Assert.Empty(results); + + var list = new List() + { + new ProcessingReceipt("123456-777") + { + Message = "x", + Outcome = RepoProcessingResult.Error, + Processed = DateTime.Now, + AccountId = "", + CaseId = "", + QueuedBy = "Testing" + }, + new ProcessingReceipt("123456-888") + { + Message = "y", + Outcome = RepoProcessingResult.Created, + Processed = DateTime.Now, + AccountId = "", + CaseId = "", + QueuedBy = "Testing" + } + }; + + await repository.SaveAllAsync(list); + await _dbContext.SaveChangesAsync(); + + results = await repository.GetRetryListAsync(); + + // Assert + Assert.NotNull(results); + Assert.NotEmpty(results); + Assert.Equal(RepoProcessingResult.Error, results.First().Outcome); + } + + [Fact] + public async void ProcessingReceipt_Update_OK() + { + var repository = new Shared.Collections.RepoApiLib.Repositories.ProcessingReceiptRepository(_dbContext); + // act + + var list = new List() + { + new ProcessingReceipt("123456-777") + { + Message = "x", + Outcome = RepoProcessingResult.Error, + Processed = DateTime.Now, + AccountId = "321", + CaseId = "", + QueuedBy = "Testing" + }, + new ProcessingReceipt("123456-888") + { + Message = "y", + Outcome = RepoProcessingResult.Created, + Processed = DateTime.Now, + AccountId = "", + CaseId = "", + QueuedBy = "Testing" + } + }; + + await repository.SaveAllAsync(list); + await _dbContext.SaveChangesAsync(); + // Fake the end of the transaction/etc with this... + _dbContext.Entry(list.First()).State = EntityState.Detached; + + var changed = new ProcessingReceipt("123456-777") + { + Message = "x", + Outcome = RepoProcessingResult.MissingRequirement, + Processed = DateTime.Now, + AccountId = "321", + CaseId = "", + QueuedBy = "Testing" + }; + + await repository.AddOrUpdateAsync(changed); + await _dbContext.SaveChangesAsync(); + var results = await repository.GetRetryListAsync(); + + // Assert + Assert.NotNull(results); + Assert.NotEmpty(results); + Assert.Equal(1, results.Count); + Assert.Equal(RepoProcessingResult.MissingRequirement, results.First().Outcome); + Assert.Equal("321", results.First().AccountId); + } + + [Fact] + public async void ProcessingReceipt_MultiRecord_OK() + { + var repository = new Shared.Collections.RepoApiLib.Repositories.ProcessingReceiptRepository(_dbContext); + // act + + var list = new List() + { + new ProcessingReceipt("123456-777") + { + Message = "x1", + Outcome = RepoProcessingResult.Error, + Processed = DateTime.Now, + AccountId = "321", + CaseId = "", + QueuedBy = "Testing" + }, + new ProcessingReceipt("123456-888") + { + Message = "y", + Outcome = RepoProcessingResult.Created, + Processed = DateTime.Now, + AccountId = "", + CaseId = "", + QueuedBy = "Testing" + } + }; + + await repository.SaveAllAsync(list); + await _dbContext.SaveChangesAsync(); + // Fake the end of the transaction/etc with this... + _dbContext.Entry(list.First()).State = EntityState.Detached; + + var changed = new ProcessingReceipt("123456-777") + { + Message = "x2", + Outcome = RepoProcessingResult.MissingRequirement, + Processed = DateTime.Now, + AccountId = "321", + CaseId = "123", + QueuedBy = "Testing" + }; + + await repository.AddOrUpdateAsync(changed); + await _dbContext.SaveChangesAsync(); + var results = await repository.GetRetryListAsync(); + + // Assert + Assert.NotNull(results); + Assert.NotEmpty(results); + Assert.Equal(2, results.Count); + Assert.Equal(RepoProcessingResult.Error, results.First().Outcome); + Assert.Equal("321", results.First().AccountId); + Assert.Equal("x1", results.First().Message); + } + + [Fact] + public async void GetReceiptByAccountNoAsync_OK() + { + var repository = new Shared.Collections.RepoApiLib.Repositories.ProcessingReceiptRepository(_dbContext); + // act + + var list = new List() + { + new ProcessingReceipt("123456-777") + { + Message = "x1", + Outcome = RepoProcessingResult.Error, + Processed = DateTime.Now, + AccountId = "321", + CaseId = "", + QueuedBy = "Testing" + }, + new ProcessingReceipt("123456-888") + { + Message = "y", + Outcome = RepoProcessingResult.Created, + Processed = DateTime.Now, + AccountId = "", + CaseId = "", + QueuedBy = "Testing" + }, + new ProcessingReceipt("123456-888") + { + Message = "y", + Outcome = RepoProcessingResult.Created, + Processed = DateTime.Now, + AccountId = "2", + CaseId = "22", + QueuedBy = "Testing" + } + }; + + await repository.SaveAllAsync(list); + await _dbContext.SaveChangesAsync(); + // Fake the end of the transaction/etc with this... + _dbContext.Entry(list.First()).State = EntityState.Detached; + + + //assert finds multiple + var results = await repository.GetReceiptsByAccountNoAsync("123456-888"); + Assert.NotNull(results); + Assert.NotEmpty(results); + Assert.Equal(2 , results.Count()); ; + Assert.All(results, (item) => + { + Assert.Contains(item, results); + }); + + //assert finds one + results = await repository.GetReceiptsByAccountNoAsync("123456-777"); + Assert.NotNull(results); + Assert.NotEmpty(results); + Assert.Single(results) ; + Assert.All(results, (item) => + { + Assert.Contains(item, results); + }); + + //assert find empy + results = await repository.GetReceiptsByAccountNoAsync("000000-000"); + Assert.NotNull(results); + Assert.Empty(results); + } + + [Fact] + public async void GetReceiptByAccountNoAsync_EmptyContext() + { + var repository = new Shared.Collections.RepoApiLib.Repositories.ProcessingReceiptRepository(_dbContext); + // act + + var list = new List(); + await repository.SaveAllAsync(list); + await _dbContext.SaveChangesAsync(); + + var results = await repository.GetReceiptsByAccountNoAsync("123456-888"); + Assert.NotNull(results); + Assert.Empty(results); + } + + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Repository/RepoAccountRepositoryTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Repository/RepoAccountRepositoryTest.cs new file mode 100644 index 0000000..8a40571 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Repository/RepoAccountRepositoryTest.cs @@ -0,0 +1,347 @@ + +using System; +using System.Collections.Generic; +using Xunit; +using System.Linq; +using LCU.API.Collections.CollectionsApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Persistence; +using Microsoft.EntityFrameworkCore; + +namespace LCU.API.Collections.RepoApiTests.Repository +{ + public class RepoAccountRepository : DbContextFromJson + { + private readonly AppDbContext _dbContext; + + public RepoAccountRepository() + { + _dbContext = GetSqliteContextWithData(@"Repository/repo_account_repository_data.json"); + + } + + [Fact] + public async void ListAccounts_Filter_Closed_Ok() + { + + var repoAccountRepos = new Shared.Collections.RepoApiLib.Repositories.RepoAccountRepository(_dbContext); + // act + var result = await repoAccountRepos.ListAsync(new List { }, 0, 10, null, null, null, true); + + // Assert + Assert.NotNull(result); + Assert.Equal(2, result.Total); + Assert.True(result.Items.ToList().Exists(x => (x.RepoId == 2))); + Assert.True(result.Items.ToList().Exists(x => (x.RepoId == 1))); + Assert.False(result.Items.ToList().Exists(x => (x.RepoId == 3 || x.RepoId == 4))); + Assert.DoesNotContain(result.Items, x => x.DateClosed != null); + } + + [Fact] + public async void FindAccount_Async_Missing_Ok() + { + var repoAccountRepos = new Shared.Collections.RepoApiLib.Repositories.RepoAccountRepository(_dbContext); + // act + var result = await repoAccountRepos.FindByAccountNoAsync("123456-999"); + + // Assert + Assert.NotNull(result); + Assert.Empty(result); + } + + [Fact] + public async void ListAccounts_Filter_By_RepoCompanyID_Ok() + { + + var repoAccountRepos = new Shared.Collections.RepoApiLib.Repositories.RepoAccountRepository(_dbContext); + // act + var result = await repoAccountRepos.ListAsync(new List { }, 0, 10, null, null, 4, null); + + // Assert + Assert.NotNull(result); + Assert.Equal(1, result.Total); + Assert.Contains(result.Items, x => x.RepoId == 2); + Assert.DoesNotContain(result.Items, x => x.RepoId == 1 || x.RepoId == 3 || x.RepoId == 4); + } + + [Fact] + public async void ListAccounts_Filter_By_AuctionHouseID_Ok() + { + + var repoAccountRepos = new Shared.Collections.RepoApiLib.Repositories.RepoAccountRepository(_dbContext); + // act + var result = await repoAccountRepos.ListAsync(new List { }, 0, 10, null, "1259", null, null); + + // Assert + Assert.NotNull(result); + Assert.Equal(1, result.Total); + Assert.Contains(result.Items, x => x.RepoId == 2); + Assert.DoesNotContain(result.Items, x => x.RepoId == 1 || x.RepoId == 3 || x.RepoId == 4); + } + + [Fact] + public async void ListAccounts_Filter_By_Status_Ok() + { + var repoAccountRepos = new Shared.Collections.RepoApiLib.Repositories.RepoAccountRepository(_dbContext); + // act + var result = await repoAccountRepos.ListAsync(new List { }, 0, 10, "SOLD", null, null, null); + + // Assert + Assert.NotNull(result); + Assert.Equal(1, result.Total); + Assert.Contains(result.Items, x => x.RepoId == 4); + Assert.DoesNotContain(result.Items, x => x.RepoId == 1 || x.RepoId == 2 || x.RepoId == 3); + } + + [Fact] + public async void ListAccounts_Filter_By_Combination_RepoCompany_AuctionHouse_Ok() + { + var repoAccountRepos = new Shared.Collections.RepoApiLib.Repositories.RepoAccountRepository(_dbContext); + // act + var result = await repoAccountRepos.ListAsync(new List { }, 0, 10, null, "1259", 4, null); + + // Assert + Assert.NotNull(result); + Assert.Equal(1, result.Total); + Assert.Contains(result.Items, x => x.RepoId == 2); + Assert.DoesNotContain(result.Items, x => x.RepoId == 1 || x.RepoId == 3 || x.RepoId == 4); + } + + [Fact] + public async void ListAccounts_Filter_By_Combination_Open_AuctionHouse_Ok() + { + var repoAccountRepos = new Shared.Collections.RepoApiLib.Repositories.RepoAccountRepository(_dbContext); + // act + var result = await repoAccountRepos.ListAsync(new List { }, 0, 10, "PSKP", null, null, true); + + // Assert + Assert.NotNull(result); + Assert.Equal(1, result.Total); + Assert.Contains(result.Items, x => x.RepoId == 1); + Assert.DoesNotContain(result.Items, x => x.RepoId == 2 || x.RepoId == 3 || x.RepoId == 4); + } + + [Fact] + public async void ListAccounts_Filter_To_Null_OK() + { + var repoAccountRepos = new Shared.Collections.RepoApiLib.Repositories.RepoAccountRepository(_dbContext); + // act + var result = await repoAccountRepos.ListAsync(new List { }, 0, 10, "PSKP", "1259", 4, true); + + // Assert + Assert.NotNull(result); + Assert.Empty(result.Items); + Assert.Equal(0, result.Total); + } + + [Fact] + public async void ListAccounts_Filter_To_Doesnt_Exist_OK() + { + var repoAccountRepos = new Shared.Collections.RepoApiLib.Repositories.RepoAccountRepository(_dbContext); + // act + var result = await repoAccountRepos.ListAsync(new List { }, 0, 10, "THISDOESNTEXIST", null, null, null); + + // Assert + Assert.NotNull(result); + Assert.Empty(result.Items); + Assert.Equal(0, result.Total); + } + + [Fact] + public async void ListAccounts_All_Paged_Result__OK() + { + var repoAccountRepos = new Shared.Collections.RepoApiLib.Repositories.RepoAccountRepository(_dbContext); + + //act + var result = await repoAccountRepos.ListAsync(new List { }, 0, 2, null, null, null, true); + + // Assert + Assert.NotNull(result); + Assert.Equal(2,result.Items.Count()); + Assert.Equal(2, result.Total); + } + + [Fact] + public async void ListAccounts_All__OK() + { + var repoAccountRepos = new Shared.Collections.RepoApiLib.Repositories.RepoAccountRepository(_dbContext); + + //act + var result = await repoAccountRepos.ListAsync(new List { }, 0, 10, null, null, null, true); + + // Assert + Assert.NotNull(result); + Assert.Equal(2,result.Items.Count()); + Assert.Equal(2, result.Total); + } + + [Fact] + public async void SaveAccount_OK() + { + var options = new DbContextOptionsBuilder() + .UseInMemoryDatabase(Guid.NewGuid().ToString()) + .Options; + var context = new AppDbContext(options); + + var repoAccountRepos = new Shared.Collections.RepoApiLib.Repositories.RepoAccountRepository(context); + + var repo = new RepoAccount() + { + AccountNo = "123456-789", + Balance = 1000, + Branch = 5, + Collector = "Test", + DaysDelinquent = 5, + AccountTypeCode = "L1", + LoanNo = 789, + DelinquentAmount = 500, + CurrentDelinquentAmount = 500, + LstPmtAmt = 200, + MemberNo = 123456, + OrigAmount = 1000, + O4RDate = DateTime.Today, + PrimaryIndividualId = "777777", + SubStatus = "XXX", + Status = "O4R", + Borrowers = new List() + { + new Borrower() + { + IndividualId = "77777", + IndividualName = "Test Borrower", + OwnershipType = 6 + } + }, + Collaterals = new List() + { + new Collateral() + { + BodyStyle = "Coupe", + Description = "2019 Subaru BRZ Ts", + Make = "Subaru", + Model = "BRZ", + Vin = "1234567AAAGHZJP11", + Year = 2019, + VehicleType = 1, + Inoperable = false + } + }, + ReferenceId = 555, + AccountLastProcessed = DateTime.Today + }; + + Assert.Equal(0, repo.RepoId); + + //act + var result = await repoAccountRepos.AddAsync(repo); + context.SaveChanges(); + + // Assert + Assert.NotNull(result); + Assert.NotNull(result.Collaterals); + Assert.NotNull(result.Borrowers); + Assert.NotEqual(0, result.RepoId); + Assert.NotEqual(0, result.Collaterals.First().CollateralId); + Assert.Equal(result.RepoId, result.Borrowers.First().RepoId); + Assert.Equal(result.RepoId, result.Collaterals.First().RepoId); + } + + [Fact] + public async void UpdateAccount_OK() + { + var options = new DbContextOptionsBuilder() + .UseInMemoryDatabase(Guid.NewGuid().ToString()) + .Options; + var context = new AppDbContext(options); + + var repoAccountRepository = new Shared.Collections.RepoApiLib.Repositories.RepoAccountRepository(context); + + var repo = new RepoAccount() + { + AccountNo = "123456-789", + Balance = 1000, + Branch = 5, + Collector = "Test", + DaysDelinquent = 5, + AccountTypeCode = "L1", + LoanNo = 789, + DelinquentAmount = 500, + CurrentDelinquentAmount = 500, + LstPmtAmt = 200, + OrigAmount = 1000, + O4RDate = DateTime.Today, + PrimaryIndividualId = "777777", + SubStatus = "XXX", + Status = "O4R", + Borrowers = new List() + { + new Borrower() + { + IndividualId = "77777", + IndividualName = "Test Borrower", + OwnershipType = 6 + } + }, + Collaterals = new List() + { + new Collateral() + { + BodyStyle = "Coupe", + Description = "2019 Subaru BRZ Ts", + Make = "Subaru", + Model = "BRZ", + Vin = "1234567AAAGHZJP11", + Year = 2019, + VehicleType = 1, + Inoperable = false, + RepoCompanySelections = new List() + { + new RepoCompanySelection() + { + RepoCompanyId = 7, + DateTimeCreated = DateTime.Now, + RepoCompanyAssignmentDate = DateTime.Now, + RepoType = RepoType.Involuntary + } + } + } + }, + ReferenceId = 999, + AccountLastProcessed = null + }; + var result = await repoAccountRepository.AddAsync(repo); + context.SaveChanges(); + + // Assert + Assert.NotNull(result); + Assert.Equal("1000", result.Balance.ToString()); + Assert.Equal(1, result.Collaterals.Count); + Assert.Equal(999, result.ReferenceId); + + //act + result.Balance = 7299; + result.Collaterals.Add(new Collateral() + { + BodyStyle = "Coupe", + Description = "2019 Subaru BRZ Ts", + Make = "Subaru", + Model = "BRZ", + Vin = "1234567AAAGHZJP22", + Year = 2019, + VehicleType = 1, + Inoperable = false + }); + result.AccountLastProcessed = DateTime.Now; + // repoAccountRepos.Update(result); + _dbContext.SaveChanges(); + + var resultNew = await repoAccountRepository.FindByIdAsync(result.RepoId); + // Assert + Assert.NotNull(resultNew); + Assert.NotNull(resultNew.AccountLastProcessed); + Assert.Equal("7299", resultNew.Balance.ToString()); + Assert.Equal(2, resultNew.Collaterals.Count); + Assert.Equal(999, resultNew.ReferenceId); + } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Repository/TestWithSqlite.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Repository/TestWithSqlite.cs new file mode 100644 index 0000000..067778c --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Repository/TestWithSqlite.cs @@ -0,0 +1,31 @@ +using System; +using LCU.Shared.Collections.RepoApiLib.Persistence; +using Microsoft.Data.Sqlite; +using Microsoft.EntityFrameworkCore; + +namespace LCU.API.Collections.RepoApiTests.Repository +{ + public abstract class TestWithSqlite : IDisposable + { + private const string InMemoryConnectionString = "DataSource=:memory:"; + private readonly SqliteConnection _connection; + + protected readonly AppDbContext SqliteDbContext; + + protected TestWithSqlite() + { + _connection = new SqliteConnection(InMemoryConnectionString); + _connection.Open(); + var options = new DbContextOptionsBuilder() + .UseSqlite(_connection) + .Options; + SqliteDbContext = new AppDbContext(options); + SqliteDbContext.Database.EnsureCreated(); + } + + public void Dispose() + { + _connection.Close(); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Repository/repo_account_repository_data.json b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Repository/repo_account_repository_data.json new file mode 100644 index 0000000..743a789 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Repository/repo_account_repository_data.json @@ -0,0 +1,608 @@ +{ + "repoAccounts": [ + { + "repoId": 1, + "accountNo": "9987149147", + "status": "PSKP", + "memberNo": 3212321, + "loanNo": 147, + "accountTypeCode": "L-AC ", + "branch": 13, + "collector": " 1367", + "balance": 7238.03, + "dueToPayDate": "2019-08-02T00:00:00", + "o4RDate": "2019-10-21T09:01:47.383", + "dateFirstDelinquent": "2019-04-08T00:00:00", + "delinquentAmount": 3491.36, + "daysDelinquent": 80, + "paidSkipAmount": null, + "subStatus": "DE", + "requiredPaymentAmount": 449.03, + "currentDelinquentAmount": 3491.36, + "lstPmtAmt": 450.00, + "origAmount": 16594.79, + "lastPaymentDate": "2019-09-25T00:00:00", + "dateFirstIntellect": "2015-12-07T00:00:00", + "primaryIndividualId": "370556", + "bankruptcy": null, + "manualRedemptionDate": null, + "redemptionExpiredDate": null, + "borrowers": [ + { + "repoId": 1, + "individualId": "370556", + "ownershipType": 6, + "individualName": "GEORGE WASHINGTON" + } + ], + "collaterals": [ + { + "collateralId": 1, + "repoId": 1, + "vin": "100000AB4FN591150", + "make": "CHRYSLER", + "model": "200", + "year": 2015, + "description": "2015 CHRYSLER 200", + "vehicleType": null, + "bodyStyle": null, + "inoperable": null, + "collateralTypeId": null, + "retitledInLandmarkName": null, + "refCollateralId": null, + "repoCompanySelections": [ + { + "id": 1, + "collateralId": 1, + "repoType": "PreSkip", + "repoCompanyId": 1, + "repoCompanyAssignmentDate": "2019-10-21T05:00:00", + "dateRepoed": "2019-11-23T06:00:00", + "dateTimeCreated": "2019-11-04T15:22:43.883" + }, + { + "id": 4433, + "collateralId": 1, + "repoType": "Skip", + "repoCompanyId": 5, + "repoCompanyAssignmentDate": "2019-11-23T12:00:00", + "dateRepoed": "2020-03-04T06:00:00", + "dateTimeCreated": "2019-11-25T11:40:46.33" + } + ] + } + ], + "repoStatusChanges": [ + { + "id": 1, + "repoId": 1, + "statusFrom": "None", + "statusTo": "O4R", + "changedBy": "Importer", + "changedDate": "2019-10-21T09:01:47.43" + }, + { + "id": 15564, + "repoId": 1, + "statusFrom": "O4R", + "statusTo": "PSKP", + "changedBy": "System User", + "changedDate": "2020-03-02T17:04:57.383" + } + ], + "refundStatus": { + "repoId": 1, + "warrantyRefundStatus": null, + "insuranceRefundStatus": null, + "premiumDefiRefundStatus": null, + "cpiRefundStatus": "Received", + "refundsReceivedDate": null + }, + "dateClosed": null + }, + { + "repoId": 2, + "accountNo": "9726450144", + "status": "RECA", + "memberNo": 9726450, + "loanNo": 144, + "accountTypeCode": "L-P4 ", + "branch": 29, + "collector": " 5784", + "balance": 893.01, + "dueToPayDate": "2018-02-23T00:00:00", + "o4RDate": "2018-04-02T11:49:24.103", + "dateFirstDelinquent": "2017-11-28T00:00:00", + "delinquentAmount": 1233.48, + "daysDelinquent": 100, + "paidSkipAmount": null, + "subStatus": "BKCB", + "requiredPaymentAmount": 325.59, + "currentDelinquentAmount": 1233.48, + "lstPmtAmt": 189.12, + "origAmount": 16340.72, + "lastPaymentDate": "2019-01-23T00:00:00", + "dateFirstIntellect": "2014-01-28T00:00:00", + "primaryIndividualId": "336974", + "bankruptcy": "B13 ", + "manualRedemptionDate": null, + "redemptionExpiredDate": null, + "borrowers": [ + { + "repoId": 2, + "individualId": "336974", + "ownershipType": 6, + "individualName": "JOHN WICK" + }, + { + "repoId": 2, + "individualId": "738089", + "ownershipType": 3, + "individualName": "BRUCE WAYNE" + } + ], + "collaterals": [ + { + "collateralId": 2, + "repoId": 2, + "vin": "1FMCU90000KB11152", + "make": "FORD TRUCK", + "model": "Escape", + "year": 2009, + "description": "", + "vehicleType": null, + "bodyStyle": null, + "inoperable": null, + "collateralTypeId": null, + "retitledInLandmarkName": null, + "refCollateralId": null, + "repoCompanySelections": [ + { + "id": 2, + "collateralId": 2, + "repoType": "Involuntary", + "repoCompanyId": 4, + "repoCompanyAssignmentDate": "2018-04-02T05:00:00", + "dateRepoed": "2018-04-09T05:00:00", + "dateTimeCreated": "2019-11-04T15:22:44.68" + } + ] + } + ], + "repoStatusChanges": [ + { + "id": 2, + "repoId": 2, + "statusFrom": "None", + "statusTo": "O4R", + "changedBy": "Importer", + "changedDate": "2018-04-02T11:49:24.107" + }, + { + "id": 3, + "repoId": 2, + "statusFrom": "O4R", + "statusTo": "RECA", + "changedBy": "Importer", + "changedDate": "2018-04-09T10:49:17.513" + } + ], + "refundStatus": null, + "dateClosed": null, + "referenceId": 555 + }, + { + "repoId": 3, + "accountNo": "9725978-143", + "status": "PSKP", + "memberNo": 9725978, + "loanNo": 143, + "accountTypeCode": "L-AC ", + "branch": 27, + "collector": " 2700", + "balance": 4136.95, + "dueToPayDate": "2017-04-25T00:00:00", + "o4RDate": "2017-07-26T08:49:07.003", + "dateFirstDelinquent": "2017-03-30T00:00:00", + "delinquentAmount": 2663.64, + "daysDelinquent": 82, + "paidSkipAmount": null, + "subStatus": "PSKP", + "requiredPaymentAmount": 334.35, + "currentDelinquentAmount": null, + "lstPmtAmt": 280.00, + "origAmount": 10853.40, + "lastPaymentDate": "2017-05-05T00:00:00", + "dateFirstIntellect": "2014-04-30T00:00:00", + "primaryIndividualId": "705151", + "bankruptcy": null, + "manualRedemptionDate": null, + "redemptionExpiredDate": null, + "borrowers": [ + { + "repoId": 3, + "individualId": "705151", + "ownershipType": 6, + "individualName": "CLARK KENT" + } + ], + "collaterals": [ + { + "collateralId": 3, + "repoId": 3, + "vin": "1J4GL00007W516801", + "make": "Jeep", + "model": "Liberty", + "year": 2007, + "description": "", + "vehicleType": null, + "bodyStyle": null, + "inoperable": null, + "collateralTypeId": null, + "retitledInLandmarkName": null, + "refCollateralId": null, + "repoCompanySelections": [ + { + "id": 3, + "collateralId": 3, + "repoType": "Skip", + "repoCompanyId": 5, + "repoCompanyAssignmentDate": "2017-07-26T00:00:00", + "dateRepoed": null, + "dateTimeCreated": "2019-11-04T15:22:45.71" + } + ] + } + ], + "repoStatusChanges": [ + { + "id": 4, + "repoId": 3, + "statusFrom": "None", + "statusTo": "O4R", + "changedBy": "Importer", + "changedDate": "2017-07-26T08:49:07.007" + }, + { + "id": 5, + "repoId": 3, + "statusFrom": "O4R", + "statusTo": "PSKP", + "changedBy": "Importer", + "changedDate": "2017-12-20T14:49:07.78" + } + ], + "refundStatus": { + "repoId": 3, + "warrantyRefundStatus": null, + "insuranceRefundStatus": null, + "premiumDefiRefundStatus": null, + "cpiRefundStatus": null, + "refundsReceivedDate": null + }, + "dateClosed": "2017-12-20T14:49:07.78" + }, + { + "repoId": 4, + "accountNo": "9723452144", + "status": "SOLD", + "memberNo": 9723452, + "loanNo": 144, + "accountTypeCode": "L-P1 ", + "branch": 27, + "collector": " 5737", + "balance": 14097.27, + "dueToPayDate": "2017-07-19T00:00:00", + "o4RDate": "2017-12-22T08:49:11.617", + "dateFirstDelinquent": "2017-08-24T00:00:00", + "delinquentAmount": 3523.20, + "daysDelinquent": 133, + "paidSkipAmount": null, + "subStatus": null, + "requiredPaymentAmount": 353.12, + "currentDelinquentAmount": null, + "lstPmtAmt": 200.00, + "origAmount": 14555.18, + "lastPaymentDate": "2018-02-05T00:00:00", + "dateFirstIntellect": "2016-12-24T00:00:00", + "primaryIndividualId": "703492", + "bankruptcy": null, + "manualRedemptionDate": null, + "redemptionExpiredDate": "2018-04-24T09:39:26", + "borrowers": [ + { + "repoId": 4, + "individualId": "703492", + "ownershipType": 6, + "individualName": "Peter Parker" + } + ], + "collaterals": [ + { + "collateralId": 4, + "repoId": 4, + "vin": "1C3CDZA0000637598", + "make": "DODGE", + "model": "Avenger", + "year": 2013, + "description": "2013 DODGE", + "vehicleType": 0, + "bodyStyle": "4DHT", + "inoperable": false, + "collateralTypeId": 2, + "retitledInLandmarkName": "2018-04-27T11:37:37.283", + "refCollateralId": null, + "repoCompanySelections": [ + { + "id": 4, + "collateralId": 4, + "repoType": "Skip", + "repoCompanyId": 5, + "repoCompanyAssignmentDate": "2017-12-22T00:00:00", + "dateRepoed": "2018-04-09T09:49:09.817", + "dateTimeCreated": "2019-11-04T15:22:46.89" + } + ] + } + ], + "repoStatusChanges": [ + { + "id": 6, + "repoId": 4, + "statusFrom": "None", + "statusTo": "O4R", + "changedBy": "Importer", + "changedDate": "2017-12-22T08:49:11.617" + }, + { + "id": 7, + "repoId": 4, + "statusFrom": "O4R", + "statusTo": "REPO", + "changedBy": "Importer", + "changedDate": "2018-04-09T09:49:09.997" + }, + { + "id": 8, + "repoId": 4, + "statusFrom": "REPO", + "statusTo": "SOLD", + "changedBy": "Diana V", + "changedDate": "2018-05-12T10:09:49.393" + } + ], + "refundStatus": { + "repoId": 4, + "warrantyRefundStatus": null, + "insuranceRefundStatus": null, + "premiumDefiRefundStatus": null, + "cpiRefundStatus": null, + "refundsReceivedDate": null + }, + "dateClosed": "2018-05-12T10:09:49.393" + } + ], + "auctionAssignments": [ + { + "id": 3075, + "auctionId": "1259", + "repoId": 2, + "auctionCustomerNo": "542673-143", + "collateralVIN": "1FMCU9E000CKC25751", + "dateSubmitted": "2020-05-07T11:48:45.773", + "floorPrice": null, + "floorPriceResponseCode": null, + "floorPriceResponseDescription": null, + "floorPriceSubmissionErrors": null, + "holdStatus": null, + "holdUntil": null, + "redeemedDate": null, + "vehicleType": null, + "bodyStyle": null, + "inoperable": null, + "retailValue": null, + "auctionNotes": null, + "availablePickupDate": "2020-05-07T05:00:00", + "legalSaleDate": "2020-05-22T15:00:00", + "cleaningLevel": 3, + "submissionResponseCode": null, + "submissionResponseDescription": null, + "submissionErrors": null, + "sentTitleDocsDate": null, + "titleSentResponseCode": null, + "titleSentResponseDescription": null, + "titleSentSubmissionErrors": null, + "addedThroughRepoDatabase": null, + "isActive": true, + "autoIMS": { + "repoId": 2, + "vin": "1FMCU9EG6CKC25751", + "auctionAssignmentId": 3075, + "auctionCustomerNo": "542673-143", + "assignmentAccepted": null, + "dateReceivedFromAutoIMS": "2020-05-07T12:45:14.483", + "scheduledSaleDate": null, + "soldDate": null, + "announcedConditions": "", + "arbitrationReason": "", + "asIs100KMiles": false, + "auctionAge": null, + "auctionGuideBookPrice": null, + "buyerId": "", + "buyerName": "", + "chargeAmount": null, + "checkAmount": null, + "clientAge": 0, + "clientCancelled": null, + "collisionDamage": "", + "inspectedDate": null, + "dateofLoss": null, + "datePickedUp": null, + "dateEnteredAutoIMS": "2020-05-07T12:48:00", + "daysRun": null, + "daysRunHighestBidRecordedbyAuction": "", + "daystoDelivery": null, + "description": "1FMCU9EG6CKC25751 2012 FORD TRUCK Escape 4SUV", + "isDrivable": null, + "floorPriceAccepted": null, + "fundsSent": null, + "grossPercentFloor": 0.00, + "highestBid": null, + "statedMileage": null, + "netPercentFloor": 0.00, + "otherAdvanceFees": null, + "otherTotal": "", + "otherAdvancedOther": "", + "otherAdvancedStorage": "", + "otherAdvancedTow": "", + "otherMiscellaneous": "", + "salePrice": null, + "titleNumber": "", + "titleReceived": null, + "titleReturned": null, + "titleState": "", + "titleStatus": "Title Not Sent", + "titleStatusfromAuction": "", + "totalCharges": null, + "approvedVehicleGrade": null, + "isOperable": false, + "shipmentDate": null, + "status": "Assigned for Pickup", + "storageCost": null, + "storageRatePerDay": null, + "towCost": null, + "vehicleDecimalGradeCode": null, + "vehicleGrade": null, + "mmrNationalAdjustedPrice": null, + "mmrRegionalAdjustedPrice": null, + "mmr": null, + "conditionReportLink": "http://Ecr.autoims.com/jsp/ConditionReport.jsp?clientid=LAND&iid=4d085a8af1c49a9996cdc8f318559314", + "collateralImagePath": null + }, + "auction": { + "auctionID": "1259", + "name": "Wisconsin State Auto Auction", + "active": "yes", + "address_Line_1": "Road Drive", + "address_Line_2": "-", + "city": "Small Town", + "state": "WI", + "zip": "532000", + "country": "USA", + "phone": "(920)100-0000", + "fax": "(920)100-0000", + "latitude": 43.6101220000000, + "longitude": -88.4395370000000 + }, + "auctionAssignmentToCollaterals": [ + { + "auctionAssignmentId": 3075, + "collateralId": 4932, + "collateral": { + "collateralId": 4932, + "repoId": 2, + "vin": "1FMCU9EG6CKC25751", + "make": "FORD TRUCK", + "model": "Escape", + "year": 2012, + "description": "2012 FORD TRUCK", + "vehicleType": null, + "bodyStyle": "Utility 4D Limited 4WD V", + "inoperable": null, + "collateralTypeId": null, + "retitledInLandmarkName": null, + "refCollateralId": "676426", + "repoCompanySelections": null + } + } + ], + "floorPriceValuesUsed": null + } + ], + "eventAlerts": [ + { + "RepoId": 14883, + "AccountNo": "9987149147", + "Message": "test", + "CreatedBy": "Unit Test", + "DateAdded": "2019-06-27T00:00:00" + }, + { + "RepoId": 14883, + "AccountNo": "9987149147", + "Message": "test", + "CreatedBy": "Unit Test", + "DateAdded": "2019-06-27T00:00:00", + "DateMarkedRead": "2019-06-27T00:00:00", + "MarkedReadBy": "tester" + }, + { + "RepoId": 11688, + "AccountNo": "6829620-143", + "Message": "test", + "CreatedBy": "Unit Test", + "DateAdded": "2019-06-27T00:00:00", + "DateMarkedRead": "2019-06-27T00:00:00", + "MarkedReadBy": "tester" + }, + { + "RepoId": 11688, + "AccountNo": "6829620-143", + "Message": "Payment Received", + "CreatedBy": "Unit Test", + "DateAdded": "2019-06-27T00:00:00", + "DateMarkedRead": "2019-06-27T00:00:00", + "MarkedReadBy": "tester" + } + ], + "repoManualStatus": [ + { + "ID": 1, + "Description": "PSKP", + "IsActiveStatus": false, + "WatchForStatusChanges": false + }, + { + "ID": 2, + "Description": "NOT ACTIVE", + "IsActiveStatus": false, + "WatchForStatusChanges": false + }, + { + "ID": 3, + "Description": "SOLD", + "IsActiveStatus": false, + "WatchForStatusChanges": false + }, + { + "ID": 4, + "Description": "REDEEMED", + "IsActiveStatus": false, + "WatchForStatusChanges": true + }, + { + "ID": 5, + "Description": "O4R", + "IsActiveStatus": true, + "WatchForStatusChanges": true + }, + { + "ID": 6, + "Description": "REPO", + "IsActiveStatus": true, + "WatchForStatusChanges": true + }, + { + "ID": 7, + "Description": "RECA", + "IsActiveStatus": true, + "WatchForStatusChanges": true + }, + { + "ID": 8, + "Description": "REHO", + "IsActiveStatus": true, + "WatchForStatusChanges": true + } + ] +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/AccountAlertCheckServiceTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/AccountAlertCheckServiceTest.cs new file mode 100644 index 0000000..8a4a9e8 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/AccountAlertCheckServiceTest.cs @@ -0,0 +1,37 @@ +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Services; +using LCU.API.Collections.RepoApi.Services.Producer; +using LCU.Shared.Collections.RepoApiLib.Models; +using Moq; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.Services +{ + public class AccountAlertCheckServiceTest + { + private readonly IAccountAlertCheckService _accountAlertCheckService; + private readonly Mock _mockEventAlertService; + + public AccountAlertCheckServiceTest() + { + _mockEventAlertService = new Mock(); + _accountAlertCheckService = new AccountAlertCheckService(_mockEventAlertService.Object); + } + + [Fact] + public async Task ListAll_Ok() + { + var testAlert = new EventAlert() + { + Message = "testing", + AccountNo = "123456-789" + }; + _mockEventAlertService.Setup(x => x.SaveAsync(It.IsAny())).ReturnsAsync(testAlert); + + var manualAlert = await _accountAlertCheckService.ManualAlert(testAlert); + Assert.NotNull(manualAlert); + _mockEventAlertService.VerifyAll(); + } + + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/AuctionAssignmentServiceTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/AuctionAssignmentServiceTest.cs new file mode 100644 index 0000000..85a3fa0 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/AuctionAssignmentServiceTest.cs @@ -0,0 +1,765 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net.Http; +using LCU.API.Collections.RepoApi.Models.Requests; +using LCU.API.Collections.RepoApi.Services; +using LCU.Shared.Collections.RepoApiLib.Exceptions; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using LCU.Shared.Collections.RepoApiLib.WebServices.AutoIMS; +using Moq; +using Xunit; +using AuctionAssignment = LCU.Shared.Collections.RepoApiLib.Models.AuctionAssignment; + +namespace LCU.API.Collections.RepoApiTests.Services +{ + public class AuctionAssignmentServiceTest + { + private readonly Mock mockUnitOfWork; + private readonly Mock mockAuctionAssignmentRepository; + private readonly Mock mockAutoImsWebService; + private readonly Mock mockRepoAccountService; + private readonly Mock mockEmailer; + + private readonly AuctionAssignmentService service; + + public AuctionAssignmentServiceTest() + { + mockUnitOfWork = new Mock(); + mockAutoImsWebService = new Mock(); + mockAuctionAssignmentRepository = new Mock(); + mockRepoAccountService = new Mock(); + mockEmailer = new Mock(); + service = new AuctionAssignmentService( + mockAutoImsWebService.Object, + mockRepoAccountService.Object, + mockAuctionAssignmentRepository.Object, + mockUnitOfWork.Object, + mockEmailer.Object); + } + + [Fact] + public async void Post_Success() + { + mockAuctionAssignmentRepository.Setup(repository => repository.AddAsync(It.IsAny())) + .ReturnsAsync(new AuctionAssignment() + { + ID = 1914, + AuctionId = "MMAA", + AuctionCustomerNo = "1234-56" + }); + mockRepoAccountService.Setup(service => service.Get(It.IsAny())).ReturnsAsync(new RepoAccount() + { + Borrowers = new List + { + new Borrower() + { + OwnershipType = 6 + } + } + }); + + var auctionAssignmentResponse = await service.SaveAsync(new AuctionAssignmentPostRequest() + { + AuctionAssignment = new AuctionAssignment() + { + RepoId = 1234 + }, + Collaterals = new List + { + new Collateral { CollateralId = 1 }, + new Collateral() + }, + VehicleLocation = new VehicleLocation(), + PrimaryCollateralId = 1, + }); + + Assert.NotNull(auctionAssignmentResponse); + Assert.NotNull(auctionAssignmentResponse.AuctionAssignment); + Assert.NotNull(auctionAssignmentResponse.Collaterals); + Assert.NotNull(auctionAssignmentResponse.VehicleLocation); + + Assert.Equal(1914, auctionAssignmentResponse.AuctionAssignment.ID); + Assert.Equal("MMAA", auctionAssignmentResponse.AuctionAssignment.AuctionId); + Assert.Equal("1234-56", auctionAssignmentResponse.AuctionAssignment.AuctionCustomerNo); + + Assert.Equal(2, auctionAssignmentResponse.Collaterals.Count()); + } + + [Fact] + public async void Post_Duplicate_Resource_Error() + { + // FindByAuctionCustomerNoAndVin() should NOT affect duplicate detection errors + mockAuctionAssignmentRepository + .Setup(repository => repository.FindByByAuctionCustomerNoAndVin(It.IsAny(), It.IsAny())) + .ReturnsAsync(new AuctionAssignment()); + + // The Existance of MATCHING active collateral should + mockAuctionAssignmentRepository.Setup(repository => repository.FindByRepoIdAsync(It.IsAny())) + .ReturnsAsync( + new List() + { + new AuctionAssignment() + { + AuctionAssignmentToCollaterals = new List() + { + new AuctionAssignmentToCollateral { CollateralId = 42 }, + new AuctionAssignmentToCollateral { CollateralId = 5 } // Matching Collateral + }, + IsActive = true + } + }); + + mockAuctionAssignmentRepository.Setup(repository => repository.AddAsync(It.IsAny())) + .ReturnsAsync(new AuctionAssignment()); + mockRepoAccountService.Setup(service => service.Get(It.IsAny())).ReturnsAsync(new RepoAccount() + { + Borrowers = new List + { + new Borrower() + { + OwnershipType = 6 + } + } + }); + + try + { + var auctionAssignmentResponse = await service.SaveAsync(new AuctionAssignmentPostRequest() + { + AuctionAssignment = new AuctionAssignment() + { + RepoId = 1234 + }, + Collaterals = new List + { + new Collateral { CollateralId = 1 }, + new Collateral() { CollateralId = 5 } + }, + VehicleLocation = new VehicleLocation(), + PrimaryCollateralId = 1, + }); + + Assert.True(false, "An Exception should have been thrown."); + } + catch (DuplicateResourceException) + { + } + catch (Exception) + { + Assert.True(false, + "An DuplicateResourceException should have been thrown. Another exception was thrown instead."); + } + } + + [Fact] + public async void GetAuctionCustomerNo_Success() + { + mockRepoAccountService.Setup(service => service.Get(It.IsAny())).ReturnsAsync(new RepoAccount() + { + LoanNo = 56, + Borrowers = new List + { + new Borrower() + { + OwnershipType = 6, + IndividualId = "1234" + } + }, + Collaterals = new List + { + new Collateral() + { + RefCollateralId = "151834" + } + } + }); + + var auctionCustomerNo = await service.GetAuctionCustomerNoAsync(1234, "151834"); + + Assert.Equal("1234-151834", auctionCustomerNo); + } + + [Fact] + public async void Update_No_Auction_Change() + { + // arrange + var assignment = new AuctionAssignment() + { + ID = 5, + FloorPrice = 0, + AuctionCustomerNo = "123456-789", + AuctionId = "Mannheim", + CollateralVIN = "12345678901234567", + VehicleType = 5, + }; + var assignmentUpdated = new AuctionAssignment() + { + ID = 5, + FloorPrice = 0, + AuctionCustomerNo = "123456-789", + AuctionId = "Mannheim", + CollateralVIN = "12345678901234567", + VehicleType = 6 + }; + + mockAuctionAssignmentRepository.Setup(x => x.FindByIdAsync(5)).ReturnsAsync(assignment); + mockAuctionAssignmentRepository.Setup(x => x.Update(It.IsAny())).Verifiable(); + mockUnitOfWork.Setup(x => x.CompleteAsync()).Verifiable(); + mockAutoImsWebService.Setup(x => x.PostVehicleAsync(It.IsAny())) + .Verifiable(); + + // act + var result = await service.UpdateAsync(assignmentUpdated); + + // Assert + Assert.NotNull(result); + mockAuctionAssignmentRepository.Verify(x => x.FindByIdAsync(5), Times.Once); + mockAutoImsWebService.Verify(x => x.PostVehicleAsync(It.IsAny()), + Times.Never); + } + + [Fact] + public async void Update_Yes_Auction_Change() + { + // arrange + var assignment = new AuctionAssignment() + { + ID = 5, + FloorPrice = 0, + AuctionCustomerNo = "123456-789", + AuctionId = "Mannheim", + CollateralVIN = "12345678901234567", + VehicleType = 5, + }; + var assignmentUpdated = new AuctionAssignment() + { + ID = 5, + FloorPrice = 1000, + AuctionCustomerNo = "123456-789", + AuctionId = "Mannheim", + CollateralVIN = "12345678901234567", + VehicleType = 6 + }; + + mockAuctionAssignmentRepository.Setup(x => x.FindByIdAsync(5)).ReturnsAsync(assignment); + mockAuctionAssignmentRepository.Setup(x => x.Update(It.IsAny())).Verifiable(); + mockAutoImsWebService.Setup(x => x.PostVehicleAsync(It.IsAny())) + .Verifiable(); + mockAutoImsWebService.Setup(x => x.PostVehicleAsync(It.IsAny())) + .ReturnsAsync((WebServiceResponse)null); + + // act + var result = await service.UpdateAsync(assignmentUpdated); + + // Assert + Assert.NotNull(result); + + mockAuctionAssignmentRepository.Verify(x => x.FindByIdAsync(5), Times.Once); + mockAutoImsWebService.Verify(x => x.PostVehicleAsync(It.IsAny()), + Times.Once); + } + + [Fact] + public void Floor_Price_Change_Manual_Success() + { + // arrange + var assignment = new AuctionAssignment() + { + ID = 5, + FloorPrice = 0, + AuctionCustomerNo = "123456-789", + AuctionId = "Mannheim", + CollateralVIN = "12345678901234567", + VehicleType = 5, + }; + var assignmentUpdated = new AuctionAssignment() + { + ID = 5, + FloorPrice = 1000, + AuctionCustomerNo = "123456-789", + AuctionId = "Mannheim", + CollateralVIN = "12345678901234567", + VehicleType = 6 + }; + WebServiceResponse response = new WebServiceResponse() + { + AuctionCollateralVin = assignmentUpdated.CollateralVIN, + Status = new WebServiceResponseStatus() + { + Description = "success", + Code = 1 + } + }; + + mockAutoImsWebService.Setup(x => x.PostVehicleAsync(It.IsAny())) + .ReturnsAsync(response); + mockEmailer.Setup(x => + x.SendFloorPriceAcceptedEmail(It.IsAny(), It.IsAny(), It.IsAny(), + It.IsAny())).ReturnsAsync(new HttpResponseMessage(System.Net.HttpStatusCode.OK)); + + // act + service.UpdateAuctionFloor(assignmentUpdated, assignment).GetAwaiter().GetResult(); + + // Assert + Assert.NotNull(assignment); + Assert.Equal(1000, assignment.FloorPrice); + mockAutoImsWebService.Verify(x => x.PostVehicleAsync(It.IsAny()), + Times.Once); + mockEmailer.Verify( + x => x.SendFloorPriceAcceptedEmail(It.IsAny(), It.IsAny(), It.IsAny(), + It.IsAny()), Times.Once); + } + + [Fact] + public void Floor_Price_Change_Fail() + { + // arrange + var assignment = new AuctionAssignment() + { + ID = 5, + FloorPrice = 0, + AuctionCustomerNo = "123456-789", + AuctionId = "Mannheim", + CollateralVIN = "12345678901234567", + VehicleType = 5, + }; + var assignmentUpdated = new AuctionAssignment() + { + ID = 5, + FloorPrice = 1000, + AuctionCustomerNo = "123456-789", + AuctionId = "Mannheim", + CollateralVIN = "12345678901234567", + VehicleType = 5 + }; + WebServiceResponse response = new WebServiceResponse() + { + AuctionCollateralVin = assignmentUpdated.CollateralVIN, + Status = new WebServiceResponseStatus() + { + Description = "success", + Code = 5, + ValidationError = new WebServiceResponseStatusValidationError[] + { + new WebServiceResponseStatusValidationError() + { + Message = "test failure", + Code = "5" + } + } + } + }; + + mockAutoImsWebService.Setup(x => x.PostVehicleAsync(It.IsAny())) + .ReturnsAsync(response); + + // act + service.UpdateAuctionFloor(assignmentUpdated, assignment).GetAwaiter().GetResult(); + + // Assert + Assert.NotNull(assignment); + Assert.Equal(0, assignment.FloorPrice); + mockAutoImsWebService.Verify(x => x.PostVehicleAsync(It.IsAny()), + Times.Once); + } + + [Fact] + public void Floor_Price_Change_Automatic_Success() + { + // arrange + var assignment = new AuctionAssignment() + { + ID = 5, + FloorPrice = 0, + AuctionCustomerNo = "123456-789", + AuctionId = "Mannheim", + CollateralVIN = "12345678901234567", + VehicleType = 5, + }; + var assignmentUpdated = new AuctionAssignment() + { + ID = 5, + FloorPrice = 1000, + FloorPriceValuesUsed = new FloorPriceValuesUsed + { MMRRegionalAdjustedPrice = 1000, NADAAverageAdjustedAuctionValue = 1000, PercentageOf = 100 }, + AuctionCustomerNo = "123456-789", + AuctionId = "Mannheim", + CollateralVIN = "12345678901234567", + VehicleType = 5 + }; + mockRepoAccountService.Setup(x => x.FindByAuctionAssignmentId(It.IsAny())) + .ReturnsAsync(new RepoAccount { AccountNo = "1234567-98" }); + WebServiceResponse response = new WebServiceResponse() + { + AuctionCollateralVin = assignmentUpdated.CollateralVIN, + Status = new WebServiceResponseStatus() + { + Description = "success", + Code = 1 + } + }; + + mockAutoImsWebService.Setup(x => x.PostVehicleAsync(It.IsAny())) + .ReturnsAsync(response); + mockEmailer.Setup(x => + x.SendFloorPriceAcceptedEmail(It.IsAny(), It.IsAny(), It.IsAny(), + It.IsAny())).ReturnsAsync(new HttpResponseMessage(System.Net.HttpStatusCode.OK)); + + // act + service.UpdateAuctionFloor(assignmentUpdated, assignment).GetAwaiter().GetResult(); + + // Assert + Assert.NotNull(assignment); + Assert.Equal(1000, assignment.FloorPrice); + mockAutoImsWebService.Verify(x => x.PostVehicleAsync(It.IsAny()), + Times.Once); + mockEmailer.Verify( + x => x.SendFloorPriceAcceptedEmail(It.IsAny(), It.IsAny(), It.IsAny(), + It.IsAny()), Times.Once); + } + + [Fact] + public void Title_Sent_Date_Change_Success() + { + // arrange + var assignment = new AuctionAssignment() + { + ID = 5, + FloorPrice = 0, + AuctionCustomerNo = "123456-789", + AuctionId = "Mannheim", + CollateralVIN = "12345678901234567", + VehicleType = 5, + SentTitleDocsDate = null + }; + var assignmentUpdated = new AuctionAssignment() + { + ID = 5, + FloorPrice = 0, + AuctionCustomerNo = "123456-789", + AuctionId = "Mannheim", + CollateralVIN = "12345678901234567", + VehicleType = 5, + SentTitleDocsDate = new System.DateTime(2017, 12, 21) + }; + WebServiceResponse response = new WebServiceResponse() + { + AuctionCollateralVin = assignmentUpdated.CollateralVIN, + Status = new WebServiceResponseStatus() + { + Description = "success", + Code = 1 + } + }; + + mockAutoImsWebService.Setup(x => x.TitleSent(It.IsAny())).ReturnsAsync(response); + + // act + service.UpdateTitleSentDate(assignmentUpdated, assignment).GetAwaiter().GetResult(); + + // assert + Assert.NotNull(assignment); + Assert.Equal(new System.DateTime(2017, 12, 21), assignment.SentTitleDocsDate); + mockAutoImsWebService.Verify(x => x.TitleSent(It.IsAny()), Times.Once); + } + + [Fact] + public void Title_Sent_Date_Change_Fail() + { + // arrange + var assignment = new AuctionAssignment() + { + ID = 5, + FloorPrice = 0, + AuctionCustomerNo = "123456-789", + AuctionId = "Mannheim", + CollateralVIN = "12345678901234567", + VehicleType = 5, + }; + var assignmentUpdated = new AuctionAssignment() + { + ID = 5, + FloorPrice = 0, + AuctionCustomerNo = "123456-789", + AuctionId = "Mannheim", + CollateralVIN = "12345678901234567", + VehicleType = 5, + SentTitleDocsDate = new System.DateTime(2017, 12, 21) + }; + WebServiceResponse response = new WebServiceResponse() + { + AuctionCollateralVin = assignmentUpdated.CollateralVIN, + Status = new WebServiceResponseStatus() + { + Description = "success", + Code = 5, + ValidationError = new WebServiceResponseStatusValidationError[] + { + new WebServiceResponseStatusValidationError() + { + Message = "test failure", + Code = "5" + } + } + } + }; + + mockAutoImsWebService.Setup(x => x.TitleSent(It.IsAny())).ReturnsAsync(response); + + // act + service.UpdateTitleSentDate(assignmentUpdated, assignment).GetAwaiter().GetResult(); + + // assert + Assert.NotNull(assignment); + Assert.Null(assignment.SentTitleDocsDate); + mockAutoImsWebService.Verify(x => x.TitleSent(It.IsAny()), Times.Once); + } + + [Fact] + public void Redeemed_Date_Change_Success() + { + // arrange + var assignment = new AuctionAssignment() + { + ID = 5, + FloorPrice = 0, + AuctionCustomerNo = "123456-789", + AuctionId = "Mannheim", + CollateralVIN = "12345678901234567", + VehicleType = 5, + RedeemedDate = null + }; + var assignmentUpdated = new AuctionAssignment() + { + ID = 5, + FloorPrice = 0, + AuctionCustomerNo = "123456-789", + AuctionId = "Mannheim", + CollateralVIN = "12345678901234567", + VehicleType = 5, + RedeemedDate = new System.DateTime(2017, 12, 21) + }; + WebServiceResponse response = new WebServiceResponse() + { + AuctionCollateralVin = assignmentUpdated.CollateralVIN, + Status = new WebServiceResponseStatus() + { + Description = "success", + Code = 1 + } + }; + + mockAutoImsWebService.Setup(x => x.Redeem(It.IsAny())).ReturnsAsync(response); + + // act + service.UpdateRedeemedDate(assignmentUpdated, assignment).GetAwaiter().GetResult(); + + // assert + Assert.NotNull(assignment); + Assert.Equal(new System.DateTime(2017, 12, 21), assignment.RedeemedDate); + mockAutoImsWebService.Verify(x => x.Redeem(It.IsAny()), Times.Once); + } + + [Fact] + public void Redeemed_Date_Change_Fail() + { + // arrange + var assignment = new AuctionAssignment() + { + ID = 5, + FloorPrice = 0, + AuctionCustomerNo = "123456-789", + AuctionId = "Mannheim", + CollateralVIN = "12345678901234567", + VehicleType = 5, + }; + var assignmentUpdated = new AuctionAssignment() + { + ID = 5, + FloorPrice = 0, + AuctionCustomerNo = "123456-789", + AuctionId = "Mannheim", + CollateralVIN = "12345678901234567", + VehicleType = 5, + RedeemedDate = new System.DateTime(2017, 12, 21) + }; + WebServiceResponse response = new WebServiceResponse() + { + AuctionCollateralVin = assignmentUpdated.CollateralVIN, + Status = new WebServiceResponseStatus() + { + Description = "success", + Code = 5, + ValidationError = new WebServiceResponseStatusValidationError[] + { + new WebServiceResponseStatusValidationError() + { + Message = "test failure", + Code = "5" + } + } + } + }; + + mockAutoImsWebService.Setup(x => x.Redeem(It.IsAny())).ReturnsAsync(response); + + // act + service.UpdateRedeemedDate(assignmentUpdated, assignment).GetAwaiter().GetResult(); + + // assert + Assert.NotNull(assignment); + Assert.Null(assignment.RedeemedDate); + mockAutoImsWebService.Verify(x => x.Redeem(It.IsAny()), Times.Once); + } + + [Fact] + public void Auction_Hold_Change_Success() + { + // arrange + var assignment = new AuctionAssignment() + { + ID = 5, + FloorPrice = 0, + AuctionCustomerNo = "123456-789", + AuctionId = "Mannheim", + CollateralVIN = "12345678901234567", + VehicleType = 5, + }; + var assignmentUpdated = new AuctionAssignment() + { + ID = 5, + FloorPrice = 0, + AuctionCustomerNo = "123456-789", + AuctionId = "Mannheim", + CollateralVIN = "12345678901234567", + VehicleType = 5, + HoldStatus = 3, + HoldUntil = new DateTime(2017, 12, 21) + }; + WebServiceResponse response = new WebServiceResponse() + { + AuctionCollateralVin = assignmentUpdated.CollateralVIN, + Status = new WebServiceResponseStatus() + { + Description = "success", + Code = 1 + } + }; + + mockAutoImsWebService.Setup(x => x.PlaceHold(It.IsAny(), It.IsAny(), It.IsAny())) + .ReturnsAsync(response); + + // act + service.UpdateHoldData(assignmentUpdated, assignment).GetAwaiter().GetResult(); + + // Assert + Assert.NotNull(assignment); + Assert.Equal(3, assignment.HoldStatus); + Assert.Equal(new DateTime(2017, 12, 21), assignment.HoldUntil); + mockAutoImsWebService.Verify(x => x.PlaceHold(It.IsAny(), It.IsAny(), It.IsAny()), + Times.Once); + } + + [Fact] + public async void Auction_Hold_Change_Fail() + { + // arrange + var assignment = new AuctionAssignment() + { + ID = 5, + FloorPrice = 0, + AuctionCustomerNo = "123456-789", + AuctionId = "Mannheim", + CollateralVIN = "12345678901234567", + VehicleType = 5, + }; + var assignmentUpdated = new AuctionAssignment() + { + ID = 5, + FloorPrice = 0, + AuctionCustomerNo = "123456-789", + AuctionId = "Mannheim", + CollateralVIN = "12345678901234567", + VehicleType = 5, + HoldStatus = 3 + }; + WebServiceResponse response = new WebServiceResponse() + { + AuctionCollateralVin = assignmentUpdated.CollateralVIN, + Status = new WebServiceResponseStatus() + { + Description = "success", + Code = 5, + ValidationError = new WebServiceResponseStatusValidationError[] + { + new WebServiceResponseStatusValidationError() + { + Message = "test failure", + Code = "5" + } + } + } + }; + + mockAutoImsWebService.Setup(x => x.PlaceHold(It.IsAny(), It.IsAny(), It.IsAny())) + .ReturnsAsync(response); + + // act + await service.UpdateHoldData(assignmentUpdated, assignment); + + // Assert + Assert.NotNull(assignment); + Assert.Null(assignment.HoldStatus); + Assert.Null(assignment.HoldUntil); + mockAutoImsWebService.Verify(x => x.PlaceHold(It.IsAny(), It.IsAny(), It.IsAny()), + Times.Once); + } + + [Fact] + public async void GetByRepoId_Ok() + { + // Arrange + mockAuctionAssignmentRepository.Setup(repo => repo.FindByRepoIdAsync(It.IsAny())).ReturnsAsync( + new List() + { + new AuctionAssignment(), + new AuctionAssignment() + }); + + // Act + var auctionAssignments = await service.GetByRepoIdAsync(5); + + // Assert + Assert.NotNull(auctionAssignments); + Assert.Equal(2, auctionAssignments.Count()); + } + + [Fact] + public async void RemoveAuction_Ok() + { + // Arrange + mockAuctionAssignmentRepository.Setup(x => x.FindByIdAsync(It.IsAny())).ReturnsAsync( + new AuctionAssignment() + { + ID = 1, + IsActive = true, + CollateralVIN = "123456789", + AuctionCustomerNo = "123-45" + }); + + // Act + var result = await service.RemoveAuction(1); + + // Assert + Assert.NotNull(result); + Assert.False(result.IsActive); + + mockAutoImsWebService.Verify(x => x.RemoveFromAuction(It.IsAny(), It.IsAny()), + Times.Once()); + mockAuctionAssignmentRepository.Verify(x => x.Update(It.IsAny()), Times.Once()); + mockUnitOfWork.Verify(x => x.CompleteAsync(), Times.Once()); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/AuctionHouseServiceTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/AuctionHouseServiceTest.cs new file mode 100644 index 0000000..8213333 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/AuctionHouseServiceTest.cs @@ -0,0 +1,389 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Exceptions; +using LCU.API.Collections.RepoApi.Factories; +using LCU.API.Collections.RepoApi.Services; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using Moq; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.Services +{ + + public class AuctionHouseServiceTest + { + [Fact] + public async void ListAll_Ok() + { + var mockAuctionHouseRepository = new Mock(); + var mockUnitOfWork = new Mock(); + + mockAuctionHouseRepository.Setup(repo => repo.ListAllAsync()).ReturnsAsync(new List() { new AuctionHouse(), new AuctionHouse(), new AuctionHouse() }); + + AuctionHouseService auctionHouseService = new AuctionHouseService(mockAuctionHouseRepository.Object, mockUnitOfWork.Object); + + var res = await auctionHouseService.ListAllAsync(); + Assert.NotNull(res); + Assert.Equal(3, res.Count()); + } + + [Fact] + public async void ListAll_Exception() + { + var mockAuctionHouseRepository = new Mock(); + var mockUnitOfWork = new Mock(); + + mockAuctionHouseRepository.Setup(repo => repo.ListAllAsync()).ThrowsAsync(new Exception("oops")); + + AuctionHouseService auctionHouseService = new AuctionHouseService(mockAuctionHouseRepository.Object, mockUnitOfWork.Object); + + await Assert.ThrowsAsync(async () => await auctionHouseService.ListAllAsync()); + } + + [Fact] + public async void SaveAsync_OK() + { + AuctionHouse AuctionHouse = new AuctionHouse() + { + AuctionID = "5" + }; + + var mockAuctionHouseRepository = new Mock(); + var mockUnitOfWork = new Mock(); + + mockAuctionHouseRepository.Setup(repo => repo.AddAsync(It.Is(param => param.AuctionID == "5"))).Returns(Task.CompletedTask); + mockUnitOfWork.Setup(mock => mock.CompleteAsync()).Returns(Task.CompletedTask); + + AuctionHouseService auctionHouseService = new AuctionHouseService(mockAuctionHouseRepository.Object, mockUnitOfWork.Object); + + var res = await auctionHouseService.SaveAsync(AuctionHouse); + Assert.NotNull(res); + Assert.Equal(AuctionHouse, res); + } + + [Fact] + public async void SaveAsync_DuplicateResource_Exception() + { + AuctionHouse AuctionHouse = new AuctionHouse() + { + AuctionID = "5" + }; + + var mockAuctionHouseRepository = new Mock(); + var mockUnitOfWork = new Mock(); + + mockAuctionHouseRepository.Setup(repo => repo.AddAsync(It.Is(param => param.AuctionID == "5"))).ThrowsAsync(new Exception("Oops")); + mockUnitOfWork.Setup(mock => mock.CompleteAsync()).Returns(Task.CompletedTask); + + AuctionHouseService auctionHouseService = new AuctionHouseService(mockAuctionHouseRepository.Object, mockUnitOfWork.Object); + + await Assert.ThrowsAsync(async () => await auctionHouseService.SaveAsync(AuctionHouse)); + } + + [Fact] + public async void SaveAsync_Exception() + { + AuctionHouse AuctionHouse = new AuctionHouse() + { + AuctionID = "5" + }; + + var mockAuctionHouseRepository = new Mock(); + var mockUnitOfWork = new Mock(); + + mockAuctionHouseRepository.Setup(repo => repo.AddAsync(It.Is(param => param.AuctionID == "5"))).ThrowsAsync(new Exception("oops")); + mockUnitOfWork.Setup(mock => mock.CompleteAsync()).Returns(Task.CompletedTask); + + AuctionHouseService auctionHouseService = new AuctionHouseService(mockAuctionHouseRepository.Object, mockUnitOfWork.Object); + + await Assert.ThrowsAsync(async () => await auctionHouseService.SaveAsync(AuctionHouse)); + } + + [Fact] + public async void Get_Ok() + { + var mockAuctionHouseRepository = new Mock(); + var mockUnitOfWork = new Mock(); + mockAuctionHouseRepository.Setup(repo => repo.FindByIdAsync(It.IsAny())).ReturnsAsync(new AuctionHouse() { AuctionID = "5" }); + mockUnitOfWork.Setup(mock => mock.CompleteAsync()).Returns(Task.CompletedTask); + + AuctionHouseService auctionHouseService = new AuctionHouseService(mockAuctionHouseRepository.Object, mockUnitOfWork.Object); + + var res = await auctionHouseService.GetAsync("5"); + Assert.NotNull(res); + Assert.Equal("5", res.AuctionID); + } + + [Fact] + public async void Get_Exception() + { + var mockAuctionHouseRepository = new Mock(); + var mockUnitOfWork = new Mock(); + mockAuctionHouseRepository.Setup(repo => repo.FindByIdAsync(It.IsAny())).ThrowsAsync(new Exception("Oops")); + mockUnitOfWork.Setup(mock => mock.CompleteAsync()).Returns(Task.CompletedTask); + + AuctionHouseService auctionHouseService = new AuctionHouseService(mockAuctionHouseRepository.Object, mockUnitOfWork.Object); + + await Assert.ThrowsAsync(async () => await auctionHouseService.GetAsync("5")); + } + + [Fact] + public async void Get_Null_Exception() + { + var mockAuctionHouseRepository = new Mock(); + var mockUnitOfWork = new Mock(); + mockAuctionHouseRepository.Setup(repo => repo.FindByIdAsync(It.IsAny())).Returns(Task.FromResult(null)); + mockUnitOfWork.Setup(mock => mock.CompleteAsync()).Returns(Task.CompletedTask); + + AuctionHouseService auctionHouseService = new AuctionHouseService(mockAuctionHouseRepository.Object, mockUnitOfWork.Object); + + await Assert.ThrowsAsync(async () => await auctionHouseService.GetAsync("5")); + } + + [Fact] + public async void Update_Null() + { + var mockAuctionHouseRepository = new Mock(); + var mockUnitOfWork = new Mock(); + + mockAuctionHouseRepository.Setup(repo => repo.FindByIdAsync(It.IsAny())).Returns(Task.FromResult(null)); + + var auctionHouseService = new AuctionHouseService(mockAuctionHouseRepository.Object, mockUnitOfWork.Object); + + var auctionHouse = new AuctionHouse + { + AuctionID = "5" + }; + + await Assert.ThrowsAsync(async () => await auctionHouseService.UpdateAsync(auctionHouse)); + } + + [Fact] + public async void Update_Exception() + { + var mockAuctionHouseRepository = new Mock(); + var mockUnitOfWork = new Mock(); + + mockAuctionHouseRepository.Setup(repo => repo.FindByIdAsync(It.IsAny())).ReturnsAsync(new AuctionHouse()); + + var auctionHouseService = new AuctionHouseService(mockAuctionHouseRepository.Object, mockUnitOfWork.Object); + + var auctionHouse = new AuctionHouse + { + AuctionID = "5" + }; + + mockAuctionHouseRepository.Setup(repo => repo.Update(It.IsAny())).Throws(new Exception("oops")); + + await Assert.ThrowsAsync(async () => await auctionHouseService.UpdateAsync(auctionHouse)); + } + + [Fact] + public async void Update_Ok() + { + var mockAuctionHouseRepository = new Mock(); + var mockUnitOfWork = new Mock(); + + mockAuctionHouseRepository.Setup(repo => repo.FindByIdAsync(It.IsAny())).ReturnsAsync(new AuctionHouse() {AuctionID = "6"}); + + var auctionHouseService = new AuctionHouseService(mockAuctionHouseRepository.Object, mockUnitOfWork.Object); + + var auctionHouse = new AuctionHouse + { + AuctionID = "5", + + }; + + var result = await auctionHouseService.UpdateAsync(auctionHouse); + + Assert.NotNull(result); + Assert.Equal("6", result.AuctionID); + } + + [Fact] + public async void Update_Existing_Exception() + { + var mockAuctionHouseRepository = new Mock(); + var mockUnitOfWork = new Mock(); + + mockAuctionHouseRepository.Setup(repo => repo.FindByIdAsync(It.IsAny())).Throws(new Exception("oops")); + + var auctionHouseService = new AuctionHouseService(mockAuctionHouseRepository.Object, mockUnitOfWork.Object); + + var auctionHouse = new AuctionHouse + { + AuctionID = "5" + }; + + await Assert.ThrowsAsync(async () => await auctionHouseService.UpdateAsync(auctionHouse)); + } + + [Fact] + public async void DeleteAsync_Ok() + { + var auctionHouse = new AuctionHouse + { + AuctionID = "5" + }; + + var mockAuctionHouseRepository = new Mock(); + var mockUnitOfWork = new Mock(); + + mockAuctionHouseRepository.Setup(repo => repo.FindByIdAsync(It.IsAny())).ReturnsAsync(auctionHouse); + mockUnitOfWork.Setup(mock => mock.CompleteAsync()).Returns(Task.CompletedTask); + mockAuctionHouseRepository.Setup(repo => repo.Remove(It.Is(param => param.AuctionID == "5"))); + + AuctionHouseService auctionHouseService = new AuctionHouseService(mockAuctionHouseRepository.Object, mockUnitOfWork.Object); + + var res = await auctionHouseService.DeleteAsync("5"); + } + + [Fact] + public async void DeleteAsync_Null() + { + var dummyAlert = new AuctionHouse + { + AuctionID = "5" + }; + + + var mockAuctionHouseRepository = new Mock(); + var mockUnitOfWork = new Mock(); + + mockAuctionHouseRepository.Setup(repo => repo.FindByIdAsync(It.IsAny())).Returns(Task.FromResult(null)); + mockUnitOfWork.Setup(mock => mock.CompleteAsync()).Returns(Task.CompletedTask); + mockAuctionHouseRepository.Setup(repo => repo.Remove(It.Is(param => param.AuctionID == "5"))); + + AuctionHouseService auctionHouseService = new AuctionHouseService(mockAuctionHouseRepository.Object, mockUnitOfWork.Object); + + await Assert.ThrowsAsync(async () => await auctionHouseService.DeleteAsync("5")); + } + + [Fact] + public async void DeleteAsync_Remove_Exception() + { + var auctionHouse = new AuctionHouse + { + AuctionID = "5" + }; + + var mockAuctionHouseRepository = new Mock(); + var mockUnitOfWork = new Mock(); + + mockAuctionHouseRepository.Setup(repo => repo.FindByIdAsync(It.IsAny())).ReturnsAsync(auctionHouse); + mockUnitOfWork.Setup(mock => mock.CompleteAsync()).Returns(Task.CompletedTask); + mockAuctionHouseRepository.Setup(repo => repo.Remove(It.Is(param => param.AuctionID == "5"))).Throws(new Exception("oops")); + + AuctionHouseService auctionHouseService = new AuctionHouseService(mockAuctionHouseRepository.Object, mockUnitOfWork.Object); + + await Assert.ThrowsAsync(async () => await auctionHouseService.DeleteAsync("5")); + } + + [Fact] + public async void DeleteAsync_Existing_Exception() + { + + var auctionHouse = new AuctionHouse + { + AuctionID = "5" + }; + + var mockAuctionHouseRepository = new Mock(); + var mockUnitOfWork = new Mock(); + + mockAuctionHouseRepository.Setup(repo => repo.FindByIdAsync(It.IsAny())).Throws(new Exception("oops")); + mockUnitOfWork.Setup(mock => mock.CompleteAsync()).Returns(Task.CompletedTask); + mockAuctionHouseRepository.Setup(repo => repo.Remove(It.Is(param => param.AuctionID == "5"))); + + AuctionHouseService auctionHouseService = new AuctionHouseService(mockAuctionHouseRepository.Object, mockUnitOfWork.Object); + + await Assert.ThrowsAsync(async () => await auctionHouseService.DeleteAsync("5")); + } + + [Fact] + public async void ListAll_Ok_2() + { + var repository = new Mock(); + var unitOfWork = new Mock(); + + repository.Setup(repo => repo.ListAllAsync()).ReturnsAsync(new List() + { + new AuctionHouse() + { + Name = "Auction House A" + } + }); + + var service = new AuctionHouseService(repository.Object, unitOfWork.Object); + + var value = await service.ListAllAsync(); + Assert.NotNull(value); + + var enumerator = value.GetEnumerator(); + enumerator.MoveNext(); + Assert.NotNull(enumerator); + Assert.Equal("Auction House A", enumerator.Current.Name); + } + + [Fact] + public async void Get_One_OK() + { + var repository = new Mock(); + var unitOfWork = new Mock(); + + repository.Setup(repo => repo.FindByIdAsync(It.IsAny())).ReturnsAsync(new AuctionHouse() + { + Name = "Auction House A" + }); + + var service = new AuctionHouseService(repository.Object, unitOfWork.Object); + + var value = await service.GetAsync("someId"); + Assert.NotNull(value); + Assert.Equal("Auction House A", value.Name); + } + + [Fact] + public async void Get_One_Does_Not_Exist() + { + var repository = new Mock(); + var unitOfWork = new Mock(); + + repository.Setup(repo => repo.FindByIdAsync(It.IsAny())).ReturnsAsync((AuctionHouse) null); + + var service = new AuctionHouseService(repository.Object, unitOfWork.Object); + + try + { + var value = await service.GetAsync("someId"); + Assert.True(false, "Exception not thrown for null return."); + } + catch (NotFoundException) + { + } + } + + [Fact] + public async void Delete_Does_Not_Exist() + { + var repository = new Mock(); + var unitOfWork = new Mock(); + + repository.Setup(repo => repo.FindByIdAsync(It.IsAny())).ReturnsAsync((AuctionHouse) null); + + var service = new AuctionHouseService(repository.Object, unitOfWork.Object); + + try + { + var value = await service.DeleteAsync("someId"); + Assert.True(false, "Exception not thrown for null return."); + } + catch (NotFoundException) + { + } + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/AuctionReportingServiceTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/AuctionReportingServiceTest.cs new file mode 100644 index 0000000..51af75d --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/AuctionReportingServiceTest.cs @@ -0,0 +1,472 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using LCU.API.Collections.RepoApi.Models.Requests; +using LCU.API.Collections.RepoApi.Services.Reporting; +using LCU.Shared.Collections.RepoApiLib.Models.Reporting; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using Moq; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.Services +{ + public class AuctionReportingServiceTest + { + private IAuctionReportingService _auctionReportingService; + private Mock _mockReportingRepository; + + public AuctionReportingServiceTest() + { + _mockReportingRepository = new Mock(); + _auctionReportingService = new AuctionReportingService(_mockReportingRepository.Object); + } + + [Fact] + public async void Empty_Result_Set_Ok() + { + // arrange + var rawResults = new List() { }; + _mockReportingRepository.Setup(x => x.GetAccountsByDateRepoed(It.IsAny(), It.IsAny())) + .ReturnsAsync(rawResults); + var request = new ReportingRequest(); + + // act + var result = await _auctionReportingService.GetAssignedBalance(request.LowDate, request.HighDate); + + // assert + Assert.NotNull(result); + } + + [Fact] + public async void GrossAmount_Two_Month_Set_Ok() + { + // arrange - should produce 4 rows with 3 columns... 2 months + total for columns and totals, two auctions, and null auctions row. + var rawResults = new List() + { + new StdReportEntry() + { + RepoId = 1000, + AuctionId = "A1", + AuctionName = "Ted", + AccountNo = "123456-789", + Balance = 1000, + CollateralId = 100, + DateRepoed = DateTime.Parse("12/15/2019"), + RepoCompanyId = 400, + DateEnteredAutoIMS = DateTime.Parse("10/01/2019") + }, + new StdReportEntry() + { + RepoId = 1001, + AuctionId = "A2", + AuctionName = "Tiger", + AccountNo = "234561-789", + Balance = 500, + CollateralId = 101, + DateRepoed = DateTime.Parse("11/15/2019"), + RepoCompanyId = 500, + DateEnteredAutoIMS = DateTime.Parse("10/01/2019") + }, + new StdReportEntry() + { + RepoId = 1001, + AuctionId = "A2", + AuctionName = "Tiger", + AccountNo = "234561-789", + Balance = 500, + CollateralId = 102, + DateRepoed = DateTime.Parse("11/15/2019"), + RepoCompanyId = 500, + DateEnteredAutoIMS = DateTime.Parse("10/01/2019") + }, + new StdReportEntry() + { + RepoId = 1002, + AuctionId = "A1", + AuctionName = "Ted", + AccountNo = "345612-789", + Balance = 500, + CollateralId = 102, + DateRepoed = DateTime.Parse("11/15/2019"), + RepoCompanyId = 500, + DateEnteredAutoIMS = DateTime.Parse("10/01/2019") + } + }; + _mockReportingRepository.Setup(x => x.GetAccountsByDateRepoed(It.IsAny(), It.IsAny())) + .ReturnsAsync(rawResults); + var highDate = DateTime.Parse("12/31/2019"); + var lowDate = DateTime.Parse("11/01/2019"); + var request = new ReportingRequest() + { + HighDate = highDate, + LowDate = lowDate + }; + + // act + var result = await _auctionReportingService.GetAssignedBalance(request.LowDate, request.HighDate); + + // assert + Assert.NotNull(result); + Assert.Equal(4, result.DataTable.Rows.Count()); + Assert.Equal(16, result.ReportTable.Cells.Length); // 4 rows of 4. + + Assert.Equal("Ted", result.ReportTable.Cells[1, 0].Display); + Assert.Equal("$1,000.00", result.ReportTable.Cells[0, 1].Display); + Assert.Equal("$1,000.00", result.ReportTable.Cells[0, 2].Display); + Assert.Equal("$2,000.00", result.ReportTable.Cells[0, 3].Display); + Assert.Equal("-", result.ReportTable.Cells[3, 3].Display); + } + + [Fact] + public async void GetActiveInventoryCountAtAuction_Two_Month_Set_Ok() + { + // arrange - should produce 4 rows with 3 columns... 2 months + total for columns and totals, two auctions, and null auctions row. + var rawResults = new List() + { + new StdReportEntry() + { + RepoId = 1, + AuctionName = "Ted", + DateRepoed = DateTime.Parse("12/15/2019"), + }, + new StdReportEntry() + { + RepoId = 2, + AuctionName = "Tiger", + DateRepoed = DateTime.Parse("11/15/2019"), + }, + new StdReportEntry() + { + RepoId = 3, + AuctionName = "Tiger", + DateRepoed = DateTime.Parse("11/15/2019"), + }, + new StdReportEntry() + { + RepoId = 4, + AuctionName = "Ted", + DateRepoed = DateTime.Parse("11/15/2019"), + } + }; + _mockReportingRepository.Setup(x => x.GetAccountsByDateRepoed(It.IsAny(), It.IsAny())) + .ReturnsAsync(rawResults); + var highDate = DateTime.Parse("12/31/2019"); + var lowDate = DateTime.Parse("11/01/2019"); + var request = new ReportingRequest() + { + HighDate = highDate, + LowDate = lowDate + }; + + // act + var result = await _auctionReportingService.GetAssignedCollateralCount(request.LowDate, request.HighDate); + + // assert + Assert.NotNull(result); + Assert.Equal(4, result.DataTable.Rows.Count()); + Assert.Equal(16, result.ReportTable.Cells.Length); // 4 rows of 4. + + // Assert Display + Assert.Equal("All Auctions", result.ReportTable.Cells[0, 0].Display); + Assert.Equal("3", result.ReportTable.Cells[0, 1].Display); + Assert.Equal("1", result.ReportTable.Cells[0, 2].Display); + Assert.Equal("4", result.ReportTable.Cells[0, 3].Display); + + Assert.Equal("Ted", result.ReportTable.Cells[1, 0].Display); + Assert.Equal("1", result.ReportTable.Cells[1, 1].Display); + Assert.Equal("1", result.ReportTable.Cells[1, 2].Display); + Assert.Equal("2", result.ReportTable.Cells[1, 3].Display); + + Assert.Equal("Tiger", result.ReportTable.Cells[2, 0].Display); + Assert.Equal("2", result.ReportTable.Cells[2, 1].Display); + Assert.Equal("-", result.ReportTable.Cells[2, 2].Display); + Assert.Equal("2", result.ReportTable.Cells[2, 3].Display); + + Assert.Equal("No Auctions", result.ReportTable.Cells[3, 0].Display); + Assert.Equal("-", result.ReportTable.Cells[3, 1].Display); + Assert.Equal("-", result.ReportTable.Cells[3, 2].Display); + Assert.Equal("-", result.ReportTable.Cells[3, 3].Display); + } + + [Fact] + public async void GetSoldPriceReport_Two_Month_Set_Ok() + { + // arrange - should produce 4 rows with 3 columns... 2 months + total for columns and totals, two auctions, and null auctions row. + var rawResults = new List() + { + new StdReportEntry() + { + AuctionName = "Ted", + RepoId = 1, + SoldDate = DateTime.Parse("11/15/2019"), + GrossSalePrice = 1500 + }, + new StdReportEntry() + { + AuctionName = "Tiger", + RepoId = 2, + SoldDate = DateTime.Parse("11/10/2019"), + GrossSalePrice = 500 + }, + new StdReportEntry() + { + AuctionName = "Tiger", + RepoId = 3, + SoldDate = DateTime.Parse("11/20/2019"), + GrossSalePrice = 1000 + }, + new StdReportEntry() + { + AuctionName = "Ted", + RepoId = 4, + SoldDate = DateTime.Parse("12/02/2019"), + GrossSalePrice = 3500 + } + }; + _mockReportingRepository.Setup(x => x.GetAccountsByDateSoldInAutoIMS(It.IsAny(), It.IsAny())) + .ReturnsAsync(rawResults); + var highDate = DateTime.Parse("12/31/2019"); + var lowDate = DateTime.Parse("11/01/2019"); + var request = new ReportingRequest() + { + HighDate = highDate, + LowDate = lowDate + }; + + // act + var result = await _auctionReportingService.GetSalePriceReport(request.LowDate, request.HighDate); + + // assert + Assert.NotNull(result); + Assert.Equal(4, result.DataTable.Rows.Count()); + Assert.Equal(12, result.ReportTable.Cells.Length); // 3 rows of 4. + + // Assert Display + Assert.Equal("All Auctions", result.ReportTable.Cells[0, 0].Display); + Assert.Equal("$3,000.00", result.ReportTable.Cells[0, 1].Display); + Assert.Equal("$3,500.00", result.ReportTable.Cells[0, 2].Display); + Assert.Equal("$6,500.00", result.ReportTable.Cells[0, 3].Display); + + Assert.Equal("Ted", result.ReportTable.Cells[1, 0].Display); + Assert.Equal("$1,500.00", result.ReportTable.Cells[1, 1].Display); + Assert.Equal("$3,500.00", result.ReportTable.Cells[1, 2].Display); + Assert.Equal("$5,000.00", result.ReportTable.Cells[1, 3].Display); + + Assert.Equal("Tiger", result.ReportTable.Cells[2, 0].Display); + Assert.Equal("$1,500.00", result.ReportTable.Cells[2, 1].Display); + Assert.Equal("-", result.ReportTable.Cells[2, 2].Display); + Assert.Equal("$1,500.00", result.ReportTable.Cells[2, 3].Display); + } + + [Fact] + public async void GetAuctionFeeReport_Two_Month_Set_Ok() + { + // arrange - should produce 4 rows with 3 columns... 2 months + total for columns and totals, two auctions, and null auctions row. + var rawResults = new List() + { + new StdReportEntry() + { + AuctionName = "Ted", + RepoId = 1, + SoldDate = DateTime.Parse("11/15/2019"), + TotalCharges = 250 + }, + new StdReportEntry() + { + AuctionName = "Tiger", + RepoId = 2, + SoldDate = DateTime.Parse("11/10/2019"), + TotalCharges = 150 + }, + new StdReportEntry() + { + AuctionName = "Tiger", + RepoId = 3, + SoldDate = DateTime.Parse("11/20/2019"), + TotalCharges = 350 + }, + new StdReportEntry() + { + AuctionName = "Ted", + RepoId = 4, + SoldDate = DateTime.Parse("12/02/2019"), + TotalCharges = 750 + } + }; + _mockReportingRepository.Setup(x => x.GetAccountsByDateSoldInAutoIMS(It.IsAny(), It.IsAny())) + .ReturnsAsync(rawResults); + var highDate = DateTime.Parse("12/31/2019"); + var lowDate = DateTime.Parse("11/01/2019"); + var request = new ReportingRequest() + { + HighDate = highDate, + LowDate = lowDate + }; + + // act + var result = await _auctionReportingService.GetAuctionFeeReport(request.LowDate, request.HighDate); + + // assert + Assert.NotNull(result); + Assert.Equal(4, result.DataTable.Rows.Count()); + Assert.Equal(12, result.ReportTable.Cells.Length); // 3 rows of 4. + + // Assert Display + Assert.Equal("All Auctions", result.ReportTable.Cells[0, 0].Display); + Assert.Equal("$750.00", result.ReportTable.Cells[0, 1].Display); + Assert.Equal("$750.00", result.ReportTable.Cells[0, 2].Display); + Assert.Equal("$1,500.00", result.ReportTable.Cells[0, 3].Display); + + Assert.Equal("Ted", result.ReportTable.Cells[1, 0].Display); + Assert.Equal("$250.00", result.ReportTable.Cells[1, 1].Display); + Assert.Equal("$750.00", result.ReportTable.Cells[1, 2].Display); + Assert.Equal("$1,000.00", result.ReportTable.Cells[1, 3].Display); + + Assert.Equal("Tiger", result.ReportTable.Cells[2, 0].Display); + Assert.Equal("$500.00", result.ReportTable.Cells[2, 1].Display); + Assert.Equal("-", result.ReportTable.Cells[2, 2].Display); + Assert.Equal("$500.00", result.ReportTable.Cells[2, 3].Display); + } + + [Fact] + public async void GetAvgDaysAssignedToSold_Two_Month_Set_Ok() + { + // arrange - should produce 4 rows with 3 columns... 2 months + total for columns and totals, two auctions, and null auctions row. + var rawResults = new List() + { + new StdReportEntry() + { + AuctionName = "Ted", + RepoId = 1, + DateEnteredAutoIMS = DateTime.Parse("11/05/2019"), + SoldDate = DateTime.Parse("11/15/2019"), + }, + new StdReportEntry() + { + AuctionName = "Tiger", + RepoId = 2, + DateEnteredAutoIMS = DateTime.Parse("11/05/2019"), + SoldDate = DateTime.Parse("11/10/2019"), + }, + new StdReportEntry() + { + AuctionName = "Tiger", + RepoId = 3, + DateEnteredAutoIMS = DateTime.Parse("11/05/2019"), + SoldDate = DateTime.Parse("11/20/2019"), + }, + new StdReportEntry() + { + AuctionName = "Ted", + RepoId = 4, + DateEnteredAutoIMS = DateTime.Parse("12/01/2019"), + SoldDate = DateTime.Parse("12/02/2019"), + } + }; + _mockReportingRepository.Setup(x => x.GetAccountsByDateSoldInAutoIMS(It.IsAny(), It.IsAny())) + .ReturnsAsync(rawResults); + var highDate = DateTime.Parse("12/31/2019"); + var lowDate = DateTime.Parse("11/01/2019"); + var request = new ReportingRequest() + { + HighDate = highDate, + LowDate = lowDate + }; + + // act + var result = await _auctionReportingService.GetAvgDaysAssignedToSold(request.LowDate, request.HighDate); + + // assert + Assert.NotNull(result); + Assert.Equal(4, result.DataTable.Rows.Count()); + Assert.Equal(12, result.ReportTable.Cells.Length); // 3 rows of 4. + + // Assert Display + Assert.Equal("All Auctions", result.ReportTable.Cells[0, 0].Display); + Assert.Equal("10", result.ReportTable.Cells[0, 1].Display); + Assert.Equal("1", result.ReportTable.Cells[0, 2].Display); + Assert.Equal("8", result.ReportTable.Cells[0, 3].Display); + + Assert.Equal("Ted", result.ReportTable.Cells[1, 0].Display); + Assert.Equal("10", result.ReportTable.Cells[1, 1].Display); + Assert.Equal("1", result.ReportTable.Cells[1, 2].Display); + Assert.Equal("6", result.ReportTable.Cells[1, 3].Display); + + Assert.Equal("Tiger", result.ReportTable.Cells[2, 0].Display); + Assert.Equal("10", result.ReportTable.Cells[2, 1].Display); + Assert.Equal("-", result.ReportTable.Cells[2, 2].Display); + Assert.Equal("10", result.ReportTable.Cells[2, 3].Display); + } + + [Fact] + public async void GetAvgNetOfFloor_Two_Month_Set_Ok() + { + // arrange - should produce 4 rows with 3 columns... 2 months + total for columns and totals, two auctions, and null auctions row. + var rawResults = new List() + { + new StdReportEntry() + { + AuctionName = "Ted", + RepoId = 1, + NetPercentFloor = 110, + SoldDate = DateTime.Parse("11/15/2019"), + }, + new StdReportEntry() + { + AuctionName = "Tiger", + RepoId = 2, + NetPercentFloor = 80, + SoldDate = DateTime.Parse("11/10/2019"), + }, + new StdReportEntry() + { + AuctionName = "Tiger", + RepoId = 3, + NetPercentFloor = 99.28m, + SoldDate = DateTime.Parse("11/20/2019"), + }, + new StdReportEntry() + { + AuctionName = "Ted", + RepoId = 4, + NetPercentFloor = 45, + SoldDate = DateTime.Parse("12/02/2019"), + } + }; + _mockReportingRepository.Setup(x => x.GetAccountsByDateSoldInAutoIMS(It.IsAny(), It.IsAny())) + .ReturnsAsync(rawResults); + var highDate = DateTime.Parse("12/31/2019"); + var lowDate = DateTime.Parse("11/01/2019"); + var request = new ReportingRequest() + { + HighDate = highDate, + LowDate = lowDate + }; + + // act + var result = await _auctionReportingService.GetAvgNetOfFloor(request.LowDate, request.HighDate); + + // assert + Assert.NotNull(result); + Assert.Equal(4, result.DataTable.Rows.Count()); + Assert.Equal(12, result.ReportTable.Cells.Length); // 3 rows of 4. + + // Assert Display + Assert.Equal("All Auctions", result.ReportTable.Cells[0, 0].Display); + Assert.Equal("96.43 %", result.ReportTable.Cells[0, 1].Display); + Assert.Equal("45.00 %", result.ReportTable.Cells[0, 2].Display); + Assert.Equal("83.57 %", result.ReportTable.Cells[0, 3].Display); + + Assert.Equal("Ted", result.ReportTable.Cells[1, 0].Display); + Assert.Equal("110.00 %", result.ReportTable.Cells[1, 1].Display); + Assert.Equal("45.00 %", result.ReportTable.Cells[1, 2].Display); + Assert.Equal("77.50 %", result.ReportTable.Cells[1, 3].Display); + + Assert.Equal("Tiger", result.ReportTable.Cells[2, 0].Display); + Assert.Equal("89.64 %", result.ReportTable.Cells[2, 1].Display); + Assert.Equal("-", result.ReportTable.Cells[2, 2].Display); + Assert.Equal("89.64 %", result.ReportTable.Cells[2, 3].Display); + } + + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/AuditRecordServiceTests.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/AuditRecordServiceTests.cs new file mode 100644 index 0000000..9aaef6e --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/AuditRecordServiceTests.cs @@ -0,0 +1,311 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Xunit; +using Moq; +using System.Linq; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.API.Collections.RepoApi.Services; +using Microsoft.AspNetCore.Mvc.RazorPages; +using LCU.API.Collections.RepoApi.Models.Filters; +using LCU.API.Collections.RepoApi.Models.Responses; +using LCU.Shared.Collections.RepoApiLib.Models.Results; +using Castle.DynamicProxy.Generators; +using LCU.API.Collections.RepoApi.Exceptions; +using Xunit.Sdk; +using System.Threading.Tasks; +using System.Threading; + +namespace LCU.API.Collections.RepoApiTests.Services +{ + public class AuditRecordServiceTests + { + [Fact] + public async void ListAll_Ok() + { + PageFilter filter = new PageFilter() + { + Limit = 5, + Page = 1 + }; + + var _mockAuditRecordRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockAuditRecordRepo.Setup(repo => repo.ListAllAsync(It.IsAny(), It.IsAny())).ReturnsAsync(new PagedResult() { Total = 1 }); + + AuditRecordService auditRecordService = new AuditRecordService(_mockAuditRecordRepo.Object, _mockUnitOfWork.Object); + + var res = await auditRecordService.ListAll(filter); + Assert.NotNull(res); + Assert.Equal(1,res.Total); + } + + [Fact] + public async void ListAll_Exception() + { + PageFilter filter = new PageFilter() + { + Limit = 5, + Page = 1 + }; + + var _mockAuditRecordRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockAuditRecordRepo.Setup(repo => repo.ListAllAsync(It.IsAny(), It.IsAny())).ThrowsAsync(new Exception("oops")); + + AuditRecordService auditRecordService = new AuditRecordService(_mockAuditRecordRepo.Object, _mockUnitOfWork.Object); + + await Assert.ThrowsAsync(async () => await auditRecordService.ListAll(filter)); + } + + [Fact] + public async void SaveAsync_Ok() + { + + AuditRecord auditRecord = new AuditRecord() + { + ID = 5 + }; + + var _mockAuditRecordRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockAuditRecordRepo.Setup(repo => repo.AddAsync(It.IsAny())).Returns(Task.CompletedTask); + _mockUnitOfWork.Setup(mock => mock.CompleteAsync()).Returns(Task.CompletedTask); + + AuditRecordService auditRecordService = new AuditRecordService(_mockAuditRecordRepo.Object, _mockUnitOfWork.Object); + + var res = await auditRecordService.SaveAsync(auditRecord); + Assert.NotNull(res); + Assert.Equal(auditRecord, res); + } + + [Fact] + public async void SaveAsync_Exception() + { + + AuditRecord auditRecord = new AuditRecord() + { + ID = 5 + }; + + var _mockAuditRecordRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockAuditRecordRepo.Setup(repo => repo.AddAsync(It.IsAny())); + _mockUnitOfWork.Setup(mock => mock.CompleteAsync()).Returns(Task.CompletedTask); + + AuditRecordService auditRecordService = new AuditRecordService(_mockAuditRecordRepo.Object, _mockUnitOfWork.Object); + + await Assert.ThrowsAsync(async () => await auditRecordService.SaveAsync(auditRecord)); + } + + [Fact] + public async void Get_OK() + { + AuditRecord auditRecord = new AuditRecord() + { + ID = 5 + }; + + var _mockAuditRecordRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockAuditRecordRepo.Setup(repo => repo.FindByIdAsync(It.IsAny())).ReturnsAsync(auditRecord); + _mockUnitOfWork.Setup(mock => mock.CompleteAsync()).Returns(Task.CompletedTask); + + AuditRecordService auditRecordService = new AuditRecordService(_mockAuditRecordRepo.Object, _mockUnitOfWork.Object); + + var res = await auditRecordService.Get(5); + Assert.NotNull(res); + Assert.Equal(auditRecord, res); + } + + [Fact] + public async void Get_Exception() + { + AuditRecord auditRecord = new AuditRecord() + { + ID = 5 + }; + + var _mockAuditRecordRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockAuditRecordRepo.Setup(repo => repo.FindByIdAsync(It.IsAny())).ThrowsAsync(new Exception("oops")); + _mockUnitOfWork.Setup(mock => mock.CompleteAsync()).Returns(Task.CompletedTask); + + AuditRecordService auditRecordService = new AuditRecordService(_mockAuditRecordRepo.Object, _mockUnitOfWork.Object); + + await Assert.ThrowsAsync(async() => await auditRecordService.Get(5)); + } + + [Fact] + public async void UpdateAsync_OK() + { + AuditRecord auditRecord = new AuditRecord() + { + ID = 5 + }; + + var _mockAuditRecordRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockAuditRecordRepo.Setup(repo => repo.FindByIdAsync(It.IsAny())).ReturnsAsync(auditRecord); + _mockUnitOfWork.Setup(mock => mock.CompleteAsync()).Returns(Task.CompletedTask); + _mockAuditRecordRepo.Setup(repo => repo.Update(It.IsAny())); + + AuditRecordService auditRecordService = new AuditRecordService(_mockAuditRecordRepo.Object, _mockUnitOfWork.Object); + + var res = await auditRecordService.UpdateAsync(auditRecord); + Assert.NotNull(res); + Assert.Equal(auditRecord,res); + } + + [Fact] + public async void UpdateAsync_Existing_Exception() + { + AuditRecord auditRecord = new AuditRecord() + { + ID = 5 + }; + + var _mockAuditRecordRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockAuditRecordRepo.Setup(repo => repo.FindByIdAsync(It.IsAny())).ThrowsAsync(new Exception("oops")); + _mockUnitOfWork.Setup(mock => mock.CompleteAsync()).Returns(Task.CompletedTask); + _mockAuditRecordRepo.Setup(repo => repo.Update(It.IsAny())); + + AuditRecordService auditRecordService = new AuditRecordService(_mockAuditRecordRepo.Object, _mockUnitOfWork.Object); + + await Assert.ThrowsAsync(async () => await auditRecordService.UpdateAsync(auditRecord)); + } + + [Fact] + public async void UpdateAsync_Existing_Null() + { + AuditRecord auditRecord = new AuditRecord() + { + ID = 5 + }; + + var _mockAuditRecordRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockAuditRecordRepo.Setup(repo => repo.FindByIdAsync(It.IsAny())).Returns(Task.FromResult(null)); + _mockUnitOfWork.Setup(mock => mock.CompleteAsync()).Returns(Task.CompletedTask); + _mockAuditRecordRepo.Setup(repo => repo.Update(It.IsAny())); + + AuditRecordService auditRecordService = new AuditRecordService(_mockAuditRecordRepo.Object, _mockUnitOfWork.Object); + + await Assert.ThrowsAsync(async () => await auditRecordService.UpdateAsync(auditRecord)); + } + + [Fact] + public async void UpdateAsync_Update_Exception() + { + AuditRecord auditRecord = new AuditRecord() + { + ID = 5 + }; + + var _mockAuditRecordRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockAuditRecordRepo.Setup(repo => repo.FindByIdAsync(It.IsAny())).ReturnsAsync(auditRecord); + _mockUnitOfWork.Setup(mock => mock.CompleteAsync()).Returns(Task.CompletedTask); + _mockAuditRecordRepo.Setup(repo => repo.Update(It.IsAny())).Throws(new Exception("oops")); + + AuditRecordService auditRecordService = new AuditRecordService(_mockAuditRecordRepo.Object, _mockUnitOfWork.Object); + + await Assert.ThrowsAsync(async () => await auditRecordService.UpdateAsync(auditRecord)); + } + + [Fact] + public async void DeleteAsync_OK() + { + AuditRecord auditRecord = new AuditRecord() + { + ID = 5 + }; + + var _mockAuditRecordRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockAuditRecordRepo.Setup(repo => repo.FindByIdAsync(It.IsAny())).ReturnsAsync(auditRecord); + _mockUnitOfWork.Setup(mock => mock.CompleteAsync()).Returns(Task.CompletedTask); + _mockAuditRecordRepo.Setup(repo => repo.Remove(It.IsAny())); + + AuditRecordService auditRecordService = new AuditRecordService(_mockAuditRecordRepo.Object, _mockUnitOfWork.Object); + + var res = await auditRecordService.DeleteAsync(5); + Assert.NotNull(res); + Assert.Equal(auditRecord, res); + } + + [Fact] + public async void DeleteAsync_Existing_Exception() + { + AuditRecord auditRecord = new AuditRecord() + { + ID = 5 + }; + + var _mockAuditRecordRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockAuditRecordRepo.Setup(repo => repo.FindByIdAsync(It.IsAny())).ThrowsAsync(new Exception("oops")); + _mockUnitOfWork.Setup(mock => mock.CompleteAsync()).Returns(Task.CompletedTask); + _mockAuditRecordRepo.Setup(repo => repo.Remove(It.IsAny())); + + AuditRecordService auditRecordService = new AuditRecordService(_mockAuditRecordRepo.Object, _mockUnitOfWork.Object); + + await Assert.ThrowsAsync(async () => await auditRecordService.DeleteAsync(5)); + } + + [Fact] + public async void DeleteAsync_Existing_Null() + { + AuditRecord auditRecord = new AuditRecord() + { + ID = 5 + }; + + var _mockAuditRecordRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockAuditRecordRepo.Setup(repo => repo.FindByIdAsync(It.IsAny())).Returns(Task.FromResult(null)); + _mockUnitOfWork.Setup(mock => mock.CompleteAsync()).Returns(Task.CompletedTask); + _mockAuditRecordRepo.Setup(repo => repo.Remove(It.IsAny())); + + AuditRecordService auditRecordService = new AuditRecordService(_mockAuditRecordRepo.Object, _mockUnitOfWork.Object); + + await Assert.ThrowsAsync(async () => await auditRecordService.DeleteAsync(5)); + } + + [Fact] + public async void DeleteAsync_Update_Exception() + { + AuditRecord auditRecord = new AuditRecord() + { + ID = 5 + }; + + var _mockAuditRecordRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockAuditRecordRepo.Setup(repo => repo.FindByIdAsync(It.IsAny())).ReturnsAsync(auditRecord); + _mockUnitOfWork.Setup(mock => mock.CompleteAsync()).Returns(Task.CompletedTask); + _mockAuditRecordRepo.Setup(repo => repo.Remove(It.IsAny())).Throws(new Exception("oops")); + + AuditRecordService auditRecordService = new AuditRecordService(_mockAuditRecordRepo.Object, _mockUnitOfWork.Object); + + await Assert.ThrowsAsync(async () => await auditRecordService.DeleteAsync(5)); + } + + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/AutoImsServiceTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/AutoImsServiceTest.cs new file mode 100644 index 0000000..bebfc54 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/AutoImsServiceTest.cs @@ -0,0 +1,118 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using LCU.API.Collections.RepoApi.Configuration; +using LCU.API.Collections.RepoApi.HostedServices; +using LCU.API.Collections.RepoApi.Services; +using LCU.API.Collections.RepoApi.Services.AutoIms; +using LCU.Shared.Collections.RepoApiLib.Models; +using Microsoft.AspNetCore.Identity.UI.V3.Pages.Internal.Account.Manage; +using Microsoft.Win32.SafeHandles; +using Moq; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.Services +{ + public class AutoImsServiceTest + { + private readonly AutoImsService _autoImsProcessor; + private readonly Mock mockImsAutoFileDataConverter; + private readonly Mock mockImsAutoFileNoteConverter; + private readonly Mock mockDownloader; + private readonly RepoApiConfiguration testConfig; + private readonly Mock mockAutoImsImporterService; + private readonly Mock mockEmailer; + + public AutoImsServiceTest() + { + mockImsAutoFileDataConverter = new Mock(); + mockImsAutoFileNoteConverter = new Mock(); + mockDownloader = new Mock(); + testConfig = new RepoApiConfiguration() + { + CheckForLocalFiles = true, + DownloadNewFiles = true, + MoveProcessedFiles = false, + LocalDirectoryPath = ".\\SampleData", + RemoteFilePath = "." + }; + mockAutoImsImporterService = new Mock(); + mockEmailer = new Mock(); + + _autoImsProcessor = new AutoImsService(mockDownloader.Object, + testConfig, mockAutoImsImporterService.Object, mockImsAutoFileDataConverter.Object, + mockImsAutoFileNoteConverter.Object, mockEmailer.Object); + } + + [Fact] + public void Test_Download_Exception() + { + mockDownloader.Setup(down => down.DownLoadAuctionFiles()).Throws(new Exception("oops")); + mockDownloader.Setup(down => down.CombineWithLocalFiles(It.IsAny>())).Returns(new Dictionary() { { new FileInfo("filename"), "test1" } }); + + var res = _autoImsProcessor.Download(); + Assert.NotNull(res); + Assert.Empty(res); + } + + [Fact] + public void Basic_Download_Test() + { + mockDownloader.Setup(service => service.DownLoadAuctionFiles()) + .Verifiable("Call Download"); + mockDownloader.Setup(service => service.CombineWithLocalFiles(It.IsAny>())) + .Verifiable("Call Download"); + mockDownloader.Setup(service => service.ConvertToFileList(It.IsAny>())) + .Returns( + new List()); + Assert.True(testConfig.DownloadNewFiles); + Assert.True(testConfig.CheckForLocalFiles); + var files = _autoImsProcessor.Download(); + mockDownloader.VerifyAll(); + } + + [Fact] + public void ProcessDownloadedFiles_Ok() + { + var fileInfos = new List() { new FileInfo("Test1"), new FileInfo("Test2") }; + + _autoImsProcessor.ProcessDownloadedFiles(fileInfos); + } + + [Fact] + public void ProcessDownloadedFiles_Exception() + { + List fileInfos = null; + + Assert.Throws(() => _autoImsProcessor.ProcessDownloadedFiles(fileInfos)); + } + + [Fact] + public void Basic_Construct_Test() + { + Assert.NotNull(_autoImsProcessor); + Assert.Throws(() => { _autoImsProcessor.ProcessDownloadedFiles(null); }); + } + + [Fact] + public void No_Files_Test() + { + testConfig.DownloadNewFiles = false; + testConfig.CheckForLocalFiles = false; + mockDownloader.Setup(service => service.DownLoadAuctionFiles()) + .Verifiable("Call Download"); + mockDownloader.Setup(service => service.CombineWithLocalFiles(It.IsAny>())) + .Verifiable("Call Download"); + mockDownloader.Setup(service => service.ConvertToFileList(It.IsAny>())) + .Returns( + new List()); + Assert.False(testConfig.DownloadNewFiles); + Assert.False(testConfig.CheckForLocalFiles); + var files = _autoImsProcessor.Download(); + mockDownloader.Verify(foo => foo.DownLoadAuctionFiles(), Times.Never()); + mockDownloader.Verify(foo => foo.CombineWithLocalFiles(It.IsAny>()), + Times.Never()); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/CollateralServiceTests.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/CollateralServiceTests.cs new file mode 100644 index 0000000..65f5615 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/CollateralServiceTests.cs @@ -0,0 +1,277 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Xunit; +using System.Linq; +using Moq; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.API.Collections.RepoApi.Services; +using LCU.API.Collections.RepoApi.Exceptions; +using System.Threading.Tasks; +using System.Xml.Linq; + +namespace LCU.API.Collections.RepoApiTests.Services +{ + public class CollateralServiceTests + { + [Fact] + public async void ListAll_Ok() + { + var _mockCollateralRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockCollateralRepo.Setup(repo => repo.ListAllAsync()).ReturnsAsync(new List() { new Collateral() { }, new Collateral() { } }); + + CollateralService collateralService = new CollateralService(_mockCollateralRepo.Object, _mockUnitOfWork.Object); + + var res = await collateralService.ListAll(); + Assert.NotNull(res); + Assert.Equal(2, res.Count()); + } + + [Fact] + public async System.Threading.Tasks.Task ListAll_Exception() + { + var _mockCollateralRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockCollateralRepo.Setup(repo => repo.ListAllAsync()).ThrowsAsync(new Exception("oops")); + + CollateralService collateralService = new CollateralService(_mockCollateralRepo.Object, _mockUnitOfWork.Object); + + await Assert.ThrowsAsync(() => collateralService.ListAll()); + } + + [Fact] + public async void SaveAsync_Ok() + { + Collateral collateral = new Collateral() + { + Make = "Sienar Fleet Systems", + Model = "TIE/ln space superiority starfighter", + BodyStyle = "Starfighter", + CollateralId = 12345 + }; + + var _mockCollateralRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockCollateralRepo.Setup(repo => repo.AddAsync(It.IsAny())).ReturnsAsync(collateral); + _mockUnitOfWork.Setup(mock => mock.CompleteAsync()).Returns(Task.CompletedTask); + + CollateralService collateralService = new CollateralService(_mockCollateralRepo.Object, _mockUnitOfWork.Object); + + var res = await collateralService.SaveAsync(collateral); + + Assert.Equal(collateral, res); + } + + [Fact] + public async void SaveAsync_Exception() + { + Collateral collateral = new Collateral() + { + Make = "Sienar Fleet Systems", + Model = "TIE/ln space superiority starfighter", + BodyStyle = "Starfighter", + CollateralId = 12345 + }; + + var _mockCollateralRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockCollateralRepo.Setup(repo => repo.AddAsync(It.Is(param => param == collateral))).ThrowsAsync(new Exception("oops")); + + CollateralService collateralService = new CollateralService(_mockCollateralRepo.Object, _mockUnitOfWork.Object); + + await Assert.ThrowsAsync(async () => await collateralService.SaveAsync(collateral)); + } + + [Fact] + public async void Get_Exception() + { + Collateral collateral = new Collateral() + { + Make = "Sienar Fleet Systems", + Model = "TIE/ln space superiority starfighter", + BodyStyle = "Starfighter", + CollateralId = 12345 + }; + + var _mockCollateralRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockCollateralRepo.Setup(repo => repo.FindByIdAsync(It.IsAny())).ThrowsAsync(new Exception("oops")); + + CollateralService collateralService = new CollateralService(_mockCollateralRepo.Object, _mockUnitOfWork.Object); + + await Assert.ThrowsAsync(async () => await collateralService.Get(12345)); + } + + [Fact] + public async void Get_Null_Exception() + { + Collateral collateral = new Collateral() + { + Make = "Sienar Fleet Systems", + Model = "TIE/ln space superiority starfighter", + BodyStyle = "Starfighter", + CollateralId = 12345 + }; + + var _mockCollateralRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockCollateralRepo.Setup(repo => repo.FindByIdAsync(It.IsAny())).Returns(Task.FromResult(null)); + + CollateralService collateralService = new CollateralService(_mockCollateralRepo.Object, _mockUnitOfWork.Object); + + await Assert.ThrowsAsync(async () => await collateralService.Get(12345)); + } + + [Fact] + public async void Get_Ok() + { + Collateral collateral = new Collateral() + { + Make = "Sienar Fleet Systems", + Model = "TIE/ln space superiority starfighter", + BodyStyle = "Starfighter", + CollateralId = 12345 + }; + + var _mockCollateralRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockCollateralRepo.Setup(repo => repo.FindByIdAsync(It.IsAny())).ReturnsAsync(collateral); + + CollateralService collateralService = new CollateralService(_mockCollateralRepo.Object, _mockUnitOfWork.Object); + + var res = await collateralService.Get(12345); + Assert.Equal(collateral, res); + } + + [Fact] + public async void UpdateAsync_Ok() + { + Collateral collateral = new Collateral() + { + Make = "Sienar Fleet Systems", + Model = "TIE/ln space superiority starfighter", + BodyStyle = "Starfighter", + CollateralId = 12345, + Vin = "r2d2c3p0", + Year = 10, + Description = "starfighter of choice for the Galactic Empire", + VehicleType = 5, + Inoperable = false, + CollateralTypeId = 1, + RetitledInLandmarkName = DateTime.Now + }; + + var _mockCollateralRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockCollateralRepo.Setup(repo => repo.FindByIdAsync(It.IsAny())).ReturnsAsync(collateral); + _mockCollateralRepo.Setup(repo => repo.Update(It.Is(param => param.Vin == "r2d2c3p0"))); + _mockUnitOfWork.Setup(mock => mock.CompleteAsync()).Returns(Task.CompletedTask); + + CollateralService collateralService = new CollateralService(_mockCollateralRepo.Object, _mockUnitOfWork.Object); + + var res = await collateralService.UpdateAsync(collateral); + Assert.Equal(collateral, res); + } + + [Fact] + public async void UpdateAsync_Existing_Null() + { + Collateral collateral = new Collateral() + { + Make = "Sienar Fleet Systems", + Model = "TIE/ln space superiority starfighter", + BodyStyle = "Starfighter", + CollateralId = 12345, + Vin = "r2d2c3p0", + Year = 10, + Description = "starfighter of choice for the Galactic Empire", + VehicleType = 5, + Inoperable = false, + CollateralTypeId = 1, + RetitledInLandmarkName = DateTime.Now + }; + + var _mockCollateralRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockCollateralRepo.Setup(repo => repo.FindByIdAsync(It.IsAny())).Returns(Task.FromResult(null)); + _mockCollateralRepo.Setup(repo => repo.Update(It.Is(param => param.Vin == "r2d2c3p0"))); + _mockUnitOfWork.Setup(mock => mock.CompleteAsync()).Returns(Task.CompletedTask); + + CollateralService collateralService = new CollateralService(_mockCollateralRepo.Object, _mockUnitOfWork.Object); + + await Assert.ThrowsAsync(async () => await collateralService.UpdateAsync(collateral)); + } + + [Fact] + public async void UpdateAsync_Existing_Exception() + { + Collateral collateral = new Collateral() + { + Make = "Sienar Fleet Systems", + Model = "TIE/ln space superiority starfighter", + BodyStyle = "Starfighter", + CollateralId = 12345, + Vin = "r2d2c3p0", + Year = 10, + Description = "starfighter of choice for the Galactic Empire", + VehicleType = 5, + Inoperable = false, + CollateralTypeId = 1, + RetitledInLandmarkName = DateTime.Now + }; + + var _mockCollateralRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockCollateralRepo.Setup(repo => repo.FindByIdAsync(It.IsAny())).ThrowsAsync(new Exception("oops")); + _mockCollateralRepo.Setup(repo => repo.Update(It.Is(param => param.Vin == "r2d2c3p0"))); + _mockUnitOfWork.Setup(mock => mock.CompleteAsync()).Returns(Task.CompletedTask); + + CollateralService collateralService = new CollateralService(_mockCollateralRepo.Object, _mockUnitOfWork.Object); + + await Assert.ThrowsAsync(async () => await collateralService.UpdateAsync(collateral)); + } + + [Fact] + public async void UpdateAsync_Update_Exception() + { + Collateral collateral = new Collateral() + { + Make = "Sienar Fleet Systems", + Model = "TIE/ln space superiority starfighter", + BodyStyle = "Starfighter", + CollateralId = 12345, + Vin = "r2d2c3p0", + Year = 10, + Description = "starfighter of choice for the Galactic Empire", + VehicleType = 5, + Inoperable = false, + CollateralTypeId = 1, + RetitledInLandmarkName = DateTime.Now + }; + + var _mockCollateralRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockCollateralRepo.Setup(repo => repo.FindByIdAsync(It.IsAny())).ReturnsAsync(collateral); + _mockCollateralRepo.Setup(repo => repo.Update(It.Is(param => param.Vin == "r2d2c3p0"))).Throws(new Exception("oops")); + _mockUnitOfWork.Setup(mock => mock.CompleteAsync()).Returns(Task.CompletedTask); + + CollateralService collateralService = new CollateralService(_mockCollateralRepo.Object, _mockUnitOfWork.Object); + + await Assert.ThrowsAsync(async () => await collateralService.UpdateAsync(collateral)); + } + + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/EventAlertServiceTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/EventAlertServiceTest.cs new file mode 100644 index 0000000..cc79f87 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/EventAlertServiceTest.cs @@ -0,0 +1,739 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Castle.DynamicProxy.Generators; +using LCU.API.Collections.RepoApi.Exceptions; +using LCU.API.Collections.RepoApi.Models; +using LCU.API.Collections.RepoApi.Services; +using LCU.Shared.Collections.RepoApiLib.Exceptions; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using Moq; +using Xunit; +using Xunit.Sdk; + +namespace LCU.API.Collections.RepoApiTests.Services +{ + public class EventAlertServiceTest + { + [Fact] + public async void ListAll_Ok() + { + var mockEventAlertRepository = new Mock(); + var mockUnitOfWork = new Mock(); + var mockRepoRepository = new Mock(); + + mockEventAlertRepository.Setup(repo => repo.ListAllAsync()).ReturnsAsync(new List() { new EventAlert(), new EventAlert(), new EventAlert() }); + + EventAlertService eventAlertService = new EventAlertService(mockEventAlertRepository.Object, mockUnitOfWork.Object, mockRepoRepository.Object); + + var res = await eventAlertService.ListAll(); + Assert.NotNull(res); + Assert.Equal(3, res.Count()); + } + + [Fact] + public async void ListAll_Exception() + { + var mockEventAlertRepository = new Mock(); + var mockUnitOfWork = new Mock(); + var mockRepoRepository = new Mock(); + + mockEventAlertRepository.Setup(repo => repo.ListAllAsync()).ThrowsAsync(new Exception("oops")); + + EventAlertService eventAlertService = new EventAlertService(mockEventAlertRepository.Object, mockUnitOfWork.Object, mockRepoRepository.Object); + + await Assert.ThrowsAsync(async () => await eventAlertService.ListAll()); + } + + [Fact] + public async void ListUnread_Ok() + { + var mockEventAlertRepository = new Mock(); + var mockUnitOfWork = new Mock(); + var mockRepoRepository = new Mock(); + + mockEventAlertRepository.Setup(repo => repo.ListUnreadAsync()).ReturnsAsync(new List() { new EventAlert(), new EventAlert(), new EventAlert() }); + + EventAlertService eventAlertService = new EventAlertService(mockEventAlertRepository.Object, mockUnitOfWork.Object, mockRepoRepository.Object); + + var res = await eventAlertService.ListUnread(); + Assert.NotNull(res); + Assert.Equal(3, res.Count()); + } + + [Fact] + public async void ListUnread_Exception() + { + var mockEventAlertRepository = new Mock(); + var mockUnitOfWork = new Mock(); + var mockRepoRepository = new Mock(); + + mockEventAlertRepository.Setup(repo => repo.ListUnreadAsync()).ThrowsAsync(new Exception("oops")); + + EventAlertService eventAlertService = new EventAlertService(mockEventAlertRepository.Object, mockUnitOfWork.Object, mockRepoRepository.Object); + + await Assert.ThrowsAsync(async () => await eventAlertService.ListUnread()); + } + + [Fact] + public async void ListWithinDateRange_OK() + { + var mockEventAlertRepository = new Mock(); + var mockUnitOfWork = new Mock(); + var mockRepoRepository = new Mock(); + + mockEventAlertRepository.Setup(repo => repo.ListWithinDateRangeAsync(It.IsAny(), It.IsAny())).ReturnsAsync(new List() { new EventAlert(), new EventAlert(), new EventAlert() }); + + EventAlertService eventAlertService = new EventAlertService(mockEventAlertRepository.Object, mockUnitOfWork.Object, mockRepoRepository.Object); + + var res = await eventAlertService.ListWithinDateRange(DateTime.Now, DateTime.Now.AddDays(5)); + Assert.NotNull(res); + Assert.Equal(3, res.Count()); + } + + [Fact] + public async void ListWithinDateRange_Exception() + { + var mockEventAlertRepository = new Mock(); + var mockUnitOfWork = new Mock(); + var mockRepoRepository = new Mock(); + + mockEventAlertRepository.Setup(repo => repo.ListWithinDateRangeAsync(It.IsAny(), It.IsAny())).ThrowsAsync(new Exception("oops")); + + EventAlertService eventAlertService = new EventAlertService(mockEventAlertRepository.Object, mockUnitOfWork.Object, mockRepoRepository.Object); + + await Assert.ThrowsAsync(async () => await eventAlertService.ListWithinDateRange(DateTime.Now, DateTime.Now.AddDays(5))); + } + + [Fact] + public async void ListActionNeeded_Exception() + { + var mockEventAlertRepository = new Mock(); + var mockUnitOfWork = new Mock(); + var mockRepoRepository = new Mock(); + + mockEventAlertRepository.Setup(repo => repo.ListRepoNoAuctionAsync()).ReturnsAsync(new List() { new EventAlert(), new EventAlert() }); + mockEventAlertRepository.Setup(repo => repo.ListRepoNoCompanyAsync()).ReturnsAsync(new List() { new EventAlert() }); + mockEventAlertRepository.Setup(repo => repo.ListO4rNoCompanyAsync()).ReturnsAsync(new List() { new EventAlert(), new EventAlert() }); + mockEventAlertRepository.Setup(repo => repo.ListReadyForRetitleAsync()).ReturnsAsync(new List() { new EventAlert(), new EventAlert(), new EventAlert() }); + mockEventAlertRepository.Setup(repo => repo.ListFloorUpdateFailedAsync()).ThrowsAsync(new Exception("oops")); + mockEventAlertRepository.Setup(repo => repo.ListFloorNeedsSettingAsync()).ReturnsAsync(new List() { new EventAlert(), new EventAlert(), new EventAlert() }); + + EventAlertService eventAlertService = new EventAlertService(mockEventAlertRepository.Object, mockUnitOfWork.Object, mockRepoRepository.Object); + + await Assert.ThrowsAsync(async () => await eventAlertService.ListActionNeeded()); + } + + [Fact] + public async void ListActionNeeded_OK() + { + var mockEventAlertRepository = new Mock(); + var mockUnitOfWork = new Mock(); + var mockRepoRepository = new Mock(); + + mockEventAlertRepository.Setup(repo => repo.ListRepoNoAuctionAsync()).ReturnsAsync(new List() { new EventAlert(), new EventAlert() }); + mockEventAlertRepository.Setup(repo => repo.ListRepoNoCompanyAsync()).ReturnsAsync(new List() { new EventAlert() }); + mockEventAlertRepository.Setup(repo => repo.ListO4rNoCompanyAsync()).ReturnsAsync(new List() { new EventAlert(), new EventAlert() }); + mockEventAlertRepository.Setup(repo => repo.ListReadyForRetitleAsync()).ReturnsAsync(new List() { new EventAlert(), new EventAlert(), new EventAlert() }); + mockEventAlertRepository.Setup(repo => repo.ListFloorUpdateFailedAsync()).ReturnsAsync(new List() { new EventAlert() }); + mockEventAlertRepository.Setup(repo => repo.ListFloorNeedsSettingAsync()).ReturnsAsync(new List() { new EventAlert(), new EventAlert(), new EventAlert() }); + + EventAlertService eventAlertService = new EventAlertService(mockEventAlertRepository.Object, mockUnitOfWork.Object, mockRepoRepository.Object); + + var res = await eventAlertService.ListActionNeeded(); + Assert.NotNull(res); + Assert.Equal(12, res.Count()); + } + + [Fact] + public async void SaveAsync_OK() + { + EventAlert eventAlert = new EventAlert() + { + Id = 5, + RepoId = 100 + }; + + RepoAccount account = new RepoAccount() + { + RepoId = 100, + Status = "O4R" + }; + + var mockEventAlertRepository = new Mock(); + var mockUnitOfWork = new Mock(); + var mockRepoRepository = new Mock(); + + mockEventAlertRepository.Setup(repo => repo.AddAsync(It.Is(param => param.Id == 5))).Returns(Task.CompletedTask); + mockRepoRepository.Setup(repo => repo.FindByIdAsync(It.Is(param => param == 100))).Returns(Task.FromResult(account)); + mockUnitOfWork.Setup(mock => mock.CompleteAsync()).Returns(Task.CompletedTask); + + EventAlertService eventAlertService = new EventAlertService(mockEventAlertRepository.Object, mockUnitOfWork.Object, mockRepoRepository.Object); + + var res = await eventAlertService.SaveAsync(eventAlert); + Assert.NotNull(res); + Assert.Equal(eventAlert, res); + } + + [Fact] + public async void SaveAsync_DuplicateResource_Exception() + { + EventAlert eventAlert = new EventAlert() + { + Id = 5, + RepoId = 100, + Message = "RTC Letter Not Found" + }; + + RepoAccount account = new RepoAccount() + { + RepoId = 100, + Status = "RTC Letter Not Found" + }; + + var mockEventAlertRepository = new Mock(); + var mockUnitOfWork = new Mock(); + var mockRepoRepository = new Mock(); + + mockEventAlertRepository.Setup(repo => repo.AddAsync(It.Is(param => param.Id == 5))).ThrowsAsync(new DuplicateResourceException("resource")); + mockRepoRepository.Setup(repo => repo.FindByIdAsync(It.Is(param => param == 100))).Returns(Task.FromResult(account)); + mockUnitOfWork.Setup(mock => mock.CompleteAsync()).Returns(Task.CompletedTask); + + EventAlertService eventAlertService = new EventAlertService(mockEventAlertRepository.Object, mockUnitOfWork.Object, mockRepoRepository.Object); + + await Assert.ThrowsAsync(async () => await eventAlertService.SaveAsync(eventAlert)); + } + + [Fact] + public async void SaveAsync_Exception() + { + EventAlert eventAlert = new EventAlert() + { + Id = 5 + }; + + var mockEventAlertRepository = new Mock(); + var mockUnitOfWork = new Mock(); + var mockRepoRepository = new Mock(); + + mockEventAlertRepository.Setup(repo => repo.AddAsync(It.Is(param => param.Id == 5))).ThrowsAsync(new Exception("oops")); + mockUnitOfWork.Setup(mock => mock.CompleteAsync()).Returns(Task.CompletedTask); + + EventAlertService eventAlertService = new EventAlertService(mockEventAlertRepository.Object, mockUnitOfWork.Object, mockRepoRepository.Object); + + await Assert.ThrowsAsync(async () => await eventAlertService.SaveAsync(eventAlert)); + } + + [Fact] + public async void saveRangeAsync_Ok() + { + List range = new List() { new EventAlert(), new EventAlert(), new EventAlert() }; + + var mockEventAlertRepository = new Mock(); + var mockUnitOfWork = new Mock(); + var mockRepoRepository = new Mock(); + mockEventAlertRepository.Setup(repo => repo.AddRangeAsync(It.Is>(param => param.Count() == 3))).ReturnsAsync(new List() { new EventAlert(), new EventAlert() }); + mockUnitOfWork.Setup(mock => mock.CompleteAsync()).Returns(Task.CompletedTask); + + EventAlertService eventAlertService = new EventAlertService(mockEventAlertRepository.Object, mockUnitOfWork.Object, mockRepoRepository.Object); + + var res = await eventAlertService.SaveRangeAsync(range); + Assert.NotNull(res); + Assert.Equal(2, res.Count()); + } + + [Fact] + public async void saveRangeAsync_Exception() + { + List range = new List() { new EventAlert(), new EventAlert(), new EventAlert() }; + + var mockEventAlertRepository = new Mock(); + var mockUnitOfWork = new Mock(); + var mockRepoRepository = new Mock(); + + mockEventAlertRepository.Setup(repo => repo.AddRangeAsync(It.Is>(param => param.Count() == 3))).ThrowsAsync(new Exception("oops")); + mockUnitOfWork.Setup(mock => mock.CompleteAsync()).Returns(Task.CompletedTask); + + EventAlertService eventAlertService = new EventAlertService(mockEventAlertRepository.Object, mockUnitOfWork.Object, mockRepoRepository.Object); + + var res = await eventAlertService.SaveRangeAsync(range); + Assert.NotNull(res); + Assert.Empty(res); + } + + [Fact] + public async void Get_Ok() + { + var mockEventAlertRepository = new Mock(); + var mockUnitOfWork = new Mock(); + var mockRepoRepository = new Mock(); + mockEventAlertRepository.Setup(repo => repo.FindByIdAsync(It.IsAny())).ReturnsAsync(new EventAlert() { Id = 5 }); + mockUnitOfWork.Setup(mock => mock.CompleteAsync()).Returns(Task.CompletedTask); + + EventAlertService eventAlertService = new EventAlertService(mockEventAlertRepository.Object, mockUnitOfWork.Object, mockRepoRepository.Object); + + var res = await eventAlertService.Get(5); + Assert.NotNull(res); + Assert.Equal(5, res.Id); + } + + [Fact] + public async void Get_Exception() + { + var mockEventAlertRepository = new Mock(); + var mockUnitOfWork = new Mock(); + var mockRepoRepository = new Mock(); + mockEventAlertRepository.Setup(repo => repo.FindByIdAsync(It.IsAny())).ThrowsAsync(new Exception("Oops")); + mockUnitOfWork.Setup(mock => mock.CompleteAsync()).Returns(Task.CompletedTask); + + EventAlertService eventAlertService = new EventAlertService(mockEventAlertRepository.Object, mockUnitOfWork.Object, mockRepoRepository.Object); + + await Assert.ThrowsAsync(async () => await eventAlertService.Get(5)); + } + + [Fact] + public async void Get_Null_Exception() + { + var mockEventAlertRepository = new Mock(); + var mockUnitOfWork = new Mock(); + var mockRepoRepository = new Mock(); + mockEventAlertRepository.Setup(repo => repo.FindByIdAsync(It.IsAny())).Returns(Task.FromResult(null)); + mockUnitOfWork.Setup(mock => mock.CompleteAsync()).Returns(Task.CompletedTask); + + EventAlertService eventAlertService = new EventAlertService(mockEventAlertRepository.Object, mockUnitOfWork.Object, mockRepoRepository.Object); + + await Assert.ThrowsAsync(async () => await eventAlertService.Get(5)); + } + + [Fact] + public async void Update_Null() + { + var mockEventAlertRepository = new Mock(); + var mockUnitOfWork = new Mock(); + var mockRepoRepository = new Mock(); + + mockEventAlertRepository.Setup(repo => repo.FindByIdAsync(It.IsAny())).Returns(Task.FromResult(null)); + + var eventAlertService = new EventAlertService(mockEventAlertRepository.Object, mockUnitOfWork.Object, mockRepoRepository.Object); + + var dummyAlert = new EventAlert + { + Message = "Message", + DateMarkedRead = DateTime.Now, + CreatedBy = "Some Guy" + }; + + var dummyUser = new AppUser + { + FirstName = "John", + LastName = "Doe" + }; + + await Assert.ThrowsAsync(async () => await eventAlertService.UpdateAsync(dummyAlert, dummyUser)); + } + + [Fact] + public async void Update_Exception() + { + var mockEventAlertRepository = new Mock(); + var mockUnitOfWork = new Mock(); + var mockRepoRepository = new Mock(); + + mockEventAlertRepository.Setup(repo => repo.FindByIdAsync(It.IsAny())).ReturnsAsync(new EventAlert()); + + var eventAlertService = new EventAlertService(mockEventAlertRepository.Object, mockUnitOfWork.Object, mockRepoRepository.Object); + + var dummyAlert = new EventAlert + { + Message = "Message", + DateMarkedRead = DateTime.Now, + CreatedBy = "Some Guy" + }; + + var dummyUser = new AppUser + { + FirstName = "John", + LastName = "Doe" + }; + + mockEventAlertRepository.Setup(repo => repo.Update(It.IsAny())).Throws(new Exception("oops")); + + await Assert.ThrowsAsync(async () => await eventAlertService.UpdateAsync(dummyAlert, dummyUser)); + } + + [Fact] + public async void Update_Ok() + { + var mockEventAlertRepository = new Mock(); + var mockUnitOfWork = new Mock(); + var mockRepoRepository = new Mock(); + + mockEventAlertRepository.Setup(repo => repo.FindByIdAsync(It.IsAny())).ReturnsAsync(new EventAlert()); + + var eventAlertService = new EventAlertService(mockEventAlertRepository.Object, mockUnitOfWork.Object, mockRepoRepository.Object); + + var dummyAlert = new EventAlert + { + Message = "Message", + DateMarkedRead = DateTime.Now, + CreatedBy = "Some Guy" + }; + + var dummyUser = new AppUser + { + FirstName = "John", + LastName = "Doe" + }; + + var result = await eventAlertService.UpdateAsync(dummyAlert, dummyUser); + + Assert.NotNull(result); + Assert.Equal(dummyAlert.DateMarkedRead, result.DateMarkedRead); + Assert.Equal("Message", result.Message); + Assert.Equal("John Doe", result.MarkedReadBy); + Assert.Null(result.CreatedBy); + } + + [Fact] + public async void Update_Existing_Exception() + { + var mockEventAlertRepository = new Mock(); + var mockUnitOfWork = new Mock(); + var mockRepoRepository = new Mock(); + + mockEventAlertRepository.Setup(repo => repo.FindByIdAsync(It.IsAny())).Throws(new Exception("oops")); + + var eventAlertService = new EventAlertService(mockEventAlertRepository.Object, mockUnitOfWork.Object, mockRepoRepository.Object); + + var dummyAlert = new EventAlert + { + Message = "Message", + DateMarkedRead = DateTime.Now, + CreatedBy = "Some Guy" + }; + + var dummyUser = new AppUser + { + FirstName = "John", + LastName = "Doe" + }; + + await Assert.ThrowsAsync(async () => await eventAlertService.UpdateAsync(dummyAlert, dummyUser)); + } + + + [Fact] + public async void Duplicate_Add_Exception() + { + RepoAccount account = new RepoAccount() + { + RepoId = 100, + Status = "RTC Letter Not Found" + }; + EventAlert eventAlert = new EventAlert() + { + Id = 5, + RepoId = 100 + }; + // arrange + var mockEventAlertRepository = new Mock(); + var mockUnitOfWork = new Mock(); + var mockRepoRepository = new Mock(); + + mockEventAlertRepository.Setup(repo => repo.AddAsync(It.Is(param => param.Id == 5))).ThrowsAsync(new DuplicateResourceException("EventAlert")); + mockRepoRepository.Setup(repo => repo.FindByIdAsync(It.Is(param => param == 100))).Returns(Task.FromResult(account)); + var eventAlertService = new EventAlertService(mockEventAlertRepository.Object, mockUnitOfWork.Object, mockRepoRepository.Object); + + // act / assert + try + { + var result = await eventAlertService.SaveAsync(eventAlert); + Assert.True(false, "An exception should have been thrown."); + } + catch (DuplicateResourceException ex) + { + Assert.Equal("Duplicate Resources of type EventAlert were found.", ex.Message); + } + catch (Exception) + { + Assert.True(false, "An exception other than DuplicateResourceException was thrown."); + } + } + + [Fact] + public async void DeleteAsync_Ok() + { + var dummyAlert = new EventAlert + { + Message = "Message", + DateMarkedRead = DateTime.Now, + CreatedBy = "Some Guy" + }; + + + var mockEventAlertRepository = new Mock(); + var mockUnitOfWork = new Mock(); + var mockRepoRepository = new Mock(); + + mockEventAlertRepository.Setup(repo => repo.FindByIdAsync(It.IsAny())).ReturnsAsync(dummyAlert); + mockUnitOfWork.Setup(mock => mock.CompleteAsync()).Returns(Task.CompletedTask); + mockEventAlertRepository.Setup(repo => repo.Remove(It.Is(param => param.Message == "message"))); + + EventAlertService eventAlertService = new EventAlertService(mockEventAlertRepository.Object, mockUnitOfWork.Object, mockRepoRepository.Object); + + var res = await eventAlertService.DeleteAsync(5); + } + + [Fact] + public async void DeleteAsync_Null() + { + var dummyAlert = new EventAlert + { + Message = "Message", + DateMarkedRead = DateTime.Now, + CreatedBy = "Some Guy" + }; + + + var mockEventAlertRepository = new Mock(); + var mockUnitOfWork = new Mock(); + var mockRepoRepository = new Mock(); + + mockEventAlertRepository.Setup(repo => repo.FindByIdAsync(It.IsAny())).Returns(Task.FromResult(null)); + mockUnitOfWork.Setup(mock => mock.CompleteAsync()).Returns(Task.CompletedTask); + mockEventAlertRepository.Setup(repo => repo.Remove(It.Is(param => param.Message == "message"))); + + EventAlertService eventAlertService = new EventAlertService(mockEventAlertRepository.Object, mockUnitOfWork.Object, mockRepoRepository.Object); + + await Assert.ThrowsAsync(async () => await eventAlertService.DeleteAsync(5)); + } + + [Fact] + public async void DeleteAsync_Remove_Exception() + { + var dummyAlert = new EventAlert + { + Message = "Message", + DateMarkedRead = DateTime.Now, + CreatedBy = "Some Guy" + }; + + var mockEventAlertRepository = new Mock(); + var mockUnitOfWork = new Mock(); + var mockRepoRepository = new Mock(); + + mockEventAlertRepository.Setup(repo => repo.FindByIdAsync(It.IsAny())).ReturnsAsync(dummyAlert); + mockUnitOfWork.Setup(mock => mock.CompleteAsync()).Returns(Task.CompletedTask); + mockEventAlertRepository.Setup(repo => repo.Remove(It.Is(param => param.Message == "Message"))).Throws(new Exception("oops")); + + EventAlertService eventAlertService = new EventAlertService(mockEventAlertRepository.Object, mockUnitOfWork.Object, mockRepoRepository.Object); + + await Assert.ThrowsAsync(async () => await eventAlertService.DeleteAsync(5)); + } + + [Fact] + public async void DeleteAsync_Existing_Exception() + { + var dummyAlert = new EventAlert + { + Message = "Message", + DateMarkedRead = DateTime.Now, + CreatedBy = "Some Guy" + }; + + + var mockEventAlertRepository = new Mock(); + var mockUnitOfWork = new Mock(); + var mockRepoRepository = new Mock(); + + mockEventAlertRepository.Setup(repo => repo.FindByIdAsync(It.IsAny())).Throws(new Exception("oops")); + mockUnitOfWork.Setup(mock => mock.CompleteAsync()).Returns(Task.CompletedTask); + mockEventAlertRepository.Setup(repo => repo.Remove(It.Is(param => param.Message == "message"))); + + EventAlertService eventAlertService = new EventAlertService(mockEventAlertRepository.Object, mockUnitOfWork.Object, mockRepoRepository.Object); + + await Assert.ThrowsAsync(async () => await eventAlertService.DeleteAsync(5)); + } + + [Fact] + public async void MarkAllAsRead_OK() + { + var alertList = new List { + new EventAlert + { + Id = 1, + Message = "Message", + CreatedBy = "Some Guy", + AccountNo = "123-04566" + }, + new EventAlert + { + Id = 2, + Message = "Message", + CreatedBy = "Some Guy", + AccountNo = "123-04566" + }, + new EventAlert + { + Id = 3, + Message = "Message", + CreatedBy = "Some Guy", + AccountNo = "123-04566" + } + }; + + var mockEventAlertRepository = new Mock(); + var mockUnitOfWork = new Mock(); + var mockRepoRepository = new Mock(); + + mockEventAlertRepository.Setup(repo => repo.ListUnreadByAccountNoAsync(It.IsAny())).ReturnsAsync(alertList); + + + EventAlertService eventAlertService = new EventAlertService(mockEventAlertRepository.Object, mockUnitOfWork.Object, mockRepoRepository.Object); + + var result = await eventAlertService.MarkAllAsRead("123-04566"); + + mockUnitOfWork.Verify(m => m.CompleteAsync(), Times.Once()); + mockEventAlertRepository.Verify(m => m.Update(It.IsAny()), Times.Exactly(3)); + + Assert.NotNull(result); + Assert.Equal(3, result.Count()); + Assert.Equal(alertList, result); + } + + [Fact] + public async void MarkAllAsRead_NotFoundException() + { + var mockEventAlertRepository = new Mock(); + var mockUnitOfWork = new Mock(); + var mockRepoRepository = new Mock(); + + mockEventAlertRepository.Setup(repo => repo.ListUnreadByAccountNoAsync(It.IsAny())).Returns(Task.FromResult>(null)); + + + EventAlertService eventAlertService = new EventAlertService(mockEventAlertRepository.Object, mockUnitOfWork.Object, mockRepoRepository.Object); + + await Assert.ThrowsAsync(async () => await eventAlertService.MarkAllAsRead("123-04566")); + + mockUnitOfWork.Verify(m => m.CompleteAsync(), Times.Never()); + mockEventAlertRepository.Verify(m => m.Update(It.IsAny()), Times.Never); + } + + [Fact] + public async void MarkAllAsRead_Existing_Exception() + { + var mockEventAlertRepository = new Mock(); + var mockUnitOfWork = new Mock(); + var mockRepoRepository = new Mock(); + + mockEventAlertRepository.Setup(repo => repo.ListUnreadByAccountNoAsync(It.IsAny())).ThrowsAsync(new Exception("oops")); + + + EventAlertService eventAlertService = new EventAlertService(mockEventAlertRepository.Object, mockUnitOfWork.Object, mockRepoRepository.Object); + + await Assert.ThrowsAsync(async () => await eventAlertService.MarkAllAsRead("123-04566")); + + mockUnitOfWork.Verify(m => m.CompleteAsync(), Times.Never()); + mockEventAlertRepository.Verify(m => m.Update(It.IsAny()), Times.Never); + } + + [Fact] + public async void MarkAllAsRead_Update_Exception() + { + var alertList = new List { + new EventAlert + { + Id = 1, + Message = "Message", + CreatedBy = "Some Guy", + AccountNo = "123-04566" + }, + new EventAlert + { + Id = 2, + Message = "Message", + CreatedBy = "Some Guy", + AccountNo = "123-04566" + }, + new EventAlert + { + Id = 3, + Message = "Message", + CreatedBy = "Some Guy", + AccountNo = "123-04566" + } + }; + + var mockEventAlertRepository = new Mock(); + var mockUnitOfWork = new Mock(); + var mockRepoRepository = new Mock(); + + mockEventAlertRepository.Setup(repo => repo.ListUnreadByAccountNoAsync(It.IsAny())).ReturnsAsync(alertList); + mockEventAlertRepository.Setup(m => m.Update(It.IsAny())).Throws(new Exception("oops")); + + + EventAlertService eventAlertService = new EventAlertService(mockEventAlertRepository.Object, mockUnitOfWork.Object, mockRepoRepository.Object); + + await Assert.ThrowsAsync(async () => await eventAlertService.MarkAllAsRead("123-04566")); + + mockUnitOfWork.Verify(m => m.CompleteAsync(), Times.Never()); + mockEventAlertRepository.Verify(m => m.Update(It.IsAny()), Times.Once); + } + + [Fact] + public async void MarkAllAsRead_Update_Exception_On_2nd() + { + var count = 0; + var alertList = new List { + new EventAlert + { + Id = 1, + Message = "Message", + CreatedBy = "Some Guy", + AccountNo = "123-04566" + }, + new EventAlert + { + Id = 2, + Message = "Message", + CreatedBy = "Some Guy", + AccountNo = "123-04566" + }, + new EventAlert + { + Id = 3, + Message = "Message", + CreatedBy = "Some Guy", + AccountNo = "123-04566" + } + }; + + var mockEventAlertRepository = new Mock(); + var mockUnitOfWork = new Mock(); + var mockRepoRepository = new Mock(); + + mockEventAlertRepository.Setup(repo => repo.ListUnreadByAccountNoAsync(It.IsAny())).ReturnsAsync(alertList); + mockEventAlertRepository.Setup(m => m.Update(It.IsAny())).Callback(() => + { + count++; + if (count == 2) + { + throw new Exception("oops"); + } + }); + + + EventAlertService eventAlertService = new EventAlertService(mockEventAlertRepository.Object, mockUnitOfWork.Object, mockRepoRepository.Object); + + await Assert.ThrowsAsync(async () => await eventAlertService.MarkAllAsRead("123-04566")); + + mockUnitOfWork.Verify(m => m.CompleteAsync(), Times.Never()); + mockEventAlertRepository.Verify(m => m.Update(It.IsAny()), Times.Exactly(2)); + } + + + + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/FactoidServiceTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/FactoidServiceTest.cs new file mode 100644 index 0000000..5813bcf --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/FactoidServiceTest.cs @@ -0,0 +1,363 @@ +using System; +using System.Collections.Generic; +using LCU.API.Collections.RepoApi.Services; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using Microsoft.Extensions.Logging; +using Moq; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.Services +{ + public class FactoidServiceTest + { + private IFactoidService _factoidService; + private Mock _mockReportingRepository; + private Mock _mockRepoAccountRepository; + private Mock _mockImsAutoFileDataRepository; + + public FactoidServiceTest() + { + _mockReportingRepository = new Mock(); + _mockRepoAccountRepository = new Mock(); + _mockImsAutoFileDataRepository = new Mock(); + _factoidService = new FactoidService(_mockReportingRepository.Object, _mockRepoAccountRepository.Object, + _mockImsAutoFileDataRepository.Object); + } + + [Fact] + public void Find_Auction_Index() + { + // arrange + var auctionHouses = new List() + { + "Gross Active Balance", "a1", "a2", "No Auction" + }; + + // act + var result = _factoidService.FindAuctionIndex(auctionHouses, "A1"); + var result2 = _factoidService.FindAuctionIndex(auctionHouses, null); + var result3 = _factoidService.FindAuctionIndex(auctionHouses, "A3"); + + // assert + Assert.Equal(1, result); + Assert.Equal(3, result2); + Assert.Equal(3, result3); + } + + [Fact] + public async void Get_All_Accounts_O4R_Ok() + { + // arrange + _mockReportingRepository.Setup(x => x.GetAllAccountsInO4R()).ReturnsAsync(new List() + { + new RepoAccount(), + new RepoAccount() + }); + + // act + var result = await _factoidService.GetAllAccountsO4R(); + + // assert + Assert.NotNull(result); + Assert.Equal("Accounts", result.Name); + Assert.Equal("Total Accounts in O4R", result.Description); + Assert.Equal("fa-car", result.FontAwesomeIcon); + Assert.Equal("2", result.CumulativeValue); + Assert.Equal(2, result.Records.Count); + } + + [Fact] + public async void Get_Percent_Floor_Price_Ok() + { + // arrange + var fakeAutoIms = new List() + { + new ImsAutoFileData() {GrossPercentFloor = 50, RepoId = 111}, + new ImsAutoFileData() {GrossPercentFloor = 100, RepoId = 111} + }; + var fakeAccounts = new List() + { + new RepoAccount(), + new RepoAccount() + }; + var highDate = DateTime.Parse("12/31/2019"); + var lowDate = DateTime.Parse("11/01/2019"); + _mockImsAutoFileDataRepository + .Setup(x => x.GetImsSoldRecordsForPeriod(It.IsAny(), It.IsAny())) + .ReturnsAsync(fakeAutoIms); + + _mockRepoAccountRepository.Setup( + x => x.FindByRepoIdAsync(It.IsAny>())) + .ReturnsAsync(fakeAccounts); + + // act + var result = await _factoidService.GetPercentFloorPrice(lowDate, highDate); + + // assert + Assert.NotNull(result); + Assert.Equal("Percentage of Floor", result.Name); + Assert.Equal("Last 30 Days", result.Description); + Assert.Equal("fa-money", result.FontAwesomeIcon); + Assert.Equal("75%", result.CumulativeValue); + Assert.Equal(2, result.Records.Count); + } + + [Fact] + public async void Get_Recently_Redeemed_Ok() + { + // arrange + var fakeAccounts = new List() + { + new RepoAccount(), + new RepoAccount() + }; + var highDate = DateTime.Parse("12/31/2019"); + var lowDate = DateTime.Parse("11/01/2019"); + + _mockRepoAccountRepository.Setup( + x => x.FindByStatusChangeInPeriod(It.IsAny(), It.IsAny(), It.IsAny(), + It.IsAny())) + .ReturnsAsync(fakeAccounts); + + // act + var result = await _factoidService.GetRecentlyRedeemed(lowDate, highDate); + + // assert + Assert.NotNull(result); + Assert.Equal("Recently Redeemed", result.Name); + Assert.Equal("Last 30 Days", result.Description); + Assert.Equal("fa-calendar", result.FontAwesomeIcon); + Assert.Equal("2", result.CumulativeValue); + Assert.Equal(2, result.Records.Count); + } + + [Fact] + public async void GetAvgDaysO4RToREPO_Ok() + { + // Arrange + var fakeAccounts = new List() + { + new RepoAccount() + { + RepoStatusChanges = new List() + { + new RepoStatusChange() + { + StatusFrom = "REHO", + StatusTo = "O4R", + ChangedDate = DateTime.Parse("10/01/2019") + }, + new RepoStatusChange() + { + StatusFrom = "O4R", + StatusTo = "REPO", + ChangedDate = DateTime.Parse("10/21/2019") + } + } + }, + new RepoAccount() + { + RepoStatusChanges = new List() + { + new RepoStatusChange() + { + StatusFrom = "REDEEMED", + StatusTo = "O4R", + ChangedDate = DateTime.Parse("10/15/2019") + }, + new RepoStatusChange() + { + StatusFrom = "O4R", + StatusTo = "REDEEMED", + ChangedDate = DateTime.Parse("10/20/2019") + }, + new RepoStatusChange() + { + StatusFrom = "REDEEMED", + StatusTo = "O4R", + ChangedDate = DateTime.Parse("10/21/2019") + }, + new RepoStatusChange() + { + StatusFrom = "REDEEMED", + StatusTo = "REPO", + ChangedDate = DateTime.Parse("10/31/2019") + } + } + } + }; + var highDate = DateTime.Parse("12/31/2019"); + var lowDate = DateTime.Parse("11/01/2019"); + + _mockRepoAccountRepository.Setup( + x => x.FindByStatusChangeInPeriod(It.IsAny(), It.IsAny(), It.IsAny(), + It.IsAny())) + .ReturnsAsync(fakeAccounts); + + // act + var result = await _factoidService.GetAvgDaysO4RToREPO(lowDate, highDate); + + // assert + Assert.NotNull(result); + Assert.Equal("Avg. Days O4R to Repo", result.Name); + Assert.Equal("Last 30 Days", result.Description); + Assert.Equal("fa-calendar", result.FontAwesomeIcon); + Assert.Equal("15", result.CumulativeValue); + Assert.Equal(2, result.Records.Count); + } + + [Fact] + public async void GetAvgDaysO4RToREPO_Does_Not_Divide_By_Zero_No_Accounts() + { + // Arrange + var fakeAccounts = new List(); + var highDate = DateTime.Parse("12/31/2019"); + var lowDate = DateTime.Parse("11/01/2019"); + + _mockRepoAccountRepository.Setup( + x => x.FindByStatusChangeInPeriod(It.IsAny(), It.IsAny(), It.IsAny(), + It.IsAny())) + .ReturnsAsync(fakeAccounts); + + // act + var result = await _factoidService.GetAvgDaysO4RToREPO(lowDate, highDate); + + // assert + Assert.NotNull(result); + Assert.Equal("Avg. Days O4R to Repo", result.Name); + Assert.Equal("Last 30 Days", result.Description); + Assert.Equal("fa-calendar", result.FontAwesomeIcon); + Assert.Equal("N/A", result.CumulativeValue); + Assert.Equal(0, result.Records.Count); + } + + [Fact] + public async void GetCurrentInventory_Success() + { + // Arrange + _mockRepoAccountRepository.Setup(repo => repo.FindByCurrentStatus(It.IsAny())).ReturnsAsync( + new List() + { + new RepoAccount() + { + Collaterals = new List() + { + new Collateral(), + new Collateral() + } + }, + new RepoAccount() + { + Collaterals = new List() + { + new Collateral() + } + } + }); + + // Act + var result = await _factoidService.GetCurrentInventory(); + + // Assert + Assert.NotNull(result); + Assert.Equal("3", result.CumulativeValue); + Assert.Equal(2, result.Records.Count); + } + + [Fact] + public async void GetAvgDaysDelqToO4R_Success() + { + // Arrange + var fakeAccounts = new List() + { + new RepoAccount() + { + DaysDelinquent = 125 + }, + new RepoAccount() + { + DaysDelinquent = 25 + }, + new RepoAccount() + }; + + _mockRepoAccountRepository.Setup( + x => x.FindByStatusChangeInPeriod(It.IsAny(), It.IsAny(), It.IsAny(), + It.IsAny())) + .ReturnsAsync(fakeAccounts); + + // act + var result = await _factoidService.GetGetAvgDaysDelqToO4R(It.IsAny(), It.IsAny()); + + // assert + Assert.NotNull(result); + Assert.Equal("Avg. Days Dlqt To O4R", result.Name); + Assert.Equal("Last 30 Days", result.Description); + Assert.Equal("fa-calendar", result.FontAwesomeIcon); + Assert.Equal("75", result.CumulativeValue); + Assert.Equal(2, result.Records.Count); + } + + [Fact] + public async void GetAvgDaysRepoToSold_Success() + { + // Arrange + var fakeAccounts = new List() + { + new RepoAccount() + { + RepoStatusChanges = new List() + { + new RepoStatusChange() + { + StatusFrom = "REPO", + StatusTo = "SOLD", + ChangedDate = DateTime.Parse("10/21/2019") + }, + new RepoStatusChange() + { + StatusFrom = "O4R", + StatusTo = "REPO", + ChangedDate = DateTime.Parse("10/01/2019") + } + } + }, + new RepoAccount() + { + RepoStatusChanges = new List() + { + new RepoStatusChange() + { + StatusFrom = "REPO", + StatusTo = "SOLD", + ChangedDate = DateTime.Parse("10/01/2019") + }, + new RepoStatusChange() + { + StatusFrom = "O4R", + StatusTo = "REPO", + ChangedDate = DateTime.Parse("09/01/2019") + } + } + } + }; + + _mockRepoAccountRepository.Setup( + x => x.FindByStatusChangeInPeriod(It.IsAny(), It.IsAny(), It.IsAny(), + It.IsAny())) + .ReturnsAsync(fakeAccounts); + + // act + var result = await _factoidService.GetGetAvgDaysRepoToSold(It.IsAny(), It.IsAny()); + + // assert + Assert.NotNull(result); + Assert.Equal("Avg. Days Repo to Sold", result.Name); + Assert.Equal("Last 30 Days", result.Description); + Assert.Equal("fa-calendar", result.FontAwesomeIcon); + Assert.Equal("25", result.CumulativeValue); + Assert.Equal(2, result.Records.Count); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/FloorPricingServiceTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/FloorPricingServiceTest.cs new file mode 100644 index 0000000..ee402fb --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/FloorPricingServiceTest.cs @@ -0,0 +1,114 @@ +using System.Collections.Generic; +using System.Linq; +using LCU.API.Collections.RepoApi.Domain.FloorPricing; +using LCU.API.Collections.RepoApi.Domain.FloorPricing.Strategies; +using LCU.API.Collections.RepoApi.Services; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.WebServices.NADA; +using Moq; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.Services +{ + public class FloorPricingServiceTest + { + private readonly Mock mockFloorPriceService; + private readonly Mock mockCollateralValueService; + private readonly Mock mockImsAutoFileDataService; + private readonly Mock mockStrategyFactory; + + private readonly FloorPricingService service; + + public FloorPricingServiceTest() + { + mockFloorPriceService = new Mock(); + mockCollateralValueService = new Mock(); + mockImsAutoFileDataService = new Mock(); + mockStrategyFactory = new Mock(); + service = new FloorPricingService( + mockStrategyFactory.Object, + mockFloorPriceService.Object, + mockImsAutoFileDataService.Object, + mockCollateralValueService.Object); + } + + [Fact] + public void Full_Calculate_Floor_Price_OK() + { + // arrange + var strategies = new List() + { + new AutoImsSuggestedValue(), + new NadaMmrConditionValue() + }; + FloorPriceCalculationParams fpcParams = new FloorPriceCalculationParams(); + mockStrategyFactory.Setup(x => x.GetFloorPricingStrategies()).Returns(strategies); + + // act + var results = service.GetCalculatedFloorPrices(fpcParams); + + // Assert + Assert.NotNull(results); + Assert.True(results.Any()); + } + + [Fact] + public void Select_Floor_Price_OK() + { + // arrange + List results = new List() + { + new FloorPriceCalculationResult() + { + Success = true, + FloorPrice = 1000, + StrategyName = "a", + ResultWeight = 100 + }, + new FloorPriceCalculationResult() + { + Success = false, + FloorPrice = 0, + StrategyName = "b", + ResultWeight = 1001 + }, + new FloorPriceCalculationResult() + { + Success = true, + FloorPrice = 0, + StrategyName = "c", + ResultWeight = -1 + }, + new FloorPriceCalculationResult() + { + Success = true, + FloorPrice = 1200, + StrategyName = "d", + ResultWeight = 101 + } + }; + var strategies = new List() + { + new AutoImsSuggestedValue(), + new NadaMmrConditionValue() + }; + + mockStrategyFactory.Setup(x => x.GetFloorPricingStrategies()).Returns(strategies); + + // act + var result = service.SelectBestFloorPrice(results); + + // Assert + Assert.NotNull(result); + Assert.Equal(1200, result.FloorPrice); + } + + [Fact] + public void Failed_NADA_Soap_Request_CollateralValuation_Not_Null() + { + mockCollateralValueService.Setup(x => x.GetCollateralValue("", 0, 0)).Throws(); + var results = service.GetCollateralValuation("",0,0); + Assert.NotNull(results); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/ImsAutoFileDataServiceTests.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/ImsAutoFileDataServiceTests.cs new file mode 100644 index 0000000..0dabb0b --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/ImsAutoFileDataServiceTests.cs @@ -0,0 +1,345 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Xunit; +using Moq; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using Xunit.Sdk; +using LCU.API.Collections.RepoApi.Services; +using LCU.Shared.Collections.RepoApiLib.Models; +using System.Linq; +using LCU.API.Collections.RepoApi.Exceptions; +using System.Threading.Tasks; +using Castle.Core.Resource; +using System.Runtime.CompilerServices; +using System.IO; + +namespace LCU.API.Collections.RepoApiTests.Services +{ + public class ImsAutoFileDataServiceTests + { + [Fact] + public async void ListAll_Ok() + { + var _mockImsAutoFileDataRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockImsAutoFileDataRepo.Setup(repo => repo.ListAllAsync()).ReturnsAsync(new List() { new ImsAutoFileData() { } }); + ImsAutoFileDataService imsAutoFileDataService = new ImsAutoFileDataService(_mockImsAutoFileDataRepo.Object, _mockUnitOfWork.Object); + + var res = await imsAutoFileDataService.ListAll(); + Assert.NotNull(res); + Assert.Single(res); + } + + [Fact] + public async void ListAll_Exception() + { + var _mockImsAutoFileDataRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockImsAutoFileDataRepo.Setup(repo => repo.ListAllAsync()).ThrowsAsync(new Exception("oops")); + ImsAutoFileDataService imsAutoFileDataService = new ImsAutoFileDataService(_mockImsAutoFileDataRepo.Object, _mockUnitOfWork.Object); + + await Assert.ThrowsAsync(async () => await imsAutoFileDataService.ListAll()); + + } + + [Fact] + public async void SaveAsync_Ok() + { + ImsAutoFileData filedata = new ImsAutoFileData() + { + RepoId = 5 + }; + + var _mockImsAutoFileDataRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockImsAutoFileDataRepo.Setup(repo => repo.AddAsync(It.IsAny())).Returns(Task.CompletedTask); + _mockUnitOfWork.Setup(mock => mock.CompleteAsync()).Returns(Task.CompletedTask); + ImsAutoFileDataService imsAutoFileDataService = new ImsAutoFileDataService(_mockImsAutoFileDataRepo.Object, _mockUnitOfWork.Object); + + var res = await imsAutoFileDataService.SaveAsync(filedata); + Assert.NotNull(res); + Assert.Equal(5,res.RepoId); + } + + [Fact] + public async void SaveAsync_Exception() + { + ImsAutoFileData filedata = new ImsAutoFileData() + { + RepoId = 5 + }; + + var _mockImsAutoFileDataRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockImsAutoFileDataRepo.Setup(repo => repo.AddAsync(It.IsAny())).ThrowsAsync(new Exception("oops")); + _mockUnitOfWork.Setup(mock => mock.CompleteAsync()).Returns(Task.CompletedTask); + ImsAutoFileDataService imsAutoFileDataService = new ImsAutoFileDataService(_mockImsAutoFileDataRepo.Object, _mockUnitOfWork.Object); + + await Assert.ThrowsAsync(async () => await imsAutoFileDataService.SaveAsync(filedata)); + } + + [Fact] + public async void Get_Exception() + { + + var _mockImsAutoFileDataRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockImsAutoFileDataRepo.Setup(repo => repo.FindByIdAsync(It.IsAny(), It.IsAny())).ThrowsAsync(new Exception("oops")); + + ImsAutoFileDataService imsAutoFileDataService = new ImsAutoFileDataService(_mockImsAutoFileDataRepo.Object, _mockUnitOfWork.Object); + + await Assert.ThrowsAsync(async () => await imsAutoFileDataService.Get("VinNumber", 12345)); + } + + [Fact] + public async void Get_Null_Exception() + { + var _mockImsAutoFileDataRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockImsAutoFileDataRepo.Setup(repo => repo.FindByIdAsync(It.IsAny(), It.IsAny())).Returns(Task.FromResult(null)); + + ImsAutoFileDataService imsAutoFileDataService = new ImsAutoFileDataService(_mockImsAutoFileDataRepo.Object, _mockUnitOfWork.Object); + + await Assert.ThrowsAsync(async () => await imsAutoFileDataService.Get("VinNumber", 12345)); + } + + [Fact] + public async void Get_Ok() + { + ImsAutoFileData filedata = new ImsAutoFileData() + { + RepoId = 5, + VIN = "VinNumber" + }; + var _mockImsAutoFileDataRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockImsAutoFileDataRepo.Setup(repo => repo.FindByIdAsync(It.IsAny(), It.IsAny())).ReturnsAsync(filedata); + + ImsAutoFileDataService imsAutoFileDataService = new ImsAutoFileDataService(_mockImsAutoFileDataRepo.Object, _mockUnitOfWork.Object); + + var res = await imsAutoFileDataService.Get("VinNumber", 12345); + Assert.NotNull(res); + Assert.Equal(filedata, res); + } + + [Fact] + public async void GetByAuctionAssignmentId_Exception() + { + + var _mockImsAutoFileDataRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockImsAutoFileDataRepo.Setup(repo => repo.FindByAuctionAssignmentIdAsync(It.IsAny())).ThrowsAsync(new Exception("oops")); + + ImsAutoFileDataService imsAutoFileDataService = new ImsAutoFileDataService(_mockImsAutoFileDataRepo.Object, _mockUnitOfWork.Object); + + await Assert.ThrowsAsync(async () => await imsAutoFileDataService.GetByAuctionAssignmentId(12345)); + } + + [Fact] + public async void GetByAuctionAssignmentId_Null_Exception() + { + var _mockImsAutoFileDataRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockImsAutoFileDataRepo.Setup(repo => repo.FindByAuctionAssignmentIdAsync(It.IsAny())).Returns(Task.FromResult(null)); + + ImsAutoFileDataService imsAutoFileDataService = new ImsAutoFileDataService(_mockImsAutoFileDataRepo.Object, _mockUnitOfWork.Object); + + await Assert.ThrowsAsync(async () => await imsAutoFileDataService.GetByAuctionAssignmentId(12345)); + } + + [Fact] + public async void GetByAuctionAssignmentId_Ok() + { + ImsAutoFileData filedata = new ImsAutoFileData() + { + RepoId = 12345, + VIN = "VinNumber" + }; + var _mockImsAutoFileDataRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockImsAutoFileDataRepo.Setup(repo => repo.FindByAuctionAssignmentIdAsync(It.IsAny())).ReturnsAsync(filedata); + + ImsAutoFileDataService imsAutoFileDataService = new ImsAutoFileDataService(_mockImsAutoFileDataRepo.Object, _mockUnitOfWork.Object); + + var res = await imsAutoFileDataService.GetByAuctionAssignmentId(12345); + Assert.NotNull(res); + Assert.Equal(filedata, res); + } + + [Fact] + public async void UpdateAsync_Ok() + { + ImsAutoFileData filedata = new ImsAutoFileData() + { + RepoId = 12345, + VIN = "VinNumber" + }; + var _mockImsAutoFileDataRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockImsAutoFileDataRepo.Setup(repo => repo.FindByIdAsync(It.IsAny(), It.IsAny())).ReturnsAsync(filedata); + _mockUnitOfWork.Setup(mock => mock.CompleteAsync()).Returns(Task.CompletedTask); + _mockImsAutoFileDataRepo.Setup(repo => repo.Update(It.IsAny())); + + ImsAutoFileDataService imsAutoFileDataService = new ImsAutoFileDataService(_mockImsAutoFileDataRepo.Object, _mockUnitOfWork.Object); + + var res = await imsAutoFileDataService.UpdateAsync(filedata); + Assert.NotNull(res); + Assert.Equal(filedata, res); + } + + [Fact] + public async void UpdateAsync_Null_Exception() + { + ImsAutoFileData filedata = new ImsAutoFileData() + { + RepoId = 12345, + VIN = "VinNumber" + }; + var _mockImsAutoFileDataRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockImsAutoFileDataRepo.Setup(repo => repo.FindByIdAsync(It.IsAny(), It.IsAny())).Returns(Task.FromResult(null)); + _mockUnitOfWork.Setup(mock => mock.CompleteAsync()).Returns(Task.CompletedTask); + _mockImsAutoFileDataRepo.Setup(repo => repo.Update(It.IsAny())); + + ImsAutoFileDataService imsAutoFileDataService = new ImsAutoFileDataService(_mockImsAutoFileDataRepo.Object, _mockUnitOfWork.Object); + + await Assert.ThrowsAsync(async () => await imsAutoFileDataService.UpdateAsync(filedata)); + } + + [Fact] + public async void UpdateAsync_Existing_Exception() + { + ImsAutoFileData filedata = new ImsAutoFileData() + { + RepoId = 12345, + VIN = "VinNumber" + }; + var _mockImsAutoFileDataRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockImsAutoFileDataRepo.Setup(repo => repo.FindByIdAsync(It.IsAny(), It.IsAny())).ThrowsAsync(new Exception("oops")); + _mockUnitOfWork.Setup(mock => mock.CompleteAsync()).Returns(Task.CompletedTask); + _mockImsAutoFileDataRepo.Setup(repo => repo.Update(It.IsAny())); + + ImsAutoFileDataService imsAutoFileDataService = new ImsAutoFileDataService(_mockImsAutoFileDataRepo.Object, _mockUnitOfWork.Object); + + await Assert.ThrowsAsync(async () => await imsAutoFileDataService.UpdateAsync(filedata)); + } + + [Fact] + public async void UpdateAsync_Update_Exception() + { + ImsAutoFileData filedata = new ImsAutoFileData() + { + RepoId = 12345, + VIN = "VinNumber" + }; + var _mockImsAutoFileDataRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockImsAutoFileDataRepo.Setup(repo => repo.FindByIdAsync(It.IsAny(), It.IsAny())).ReturnsAsync(filedata); + _mockUnitOfWork.Setup(mock => mock.CompleteAsync()).Returns(Task.CompletedTask); + _mockImsAutoFileDataRepo.Setup(repo => repo.Update(It.IsAny())).Throws(new Exception("oops")); + + ImsAutoFileDataService imsAutoFileDataService = new ImsAutoFileDataService(_mockImsAutoFileDataRepo.Object, _mockUnitOfWork.Object); + + await Assert.ThrowsAsync(async () => await imsAutoFileDataService.UpdateAsync(filedata)); + } + + [Fact] + public async void DeleteAsync_Ok() + { + ImsAutoFileData filedata = new ImsAutoFileData() + { + RepoId = 12345, + VIN = "VinNumber" + }; + var _mockImsAutoFileDataRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockImsAutoFileDataRepo.Setup(repo => repo.FindByIdAsync(It.IsAny(), It.IsAny())).ReturnsAsync(filedata); + _mockUnitOfWork.Setup(mock => mock.CompleteAsync()).Returns(Task.CompletedTask); + _mockImsAutoFileDataRepo.Setup(repo => repo.Remove(It.IsAny())); + + ImsAutoFileDataService imsAutoFileDataService = new ImsAutoFileDataService(_mockImsAutoFileDataRepo.Object, _mockUnitOfWork.Object); + + var res = await imsAutoFileDataService.DeleteAsync("vin",5); + Assert.NotNull(res); + Assert.Equal(filedata, res); + } + + [Fact] + public async void DeleteAsync_Null_Exception() + { + ImsAutoFileData filedata = new ImsAutoFileData() + { + RepoId = 12345, + VIN = "VinNumber" + }; + var _mockImsAutoFileDataRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockImsAutoFileDataRepo.Setup(repo => repo.FindByIdAsync(It.IsAny(), It.IsAny())).Returns(Task.FromResult(null)); + _mockUnitOfWork.Setup(mock => mock.CompleteAsync()).Returns(Task.CompletedTask); + _mockImsAutoFileDataRepo.Setup(repo => repo.Remove(It.IsAny())); + + ImsAutoFileDataService imsAutoFileDataService = new ImsAutoFileDataService(_mockImsAutoFileDataRepo.Object, _mockUnitOfWork.Object); + + await Assert.ThrowsAsync(async () => await imsAutoFileDataService.DeleteAsync("vin", 5)); + } + + [Fact] + public async void DeleteAsync_Existing_Exception() + { + ImsAutoFileData filedata = new ImsAutoFileData() + { + RepoId = 12345, + VIN = "VinNumber" + }; + var _mockImsAutoFileDataRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockImsAutoFileDataRepo.Setup(repo => repo.FindByIdAsync(It.IsAny(), It.IsAny())).ThrowsAsync(new Exception("oops")); + _mockUnitOfWork.Setup(mock => mock.CompleteAsync()).Returns(Task.CompletedTask); + _mockImsAutoFileDataRepo.Setup(repo => repo.Remove(It.IsAny())); + + ImsAutoFileDataService imsAutoFileDataService = new ImsAutoFileDataService(_mockImsAutoFileDataRepo.Object, _mockUnitOfWork.Object); + + await Assert.ThrowsAsync(async () => await imsAutoFileDataService.DeleteAsync("vin", 5)); + } + + [Fact] + public async void DeleteAsync_Update_Exception() + { + ImsAutoFileData filedata = new ImsAutoFileData() + { + RepoId = 12345, + VIN = "VinNumber" + }; + var _mockImsAutoFileDataRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockImsAutoFileDataRepo.Setup(repo => repo.FindByIdAsync(It.IsAny(), It.IsAny())).ReturnsAsync(filedata); + _mockUnitOfWork.Setup(mock => mock.CompleteAsync()).Returns(Task.CompletedTask); + _mockImsAutoFileDataRepo.Setup(repo => repo.Remove(It.IsAny())).Throws(new Exception("oops")); + + ImsAutoFileDataService imsAutoFileDataService = new ImsAutoFileDataService(_mockImsAutoFileDataRepo.Object, _mockUnitOfWork.Object); + + await Assert.ThrowsAsync(async () => await imsAutoFileDataService.DeleteAsync("vin", 5)); + } + + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/LandmarkReportingServiceTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/LandmarkReportingServiceTest.cs new file mode 100644 index 0000000..f5894ff --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/LandmarkReportingServiceTest.cs @@ -0,0 +1,430 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using LCU.API.Collections.RepoApi.Services.Reporting; +using LCU.Shared.Collections.RepoApiLib.Models.Reporting; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using Moq; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.Services +{ + public class LandmarkReportingServiceTest + { + private LandmarkReportingService _landmarkReportingService; + private Mock _mockRepository; + + public LandmarkReportingServiceTest() + { + _mockRepository = new Mock(); + _landmarkReportingService = new LandmarkReportingService(_mockRepository.Object); + } + + [Fact] + public async void GetAvgDaysRepoToSold_Ok() + { + // Arrange + var reportData = new List() + { + new StdReportEntry() + { + RepoId = 1, + DateRepoed = DateTime.Parse("11/01/2019"), + FilteredStatusChangeDate = DateTime.Parse("12/01/2019") + }, + new StdReportEntry() + { + RepoId = 2, + DateRepoed = DateTime.Parse("11/15/2019"), + FilteredStatusChangeDate = DateTime.Parse("11/25/2019") + }, + new StdReportEntry() + { + RepoId = 3 + }, + new StdReportEntry() + { + RepoId = 4, + DateRepoed = DateTime.Parse("11/22/2019") + }, + new StdReportEntry() + { + RepoId = 5, + FilteredStatusChangeDate = DateTime.Parse("12/21/2019") + }, + new StdReportEntry() + { + RepoId = 6, + DateRepoed = DateTime.Parse("12/21/2019"), + FilteredStatusChangeDate = DateTime.Parse("12/31/2019") + }, + }; + _mockRepository.Setup(repo => + repo.GetAccountsByStatusChangeInPeriod(It.IsAny(), It.IsAny(), + It.IsAny())) + .ReturnsAsync(reportData); + + // Act + var result = + await _landmarkReportingService.GetAvgDaysRepoToSoldReport(DateTime.Parse("11/01/2019"), + DateTime.Parse("12/31/2019")); + + // Assert + Assert.NotNull(result); + Assert.Equal(6, result.DataTable.Rows.Count()); + Assert.Equal(4, result.ReportTable.Cells.Length); + + Assert.Equal("All Sold Accounts", result.ReportTable.Cells[0, 0].Display); + Assert.Equal("10", result.ReportTable.Cells[0, 1].Display); + Assert.Equal("20", result.ReportTable.Cells[0, 2].Display); + Assert.Equal("17", result.ReportTable.Cells[0, 3].Display); + } + + [Fact] + public async void GetRedemptionCountReport_Ok() + { + // Arrange + var reportData = new List() + { + new StdReportEntry() + { + RepoId = 1, + FilteredStatusChangeDate = DateTime.Parse("11/01/2019") + }, + new StdReportEntry() + { + RepoId = 1, + FilteredStatusChangeDate = DateTime.Parse("11/02/2019") + }, + new StdReportEntry() + { + RepoId = 1, + FilteredStatusChangeDate = DateTime.Parse("11/02/2019") + }, + new StdReportEntry() + { + RepoId = 5, + FilteredStatusChangeDate = DateTime.Parse("12/01/2019") + }, + new StdReportEntry() + { + RepoId = 6, + FilteredStatusChangeDate = DateTime.Parse("11/30/2019") + }, + }; + _mockRepository.Setup(repo => + repo.GetAccountsByStatusChangeInPeriod(It.IsAny(), It.IsAny(), + It.IsAny())) + .ReturnsAsync(reportData); + + // Act + var result = + await _landmarkReportingService.GetRedemptionCountReport(DateTime.Parse("11/01/2019"), + DateTime.Parse("12/31/2019")); + + // Assert + Assert.NotNull(result); + Assert.Equal(5, result.DataTable.Rows.Count()); + Assert.Equal(4, result.ReportTable.Cells.Length); + + Assert.Equal("All Redemptions", result.ReportTable.Cells[0, 0].Display); + Assert.Equal("3", result.ReportTable.Cells[0, 1].Display); + Assert.Equal("1", result.ReportTable.Cells[0, 2].Display); + Assert.Equal("4", result.ReportTable.Cells[0, 3].Display); + } + + [Fact] + public async void GetAvgDaysDelqWhenAddedReport_Ok() + { + // Arrange + var reportData = new List() + { + new StdReportEntry() + { + RepoId = 1, + DaysDelqWhenAdded = 25, + O4RDate = DateTime.Parse("11/01/2019") + }, + new StdReportEntry() + { + RepoId = 2, + DaysDelqWhenAdded = 38, + O4RDate = DateTime.Parse("11/02/2019") + }, + new StdReportEntry() + { + RepoId = 3, + DaysDelqWhenAdded = 19, + O4RDate = DateTime.Parse("11/02/2019") + }, + new StdReportEntry() + { + RepoId = 4, + DaysDelqWhenAdded = 12, + O4RDate = DateTime.Parse("12/01/2019") + }, + }; + _mockRepository.Setup(repo => repo.GetAccountsByO4RDate(It.IsAny(), It.IsAny())) + .ReturnsAsync(reportData); + + // Act + var result = + await _landmarkReportingService.GetAvgDaysDelqWhenAddedReport(DateTime.Parse("11/01/2019"), + DateTime.Parse("12/31/2019")); + + // Assert + Assert.NotNull(result); + Assert.Equal(4, result.DataTable.Rows.Count()); + Assert.Equal(4, result.ReportTable.Cells.Length); + + Assert.Equal("All Accounts", result.ReportTable.Cells[0, 0].Display); + Assert.Equal("27", result.ReportTable.Cells[0, 1].Display); + Assert.Equal("12", result.ReportTable.Cells[0, 2].Display); + Assert.Equal("24", result.ReportTable.Cells[0, 3].Display); + } + + [Fact] + public async void GetCountOfSalesReport_Ok() + { + // Arrange + var reportData = new List() + { + new StdReportEntry() + { + RepoId = 1, + FilteredStatusChangeDate = DateTime.Parse("11/01/2019") + }, + new StdReportEntry() + { + RepoId = 2, + FilteredStatusChangeDate = DateTime.Parse("11/02/2019") + }, + new StdReportEntry() + { + RepoId = 3, + FilteredStatusChangeDate = DateTime.Parse("11/02/2019") + }, + new StdReportEntry() + { + RepoId = 4, + FilteredStatusChangeDate = DateTime.Parse("12/01/2019") + }, + }; + _mockRepository.Setup(repo => + repo.GetAccountsByStatusChangeInPeriod(It.IsAny(), It.IsAny(), + It.IsAny())) + .ReturnsAsync(reportData); + + // Act + var result = + await _landmarkReportingService.GetCountOfSalesReport(DateTime.Parse("11/01/2019"), + DateTime.Parse("12/31/2019")); + + // Assert + Assert.NotNull(result); + Assert.Equal(4, result.DataTable.Rows.Count()); + Assert.Equal(4, result.ReportTable.Cells.Length); + + Assert.Equal("All Sold Accounts", result.ReportTable.Cells[0, 0].Display); + Assert.Equal("3", result.ReportTable.Cells[0, 1].Display); + Assert.Equal("1", result.ReportTable.Cells[0, 2].Display); + Assert.Equal("4", result.ReportTable.Cells[0, 3].Display); + } + + [Fact] + public async void GetAvgSurplusReport_Ok() + { + // Arrange + var reportData = new List() + { + new StdReportEntry() + { + RepoId = 1, + GrossSalePrice = 3000, + Balance = 3500, + AuctionName = "Auction A", + SoldDate = DateTime.Parse("11/01/2019") + }, + new StdReportEntry() + { + RepoId = 2, + GrossSalePrice = 500, + Balance = 1200, + AuctionName = "Auction B", + SoldDate = DateTime.Parse("11/02/2019") + }, + new StdReportEntry() + { + RepoId = 3, + GrossSalePrice = 700, + Balance = 650, + AuctionName = "Auction B", + SoldDate = DateTime.Parse("11/02/2019") + }, + new StdReportEntry() + { + RepoId = 4, + GrossSalePrice = 8000, + Balance = 4000, + AuctionName = "Auction A", + SoldDate = DateTime.Parse("12/01/2019") + }, + }; + _mockRepository.Setup(repo => + repo.GetAccountsByDateSoldInAutoIMS(It.IsAny(), It.IsAny())) + .ReturnsAsync(reportData); + + // Act + var result = + await _landmarkReportingService.GetAvgSurplusReport(DateTime.Parse("11/01/2019"), + DateTime.Parse("12/31/2019")); + + // Assert + Assert.NotNull(result); + Assert.Equal(4, result.DataTable.Rows.Count()); + Assert.Equal(12, result.ReportTable.Cells.Length); + + Assert.Equal("All Sold Accounts", result.ReportTable.Cells[0, 0].Display); + Assert.Equal("($383.33)", result.ReportTable.Cells[0, 1].Display); + Assert.Equal("$4,000.00", result.ReportTable.Cells[0, 2].Display); + Assert.Equal("$712.50", result.ReportTable.Cells[0, 3].Display); + + Assert.Equal("Auction A", result.ReportTable.Cells[1, 0].Display); + Assert.Equal("($500.00)", result.ReportTable.Cells[1, 1].Display); + Assert.Equal("$4,000.00", result.ReportTable.Cells[1, 2].Display); + Assert.Equal("$1,750.00", result.ReportTable.Cells[1, 3].Display); + + Assert.Equal("Auction B", result.ReportTable.Cells[2, 0].Display); + Assert.Equal("($325.00)", result.ReportTable.Cells[2, 1].Display); + Assert.Equal("-", result.ReportTable.Cells[2, 2].Display); + Assert.Equal("($325.00)", result.ReportTable.Cells[2, 3].Display); + } + + [Fact] + public async void GetRepoBalanceReport_Ok() + { + // Arrange + var reportData = new List() + { + new StdReportEntry() + { + RepoId = 1, + Balance = 300m, + RepoCompany = "Company A", + DateRepoed = DateTime.Parse("11/01/2019") + }, + new StdReportEntry() + { + RepoId = 2, + Balance = 275.49005m, + RepoCompany = "Company A", + DateRepoed = DateTime.Parse("11/02/2019") + }, + new StdReportEntry() + { + RepoId = 3, + Balance = 999.91m, + RepoCompany = "Company B", + DateRepoed = DateTime.Parse("11/02/2019") + }, + new StdReportEntry() + { + RepoId = 4, + Balance = 100m, + RepoCompany = "Company B", + DateRepoed = DateTime.Parse("12/01/2019") + }, + new StdReportEntry() + { + RepoId = 5, + Balance = 210m, + DateRepoed = DateTime.Parse("12/11/2019") + }, + }; + _mockRepository.Setup(repo => repo.GetAccountsByDateRepoed(It.IsAny(), It.IsAny())) + .ReturnsAsync(reportData); + + // Act + var result = + await _landmarkReportingService.GetRepoBalanceReport(DateTime.Parse("11/01/2019"), + DateTime.Parse("12/31/2019")); + + // Assert + Assert.NotNull(result); + Assert.Equal(5, result.DataTable.Rows.Count()); + Assert.Equal(16, result.ReportTable.Cells.Length); + + Assert.Equal("All Companies", result.ReportTable.Cells[0, 0].Display); + Assert.Equal("$1,575.40", result.ReportTable.Cells[0, 1].Display); + Assert.Equal("$310.00", result.ReportTable.Cells[0, 2].Display); + Assert.Equal("$1,885.40", result.ReportTable.Cells[0, 3].Display); + + Assert.Equal("Company A", result.ReportTable.Cells[1, 0].Display); + Assert.Equal("$575.49", result.ReportTable.Cells[1, 1].Display); + Assert.Equal("-", result.ReportTable.Cells[1, 2].Display); + Assert.Equal("$575.49", result.ReportTable.Cells[1, 3].Display); + + Assert.Equal("Company B", result.ReportTable.Cells[2, 0].Display); + Assert.Equal("$999.91", result.ReportTable.Cells[2, 1].Display); + Assert.Equal("$100.00", result.ReportTable.Cells[2, 2].Display); + Assert.Equal("$1,099.91", result.ReportTable.Cells[2, 3].Display); + + Assert.Equal("No Companies", result.ReportTable.Cells[3, 0].Display); + Assert.Equal("-", result.ReportTable.Cells[3, 1].Display); + Assert.Equal("$210.00", result.ReportTable.Cells[3, 2].Display); + Assert.Equal("$210.00", result.ReportTable.Cells[3, 3].Display); + } + + [Fact] + public async void GetRedemptionBalanceReport_Ok() + { + // Arrange + var reportData = new List() + { + new StdReportEntry() + { + RepoId = 1, + Balance = 250, + FilteredStatusChangeDate = DateTime.Parse("11/01/2019") + }, + new StdReportEntry() + { + RepoId = 2, + Balance = 150, + FilteredStatusChangeDate = DateTime.Parse("11/02/2019") + }, + new StdReportEntry() + { + RepoId = 3, + Balance = 99.99m, + FilteredStatusChangeDate = DateTime.Parse("11/02/2019") + }, + new StdReportEntry() + { + RepoId = 4, + Balance = 1.49m, + FilteredStatusChangeDate = DateTime.Parse("12/01/2019") + }, + }; + _mockRepository.Setup(repo => + repo.GetAccountsByStatusChangeInPeriod(It.IsAny(), It.IsAny(), + It.IsAny())) + .ReturnsAsync(reportData); + + // Act + var result = + await _landmarkReportingService.GetRedemptionBalanceReport(DateTime.Parse("11/01/2019"), + DateTime.Parse("12/31/2019")); + + // Assert + Assert.NotNull(result); + Assert.Equal(4, result.DataTable.Rows.Count()); + Assert.Equal(4, result.ReportTable.Cells.Length); + + Assert.Equal("All Redeemed Accounts", result.ReportTable.Cells[0, 0].Display); + Assert.Equal("$499.99", result.ReportTable.Cells[0, 1].Display); + Assert.Equal("$1.49", result.ReportTable.Cells[0, 2].Display); + Assert.Equal("$501.48", result.ReportTable.Cells[0, 3].Display); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/Processor/RepoAccountProcessorIntegrationTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/Processor/RepoAccountProcessorIntegrationTest.cs new file mode 100644 index 0000000..5d678f7 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/Processor/RepoAccountProcessorIntegrationTest.cs @@ -0,0 +1,372 @@ +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.DataAccess; +using LCU.API.Collections.RepoApi.Domain; +using LCU.API.Collections.RepoApi.Domain.Extensions; +using LCU.API.Collections.RepoApi.Exceptions; +using LCU.API.Collections.RepoApi.Models; +using LCU.API.Collections.RepoApi.Services; +using LCU.API.Collections.RepoApi.Services.Producer; +using LCU.API.Collections.RepoApiTests.Domain; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.Producer; +using LCU.Shared.Collections.RepoApiLib.Models.Settings; +using Moq; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.Services.Processor +{ + public class RepoAccountProcessorIntegrationTest + { + private readonly RepoAccountProcessor _repoAccountProcessor; + private readonly IRepoAccountProcessorService _repoAccountProcessorService; + private readonly Mock _mockAccountAlertCheckService; + private readonly Mock _mockSettingsService; + private readonly Mock _mockRepoAccountService; + private readonly Mock _mockCollectionsDao; + private readonly Mock _mockCoreDao; + private readonly Mock _mockRepoLetterService; + private readonly Mock _mockEmailer; + private readonly Mock _mockAuctionAssignmentService; + private readonly Mock _mockEventAlertService; + private readonly Mock _mockRepoCompanySelectionService; + + public RepoAccountProcessorIntegrationTest() + { + _mockAccountAlertCheckService = new Mock(); + _mockSettingsService = new Mock(); + _mockRepoAccountService = new Mock(); + _mockCollectionsDao = new Mock(); + _mockCoreDao = new Mock(); + _mockEmailer = new Mock(); + _mockAuctionAssignmentService = new Mock(); + _mockRepoLetterService = new Mock(); + _mockEventAlertService = new Mock(); + _mockRepoCompanySelectionService = new Mock(); + var repoSettings = DbContextFromJson.GetTestObjectFromFile("Services/Processor/repoSettings.json"); + _mockSettingsService.Setup(x => x.GetCachedRepoSettingsAsync()).ReturnsAsync(repoSettings); + _repoAccountProcessorService = new RepoAccountProcessorService( _mockCoreDao.Object, + new RedemptionExpiredDateCalculator(), _mockAccountAlertCheckService.Object, + _mockEventAlertService.Object, _mockRepoCompanySelectionService.Object); + _repoAccountProcessor = new RepoAccountProcessor( + _repoAccountProcessorService, _mockAccountAlertCheckService.Object, _mockCollectionsDao.Object, + _mockEmailer.Object, _mockSettingsService.Object, _mockRepoAccountService.Object, + _mockRepoLetterService.Object, _mockCoreDao.Object, _mockAuctionAssignmentService.Object); + + // _mockRepoAccountProcessorService.Setup(mock => mock.TryUpdateCollateralRetitleDate(It.IsAny(), It.IsAny())); + } + + [Fact] + public async Task Basic_Construct_Test() + { + Assert.NotNull(_repoAccountProcessor); + await Assert.ThrowsAsync(() => { return _repoAccountProcessor.HandleAccount(null); }); + } + + /** + * Use this test to make more tests when things go wrong, you can dump raw JSON files from the sources into the test + * and make sure you get expected results. Remember to remove member's PII. + */ + [Fact] + public async Task Should_Create_Account() + { + var testInput = DbContextFromJson.GetTestObjectFromFile("Services/Processor/newAccount.json"); + Assert.NotNull(testInput); + _mockCollectionsDao.Setup(cd => cd.RetrieveAccountAsync(It.IsAny())).ReturnsAsync(testInput.TemenosAccount); + _mockRepoAccountService.Setup(ras => ras.GetNewestOpenAccount(It.IsAny())) + .ReturnsAsync((RepoAccount) null); + _mockCoreDao.Setup(cd => cd.RetrieveLoanAsync(It.IsAny())).ReturnsAsync(testInput.LoanDetail); + _mockCoreDao.Setup(cd => cd.RetrieveMemberAsync(It.IsAny())).ReturnsAsync(testInput.MemberDetail); + _mockCoreDao.Setup(cd => cd.RetrieveTransactionsAsync(It.IsAny())).ReturnsAsync(testInput.CoreTransactions); + _mockCoreDao.Setup(cd => cd.RetrieveCollateralAsync(It.IsAny())).ReturnsAsync(testInput.CollateralDetails); + _mockRepoLetterService.Setup(x => x.ListByAccountIdAsync(It.IsAny())).ReturnsAsync( + RepoLetterService.ProcessLetters(testInput.TemenosHistory, testInput.RepoLetters)); + _mockAuctionAssignmentService.Setup(x => x.GetListByIdsAsync(It.IsAny>())) + .ReturnsAsync(new List()); + var result = await _repoAccountProcessor.HandleAccount(new ProcessingItem() + { + AccountNo = "6466120143" + }); + Assert.Equal(RepoProcessingResult.Created, result); + } + + [Fact] + public void Should_Select_Correct_Case() + { + /** + * Given an account with three cases, choose the correct one: + * 1. Wrong case type + * 2. Ineligible case stage (repoStatus) + * 3. Eligible case with valid stage/status. + */ + var testInput = DbContextFromJson.GetTestObjectFromFile("Services/Processor/selectCorrectCase.json"); + Assert.NotNull(testInput); + var selectedCase = testInput.TemenosAccount.FindRecoveryCaseOrDefault(0); + Assert.Equal( 342, selectedCase.CaseId); + selectedCase = testInput.TemenosAccount.FindRecoveryCaseOrDefault(25); + Assert.Equal( 25, selectedCase.CaseId); + } + + [Fact] + public async Task Should_Not_Create_Ineligible_Account_Temenos_Event() + { + // Temenos Events will specify a case id. + var testInput = DbContextFromJson.GetTestObjectFromFile("Services/Processor/ineligibleAccount.json"); + Assert.NotNull(testInput); + _mockCollectionsDao.Setup(cd => cd.RetrieveAccountAsync(It.IsAny())).ReturnsAsync(testInput.TemenosAccount); + _mockRepoAccountService.Setup(ras => ras.GetNewestOpenAccount(It.IsAny())) + .ReturnsAsync((RepoAccount) null); + _mockCoreDao.Setup(cd => cd.RetrieveLoanAsync(It.IsAny())).ReturnsAsync(testInput.LoanDetail); + _mockCoreDao.Setup(cd => cd.RetrieveMemberAsync(It.IsAny())).ReturnsAsync(testInput.MemberDetail); + _mockCoreDao.Setup(cd => cd.RetrieveTransactionsAsync(It.IsAny())).ReturnsAsync(testInput.CoreTransactions); + _mockCoreDao.Setup(cd => cd.RetrieveCollateralAsync(It.IsAny())).ReturnsAsync(testInput.CollateralDetails); + _mockRepoLetterService.Setup(x => x.ListByAccountIdAsync(It.IsAny())).ReturnsAsync( + RepoLetterService.ProcessLetters(testInput.TemenosHistory, testInput.RepoLetters)); + _mockAuctionAssignmentService.Setup(x => x.GetListByIdsAsync(It.IsAny>())) + .ReturnsAsync(new List()); + var result = await _repoAccountProcessor.HandleAccount(new ProcessingItem() + { + AccountNo = "6466120143", + CaseId = "306" + }); + Assert.Equal(RepoProcessingResult.Ineligible, result); + } + + [Fact] + public async Task Should_Update_Retitled_And_Redemption_Expired_Account() + { + RepoAccount resultAccount = null; + var testInput = DbContextFromJson.GetTestObjectFromFile("Services/Processor/update-retitle-redemption-exp.json"); + Assert.NotNull(testInput); + _mockCollectionsDao.Setup(cd => cd.RetrieveAccountAsync(It.IsAny())).ReturnsAsync(testInput.TemenosAccount); + _mockRepoAccountService.Setup(ras => ras.GetNewestOpenAccount(It.IsAny())) + .ReturnsAsync(testInput.RepoAccount); + _mockRepoAccountService.Setup(x => x.UpdateAsync(It.IsAny(), It.IsAny())) + .ReturnsAsync((RepoAccount inAccount, AppUser inUser) => { + resultAccount = inAccount; + return inAccount; + }); + _mockCoreDao.Setup(cd => cd.RetrieveLoanAsync(It.IsAny())).ReturnsAsync(testInput.LoanDetail); + _mockCoreDao.Setup(cd => cd.RetrieveMemberAsync(It.IsAny())).ReturnsAsync(testInput.MemberDetail); + _mockCoreDao.Setup(cd => cd.RetrieveTransactionsAsync(It.IsAny())).ReturnsAsync(testInput.CoreTransactions); + _mockRepoLetterService.Setup(x => x.ListByAccountIdAsync(It.IsAny())).ReturnsAsync( + RepoLetterService.ProcessLetters(testInput.TemenosHistory, testInput.RepoLetters)); + _mockAuctionAssignmentService.Setup(x => x.GetListByIdsAsync(It.IsAny>())) + .ReturnsAsync(new List()); + + // Pre-Assert. + Assert.Null(resultAccount); + Assert.Null(testInput.RepoAccount.RedemptionExpiredDate); + Assert.NotNull(testInput.TemenosAccount.Cases.First().RedemptionExpiredDateWi); + + var existingSelections = testInput.RepoAccount.Collaterals.First(); + Assert.Null(existingSelections.RetitledInLandmarkName); + Assert.NotEmpty(existingSelections.RepoCompanySelections); + Assert.Collection(existingSelections.RepoCompanySelections, + item => + { + Assert.Equal(5, item.RepoCompanyId); + Assert.NotNull(item.DateRepoed); + }); + + // Run + var result = await _repoAccountProcessor.HandleAccount(new ProcessingItem() + { + AccountNo = "7584700143" + }); + + // Post-Assert + Assert.Equal(RepoProcessingResult.Updated, result); + Assert.NotNull(resultAccount); + Assert.NotNull(resultAccount.RedemptionExpiredDate); + var newSelections = resultAccount.Collaterals.First(); + Assert.NotNull(newSelections.RetitledInLandmarkName); + Assert.Collection(newSelections.RepoCompanySelections, + + item => + { + Assert.Equal(5, item.RepoCompanyId); + Assert.NotNull(item.DateRepoed); + } + ); + } + + [Fact] + public async Task Should_Update_WrittenOff_And_RepoSelection_Account() + { + RepoAccount resultAccount = null; + var testInput = DbContextFromJson.GetTestObjectFromFile("Services/Processor/written-off-account.json"); + Assert.NotNull(testInput); + _mockCollectionsDao.Setup(cd => cd.RetrieveAccountAsync(It.IsAny())).ReturnsAsync(testInput.TemenosAccount); + _mockRepoAccountService.Setup(ras => ras.GetNewestOpenAccount(It.IsAny())) + .ReturnsAsync(testInput.RepoAccount); + _mockRepoAccountService.Setup(x => x.UpdateAsync(It.IsAny(), It.IsAny())) + .ReturnsAsync((RepoAccount inAccount, AppUser inUser) => { + resultAccount = inAccount; + return inAccount; + }); + _mockCoreDao.Setup(cd => cd.RetrieveLoanAsync(It.IsAny())).ReturnsAsync(testInput.LoanDetail); + _mockCoreDao.Setup(cd => cd.RetrieveMemberAsync(It.IsAny())).ReturnsAsync(testInput.MemberDetail); + _mockCoreDao.Setup(cd => cd.RetrieveTransactionsAsync(It.IsAny())).ReturnsAsync(testInput.CoreTransactions); + _mockRepoLetterService.Setup(x => x.ListByAccountIdAsync(It.IsAny())).ReturnsAsync( + RepoLetterService.ProcessLetters(testInput.TemenosHistory, testInput.RepoLetters)); + _mockAuctionAssignmentService.Setup(x => x.GetListByIdsAsync(It.IsAny>())) + .ReturnsAsync(new List()); + + // Pre-Assert. + Assert.Null(resultAccount); + Assert.Null(testInput.RepoAccount.ReferenceStatus); + Assert.Null(testInput.RepoAccount.WrittenOffDate); + var existingSelections = testInput.RepoAccount.Collaterals.First(); + Assert.NotEmpty(existingSelections.RepoCompanySelections); + Assert.Collection(existingSelections.RepoCompanySelections, + item => + { + Assert.Equal(4, item.RepoCompanyId); + Assert.Null(item.DateRepoed); + }, + item => + { + Assert.Equal(13, item.RepoCompanyId); + Assert.Null(item.DateRepoed); + }); + + // Run + var result = await _repoAccountProcessor.HandleAccount(new ProcessingItem() + { + AccountNo = "5730350143" + }); + + // Post-Assert + Assert.Equal(RepoProcessingResult.Updated, result); + Assert.NotNull(resultAccount); + Assert.Equal("Written Off", resultAccount.ReferenceStatus); + Assert.NotNull(resultAccount.WrittenOffDate); + var newSelections = resultAccount.Collaterals.First(); + Assert.Collection(newSelections.RepoCompanySelections, + + item => + { + Assert.Equal(4, item.RepoCompanyId); + Assert.Null(item.DateRepoed); + }, + item => + { + Assert.Equal(13, item.RepoCompanyId); + Assert.NotNull(item.DateRepoed); + }, + item => + { + Assert.Equal(7, item.RepoCompanyId); + Assert.Null(item.DateRepoed); + } + ); + } + + [Fact] + public async Task Should_Update_WrittenOff_And_RepoSelection_Account2() + { + RepoAccount resultAccount = null; + var testInput = DbContextFromJson.GetTestObjectFromFile("Services/Processor/written-off-account-2.json"); + Assert.NotNull(testInput); + _mockCollectionsDao.Setup(cd => cd.RetrieveAccountAsync(It.IsAny())).ReturnsAsync(testInput.TemenosAccount); + _mockRepoAccountService.Setup(ras => ras.GetNewestOpenAccount(It.IsAny())) + .ReturnsAsync(testInput.RepoAccount); + _mockRepoAccountService.Setup(x => x.UpdateAsync(It.IsAny(), It.IsAny())) + .ReturnsAsync((RepoAccount inAccount, AppUser inUser) => { + resultAccount = inAccount; + return inAccount; + }); + _mockCoreDao.Setup(cd => cd.RetrieveLoanAsync(It.IsAny())).ReturnsAsync(testInput.LoanDetail); + _mockCoreDao.Setup(cd => cd.RetrieveMemberAsync(It.IsAny())).ReturnsAsync(testInput.MemberDetail); + _mockCoreDao.Setup(cd => cd.RetrieveTransactionsAsync(It.IsAny())).ReturnsAsync(testInput.CoreTransactions); + _mockRepoLetterService.Setup(x => x.ListByAccountIdAsync(It.IsAny())).ReturnsAsync( + RepoLetterService.ProcessLetters(testInput.TemenosHistory, testInput.RepoLetters)); + _mockAuctionAssignmentService.Setup(x => x.GetListByIdsAsync(It.IsAny>())) + .ReturnsAsync(new List()); + + // Pre-Assert. + Assert.Null(resultAccount); + Assert.Equal("Written Off", testInput.RepoAccount.ReferenceStatus); + Assert.Null(testInput.RepoAccount.WrittenOffDate); + var existingSelections = testInput.RepoAccount.Collaterals.First(); + Assert.NotEmpty(existingSelections.RepoCompanySelections); + Assert.Collection(existingSelections.RepoCompanySelections, + item => + { + Assert.Equal(11, item.RepoCompanyId); + Assert.Null(item.DateRepoed); + }, + item => + { + Assert.Equal(11, item.RepoCompanyId); + Assert.NotNull(item.DateRepoed); + }, + item => + { + Assert.Equal(1, item.RepoCompanyId); + Assert.NotNull(item.DateRepoed); + }, + item => + { + Assert.Equal(5, item.RepoCompanyId); + Assert.NotNull(item.DateRepoed); + }, + item => + { + Assert.Equal(13, item.RepoCompanyId); + Assert.NotNull(item.DateRepoed); + }, + item => + { + Assert.Equal(13, item.RepoCompanyId); + Assert.Null(item.DateRepoed); + }); + + // Run + var result = await _repoAccountProcessor.HandleAccount(new ProcessingItem() + { + AccountNo = "7115520143" + }); + + // Post-Assert + Assert.Equal(RepoProcessingResult.Updated, result); + Assert.NotNull(resultAccount); + Assert.Equal("Written Off", resultAccount.ReferenceStatus); + Assert.NotNull(resultAccount.WrittenOffDate); + var newSelections = resultAccount.Collaterals.First(); + Assert.Collection(existingSelections.RepoCompanySelections, + item => + { + Assert.Equal(11, item.RepoCompanyId); + Assert.Null(item.DateRepoed); + }, + item => + { + Assert.Equal(11, item.RepoCompanyId); + Assert.NotNull(item.DateRepoed); + }, + item => + { + Assert.Equal(1, item.RepoCompanyId); + Assert.NotNull(item.DateRepoed); + }, + item => + { + Assert.Equal(5, item.RepoCompanyId); + Assert.NotNull(item.DateRepoed); + }, + item => + { + Assert.Equal(13, item.RepoCompanyId); + Assert.NotNull(item.DateRepoed); + }, + item => + { + Assert.Equal(13, item.RepoCompanyId); + Assert.Null(item.DateRepoed); + }); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/Processor/RepoAccountProcessorServiceTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/Processor/RepoAccountProcessorServiceTest.cs new file mode 100644 index 0000000..58b2b1c --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/Processor/RepoAccountProcessorServiceTest.cs @@ -0,0 +1,1654 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using LCU.API.Collections.CollectionsApiLib.Models; +using LCU.API.Collections.RepoApi.DataAccess; +using LCU.API.Collections.RepoApi.Domain.Processing; +using LCU.API.Collections.RepoApi.Exceptions; +using LCU.API.Collections.RepoApi.Services; +using LCU.API.Collections.RepoApi.Services.Producer; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.Consumer; +using LCU.Shared.Collections.RepoApiLib.Models.Producer; +using LCU.Shared.Collections.RepoApiLib.Models.Settings; +using Moq; +using Xunit; +using Xunit.Sdk; + +namespace LCU.API.Collections.RepoApiTests.Services.Processor +{ + public class RepoAccountProcessorServiceTest + { + private readonly Mock _mockCoreDao; + private readonly RepoAccountProcessorService _repoAccountProcessorService; + private readonly RepoAccount originalRepoAccount; + private readonly TemenosAccount recoveryAccount; + private readonly TemenosCase recoveryCase; + private readonly LoanDetail loanDetail; + private readonly Mock mockRedemptionExpiredDateCalculator; + private readonly Mock mockAccountAlertCheckService; + private readonly Settings settings; + private readonly Mock _mockEventAlertService; + private readonly Mock _mockRepoCompanySelectionService; + + public RepoAccountProcessorServiceTest() + { + settings = new Settings() + { + AllowedStatusChanges = new List() + { + new AllowedStatusChange() + { + ID = 1, CurrentStatus = "O4R", AllowedChangeStatus = "REPO" + }, + new AllowedStatusChange() + { + ID = 2, CurrentStatus = "RECA", AllowedChangeStatus = "O4R" + } + } + }; + + mockAccountAlertCheckService = new Mock(); + mockRedemptionExpiredDateCalculator = new Mock(); + _mockEventAlertService = new Mock(); + _mockCoreDao = new Mock(); + _mockRepoCompanySelectionService = new Mock(); + + mockRedemptionExpiredDateCalculator.Setup(x => + x.CalculateAsync(It.IsAny(), It.IsAny>())) + .Returns(DateTime.Parse("2015-05-09")); + _repoAccountProcessorService = new RepoAccountProcessorService(_mockCoreDao.Object, + mockRedemptionExpiredDateCalculator.Object, mockAccountAlertCheckService.Object, + _mockEventAlertService.Object, _mockRepoCompanySelectionService.Object); + originalRepoAccount = new RepoAccount() + { + RepoId = 100, + AccountNo = "123456-789", + AccountTypeCode = "LP1", + OrigAccountTypeCode = "LP1", + Balance = 100, + Bankruptcy = "No", + Borrowers = new List() + { + new Borrower() + { + RepoId = 100, + IndividualId = "1200", + IndividualName = "John Tester", + OwnershipType = 6 + } + }, + Branch = 5656, + Collaterals = new List() + { + new Collateral() + { + RepoId = 100, + Vin = "123", + CollateralId = 101, + RepoCompanySelections = new List() + { + new RepoCompanySelection() + { + RepoType = RepoType.Involuntary + } + } + } + }, + Collector = "Diana", + LoanNo = 123, + MemberNo = 1000, + PrimaryIndividualId = "1200", + Status = "O4R", + SubStatus = "SUB", + ReferenceId = 997, + SixtyPlusCollectorId = 12345, + SixtyPlusCollector = new SixtyPlusCollector() + { + SixtyPlusCollectorId = 12345, + SixtyPlusCollectorName = "Sixty Plus" + } + }; + recoveryAccount = new TemenosAccount() + { + AccountNumber = "123456-789", + AccountTypeId = 1008, + AccountType = new RepoAccountType() + { + Id = 1008, + Code = "LP2", + Description = "Something" + }, + AccountStatus = "Open", + AccountId = 5, + Branch = "54", + DateFirstDelinquent = "11/5/2018 12:00:00 AM", + DateLastPaid = "11/4/2018 12:00:00 AM", + // UserStatusCode1 = "REPO", + // CustomerNo = "1234" + }; + recoveryCase = new TemenosCase() + { + CaseId = 997, + RepoStatus = RepoStatus.O4R, + CreatedDate = DateTime.Today, + TitleOrdered = true, + TitleOrderedDate = DateTime.Parse("8/12/2020 12:00:00 AM") + }; + loanDetail = new LoanDetail() + { + Status = "OpenOrSomething" + }; + } + + [Fact] + public void Basic_Construct_Test() + { + Assert.NotNull(_repoAccountProcessorService); + } + + [Fact] + public void Status_Compare_Test() + { + Assert.NotNull(_repoAccountProcessorService); + RepoAccount account1 = new RepoAccount() + { + Status = "O4R" + }; + RepoAccount account2 = new RepoAccount() + { + Status = "REPO" + }; + RepoAccount account3 = new RepoAccount(); + Assert.True(_repoAccountProcessorService.IsStatusMatch(account1, " O4r ")); + Assert.True(_repoAccountProcessorService.IsStatusMatch(account1, " O4R")); + Assert.True(_repoAccountProcessorService.IsStatusMatch(account1, "O4r ")); + Assert.True(_repoAccountProcessorService.IsStatusMatch(account2, " repo ")); + Assert.False(_repoAccountProcessorService.IsStatusMatch(account1, null)); + Assert.False(_repoAccountProcessorService.IsStatusMatch(account1, "repo")); + Assert.False(_repoAccountProcessorService.IsStatusMatch(account2, null)); + Assert.False(_repoAccountProcessorService.IsStatusMatch(account3, " repo ")); + } + + [Fact] + public void Convert_Borrower_Type_Test() + { + Assert.NotNull(_repoAccountProcessorService); + Assert.Equal(OwnershipType.Borrower, _repoAccountProcessorService.ConvertBorrowerType(" BORROWER ")); + Assert.Equal(OwnershipType.Borrower, _repoAccountProcessorService.ConvertBorrowerType("borrower ")); + Assert.Equal(OwnershipType.Borrower, _repoAccountProcessorService.ConvertBorrowerType(" borRower")); + Assert.Equal(OwnershipType.Coborrower, _repoAccountProcessorService.ConvertBorrowerType(" CO-BORROWER ")); + Assert.Equal(OwnershipType.Coborrower, _repoAccountProcessorService.ConvertBorrowerType("co-borrower ")); + Assert.Equal(OwnershipType.Coborrower, _repoAccountProcessorService.ConvertBorrowerType(" co-borRower")); + Assert.Equal(OwnershipType.Other, _repoAccountProcessorService.ConvertBorrowerType(" COBORROWER ")); + Assert.Equal(OwnershipType.Other, _repoAccountProcessorService.ConvertBorrowerType("asdfasdf ")); + Assert.Equal(OwnershipType.Other, _repoAccountProcessorService.ConvertBorrowerType(null)); + } + + [Fact] + public void Create_Repo_Account_Ok() + { + var temenosAccount = new TemenosAccount() + { + AccountIdentifier = "323232789", + AccountType = new RepoAccountType() { Id = 1007, Code = "LP2", Description = "test" }, + AccountId = 5, + Branch = "54", + Balance = (decimal)71234.33, + AccountTypeId = 1007, + AccountStatus = "Open", + DateFirstDelinquent = "11/5/2018 12:00:00 AM", + DateLastPaid = "11/5/2018 12:00:00 AM" + }; + var temenosCase = new TemenosCase() + { + CaseId = 12345, + RepoStatus = RepoStatus.O4R, + CreatedDate = DateTime.Today, + TitleOrdered = true, + TitleOrderedDate = DateTime.Parse("8/12/2020 12:00:00 AM") + }; + var loanDetail = + new LoanDetail() + { + Balance = 1000, + AccountType = 5, + IndividualId = new int[] { 1000, 1001 }, + Borrowers = new List() + { + new LoanOwner() + { + IndividualId = 12345, + Name = "xxx Borrower", + Type = "Borrower" + } + }, + NextDueDate = DateTime.Today + }; + _mockCoreDao.Setup(service => service.RetrieveCollateralAsync(It.IsAny())) + .ReturnsAsync( + new List() + { + new CollateralDetail() + { + CollateralId = 1000, + CurrentValue = 2000, + Description = "xxx description" + } + } + ); + _mockCoreDao.Setup(service => service.RetrieveMemberAsync(It.IsAny())) + .ReturnsAsync( + new MemberDetail() + { + MemberId = 8675309 + } + ); + + + var result = _repoAccountProcessorService.CreateRepoAccount(temenosAccount, temenosCase, loanDetail); + + Assert.Equal(temenosAccount.AccountIdentifier, result.AccountNo); + Assert.Equal(temenosAccount.Balance, result.Balance); // Q1. Confirm with business not to use loan balance? + + Assert.NotNull(result.Borrowers); + Assert.NotNull(result.Collaterals); + Assert.NotNull(result.AccountLastProcessed); + Assert.Equal("xxx Borrower", result.Borrowers.First().IndividualName); + Assert.Equal("xxx description", result.Collaterals.First().Description); + Assert.Equal(temenosAccount.AccountId, result.ReferenceId); + Assert.Equal(temenosCase.CaseId, result.ReferenceCaseId); + Assert.Equal(temenosAccount.AccountType.Code, result.AccountTypeCode); + Assert.Equal(temenosAccount.AccountType.Code, result.OrigAccountTypeCode); + Assert.Equal(temenosAccount.AccountStatus, result.ReferenceStatus); + } + + [Fact] + public void Create_Repo_Account_No_Collateral() + { + var loanDetail = new LoanDetail() + { + Balance = 1000, + AccountType = 5, + IndividualId = new int[] { 1000, 1001 } + }; + _mockCoreDao.Setup(service => service.RetrieveCollateralAsync(It.IsAny())) + .ReturnsAsync(new List() { }); + + Assert.Throws(() => + _repoAccountProcessorService.CreateRepoAccount(recoveryAccount, recoveryCase, loanDetail)); + } + + [Fact] + public void Create_Repo_Account_No_Borrower() + { + var loanDetail = new LoanDetail() + { + Balance = 1000, + AccountType = 5, + IndividualId = new int[] { 1000, 1001 } + }; + _mockCoreDao.Setup(service => service.RetrieveCollateralAsync(It.IsAny())) + .ReturnsAsync(new List() + { + new CollateralDetail() + { + CollateralId = 1000, + CurrentValue = 2000 + } + }); + + Assert.Throws(() => + _repoAccountProcessorService.CreateRepoAccount(recoveryAccount, recoveryCase, loanDetail)); + } + + [Fact] + public void Create_Repo_Account_Bad_DateTime() + { + var temenosAccount = recoveryAccount; + temenosAccount.DateFirstDelinquent = null; + + var loanDetail = new LoanDetail() + { + Balance = 1000, + AccountType = 5, + IndividualId = new int[] { 1000, 1001 }, + Borrowers = new List() + { + new LoanOwner() + { + IndividualId = 12345, + Name = "John Borrower", + Type = "Borrower" + } + } + }; + _mockCoreDao.Setup(service => service.RetrieveCollateralAsync(It.IsAny())) + .ReturnsAsync( + new List() + { + new CollateralDetail() + { + CollateralId = 1000, + CurrentValue = 2000 + } + }); + + Assert.ThrowsAny(() => + _repoAccountProcessorService.CreateRepoAccount(temenosAccount, recoveryCase, loanDetail)); + } + + [Fact] + public void Construct_Collateral_OK() + { + List collateralDetail = new List() + { + new CollateralDetail() + { + Other = new OtherCollateral() + { + MiscellaneousInformation = "VINVINVINVINVIN" + }, + Vehicle = new Vehicle() + { + VIN = "VINVINVINVINVINVIN" + } + } + }; + RepoAccount repoAccount = new RepoAccount() { }; + var results = _repoAccountProcessorService.ConstructCollateralFromDetails(collateralDetail); + Assert.NotNull(results); + Assert.NotEmpty(results); + } + + + [Fact] + public void Construct_Collateral_Empty_List() + { + List collateralDetail = new List() + { + }; + RepoAccount repoAccount = new RepoAccount() { }; + var results = _repoAccountProcessorService.ConstructCollateralFromDetails(collateralDetail); + Assert.NotNull(results); + Assert.Empty(results); + } + + [Fact] + public void Merge_Everything_Ok() + { + var slip = new RepoAccountProcessingSlip() + { + RecoveryAccount = recoveryAccount, + ExistingRepoAccount = originalRepoAccount, + RecoveryCase = recoveryCase, + CurrentSettings = settings, + Letters = new List(), + Loan = loanDetail, + RequestedBy = new ProcessingItem() + { + AccountNo = recoveryAccount.AccountIdentifier, + QueuedBy = "Tester" + } + }; + slip.AssertReadyForFullProcessing(); + var result = _repoAccountProcessorService.UpdateRepoAccountFromParts(slip); + Assert.Equal(originalRepoAccount.AccountNo, result.AccountNo); + Assert.Equal(originalRepoAccount.RepoId, result.RepoId); + Assert.Equal(originalRepoAccount.Borrowers, result.Borrowers); + Assert.Equal(originalRepoAccount.Collaterals, result.Collaterals); + Assert.Equal(originalRepoAccount.OrigAccountTypeCode, result.OrigAccountTypeCode); + Assert.NotEqual(originalRepoAccount.SixtyPlusCollector, result.SixtyPlusCollector); + Assert.NotEqual(originalRepoAccount.AccountTypeCode, result.AccountTypeCode); + } + + [Fact] + public void UpdateRepoAccountFromParts_Updates_Repo_Status_Ok() + { + originalRepoAccount.Status = "O4R"; + recoveryCase.RepoStatus = RepoStatus.REPO; + var slip = new RepoAccountProcessingSlip() + { + RecoveryAccount = recoveryAccount, + ExistingRepoAccount = originalRepoAccount, + RecoveryCase = recoveryCase, + CurrentSettings = settings, + Letters = new List(), + Loan = loanDetail, + RequestedBy = new ProcessingItem() + { + AccountNo = recoveryAccount.AccountIdentifier, + QueuedBy = "Tester" + } + }; + slip.AssertReadyForFullProcessing(); + + var updatedRepoAccount = + _repoAccountProcessorService.UpdateRepoAccountFromParts(slip); + Assert.Equal("REPO", updatedRepoAccount.Status); + _repoAccountProcessorService.CheckForRejectedStatusChange(originalRepoAccount, updatedRepoAccount, + settings); + Assert.Equal("REPO", updatedRepoAccount.Status); + Assert.Null(updatedRepoAccount.Collaterals.First().RepoCompanySelections.First().DateRepoed); + } + + [Fact] + public void UpdateRepoAccountFromParts_Updates_O4R_Status_Ok() + { + originalRepoAccount.Status = "RECA"; + recoveryCase.RepoStatus = RepoStatus.O4R; + var slip = new RepoAccountProcessingSlip() + { + RecoveryAccount = recoveryAccount, + ExistingRepoAccount = originalRepoAccount, + RecoveryCase = recoveryCase, + CurrentSettings = settings, + Letters = new List(), + Loan = loanDetail, + RequestedBy = new ProcessingItem() + { + AccountNo = recoveryAccount.AccountIdentifier, + QueuedBy = "Tester" + } + }; + slip.AssertReadyForFullProcessing(); + + var updatedRepoAccount = + _repoAccountProcessorService.UpdateRepoAccountFromParts(slip); + Assert.Equal("O4R", updatedRepoAccount.Status); + _repoAccountProcessorService.CheckForRejectedStatusChange(originalRepoAccount, updatedRepoAccount, + settings); + Assert.Equal("O4R", updatedRepoAccount.Status); + } + + [Fact] + public void UpdateRepoAccountFromParts_Updates_SixtyPlusCollector_Ok() + { + var SixtyPlus = new Dictionary() + { + {"SixtyPlus User Assigned", "67890" } + }; + recoveryAccount.CustomFieldMap = SixtyPlus; + var slip = new RepoAccountProcessingSlip() + { + RecoveryAccount = recoveryAccount, + ExistingRepoAccount = originalRepoAccount, + RecoveryCase = recoveryCase, + CurrentSettings = settings, + Letters = new List(), + Loan = loanDetail, + RequestedBy = new ProcessingItem() + { + AccountNo = recoveryAccount.AccountIdentifier, + QueuedBy = "Tester" + } + }; + slip.AssertReadyForFullProcessing(); + + var updatedRepoAccount = + _repoAccountProcessorService.UpdateRepoAccountFromParts(slip); + Assert.Equal(67890, updatedRepoAccount.SixtyPlusCollectorId); + } + + [Fact] + public void UpdateRepoAccountFromParts_Updates_SixtyPlusCollector_Null() + { + var SixtyPlus = new Dictionary() + { + {"SixtyPlus User Assigned", "" } + }; + recoveryAccount.CustomFieldMap = SixtyPlus; + var slip = new RepoAccountProcessingSlip() + { + RecoveryAccount = recoveryAccount, + ExistingRepoAccount = originalRepoAccount, + RecoveryCase = recoveryCase, + CurrentSettings = settings, + Letters = new List(), + Loan = loanDetail, + RequestedBy = new ProcessingItem() + { + AccountNo = recoveryAccount.AccountIdentifier, + QueuedBy = "Tester" + } + }; + slip.AssertReadyForFullProcessing(); + + var updatedRepoAccount = + _repoAccountProcessorService.UpdateRepoAccountFromParts(slip); + Assert.Null(updatedRepoAccount.SixtyPlusCollectorId); + } + + [Fact] + public void UpdateRepoAccountFromParts_DontThrow_Null_LastPaymentDate() + { + originalRepoAccount.Status = "RECA"; + recoveryAccount.DateLastPaid = null; + recoveryCase.RepoStatus = RepoStatus.O4R; + var slip = new RepoAccountProcessingSlip() + { + RecoveryAccount = recoveryAccount, + ExistingRepoAccount = originalRepoAccount, + RecoveryCase = recoveryCase, + CurrentSettings = settings, + Letters = new List(), + Loan = loanDetail, + RequestedBy = new ProcessingItem() + { + AccountNo = recoveryAccount.AccountIdentifier, + QueuedBy = "Tester" + } + }; + slip.AssertReadyForFullProcessing(); + + var updatedRepoAccount = _repoAccountProcessorService.UpdateRepoAccountFromParts(slip); + Assert.Null(updatedRepoAccount.LastPaymentDate); + } + + [Fact] + public void UpdateRepoAccountFromParts_DontThrow_Bad_LastPaymentDate() + { + originalRepoAccount.Status = "RECA"; + recoveryAccount.DateLastPaid = "NotADate"; + recoveryCase.RepoStatus = RepoStatus.O4R; + var slip = new RepoAccountProcessingSlip() + { + RecoveryAccount = recoveryAccount, + ExistingRepoAccount = originalRepoAccount, + RecoveryCase = recoveryCase, + CurrentSettings = settings, + Letters = new List(), + Loan = loanDetail, + RequestedBy = new ProcessingItem() + { + AccountNo = recoveryAccount.AccountIdentifier, + QueuedBy = "Tester" + } + }; + slip.AssertReadyForFullProcessing(); + + var updatedRepoAccount = + _repoAccountProcessorService.UpdateRepoAccountFromParts(slip); + Assert.Null(updatedRepoAccount.LastPaymentDate); + } + + [Fact] + public void Check_Status_Reject_REJECT() + { + originalRepoAccount.Status = "RECA"; + // RECA can't go to REPO + recoveryCase.RepoStatus = RepoStatus.REPO; + var slip = new RepoAccountProcessingSlip() + { + RecoveryAccount = recoveryAccount, + ExistingRepoAccount = originalRepoAccount, + RecoveryCase = recoveryCase, + CurrentSettings = settings, + Letters = new List(), + Loan = loanDetail, + RequestedBy = new ProcessingItem() + { + AccountNo = recoveryAccount.AccountIdentifier, + QueuedBy = "Tester" + } + }; + slip.AssertReadyForFullProcessing(); + + var updatedRepoAccount = + _repoAccountProcessorService.UpdateRepoAccountFromParts(slip); + Assert.Equal("REPO", updatedRepoAccount.Status); + _repoAccountProcessorService.CheckForRejectedStatusChange(originalRepoAccount, updatedRepoAccount, + settings); + // Should have been reverted + Assert.Equal("RECA", updatedRepoAccount.Status); + mockAccountAlertCheckService.Verify(x => x.ManualAlert(It.IsAny()), Times.Once); + } + + [Fact] + public void Check_Status_Reject_ACCEPT() + { + originalRepoAccount.Status = "RECA"; + // RECA can go to 04R + recoveryCase.RepoStatus = RepoStatus.O4R; + var slip = new RepoAccountProcessingSlip() + { + RecoveryAccount = recoveryAccount, + ExistingRepoAccount = originalRepoAccount, + RecoveryCase = recoveryCase, + CurrentSettings = settings, + Letters = new List(), + Loan = loanDetail, + RequestedBy = new ProcessingItem() + { + AccountNo = recoveryAccount.AccountIdentifier, + QueuedBy = "Tester" + } + }; + slip.AssertReadyForFullProcessing(); + + var updatedRepoAccount = + _repoAccountProcessorService.UpdateRepoAccountFromParts(slip); + Assert.Equal("O4R", updatedRepoAccount.Status); + _repoAccountProcessorService.CheckForRejectedStatusChange(originalRepoAccount, updatedRepoAccount, + settings); + // Should have been accepted + Assert.Equal("O4R", updatedRepoAccount.Status); + mockAccountAlertCheckService.Verify(x => x.ManualAlert(It.IsAny()), Times.Never); + } + + [Fact] + public void Update_Redemption_Expired_Date_Ok() + { + originalRepoAccount.Status = "O4R"; + recoveryCase.RepoStatus = RepoStatus.REPO; + var slip = new RepoAccountProcessingSlip() + { + RecoveryAccount = recoveryAccount, + ExistingRepoAccount = originalRepoAccount, + RecoveryCase = recoveryCase, + CurrentSettings = settings, + Loan = loanDetail, + Letters = new List(), + RequestedBy = new ProcessingItem() + { + AccountNo = recoveryAccount.AccountIdentifier, + QueuedBy = "Tester" + } + }; + slip.AssertReadyForFullProcessing(); + + var updatedRepoAccount = + _repoAccountProcessorService.UpdateRepoAccountFromParts(slip); + Assert.Equal("REPO", updatedRepoAccount.Status); + _repoAccountProcessorService.CheckForRejectedStatusChange(originalRepoAccount, updatedRepoAccount, + settings); + Assert.Equal("REPO", updatedRepoAccount.Status); + Assert.Equal(DateTime.Parse("2015-05-09"), updatedRepoAccount.RedemptionExpiredDate); + } + + [Fact] + public void Status_CoMpARe_Test() + { + Assert.NotNull(_repoAccountProcessorService); + var repoAccount = new RepoAccount() + { + Status = "o4r" + }; + Assert.False(_repoAccountProcessorService.IsStatusMatch(null, "repo")); + Assert.False(_repoAccountProcessorService.IsStatusMatch(repoAccount, "repo")); + Assert.False(_repoAccountProcessorService.IsStatusMatch(repoAccount, "Repo")); + Assert.True(_repoAccountProcessorService.IsStatusMatch(repoAccount, "o4r")); + Assert.True(_repoAccountProcessorService.IsStatusMatch(repoAccount, "O4r")); + Assert.True(_repoAccountProcessorService.IsStatusMatch(repoAccount, "O4r ")); + Assert.True(_repoAccountProcessorService.IsStatusMatch(repoAccount, " o4R ")); + } + + [Fact] + public void UpdateRepo_From_REDEM_Test() + { + Assert.NotNull(_repoAccountProcessorService); + var temenosAccount = new TemenosAccount() + { + AccountNumber = "123456-789", + DateFirstDelinquent = "11/5/2018 12:00:00 AM", + DateLastPaid = "11/4/2018 12:00:00 AM", + AccountTypeId = 1007, + AccountType = new RepoAccountType() + { + Id = 1007, + Code = "LP1", + Description = "Testlp1" + } + }; + var temenosCase = new TemenosCase() + { + RepoStatus = RepoStatus.REDEEMED + }; + var repoAccount = new RepoAccount() + { + RepoId = 1, + Status = "o4r", + AccountNo = "123456-999", + Collaterals = new List() + { + new Collateral() + { + RepoId = 1, + RepoCompanySelections = new List() + { + new RepoCompanySelection() + { + DateTimeCreated = DateTime.Now.Subtract(TimeSpan.FromDays(7)), + RepoType = RepoType.Involuntary, + CollateralId = 1, + Id = 1, + RepoCompanyId = 4, + RepoCompanyAssignmentDate = DateTime.Now.Subtract(TimeSpan.FromDays(7)) + } + } + } + } + }; + var slip = new RepoAccountProcessingSlip() + { + RecoveryAccount = temenosAccount, + ExistingRepoAccount = repoAccount, + RecoveryCase = temenosCase, + Loan = loanDetail, + CurrentSettings = settings, + Letters = new List(), + RequestedBy = new ProcessingItem() + { + AccountNo = recoveryAccount.AccountIdentifier, + QueuedBy = "Tester" + } + }; + slip.AssertReadyForFullProcessing(); + + var result = _repoAccountProcessorService.UpdateRepoAccountFromParts(slip); + Assert.Equal("REDEEMED", result.Status); + Assert.Equal("123456-999", result.AccountNo); + } + + [Fact] + public void Update_With_REPO_Status_Four_Days_Does_Not_Close_Account() + { + Assert.NotNull(_repoAccountProcessorService); + var repo = new RepoAccount() + { + RepoId = 5, + AccountNo = "1234567-98", + Status = "REPO", + RepoStatusChanges = new List + { + new RepoStatusChange + { + StatusFrom = "O4R", + StatusTo = "REPO", + ChangedDate = DateTime.Now.AddDays(-4) + } + } + }; + + _repoAccountProcessorService.UpdateRepoAccountDateClosed(repo); + _mockEventAlertService.Verify(x => x.MarkAllAsRead(It.IsAny()), Times.Never()); + + Assert.Null(repo.DateClosed); + } + + [Fact] + public void Update_With_PSKP_Status_Four_Days_Closes_Account() + { + Assert.NotNull(_repoAccountProcessorService); + var repo = new RepoAccount() + { + RepoId = 5, + AccountNo = "1234567-98", + Status = "PSKP", + RepoStatusChanges = new List + { + new RepoStatusChange + { + StatusFrom = "O4R", + StatusTo = "PSKP", + ChangedDate = DateTime.Now.AddDays(-4) + } + } + }; + + _repoAccountProcessorService.UpdateRepoAccountDateClosed(repo); + _mockEventAlertService.Verify(x => x.MarkAllAsRead(It.IsAny()), Times.Once()); + + Assert.NotNull(repo.DateClosed); + } + + [Fact] + public void Update_With_REDEEMED_Status_Four_Days_Closes_Account() + { + Assert.NotNull(_repoAccountProcessorService); + var repo = new RepoAccount() + { + RepoId = 5, + AccountNo = "1234567-98", + Status = "REDEEMED", + RepoStatusChanges = new List + { + new RepoStatusChange + { + StatusFrom = "REPO", + StatusTo = "REDEEMED", + ChangedDate = DateTime.Now.AddDays(-4) + } + } + }; + + _repoAccountProcessorService.UpdateRepoAccountDateClosed(repo); + _mockEventAlertService.Verify(x => x.MarkAllAsRead(It.IsAny()), Times.Once()); + + Assert.NotNull(repo.DateClosed); + } + + [Fact] + public void Update_With_REDEEMED_Three_Days_Does_Not_Force_Close_Account() + { + Assert.NotNull(_repoAccountProcessorService); + var repo = new RepoAccount() + { + RepoId = 5, + AccountNo = "1234567-98", + Status = "REDEEMED", + RepoStatusChanges = new List + { + new RepoStatusChange + { + StatusFrom = "REPO", + StatusTo = "REDEEMED", + ChangedDate = DateTime.Now.AddDays(-3) + } + } + }; + + _repoAccountProcessorService.UpdateRepoAccountDateClosed(repo); + _mockEventAlertService.Verify(x => x.MarkAllAsRead(It.IsAny()), Times.Never()); + + Assert.Null(repo.DateClosed); + } + + [Fact] + public void TryUpdateCollateralRetitleDate_OK() + { + var ogAccount = originalRepoAccount; + _repoAccountProcessorService.TryUpdateCollateralRetitleDate(ogAccount, recoveryCase); + + Assert.All(ogAccount.Collaterals, collateral => + { + Assert.Equal(DateTime.Parse("8/12/2020 12:00:00 AM"), collateral.RetitledInLandmarkName); + Assert.Equal(new DateTime(637327872000000000), collateral.RetitledInLandmarkName); + }); + } + + [Fact] + public void TryUpdateCollateralRetitleDate_MissingFields() + { + var ogAccount = originalRepoAccount; + var temenosCase = new TemenosCase() + { + CaseId = 997, + RepoStatus = RepoStatus.O4R, + CreatedDate = DateTime.Today, + }; + + _repoAccountProcessorService.TryUpdateCollateralRetitleDate(ogAccount, temenosCase); + + Assert.All(ogAccount.Collaterals, collateral => { Assert.Null(collateral.RetitledInLandmarkName); }); + } + + [Fact] + public void TryUpdateCollateralRetitleDate_NullDate() + { + var ogAccount = originalRepoAccount; + var temenoseCase = recoveryCase; + temenoseCase.TitleOrdered = true; + temenoseCase.TitleOrderedDate = null; + _repoAccountProcessorService.TryUpdateCollateralRetitleDate(ogAccount, temenoseCase); + + Assert.All(ogAccount.Collaterals, collateral => { Assert.Null(collateral.RetitledInLandmarkName); }); + } + + [Fact] + public void TryUpdateCollateralRetitleDate_TitleOrderedFalse() + { + var ogAccount = originalRepoAccount; + var temenosCase = recoveryCase; + temenosCase.TitleOrdered = false; + _repoAccountProcessorService.TryUpdateCollateralRetitleDate(ogAccount, temenosCase); + + Assert.All(ogAccount.Collaterals, collateral => { Assert.Null(collateral.RetitledInLandmarkName); }); + } + + [Fact] + public void MapRepoAgentIdToRepoCompanyId_OK() + { + var repoCompanies = new List(); + repoCompanies.Add(new RepoCompany() + { + ID = 5, + ReferenceId = 555 + }); + repoCompanies.Add(new RepoCompany() + { + ID = 3, + ReferenceId = 333 + }); + + Assert.Equal(5, _repoAccountProcessorService.MapRepoAgentIdToRepoCompanyId("555", repoCompanies)); + Assert.Equal(3, _repoAccountProcessorService.MapRepoAgentIdToRepoCompanyId("333", repoCompanies)); + } + + [Fact] + public void MapRepoAgentIdToRepoCompanyId_Returns_Null_If_No_Map() + { + var repoCompanies = new List(); + repoCompanies.Add(new RepoCompany() + { + ID = 5, + ReferenceId = 555 + }); + repoCompanies.Add(new RepoCompany() + { + ID = 3, + ReferenceId = 333 + }); + + Assert.Throws(() => { _repoAccountProcessorService.MapRepoAgentIdToRepoCompanyId("777", new List()); }); + } + + [Fact] + public void MapRepoAgentIdToRepoCompanyId_Throws_If_Empty_List() + { + Assert.Throws(() => { _repoAccountProcessorService.MapRepoAgentIdToRepoCompanyId("777", new List()); }); + } + + [Fact] + public void CreateNewRepoCompanyAssignment_OK() + { + var collateral = new Collateral() + { + CollateralId = 4, + RepoCompanySelections = new List() + }; + + var temenosCase = new TemenosCase() + { + RepoAgentId = "555", + RepoType = RepoType.Voluntary, + DateRepossessed = DateTime.Parse("2020-02-10"), + DateRepoAssigned = DateTime.Parse("2015-02-10") + }; + var results = _repoAccountProcessorService.CreateNewRepoCompanyAssignment(collateral, temenosCase, 123); + Assert.NotNull(results); + Assert.Equal(4, results.CollateralId); + Assert.Equal(RepoType.Voluntary, results.RepoType); + Assert.Equal(DateTime.Parse("2020-02-10"), results.DateRepoed); + Assert.Equal(DateTime.Parse("2015-02-10"), results.RepoCompanyAssignmentDate); + } + + [Fact] + public void CreateNewRepoCompanyAssignment_No_DateReposessed() + { + var collateral = new Collateral() + { + CollateralId = 4, + RepoCompanySelections = new List() + }; + + var temenosCase = new TemenosCase() + { + RepoAgentId = "555", + RepoType = RepoType.Voluntary, + DateRepossessed = null, + DateRepoAssigned = DateTime.Parse("2015-02-10") + }; + var results = _repoAccountProcessorService.CreateNewRepoCompanyAssignment(collateral, temenosCase, 123); + Assert.NotNull(results); + Assert.Equal(4, results.CollateralId); + Assert.Equal(RepoType.Voluntary, results.RepoType); + Assert.Null(results.DateRepoed); + Assert.Equal(DateTime.Parse("2015-02-10"), results.RepoCompanyAssignmentDate); + } + + [Fact] + public void CreateNewRepoCompanyAssignment_Defaults_Null_RepoType() + { + var collateral = new Collateral() + { + CollateralId = 4, + RepoCompanySelections = new List() + }; + + var temenosCase = new TemenosCase() + { + RepoAgentId = "555", + RepoType = null, + DateRepossessed = null, + DateRepoAssigned = DateTime.Parse("2015-02-10") + }; + var results = _repoAccountProcessorService.CreateNewRepoCompanyAssignment(collateral, temenosCase, 123); + Assert.NotNull(results); + Assert.Equal(4, results.CollateralId); + Assert.Equal(RepoType.Unknown, results.RepoType); + Assert.Null(results.DateRepoed); + Assert.Equal(DateTime.Parse("2015-02-10"), results.RepoCompanyAssignmentDate); + } + + [Fact] + public void TryUpdateOrCreateRepoCompanyAssignment_OK_No_Existing_Assignment_TemenosHasData() + { + var temenosCase = new TemenosCase() + { + RepoAgentId = "333", + DateRepossessed = null, + RepoType = RepoType.Voluntary, + DateRepoAssigned = DateTime.Parse("2015-02-10") + }; + + ICollection collaterals = new[] + { + new Collateral() + { + CollateralId = 0, + RepoCompanySelections = new List() + }, + new Collateral() + { + CollateralId = 1, + RepoCompanySelections = new List() + } + }; + + var settings = new Settings() + { + RepoCompanies = new RepoCompany[] + { + new RepoCompany + { + ID = 3, + ReferenceId = 333 + }, + new RepoCompany + { + ID = 5, + ReferenceId = 555 + } + } + }; + + var repoAccount = new RepoAccount() + { + Collaterals = collaterals + }; + + _repoAccountProcessorService.TryUpdateOrCreateRepoCompanyAssignment(repoAccount, temenosCase, settings); + Assert.All(repoAccount.Collaterals, collateral => { Assert.Single(collateral.RepoCompanySelections); }); + } + + [Fact] + public void TryUpdateOrCreateRepoCompanyAssignment_OK_No_Existing_Assignment_NoTemenosData() + { + var temenosCase = new TemenosCase() + { + }; + + ICollection collaterals = new[] + { + new Collateral() + { + CollateralId = 0, + RepoCompanySelections = new List() + }, + new Collateral() + { + CollateralId = 1, + RepoCompanySelections = new List() + } + }; + + var settings = new Settings() + { + RepoCompanies = new RepoCompany[] + { + new RepoCompany + { + ID = 3, + ReferenceId = 333 + }, + new RepoCompany + { + ID = 5, + ReferenceId = 555 + } + } + }; + + var repoAccount = new RepoAccount() + { + Collaterals = collaterals + }; + + _repoAccountProcessorService.TryUpdateOrCreateRepoCompanyAssignment(repoAccount, temenosCase, settings); + Assert.All(repoAccount.Collaterals, collateral => { Assert.Empty(collateral.RepoCompanySelections); }); + } + + [Fact] + public void TryUpdateOrCreateRepoCompanyAssignment_NoUpdateWhenDataSame() + { + var temenosCase = new TemenosCase() + { + RepoAgentId = "333", + DateRepossessed = null, + RepoType = RepoType.Voluntary, + DateRepoAssigned = DateTime.Parse("2015-02-10") + }; + + var companyForCollateral = new RepoCompanySelection() + { + RepoType = RepoType.Voluntary, + RepoCompanyId = 3, + DateRepoed = null, + RepoCompanyAssignmentDate = DateTime.Parse("2015-02-10") + }; + + ICollection collaterals = new[] + { + new Collateral() + { + CollateralId = 0, + RepoCompanySelections = new List + { + companyForCollateral + } + } + }; + + var settings = new Settings() + { + RepoCompanies = new RepoCompany[] + { + new RepoCompany + { + ID = 3, + ReferenceId = 333 + }, + new RepoCompany + { + ID = 5, + ReferenceId = 555 + } + } + }; + + var repoAccount = new RepoAccount() + { + Collaterals = collaterals + }; + + _repoAccountProcessorService.TryUpdateOrCreateRepoCompanyAssignment(repoAccount, temenosCase, settings); + Assert.All(repoAccount.Collaterals, collateral => + { + var repoCompany = collateral.RepoCompanySelections.Single(); + Assert.Equal(companyForCollateral, repoCompany); + }); + } + + [Fact] + public void TryUpdateOrCreateRepoCompanyAssignment_Update_Ok() + { + var temenosCase = new TemenosCase() + { + RepoAgentId = "333", + DateRepossessed = DateTime.Parse("2020-02-10"), + RepoType = RepoType.Voluntary, + DateRepoAssigned = DateTime.Parse("2015-02-10"), + }; + + var companyForCollateral = new RepoCompanySelection() + { + RepoType = RepoType.Voluntary, + RepoCompanyId = 3, + DateRepoed = null, + RepoCompanyAssignmentDate = DateTime.Parse("2015-02-10") + }; + + ICollection collaterals = new[] + { + new Collateral() + { + CollateralId = 0, + RepoCompanySelections = new List + { + companyForCollateral + } + } + }; + + var settings = new Settings() + { + RepoCompanies = new RepoCompany[] + { + new RepoCompany + { + ID = 3, + ReferenceId = 333 + }, + new RepoCompany + { + ID = 5, + ReferenceId = 555 + } + } + }; + + var repoAccount = new RepoAccount() + { + Collaterals = collaterals + }; + + _repoAccountProcessorService.TryUpdateOrCreateRepoCompanyAssignment(repoAccount, temenosCase, settings); + Assert.All(repoAccount.Collaterals, collateral => + { + var repoCompany = collateral.RepoCompanySelections.Single(); + Assert.Equal(DateTime.Parse("2020-02-10"), repoCompany.DateRepoed); + }); + } + + [Fact] + public void TryUpdateOrCreateRepoCompanyAssignment_Missing_RepoCompanyAssignmentDate() + { + var temenosCase = new TemenosCase() + { + RepoAgentId = "333", + DateRepossessed = DateTime.Parse("2020-02-10"), + RepoType = RepoType.Voluntary, + DateRepoAssigned = null, + }; + + var companyForCollateral = new RepoCompanySelection() + { + RepoType = RepoType.Voluntary, + RepoCompanyId = 3, + DateRepoed = null, + RepoCompanyAssignmentDate = null + }; + + ICollection collaterals = new[] + { + new Collateral() + { + CollateralId = 0, + RepoCompanySelections = new List + { + companyForCollateral + } + } + }; + + var settings = new Settings() + { + RepoCompanies = new RepoCompany[] + { + new RepoCompany + { + ID = 3, + ReferenceId = 333 + }, + new RepoCompany + { + ID = 5, + ReferenceId = 555 + } + } + }; + + var repoAccount = new RepoAccount() + { + Collaterals = collaterals + }; + + Assert.Throws(() => + _repoAccountProcessorService.TryUpdateOrCreateRepoCompanyAssignment(repoAccount, temenosCase, settings)); + } + + [Fact] + public void TryUpdateOrCreateRepoCompanyAssignment_Handles_RepoAgentID_Empty_String() + { + var temenosCase = new TemenosCase() + { + RepoAgentId = "", + DateRepossessed = DateTime.Parse("2020-02-10"), + RepoType = RepoType.Voluntary, + DateRepoAssigned = DateTime.Parse("2015-02-10"), + }; + + var companyForCollateral = new RepoCompanySelection() + { + RepoType = RepoType.Voluntary, + RepoCompanyId = 3, + DateRepoed = null, + RepoCompanyAssignmentDate = DateTime.Parse("2015-02-10") + }; + + ICollection collaterals = new[] + { + new Collateral() + { + CollateralId = 0, + RepoCompanySelections = new List + { + companyForCollateral + } + } + }; + + var settings = new Settings() + { + RepoCompanies = new RepoCompany[] + { + new RepoCompany + { + ID = 3, + ReferenceId = 333 + }, + new RepoCompany + { + ID = 5, + ReferenceId = 555 + } + } + }; + + var repoAccount = new RepoAccount() + { + Collaterals = collaterals + }; + + _repoAccountProcessorService.TryUpdateOrCreateRepoCompanyAssignment(repoAccount, temenosCase, settings); + + Assert.All((repoAccount.Collaterals), (collateral => + { + Assert.Equal(2, collateral.RepoCompanySelections.Count); + Assert.Contains(collateral.RepoCompanySelections, + selection => selection.DateRepoed == DateTime.Today || + selection.DateRepoed == DateTime.Parse("2020-02-10")); + })); + } + + [Fact] + public void TryUpdateOrCreateRepoCompanyAssignment_Create_OK() + { + var temenosCase = new TemenosCase() + { + RepoAgentId = "555", + DateRepossessed = null, + RepoType = RepoType.Skip, + DateRepoAssigned = DateTime.Parse("2015-02-10"), + }; + + var companyForCollateral = new RepoCompanySelection() + { + RepoType = RepoType.Voluntary, + RepoCompanyId = 3, + DateRepoed = null, + RepoCompanyAssignmentDate = DateTime.Parse("2015-02-10") + }; + + ICollection collaterals = new[] + { + new Collateral() + { + CollateralId = 0, + RepoCompanySelections = new List + { + companyForCollateral + } + } + }; + + var settings = new Settings() + { + RepoCompanies = new RepoCompany[] + { + new RepoCompany + { + ID = 3, + ReferenceId = 333 + }, + new RepoCompany + { + ID = 5, + ReferenceId = 555 + } + } + }; + + var repoAccount = new RepoAccount() + { + Collaterals = collaterals + }; + + _repoAccountProcessorService.TryUpdateOrCreateRepoCompanyAssignment(repoAccount, temenosCase, settings); + Assert.All(repoAccount.Collaterals, collateral => + { + Assert.Equal(2, collateral.RepoCompanySelections.Count); + Assert.Equal(5, + collateral.RepoCompanySelections.OrderByDescending(x => x.DateTimeCreated).First().RepoCompanyId); + Assert.Equal(3, + collateral.RepoCompanySelections.OrderByDescending(x => x.DateTimeCreated).ToList()[1] + .RepoCompanyId); + //SHOULD MARK PREVIOUS MOST RECENT ENTRY WITH A DateRepoed! + Assert.NotNull(collateral.RepoCompanySelections.OrderByDescending(x => x.DateTimeCreated).ToList()[1] + .DateRepoed); + Assert.NotNull(collateral.RepoCompanySelections.OrderByDescending(x => x.DateTimeCreated).ToList()[1] + .RepoCompanyAssignmentDate); + }); + } + + [Fact] + public void TryUpdateOrCreateRepoCompanyAssignment_Create_OK_Missing_BOTH_Dates() + { + var temenosCase = new TemenosCase() + { + RepoAgentId = "555", + DateRepossessed = null, + RepoType = RepoType.Skip, + DateRepoAssigned = DateTime.Parse("2015-02-10"), + }; + + // So, both DateRepoed and RepoCompanyAssignmentDate are null. GJF 256 rows like this in prod. + var companyForCollateral = new RepoCompanySelection() + { + RepoType = RepoType.Voluntary, + RepoCompanyId = 3, + DateRepoed = null, + RepoCompanyAssignmentDate = null, + DateTimeCreated = DateTime.Parse("2015-02-10"), + }; + + ICollection collaterals = new[] + { + new Collateral() + { + CollateralId = 0, + RepoCompanySelections = new List + { + companyForCollateral + } + } + }; + + var settings = new Settings() + { + RepoCompanies = new RepoCompany[] + { + new RepoCompany + { + ID = 3, + ReferenceId = 333 + }, + new RepoCompany + { + ID = 5, + ReferenceId = 555 + } + } + }; + + var repoAccount = new RepoAccount() + { + Collaterals = collaterals + }; + + _repoAccountProcessorService.TryUpdateOrCreateRepoCompanyAssignment(repoAccount, temenosCase, settings); + Assert.All(repoAccount.Collaterals, collateral => + { + Assert.Equal(2, collateral.RepoCompanySelections.Count); + Assert.Equal(5, + collateral.RepoCompanySelections.OrderByDescending(x => x.DateTimeCreated).First().RepoCompanyId); + Assert.Equal(3, + collateral.RepoCompanySelections.OrderByDescending(x => x.DateTimeCreated).ToList()[1] + .RepoCompanyId); + //SHOULD MARK PREVIOUS MOST RECENT ENTRY WITH A DateRepoed! + Assert.NotNull(collateral.RepoCompanySelections.OrderByDescending(x => x.DateTimeCreated).ToList()[1] + .DateRepoed); + Assert.NotNull(collateral.RepoCompanySelections.OrderByDescending(x => x.DateTimeCreated).ToList()[1] + .RepoCompanyAssignmentDate); + }); + } + + + [Fact] + public void UpdateOrCreateRepoCompanyAssignment_Update_Ok() + { + var temenosCase = new TemenosCase() + { + RepoAgentId = "333", + DateRepossessed = DateTime.Parse("2020-02-10"), + RepoType = RepoType.Involuntary, + DateRepoAssigned = DateTime.Parse("2018-02-10"), + }; + + var companyForCollateral = new RepoCompanySelection() + { + RepoType = RepoType.Voluntary, + RepoCompanyId = 3, + DateRepoed = null, + RepoCompanyAssignmentDate = DateTime.Parse("2015-02-10") + }; + + + var collateral = new Collateral() + { + CollateralId = 0, + RepoCompanySelections = new List + { + companyForCollateral + } + }; + + var updates = _repoAccountProcessorService.UpdateOrCreateRepoCompanyAssignment(collateral, companyForCollateral, temenosCase, 3); + Assert.Equal(2, updates.Count); + updates = updates.OrderByDescending(x => x.DateRepoed).ToList(); + Assert.Equal(temenosCase.RepoType, updates[1].RepoType); + Assert.Equal(temenosCase.DateRepoAssigned, updates[1].RepoCompanyAssignmentDate); + Assert.Equal(temenosCase.DateRepossessed, updates[1].DateRepoed); + + Assert.Equal(companyForCollateral.RepoType, updates[0].RepoType); + Assert.Equal(companyForCollateral.RepoCompanyAssignmentDate, updates[0].RepoCompanyAssignmentDate); + Assert.Contains(DateTime.Today.ToShortDateString().ToString(CultureInfo.InvariantCulture), updates[0].DateRepoed.ToString()); + + Assert.Equal(updates[0], collateral.RepoCompanySelections.OrderByDescending(x => x.DateRepoed).ToList()[0]); + } + + [Fact] + public void UpdateOrCreateRepoCompanyAssignment_No_Update_Ok() + { + var temenosCase = new TemenosCase() + { + RepoAgentId = "333", + DateRepossessed = DateTime.Parse("12-31-2021"), + RepoType = RepoType.Voluntary, + DateRepoAssigned = DateTime.Parse("2015-02-10") + }; + + var companyForCollateral = new RepoCompanySelection() + { + RepoType = RepoType.Voluntary, + RepoCompanyId = 3, + DateRepoed = null, + RepoCompanyAssignmentDate = DateTime.Parse("2015-02-10") + }; + + + var collateral = new Collateral() + { + CollateralId = 0, + RepoCompanySelections = new List + { + companyForCollateral + } + }; + + var updates = _repoAccountProcessorService.UpdateOrCreateRepoCompanyAssignment(collateral, companyForCollateral, temenosCase, 3); + Assert.Single(updates); + Assert.Equal(DateTime.Parse("12-31-2021"), updates.Single().DateRepoed); + Assert.Equal(collateral.RepoCompanySelections, updates); + } + + [Fact] + public void UpdateOrCreateRepoCompanyAssignment_No_Selections_New_Data() + { + var temenosCase = new TemenosCase() + { + RepoAgentId = "333", + DateRepossessed = DateTime.Parse("12-31-2021"), + RepoType = RepoType.Voluntary, + DateRepoAssigned = DateTime.Parse("2015-02-10") + }; + + var collateral = new Collateral() + { + CollateralId = 0, + RepoCompanySelections = new List() + }; + + var updates = _repoAccountProcessorService.UpdateOrCreateRepoCompanyAssignment(collateral, null, temenosCase, 3); + Assert.Single(updates); + Assert.Single(collateral.RepoCompanySelections); + + Assert.Equal(updates, collateral.RepoCompanySelections); + Assert.Equal(3, updates.Single().RepoCompanyId); + Assert.Equal(DateTime.Parse("12-31-2021"), updates.Single().DateRepoed); + Assert.Equal(DateTime.Parse("2015-02-10"), updates.Single().RepoCompanyAssignmentDate); + Assert.Equal(RepoType.Voluntary, updates.Single().RepoType); + } + + [Fact] + public void UpdateOrCreateRepoCompanyAssignment_No_Selections_No_Fields() + { + var temenosCase = new TemenosCase(); + + + var collateral = new Collateral() + { + CollateralId = 0, + RepoCompanySelections = new List() + }; + + var updates = _repoAccountProcessorService.UpdateOrCreateRepoCompanyAssignment(collateral, null, temenosCase, null); + Assert.Empty(updates); + Assert.Empty(collateral.RepoCompanySelections); + } + + [Fact] + public void GetDateTimeFromString_Ok() + { + var dateString = "2015-02-10"; + var result = _repoAccountProcessorService.GetDateTimeFromString(dateString); + Assert.True(result.IsSuccess); + Assert.Equal(new DateTime(2015, 02, 10), result.Value); + Assert.Null(result.ErrorMessage); + + dateString = ""; + result = _repoAccountProcessorService.GetDateTimeFromString(dateString); + Assert.False(result.IsSuccess); + Assert.Null(result.Value); + Assert.Equal("Cannot Parse Empty Date String", result.ErrorMessage); + + dateString = "¯\\_(ツ)_/¯"; + result = _repoAccountProcessorService.GetDateTimeFromString(dateString); + Assert.False(result.IsSuccess); + Assert.Null(result.Value); + Assert.Equal("There was an Exception when processing the date string: ¯\\_(ツ)_/¯", result.ErrorMessage); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/Processor/RepoAccountProcessorTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/Processor/RepoAccountProcessorTest.cs new file mode 100644 index 0000000..ac89d58 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/Processor/RepoAccountProcessorTest.cs @@ -0,0 +1,650 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Threading.Tasks; +using LCU.API.Collections.CollectionsApiLib.Models; +using LCU.API.Collections.RepoApi.DataAccess; +using LCU.API.Collections.RepoApi.Domain.Extensions; +using LCU.API.Collections.RepoApi.Domain.Processing; +using LCU.API.Collections.RepoApi.Exceptions; +using LCU.API.Collections.RepoApi.Models; +using LCU.API.Collections.RepoApi.Services; +using LCU.API.Collections.RepoApi.Services.Producer; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.Consumer; +using LCU.Shared.Collections.RepoApiLib.Models.Producer; +using LCU.Shared.Collections.RepoApiLib.Models.Settings; +using Moq; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.Services.Processor +{ + public class RepoAccountProcessorTest + { + private readonly RepoAccountProcessor _repoAccountProcessor; + private readonly Mock _mockRepoAccountProcessorService; + private readonly Mock _mockAccountAlertCheckService; + private readonly Mock _mockSettingsService; + private readonly Mock _mockRepoAccountService; + private readonly Mock _mockCollectionsDao; + private readonly Mock _mockCoreDao; + private readonly Mock _mockRepoLetterService; + private readonly Mock _mockEmailer; + private readonly Mock _mockAuctionAssignmentService; + + public RepoAccountProcessorTest() + { + _mockRepoAccountProcessorService = new Mock(); + _mockAccountAlertCheckService = new Mock(); + _mockSettingsService = new Mock(); + _mockRepoAccountService = new Mock(); + _mockCollectionsDao = new Mock(); + _mockCoreDao = new Mock(); + _mockEmailer = new Mock(); + _mockAuctionAssignmentService = new Mock(); + _mockRepoLetterService = new Mock(); + var repoSettings = DbContextFromJson.GetTestObjectFromFile("Services/Processor/repoSettings.json"); + _mockSettingsService.Setup(x => x.GetCachedRepoSettingsAsync()).ReturnsAsync(repoSettings); + _repoAccountProcessor = new RepoAccountProcessor( + _mockRepoAccountProcessorService.Object, _mockAccountAlertCheckService.Object, _mockCollectionsDao.Object, + _mockEmailer.Object, _mockSettingsService.Object, _mockRepoAccountService.Object, + _mockRepoLetterService.Object, _mockCoreDao.Object, _mockAuctionAssignmentService.Object); + + _mockRepoAccountProcessorService.Setup(mock => mock.TryUpdateCollateralRetitleDate(It.IsAny(), It.IsAny())); + } + + [Fact] + public async Task Basic_Construct_Test() + { + Assert.NotNull(_repoAccountProcessor); + await Assert.ThrowsAsync(() => { return _repoAccountProcessor.HandleAccount(null); }); + } + + [Fact] + public void Verify_AccountNo_Test() + { + Assert.NotNull(_repoAccountProcessor); + Assert.Throws(() => { _repoAccountProcessor.VerifyAccountNo(null); }); + Assert.Throws(() => { _repoAccountProcessor.VerifyAccountNo(new ProcessingItem()); }); + // Assert.Throws(() => { _repoAccountProcessor.VerifyAccountNo(new ProcessingItem() + // { + // AccountNo = "a;sldkfj" + // }); }); + Assert.Equal("123456789", _repoAccountProcessor.VerifyAccountNo(new ProcessingItem() + { + CaseId = "1", + AccountNo = "123456789", + QueuedBy = "tester" + }) ); + } + + [Fact] + public void UnconvertedAccount_HasFallbackField_Test() + { + var temenosAccount = new TemenosAccount() + { + CustomFieldMap = new Dictionary() + }; + temenosAccount.CustomFieldMap.Add(RepoAccountProcessor.UserStatusFieldOld, "REPO"); + var repoAccount = new RepoAccount() + { + RepoId = 5, + Status = "REPO" + }; + var slip = new RepoAccountProcessingSlip() + { + ExistingRepoAccount = repoAccount, + RecoveryAccount = temenosAccount + }; + // repoAccount, temenosAccount, 0, "123456-789" + Assert.True(_repoAccountProcessor.IsUnconvertedIntellectAccount(slip)); + } + + [Fact] + public void UnconvertedAccount_Missing_Test() + { + var temenosAccount = new TemenosAccount() + { + CustomFieldMap = new Dictionary() + }; + temenosAccount.CustomFieldMap.Add(RepoAccountProcessor.UserStatusFieldOld, "REPO"); + var repoAccount = new RepoAccount() + { + RepoId = 5, + Status = "REPO" + }; + var slip = new RepoAccountProcessingSlip() + { + ExistingRepoAccount = repoAccount, + RecoveryAccount = null + }; + // repoAccount, temenosAccount, 0, "123456-789" + var result = _repoAccountProcessor.IsUnconvertedIntellectAccount(slip); + Assert.False(result); + } + + [Fact] + public void UnconvertedAccount_NoFallbackfield_Test() + { + var temenosAccount = new TemenosAccount() + { + AccountIdentifier = "123456-789" + }; + var repoAccount = new RepoAccount() + { + RepoId = 5, + Status = "REPO" + }; + var slip = new RepoAccountProcessingSlip() + { + ExistingRepoAccount = repoAccount, + RecoveryAccount = temenosAccount + }; + Assert.False(_repoAccountProcessor.IsUnconvertedIntellectAccount(slip)); + + temenosAccount.CustomFieldMap = new Dictionary(); + Assert.False(_repoAccountProcessor.IsUnconvertedIntellectAccount(slip)); + } + + [Fact] + public void ShouldCreateNew_Test() + { + var slip = new RepoAccountProcessingSlip(); + Assert.NotNull(_repoAccountProcessor); + Assert.False(_repoAccountProcessor.ShouldCreateNewAccount(null)); + Assert.True(_repoAccountProcessor.ShouldCreateNewAccount(slip)); + slip.ExistingRepoAccount = new RepoAccount(); + Assert.False(_repoAccountProcessor.ShouldCreateNewAccount(slip)); + slip.ExistingRepoAccount = new RepoAccount() + { + DateClosed = DateTime.Today + }; + Assert.True(_repoAccountProcessor.ShouldCreateNewAccount(slip)); + } + + [Fact] + public void Should_Run_Complete_Update_Test() + { + var temenosCase = new TemenosCase(); + var temenosAccount = new TemenosAccount(); + var repoAccount = new RepoAccount(); + var slip = new RepoAccountProcessingSlip(); + Assert.NotNull(_repoAccountProcessor); + Assert.Throws(() => { _repoAccountProcessor.ShouldRunCompleteUpdate(slip); }); + + slip.RecoveryAccount = temenosAccount; + slip.RecoveryCase = temenosCase; + slip.ExistingRepoAccount = repoAccount; + + temenosCase.RepoStatus = RepoStatus.REPO; + repoAccount.Status = "O4R"; + repoAccount.Balance = 1; + temenosAccount.Balance = 2; + Assert.True( _repoAccountProcessor.ShouldRunCompleteUpdate(slip)); + + temenosCase.RepoStatus = RepoStatus.O4R; + repoAccount.Status = "O4R"; + repoAccount.Balance = 1; + temenosAccount.Balance = 2; + Assert.True( _repoAccountProcessor.ShouldRunCompleteUpdate(slip)); + + temenosCase.RepoStatus = RepoStatus.O4R; + repoAccount.Status = "O4R"; + repoAccount.Balance = 1; + temenosAccount.Balance = 1; + repoAccount.ReferenceStatus = "Open"; + temenosAccount.AccountStatus = "Open"; + Assert.False( _repoAccountProcessor.ShouldRunCompleteUpdate(slip)); + + temenosCase.RepoStatus = RepoStatus.O4R; + repoAccount.Status = "O4R"; + repoAccount.Balance = 1; + temenosAccount.Balance = 1; + repoAccount.ReferenceStatus = "Open"; + temenosAccount.AccountStatus = "Written Off"; + Assert.True( _repoAccountProcessor.ShouldRunCompleteUpdate(slip)); + } + + [Theory] + [CollectionsJsonFileData("test_accounts.json", "newAccounts04R")] + public async Task New_Accounts_04R(RepoUpdateTestRow row) + { + // Setup + _mockCollectionsDao.Setup(x => x.RetrieveAccountAsync(It.IsAny())) + .ReturnsAsync(row.CollectionAccount); + _mockRepoAccountService.Setup(x => x.GetNewestOpenAccount(row.CollectionAccount.AccountIdentifier)) + .ReturnsAsync(row.ExistingRepoAccount); + _mockRepoAccountProcessorService.Setup(service => service.CreateRepoAccount(It.IsAny(), It.IsAny(), It.IsAny())) + .Returns(row.NewRepoAccount); + _mockRepoAccountService.Setup(service => service.SaveAsync(It.IsAny())) + .ReturnsAsync(row.NewRepoAccount); + _mockRepoLetterService.Setup(service => service.ListByAccountIdAsync(It.IsAny())) + .ReturnsAsync(new List()); + _mockCoreDao.Setup(service => service.RetrieveTransactionsAsync(It.IsAny())).ReturnsAsync( + new List()); + _mockCoreDao.Setup(service => service.RetrieveMemberAsync(It.IsAny())).ReturnsAsync( + new MemberDetail()); + _mockCoreDao.Setup(service => service.RetrieveLoanAsync(It.IsAny())).ReturnsAsync( + new LoanDetail()); + _mockAuctionAssignmentService + .Setup(service => service.GetListByIdsAsync(It.IsAny>())).ReturnsAsync( + new LinkedList()); + _mockAccountAlertCheckService.Setup(service => service.AlertChecksPrimary(It.IsAny())) + .Returns(Task.FromResult(null)).Verifiable(); + + // Run, don't provide collections account so it loads it... + var result = await _repoAccountProcessor.HandleAccount(new ProcessingItem() + { + AccountNo = row.CollectionAccount.AccountIdentifier, + CaseId = $"{row.CollectionCase.CaseId}" + }); + + // Verify. + _mockRepoAccountService.VerifyAll(); + _mockAccountAlertCheckService.VerifyAll(); + Assert.Equal(RepoProcessingResult.Created, result); + } + + [Theory] + [CollectionsJsonFileData("test_accounts.json", "existingAccounts04R")] + public async Task Existing_Accounts_04R(RepoUpdateTestRow row) + { + // Setup + _mockCollectionsDao.Setup(x => x.RetrieveAccountAsync(It.IsAny())) + .ReturnsAsync(row.CollectionAccount); + _mockRepoAccountService.Setup(x => x.GetNewestOpenAccount(row.CollectionAccount.AccountIdentifier)) + .ReturnsAsync(row.ExistingRepoAccount); + _mockRepoAccountProcessorService.Setup(service => service.UpdateRepoAccountFromParts( It.IsAny())) + .Returns(row.NewRepoAccount); + _mockRepoAccountService.Setup(service => service.UpdateAsync(It.IsAny(), It.IsAny())) + .ReturnsAsync(row.NewRepoAccount); + _mockRepoLetterService.Setup(service => service.ListByAccountIdAsync(It.IsAny())) + .ReturnsAsync(new List()); + _mockCoreDao.Setup(service => service.RetrieveTransactionsAsync(It.IsAny())).ReturnsAsync( + new List()); + _mockCoreDao.Setup(service => service.RetrieveMemberAsync(It.IsAny())).ReturnsAsync( + new MemberDetail()); + _mockCoreDao.Setup(service => service.RetrieveLoanAsync(It.IsAny())).ReturnsAsync( + new LoanDetail()); + _mockAuctionAssignmentService + .Setup(service => service.GetListByIdsAsync(It.IsAny>())).ReturnsAsync( + new LinkedList()); + _mockAccountAlertCheckService.Setup(service => service.AlertChecksPrimary(It.IsAny())) + .Returns(Task.FromResult(null)).Verifiable(); + + // Run, don't provide collections account so it loads it... + var result = await _repoAccountProcessor.HandleAccount(new ProcessingItem() + { + AccountNo = row.CollectionAccount.AccountIdentifier, + CaseId = $"{row.CollectionCase.CaseId}" + }); + + // Verify. + Assert.NotEqual(RepoProcessingResult.Error, result); + Assert.NotEqual(RepoProcessingResult.Autoclosed, result); + Assert.NotEqual(RepoProcessingResult.Ineligible, result); + Assert.NotEqual(RepoProcessingResult.Unconverted, result); + Assert.Equal(RepoProcessingResult.Updated, result); + _mockRepoAccountService.VerifyAll(); + _mockAccountAlertCheckService.VerifyAll(); + } + + [Theory] + [CollectionsJsonFileData("test_accounts - RECA.json", "existingAccountsRECA")] + public async Task Existing_Accounts_RECA(RepoUpdateTestRow row) + { + // Setup + _mockCollectionsDao.Setup(x => x.RetrieveAccountAsync(It.IsAny())) + .ReturnsAsync(row.CollectionAccount); + _mockRepoAccountService.Setup(x => x.GetNewestOpenAccount(row.CollectionAccount.AccountIdentifier)) + .ReturnsAsync(row.ExistingRepoAccount); + _mockRepoAccountProcessorService.Setup(service => service.UpdateRepoAccountFromParts(It.IsAny())) + .Returns(row.NewRepoAccount); + _mockRepoAccountService.Setup(service => service.UpdateAsync(It.IsAny(), It.IsAny())) + .ReturnsAsync(row.NewRepoAccount); + _mockRepoLetterService.Setup(service => service.ListByAccountIdAsync(It.IsAny())) + .ReturnsAsync(new List()); + _mockCoreDao.Setup(service => service.RetrieveTransactionsAsync(It.IsAny())).ReturnsAsync( + new List()); + _mockCoreDao.Setup(service => service.RetrieveMemberAsync(It.IsAny())).ReturnsAsync( + new MemberDetail()); + _mockCoreDao.Setup(service => service.RetrieveLoanAsync(It.IsAny())).ReturnsAsync( + new LoanDetail()); + _mockAuctionAssignmentService + .Setup(service => service.GetListByIdsAsync(It.IsAny>())).ReturnsAsync( + new LinkedList()); + + + var result = await _repoAccountProcessor.HandleAccount(new ProcessingItem() + { + AccountNo = row.CollectionAccount.AccountIdentifier, + CaseId = $"{row.CollectionCase.CaseId}" + }); + + + Assert.NotEqual(RepoProcessingResult.Error, result); + Assert.NotEqual(RepoProcessingResult.Autoclosed, result); + Assert.NotEqual(RepoProcessingResult.Ineligible, result); + Assert.NotEqual(RepoProcessingResult.Unconverted, result); + + Assert.Equal(RepoProcessingResult.Updated, result); + + _mockRepoAccountService.VerifyAll(); //should not verify alert checks will exit + + } + + [Fact] + public async Task Update_Account_Existing_Collateral() + { + var testAccount = new TemenosAccount() + { + AccountIdentifier = "123456134", + ActiveFlag = true, + AccountTypeId = 4, // "L ", + Cases = new List() + { + new TemenosCase() + { + CaseId = 999, + RepoStatus = RepoStatus.REPO, + CaseTypeId = 7 + } + } + // UserStatusCode1 = "REPO" + }; + var repoAccount = new RepoAccount() + { + RepoId = 555, + Status = "O4R", + Collaterals = new List() + { + new Collateral() + { + RepoId = 555 + } + } + }; + + _mockCollectionsDao.Setup(x => x.RetrieveAccountAsync(It.IsAny())) + .ReturnsAsync(testAccount); + + _mockRepoAccountService.Setup(x => x.GetNewestOpenAccount(It.IsAny())) + .ReturnsAsync(repoAccount); + + _mockRepoAccountProcessorService + .Setup(service => service.CreateRepoAccount(It.IsAny(), It.IsAny(), It.IsAny())) + .Returns(repoAccount); + + _mockRepoLetterService.Setup(service => service.ListByAccountIdAsync(It.IsAny())) + .ReturnsAsync(new List()); + _mockCoreDao.Setup(service => service.RetrieveTransactionsAsync(It.IsAny())).ReturnsAsync( + new List()); + _mockCoreDao.Setup(service => service.RetrieveMemberAsync(It.IsAny())).ReturnsAsync( + new MemberDetail()); + _mockCoreDao.Setup(service => service.RetrieveLoanAsync(It.IsAny())).ReturnsAsync( + new LoanDetail()); + _mockAuctionAssignmentService + .Setup(service => service.GetListByIdsAsync(It.IsAny>())).ReturnsAsync( + new LinkedList()); + _mockRepoAccountProcessorService.Setup(service => + service.UpdateRepoAccountFromParts(It.IsAny())) + .Returns(repoAccount); + + var result = await _repoAccountProcessor.HandleAccount(new ProcessingItem() + {AccountNo = testAccount.AccountIdentifier, CaseId = "999"}); + _mockRepoAccountProcessorService.Verify(foo => foo.UpdateRepoAccountFromParts(It.IsAny()), Times.Once); + _mockRepoAccountProcessorService.Verify(foo => foo.CreateRepoAccount( It.IsAny(), It.IsAny(), It.IsAny()), Times.Never()); + _mockRepoAccountProcessorService.Verify(mock => mock.TryUpdateCollateralRetitleDate(It.IsAny(), It.IsAny()), Times.Exactly(1)); + Assert.NotNull(_repoAccountProcessor); + Assert.Equal(RepoProcessingResult.Updated, result); + } + //add test + + [Fact] + public async Task Update_Account_No_Collateral() + { + var testAccount = new TemenosAccount() + { + AccountIdentifier = "123456134", + Cases = new List() + { + new TemenosCase() + { + CaseId = 99, + RepoStatus = RepoStatus.O4R, + CaseTypeId = 7 + } + } + }; + + _mockCollectionsDao.Setup(x => x.RetrieveAccountAsync(It.IsAny())) + .ReturnsAsync(testAccount); + _mockRepoAccountService.Setup(x => x.GetNewestOpenAccount(It.IsAny())) + .ReturnsAsync(new RepoAccount() + { + Status = "O4R", + RepoId = 555 /* no collateral! */ + }); + + _mockRepoAccountProcessorService.Setup(service => service.CreateRepoAccount(It.IsAny(), It.IsAny(), It.IsAny())) + .Verifiable("Called create"); + _mockRepoAccountProcessorService.Setup(service => + service.UpdateRepoAccountFromParts(It.IsAny())) + .Verifiable("merge existing"); + _mockRepoLetterService.Setup(service => service.ListByAccountIdAsync(It.IsAny())) + .ReturnsAsync(new List()); + _mockEmailer.Setup(service => service.MaybeSendO4rNoCollateralEmail(It.IsAny())) + .ReturnsAsync(new HttpResponseMessage { StatusCode = HttpStatusCode.OK }).Verifiable("Send e-mail"); + _mockCoreDao.Setup(service => service.RetrieveLoanAsync(It.IsAny())).ReturnsAsync( + new LoanDetail()); + + await Assert.ThrowsAsync(() => _repoAccountProcessor.HandleAccount( + new ProcessingItem() + { + AccountNo = testAccount.AccountIdentifier, + CaseId = $"{testAccount.Cases.First().CaseId}" + })); + _mockRepoAccountProcessorService.Verify(foo => foo.CreateRepoAccount(It.IsAny(), It.IsAny(), It.IsAny()), Times.Never()); + // _mockRepoAccountProcessorService.VerifyAll(); + _mockRepoAccountProcessorService.Verify( + service => service.UpdateRepoAccountFromParts(It.IsAny()), + Times.Never()); + + _mockEmailer.Verify(x => x.MaybeSendO4rNoCollateralEmail(It.IsAny()), Times.Once); + Assert.NotNull(_repoAccountProcessor); + } + + [Fact] + public void Find_Recovery_Case_OK() + { + var testAccount = new TemenosAccount() + { + AccountIdentifier = "123456-134", + Cases = new List() + { + new TemenosCase() + { + CaseId = 99 + } + } + }; + + var temenosCase = testAccount.FindRecoveryCaseOrDefault(99); + Assert.True(testAccount.HasRecoveryCase(99)); + Assert.NotNull(temenosCase); + Assert.Equal(99,temenosCase.CaseId); + } + + [Fact] + public void Find_Recovery_Case_OK_No_Case_Id_No_RepoStatus() + { + var testAccount = new TemenosAccount() + { + AccountIdentifier = "123456-134", + Cases = new List() + { + new TemenosCase() + { + CaseId = 99, + CaseStatusId = 33, + RepoStatus = RepoStatus.UNKNOWN + } + } + }; + + Assert.False(testAccount.HasRecoveryCase(0)); + Assert.False(testAccount.HasRecoveryCase(88)); + } + + [Fact] + public void Find_Recovery_Case_OK_No_Case_Id() + { + var testAccount = new TemenosAccount() + { + AccountIdentifier = "123456-134", + Cases = new List() + { + new TemenosCase() + { + CaseId = 99, + CaseStatusId = 33, + RepoStatus = RepoStatus.O4R, + CaseTypeId = 7 + } + } + }; + + var temenosCase = testAccount.FindRecoveryCaseOrDefault(0); + Assert.True(testAccount.HasRecoveryCase(0)); + Assert.NotNull(temenosCase); + Assert.Equal(99,temenosCase.CaseId); + } + + [Fact] + public async Task UpdateExistingRepoAccount_FullUpdate_OK() + { + var repoAccount = new RepoAccount() + { + RepoId = 555, + AccountNo = "123456-789", + Status = "O4R", + Collaterals = new List() + { + new Collateral() + { + RepoId = 555 + } + } + }; + + _mockRepoAccountProcessorService.Setup(serv => serv.UpdateRepoAccountFromParts(It.IsAny())).Returns(repoAccount); + _mockRepoAccountProcessorService.Setup(serv => serv.CheckForRejectedStatusChange(It.IsAny(), It.IsAny(), It.IsAny())); + _mockRepoAccountProcessorService.Setup(serv => + serv.TryUpdateOrCreateRepoCompanyAssignment(It.IsAny(), It.IsAny(), + It.IsAny())); + _mockRepoAccountProcessorService.Setup(serv => serv.TryUpdateCollateralRetitleDate(It.IsAny(), It.IsAny())); + _mockRepoAccountProcessorService.Setup(serv => serv.UpdateRepoAccountDateClosed(It.IsAny())); + + _mockAccountAlertCheckService + .Setup(serv => serv.AlertChecksPreStatusReject(It.IsAny())) + .Returns(Task.FromResult(null)); + + _mockRepoAccountService.Setup(serv => serv.UpdateAsync(It.IsAny(), It.IsAny())).ReturnsAsync(repoAccount); + + var temenosCase = new TemenosCase(); + var temenosAccount = new TemenosAccount(); + + //Full Update Criteria + temenosCase.RepoStatus = RepoStatus.REPO; + repoAccount.Status = "O4R"; + repoAccount.Balance = 1; + temenosAccount.Balance = 2; + + var slip = new RepoAccountProcessingSlip() + { + RecoveryCase = temenosCase, + RecoveryAccount = temenosAccount, + ExistingRepoAccount = repoAccount, + RequestedBy = new ProcessingItem() + { + QueuedBy = "testing", + AccountNo = "123456-789", + CaseId = "0" + } + }; + + // repoAccount, temenosAccount, temenosCase, "123213123" + var res = await _repoAccountProcessor.UpdateExistingRepoAccount(slip); + + _mockRepoAccountService.Verify(serv => serv.UpdateAsync(It.IsAny(), It.IsAny()), Times.Once); + _mockRepoAccountProcessorService.Verify(serv => + serv.TryUpdateOrCreateRepoCompanyAssignment(It.IsAny(), It.IsAny(), + It.IsAny())); + + Assert.NotNull(res); + } + + [Fact] + public async Task UpdateExistingRepoAccount_HalfUpdate_OK() + { + var repoAccount = new RepoAccount() + { + RepoId = 555, + AccountNo = "123456-789", + Status = "O4R", + Collaterals = new List() + { + new Collateral() + { + RepoId = 555 + } + } + }; + + _mockRepoAccountProcessorService.Setup(serv => serv.UpdateRepoAccountFromParts(It.IsAny())).Returns(repoAccount); + _mockRepoAccountProcessorService.Setup(serv => serv.CheckForRejectedStatusChange(It.IsAny(), It.IsAny(), It.IsAny())); + _mockRepoAccountProcessorService.Setup(serv => + serv.TryUpdateOrCreateRepoCompanyAssignment(It.IsAny(), It.IsAny(), It.IsAny())); + _mockRepoAccountProcessorService.Setup(serv => serv.TryUpdateCollateralRetitleDate(It.IsAny(), It.IsAny())); + _mockRepoAccountProcessorService.Setup(serv => serv.UpdateRepoAccountDateClosed(It.IsAny())); + + _mockAccountAlertCheckService.Setup(serv => serv.AlertChecksPreStatusReject(It.IsAny())); + + _mockRepoAccountService.Setup(serv => serv.UpdateAsync(It.IsAny(), It.IsAny())).ReturnsAsync(repoAccount); + + var temenosCase = new TemenosCase(); + var temenosAccount = new TemenosAccount(); + + //Not Full Update Criteria + temenosCase.RepoStatus = RepoStatus.O4R; + repoAccount.Status = "O4R"; + repoAccount.Balance = 1; + temenosAccount.Balance = 1; + var slip = new RepoAccountProcessingSlip() + { + RecoveryCase = temenosCase, + RecoveryAccount = temenosAccount, + ExistingRepoAccount = repoAccount, + RequestedBy = new ProcessingItem() + { + QueuedBy = "testing", + AccountNo = "123456-789", + CaseId = "0" + } + }; + + // repoAccount, temenosAccount, temenosCase, "123213123" + var res = await _repoAccountProcessor.UpdateExistingRepoAccount(slip); + + _mockRepoAccountProcessorService.Verify(serv => serv.UpdateRepoAccountDateClosed(It.IsAny()), Times.Once); + _mockRepoAccountProcessorService.Verify(serv => serv.TryUpdateCollateralRetitleDate(It.IsAny(), It.IsAny()),Times.Once); + _mockRepoAccountProcessorService.Verify(serv => serv.UpdateRepoAccountDateClosed(It.IsAny()), Times.Once); + _mockRepoAccountProcessorService.Verify(serv => + serv.TryUpdateOrCreateRepoCompanyAssignment(It.IsAny(), It.IsAny(), It.IsAny()),Times.Once); + + Assert.NotNull(res); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/Processor/ineligibleAccount.json b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/Processor/ineligibleAccount.json new file mode 100644 index 0000000..4c40de0 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/Processor/ineligibleAccount.json @@ -0,0 +1,3492 @@ +{ + "repoLetters": [], + "coreTransactions": [], + "temenosHistory": [ + { + "name": "CRIF FRAUD File Fields", + "message": "change field", + "userId": 5, + "created": "2020-10-23T15:29:39.42", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2020-10-23T08:16:39.047", + "type": 1 + }, + { + "name": "AUTO - Status Set Repo Flag", + "message": "set flag", + "userId": 0, + "created": "2020-10-23T06:38:15.717", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-23T06:22:05.623", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2020-10-22T08:10:59.55", + "type": 1 + }, + { + "name": "AUTO - Status Set Repo Flag", + "message": "set flag", + "userId": 0, + "created": "2020-10-22T06:37:32.957", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-22T06:21:44.873", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2020-10-21T08:19:46.947", + "type": 1 + }, + { + "name": "AUTO - Status Set Repo Flag", + "message": "set flag", + "userId": 0, + "created": "2020-10-21T06:35:24.333", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-21T06:23:20.243", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2020-10-20T08:15:56.42", + "type": 1 + }, + { + "name": "AUTO - Status Set Repo Flag", + "message": "set flag", + "userId": 0, + "created": "2020-10-20T06:38:22.03", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-20T06:27:00.233", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2020-10-19T13:00:53.017", + "type": 1 + }, + { + "name": "AUTO - Status Set Repo Flag", + "message": "set flag", + "userId": 0, + "created": "2020-10-19T12:59:15.047", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-19T12:36:41.373", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2020-10-18T08:03:45.833", + "type": 1 + }, + { + "name": "AUTO - Status Set Repo Flag", + "message": "set flag", + "userId": 0, + "created": "2020-10-18T06:27:29.54", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-18T06:14:22.663", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2020-10-17T08:15:15.84", + "type": 1 + }, + { + "name": "AUTO - Status Set Repo Flag", + "message": "set flag", + "userId": 0, + "created": "2020-10-17T06:27:17.297", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-17T06:17:28.42", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2020-10-16T08:13:28.72", + "type": 1 + }, + { + "name": "AUTO - Status Set Repo Flag", + "message": "set flag", + "userId": 0, + "created": "2020-10-16T06:35:00.31", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-16T06:22:48.84", + "type": 1 + }, + { + "name": "Comment", + "message": "Requesting fraud research be completed on the account. Reason: \r\n cb alert", + "userId": 17, + "created": "2020-10-14T16:40:52.973", + "type": 0 + }, + { + "name": "Fraud Research Request", + "message": "Fraud Flag", + "userId": 17, + "created": "2020-10-14T16:40:52.97", + "type": 1 + }, + { + "name": "Fraud Research Request", + "message": "Auto Comment: Fraud Research Requested", + "userId": 17, + "created": "2020-10-14T16:40:52.97", + "type": 1 + }, + { + "name": "Fraud Research Request", + "message": "Fraud Request Reason", + "userId": 17, + "created": "2020-10-14T16:40:52.97", + "type": 1 + }, + { + "name": "Comment", + "message": "test", + "userId": 17, + "created": "2020-10-14T16:39:10.093", + "type": 0 + }, + { + "name": "Fraud Follow Up", + "message": "Contact Method", + "userId": 17, + "created": "2020-10-14T16:39:10.043", + "type": 1 + }, + { + "name": "Fraud Follow Up", + "message": "Update Fraud Information", + "userId": 17, + "created": "2020-10-14T16:39:10.043", + "type": 1 + }, + { + "name": "Fraud Follow Up", + "message": "Document Fraud Information", + "userId": 17, + "created": "2020-10-14T16:39:10.043", + "type": 1 + }, + { + "name": "Fraud Follow Up", + "message": "Set Nezt Contact Date", + "userId": 17, + "created": "2020-10-14T16:39:10.043", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2020-10-14T12:24:16.793", + "type": 1 + }, + { + "name": "AUTO - Status Set Repo Flag", + "message": "set flag", + "userId": 0, + "created": "2020-10-14T12:23:37.857", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-14T06:14:35.137", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-13T06:11:41.967", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-10-12T12:21:45.92", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-10-12T12:21:45.92", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-12T12:03:11.283", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-10-12T11:32:05.667", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-10-12T11:32:05.667", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-10-09T06:31:20.12", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-10-09T06:31:20.12", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-09T06:22:41.29", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-10-09T06:16:27.697", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-10-09T06:16:27.697", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-10-08T06:35:42.89", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-10-08T06:35:42.89", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-08T06:17:22.143", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-10-08T06:12:23.817", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-10-08T06:12:23.817", + "type": 1 + }, + { + "name": "Case Stage Account - O4R", + "message": "Account level stage ", + "userId": 5, + "created": "2020-10-07T15:51:36.86", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-10-07T06:44:34.777", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-10-07T06:44:34.777", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-07T06:22:42.29", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-10-07T06:09:41.713", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-10-07T06:09:41.713", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2020-10-06T20:12:16.807", + "type": 1 + }, + { + "name": "AUTO - Status Set Repo Flag", + "message": "set flag", + "userId": 0, + "created": "2020-10-06T20:11:38.01", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-10-06T06:27:10.97", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-10-06T06:27:10.97", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-06T06:17:43.497", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-10-06T06:12:27.39", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-10-06T06:12:27.39", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-10-05T06:23:52.737", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-10-05T06:23:52.737", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-05T06:13:34.097", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-10-05T06:04:58.19", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-10-05T06:04:58.19", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-10-04T06:16:28.58", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-10-04T06:16:28.58", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-04T06:08:03.91", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-10-04T06:02:02.05", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-10-04T06:02:02.05", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-10-03T06:28:23.783", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-10-03T06:28:23.783", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-03T06:21:49.143", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-10-03T06:14:59.927", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-10-03T06:14:59.927", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-10-02T06:25:02.237", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-10-02T06:25:02.237", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-02T06:16:11.47", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-10-02T06:10:30.127", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-10-02T06:10:30.127", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-10-01T06:20:10.807", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-10-01T06:20:10.807", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-01T06:11:31.323", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-10-01T06:07:08.557", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-10-01T06:07:08.557", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-30T06:20:05.61", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-30T06:20:05.61", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-30T06:11:23.797", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-30T06:03:58.373", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-30T06:03:58.373", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-29T06:28:40.743", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-29T06:28:40.743", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-29T06:09:00.303", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-29T06:01:18.24", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-29T06:01:18.24", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-27T06:39:41.667", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-27T06:39:41.667", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-27T06:25:20.837", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-27T06:17:53.79", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-27T06:17:53.79", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-26T06:32:00.583", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-26T06:32:00.583", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-26T06:22:58.99", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-26T06:15:46.18", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-26T06:15:46.18", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-25T06:20:16.227", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-25T06:20:16.227", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-25T06:12:11.01", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-25T06:07:56.26", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-25T06:07:56.26", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-23T06:24:05.203", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-23T06:24:05.203", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-23T06:12:51.97", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-23T06:02:09.483", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-23T06:02:09.483", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-22T06:22:51.55", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-22T06:22:51.55", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-22T06:15:32.707", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-22T06:10:12.083", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-22T06:10:12.083", + "type": 1 + }, + { + "name": "Comment", + "message": "test", + "userId": 4, + "created": "2020-09-21T17:15:18.36", + "type": 0 + }, + { + "name": "Remove Account Flag", + "message": "Remove Flag", + "userId": 4, + "created": "2020-09-21T17:15:18.36", + "type": 1 + }, + { + "name": "Remove Account Flag", + "message": "Give Reason", + "userId": 4, + "created": "2020-09-21T17:15:18.36", + "type": 1 + }, + { + "name": "Remove Account Flag", + "message": "Next Contact Date ", + "userId": 4, + "created": "2020-09-21T17:15:18.36", + "type": 1 + }, + { + "name": "Comment", + "message": "Removing Repo flag as repo was closed.", + "userId": 4, + "created": "2020-09-21T17:10:39.893", + "type": 0 + }, + { + "name": "Remove Account Flag", + "message": "Remove Flag", + "userId": 4, + "created": "2020-09-21T17:10:39.75", + "type": 1 + }, + { + "name": "Remove Account Flag", + "message": "Give Reason", + "userId": 4, + "created": "2020-09-21T17:10:39.75", + "type": 1 + }, + { + "name": "Remove Account Flag", + "message": "Next Contact Date ", + "userId": 4, + "created": "2020-09-21T17:10:39.75", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-19T06:19:32.91", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-19T06:19:32.91", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-19T06:11:41.73", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-19T06:07:28.5", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-19T06:07:28.5", + "type": 1 + }, + { + "name": "AUTO - Collection Agency ACSI", + "message": "Flip to ACSI", + "userId": 5, + "created": "2020-09-18T14:51:00.86", + "type": 1 + }, + { + "name": "AUTO - Collection Agency ACSI", + "message": "Flip to ACSI", + "userId": 5, + "created": "2020-09-18T14:48:12.94", + "type": 1 + }, + { + "name": "Comment", + "message": "No fraud was determined. test Sent letter(s): Fraud.", + "userId": 17, + "created": "2020-09-18T10:58:41.953", + "type": 2 + }, + { + "name": "Fraud Determination", + "message": "Fraud Research", + "userId": 17, + "created": "2020-09-18T10:58:41.937", + "type": 1 + }, + { + "name": "Fraud Determination", + "message": "Fraud Determined?", + "userId": 17, + "created": "2020-09-18T10:58:41.937", + "type": 1 + }, + { + "name": "Fraud Determination", + "message": "Automated Comment - No Fraud", + "userId": 17, + "created": "2020-09-18T10:58:41.937", + "type": 1 + }, + { + "name": "Fraud Determination", + "message": "Reason", + "userId": 17, + "created": "2020-09-18T10:58:41.937", + "type": 1 + }, + { + "name": "Fraud Determination", + "message": "Case Stage = No Fraud", + "userId": 17, + "created": "2020-09-18T10:58:41.937", + "type": 1 + }, + { + "name": "Fraud Determination", + "message": "Clear Account Level Flag", + "userId": 17, + "created": "2020-09-18T10:58:41.937", + "type": 1 + }, + { + "name": "Fraud Determination", + "message": "Send Denial Letter", + "userId": 17, + "created": "2020-09-18T10:58:41.937", + "type": 1 + }, + { + "name": "Fraud Determination", + "message": "Case Status = Closed", + "userId": 17, + "created": "2020-09-18T10:58:41.937", + "type": 1 + }, + { + "name": "Fraud Determination", + "message": "Set Nezt Contact Date", + "userId": 17, + "created": "2020-09-18T10:58:41.937", + "type": 1 + }, + { + "name": "Comment", + "message": "test", + "userId": 17, + "created": "2020-09-18T10:58:15.08", + "type": 0 + }, + { + "name": "Fraud Suspected", + "message": "Update Fraud Information", + "userId": 17, + "created": "2020-09-18T10:58:15.063", + "type": 1 + }, + { + "name": "Fraud Suspected", + "message": "Case Stage = Fraud Suspected", + "userId": 17, + "created": "2020-09-18T10:58:15.063", + "type": 1 + }, + { + "name": "Fraud Suspected", + "message": "Set account fraud suspected flag", + "userId": 17, + "created": "2020-09-18T10:58:15.063", + "type": 1 + }, + { + "name": "Fraud Suspected", + "message": "Document Fraud Information", + "userId": 17, + "created": "2020-09-18T10:58:15.063", + "type": 1 + }, + { + "name": "Fraud Suspected", + "message": "Set Next Contact Date", + "userId": 17, + "created": "2020-09-18T10:58:15.063", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-18T06:22:22.95", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-18T06:22:22.95", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-18T06:12:06.73", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-18T06:06:34.183", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-18T06:06:34.183", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2020-09-17T08:14:29.063", + "type": 1 + }, + { + "name": "AUTO - Status Set Repo Flag", + "message": "set flag", + "userId": 0, + "created": "2020-09-17T06:58:01.267", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-17T06:56:37.983", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-17T06:56:37.983", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-17T06:47:12.78", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-17T06:40:04.407", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-17T06:40:04.407", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 5, + "created": "2020-09-16T21:56:02.89", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2020-09-16T20:14:21.313", + "type": 1 + }, + { + "name": "AUTO - Status Set Repo Flag", + "message": "set flag", + "userId": 0, + "created": "2020-09-16T20:13:04.847", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-16T06:22:03.643", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-16T06:22:03.643", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-16T06:15:29.783", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-16T06:09:48.093", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-16T06:09:48.093", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-15T06:57:43.907", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-15T06:57:43.907", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-15T06:49:08.393", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-15T06:43:15.377", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-15T06:43:15.377", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-14T12:09:31.487", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 5, + "created": "2020-09-14T11:10:47.127", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 5, + "created": "2020-09-14T11:10:47.127", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 5, + "created": "2020-09-14T11:10:26.28", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 5, + "created": "2020-09-14T11:10:26.28", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 5, + "created": "2020-09-12T18:06:44.427", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 5, + "created": "2020-09-12T18:06:44.427", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 5, + "created": "2020-09-12T18:06:36.003", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 5, + "created": "2020-09-12T18:06:36.003", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 5, + "created": "2020-09-12T18:05:34.457", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 5, + "created": "2020-09-12T18:05:34.457", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 5, + "created": "2020-09-12T18:05:11.99", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 5, + "created": "2020-09-12T18:05:11.99", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-12T06:58:23.58", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-12T06:58:23.58", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-12T06:47:34.067", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-12T06:38:15.787", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-12T06:38:15.787", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-11T06:47:08.953", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-11T06:47:08.953", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-11T06:38:07.343", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-11T06:31:54.797", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-11T06:31:54.797", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 5, + "created": "2020-09-10T14:31:03.44", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-10T06:24:31.703", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-10T06:24:31.703", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-10T06:17:46.923", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-10T06:12:27.19", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-10T06:12:27.19", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2020-09-09T06:42:49.583", + "type": 1 + }, + { + "name": "AUTO - Status Set Repo Flag", + "message": "set flag", + "userId": 0, + "created": "2020-09-09T06:42:21.053", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-09T06:41:30.74", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-09T06:41:30.74", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-09T06:13:18.233", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-09T06:07:40.61", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-09T06:07:40.61", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2020-09-05T06:20:19.827", + "type": 1 + }, + { + "name": "AUTO - Status Set Repo Flag", + "message": "set flag", + "userId": 0, + "created": "2020-09-05T06:20:00.327", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-05T06:18:53.937", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-05T06:18:53.937", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-05T06:13:36.203", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-05T06:08:34.767", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-05T06:08:34.767", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2020-09-04T06:15:17.443", + "type": 1 + }, + { + "name": "AUTO - Status Set Repo Flag", + "message": "set flag", + "userId": 0, + "created": "2020-09-04T06:15:01.443", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-04T06:14:06.397", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-04T06:14:06.397", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-04T06:08:05.63", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-04T06:04:20.227", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-04T06:04:20.227", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2020-09-03T20:05:41.673", + "type": 1 + }, + { + "name": "AUTO - Status Set Repo Flag", + "message": "set flag", + "userId": 0, + "created": "2020-09-03T20:05:16.627", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-03T06:26:33.267", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-03T06:26:33.267", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-03T06:20:31.987", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-03T06:15:19.283", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-03T06:15:19.283", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-02T06:23:06.313", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-02T06:23:06.313", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-02T06:17:58.453", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-02T06:12:43.64", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-02T06:12:43.64", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-08-29T06:10:51.86", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-08-29T06:10:51.86", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-08-29T06:04:59", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-08-29T06:01:35.11", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-08-29T06:01:35.11", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-08-28T06:19:11.93", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-08-28T06:19:11.93", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-08-28T06:12:12.493", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-08-28T06:09:32.977", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-08-28T06:09:32.977", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-08-27T06:18:50.763", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-08-27T06:18:50.763", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-08-27T06:13:32.97", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-08-27T06:10:33.67", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-08-27T06:10:33.67", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-08-26T06:30:04.41", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-08-26T06:30:04.41", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-08-26T06:21:40.053", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-08-26T06:14:38.397", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-08-26T06:14:38.397", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-08-25T06:59:21.363", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-08-25T06:59:21.363", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-08-25T06:29:11.77", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-08-25T06:08:28.13", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-08-25T06:08:28.13", + "type": 1 + }, + { + "name": "AUTO - Collection Agency Aries Data", + "message": "Flip to Aries Data", + "userId": 5, + "created": "2020-08-24T11:18:07.53", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 5, + "created": "2020-08-24T10:38:32.603", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 5, + "created": "2020-08-24T10:38:32.603", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 5, + "created": "2020-08-24T10:38:06.633", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 5, + "created": "2020-08-24T10:38:06.633", + "type": 1 + }, + { + "name": "AUTO - Collection Agency ACSI", + "message": "Flip to ACSI", + "userId": 5, + "created": "2020-08-24T10:37:08.713", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-08-21T06:24:18.497", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-08-21T06:24:18.497", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-08-21T06:16:24.2", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-08-21T06:11:34.887", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-08-21T06:11:34.887", + "type": 1 + }, + { + "name": "AUTO - Status Set Repo Flag", + "message": "set flag", + "userId": 5, + "created": "2020-08-19T22:53:55.283", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 5, + "created": "2020-08-19T22:53:24.58", + "type": 1 + }, + { + "name": "BATCH - Recovery Charge Off", + "message": "Recommend for Charge Off", + "userId": 4, + "created": "2020-08-17T14:36:50.917", + "type": 1 + }, + { + "name": "BATCH - Recovery Charge Off", + "message": "Recommendation Approval", + "userId": 4, + "created": "2020-08-17T14:36:50.917", + "type": 1 + }, + { + "name": "BATCH - Recovery Charge Off", + "message": "Set GL Amounts", + "userId": 4, + "created": "2020-08-17T14:36:50.917", + "type": 1 + }, + { + "name": "BATCH - Recovery Charge Off", + "message": "Charge Off Account", + "userId": 4, + "created": "2020-08-17T14:36:50.917", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-08-15T06:18:15.563", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-08-15T06:18:15.563", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-08-15T06:09:53.47", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-08-15T06:04:46.533", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-08-15T06:04:46.533", + "type": 1 + }, + { + "name": "AUTO - Set Repo Flag", + "message": "set flag", + "userId": 5, + "created": "2020-08-14T10:26:40.197", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-08-14T06:08:06.39", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-08-12T06:19:54.927", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-08-11T06:21:24.317", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-08-08T08:15:36.74", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-08-07T06:11:56.543", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-08-06T20:07:35.003", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-08-05T20:18:54.923", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "Intellect Permanent Comments - Blank", + "userId": 2, + "created": "2020-07-29T14:38:52.273", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "User Status Code 2 - Blank", + "userId": 2, + "created": "2020-07-29T14:38:52.273", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "User Status Code 1 - Blank", + "userId": 2, + "created": "2020-07-29T14:38:52.273", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "Intellect Next Follow Up Date - 1/1/20", + "userId": 2, + "created": "2020-07-29T14:38:52.273", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "Last Contact Date - 1/1/2020", + "userId": 2, + "created": "2020-07-29T14:38:52.273", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "Intellect Permanent Comments - Blank", + "userId": 2, + "created": "2020-07-29T14:35:48.46", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "User Status Code 2 - Blank", + "userId": 2, + "created": "2020-07-29T14:35:48.46", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "User Status Code 1 - Blank", + "userId": 2, + "created": "2020-07-29T14:35:48.46", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "Intellect Next Follow Up Date - 1/1/20", + "userId": 2, + "created": "2020-07-29T14:35:48.46", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "Last Contact Date - 1/1/2020", + "userId": 2, + "created": "2020-07-29T14:35:48.46", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "Intellect Permanent Comments - Blank", + "userId": 2, + "created": "2020-07-29T14:25:50.07", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "User Status Code 2 - Blank", + "userId": 2, + "created": "2020-07-29T14:25:50.07", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "User Status Code 1 - Blank", + "userId": 2, + "created": "2020-07-29T14:25:50.07", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "Intellect Next Follow Up Date - 1/1/20", + "userId": 2, + "created": "2020-07-29T14:25:50.07", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "Last Contact Date - 1/1/2020", + "userId": 2, + "created": "2020-07-29T14:25:50.07", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-07-27T08:28:28.55", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-07-22T08:34:19.907", + "type": 1 + }, + { + "name": "Comment", + "message": "called Possible POE608-566-4456 not in service \r\n6466120143 07/15/2020 12:09:06 PMcalled the 608-206-9293 talked to MEMBERNAME autho full name ssn dob, address, she is still at the bar and they are closed, she stated she may have some money next week, let her know she would need 1200.00 to make any type of payment arrangement with her, she said ok, let her know that I can't stop or alter any action on the accountwithout a payment arrangment and money upfront, she said she will call us \r\n6466120143 07/17/2020 11:00:00 AMto agentI did some skip work on this and found the father David Wagner reports at the 22 NORTH ST MADISON, WI 53704 address. I called our agent and they will run ASAP. I will advise if our unit is secured or an update. Thanks, Jeff Kalber 800-588-0097 x1091 2020-07-15 13:52:33 \r\n6466120143 07/23/2019 12:00:00 AMe/m LUVED99@GMAIL.COM", + "userId": 1, + "created": "2020-07-15T12:05:08", + "type": 0 + }, + { + "name": "Comment", + "message": "CCAPSHE HAS A JUDGMENT US BANK IN JANUARY 2020 \r\n6466120143 07/15/2020 11:35:36 AMCURRENT ADDRESS UPDATED WITH CHILD SUPPORT AGENCY22 North St, Madison, WI 53704 United States (Effective: 06-10-2020) \r\n6466120143 07/15/2020 12:00:30 PMgave the agent the new address 22 North St, Madison, WI 53704 United States \r\n6466120143 07/15/2020 12:04:53 PMLoan documentsPOE listed POE was Club Bristol Bar manager, 608-566-4456", + "userId": 1, + "created": "2020-07-15T11:33:32", + "type": 0 + }, + { + "name": "Comment", + "message": "DRN Sorry, there were no clustered locations found. \r\n6466120143 07/09/2020 08:08:03 AM* LETTER * Letter for Loan & Dep Accts Pre Coll Agency \r\n6466120143 07/15/2020 01:17:25 PMFOLLOW UP ON AGENT UPDATES \r\n6466120143 07/15/2020 11:31:46 AMAGENT UPDATERan 18 Woodridge Ct day and night with no sighting of wanted unit", + "userId": 1, + "created": "2020-07-07T10:31:48", + "type": 0 + }, + { + "name": "Comment", + "message": "CCABR Comment: RDN LAST UPDATE \t06/25/2020\t06:23\tLocation Services, LLCWhiteman, Nelly\t(O)Agent-UpdateHello,We have assigned 18 WOODRICH CT to a new agent for a fresh set of eyes, updates to follow.Thank you \r\n6466120143 06/29/2020 10:27:13 AMCCABR Call: Call Follow Up \r\n6466120143 06/29/2020 10:27:07 AMCCABR Message: MEMBERNAME WAGNER @ 608-206-9293 \r\n6466120143 02/26/2020 02:53:51 PMTCOTT Contact Out: Called MEMBERNAME WAGNER @ 608-206-9293", + "userId": 1, + "created": "2020-07-07T10:27:31", + "type": 0 + }, + { + "name": "Comment", + "message": "CCABR Comment: Hello MEMBERNAME,Its important you contact Landmark Credit Union Collections at (855)815-6391.Thank you,Cynthia Avila Collections Team LeadLandmark Credit Union \r\n6466120143 02/26/2020 02:57:50 PMTCOTT Call: Call Follow Up \r\n6466120143 06/11/2020 09:59:05 AMCCABR Message: MEMBERNAME WAGNER @ 608-206-9293 \r\n6466120143 07/07/2020 10:24:58 AMCCABR Message: Emailed MEMBERNAME WAGNER - LUVED99@GMAIL.COM", + "userId": 1, + "created": "2020-07-07T10:26:02", + "type": 0 + }, + { + "name": "Comment", + "message": "CCABR Call: Call Follow Up \r\n6466120143 02/26/2020 02:56:23 PMTCOTT Comment: SPOKE W/ MEMBERNAME SHE STATED THAT SHE HAD TO GET A TON OF WRK DONE ON THE CAR, INFORMED HER THAT IM TRYONG TO KEEP HER FROM GOING OUT FOR REPO IF SHE SI ABLE TO MAKE DEC PAYMNT SUBMIT 2MNTH DEFRL FOR JAN AND FEB SHE SD THAR SHE WILL TRY TO GET SOMETHING I \r\n6466120143 01/29/2020 09:14:49 AMTCOTT Comment: PAYMNT RECVD FOR $750.00 LOAN 50DPD WILL CXL REPO AT THIS TIME \r\n6466120143 02/19/2020 11:59:35 AMTCOTT Call: Call Follow Up", + "userId": 1, + "created": "2020-07-07T10:26:02", + "type": 0 + }, + { + "name": "Comment", + "message": "Hello MEMBERNAME,Please contact Landmark Credit Union - Collections at (855)815-6391.Thank you,Cynthia Avila Collections Team Lead \r\n6466120143 07/07/2020 10:26:02 AMHello MEMBERNAME,Its important you contact Landmark Credit Union Collections at (855)815-6391.Thank you,Cynthia Avila Collections Team LeadLandmark Credit Union \r\n6466120143 07/07/2020 10:27:31 AMRDN LAST UPDATE \t06/25/2020\t06:23\tLocation Services, LLCWhiteman, Nelly\t(O)Agent-UpdateHello,We have assigned 18 WOODRICH CT to a new agent for a fresh set of eyes, updates to follow.Thank you \r\n6466120143 07/07/2020 10:28:39 AMRDN requested update: \t07/07/2020\t08:28\tLandmark Credit UnionCabrera, Cynthia\tClient-Requesting UpdatePlease update status. ThanksFor Address: 18 WOODRICH CT MADISON, WI", + "userId": 1, + "created": "2020-06-29T10:13:48", + "type": 0 + }, + { + "name": "Comment", + "message": "CCABR Comment: RDN REQT UPDATES:\t06/24/2020\t07:57\tLandmark Credit UnionCabrera, Cynthia\tClient-New InfoPlease update any info on acct. Thanks! \r\n6466120143 06/24/2020 09:58:04 AMCCABR Message: Emailed MEMBERNAME WAGNER - LUVED99@GMAIL.COM \r\n6466120143 03/20/2020 02:03:20 PMCCABR Comment: aced on hold for the following reason:COV0ID-19 \r\n6466120143 03/20/2020 02:03:20 PMCCABR Comment: RDN UPDATED BY TRA:03/20/2020\t08:55\tLocation Services, LLCWhiteman, Nelly\tAgent AcknowledgeAgent acknowledged the hold\t\t03/20/2020\t08:52\tLandmark Credit UnionCotton, Tranace\tClient-Account On HOLDYour client has requested that this account be pl", + "userId": 1, + "created": "2020-06-24T09:59:46", + "type": 0 + }, + { + "name": "Comment", + "message": "CCABR Comment: Hello MEMBERNAME,Please contact Landmark Credit Union - Collections at (855)815-6391.Thank you,Cynthia Avila Collections Team Lead \r\n6466120143 06/24/2020 09:58:56 AMCCABR Call: Call Follow Up \r\n6466120143 06/24/2020 09:59:04 AMCCABR Message: MEMBERNAME WAGNER @ 608-206-9293 \r\n6466120143 06/24/2020 09:59:12 AMCCABR Call: Call Follow Up", + "userId": 1, + "created": "2020-06-24T09:58:56", + "type": 0 + }, + { + "name": "Comment", + "message": "USERDEF FRON REHO TO O4R \r\n6466120143 06/18/2020 03:31:25 PMREMOVED REHO ALERTS \r\n6466120143 06/18/2020 03:34:48 PMRDN UPDATED 06/18/2020\t13:32\tLandmark Credit UnionCabrera, Cynthia\tClient-Account Re-OpenedYour client has requested that this account be taken off hold for the following reason:ABLE TO RELEASE HOLD IF NO PMTS AFTER COVID-19 \r\n6466120143 06/24/2020 09:59:46 AMRDN REQT UPDATES:\t06/24/2020\t07:57\tLandmark Credit UnionCabrera, Cynthia\tClient-New InfoPlease update any info on acct. Thanks!", + "userId": 1, + "created": "2020-06-18T15:31:13", + "type": 0 + }, + { + "name": "Comment", + "message": "CCABR No Answer: MEMBERNAME WAGNER @ 608-206-9293 \r\n6466120143 06/18/2020 03:31:13 PMCCABR Comment: USERDEF FRON REHO TO O4R \r\n6466120143 06/18/2020 03:30:41 PMCCABR Comment: NO PMTS SINCE LAST CONTACT WITH MBR \r\n6466120143 06/18/2020 03:30:52 PMCCABR Comment: PLACING ACCT BACK O4R", + "userId": 1, + "created": "2020-06-18T15:29:51", + "type": 0 + }, + { + "name": "Comment", + "message": "CCABR Comment: Putting repossession on hold due to Covid-19. \r\n6466120143 03/20/2020 02:00:50 PMCCABR Comment: Userdef from=O4R to REHO. \r\n6466120143 03/20/2020 02:00:41 PMCCABR Comment: 101 DPD DUE FOR 12/10/169 \r\n6466120143 03/10/2020 11:28:32 AMCCABR Message: MEMBERNAME WAGNER @ 608-206-9293", + "userId": 1, + "created": "2020-03-20T14:00:56", + "type": 0 + }, + { + "name": "Comment", + "message": "101 DPD DUE FOR 12/10/169 \r\n6466120143 03/20/2020 02:00:50 PMUserdef from=O4R to REHO. \r\n6466120143 03/20/2020 02:00:56 PMPutting repossession on hold due to Covid-19. \r\n6466120143 03/20/2020 02:03:20 PMRDN UPDATED BY TRA:03/20/2020\t08:55\tLocation Services, LLCWhiteman, Nelly\tAgent AcknowledgeAgent acknowledged the hold\t\t03/20/2020\t08:52\tLandmark Credit UnionCotton, Tranace\tClient-Account On HOLDYour client has requested that this account be placed on hold for the following reason:COV0ID-19", + "userId": 1, + "created": "2020-03-20T14:00:41", + "type": 0 + }, + { + "name": "Comment", + "message": "USERDEF CHANGED FROM O4R TO REHO-COVID-19 \r\n6466120143 06/11/2020 12:00:00 AMTT MEMBERNAME 608-206-9293 ADV ON PMTS DUE SINCE DEC 2019RFD STATED COVID-19 LAID OFFADV MBR ON MAKING PMTS FOR DEC JAN FEB AND MARCH AMT OF $1570 INCLUDING LATE FEES OF $42.90 ONCE THIS PMT IS MADE WE CAN OFFER A 3 MONTH DEFERRAL APRIL MAY JUNE DUE TO COVID-19 LAID OFFMBR AWARE OUT FOR REPO ADV ME ON CALLING HER BACK ON WED 6/10/20 FOR SOLUTIONVERIFIED DEMOS \r\n6466120143 06/18/2020 03:30:41 PMNO PMTS SINCE LAST CONTACT WITH MBR \r\n6466120143 06/18/2020 03:30:52 PMPLACING ACCT BACK O4R", + "userId": 1, + "created": "2020-03-20T10:52:42", + "type": 0 + }, + { + "name": "Comment", + "message": "TCOTT Comment: USERDEF CHANGED FROM O4R TO REHO-COVID-19 \r\n6466120143 03/10/2020 11:28:36 AMCCABR Call: Call Follow Up \r\n6466120143 06/18/2020 03:29:56 PMCCABR Call: Call Follow Up \r\n6466120143 03/09/2020 09:31:08 AMJOHNS Comment: Approved REPORTC EXP 2/12/20, REPO DUE 12/10/19 @ 90 DPDNO COMMUNICATION, LAST PAYMNT 1/17/20, SCRA NOT LISTED NO UPDATED POE INS EXP 8/15/20", + "userId": 1, + "created": "2020-03-20T10:52:42", + "type": 0 + }, + { + "name": "Comment", + "message": "CCABR Message: MEMBERNAME WAGNER @ 608-206-9293 \r\n6466120143 07/07/2020 10:28:39 AMCCABR Comment: RDN requested update: \t07/07/2020\t08:28\tLandmark Credit UnionCabrera, Cynthia\tClient-Requesting UpdatePlease update status. ThanksFor Address: 18 WOODRICH CT MADISON, WI \r\n6466120143 03/11/2020 08:41:07 AMACEVE Comment: 92 dpd - Next due date 12/10/19 - Cont w/repo \r\n6466120143 07/07/2020 10:31:48 AMCCABR Comment: DRN Sorry, there were no clustered locations found.", + "userId": 1, + "created": "2020-03-17T14:49:09", + "type": 0 + }, + { + "name": "Comment", + "message": "ACEVE Comment: Repo Manager Alerts 03-10-2020 17:10:09Account No: 6466120143Alert: Payment Receivedhttps://repomanage.lcu-internal.com/#/Account/4133Payment Amount $420 \r\n6466120143 03/06/2020 03:05:47 PMTCOTT Comment: USERDEF CHNAGED FROM RECA TO RR \r\n6466120143 03/06/2020 03:26:56 PM5783 Comment: ISSUED TO LOCATION SERVICES \r\n6466120143 03/06/2020 03:06:30 PMTCOTT Call: Call Follow Up", + "userId": 1, + "created": "2020-03-11T08:40:40", + "type": 0 + }, + { + "name": "Comment", + "message": "Approved REPORTC EXP 2/12/20, REPO DUE 12/10/19 @ 90 DPDNO COMMUNICATION, LAST PAYMNT 1/17/20, SCRA NOT LISTED NO UPDATED POE INS EXP 8/15/20 \r\n6466120143 03/11/2020 08:41:26 AMEmailed Tra \r\n6466120143 03/11/2020 08:41:42 AM92 dpd - Next due date 12/10/19 - Cont w/repo \r\n6466120143 03/11/2020 08:41:46 AMRepo Manager Alerts 03-10-2020 17:10:09Account No: 6466120143Alert: Payment Receivedhttps://repomanage.lcu-internal.com/#/Account/4133Payment Amount $420", + "userId": 1, + "created": "2020-03-10T11:27:32", + "type": 0 + }, + { + "name": "Comment", + "message": "JOHNS Call: Call Follow Up \r\n6466120143 06/08/2020 03:51:27 PMCCABR Comment: TO COVID-19 LAID OFFMBR AWARE OUT FOR REPO ADV ME ON CALLING HER BACK ON WED 6/10/20 FOR SOLUTIONVERIFIED DEMOS \r\n6466120143 06/08/2020 03:51:27 PMCCABR Comment: TT MEMBERNAME 608-206-9293 ADV ON PMTS DUE SINCE DEC 2019RFD STATED COVID-19 LAID OFFADV MBR ON MAKING PMTS FOR DEC JAN FEB AND MARCH AMT OF $1570 INCLUDING LATE FEES OF $42.90 ONCE THIS PMT IS MADE WE CAN OFFER A 3 MONTH DEFERRAL APRIL MAY JUNE DUE \r\n6466120143 06/08/2020 03:51:27 PMCCABR Call: Call Follow Up", + "userId": 1, + "created": "2020-03-09T09:31:08", + "type": 0 + }, + { + "name": "Comment", + "message": "E/M-LUVED99@GMAIL.COM \r\n6466120143 03/06/2020 03:05:22 PMREPO- RR SYSTEMRTC EXP 2/12/20, REPO DUE 12/10/19 @ 87DPDNO COMMUNICATION, LAST PAYMNT 1/17/20, SCRA NOT LISTED NO UPDATED POE INS EXP 8/15/20PLEASE START RECOVERY AT ADDY ON FILE \r\n6466120143 03/06/2020 03:05:47 PMUSERDEF CHNAGED FROM RECA TO RR \r\n6466120143 03/06/2020 03:26:56 PMISSUED TO LOCATION SERVICES", + "userId": 1, + "created": "2020-03-06T15:02:32", + "type": 0 + }, + { + "name": "Comment", + "message": "TCOTT Comment: E/M-LUVED99@GMAIL.COM \r\n6466120143 03/06/2020 03:05:22 PMTCOTT Comment: REPO- RR SYSTEMRTC EXP 2/12/20, REPO DUE 12/10/19 @ 87DPDNO COMMUNICATION, LAST PAYMNT 1/17/20, SCRA NOT LISTED NO UPDATED POE INS EXP 8/15/20PLEASE START RECOVERY AT ADDY ON FILE \r\n6466120143 02/10/2020 11:08:15 AM4735 Ltr-File: 60 Day Past Due Letter \r\n6466120143 02/10/2020 10:05:14 AMTCOTT Comment: E/M-LUVED99@GMAIL.COM", + "userId": 1, + "created": "2020-03-06T15:02:32", + "type": 0 + }, + { + "name": "Comment", + "message": "TCOTT Comment: NO RETRN CALL/PAYMNT NEXT FOLLOW UP BACK OUT FOR REPO \r\n6466120143 02/19/2020 11:59:04 AMTCOTT Message: MEMBERNAME WAGNER @ 608-206-9293 \r\n6466120143 03/17/2020 02:49:12 PMCCABR Call: Call Follow Up \r\n6466120143 02/26/2020 02:56:23 PMTCOTT Comment: N NEXT WEEK.. DEM STILL THE SME", + "userId": 1, + "created": "2020-02-19T11:59:32", + "type": 0 + }, + { + "name": "Comment", + "message": "Letter. The letter was sent to Address Home printed on 1/27/2020 11:41:32 AM. Letter \r\n6466120143 02/10/2020 12:00:00 AMLtr-File. The letter was sent to Address Home printed on 2/10/2020 11:16:29 AM. Ltr-File \r\n6466120143 02/19/2020 11:59:32 AMNO RETRN CALL/PAYMNT NEXT FOLLOW UP BACK OUT FOR REPO \r\n6466120143 02/26/2020 02:56:23 PMSPOKE W/ MEMBERNAME SHE STATED THAT SHE HAD TO GET A TON OF WRK DONE ON THE CAR, INFORMED HER THAT IM TRYONG TO KEEP HER FROM GOING OUT FOR REPO IF SHE SI ABLE TO MAKE DEC PAYMNT SUBMIT 2MNTH DEFRL FOR JAN AND FEB SHE SD THAR SHE WILL TRY TO GET SOMETHING IN NEXT WEEK.. DEM STILL THE SME", + "userId": 1, + "created": "2020-02-10T10:06:05", + "type": 0 + }, + { + "name": "Comment", + "message": "TCOTT Call: Call Follow Up \r\n6466120143 02/10/2020 10:04:18 AMTCOTT Message: MEMBERNAME WAGNER @ 608-206-9293 \r\n6466120143 03/11/2020 08:41:16 AMACEVE Comment: Emailed Tra \r\n6466120143 06/11/2020 09:59:16 AMCCABR Call: Call Follow Up", + "userId": 1, + "created": "2020-02-10T10:06:03", + "type": 0 + }, + { + "name": "Comment", + "message": "4735 Letter: RTC-WI-AUTO LOANS \r\n6466120143 06/08/2020 03:47:32 PMCCABR Contact Out: Called MEMBERNAME WAGNER @ 608-206-9293 \r\n6466120143 06/18/2020 03:34:48 PMCCABR Comment: RDN UPDATED 06/18/2020\t13:32\tLandmark Credit UnionCabrera, Cynthia\tClient-Account Re-OpenedYour client has requested that this account be taken off hold for the following reason:ABLE TO RELEASE HOLD IF NO PMTS AFTER COVID-19 \r\n6466120143 06/18/2020 03:31:25 PMCCABR Comment: REMOVED REHO ALERTS", + "userId": 1, + "created": "2020-01-27T11:41:28", + "type": 0 + }, + { + "name": "Comment", + "message": "SPOKE W/ MEMBERNAME SHE STATED THAT SHE WAS GOING TO CALL TODAY TO SEE WHAT SHE OWES, INFORMED HER THAT SHE HAS BEEN PLACED BACKOUT FOR REPO, IN ORDER TO PLACE REPO BACK ON HOLD I NEED $737.48 TO CLEAR OCT AND NOV PAYMENT.SHE SD THAT SHE CAN GETTHAT TO ME ON MONDAY, TOLD HER MONDAY IS HER CUT OFF DATE NO PAYMNT I HAVE TO COME AND PICK UP THE CAR, SHE SD OK.. \r\n6466120143 01/15/2020 11:47:18 AMUSERDEF CHANGED FROM O4R TO REHO \r\n6466120143 01/29/2020 09:14:49 AMPAYMNT RECVD FOR $750.00 LOAN 50DPD WILL CXL REPO AT THIS TIME \r\n6466120143 02/10/2020 10:05:14 AME/M-LUVED99@GMAIL.COM", + "userId": 1, + "created": "2020-01-15T11:46:01", + "type": 0 + }, + { + "name": "Comment", + "message": "E/M-LUVED99@GMAIL.COM \r\n6466120143 01/08/2020 03:01:24 PMRELEASED HOLD, NO RETRN CALLS. BRKN PTP FOR 12/27 \r\n6466120143 01/08/2020 03:02:13 PMUSERTDEF CHANGED FROM REHO BACK TO O4R/RELEASED HOLD IN RDN \r\n6466120143 01/15/2020 11:41:39 AMREVERSE ADDY GOES BACK TO MBR", + "userId": 1, + "created": "2020-01-03T08:42:16", + "type": 0 + }, + { + "name": "Comment", + "message": "SPOKE W/ MEMBERNAME INFORMED HER THAT SHES 99DPD AND I NEED UPDATE ON NEXT PAYMNT TO GET HER OUT OF REPO SHE ASKED TEH AMOUNT TOLD HER $548.39 WHICH $60 OF THAT CLEAR SEPT PAYMNT SHE SD THAT SHE WILL CALL BACK LATER TODAY OR TOMORROW.. TOLD HER I NEED A CB BY FRI \r\n6466120143 12/18/2019 04:51:09 PMMEMBERNAME CB IN TO PAY SD THAT SHE ONLY HAS $300 WILL PAY THE REMAINING NEXT FRI TOLD HER ONCE I GET THAT I WILL CXL REPO \r\n6466120143 12/18/2019 04:51:31 PMElectronic Cash Management (ECM) » SuccessYour transaction was successfully submitted for processing.Tracking Number: AN0E2B1ABD6B \r\n6466550-2 07/25/2019 11:02:32 AMKITTY CI FROM W.ALLIS BR MEM PAYING IN FULL CASH 197.42 I UPATED XP NOTES", + "userId": 1, + "created": "2019-12-18T15:30:45", + "type": 0 + }, + { + "name": "Comment", + "message": "tt MEMBERNAME stated car has been broken down front end and new tires does not have it in a shop has not been working for 2 months xfer to trenace vehile is out for repo verified demos \r\n6466120143 12/04/2019 08:31:39 AMProcessed pymt of $780 + $10 conv fee for Tra.Electronic Cash Management (ECM) » SuccessYour transaction was successfully submitted for processing.Tracking Number: AH0E2AD19FBE \r\n6466120143 12/10/2019 04:40:19 PME/M-LUVED99@GMAIL.COM \r\n6466120143 12/10/2019 04:40:36 PMNO RETRN CALL NEXT WEEK/PAYMNT RELEASING HOLD", + "userId": 1, + "created": "2019-12-03T17:00:17", + "type": 0 + }, + { + "name": "Comment", + "message": "SPOKE W/ MEMBERNAME SHE STATED THAT SHE ISNT WORKING AND CAN PAY $100 A WEEK TO GET CAUGHT UP ASKED HER WHAT WAS WRONG W/ THE CAR SHE SD NEEDS TIRES, SOME FROMT END WORK AND SUSPENSION INFORMED HER SHE WAS OUT FOR REPO, SHE ASKED WHAT WOULD SHE NEED TO PAY TO STOP REPO, INFORMED HER THAT I WOULD NEED $839.30 WHICH WILL CLEAR AUG AND SEPT PAYMNTS ONCE THAT IS MADE WE CAN DO A 2MNTH DEFRL FOR OCT AND NOV TO HELP HER GET CAUGHT UP SHE SD OK SHE WILL SEE WHAT SHE CAN DO.. INFORMED HER THAT I CANNOT STOP REPO UNTIL SHE GIVES ME A PAYMNT AND DATE SHE SD OK.. NO PAYMNT ARRGAMENTS MADE \r\n6466120143 12/03/2019 04:59:13 PMMEMBERNAME called back, she sd that she had the money she had $780 informd her of $10 fee she sd ok.. tookdebit card paymnt toldher ill place repoon hold she will have a bal of$59.30 still due for sept she sd thar she will probablybebale to pay iton fri at a branch dont wantto pay $10 for paymntsent paymnt over to deb to process, informed her once she clears the remaining bal for sept i will submit 2 mnth defrl \r\n6466120143 12/03/2019 04:59:43 PMrepo placed onhold in rdn \r\n6466120143 12/03/2019 04:59:59 PMuserdef changed from o4r to reho", + "userId": 1, + "created": "2019-12-03T14:40:46", + "type": 0 + }, + { + "name": "Comment", + "message": "TLO- ADDY STILL SHOWING CURRENT \r\n6466120143 11/29/2019 05:10:23 PMCALLED POE: 608-837-7722-EMP ANSWERED STATED THAT SHE WRKS SOME FRIDAYS MAY WRK TONIGHT***GENTLEMANS CLUB*** \r\n6466120143 11/29/2019 05:10:59 PMPOE ADDY:7653 COUNTY RD N SUN PRAIRIE, WI 53590UPDATED RDN TO RUN ADDY \r\n6466120143 11/29/2019 12:00:00 AMREPO- RR SYSTEMRTC EXP 10/11/19 REPO DUE 8/10/19@ 102DPDNO COMMUNICATION, LAST PAYMNT 8/14/19, NO UPDATED POE, SCRA NOT LISTED, INSURED W/ FOUNDERSPLEASE STARR RECOVERY AT ADDY ON FILE", + "userId": 1, + "created": "2019-11-29T17:07:43", + "type": 0 + }, + { + "name": "Comment", + "message": "TLO-608-209-8420-BUSY \r\n6466120143 11/29/2019 05:06:06 PMTLO-608-285-5999-VM NOT SET UP \r\n6466120143 11/29/2019 05:06:42 PMTLO-608-219-1792-VM STATED MARK-DIDNT LEAVE MSG \r\n6466120143 11/29/2019 05:07:27 PME/M-davewagner@gmail.com", + "userId": 1, + "created": "2019-11-29T17:05:45", + "type": 0 + }, + { + "name": "Comment", + "message": "NO RETRN CALL OR PAYMNT OUT FOR RECOVERY NEXT FOLLOW UP \r\n6466120143 11/20/2019 04:24:22 PMEMAIL TRA TO PUT OUT FOR REPO BASED ON PREVIOUS NOTES 11.05.2019..PUT THE REPO REF CODE ON THE ACCT \r\n6466120143 11/21/2019 01:27:45 PMISSUED TO LOCATION SERVICES \r\n6466120143 11/22/2019 05:50:30 PMApproved REPO- RR SYSTEMRTC EXP 10/11/19 REPO DUE 8/10/19@ 103 DPDNO COMMUNICATION, LAST PAYMNT 8/14/19, NO UPDATED POE, SCRA NOT LISTED, INSURED W/ FOUNDERS", + "userId": 1, + "created": "2019-11-05T12:52:29", + "type": 0 + }, + { + "name": "Comment", + "message": "TRUEPOEOPLE SEARCH:Current Address 2636 Milwaukee St Madison, WI 53704-5120 \r\n6466120143 11/05/2019 12:47:28 PMCCAPS-1/29/19:Speeding in 55 MPH Zone (11-15 MPH)SAME ADDY LISTED \r\n6466120143 11/05/2019 12:49:36 PMCBR PULLED:ADDY STILL THE SAMEPOE LISTED: SELF EMPLYDNO MTRGQUITE A FEW OPEN CREDIT ACCTS \r\n6466120143 11/05/2019 12:51:15 PMSCRA-NOT LISTED", + "userId": 1, + "created": "2019-11-05T12:46:34", + "type": 0 + }, + { + "name": "Comment", + "message": "e/m davewagner@gmail.comlilbabigoddess@yahoo.comcengleson@hotmail.com \r\n6466120143 11/05/2019 12:44:22 PMCALLED 608-209-8420-NOT IN SERVICE \r\n6466120143 11/05/2019 12:45:33 PMTRUEPEOPLESEARCH-608-446-5497-DSNTD \r\n6466120143 11/05/2019 12:46:08 PMTRUEPEOPLESERACH-608-285-5999-LEFT VM", + "userId": 1, + "created": "2019-10-29T00:00:00", + "type": 0 + }, + { + "name": "Comment", + "message": "skip searchPOE, Gentlemens club, sun praire, shows this possible MEMBERNAME Wagner in Sun prairie but that MEMBERNAME is 24, not the age of our menber.tried to utilize a card from Thomas D. Payton back in August but declined, member had Thomas on the phone. 823 N Gammon Rd Madison, WI 608 831 6961 \r\n6466120143 10/24/2019 12:00:00 AMe/m LUVED99@GMAIL.COM \r\n6466120143 10/24/2019 12:34:15 PMTLOPOEBusiness Name: CLUB BRISTOLPhone: (608) 209-8420 TEMP NOT IN SERVICE POSSIBLE NUMBER (608) 209-8420 POSSIBLE EMAIL davewagner@gmail.comlilbabigoddess@yahoo.comcengleson@hotmail.comADDY 18 WOODRIDGE CT APT 7, MADISON, WI 53704-7889 (DANE COUNTY) (07/2016 to 10/24/2019) CURRENT VEHICLE1999 BUICK -Series: CUSTOM -Model: CENTURYVIN: 2G4WS52M4X1613864 Most Current Tag #: WI 580YFJ Valid from: (10/03/2018 to 11/19/2019)GLOBAL WATCH LIST Name: DANIELA GOZES-WAGNER Address: DANBURY, CT 06811 Match Score: 69 Source: System for Award Management Exclusions Type: INDIVIDUAL Wanted By: HHS Program: PROHIBITION/RESTRICTION Legal Basis: RECIPROCAL Country: USA \r\n6466120143 10/29/2019 03:59:25 PMACCURINT SEARCHSAME ADDY AS ON FILE NO NUMBERS LISTED", + "userId": 1, + "created": "2019-10-23T12:23:36", + "type": 0 + }, + { + "name": "Comment", + "message": "Letter. The letter was sent to Address Home printed on 10/9/2019 11:08:01 AM. Letter \r\n6466120143 10/09/2019 12:00:00 AMLetter. The letter was sent to Address Home printed on 9/25/2019 9:53:00 AM. Letter \r\n6466120143 10/11/2019 12:00:00 AMLtr-File. The letter was sent to Address Home printed on 10/11/2019 10:01:58 AM. Ltr-File \r\n6466120143 10/23/2019 12:10:51 PMskip FB nothing", + "userId": 1, + "created": "2019-10-09T11:10:51", + "type": 0 + }, + { + "name": "Comment", + "message": "608-209-8420 Temporarily not in service. \r\n6466120143 10/09/2019 11:03:14 AMI emailed MEMBERNAME at LUVED99@GMAIL.COM to call us back. \r\n6466120143 10/09/2019 11:04:50 AMPOE (per loan app & notes) is Club Bristol. Phone: 608-566-4456. \r\n6466120143 10/09/2019 11:06:59 AMCalled out on 608-566-4456. A man named Jimmy Johnson answered. It was not the phone number for Club Bristol. Wrong number.", + "userId": 1, + "created": "2019-10-09T11:01:43", + "type": 0 + }, + { + "name": "Comment", + "message": "she cd sd wd figure it out & call back in a day or two since pmt rejected \r\n6466120143 09/03/2019 12:00:00 AMLtr-File. The letter was sent to Address Home printed on 9/3/2019 9:54:25 AM. Ltr-File \r\n6466120143 09/11/2019 12:00:00 AMLtr-File. The letter was sent to Address Home printed on 9/11/2019 10:57:48 AM. Ltr-File \r\n6466120143 10/09/2019 11:00:40 AMPer Allied website, the vehicle is insured. Current policy with Founders began on 8/14/19 and expires on 2/15/20. Member had a previous lapse in coverage from 3/5/19 to 8/14/19.", + "userId": 1, + "created": "2019-08-15T14:40:32", + "type": 0 + }, + { + "name": "Comment", + "message": "****PAYMENT REJECTED FOR $1,000 DUE TO VISA*******CALLED MEMBERNAME BACK AND LM ON HER VM TO CALL ME BACK WITH MY DIRECT EXTENSION AND OUR COLLECTIONS LINE. I need to inform her that we need a Visa Debit Card and that this credit payment would not process!! \r\n6466120143 08/12/2019 05:02:06 PMSpoke MEMBERNAME and she is aware the payment was rejected and she will figure something out \r\n6466120143 08/12/2019 12:00:00 AMLtr-File. The letter was sent to Address Home printed on 8/12/2019 9:18:51 AM. Ltr-File \r\n6466120143 08/12/2019 12:00:00 AMMember called in verf demos, took a PTP: $1,000.00 from a credit card of Thomas D. Payton for today using his visa, he gave us permission to take $1,010.00 including the convenience fee, explained to her that her entire July payment isn't complete and that if there are any issues with the payment my supervisor needs to run i'll call back", + "userId": 1, + "created": "2019-08-12T16:24:02", + "type": 0 + }, + { + "name": "Comment", + "message": "MEMBERNAME c/n verified her demos, stressed SOA and pymnt. Rfd-CPI added. the member confirmed she does not have insurance and should have it by next week Tuesday. MEMBERNAME will try to pay the balance of Mays pymnt next week. I advised enough in the savings to make the pymnt. The member does not remember having money in the sav ; but, advised to add all of it toward the loan. \r\n6466120143 07/31/2019 12:39:29 PMmntq-plz xfer $210.12 from 6466120-1 and apply to 6466120143. Thank you. \r\n6466120143 07/31/2019 12:39:44 PM608)209-8420 lvm \r\n6466120143 08/01/2019 12:00:00 AMLtr-File. The letter was sent to Address Home printed on 8/1/2019 10:51:36 AM. Ltr-File", + "userId": 1, + "created": "2019-07-31T12:39:29", + "type": 0 + }, + { + "name": "Comment", + "message": "TT MEMBERNAME SD THAT SHE WILL MKE A PMT BETWEEN $300.00-$400.00 BY 07/26/19 AND WILL MKE ANOTHER PMT THE FOLLOWING WEEKLY DID NOT CONFIRM THE AMOUNT EXPLAIN THAT SHE WILL NEED TO MKE A FULL PMT $568.19 RFD RENT CAR REPAIRSVERIFIED DEMOS \r\n6466120143 07/30/2019 12:00:00 AMe/m LUVED99@GMAIL.COM \r\n6466120143 07/31/2019 09:09:03 AMTransfer done. \r\n6466120143 07/31/2019 12:39:27 PMmbr 51 dpd", + "userId": 1, + "created": "2019-07-24T11:57:44", + "type": 0 + } + ], + "temenosAccount": { + "accountId": 491780, + "accountIdentifier": "6466120143", + "accountNumber": "6466120", + "accountStatus": "Written Off", + "accountTypeId": 1016, + "accountType": { + "id": 1016, + "description": "Miscellaneous", + "code": "MISC" + }, + "activeFlag": true, + "amountLastPaid": 900, + "balance": 13862.46, + "bankruptcyFlag": false, + "branch": "57", + "dueDate": "2020-02-10T00:00:00", + "firstPaymentDueDate": "2017-02-10T00:00:00", + "loanOfficer": "JAMIE JOHNSON", + "originalLoanAmount": 22604.29, + "originalLoanDate": "2016-12-27T00:00:00", + "dqAmount": 0, + "daysDq": 247, + "suffix": "143", + "linkedAccount": "6466120143", + "productType": "98", + "closedDate": null, + "dateLastPaid": "7/29/2020 12:00:00 AM", + "dateFirstDelinquent": "9/9/2019 12:00:00 AM", + "cases": [ + { + "caseId": 306, + "caseNumber": "FRAUD-00000306", + "caseDescription": "", + "caseStageId": 2000048, + "repoStatus": 999, + "caseStatusId": 34, + "caseTitle": "test", + "caseTypeBasisId": 3, + "caseTypeId": 5, + "closedDate": null, + "createdDate": "2020-09-18T10:57:57.657", + "createdUserId": 17, + "currentStageDate": "2020-09-18T10:57:57.613", + "currentStatusDate": "2020-09-18T10:57:57.613", + "lastReviewDate": null, + "nextReviewDate": null, + "stage1CompletionDate": null, + "stage2CompletionDate": null, + "stage3CompletionDate": null, + "stage4CompletionDate": null, + "stage5CompletionDate": null, + "titleOrdered": false, + "titleOrderedDate": null, + "redemptionExpiredDateIl": null, + "redemptionExpiredDateWi": null, + "customFieldMap": { + "Case Modification Status": "", + "Case Loss Mitigation Stage": "", + "Case Loss Mitigation Type": "", + "Case Loss Mitigation Status": "", + "BRP Hardship Letter": "", + "BRP Bank Statements": "", + "BRP Paycheck Stubs": "", + "BRP Other Income If Applicable": "", + "BRP Tax Returns": "", + "BRP 4506T Form Signed": "", + "BRP Financial Worksheet": "", + "BRP 1st Mortgage Statement": "", + "BRP HOI Declaration Page": "", + "BRP Escrow Authorization Signed": "", + "BRP Additional Information Needed": "", + "Def Fore Financial Filed": "", + "Def Fore Case Number": "", + "Def Fore Date Filed": "", + "Def Fore Property Address is Mailing Address": "", + "Def Fore Property Address if not Mailing Address": "", + "Def Fore Attorney Name": "", + "Def Fore Attorney Number": "", + "Fore Referral Date": "", + "Fore SCRA Checked Date": "", + "Fore RTC Expiration Date": "", + "Fore On Hold Date": "", + "Fore On Hold Reason": "", + "Fore Reinstated Date": "", + "Fore Withdrawn Date": "", + "Fore Withdrawn Reason": "", + "Fore Withdrawn Reason If Other": "", + "Fore Date Last Payment": "", + "Fore Sale Scheduled Date": "", + "Fore Confirmation Scheduled Date": "", + "Fore Confirmation Complete Date": "", + "Fore Sale Result": "", + "Collection Agency": "False", + "Todays Date Case Lvl": "", + "DQ Amount Case Lvl": "", + "Performance Pymnts Case Lvl": "", + "Late Charges Case Lvl": "", + "Repo Fees Case Lvl": "", + "Redemption Amount Case Lvl": "0.0000", + "Balance Due Case Lvl": "", + "Legal Requested State Case Lvl": "", + "Judgement Dropdown Case Lvl": "", + "Attorney Firm Case Lvl": "", + "Documents Sent Date Case Lvl": "", + "Date Sent to Attorney Case Lvl": "", + "Date Served Case Lvl": "", + "Attorney Invoice Number Case Lvl": "", + "WRIT Flag Case Lvl": "False", + "Date Last RTC Letter Sent Case Lvl": "", + "RTC Sent Flag Case Lvl": "False", + "WRIT Date Case Lvl": "", + "Bond Obtained Flag Case Lvl": "False", + "Bond Obtained Date Case Lvl": "", + "Sent to Sheriff Date Case Lvl": "", + "Garnishment Employer Case Lvl": "", + "Financial Disclosure Sent Flag Case Lvl": "False", + "Garnishment Paying Flag Case Lvl": "False", + "Garnishment Review Date Case Lvl": "", + "Post Judgement Rate Case Lvl": "", + "Judgement Property Address 1 Case Lvl": "", + "Judgement Property Address 2 Case Lvl": "", + "Judgement Property Address 3 Case Lvl": "", + "Docket Date 1 Case Lvl": "", + "Docket Date 2 Case Lvl": "", + "Docket Date 3 Case Lvl": "", + "Stip Payment Amount Case Lvl": "", + "Stip Payment Frequency Case Lvl": "", + "Stip Total Amount Case Level": "", + "Legal Closed Reason Case Lvl": "" + }, + "dateRepossessed": null, + "repoTypeId": "", + "repoType": 0, + "dateRepoAssigned": null, + "repoAgentId": null + }, + { + "caseId": 479, + "caseNumber": "RPP-00000479", + "caseDescription": "", + "caseStageId": 2000048, + "repoStatus": 999, + "caseStatusId": 33, + "caseTitle": "RPP-00000479", + "caseTypeBasisId": 6, + "caseTypeId": 27, + "closedDate": null, + "createdDate": "2020-10-05T08:52:35.89", + "createdUserId": 52, + "currentStageDate": "2020-10-05T08:52:35.343", + "currentStatusDate": "2020-10-05T08:52:35.343", + "lastReviewDate": null, + "nextReviewDate": null, + "stage1CompletionDate": null, + "stage2CompletionDate": null, + "stage3CompletionDate": null, + "stage4CompletionDate": null, + "stage5CompletionDate": null, + "titleOrdered": false, + "titleOrderedDate": null, + "redemptionExpiredDateIl": null, + "redemptionExpiredDateWi": null, + "customFieldMap": { + "Case Modification Status": "", + "Case Loss Mitigation Stage": "", + "Case Loss Mitigation Type": "", + "Case Loss Mitigation Status": "", + "BRP Hardship Letter": "", + "BRP Bank Statements": "", + "BRP Paycheck Stubs": "", + "BRP Other Income If Applicable": "", + "BRP Tax Returns": "", + "BRP 4506T Form Signed": "", + "BRP Financial Worksheet": "", + "BRP 1st Mortgage Statement": "", + "BRP HOI Declaration Page": "", + "BRP Escrow Authorization Signed": "", + "BRP Additional Information Needed": "", + "Def Fore Financial Filed": "", + "Def Fore Case Number": "", + "Def Fore Date Filed": "", + "Def Fore Property Address is Mailing Address": "", + "Def Fore Property Address if not Mailing Address": "", + "Def Fore Attorney Name": "", + "Def Fore Attorney Number": "", + "Fore Referral Date": "", + "Fore SCRA Checked Date": "", + "Fore RTC Expiration Date": "", + "Fore On Hold Date": "", + "Fore On Hold Reason": "", + "Fore Reinstated Date": "", + "Fore Withdrawn Date": "", + "Fore Withdrawn Reason": "", + "Fore Withdrawn Reason If Other": "", + "Fore Date Last Payment": "", + "Fore Sale Scheduled Date": "", + "Fore Confirmation Scheduled Date": "", + "Fore Confirmation Complete Date": "", + "Fore Sale Result": "", + "Collection Agency": "False", + "Todays Date Case Lvl": "", + "DQ Amount Case Lvl": "", + "Performance Pymnts Case Lvl": "", + "Late Charges Case Lvl": "", + "Repo Fees Case Lvl": "", + "Redemption Amount Case Lvl": "0.0000", + "Balance Due Case Lvl": "", + "Legal Requested State Case Lvl": "", + "Judgement Dropdown Case Lvl": "", + "Attorney Firm Case Lvl": "", + "Documents Sent Date Case Lvl": "", + "Date Sent to Attorney Case Lvl": "", + "Date Served Case Lvl": "", + "Attorney Invoice Number Case Lvl": "", + "WRIT Flag Case Lvl": "False", + "Date Last RTC Letter Sent Case Lvl": "", + "RTC Sent Flag Case Lvl": "False", + "WRIT Date Case Lvl": "", + "Bond Obtained Flag Case Lvl": "False", + "Bond Obtained Date Case Lvl": "", + "Sent to Sheriff Date Case Lvl": "", + "Garnishment Employer Case Lvl": "", + "Financial Disclosure Sent Flag Case Lvl": "False", + "Garnishment Paying Flag Case Lvl": "False", + "Garnishment Review Date Case Lvl": "", + "Post Judgement Rate Case Lvl": "", + "Judgement Property Address 1 Case Lvl": "", + "Judgement Property Address 2 Case Lvl": "", + "Judgement Property Address 3 Case Lvl": "", + "Docket Date 1 Case Lvl": "", + "Docket Date 2 Case Lvl": "", + "Docket Date 3 Case Lvl": "", + "Stip Payment Amount Case Lvl": "", + "Stip Payment Frequency Case Lvl": "", + "Stip Total Amount Case Level": "", + "Legal Closed Reason Case Lvl": "" + }, + "dateRepossessed": null, + "repoTypeId": "", + "repoType": 0, + "dateRepoAssigned": null, + "repoAgentId": null + } + ], + "customFieldMap": { + "Charge Off Status": "", + "Foreclosure Status - Lookup": "", + "Reason for Charge Off": "", + "Post Charge Off Intentions": "", + "BK Discharged Flag": "False", + "BK Reaffirmed Flag": "False", + "Fraud Suspected Flag": "False", + "Management Review Flag": "False", + "Balance at time of Charge Off": "", + "Date Approved for Charge Off": "", + "Date Approved for Foreclosure": "", + "Date Approved for Legal": "", + "Date Approved for Repo": "", + "Foreclosure Requested Flag": "False", + "Legal Requested Flag": "False", + "Lookup Value 4 - Lookup": "", + "Lookup Value 5 - Lookup": "", + "Repo Requested Flag": "False", + "Status Code 1": "", + "Status Code 2": "", + "Status Code 3": "", + "Status Code 4": "", + "Status Code 5": "", + "External Loan Number": "", + "Product Code": "204459", + "Product Name": "LOANS WRITTEN OFF", + "CORS Court Name": "", + "Loan Type": "98", + "Original Interest Rate": "9.4500", + "Original Rate Type": "F", + "Current Rate Type": "", + "Current Rate Term": "75", + "Required Payment Amount": "0.0000", + "Times Late Count": "", + "Times Late 30 Days Count": "7", + "Times Late 60 Days Count": "3", + "Times Late 90 Days Count": "2", + "Troubled Debt Restructure": "False", + "Modification Date": "", + "Modification Count": "", + "Modification Type": "", + "Financial Condition": "", + "Modification Reason": "", + "Membership Address 1": "", + "Membership Address 2": "", + "Membership City": "", + "Membership State Code": "", + "Membership Postal Code": "", + "User Status Code 1": "O4R", + "User Status Code 2": "TCIN", + "Intellect Permanent Comments": "**********************OUT FOR REPO 6/18/20CC************************** 143 RTC $975.11 Exp.2/12/20 143-file scanned 7/26/18 POEU/E**6/8/20CA TCPA 8-12-19 SW", + "PRI Metro 2 Code": "", + "S1 Metro 2 Code": "", + "S2 Metro 2 Code": "", + "PRI Metro 2 Code Description": "", + "S1 Metro 2 Code Description": "", + "S2 Metro 2 Code Description": "", + "PRI Affiliation Description": "", + "S1 Affiliation Description": "", + "S2 Affiliation Description": "", + "CORS Employer Address 1": "", + "CORS Employer Address 2": "", + "CORS Employer City": "", + "CORS Employer State Code": "", + "CORS Employer Postal Code": "", + "CORS Employer Comment": "", + "CORS Loan CORS date": "", + "CORS Demand Agency": "", + "CORS Assigned Agency": "", + "CORS Bankruptcy Case Number": "", + "CORS Bankruptcy File Date": "", + "CORS Bankruptcy Discharged Date": "", + "CORS Consumer Info Indicator": "False", + "CORS Trustee Name": "", + "CORS Bankruptcy Comment": "", + "CORS Motion Date": "", + "CORS Judgement Recordation": "", + "CORS Judgement Amount": "", + "CORS Judgement Status": "", + "CORS Judgement Comment": "", + "CORS Transaction Code": "", + "CORS Payment Amount": "", + "CORS Payment Frequency": "", + "CORS Payment Start Date": "", + "CORS User Assigned Name": "", + "CORS User Assigned Start Date": "", + "CORS User Assigned End Date": "", + "CORS Workflow Entered Date": "", + "CORS Workflow To Do Date": "", + "CORS Workflow Completed By Date": "", + "CORS Workflow User Name": "JEANNE STELLA", + "CORS Workflow Action Description": "Loan Comment", + "CORS Workflow Comment": "incoming call from 608-206-92", + "Organization Number": "", + "Client Number": "", + "Date High Balance": "", + "External Status Date 1": "", + "External Status 2": "", + "External Status Date 2": "", + "Insurance Code 1": "", + "Insurance Status 1": "", + "Insurance Status 2": "", + "Insurance Code 2": "", + "Insurance Status 3": "", + "Insurance Code 3": "", + "Most Recent Credit Score": "", + "Credit Score Less Recent": "", + "Relationship Flag": "", + "Relationship Number": "", + "S1 Original Credit Union": "", + "S1 Most Recent Credit Score": "", + "S1 Credit Score Less Recent": "", + "Client Name": "", + "Mortgage Insurer": "", + "Last Analyzed Date": "", + "Deferred Principal Balance": "", + "Prepetition Unapplied Balance": "", + "Stipulation Unapplied Balance": "", + "Other Funds Payment Amount": "", + "Assistance Payment Amount": "", + "Reserve Account Payment Amount": "", + "Default Interest Amount": "", + "Last NSF Fee Date": "", + "Last Letter Date": "", + "Other Fee Amount": "", + "Last Late Charge Waived Date": "", + "Last Late Charge Waived Amount": "", + "Next Late Charge Amount": "", + "Times Late LOL Count": "", + "Times Late Last 12 Months Count": "", + "Times Late 120 Days Count": "", + "Times Late 150 Days Count": "", + "Times Late 180 Days Count": "", + "First Payment Due Date": "", + "Maturity Type Description": "", + "Inspection Ordered Date": "", + "Last Inspection Date": "", + "Inspection Received Date": "", + "Current Occupancy Code": "", + "Inspected By": "", + "Property Type Description": "", + "Property Condition Description": "", + "Neighborhood Condition": "", + "Collateral 1 Property Type Code": "", + "Collateral 1 Lein Position": "", + "Bankruptcy Case Number": "", + "Bankruptcy Date Filed": "", + "DNU Bankruptcy Chapter Filed": "", + "Bankruptcy Claim Number": "", + "Bankruptcy Trustee Claim Number 1": "", + "Bankruptcy Trustee Claim Number 2": "", + "Bankruptcy Trustee Claim Number 3": "", + "Bankruptcy Name": "", + "Bankruptcy Event Code": "", + "Bankruptcy Event Legal": "", + "Bankruptcy Event Warning": "", + "Active Bankruptcy Flag": "False", + "Active Bankruptcy Plan Flag": "False", + "Bankruptcy Payment Status Date": "", + "Bankruptcy Milestone Due Date": "", + "Bankruptcy Milestone Completion Date": "", + "Bankruptcy Milestone Scheduled Date": "", + "Bankruptcy Milestone Actual Date": "", + "Bankruptcy Servicer Only": "", + "Contact Promise Date 1": "", + "Contact Promise Amount 1": "", + "Contact Promise Date 2": "", + "Contact Promise Amount 2": "", + "Contact Promise Date 3": "", + "Contact Promise Amount 3": "", + "Contact Reason": "", + "Contact Demeanor": "", + "Contact Outcome": "", + "Contact Permanent Comments": "", + "Legal Fee Amount": "", + "Collateral 1 Seller Name": "", + "Collateral 2 Seller Name": "", + "Collateral 3 Seller Name": "", + "Net Capitalized Cost Amount": "", + "Total Payments Count": "", + "Times Late 90 Plus Days Count": "", + "Late Fee Amount": "", + "Date 22 Day Letter Sent": "", + "Date 32 Day Letter Sent": "", + "Date 60 Day Letter Sent": "", + "Collateral 1 Legal Description": "", + "Collateral 2 Legal Description": "", + "Collateral 3 Legal Description": "", + "Collateral 4 Legal Description": "", + "SD Contact Follow Up Date": "", + "CORS Next Follow Up Date": "7/20/2020 12:00:00 AM", + "Waive Fee Reason DropDown": "", + "Waive Fee Reason Dropdown Spanish": "", + "Case Stages 1": "2000122", + "Dollar Amount": "", + "Case Stages 2": "", + "SCRA Flag": "False", + "TCPA Consent": "7003", + "Request Outcome": "", + "Request Outcome Date": "", + "Offset Request Reason DropDown": "", + "Intellect Next Follow Up Date": "7/15/2020 12:00:00 AM", + "Original Product Type": "67", + "Recovery Branch": "1", + "Reason For Repo": "", + "Repo Recovery Address": "", + "Right to Cure Expired": "False", + "RTC Expiration Date": "", + "Repo Type": "", + "Repossession Type": "", + "Secondary Recovery Address": "", + "Redemption Calc WI Perfrmnce Pymnts": "1467.2700", + "Redemption Calc WI Repo Fees": "", + "Redemption Calc WI Total Due": "1477.2700", + "Redemption Calc WI Exp Date": "", + "Redemption Date Current Date": "10/12/2020 12:00:00 AM", + "Redemption Calc WI Expiration Date": "10/27/2020 12:00:00 AM", + "Investor": "", + "Money Field 2": "", + "Money Field 1": "", + "Loan Status": "Payment Scheduled Q", + "Redemption Calc IL 30 Percent Amnt Paid": "6781.2870", + "Redemption Calc IL 30 Percent Yes or No": "True", + "Redemption Calc IL Total Due": "10.0000", + "Redemption Calc IL Exp Date": "", + "Current LTV Amount": "", + "Original LTV Amount": "", + "Redemption Calc IL Repo Fees": "", + "Redemption Calc IL Expiration Date": "11/2/2020 12:00:00 AM", + "Repo Agencies": "", + "Bankruptcy Trustee": "", + "Title Ordered": "False", + "Title Received": "False", + "Vehicle ReTitled": "False", + "Title Ordered Date": "", + "ReTitled Date": "", + "Title Received Date": "", + "X Deceased Flag Dont Use": "False", + "CPI Active": "False", + "Branch Location": "", + "Collection Agency": "2000177", + "Consumer Credit Counseling Services Flag": "False", + "Skip Trace Requested": "False", + "Loss Mitigation Status": "", + "Judgement Dropdown": "", + "Claim Type": "", + "Refund Status": "", + "Maintenance Requested": "False", + "BK Chapter": "", + "Settlement": "False", + "Repayment Plan Status": "8786", + "BK No Reaffirmation Flag": "False", + "test": "", + "Totaled Vehicle": "False", + "Fees Due": "0.0000", + "Original Input Code": "P1", + "Fraud Status": "", + "CORS Recovery Amt": "900.0000", + "CORS Recovery Amount Principal": "900.0000", + "Expense Applied Amount": "0.0000", + "Interest Applied Amount": "0.0000", + "Exp Amp": "52.9000", + "Input Code": "L-WO", + "Report Blank": "", + "Totaled Vehicle Notification Date": "", + "Warranty Cancellation Date": "", + "Refunds Requested Date": "", + "Repayment Plan Active": "True", + "Estate Attorney": "", + "Estate Attorney Phone Number": "", + "Personal Representative": "", + "Final Date to File Claim": "", + "Estate Closing Dates": "", + "Date Entered to Probate Finder": "", + "Date Notified Deceased": "", + "Death Notification Type": "", + "Visible Assets": "False", + "CCCS Status": "", + "Consumer Credit Counseling Service Company": "", + "CCCS Amount Approved": "", + "CCCS Decision Date": "", + "Settlement Amount": "", + "Primary Insurance Company": "", + "Primary Insurance Company Phone Number": "", + "Claim Number": "", + "Date of Loss": "", + "Totaled Vehicle Mileage": "", + "Totaled Vehicle Settlement Amount": "", + "Totaled Vehicle Warranty Refund": "", + "Totaled Vehicle Refunds Received Date": "", + "Totaled Vehicle Refunds Received Amount": "", + "GAP Payment Received Date": "", + "Defensive Foreclosure Flag Do Not Use": "False", + "Defensive Foreclosure Flag": "False", + "Collateral Still Exists Flags": "False", + "Bankrupt Collectible Non Filing Borrower Flag": "False", + "Manual Transfer Amount": "", + "Manual Transfer Frequency": "", + "Transfer From Account": "", + "Transfer To Account": "", + "CBR Request": "", + "CBR Date Received": "", + "Additional CBR Information Needed": "", + "CBR Approved": "", + "CBR Yes No Reason": "", + "BRP Sent Flag": "False", + "BRP Sent Date": "", + "Manual Transfer Start Date": "", + "Loss Mitigation Stage": "", + "Loss Mitigation Type": "", + "Date Last RTC Letter Sent": "", + "Skip Trace Phone No1": "", + "Skip Trace Phone No2": "", + "Skip Trace Phone No3": "", + "Skip Trace Phone No4": "", + "Skip Trace Phone No5": "", + "Skip Trace Phone No6": "", + "Skip Trace Phone No7": "", + "Skip Trace Phone No8": "", + "Skip Trace Phone No9": "", + "Skip Trace Phone No10": "", + "Skip Trace Address No1": "", + "Skip Trace Address No2": "", + "Skip Trace Address No3": "", + "Skip Trace Address No4": "", + "Skip Trace Address No5": "", + "Skip Trace Address No6": "", + "Skip Trace Email No1": "", + "Skip Trace Email No2": "", + "Skip Trace Email No3": "", + "Skip Trace Email No4": "", + "Skip Trace Email No5": "", + "Skip Trace POE No1": "", + "Skip Trace POE No2": "", + "Skip Trace Comments": "", + "TLO Basic Flag": "False", + "TLO Comprehensive Flag": "False", + "DRN Flag": "False", + "RDN Flag": "False", + "CarFax Flag": "False", + "Equifax Flag": "False", + "Facebook Flag": "False", + "Skip Trace Date": "", + "GainLoss Value Amount": "", + "GainLoss Value Date": "", + "GainLoss Senior Balance": "", + "GainLoss Senior Name": "", + "GainLoss Value Source": "", + "GainLoss Outstanding Taxes": "", + "GainLoss Marketing Costs": "5000.0000", + "GainLoss 1yr Taxes": "", + "GainLoss Review Date": "", + "GainLoss Marketing Commission": "0.0000", + "GainLoss Total Amount": "-18862.4600", + "Collection Agency Flag": "False", + "Chapter 128 Flag": "False", + "Chapter 128 Case Number": "", + "Chapter 128 Date Filed": "", + "CORS Trustee Number": "", + "CORS Trustee Address": "", + "CORS Trustee Email": "", + "CORS Loan type Description": "L-P1- Dealer Used Auto/Truck", + "Host Code": "L-P1", + "CORS Initial Charge Off Balance Amount": "14762.4600", + "CORS Initial Charge Off Date": "7/8/2020 12:00:00 AM", + "CORS Initial Principal Amount": "14762.4600", + "CORS Initial Interest Amount": "449.7700", + "CORS Initial Expense Amount": "52.9000", + "CORS Transfer Date": "7/8/2020 12:00:00 AM", + "CORS Initial Interest Rate Type": "Fixed Rate", + "CORS Initial Interest Rate Percent": "9.4500", + "CORS Initial Day Count": "", + "CORS Current Principal Amount": "13862.4600", + "CORS Current Interest Amount": "801.6000", + "CORS Current Expense Amount": "52.9000", + "CORS Curent Non Reimbursable Expense Amount": "0.0000", + "CORS Current Other Amount": "0.0000", + "CORS Non Reimbursable Other Amount": "0.0000", + "CORS Current Loan Balance Amount": "14716.9600", + "Attorney Firm": "", + "Legal Requested State": "", + "Garnishment Flag": "False", + "Money Judgement Flag": "False", + "Replevin Judgement Flag": "False", + "Stipulation Flag": "False", + "Summary Judgement Flag": "False", + "Wage Assignment Flag": "False", + "Date No Phone Number Letter Sent": "" + } + }, + "loanDetail" : { + "MemberId": 6466120, + "LoanId": 143, + "ExternalLoanId": 0, + "IndividualId": [ + 943900 + ], + "Borrowers": [ + { + "IndividualId": 943900, + "Name": "MEMBER MEMBER", + "Type": "Borrower", + "Address": "18 WOODRIDGE CT APT 7 , MADISON, WI 53704-7889", + "TaxId": "399-04-1120", + "Association": "Individual Contract (Primary)", + "LastAssociationCodeChangedDate": "2017-02-03T00:00:00", + "Metro2ConsumerInformationIndicator": "", + "CoborrowerIsSpouse": false, + "OwnershipPercentage": 0.0, + "PercentageDescription": "" + } + ], + "LoanType": "Regular Loan", + "Title": "LOANS WRITTEN OFF", + "Alerts": "0", + "Product": "LOANS WRITTEN OFF", + "ProductCode": 98, + "Template": "Regular Loan", + "ProductId": 204459, + "ProductDescription": "", + "ProductCategory": "Loan", + "ProductClass": "Regular Loan", + "AccountType": 98, + "Status": "Written Off", + "ClosedDate": "0001-01-01T00:00:00", + "Category": "", + "Classification": "", + "MetroAcctType": "00", + "SMSA": "", + "Officer": "5749", + "OtherSecurity": " ", + "NoteNumber": "997071", + "LastMaintenance": "0001-01-01T00:00:00", + "WrittenOffDate": "2020-07-08T00:00:00", + "CreditCardNumber": "", + "LastCycleDate": "0001-01-01T00:00:00", + "LegalDescription": "", + "PropertyType": "", + "PurposeCode": "", + "CollateralCode": "", + "RefinanceCount": "0", + "LastRefinanceDate": "0001-01-01T00:00:00", + "LdcNumber": "", + "Messages": "", + "OriginalAmount": 22604.29, + "OriginationDate": "2016-12-27T00:00:00", + "Balance": 13862.46, + "AvailableBalance": 0.0, + "Limit": 0.0, + "EscrowBalance": 0.0, + "Payoff": 13862.46, + "UnappliedFundsBalance": 0.0, + "CashAdvanceBalance": 0.0, + "PurchaseAdvanceBalance": 0.0, + "ActiveAuthorizationAmount": 0.00, + "EscrowDividends": 0.0, + "PledgeType": "", + "MiscCharge1": "$0.00", + "MiscCharge2": "$0.00", + "MiscCharge3": "", + "MiscChargeCode1": "", + "MiscChargeCode2": "", + "MiscChargeCode3": "", + "InterestMemoed": 0.00, + "InterestAccruedDate": "2020-07-29T00:00:00", + "PaymentInterestDue": 0.00, + "PayoffInterestDue": 0.00, + "LateChargeMethod": "Not Assessed", + "LateCharge": 0.0, + "LateChargeDate": "2020-06-10T00:00:00", + "CashAdvance": 0.0, + "Insurance": "XX", + "LastStatementLateCharges": 0.0, + "LastStatementMiscFees": 0.0, + "LastStatementPurchaseAdvances": 0.0, + "LastStatementCashAdvances": 0.0, + "LastStatementCashAdvanceFees": 0.0, + "LastStatementMiscDebits": 0.0, + "LastStatementTotalPayments": 0.0, + "LastStatementCreditsPosted": 0.0, + "LastStatementAccruedInterest": 0.0, + "LastStatementDate": "0001-01-01T00:00:00", + "LastStatementPurchaseAdvanceBalance": 0.0, + "LastStatementEndingBalance": 0.0, + "DelinquentAmount": 0.0, + "LastStatementMonthlyMinimum": 0.0, + "LastStatementRequiredDue": 0.0, + "LastStatementRequiredPayment": 0.0, + "ScheduledPayment": 489.09, + "NextDueDate": "2020-02-10T00:00:00", + "PartialPaymentAmount": 354.34, + "PreviousDate": "2019-12-10T00:00:00", + "PaymentFrequency": "Monthly", + "AlignmentDate": "0001-01-01T00:00:00", + "PaymentMethod": "Counter Item", + "SourceAccount": "", + "ProcessingGroup": "0", + "LoanCouponDate": "0001-01-01T00:00:00", + "RequiredPaymentDue": 489.09, + "FirstPaymentDate": "2017-02-10T00:00:00", + "AlternatePaymentAmount": 0.00, + "AlternateBeginDate": "0001-01-01T00:00:00", + "AlternateEndDate": "0001-01-01T00:00:00", + "PaymentSkips": 0, + "FinalPaymentAmount": 401.81, + "FinalPaymentDate": "2023-04-10T00:00:00", + "CycleAmount": 0.0, + "VariableRatePaymentChange": "Default Product", + "VariableRateCode": "F", + "MinimumDue": 0.00, + "FrequencyPayment": 0.0, + "EscrowPayment": 0.0, + "PrincipalAndInterestPayment": 0.0, + "PaymentLoanDefinitionNumber": "", + "RateLoanDefinitionNumber": "", + "VacationWeeks": 0, + "PayrollRepaidWeeklyPaymentCount": 0, + "BaseRate": 0.000, + "TieredRateAdj": 0.000, + "ManualRateAdj": 0.000, + "Rate": 0.000, + "ManualRate": 0.0, + "APR": 9.450, + "OriginalInterestRate": 9.450, + "AlternateInterestRate": 0.000, + "LastRateChange": "2016-12-27T00:00:00", + "RealEstateMargin": 0.0, + "Amortization": "P & I Amt", + "AmortizationTerm": 0, + "MonthlyTerm": 75, + "NumberOfPayments": 75, + "InterestYTD": 317.91, + "InterestPYTD": 1663.88, + "InterestDaily": 0.01, + "PrincipalYTD": 16504.55, + "PrincipalPYTD": 3869.89, + "LateChargeYTD": 10.00, + "LateChargePYTD": 85.35, + "PaymentHistory": "065432123210", + "LastPaymentDue": "0001-01-01T00:00:00", + "PaymentsPastDue": 0, + "DaysPastDue": 0, + "MonthsPastDue": 0, + "CurrentStatementLateCharges": 0.0, + "CurrentStatementMiscFees": 0.0, + "CurrentStatementPurchaseAdvances": 0.0, + "CurrentStatementCashAdvances": 0.0, + "CurrentStatementCashAdvanceFees": 0.0, + "CurrentStatementMiscDebits": 0.0, + "CurrentStatementTotalPayments": 0.0, + "CurrentStatementTotalCredits": 0.0, + "DelinquentPaymentDueDate": "0001-01-01T00:00:00", + "IsInactive": false, + "StatementFrequency": "Default:N", + "AppraisedValue": 0.0, + "LocCycleDay": 0, + "IgnorePledge": false, + "OpenEndPlan": false, + "OpenEndCategory": "None", + "PointsPaid": 0.00, + "CurtailmentAmount": 0.0, + "CurtailmentDate": "0001-01-01T00:00:00", + "InsuranceExpirationDate": "2023-04-10T00:00:00", + "LifeInsuranceMI": "XX", + "DisabilityInsuranceMI": " ", + "LifeActivityInsuranceCode": " ", + "DisabilityActivityInsuranceCode": " ", + "LoanCoupons": true, + "PaidbyGrace": false, + "EscrowAccount": "", + "EscrowInterestPaid": false, + "NextPaymentAdjustmentDate": "0001-01-01T00:00:00", + "EffectivePayment": 489.09, + "InterestRate": 0.000, + "LastPaymentDate": "2020-07-29T00:00:00", + "LastPurchaseDate": "0001-01-01T00:00:00", + "LastCashAdvanceDate": "0001-01-01T00:00:00", + "BlockCode": "", + "ReclassCode": "", + "OutstandingAuthCount": 0, + "OutstandingAuthAmount": 0.0, + "InterestType": "Fixed", + "AlternateLoanNumber": "", + "ArmIndex": 0, + "DeductionOption": "", + "DelinquentPaymentSkips": false, + "FirstPayment": false, + "InterestDue": 0.00, + "LoanLevelSkips": false, + "PaymentReduction": false, + "WaiveLateCharge": false, + "ExcessPaymentTargetAccountId": 0, + "ExcessPaymentMemberId": 0, + "CustRate": false, + "IntRateMethod": "", + "Margin": 0.0, + "Index": "", + "RndFactPct": 0.0, + "RndFactOpt": "", + "IntRateCeiling": 0.0, + "IntRateFloor": 0.0, + "MaxDnRateChgLife": 0.0, + "MaxUpRateChgLife": 0.0, + "MaxDnRateChgPeriod": 0.0, + "MaxUpRateChgPeriod": 0.0, + "MinDnRateChgPeriod": 0.0, + "MinUpRateChgPeriod": 0.0, + "PmtAdjPeriod": 0, + "DaysPriorToPeriodicRateAdj": 0, + "DaysPriorToInitialRateAdjustment": 0, + "FirstAdjustmentIsEstimate": false, + "InitialAnalysisEstimateDate": "0001-01-01T00:00:00", + "EstimatePerformed": "", + "BalloonTerm": 0, + "PledgeTypeDescription": "", + "SystemApproved": "Yes", + "VINList": [ + "5XXGR4A63CG061909" + ], + "MortgageLoanOriginator": 0, + "LastPaymentPrincipal": 900.00, + "LastPaymentInterest": 0.00, + "LastPaymentFees": 0.00, + "LastPaymentLateCharges": 0.00, + "LastPaymentEscrowImpound": null, + "LastPaymentCurtailment": null, + "LastPaymentTotal": 900.00, + "TransferDay": 0, + "SourceMember": 0, + "AdjustPurchaseAccrual": false, + "AnnualFee": false, + "AnnualFeeDate": "0001-01-01T00:00:00", + "BalaceLimit": 0.00, + "CloseOnZero": false, + "DrawDate": "0001-01-01T00:00:00", + "Form1098Option": "N", + "MethodADelinquency": false, + "NumberofSkips": 0, + "OverlimitAmount": 0.00, + "OverlimitDate": "0001-01-01T00:00:00", + "PurchaseAdvBalance": 0.00, + "SkipDate": "0001-01-01T00:00:00", + "ToBeDelinquent": false, + "WaiveDelinquencyNotice": false, + "WaiveBillingNotice": false, + "WaiveInterest": false, + "LastStatementMinimumPayment": 0.0, + "LastStatementCycleRequiredPayment": 0.0, + "ExemptNonResident": false, + "YTDNonresidentWithholding": null, + "PYTDNonresidentWithholding": null, + "InCollection": "OUT", + "UniversalLoanId": "", + "RateLockDate": "0001-01-01T00:00:00", + "ActiveStopPays": "", + "ErrorMessage": [] + }, + "memberDetail" : { + "MemberId": 6466120, + "MemberName": "Jonathan Doerson", + "PrimaryIndividualId": 943900, + "MemberType": "REGULAR", + "Affiliation": "", + "MemberSince": "2017-02-03T00:00:00", + "Miscellaneous1": "", + "Miscellaneous2": "", + "OriginalOpenBranch": "INDIRECT LENDING DEPT", + "WithholdingCode": "", + "ExpeditedFunds": 0.00, + "ExpeditedFundsDate": "0001-01-01T00:00:00", + "AccessLevel": 1, + "StandardStatementCycle": 1, + "StandardStatementCode": "", + "StandardStatementMethod": "Microfiche", + "CATFeeCounter": 0, + "CATFeeDate": "0001-01-01T00:00:00", + "CreditCardStatementCycle": 1, + "CreditCardStatementCode": "", + "CreditCardStatementMethod": "Hold", + "AccountCount": 1, + "AccountBalance": 0.00, + "LoanCount": 1, + "LoanBalance": 13862.46, + "LoansDelinquentCount": 1, + "LoansDelinquent": 13862.46, + "LoansWrittenOffCount": 1, + "LoansWrittenOff": 13862.46, + "LoansInCollectionCount": 0, + "LoansInCollection": 0.0, + "Password": "", + "PinLock": "Unlock", + "BranchId": 57, + "RelationshipPricingLevel": 0, + "RelationshipPricingLevelPermanent": "No", + "RelationshipPricingDescription": "", + "PreviousRelationshipPricingLevel": 0, + "LastRelationshipPricingLevelAnalysisDate": "", + "LastRelationshipPricingLevelChangeDate": "7/8/2020 12:00:00 AM", + "InhibitActivity": "No", + "WrittenOffLoan": "Yes", + "LoanInCollection": "No", + "PurgeMembership": "Yes", + "Address": { + "AddressId": 3308623, + "Line1": "18 WOODRIDGE CT APT 7", + "Line2": "", + "Line3": "", + "City": "MADISON", + "State": "WI", + "ZipCode": "53704-7889", + "Country": "US", + "CountyName": "", + "AddressType": "", + "IsPrimary": true, + "IsInternational": false, + "AddressVerification": 18, + "Occupancy": "", + "StartDate": "0001-01-01T00:00:00", + "EndDate": "0001-01-01T00:00:00", + "LongAddress1": "18 WOODRIDGE CT APT 7", + "LongAddress2": "", + "Membership": [], + "CoBorrower": [], + "UseAlternateAsOf": "0001-01-01T00:00:00", + "RestorePrimaryAsOf": "0001-01-01T00:00:00", + "AlternateType": "", + "Comments": "", + "Met2AddressIndicator": "", + "UspsVerified": false, + "AddressMatchStatus": null, + "IsHSA": false + } + }, + "collateralDetails": [] +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/Processor/newAccount.json b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/Processor/newAccount.json new file mode 100644 index 0000000..2b8ebf9 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/Processor/newAccount.json @@ -0,0 +1,4909 @@ +{ + "repoLetters": [ + { + "ActionCode": "700", + "Description": "RTC-Illinois", + "DaysToWait": 15, + "WhenLetterIsSent": "BeforeO4R", + "LetterDescription": "None" + }, + { + "ActionCode": "701", + "Description": "Right to Reinstate/Redeem-Illinois", + "DaysToWait": 22, + "WhenLetterIsSent": "AfterO4R", + "LetterDescription": "Right to Reinstate/Redeem" + }, + { + "ActionCode": "702", + "Description": "Affidavit of Defense-Illinois", + "DaysToWait": 22, + "WhenLetterIsSent": "AfterO4R", + "LetterDescription": "None" + }, + { + "ActionCode": "703", + "Description": "Notice of Plan to Sell-Illinois", + "DaysToWait": 22, + "WhenLetterIsSent": "AfterO4R", + "LetterDescription": "None" + }, + { + "ActionCode": "704", + "Description": "Repo: Surplus-Deficiency Notice", + "DaysToWait": 0, + "WhenLetterIsSent": "AfterSale", + "LetterDescription": "None" + }, + { + "ActionCode": "ILLSU", + "Description": "ILLINOIS SURRENDER", + "DaysToWait": 0, + "WhenLetterIsSent": "BeforeO4R", + "LetterDescription": "Surrender (Illinois)" + }, + { + "ActionCode": "LTR34", + "Description": "Repo-Notice of Repossession", + "DaysToWait": 15, + "WhenLetterIsSent": "AfterO4R", + "LetterDescription": "Notice of Repossession" + }, + { + "ActionCode": "LTR35", + "Description": "WI Repo-Notice of Sale", + "DaysToWait": 15, + "WhenLetterIsSent": "AfterO4R", + "LetterDescription": "Notice of Plan to Sell - WI" + }, + { + "ActionCode": "LTR36", + "Description": "WI Repo-Sale of Collateral Notice", + "DaysToWait": 15, + "WhenLetterIsSent": "AfterO4R", + "LetterDescription": "None" + }, + { + "ActionCode": "RTC", + "Description": "Notice to repossess/prior expired RTC", + "DaysToWait": 0, + "WhenLetterIsSent": "BeforeO4R", + "LetterDescription": "None" + }, + { + "ActionCode": "RTC, 1", + "Description": "RTC Non Auto & Non Cycle", + "DaysToWait": 15, + "WhenLetterIsSent": "BeforeO4R", + "LetterDescription": "WI Unsecured RTC" + }, + { + "ActionCode": "RTC, 3", + "Description": "RTC-AUTO LOANS-WI", + "DaysToWait": 15, + "WhenLetterIsSent": "BeforeO4R", + "LetterDescription": "WI Auto RTC" + }, + { + "ActionCode": "RTC2", + "Description": "RTC New Law", + "DaysToWait": 15, + "WhenLetterIsSent": "BeforeO4R", + "LetterDescription": "None" + }, + { + "ActionCode": "RTCSP", + "Description": "SPANISH RTC WI AUTO LOANS", + "DaysToWait": 15, + "WhenLetterIsSent": "BeforeO4R", + "LetterDescription": "None" + }, + { + "ActionCode": "VOL", + "Description": "Wisconsin Surrender", + "DaysToWait": 0, + "WhenLetterIsSent": "BeforeO4R", + "LetterDescription": "Surrender (Wisconsin)" + } +], + "coreTransactions": [ + { + "postingDate": "2020-07-29T00:00:00", + "effectiveDate": "2020-07-29T00:00:00", + "operatorId": 6051, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ELECTRONIC LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "PR ", + "amount": 900.00, + "runningBalance": 13862.46, + "principalAmount": -900.00, + "interest": 0.00, + "escrowAmount": 0.0, + "processingGroup": "10", + "batchControlId": 6285, + "historyItemId": 654509536, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0.0, + "lateCharge": "", + "transactionTypeDescription": "LANDMARKCU ECM LOAN PAY 200728", + "amountToCurtailment": 0.0 + }, + { + "postingDate": "2020-07-08T17:02:38", + "effectiveDate": "2020-07-08T00:00:00", + "operatorId": 4792, + "drawerName": "", + "drawerBranch": "", + "transactionType": "Write Off Held", + "transactionNumber": 289, + "transactionTypeCode": "HD ", + "amount": 0.00, + "runningBalance": 14762.46, + "principalAmount": 0.00, + "interest": 0.00, + "escrowAmount": 0.0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 650076100, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0.0, + "lateCharge": "", + "transactionTypeDescription": "*Held Amount= $14,762.46", + "amountToCurtailment": 0.0 + }, + { + "postingDate": "2020-07-08T17:02:32", + "effectiveDate": "2020-07-08T00:00:00", + "operatorId": 4792, + "drawerName": "", + "drawerBranch": "", + "transactionType": "LOAN WRITTEN OFF", + "transactionNumber": 260, + "transactionTypeCode": "WOFF", + "amount": 14762.46, + "runningBalance": 0.00, + "principalAmount": -14762.46, + "interest": 0.00, + "escrowAmount": 0.0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 650076081, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "719-1", + "totalFee": 0.0, + "lateCharge": "", + "transactionTypeDescription": "LOANS WRITTEN OFF", + "amountToCurtailment": 0.0 + }, + { + "postingDate": "2020-06-22T00:00:00", + "effectiveDate": "2020-06-22T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ADJ NON-CASH", + "transactionNumber": 289, + "transactionTypeCode": "ADNC", + "amount": 0.00, + "runningBalance": 14762.46, + "principalAmount": 0.00, + "interest": 0.00, + "escrowAmount": 0.0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 645831232, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0.0, + "lateCharge": "", + "transactionTypeDescription": "LATE CHARGE ASSESSED: 10.00, LATE DATE: 06-10-20", + "amountToCurtailment": 0.0 + }, + { + "postingDate": "2020-05-21T00:00:00", + "effectiveDate": "2020-05-21T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ADJ NON-CASH", + "transactionNumber": 289, + "transactionTypeCode": "ADNC", + "amount": 0.00, + "runningBalance": 14762.46, + "principalAmount": 0.00, + "interest": 0.00, + "escrowAmount": 0.0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 638758909, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0.0, + "lateCharge": "", + "transactionTypeDescription": "LATE CHARGE ASSESSED: 10.00, LATE DATE: 05-10-20", + "amountToCurtailment": 0.0 + }, + { + "postingDate": "2020-04-21T00:00:00", + "effectiveDate": "2020-04-21T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ADJ NON-CASH", + "transactionNumber": 289, + "transactionTypeCode": "ADNC", + "amount": 0.00, + "runningBalance": 14762.46, + "principalAmount": 0.00, + "interest": 0.00, + "escrowAmount": 0.0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 632228533, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0.0, + "lateCharge": "", + "transactionTypeDescription": "LATE CHARGE ASSESSED: 10.00, LATE DATE: 04-10-20", + "amountToCurtailment": 0.0 + }, + { + "postingDate": "2020-03-21T00:00:00", + "effectiveDate": "2020-03-21T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ADJ NON-CASH", + "transactionNumber": 289, + "transactionTypeCode": "ADNC", + "amount": 0.00, + "runningBalance": 14762.46, + "principalAmount": 0.00, + "interest": 0.00, + "escrowAmount": 0.0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 626176378, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0.0, + "lateCharge": "", + "transactionTypeDescription": "LATE CHARGE ASSESSED: 3.45, PARTIAL PMT: 420.00, LATE DATE: 03-10-20", + "amountToCurtailment": 0.0 + }, + { + "postingDate": "2020-03-10T16:22:35", + "effectiveDate": "2020-03-10T00:00:00", + "operatorId": 3105, + "drawerName": "", + "drawerBranch": "", + "transactionType": "LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "C ", + "amount": 420.00, + "runningBalance": 14762.46, + "principalAmount": -215.04, + "interest": 204.96, + "escrowAmount": 0.0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 623807137, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0.0, + "lateCharge": "", + "transactionTypeDescription": "", + "amountToCurtailment": 0.0 + }, + { + "postingDate": "2020-02-21T00:00:00", + "effectiveDate": "2020-02-21T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ADJ NON-CASH", + "transactionNumber": 289, + "transactionTypeCode": "ADNC", + "amount": 0.00, + "runningBalance": 14977.50, + "principalAmount": 0.00, + "interest": 0.00, + "escrowAmount": 0.0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 619191262, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0.0, + "lateCharge": "", + "transactionTypeDescription": "LATE CHARGE ASSESSED: 10.00, LATE DATE: 02-10-20", + "amountToCurtailment": 0.0 + }, + { + "postingDate": "2020-01-17T14:32:08", + "effectiveDate": "2020-01-17T00:00:00", + "operatorId": 3114, + "drawerName": "", + "drawerBranch": "", + "transactionType": "LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "C ", + "amount": 750.00, + "runningBalance": 14977.50, + "principalAmount": -627.05, + "interest": 112.95, + "escrowAmount": 0.0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 611651075, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 10.00, + "lateCharge": "10.00", + "transactionTypeDescription": "", + "amountToCurtailment": 0.0 + }, + { + "postingDate": "2019-12-21T00:00:00", + "effectiveDate": "2019-12-21T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ADJ NON-CASH", + "transactionNumber": 289, + "transactionTypeCode": "ADNC", + "amount": 0.00, + "runningBalance": 15604.55, + "principalAmount": 0.00, + "interest": 0.00, + "escrowAmount": 0.0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 605597224, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0.0, + "lateCharge": "", + "transactionTypeDescription": "LATE CHARGE ASSESSED: 9.45, PARTIAL PMT: 300.00, LATE DATE: 12-10-19", + "amountToCurtailment": 0.0 + }, + { + "postingDate": "2019-12-20T00:00:00", + "effectiveDate": "2019-12-20T00:00:00", + "operatorId": 6051, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ELECTRONIC LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "PR ", + "amount": 300.00, + "runningBalance": 15604.55, + "principalAmount": -242.56, + "interest": 57.44, + "escrowAmount": 0.0, + "processingGroup": "10", + "batchControlId": 3366, + "historyItemId": 605374027, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0.0, + "lateCharge": "", + "transactionTypeDescription": "LANDMARKCU ECM LOAN PAY 191219", + "amountToCurtailment": 0.0 + }, + { + "postingDate": "2019-12-06T00:00:00", + "effectiveDate": "2019-12-06T00:00:00", + "operatorId": 6051, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ELECTRONIC LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "PR ", + "amount": 780.00, + "runningBalance": 15847.11, + "principalAmount": -281.31, + "interest": 478.69, + "escrowAmount": 0.0, + "processingGroup": "10", + "batchControlId": 3164, + "historyItemId": 602263856, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 20.00, + "lateCharge": "20.00", + "transactionTypeDescription": "LANDMARKCU ECM LOAN PAY 191205", + "amountToCurtailment": 0.0 + }, + { + "postingDate": "2019-11-21T00:00:00", + "effectiveDate": "2019-11-21T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ADJ NON-CASH", + "transactionNumber": 289, + "transactionTypeCode": "ADNC", + "amount": 0.00, + "runningBalance": 16128.42, + "principalAmount": 0.00, + "interest": 0.00, + "escrowAmount": 0.0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 598585342, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0.0, + "lateCharge": "", + "transactionTypeDescription": "LATE CHARGE ASSESSED: 10.00, LATE DATE: 11-10-19", + "amountToCurtailment": 0.0 + }, + { + "postingDate": "2019-10-21T00:00:00", + "effectiveDate": "2019-10-21T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ADJ NON-CASH", + "transactionNumber": 289, + "transactionTypeCode": "ADNC", + "amount": 0.00, + "runningBalance": 16128.42, + "principalAmount": 0.00, + "interest": 0.00, + "escrowAmount": 0.0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 591538486, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0.0, + "lateCharge": "", + "transactionTypeDescription": "LATE CHARGE ASSESSED: 10.00, LATE DATE: 10-10-19", + "amountToCurtailment": 0.0 + }, + { + "postingDate": "2019-09-21T00:00:00", + "effectiveDate": "2019-09-21T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ADJ NON-CASH", + "transactionNumber": 289, + "transactionTypeCode": "ADNC", + "amount": 0.00, + "runningBalance": 16128.42, + "principalAmount": 0.00, + "interest": 0.00, + "escrowAmount": 0.0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 585054500, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0.0, + "lateCharge": "", + "transactionTypeDescription": "LATE CHARGE ASSESSED: 10.00, PARTIAL PMT: 138.88, LATE DATE: 09-10-19", + "amountToCurtailment": 0.0 + }, + { + "postingDate": "2019-08-30T00:00:00", + "effectiveDate": "2019-08-30T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "FLEXIBLE LOAN CHANGE", + "transactionNumber": 289, + "transactionTypeCode": "MAN ", + "amount": 0.00, + "runningBalance": 16128.42, + "principalAmount": 0.00, + "interest": 0.00, + "escrowAmount": 0.0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 579904698, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0.0, + "lateCharge": "", + "transactionTypeDescription": " OLD PMT=401.81 NEW PMT=489.09 Policy #MQK0337128", + "amountToCurtailment": 0.0 + }, + { + "postingDate": "2019-08-30T00:00:00", + "effectiveDate": "2019-08-30T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "FLEXIBLE LOAN CHANGE", + "transactionNumber": 289, + "transactionTypeCode": "MAN ", + "amount": 0.00, + "runningBalance": 16128.42, + "principalAmount": 0.00, + "interest": 0.00, + "escrowAmount": 0.0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 579904697, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0.0, + "lateCharge": "", + "transactionTypeDescription": " OLD PMT=568.19 NEW PMT=401.81 Policy #MQK0337128", + "amountToCurtailment": 0.0 + }, + { + "postingDate": "2019-08-29T00:00:00", + "effectiveDate": "2019-08-29T00:00:00", + "operatorId": 6056, + "drawerName": "", + "drawerBranch": "", + "transactionType": "CREDIT ADJUSTMENT", + "transactionNumber": 225, + "transactionTypeCode": " ", + "amount": 683.00, + "runningBalance": 16128.42, + "principalAmount": -683.00, + "interest": 0.00, + "escrowAmount": 0.0, + "processingGroup": "", + "batchControlId": 1742, + "historyItemId": 579805424, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0.0, + "lateCharge": "", + "transactionTypeDescription": "Policy #MQK0337128", + "amountToCurtailment": 0.0 + }, + { + "postingDate": "2019-08-14T16:17:43", + "effectiveDate": "2019-08-14T00:00:00", + "operatorId": 3109, + "drawerName": "", + "drawerBranch": "", + "transactionType": "LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "C ", + "amount": 1250.00, + "runningBalance": 16811.42, + "principalAmount": -1174.81, + "interest": 65.19, + "escrowAmount": 0.0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 576735446, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 10.00, + "lateCharge": "10.00", + "transactionTypeDescription": "", + "amountToCurtailment": 0.0 + }, + { + "postingDate": "2019-07-31T09:12:54", + "effectiveDate": "2019-07-31T00:00:00", + "operatorId": 4739, + "drawerName": "", + "drawerBranch": "", + "transactionType": "LOAN PAYMENT-TRANSFER", + "transactionNumber": 200, + "transactionTypeCode": "*SLP", + "amount": 210.12, + "runningBalance": 17986.23, + "principalAmount": -200.70, + "interest": 9.42, + "escrowAmount": 0.0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 573300626, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0.0, + "lateCharge": "", + "transactionTypeDescription": "Transfer to ln per 4722", + "amountToCurtailment": 0.0 + }, + { + "postingDate": "2019-07-29T15:29:15", + "effectiveDate": "2019-07-29T00:00:00", + "operatorId": 3114, + "drawerName": "", + "drawerBranch": "", + "transactionType": "LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "C ", + "amount": 310.00, + "runningBalance": 18186.93, + "principalAmount": -43.54, + "interest": 256.46, + "escrowAmount": 0.0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 572960728, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 10.00, + "lateCharge": "10.00", + "transactionTypeDescription": "", + "amountToCurtailment": 0.0 + }, + { + "postingDate": "2019-07-22T00:00:00", + "effectiveDate": "2019-07-22T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ADJ NON-CASH", + "transactionNumber": 289, + "transactionTypeCode": "ADNC", + "amount": 0.00, + "runningBalance": 18230.47, + "principalAmount": 0.00, + "interest": 0.00, + "escrowAmount": 0.0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 571237155, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0.0, + "lateCharge": "", + "transactionTypeDescription": "LATE CHARGE ASSESSED: 10.00, LATE DATE: 07-10-19", + "amountToCurtailment": 0.0 + }, + { + "postingDate": "2019-06-21T00:00:00", + "effectiveDate": "2019-06-21T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ADJ NON-CASH", + "transactionNumber": 289, + "transactionTypeCode": "ADNC", + "amount": 0.00, + "runningBalance": 18230.47, + "principalAmount": 0.00, + "interest": 0.00, + "escrowAmount": 0.0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 564588185, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0.0, + "lateCharge": "", + "transactionTypeDescription": "LATE CHARGE ASSESSED: 10.00, PARTIAL PMT: 73.33, LATE DATE: 06-10-19", + "amountToCurtailment": 0.0 + }, + { + "postingDate": "2019-06-20T00:00:00", + "effectiveDate": "2019-06-20T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "FLEXIBLE LOAN CHANGE", + "transactionNumber": 289, + "transactionTypeCode": "MAN ", + "amount": 0.00, + "runningBalance": 18230.47, + "principalAmount": 0.00, + "interest": 0.00, + "escrowAmount": 0.0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 564319304, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0.0, + "lateCharge": "", + "transactionTypeDescription": " OLD PMT=401.81 NEW PMT=568.19 Policy #MQK0337128", + "amountToCurtailment": 0.0 + }, + { + "postingDate": "2019-06-19T00:00:00", + "effectiveDate": "2019-06-19T00:00:00", + "operatorId": 6056, + "drawerName": "", + "drawerBranch": "", + "transactionType": "LOAN ADVANCE", + "transactionNumber": 230, + "transactionTypeCode": "C ", + "amount": 1898.00, + "runningBalance": 18230.47, + "principalAmount": 1898.00, + "interest": 0.00, + "escrowAmount": 0.0, + "processingGroup": "", + "batchControlId": 762, + "historyItemId": 564291676, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0.0, + "lateCharge": "", + "transactionTypeDescription": "Policy #MQK0337128", + "amountToCurtailment": 0.0 + }, + { + "postingDate": "2019-06-03T13:42:24", + "effectiveDate": "2019-06-03T00:00:00", + "operatorId": 3105, + "drawerName": "", + "drawerBranch": "", + "transactionType": "LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "C ", + "amount": 350.00, + "runningBalance": 16332.47, + "principalAmount": -284.35, + "interest": 55.93, + "escrowAmount": 0.0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 560869218, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 9.72, + "lateCharge": "9.72", + "transactionTypeDescription": "", + "amountToCurtailment": 0.0 + }, + { + "postingDate": "2019-05-21T14:27:24", + "effectiveDate": "2019-05-21T00:00:00", + "operatorId": 3105, + "drawerName": "", + "drawerBranch": "", + "transactionType": "LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "C ", + "amount": 100.00, + "runningBalance": 16616.82, + "principalAmount": -9.32, + "interest": 90.40, + "escrowAmount": 0.0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 557875681, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0.28, + "lateCharge": "0.28", + "transactionTypeDescription": "", + "amountToCurtailment": 0.0 + }, + { + "postingDate": "2019-05-21T00:00:00", + "effectiveDate": "2019-05-21T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ADJ NON-CASH", + "transactionNumber": 289, + "transactionTypeCode": "ADNC", + "amount": 0.00, + "runningBalance": 16626.14, + "principalAmount": 0.00, + "interest": 0.00, + "escrowAmount": 0.0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 557745153, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0.0, + "lateCharge": "", + "transactionTypeDescription": "LATE CHARGE ASSESSED: 10.00, PARTIAL PMT: 25.14, LATE DATE: 05-10-19", + "amountToCurtailment": 0.0 + }, + { + "postingDate": "2019-04-30T13:21:45", + "effectiveDate": "2019-04-30T00:00:00", + "operatorId": 3109, + "drawerName": "", + "drawerBranch": "", + "transactionType": "LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "C ", + "amount": 150.00, + "runningBalance": 16626.14, + "principalAmount": -53.08, + "interest": 90.68, + "escrowAmount": 0.0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 553031879, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 6.24, + "lateCharge": "6.24", + "transactionTypeDescription": "", + "amountToCurtailment": 0.0 + }, + { + "postingDate": "2019-04-22T00:00:00", + "effectiveDate": "2019-04-22T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ADJ NON-CASH", + "transactionNumber": 289, + "transactionTypeCode": "ADNC", + "amount": 0.00, + "runningBalance": 16679.22, + "principalAmount": 0.00, + "interest": 0.00, + "escrowAmount": 0.0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 551167653, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0.0, + "lateCharge": "", + "transactionTypeDescription": "LATE CHARGE ASSESSED: 6.24, PARTIAL PMT: 276.95, LATE DATE: 04-10-19", + "amountToCurtailment": 0.0 + }, + { + "postingDate": "2019-04-09T15:28:44", + "effectiveDate": "2019-04-09T00:00:00", + "operatorId": 3114, + "drawerName": "", + "drawerBranch": "", + "transactionType": "LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "C ", + "amount": 200.00, + "runningBalance": 16679.22, + "principalAmount": -156.04, + "interest": 34.87, + "escrowAmount": 0.0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 548733659, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 9.09, + "lateCharge": "9.09", + "transactionTypeDescription": "", + "amountToCurtailment": 0.0 + }, + { + "postingDate": "2019-04-01T14:55:38", + "effectiveDate": "2019-04-01T00:00:00", + "operatorId": 3114, + "drawerName": "", + "drawerBranch": "", + "transactionType": "LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "C ", + "amount": 221.00, + "runningBalance": 16835.26, + "principalAmount": -118.82, + "interest": 92.18, + "escrowAmount": 0.0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 546991992, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 10.00, + "lateCharge": "10.00", + "transactionTypeDescription": "", + "amountToCurtailment": 0.0 + }, + { + "postingDate": "2019-03-21T00:00:00", + "effectiveDate": "2019-03-21T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ADJ NON-CASH", + "transactionNumber": 289, + "transactionTypeCode": "ADNC", + "amount": 0.00, + "runningBalance": 16954.08, + "principalAmount": 0.00, + "interest": 0.00, + "escrowAmount": 0.0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 544262880, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0.0, + "lateCharge": "", + "transactionTypeDescription": "LATE CHARGE ASSESSED: 9.09, PARTIAL PMT: 220.00, LATE DATE: 03-10-19", + "amountToCurtailment": 0.0 + }, + { + "postingDate": "2019-03-11T13:48:14", + "effectiveDate": "2019-03-11T00:00:00", + "operatorId": 3114, + "drawerName": "", + "drawerBranch": "", + "transactionType": "LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "C ", + "amount": 220.00, + "runningBalance": 16954.08, + "principalAmount": -96.40, + "interest": 123.60, + "escrowAmount": 0.0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 542293250, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0.0, + "lateCharge": "", + "transactionTypeDescription": "", + "amountToCurtailment": 0.0 + }, + { + "postingDate": "2019-02-21T00:00:00", + "effectiveDate": "2019-02-21T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ADJ NON-CASH", + "transactionNumber": 289, + "transactionTypeCode": "ADNC", + "amount": 0.00, + "runningBalance": 17050.48, + "principalAmount": 0.00, + "interest": 0.00, + "escrowAmount": 0.0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 538028461, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0.0, + "lateCharge": "", + "transactionTypeDescription": "LATE CHARGE ASSESSED: 10.00, PARTIAL PMT: 37.76, LATE DATE: 02-10-19", + "amountToCurtailment": 0.0 + }, + { + "postingDate": "2019-02-11T12:30:07", + "effectiveDate": "2019-02-11T00:00:00", + "operatorId": 3109, + "drawerName": "", + "drawerBranch": "", + "transactionType": "LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "C ", + "amount": 240.00, + "runningBalance": 17050.48, + "principalAmount": -217.65, + "interest": 22.35, + "escrowAmount": 0.0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 536176062, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0.0, + "lateCharge": "", + "transactionTypeDescription": "", + "amountToCurtailment": 0.0 + }, + { + "postingDate": "2019-02-06T15:50:06", + "effectiveDate": "2019-02-06T00:00:00", + "operatorId": 3109, + "drawerName": "", + "drawerBranch": "", + "transactionType": "LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "C ", + "amount": 400.00, + "runningBalance": 17268.13, + "principalAmount": -303.54, + "interest": 86.44, + "escrowAmount": 0.0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 535233426, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 10.02, + "lateCharge": "10.02", + "transactionTypeDescription": "", + "amountToCurtailment": 0.0 + }, + { + "postingDate": "2019-01-21T00:00:00", + "effectiveDate": "2019-01-21T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ADJ NON-CASH", + "transactionNumber": 289, + "transactionTypeCode": "ADNC", + "amount": 0.00, + "runningBalance": 17571.67, + "principalAmount": 0.00, + "interest": 0.00, + "escrowAmount": 0.0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 531704372, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0.0, + "lateCharge": "", + "transactionTypeDescription": "LATE CHARGE ASSESSED: 9.84, PARTIAL PMT: 205.00, LATE DATE: 01-10-19", + "amountToCurtailment": 0.0 + }, + { + "postingDate": "2019-01-18T14:27:52", + "effectiveDate": "2019-01-18T00:00:00", + "operatorId": 3102, + "drawerName": "", + "drawerBranch": "", + "transactionType": "LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "C ", + "amount": 205.00, + "runningBalance": 17571.67, + "principalAmount": -4.77, + "interest": 200.23, + "escrowAmount": 0.0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 531490792, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0.0, + "lateCharge": "", + "transactionTypeDescription": "", + "amountToCurtailment": 0.0 + }, + { + "postingDate": "2018-12-21T00:00:00", + "effectiveDate": "2018-12-21T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ADJ NON-CASH", + "transactionNumber": 289, + "transactionTypeCode": "ADNC", + "amount": 0.00, + "runningBalance": 17576.44, + "principalAmount": 0.00, + "interest": 0.00, + "escrowAmount": 0.0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 525693008, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0.0, + "lateCharge": "", + "transactionTypeDescription": "LATE CHARGE ASSESSED: 0.18, PARTIAL PMT: 398.19, LATE DATE: 12-10-18", + "amountToCurtailment": 0.0 + }, + { + "postingDate": "2018-12-06T00:00:00", + "effectiveDate": "2018-12-05T00:00:00", + "operatorId": 6051, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ELECTRONIC LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "PR ", + "amount": 200.00, + "runningBalance": 17576.44, + "principalAmount": -200.00, + "interest": 0.00, + "escrowAmount": 0.0, + "processingGroup": "111", + "batchControlId": 8089, + "historyItemId": 522622250, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0.0, + "lateCharge": "", + "transactionTypeDescription": "LandmarkCU TRANSFER 120518", + "amountToCurtailment": 0.0 + }, + { + "postingDate": "2018-12-05T15:09:51", + "effectiveDate": "2018-12-05T00:00:00", + "operatorId": 3109, + "drawerName": "", + "drawerBranch": "", + "transactionType": "LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "C ", + "amount": 200.00, + "runningBalance": 17776.44, + "principalAmount": -61.36, + "interest": 138.55, + "escrowAmount": 0.0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 522515500, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0.09, + "lateCharge": "0.09", + "transactionTypeDescription": "", + "amountToCurtailment": 0.0 + }, + { + "postingDate": "2018-11-21T00:00:00", + "effectiveDate": "2018-11-21T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ADJ NON-CASH", + "transactionNumber": 289, + "transactionTypeCode": "ADNC", + "amount": 0.00, + "runningBalance": 17837.80, + "principalAmount": 0.00, + "interest": 0.00, + "escrowAmount": 0.0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 519311373, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0.0, + "lateCharge": "", + "transactionTypeDescription": "LATE CHARGE ASSESSED: 0.09, PARTIAL PMT: 400.00, LATE DATE: 11-10-18", + "amountToCurtailment": 0.0 + }, + { + "postingDate": "2018-11-05T14:53:45", + "effectiveDate": "2018-11-05T00:00:00", + "operatorId": 3102, + "drawerName": "", + "drawerBranch": "", + "transactionType": "LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "C ", + "amount": 400.00, + "runningBalance": 17837.80, + "principalAmount": -226.31, + "interest": 163.69, + "escrowAmount": 0.0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 516336251, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 10.00, + "lateCharge": "10.00", + "transactionTypeDescription": "", + "amountToCurtailment": 0.0 + }, + { + "postingDate": "2018-10-22T00:00:00", + "effectiveDate": "2018-10-22T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ADJ NON-CASH", + "transactionNumber": 289, + "transactionTypeCode": "ADNC", + "amount": 0.00, + "runningBalance": 18064.11, + "principalAmount": 0.00, + "interest": 0.00, + "escrowAmount": 0.0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 512995650, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0.0, + "lateCharge": "", + "transactionTypeDescription": "LATE CHARGE ASSESSED: 10.00, LATE DATE: 10-10-18", + "amountToCurtailment": 0.0 + }, + { + "postingDate": "2018-10-02T00:00:00", + "effectiveDate": "2018-10-01T00:00:00", + "operatorId": 6051, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ELECTRONIC LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "PR ", + "amount": 100.00, + "runningBalance": 18064.11, + "principalAmount": -100.00, + "interest": 0.00, + "escrowAmount": 0.0, + "processingGroup": "111", + "batchControlId": 7166, + "historyItemId": 509263160, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0.0, + "lateCharge": "", + "transactionTypeDescription": "LandmarkCU TRANSFER 100118", + "amountToCurtailment": 0.0 + }, + { + "postingDate": "2018-10-01T15:55:26", + "effectiveDate": "2018-10-01T00:00:00", + "operatorId": 3109, + "drawerName": "", + "drawerBranch": "", + "transactionType": "LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "C ", + "amount": 335.77, + "runningBalance": 18164.11, + "principalAmount": -243.52, + "interest": 90.55, + "escrowAmount": 0.0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 509155866, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 1.70, + "lateCharge": "1.70", + "transactionTypeDescription": "CASH ADVANCE PAYMENT", + "amountToCurtailment": 0.0 + }, + { + "postingDate": "2018-09-21T00:00:00", + "effectiveDate": "2018-09-21T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ADJ NON-CASH", + "transactionNumber": 289, + "transactionTypeCode": "ADNC", + "amount": 0.00, + "runningBalance": 18407.63, + "principalAmount": 0.00, + "interest": 0.00, + "escrowAmount": 0.0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 506806679, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0.0, + "lateCharge": "", + "transactionTypeDescription": "LATE CHARGE ASSESSED: 1.70, PARTIAL PMT: 367.85, LATE DATE: 09-10-18", + "amountToCurtailment": 0.0 + } + ], + "temenosHistory": [ + { + "name": "CRIF FRAUD File Fields", + "message": "change field", + "userId": 5, + "created": "2020-10-23T15:29:39.42", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2020-10-23T08:16:39.047", + "type": 1 + }, + { + "name": "AUTO - Status Set Repo Flag", + "message": "set flag", + "userId": 0, + "created": "2020-10-23T06:38:15.717", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-23T06:22:05.623", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2020-10-22T08:10:59.55", + "type": 1 + }, + { + "name": "AUTO - Status Set Repo Flag", + "message": "set flag", + "userId": 0, + "created": "2020-10-22T06:37:32.957", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-22T06:21:44.873", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2020-10-21T08:19:46.947", + "type": 1 + }, + { + "name": "AUTO - Status Set Repo Flag", + "message": "set flag", + "userId": 0, + "created": "2020-10-21T06:35:24.333", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-21T06:23:20.243", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2020-10-20T08:15:56.42", + "type": 1 + }, + { + "name": "AUTO - Status Set Repo Flag", + "message": "set flag", + "userId": 0, + "created": "2020-10-20T06:38:22.03", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-20T06:27:00.233", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2020-10-19T13:00:53.017", + "type": 1 + }, + { + "name": "AUTO - Status Set Repo Flag", + "message": "set flag", + "userId": 0, + "created": "2020-10-19T12:59:15.047", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-19T12:36:41.373", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2020-10-18T08:03:45.833", + "type": 1 + }, + { + "name": "AUTO - Status Set Repo Flag", + "message": "set flag", + "userId": 0, + "created": "2020-10-18T06:27:29.54", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-18T06:14:22.663", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2020-10-17T08:15:15.84", + "type": 1 + }, + { + "name": "AUTO - Status Set Repo Flag", + "message": "set flag", + "userId": 0, + "created": "2020-10-17T06:27:17.297", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-17T06:17:28.42", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2020-10-16T08:13:28.72", + "type": 1 + }, + { + "name": "AUTO - Status Set Repo Flag", + "message": "set flag", + "userId": 0, + "created": "2020-10-16T06:35:00.31", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-16T06:22:48.84", + "type": 1 + }, + { + "name": "Comment", + "message": "Requesting fraud research be completed on the account. Reason: \r\n cb alert", + "userId": 17, + "created": "2020-10-14T16:40:52.973", + "type": 0 + }, + { + "name": "Fraud Research Request", + "message": "Fraud Flag", + "userId": 17, + "created": "2020-10-14T16:40:52.97", + "type": 1 + }, + { + "name": "Fraud Research Request", + "message": "Auto Comment: Fraud Research Requested", + "userId": 17, + "created": "2020-10-14T16:40:52.97", + "type": 1 + }, + { + "name": "Fraud Research Request", + "message": "Fraud Request Reason", + "userId": 17, + "created": "2020-10-14T16:40:52.97", + "type": 1 + }, + { + "name": "Comment", + "message": "test", + "userId": 17, + "created": "2020-10-14T16:39:10.093", + "type": 0 + }, + { + "name": "Fraud Follow Up", + "message": "Contact Method", + "userId": 17, + "created": "2020-10-14T16:39:10.043", + "type": 1 + }, + { + "name": "Fraud Follow Up", + "message": "Update Fraud Information", + "userId": 17, + "created": "2020-10-14T16:39:10.043", + "type": 1 + }, + { + "name": "Fraud Follow Up", + "message": "Document Fraud Information", + "userId": 17, + "created": "2020-10-14T16:39:10.043", + "type": 1 + }, + { + "name": "Fraud Follow Up", + "message": "Set Nezt Contact Date", + "userId": 17, + "created": "2020-10-14T16:39:10.043", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2020-10-14T12:24:16.793", + "type": 1 + }, + { + "name": "AUTO - Status Set Repo Flag", + "message": "set flag", + "userId": 0, + "created": "2020-10-14T12:23:37.857", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-14T06:14:35.137", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-13T06:11:41.967", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-10-12T12:21:45.92", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-10-12T12:21:45.92", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-12T12:03:11.283", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-10-12T11:32:05.667", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-10-12T11:32:05.667", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-10-09T06:31:20.12", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-10-09T06:31:20.12", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-09T06:22:41.29", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-10-09T06:16:27.697", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-10-09T06:16:27.697", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-10-08T06:35:42.89", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-10-08T06:35:42.89", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-08T06:17:22.143", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-10-08T06:12:23.817", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-10-08T06:12:23.817", + "type": 1 + }, + { + "name": "Case Stage Account - O4R", + "message": "Account level stage ", + "userId": 5, + "created": "2020-10-07T15:51:36.86", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-10-07T06:44:34.777", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-10-07T06:44:34.777", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-07T06:22:42.29", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-10-07T06:09:41.713", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-10-07T06:09:41.713", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2020-10-06T20:12:16.807", + "type": 1 + }, + { + "name": "AUTO - Status Set Repo Flag", + "message": "set flag", + "userId": 0, + "created": "2020-10-06T20:11:38.01", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-10-06T06:27:10.97", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-10-06T06:27:10.97", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-06T06:17:43.497", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-10-06T06:12:27.39", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-10-06T06:12:27.39", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-10-05T06:23:52.737", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-10-05T06:23:52.737", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-05T06:13:34.097", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-10-05T06:04:58.19", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-10-05T06:04:58.19", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-10-04T06:16:28.58", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-10-04T06:16:28.58", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-04T06:08:03.91", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-10-04T06:02:02.05", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-10-04T06:02:02.05", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-10-03T06:28:23.783", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-10-03T06:28:23.783", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-03T06:21:49.143", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-10-03T06:14:59.927", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-10-03T06:14:59.927", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-10-02T06:25:02.237", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-10-02T06:25:02.237", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-02T06:16:11.47", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-10-02T06:10:30.127", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-10-02T06:10:30.127", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-10-01T06:20:10.807", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-10-01T06:20:10.807", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-01T06:11:31.323", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-10-01T06:07:08.557", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-10-01T06:07:08.557", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-30T06:20:05.61", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-30T06:20:05.61", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-30T06:11:23.797", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-30T06:03:58.373", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-30T06:03:58.373", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-29T06:28:40.743", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-29T06:28:40.743", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-29T06:09:00.303", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-29T06:01:18.24", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-29T06:01:18.24", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-27T06:39:41.667", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-27T06:39:41.667", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-27T06:25:20.837", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-27T06:17:53.79", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-27T06:17:53.79", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-26T06:32:00.583", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-26T06:32:00.583", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-26T06:22:58.99", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-26T06:15:46.18", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-26T06:15:46.18", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-25T06:20:16.227", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-25T06:20:16.227", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-25T06:12:11.01", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-25T06:07:56.26", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-25T06:07:56.26", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-23T06:24:05.203", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-23T06:24:05.203", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-23T06:12:51.97", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-23T06:02:09.483", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-23T06:02:09.483", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-22T06:22:51.55", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-22T06:22:51.55", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-22T06:15:32.707", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-22T06:10:12.083", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-22T06:10:12.083", + "type": 1 + }, + { + "name": "Comment", + "message": "test", + "userId": 4, + "created": "2020-09-21T17:15:18.36", + "type": 0 + }, + { + "name": "Remove Account Flag", + "message": "Remove Flag", + "userId": 4, + "created": "2020-09-21T17:15:18.36", + "type": 1 + }, + { + "name": "Remove Account Flag", + "message": "Give Reason", + "userId": 4, + "created": "2020-09-21T17:15:18.36", + "type": 1 + }, + { + "name": "Remove Account Flag", + "message": "Next Contact Date ", + "userId": 4, + "created": "2020-09-21T17:15:18.36", + "type": 1 + }, + { + "name": "Comment", + "message": "Removing Repo flag as repo was closed.", + "userId": 4, + "created": "2020-09-21T17:10:39.893", + "type": 0 + }, + { + "name": "Remove Account Flag", + "message": "Remove Flag", + "userId": 4, + "created": "2020-09-21T17:10:39.75", + "type": 1 + }, + { + "name": "Remove Account Flag", + "message": "Give Reason", + "userId": 4, + "created": "2020-09-21T17:10:39.75", + "type": 1 + }, + { + "name": "Remove Account Flag", + "message": "Next Contact Date ", + "userId": 4, + "created": "2020-09-21T17:10:39.75", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-19T06:19:32.91", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-19T06:19:32.91", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-19T06:11:41.73", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-19T06:07:28.5", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-19T06:07:28.5", + "type": 1 + }, + { + "name": "AUTO - Collection Agency ACSI", + "message": "Flip to ACSI", + "userId": 5, + "created": "2020-09-18T14:51:00.86", + "type": 1 + }, + { + "name": "AUTO - Collection Agency ACSI", + "message": "Flip to ACSI", + "userId": 5, + "created": "2020-09-18T14:48:12.94", + "type": 1 + }, + { + "name": "Comment", + "message": "No fraud was determined. test Sent letter(s): Fraud.", + "userId": 17, + "created": "2020-09-18T10:58:41.953", + "type": 2 + }, + { + "name": "Fraud Determination", + "message": "Fraud Research", + "userId": 17, + "created": "2020-09-18T10:58:41.937", + "type": 1 + }, + { + "name": "Fraud Determination", + "message": "Fraud Determined?", + "userId": 17, + "created": "2020-09-18T10:58:41.937", + "type": 1 + }, + { + "name": "Fraud Determination", + "message": "Automated Comment - No Fraud", + "userId": 17, + "created": "2020-09-18T10:58:41.937", + "type": 1 + }, + { + "name": "Fraud Determination", + "message": "Reason", + "userId": 17, + "created": "2020-09-18T10:58:41.937", + "type": 1 + }, + { + "name": "Fraud Determination", + "message": "Case Stage = No Fraud", + "userId": 17, + "created": "2020-09-18T10:58:41.937", + "type": 1 + }, + { + "name": "Fraud Determination", + "message": "Clear Account Level Flag", + "userId": 17, + "created": "2020-09-18T10:58:41.937", + "type": 1 + }, + { + "name": "Fraud Determination", + "message": "Send Denial Letter", + "userId": 17, + "created": "2020-09-18T10:58:41.937", + "type": 1 + }, + { + "name": "Fraud Determination", + "message": "Case Status = Closed", + "userId": 17, + "created": "2020-09-18T10:58:41.937", + "type": 1 + }, + { + "name": "Fraud Determination", + "message": "Set Nezt Contact Date", + "userId": 17, + "created": "2020-09-18T10:58:41.937", + "type": 1 + }, + { + "name": "Comment", + "message": "test", + "userId": 17, + "created": "2020-09-18T10:58:15.08", + "type": 0 + }, + { + "name": "Fraud Suspected", + "message": "Update Fraud Information", + "userId": 17, + "created": "2020-09-18T10:58:15.063", + "type": 1 + }, + { + "name": "Fraud Suspected", + "message": "Case Stage = Fraud Suspected", + "userId": 17, + "created": "2020-09-18T10:58:15.063", + "type": 1 + }, + { + "name": "Fraud Suspected", + "message": "Set account fraud suspected flag", + "userId": 17, + "created": "2020-09-18T10:58:15.063", + "type": 1 + }, + { + "name": "Fraud Suspected", + "message": "Document Fraud Information", + "userId": 17, + "created": "2020-09-18T10:58:15.063", + "type": 1 + }, + { + "name": "Fraud Suspected", + "message": "Set Next Contact Date", + "userId": 17, + "created": "2020-09-18T10:58:15.063", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-18T06:22:22.95", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-18T06:22:22.95", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-18T06:12:06.73", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-18T06:06:34.183", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-18T06:06:34.183", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2020-09-17T08:14:29.063", + "type": 1 + }, + { + "name": "AUTO - Status Set Repo Flag", + "message": "set flag", + "userId": 0, + "created": "2020-09-17T06:58:01.267", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-17T06:56:37.983", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-17T06:56:37.983", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-17T06:47:12.78", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-17T06:40:04.407", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-17T06:40:04.407", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 5, + "created": "2020-09-16T21:56:02.89", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2020-09-16T20:14:21.313", + "type": 1 + }, + { + "name": "AUTO - Status Set Repo Flag", + "message": "set flag", + "userId": 0, + "created": "2020-09-16T20:13:04.847", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-16T06:22:03.643", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-16T06:22:03.643", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-16T06:15:29.783", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-16T06:09:48.093", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-16T06:09:48.093", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-15T06:57:43.907", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-15T06:57:43.907", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-15T06:49:08.393", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-15T06:43:15.377", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-15T06:43:15.377", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-14T12:09:31.487", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 5, + "created": "2020-09-14T11:10:47.127", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 5, + "created": "2020-09-14T11:10:47.127", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 5, + "created": "2020-09-14T11:10:26.28", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 5, + "created": "2020-09-14T11:10:26.28", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 5, + "created": "2020-09-12T18:06:44.427", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 5, + "created": "2020-09-12T18:06:44.427", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 5, + "created": "2020-09-12T18:06:36.003", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 5, + "created": "2020-09-12T18:06:36.003", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 5, + "created": "2020-09-12T18:05:34.457", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 5, + "created": "2020-09-12T18:05:34.457", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 5, + "created": "2020-09-12T18:05:11.99", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 5, + "created": "2020-09-12T18:05:11.99", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-12T06:58:23.58", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-12T06:58:23.58", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-12T06:47:34.067", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-12T06:38:15.787", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-12T06:38:15.787", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-11T06:47:08.953", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-11T06:47:08.953", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-11T06:38:07.343", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-11T06:31:54.797", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-11T06:31:54.797", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 5, + "created": "2020-09-10T14:31:03.44", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-10T06:24:31.703", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-10T06:24:31.703", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-10T06:17:46.923", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-10T06:12:27.19", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-10T06:12:27.19", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2020-09-09T06:42:49.583", + "type": 1 + }, + { + "name": "AUTO - Status Set Repo Flag", + "message": "set flag", + "userId": 0, + "created": "2020-09-09T06:42:21.053", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-09T06:41:30.74", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-09T06:41:30.74", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-09T06:13:18.233", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-09T06:07:40.61", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-09T06:07:40.61", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2020-09-05T06:20:19.827", + "type": 1 + }, + { + "name": "AUTO - Status Set Repo Flag", + "message": "set flag", + "userId": 0, + "created": "2020-09-05T06:20:00.327", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-05T06:18:53.937", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-05T06:18:53.937", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-05T06:13:36.203", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-05T06:08:34.767", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-05T06:08:34.767", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2020-09-04T06:15:17.443", + "type": 1 + }, + { + "name": "AUTO - Status Set Repo Flag", + "message": "set flag", + "userId": 0, + "created": "2020-09-04T06:15:01.443", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-04T06:14:06.397", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-04T06:14:06.397", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-04T06:08:05.63", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-04T06:04:20.227", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-04T06:04:20.227", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2020-09-03T20:05:41.673", + "type": 1 + }, + { + "name": "AUTO - Status Set Repo Flag", + "message": "set flag", + "userId": 0, + "created": "2020-09-03T20:05:16.627", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-03T06:26:33.267", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-03T06:26:33.267", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-03T06:20:31.987", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-03T06:15:19.283", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-03T06:15:19.283", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-02T06:23:06.313", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-02T06:23:06.313", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-02T06:17:58.453", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-09-02T06:12:43.64", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-09-02T06:12:43.64", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-08-29T06:10:51.86", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-08-29T06:10:51.86", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-08-29T06:04:59", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-08-29T06:01:35.11", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-08-29T06:01:35.11", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-08-28T06:19:11.93", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-08-28T06:19:11.93", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-08-28T06:12:12.493", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-08-28T06:09:32.977", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-08-28T06:09:32.977", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-08-27T06:18:50.763", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-08-27T06:18:50.763", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-08-27T06:13:32.97", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-08-27T06:10:33.67", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-08-27T06:10:33.67", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-08-26T06:30:04.41", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-08-26T06:30:04.41", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-08-26T06:21:40.053", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-08-26T06:14:38.397", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-08-26T06:14:38.397", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-08-25T06:59:21.363", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-08-25T06:59:21.363", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-08-25T06:29:11.77", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-08-25T06:08:28.13", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-08-25T06:08:28.13", + "type": 1 + }, + { + "name": "AUTO - Collection Agency Aries Data", + "message": "Flip to Aries Data", + "userId": 5, + "created": "2020-08-24T11:18:07.53", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 5, + "created": "2020-08-24T10:38:32.603", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 5, + "created": "2020-08-24T10:38:32.603", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 5, + "created": "2020-08-24T10:38:06.633", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 5, + "created": "2020-08-24T10:38:06.633", + "type": 1 + }, + { + "name": "AUTO - Collection Agency ACSI", + "message": "Flip to ACSI", + "userId": 5, + "created": "2020-08-24T10:37:08.713", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-08-21T06:24:18.497", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-08-21T06:24:18.497", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-08-21T06:16:24.2", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-08-21T06:11:34.887", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-08-21T06:11:34.887", + "type": 1 + }, + { + "name": "AUTO - Status Set Repo Flag", + "message": "set flag", + "userId": 5, + "created": "2020-08-19T22:53:55.283", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 5, + "created": "2020-08-19T22:53:24.58", + "type": 1 + }, + { + "name": "BATCH - Recovery Charge Off", + "message": "Recommend for Charge Off", + "userId": 4, + "created": "2020-08-17T14:36:50.917", + "type": 1 + }, + { + "name": "BATCH - Recovery Charge Off", + "message": "Recommendation Approval", + "userId": 4, + "created": "2020-08-17T14:36:50.917", + "type": 1 + }, + { + "name": "BATCH - Recovery Charge Off", + "message": "Set GL Amounts", + "userId": 4, + "created": "2020-08-17T14:36:50.917", + "type": 1 + }, + { + "name": "BATCH - Recovery Charge Off", + "message": "Charge Off Account", + "userId": 4, + "created": "2020-08-17T14:36:50.917", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-08-15T06:18:15.563", + "type": 1 + }, + { + "name": "Redemption Calc IL Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-08-15T06:18:15.563", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-08-15T06:09:53.47", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Current Date", + "userId": 0, + "created": "2020-08-15T06:04:46.533", + "type": 1 + }, + { + "name": "Redemption Calc WI Date Set", + "message": "Change Date - Expiration Date", + "userId": 0, + "created": "2020-08-15T06:04:46.533", + "type": 1 + }, + { + "name": "AUTO - Set Repo Flag", + "message": "set flag", + "userId": 5, + "created": "2020-08-14T10:26:40.197", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-08-14T06:08:06.39", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-08-12T06:19:54.927", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-08-11T06:21:24.317", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-08-08T08:15:36.74", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-08-07T06:11:56.543", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-08-06T20:07:35.003", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-08-05T20:18:54.923", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "Intellect Permanent Comments - Blank", + "userId": 2, + "created": "2020-07-29T14:38:52.273", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "User Status Code 2 - Blank", + "userId": 2, + "created": "2020-07-29T14:38:52.273", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "User Status Code 1 - Blank", + "userId": 2, + "created": "2020-07-29T14:38:52.273", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "Intellect Next Follow Up Date - 1/1/20", + "userId": 2, + "created": "2020-07-29T14:38:52.273", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "Last Contact Date - 1/1/2020", + "userId": 2, + "created": "2020-07-29T14:38:52.273", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "Intellect Permanent Comments - Blank", + "userId": 2, + "created": "2020-07-29T14:35:48.46", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "User Status Code 2 - Blank", + "userId": 2, + "created": "2020-07-29T14:35:48.46", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "User Status Code 1 - Blank", + "userId": 2, + "created": "2020-07-29T14:35:48.46", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "Intellect Next Follow Up Date - 1/1/20", + "userId": 2, + "created": "2020-07-29T14:35:48.46", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "Last Contact Date - 1/1/2020", + "userId": 2, + "created": "2020-07-29T14:35:48.46", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "Intellect Permanent Comments - Blank", + "userId": 2, + "created": "2020-07-29T14:25:50.07", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "User Status Code 2 - Blank", + "userId": 2, + "created": "2020-07-29T14:25:50.07", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "User Status Code 1 - Blank", + "userId": 2, + "created": "2020-07-29T14:25:50.07", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "Intellect Next Follow Up Date - 1/1/20", + "userId": 2, + "created": "2020-07-29T14:25:50.07", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "Last Contact Date - 1/1/2020", + "userId": 2, + "created": "2020-07-29T14:25:50.07", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-07-27T08:28:28.55", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-07-22T08:34:19.907", + "type": 1 + }, + { + "name": "Comment", + "message": "called Possible POE608-566-4456 not in service \r\n6466120143 07/15/2020 12:09:06 PMcalled the 608-206-9293 talked to MEMBERNAME autho full name ssn dob, address, she is still at the bar and they are closed, she stated she may have some money next week, let her know she would need 1200.00 to make any type of payment arrangement with her, she said ok, let her know that I can't stop or alter any action on the accountwithout a payment arrangment and money upfront, she said she will call us \r\n6466120143 07/17/2020 11:00:00 AMto agentI did some skip work on this and found the father David Wagner reports at the 22 NORTH ST MADISON, WI 53704 address. I called our agent and they will run ASAP. I will advise if our unit is secured or an update. Thanks, Jeff Kalber 800-588-0097 x1091 2020-07-15 13:52:33 \r\n6466120143 07/23/2019 12:00:00 AMe/m LUVED99@GMAIL.COM", + "userId": 1, + "created": "2020-07-15T12:05:08", + "type": 0 + }, + { + "name": "Comment", + "message": "CCAPSHE HAS A JUDGMENT US BANK IN JANUARY 2020 \r\n6466120143 07/15/2020 11:35:36 AMCURRENT ADDRESS UPDATED WITH CHILD SUPPORT AGENCY22 North St, Madison, WI 53704 United States (Effective: 06-10-2020) \r\n6466120143 07/15/2020 12:00:30 PMgave the agent the new address 22 North St, Madison, WI 53704 United States \r\n6466120143 07/15/2020 12:04:53 PMLoan documentsPOE listed POE was Club Bristol Bar manager, 608-566-4456", + "userId": 1, + "created": "2020-07-15T11:33:32", + "type": 0 + }, + { + "name": "Comment", + "message": "DRN Sorry, there were no clustered locations found. \r\n6466120143 07/09/2020 08:08:03 AM* LETTER * Letter for Loan & Dep Accts Pre Coll Agency \r\n6466120143 07/15/2020 01:17:25 PMFOLLOW UP ON AGENT UPDATES \r\n6466120143 07/15/2020 11:31:46 AMAGENT UPDATERan 18 Woodridge Ct day and night with no sighting of wanted unit", + "userId": 1, + "created": "2020-07-07T10:31:48", + "type": 0 + }, + { + "name": "Comment", + "message": "CCABR Comment: RDN LAST UPDATE \t06/25/2020\t06:23\tLocation Services, LLCWhiteman, Nelly\t(O)Agent-UpdateHello,We have assigned 18 WOODRICH CT to a new agent for a fresh set of eyes, updates to follow.Thank you \r\n6466120143 06/29/2020 10:27:13 AMCCABR Call: Call Follow Up \r\n6466120143 06/29/2020 10:27:07 AMCCABR Message: MEMBERNAME WAGNER @ 608-206-9293 \r\n6466120143 02/26/2020 02:53:51 PMTCOTT Contact Out: Called MEMBERNAME WAGNER @ 608-206-9293", + "userId": 1, + "created": "2020-07-07T10:27:31", + "type": 0 + }, + { + "name": "Comment", + "message": "CCABR Comment: Hello MEMBERNAME,Its important you contact Landmark Credit Union Collections at (855)815-6391.Thank you,Cynthia Avila Collections Team LeadLandmark Credit Union \r\n6466120143 02/26/2020 02:57:50 PMTCOTT Call: Call Follow Up \r\n6466120143 06/11/2020 09:59:05 AMCCABR Message: MEMBERNAME WAGNER @ 608-206-9293 \r\n6466120143 07/07/2020 10:24:58 AMCCABR Message: Emailed MEMBERNAME WAGNER - LUVED99@GMAIL.COM", + "userId": 1, + "created": "2020-07-07T10:26:02", + "type": 0 + }, + { + "name": "Comment", + "message": "CCABR Call: Call Follow Up \r\n6466120143 02/26/2020 02:56:23 PMTCOTT Comment: SPOKE W/ MEMBERNAME SHE STATED THAT SHE HAD TO GET A TON OF WRK DONE ON THE CAR, INFORMED HER THAT IM TRYONG TO KEEP HER FROM GOING OUT FOR REPO IF SHE SI ABLE TO MAKE DEC PAYMNT SUBMIT 2MNTH DEFRL FOR JAN AND FEB SHE SD THAR SHE WILL TRY TO GET SOMETHING I \r\n6466120143 01/29/2020 09:14:49 AMTCOTT Comment: PAYMNT RECVD FOR $750.00 LOAN 50DPD WILL CXL REPO AT THIS TIME \r\n6466120143 02/19/2020 11:59:35 AMTCOTT Call: Call Follow Up", + "userId": 1, + "created": "2020-07-07T10:26:02", + "type": 0 + }, + { + "name": "Comment", + "message": "Hello MEMBERNAME,Please contact Landmark Credit Union - Collections at (855)815-6391.Thank you,Cynthia Avila Collections Team Lead \r\n6466120143 07/07/2020 10:26:02 AMHello MEMBERNAME,Its important you contact Landmark Credit Union Collections at (855)815-6391.Thank you,Cynthia Avila Collections Team LeadLandmark Credit Union \r\n6466120143 07/07/2020 10:27:31 AMRDN LAST UPDATE \t06/25/2020\t06:23\tLocation Services, LLCWhiteman, Nelly\t(O)Agent-UpdateHello,We have assigned 18 WOODRICH CT to a new agent for a fresh set of eyes, updates to follow.Thank you \r\n6466120143 07/07/2020 10:28:39 AMRDN requested update: \t07/07/2020\t08:28\tLandmark Credit UnionCabrera, Cynthia\tClient-Requesting UpdatePlease update status. ThanksFor Address: 18 WOODRICH CT MADISON, WI", + "userId": 1, + "created": "2020-06-29T10:13:48", + "type": 0 + }, + { + "name": "Comment", + "message": "CCABR Comment: RDN REQT UPDATES:\t06/24/2020\t07:57\tLandmark Credit UnionCabrera, Cynthia\tClient-New InfoPlease update any info on acct. Thanks! \r\n6466120143 06/24/2020 09:58:04 AMCCABR Message: Emailed MEMBERNAME WAGNER - LUVED99@GMAIL.COM \r\n6466120143 03/20/2020 02:03:20 PMCCABR Comment: aced on hold for the following reason:COV0ID-19 \r\n6466120143 03/20/2020 02:03:20 PMCCABR Comment: RDN UPDATED BY TRA:03/20/2020\t08:55\tLocation Services, LLCWhiteman, Nelly\tAgent AcknowledgeAgent acknowledged the hold\t\t03/20/2020\t08:52\tLandmark Credit UnionCotton, Tranace\tClient-Account On HOLDYour client has requested that this account be pl", + "userId": 1, + "created": "2020-06-24T09:59:46", + "type": 0 + }, + { + "name": "Comment", + "message": "CCABR Comment: Hello MEMBERNAME,Please contact Landmark Credit Union - Collections at (855)815-6391.Thank you,Cynthia Avila Collections Team Lead \r\n6466120143 06/24/2020 09:58:56 AMCCABR Call: Call Follow Up \r\n6466120143 06/24/2020 09:59:04 AMCCABR Message: MEMBERNAME WAGNER @ 608-206-9293 \r\n6466120143 06/24/2020 09:59:12 AMCCABR Call: Call Follow Up", + "userId": 1, + "created": "2020-06-24T09:58:56", + "type": 0 + }, + { + "name": "Comment", + "message": "USERDEF FRON REHO TO O4R \r\n6466120143 06/18/2020 03:31:25 PMREMOVED REHO ALERTS \r\n6466120143 06/18/2020 03:34:48 PMRDN UPDATED 06/18/2020\t13:32\tLandmark Credit UnionCabrera, Cynthia\tClient-Account Re-OpenedYour client has requested that this account be taken off hold for the following reason:ABLE TO RELEASE HOLD IF NO PMTS AFTER COVID-19 \r\n6466120143 06/24/2020 09:59:46 AMRDN REQT UPDATES:\t06/24/2020\t07:57\tLandmark Credit UnionCabrera, Cynthia\tClient-New InfoPlease update any info on acct. Thanks!", + "userId": 1, + "created": "2020-06-18T15:31:13", + "type": 0 + }, + { + "name": "Comment", + "message": "CCABR No Answer: MEMBERNAME WAGNER @ 608-206-9293 \r\n6466120143 06/18/2020 03:31:13 PMCCABR Comment: USERDEF FRON REHO TO O4R \r\n6466120143 06/18/2020 03:30:41 PMCCABR Comment: NO PMTS SINCE LAST CONTACT WITH MBR \r\n6466120143 06/18/2020 03:30:52 PMCCABR Comment: PLACING ACCT BACK O4R", + "userId": 1, + "created": "2020-06-18T15:29:51", + "type": 0 + }, + { + "name": "Comment", + "message": "CCABR Comment: Putting repossession on hold due to Covid-19. \r\n6466120143 03/20/2020 02:00:50 PMCCABR Comment: Userdef from=O4R to REHO. \r\n6466120143 03/20/2020 02:00:41 PMCCABR Comment: 101 DPD DUE FOR 12/10/169 \r\n6466120143 03/10/2020 11:28:32 AMCCABR Message: MEMBERNAME WAGNER @ 608-206-9293", + "userId": 1, + "created": "2020-03-20T14:00:56", + "type": 0 + }, + { + "name": "Comment", + "message": "101 DPD DUE FOR 12/10/169 \r\n6466120143 03/20/2020 02:00:50 PMUserdef from=O4R to REHO. \r\n6466120143 03/20/2020 02:00:56 PMPutting repossession on hold due to Covid-19. \r\n6466120143 03/20/2020 02:03:20 PMRDN UPDATED BY TRA:03/20/2020\t08:55\tLocation Services, LLCWhiteman, Nelly\tAgent AcknowledgeAgent acknowledged the hold\t\t03/20/2020\t08:52\tLandmark Credit UnionCotton, Tranace\tClient-Account On HOLDYour client has requested that this account be placed on hold for the following reason:COV0ID-19", + "userId": 1, + "created": "2020-03-20T14:00:41", + "type": 0 + }, + { + "name": "Comment", + "message": "USERDEF CHANGED FROM O4R TO REHO-COVID-19 \r\n6466120143 06/11/2020 12:00:00 AMTT MEMBERNAME 608-206-9293 ADV ON PMTS DUE SINCE DEC 2019RFD STATED COVID-19 LAID OFFADV MBR ON MAKING PMTS FOR DEC JAN FEB AND MARCH AMT OF $1570 INCLUDING LATE FEES OF $42.90 ONCE THIS PMT IS MADE WE CAN OFFER A 3 MONTH DEFERRAL APRIL MAY JUNE DUE TO COVID-19 LAID OFFMBR AWARE OUT FOR REPO ADV ME ON CALLING HER BACK ON WED 6/10/20 FOR SOLUTIONVERIFIED DEMOS \r\n6466120143 06/18/2020 03:30:41 PMNO PMTS SINCE LAST CONTACT WITH MBR \r\n6466120143 06/18/2020 03:30:52 PMPLACING ACCT BACK O4R", + "userId": 1, + "created": "2020-03-20T10:52:42", + "type": 0 + }, + { + "name": "Comment", + "message": "TCOTT Comment: USERDEF CHANGED FROM O4R TO REHO-COVID-19 \r\n6466120143 03/10/2020 11:28:36 AMCCABR Call: Call Follow Up \r\n6466120143 06/18/2020 03:29:56 PMCCABR Call: Call Follow Up \r\n6466120143 03/09/2020 09:31:08 AMJOHNS Comment: Approved REPORTC EXP 2/12/20, REPO DUE 12/10/19 @ 90 DPDNO COMMUNICATION, LAST PAYMNT 1/17/20, SCRA NOT LISTED NO UPDATED POE INS EXP 8/15/20", + "userId": 1, + "created": "2020-03-20T10:52:42", + "type": 0 + }, + { + "name": "Comment", + "message": "CCABR Message: MEMBERNAME WAGNER @ 608-206-9293 \r\n6466120143 07/07/2020 10:28:39 AMCCABR Comment: RDN requested update: \t07/07/2020\t08:28\tLandmark Credit UnionCabrera, Cynthia\tClient-Requesting UpdatePlease update status. ThanksFor Address: 18 WOODRICH CT MADISON, WI \r\n6466120143 03/11/2020 08:41:07 AMACEVE Comment: 92 dpd - Next due date 12/10/19 - Cont w/repo \r\n6466120143 07/07/2020 10:31:48 AMCCABR Comment: DRN Sorry, there were no clustered locations found.", + "userId": 1, + "created": "2020-03-17T14:49:09", + "type": 0 + }, + { + "name": "Comment", + "message": "ACEVE Comment: Repo Manager Alerts 03-10-2020 17:10:09Account No: 6466120143Alert: Payment Receivedhttps://repomanage.lcu-internal.com/#/Account/4133Payment Amount $420 \r\n6466120143 03/06/2020 03:05:47 PMTCOTT Comment: USERDEF CHNAGED FROM RECA TO RR \r\n6466120143 03/06/2020 03:26:56 PM5783 Comment: ISSUED TO LOCATION SERVICES \r\n6466120143 03/06/2020 03:06:30 PMTCOTT Call: Call Follow Up", + "userId": 1, + "created": "2020-03-11T08:40:40", + "type": 0 + }, + { + "name": "Comment", + "message": "Approved REPORTC EXP 2/12/20, REPO DUE 12/10/19 @ 90 DPDNO COMMUNICATION, LAST PAYMNT 1/17/20, SCRA NOT LISTED NO UPDATED POE INS EXP 8/15/20 \r\n6466120143 03/11/2020 08:41:26 AMEmailed Tra \r\n6466120143 03/11/2020 08:41:42 AM92 dpd - Next due date 12/10/19 - Cont w/repo \r\n6466120143 03/11/2020 08:41:46 AMRepo Manager Alerts 03-10-2020 17:10:09Account No: 6466120143Alert: Payment Receivedhttps://repomanage.lcu-internal.com/#/Account/4133Payment Amount $420", + "userId": 1, + "created": "2020-03-10T11:27:32", + "type": 0 + }, + { + "name": "Comment", + "message": "JOHNS Call: Call Follow Up \r\n6466120143 06/08/2020 03:51:27 PMCCABR Comment: TO COVID-19 LAID OFFMBR AWARE OUT FOR REPO ADV ME ON CALLING HER BACK ON WED 6/10/20 FOR SOLUTIONVERIFIED DEMOS \r\n6466120143 06/08/2020 03:51:27 PMCCABR Comment: TT MEMBERNAME 608-206-9293 ADV ON PMTS DUE SINCE DEC 2019RFD STATED COVID-19 LAID OFFADV MBR ON MAKING PMTS FOR DEC JAN FEB AND MARCH AMT OF $1570 INCLUDING LATE FEES OF $42.90 ONCE THIS PMT IS MADE WE CAN OFFER A 3 MONTH DEFERRAL APRIL MAY JUNE DUE \r\n6466120143 06/08/2020 03:51:27 PMCCABR Call: Call Follow Up", + "userId": 1, + "created": "2020-03-09T09:31:08", + "type": 0 + }, + { + "name": "Comment", + "message": "E/M-LUVED99@GMAIL.COM \r\n6466120143 03/06/2020 03:05:22 PMREPO- RR SYSTEMRTC EXP 2/12/20, REPO DUE 12/10/19 @ 87DPDNO COMMUNICATION, LAST PAYMNT 1/17/20, SCRA NOT LISTED NO UPDATED POE INS EXP 8/15/20PLEASE START RECOVERY AT ADDY ON FILE \r\n6466120143 03/06/2020 03:05:47 PMUSERDEF CHNAGED FROM RECA TO RR \r\n6466120143 03/06/2020 03:26:56 PMISSUED TO LOCATION SERVICES", + "userId": 1, + "created": "2020-03-06T15:02:32", + "type": 0 + }, + { + "name": "Comment", + "message": "TCOTT Comment: E/M-LUVED99@GMAIL.COM \r\n6466120143 03/06/2020 03:05:22 PMTCOTT Comment: REPO- RR SYSTEMRTC EXP 2/12/20, REPO DUE 12/10/19 @ 87DPDNO COMMUNICATION, LAST PAYMNT 1/17/20, SCRA NOT LISTED NO UPDATED POE INS EXP 8/15/20PLEASE START RECOVERY AT ADDY ON FILE \r\n6466120143 02/10/2020 11:08:15 AM4735 Ltr-File: 60 Day Past Due Letter \r\n6466120143 02/10/2020 10:05:14 AMTCOTT Comment: E/M-LUVED99@GMAIL.COM", + "userId": 1, + "created": "2020-03-06T15:02:32", + "type": 0 + }, + { + "name": "Comment", + "message": "TCOTT Comment: NO RETRN CALL/PAYMNT NEXT FOLLOW UP BACK OUT FOR REPO \r\n6466120143 02/19/2020 11:59:04 AMTCOTT Message: MEMBERNAME WAGNER @ 608-206-9293 \r\n6466120143 03/17/2020 02:49:12 PMCCABR Call: Call Follow Up \r\n6466120143 02/26/2020 02:56:23 PMTCOTT Comment: N NEXT WEEK.. DEM STILL THE SME", + "userId": 1, + "created": "2020-02-19T11:59:32", + "type": 0 + }, + { + "name": "Comment", + "message": "Letter. The letter was sent to Address Home printed on 1/27/2020 11:41:32 AM. Letter \r\n6466120143 02/10/2020 12:00:00 AMLtr-File. The letter was sent to Address Home printed on 2/10/2020 11:16:29 AM. Ltr-File \r\n6466120143 02/19/2020 11:59:32 AMNO RETRN CALL/PAYMNT NEXT FOLLOW UP BACK OUT FOR REPO \r\n6466120143 02/26/2020 02:56:23 PMSPOKE W/ MEMBERNAME SHE STATED THAT SHE HAD TO GET A TON OF WRK DONE ON THE CAR, INFORMED HER THAT IM TRYONG TO KEEP HER FROM GOING OUT FOR REPO IF SHE SI ABLE TO MAKE DEC PAYMNT SUBMIT 2MNTH DEFRL FOR JAN AND FEB SHE SD THAR SHE WILL TRY TO GET SOMETHING IN NEXT WEEK.. DEM STILL THE SME", + "userId": 1, + "created": "2020-02-10T10:06:05", + "type": 0 + }, + { + "name": "Comment", + "message": "TCOTT Call: Call Follow Up \r\n6466120143 02/10/2020 10:04:18 AMTCOTT Message: MEMBERNAME WAGNER @ 608-206-9293 \r\n6466120143 03/11/2020 08:41:16 AMACEVE Comment: Emailed Tra \r\n6466120143 06/11/2020 09:59:16 AMCCABR Call: Call Follow Up", + "userId": 1, + "created": "2020-02-10T10:06:03", + "type": 0 + }, + { + "name": "Comment", + "message": "4735 Letter: RTC-WI-AUTO LOANS \r\n6466120143 06/08/2020 03:47:32 PMCCABR Contact Out: Called MEMBERNAME WAGNER @ 608-206-9293 \r\n6466120143 06/18/2020 03:34:48 PMCCABR Comment: RDN UPDATED 06/18/2020\t13:32\tLandmark Credit UnionCabrera, Cynthia\tClient-Account Re-OpenedYour client has requested that this account be taken off hold for the following reason:ABLE TO RELEASE HOLD IF NO PMTS AFTER COVID-19 \r\n6466120143 06/18/2020 03:31:25 PMCCABR Comment: REMOVED REHO ALERTS", + "userId": 1, + "created": "2020-01-27T11:41:28", + "type": 0 + }, + { + "name": "Comment", + "message": "SPOKE W/ MEMBERNAME SHE STATED THAT SHE WAS GOING TO CALL TODAY TO SEE WHAT SHE OWES, INFORMED HER THAT SHE HAS BEEN PLACED BACKOUT FOR REPO, IN ORDER TO PLACE REPO BACK ON HOLD I NEED $737.48 TO CLEAR OCT AND NOV PAYMENT.SHE SD THAT SHE CAN GETTHAT TO ME ON MONDAY, TOLD HER MONDAY IS HER CUT OFF DATE NO PAYMNT I HAVE TO COME AND PICK UP THE CAR, SHE SD OK.. \r\n6466120143 01/15/2020 11:47:18 AMUSERDEF CHANGED FROM O4R TO REHO \r\n6466120143 01/29/2020 09:14:49 AMPAYMNT RECVD FOR $750.00 LOAN 50DPD WILL CXL REPO AT THIS TIME \r\n6466120143 02/10/2020 10:05:14 AME/M-LUVED99@GMAIL.COM", + "userId": 1, + "created": "2020-01-15T11:46:01", + "type": 0 + }, + { + "name": "Comment", + "message": "E/M-LUVED99@GMAIL.COM \r\n6466120143 01/08/2020 03:01:24 PMRELEASED HOLD, NO RETRN CALLS. BRKN PTP FOR 12/27 \r\n6466120143 01/08/2020 03:02:13 PMUSERTDEF CHANGED FROM REHO BACK TO O4R/RELEASED HOLD IN RDN \r\n6466120143 01/15/2020 11:41:39 AMREVERSE ADDY GOES BACK TO MBR", + "userId": 1, + "created": "2020-01-03T08:42:16", + "type": 0 + }, + { + "name": "Comment", + "message": "SPOKE W/ MEMBERNAME INFORMED HER THAT SHES 99DPD AND I NEED UPDATE ON NEXT PAYMNT TO GET HER OUT OF REPO SHE ASKED TEH AMOUNT TOLD HER $548.39 WHICH $60 OF THAT CLEAR SEPT PAYMNT SHE SD THAT SHE WILL CALL BACK LATER TODAY OR TOMORROW.. TOLD HER I NEED A CB BY FRI \r\n6466120143 12/18/2019 04:51:09 PMMEMBERNAME CB IN TO PAY SD THAT SHE ONLY HAS $300 WILL PAY THE REMAINING NEXT FRI TOLD HER ONCE I GET THAT I WILL CXL REPO \r\n6466120143 12/18/2019 04:51:31 PMElectronic Cash Management (ECM) » SuccessYour transaction was successfully submitted for processing.Tracking Number: AN0E2B1ABD6B \r\n6466550-2 07/25/2019 11:02:32 AMKITTY CI FROM W.ALLIS BR MEM PAYING IN FULL CASH 197.42 I UPATED XP NOTES", + "userId": 1, + "created": "2019-12-18T15:30:45", + "type": 0 + }, + { + "name": "Comment", + "message": "tt MEMBERNAME stated car has been broken down front end and new tires does not have it in a shop has not been working for 2 months xfer to trenace vehile is out for repo verified demos \r\n6466120143 12/04/2019 08:31:39 AMProcessed pymt of $780 + $10 conv fee for Tra.Electronic Cash Management (ECM) » SuccessYour transaction was successfully submitted for processing.Tracking Number: AH0E2AD19FBE \r\n6466120143 12/10/2019 04:40:19 PME/M-LUVED99@GMAIL.COM \r\n6466120143 12/10/2019 04:40:36 PMNO RETRN CALL NEXT WEEK/PAYMNT RELEASING HOLD", + "userId": 1, + "created": "2019-12-03T17:00:17", + "type": 0 + }, + { + "name": "Comment", + "message": "SPOKE W/ MEMBERNAME SHE STATED THAT SHE ISNT WORKING AND CAN PAY $100 A WEEK TO GET CAUGHT UP ASKED HER WHAT WAS WRONG W/ THE CAR SHE SD NEEDS TIRES, SOME FROMT END WORK AND SUSPENSION INFORMED HER SHE WAS OUT FOR REPO, SHE ASKED WHAT WOULD SHE NEED TO PAY TO STOP REPO, INFORMED HER THAT I WOULD NEED $839.30 WHICH WILL CLEAR AUG AND SEPT PAYMNTS ONCE THAT IS MADE WE CAN DO A 2MNTH DEFRL FOR OCT AND NOV TO HELP HER GET CAUGHT UP SHE SD OK SHE WILL SEE WHAT SHE CAN DO.. INFORMED HER THAT I CANNOT STOP REPO UNTIL SHE GIVES ME A PAYMNT AND DATE SHE SD OK.. NO PAYMNT ARRGAMENTS MADE \r\n6466120143 12/03/2019 04:59:13 PMMEMBERNAME called back, she sd that she had the money she had $780 informd her of $10 fee she sd ok.. tookdebit card paymnt toldher ill place repoon hold she will have a bal of$59.30 still due for sept she sd thar she will probablybebale to pay iton fri at a branch dont wantto pay $10 for paymntsent paymnt over to deb to process, informed her once she clears the remaining bal for sept i will submit 2 mnth defrl \r\n6466120143 12/03/2019 04:59:43 PMrepo placed onhold in rdn \r\n6466120143 12/03/2019 04:59:59 PMuserdef changed from o4r to reho", + "userId": 1, + "created": "2019-12-03T14:40:46", + "type": 0 + }, + { + "name": "Comment", + "message": "TLO- ADDY STILL SHOWING CURRENT \r\n6466120143 11/29/2019 05:10:23 PMCALLED POE: 608-837-7722-EMP ANSWERED STATED THAT SHE WRKS SOME FRIDAYS MAY WRK TONIGHT***GENTLEMANS CLUB*** \r\n6466120143 11/29/2019 05:10:59 PMPOE ADDY:7653 COUNTY RD N SUN PRAIRIE, WI 53590UPDATED RDN TO RUN ADDY \r\n6466120143 11/29/2019 12:00:00 AMREPO- RR SYSTEMRTC EXP 10/11/19 REPO DUE 8/10/19@ 102DPDNO COMMUNICATION, LAST PAYMNT 8/14/19, NO UPDATED POE, SCRA NOT LISTED, INSURED W/ FOUNDERSPLEASE STARR RECOVERY AT ADDY ON FILE", + "userId": 1, + "created": "2019-11-29T17:07:43", + "type": 0 + }, + { + "name": "Comment", + "message": "TLO-608-209-8420-BUSY \r\n6466120143 11/29/2019 05:06:06 PMTLO-608-285-5999-VM NOT SET UP \r\n6466120143 11/29/2019 05:06:42 PMTLO-608-219-1792-VM STATED MARK-DIDNT LEAVE MSG \r\n6466120143 11/29/2019 05:07:27 PME/M-davewagner@gmail.com", + "userId": 1, + "created": "2019-11-29T17:05:45", + "type": 0 + }, + { + "name": "Comment", + "message": "NO RETRN CALL OR PAYMNT OUT FOR RECOVERY NEXT FOLLOW UP \r\n6466120143 11/20/2019 04:24:22 PMEMAIL TRA TO PUT OUT FOR REPO BASED ON PREVIOUS NOTES 11.05.2019..PUT THE REPO REF CODE ON THE ACCT \r\n6466120143 11/21/2019 01:27:45 PMISSUED TO LOCATION SERVICES \r\n6466120143 11/22/2019 05:50:30 PMApproved REPO- RR SYSTEMRTC EXP 10/11/19 REPO DUE 8/10/19@ 103 DPDNO COMMUNICATION, LAST PAYMNT 8/14/19, NO UPDATED POE, SCRA NOT LISTED, INSURED W/ FOUNDERS", + "userId": 1, + "created": "2019-11-05T12:52:29", + "type": 0 + }, + { + "name": "Comment", + "message": "TRUEPOEOPLE SEARCH:Current Address 2636 Milwaukee St Madison, WI 53704-5120 \r\n6466120143 11/05/2019 12:47:28 PMCCAPS-1/29/19:Speeding in 55 MPH Zone (11-15 MPH)SAME ADDY LISTED \r\n6466120143 11/05/2019 12:49:36 PMCBR PULLED:ADDY STILL THE SAMEPOE LISTED: SELF EMPLYDNO MTRGQUITE A FEW OPEN CREDIT ACCTS \r\n6466120143 11/05/2019 12:51:15 PMSCRA-NOT LISTED", + "userId": 1, + "created": "2019-11-05T12:46:34", + "type": 0 + }, + { + "name": "Comment", + "message": "e/m davewagner@gmail.comlilbabigoddess@yahoo.comcengleson@hotmail.com \r\n6466120143 11/05/2019 12:44:22 PMCALLED 608-209-8420-NOT IN SERVICE \r\n6466120143 11/05/2019 12:45:33 PMTRUEPEOPLESEARCH-608-446-5497-DSNTD \r\n6466120143 11/05/2019 12:46:08 PMTRUEPEOPLESERACH-608-285-5999-LEFT VM", + "userId": 1, + "created": "2019-10-29T00:00:00", + "type": 0 + }, + { + "name": "Comment", + "message": "skip searchPOE, Gentlemens club, sun praire, shows this possible MEMBERNAME Wagner in Sun prairie but that MEMBERNAME is 24, not the age of our menber.tried to utilize a card from Thomas D. Payton back in August but declined, member had Thomas on the phone. 823 N Gammon Rd Madison, WI 608 831 6961 \r\n6466120143 10/24/2019 12:00:00 AMe/m LUVED99@GMAIL.COM \r\n6466120143 10/24/2019 12:34:15 PMTLOPOEBusiness Name: CLUB BRISTOLPhone: (608) 209-8420 TEMP NOT IN SERVICE POSSIBLE NUMBER (608) 209-8420 POSSIBLE EMAIL davewagner@gmail.comlilbabigoddess@yahoo.comcengleson@hotmail.comADDY 18 WOODRIDGE CT APT 7, MADISON, WI 53704-7889 (DANE COUNTY) (07/2016 to 10/24/2019) CURRENT VEHICLE1999 BUICK -Series: CUSTOM -Model: CENTURYVIN: 2G4WS52M4X1613864 Most Current Tag #: WI 580YFJ Valid from: (10/03/2018 to 11/19/2019)GLOBAL WATCH LIST Name: DANIELA GOZES-WAGNER Address: DANBURY, CT 06811 Match Score: 69 Source: System for Award Management Exclusions Type: INDIVIDUAL Wanted By: HHS Program: PROHIBITION/RESTRICTION Legal Basis: RECIPROCAL Country: USA \r\n6466120143 10/29/2019 03:59:25 PMACCURINT SEARCHSAME ADDY AS ON FILE NO NUMBERS LISTED", + "userId": 1, + "created": "2019-10-23T12:23:36", + "type": 0 + }, + { + "name": "Comment", + "message": "Letter. The letter was sent to Address Home printed on 10/9/2019 11:08:01 AM. Letter \r\n6466120143 10/09/2019 12:00:00 AMLetter. The letter was sent to Address Home printed on 9/25/2019 9:53:00 AM. Letter \r\n6466120143 10/11/2019 12:00:00 AMLtr-File. The letter was sent to Address Home printed on 10/11/2019 10:01:58 AM. Ltr-File \r\n6466120143 10/23/2019 12:10:51 PMskip FB nothing", + "userId": 1, + "created": "2019-10-09T11:10:51", + "type": 0 + }, + { + "name": "Comment", + "message": "608-209-8420 Temporarily not in service. \r\n6466120143 10/09/2019 11:03:14 AMI emailed MEMBERNAME at LUVED99@GMAIL.COM to call us back. \r\n6466120143 10/09/2019 11:04:50 AMPOE (per loan app & notes) is Club Bristol. Phone: 608-566-4456. \r\n6466120143 10/09/2019 11:06:59 AMCalled out on 608-566-4456. A man named Jimmy Johnson answered. It was not the phone number for Club Bristol. Wrong number.", + "userId": 1, + "created": "2019-10-09T11:01:43", + "type": 0 + }, + { + "name": "Comment", + "message": "she cd sd wd figure it out & call back in a day or two since pmt rejected \r\n6466120143 09/03/2019 12:00:00 AMLtr-File. The letter was sent to Address Home printed on 9/3/2019 9:54:25 AM. Ltr-File \r\n6466120143 09/11/2019 12:00:00 AMLtr-File. The letter was sent to Address Home printed on 9/11/2019 10:57:48 AM. Ltr-File \r\n6466120143 10/09/2019 11:00:40 AMPer Allied website, the vehicle is insured. Current policy with Founders began on 8/14/19 and expires on 2/15/20. Member had a previous lapse in coverage from 3/5/19 to 8/14/19.", + "userId": 1, + "created": "2019-08-15T14:40:32", + "type": 0 + }, + { + "name": "Comment", + "message": "****PAYMENT REJECTED FOR $1,000 DUE TO VISA*******CALLED MEMBERNAME BACK AND LM ON HER VM TO CALL ME BACK WITH MY DIRECT EXTENSION AND OUR COLLECTIONS LINE. I need to inform her that we need a Visa Debit Card and that this credit payment would not process!! \r\n6466120143 08/12/2019 05:02:06 PMSpoke MEMBERNAME and she is aware the payment was rejected and she will figure something out \r\n6466120143 08/12/2019 12:00:00 AMLtr-File. The letter was sent to Address Home printed on 8/12/2019 9:18:51 AM. Ltr-File \r\n6466120143 08/12/2019 12:00:00 AMMember called in verf demos, took a PTP: $1,000.00 from a credit card of Thomas D. Payton for today using his visa, he gave us permission to take $1,010.00 including the convenience fee, explained to her that her entire July payment isn't complete and that if there are any issues with the payment my supervisor needs to run i'll call back", + "userId": 1, + "created": "2019-08-12T16:24:02", + "type": 0 + }, + { + "name": "Comment", + "message": "MEMBERNAME c/n verified her demos, stressed SOA and pymnt. Rfd-CPI added. the member confirmed she does not have insurance and should have it by next week Tuesday. MEMBERNAME will try to pay the balance of Mays pymnt next week. I advised enough in the savings to make the pymnt. The member does not remember having money in the sav ; but, advised to add all of it toward the loan. \r\n6466120143 07/31/2019 12:39:29 PMmntq-plz xfer $210.12 from 6466120-1 and apply to 6466120143. Thank you. \r\n6466120143 07/31/2019 12:39:44 PM608)209-8420 lvm \r\n6466120143 08/01/2019 12:00:00 AMLtr-File. The letter was sent to Address Home printed on 8/1/2019 10:51:36 AM. Ltr-File", + "userId": 1, + "created": "2019-07-31T12:39:29", + "type": 0 + }, + { + "name": "Comment", + "message": "TT MEMBERNAME SD THAT SHE WILL MKE A PMT BETWEEN $300.00-$400.00 BY 07/26/19 AND WILL MKE ANOTHER PMT THE FOLLOWING WEEKLY DID NOT CONFIRM THE AMOUNT EXPLAIN THAT SHE WILL NEED TO MKE A FULL PMT $568.19 RFD RENT CAR REPAIRSVERIFIED DEMOS \r\n6466120143 07/30/2019 12:00:00 AMe/m LUVED99@GMAIL.COM \r\n6466120143 07/31/2019 09:09:03 AMTransfer done. \r\n6466120143 07/31/2019 12:39:27 PMmbr 51 dpd", + "userId": 1, + "created": "2019-07-24T11:57:44", + "type": 0 + } + ], + "temenosAccount": { + "accountId": 491780, + "accountIdentifier": "6466120143", + "accountNumber": "6466120", + "accountStatus": "Written Off", + "accountTypeId": 1016, + "accountType": { + "id": 1016, + "description": "Miscellaneous", + "code": "MISC" + }, + "activeFlag": true, + "amountLastPaid": 900, + "runningBalance": 13862.46, + "bankruptcyFlag": false, + "branch": "57", + "dueDate": "2020-02-10T00:00:00", + "firstPaymentDueDate": "2017-02-10T00:00:00", + "loanOfficer": "JAMIE JOHNSON", + "originalLoanAmount": 22604.29, + "originalLoanDate": "2016-12-27T00:00:00", + "dqAmount": 0, + "daysDq": 247, + "suffix": "143", + "linkedAccount": "6466120143", + "productType": "98", + "closedDate": null, + "dateLastPaid": "7/29/2020 12:00:00 AM", + "dateFirstDelinquent": "9/9/2019 12:00:00 AM", + "cases": [ + { + "caseId": 306, + "caseNumber": "FRAUD-00000306", + "caseDescription": "", + "caseStageId": 2000125, + "repoStatus": 600, + "caseStatusId": 34, + "caseTitle": "test", + "caseTypeBasisId": 3, + "caseTypeId": 5, + "closedDate": null, + "createdDate": "2020-09-18T10:57:57.657", + "createdUserId": 17, + "currentStageDate": "2020-09-18T10:57:57.613", + "currentStatusDate": "2020-09-18T10:57:57.613", + "lastReviewDate": null, + "nextReviewDate": null, + "stage1CompletionDate": null, + "stage2CompletionDate": null, + "stage3CompletionDate": null, + "stage4CompletionDate": null, + "stage5CompletionDate": null, + "titleOrdered": false, + "titleOrderedDate": null, + "redemptionExpiredDateIl": null, + "redemptionExpiredDateWi": null, + "customFieldMap": { + "Case Modification Status": "", + "Case Loss Mitigation Stage": "", + "Case Loss Mitigation Type": "", + "Case Loss Mitigation Status": "", + "BRP Hardship Letter": "", + "BRP Bank Statements": "", + "BRP Paycheck Stubs": "", + "BRP Other Income If Applicable": "", + "BRP Tax Returns": "", + "BRP 4506T Form Signed": "", + "BRP Financial Worksheet": "", + "BRP 1st Mortgage Statement": "", + "BRP HOI Declaration Page": "", + "BRP Escrow Authorization Signed": "", + "BRP Additional Information Needed": "", + "Def Fore Financial Filed": "", + "Def Fore Case Number": "", + "Def Fore Date Filed": "", + "Def Fore Property Address is Mailing Address": "", + "Def Fore Property Address if not Mailing Address": "", + "Def Fore Attorney Name": "", + "Def Fore Attorney Number": "", + "Fore Referral Date": "", + "Fore SCRA Checked Date": "", + "Fore RTC Expiration Date": "", + "Fore On Hold Date": "", + "Fore On Hold Reason": "", + "Fore Reinstated Date": "", + "Fore Withdrawn Date": "", + "Fore Withdrawn Reason": "", + "Fore Withdrawn Reason If Other": "", + "Fore Date Last Payment": "", + "Fore Sale Scheduled Date": "", + "Fore Confirmation Scheduled Date": "", + "Fore Confirmation Complete Date": "", + "Fore Sale Result": "", + "Collection Agency": "False", + "Todays Date Case Lvl": "", + "DQ Amount Case Lvl": "", + "Performance Pymnts Case Lvl": "", + "Late Charges Case Lvl": "", + "Repo Fees Case Lvl": "", + "Redemption Amount Case Lvl": "0.0000", + "Balance Due Case Lvl": "", + "Legal Requested State Case Lvl": "", + "Judgement Dropdown Case Lvl": "", + "Attorney Firm Case Lvl": "", + "Documents Sent Date Case Lvl": "", + "Date Sent to Attorney Case Lvl": "", + "Date Served Case Lvl": "", + "Attorney Invoice Number Case Lvl": "", + "WRIT Flag Case Lvl": "False", + "Date Last RTC Letter Sent Case Lvl": "", + "RTC Sent Flag Case Lvl": "False", + "WRIT Date Case Lvl": "", + "Bond Obtained Flag Case Lvl": "False", + "Bond Obtained Date Case Lvl": "", + "Sent to Sheriff Date Case Lvl": "", + "Garnishment Employer Case Lvl": "", + "Financial Disclosure Sent Flag Case Lvl": "False", + "Garnishment Paying Flag Case Lvl": "False", + "Garnishment Review Date Case Lvl": "", + "Post Judgement Rate Case Lvl": "", + "Judgement Property Address 1 Case Lvl": "", + "Judgement Property Address 2 Case Lvl": "", + "Judgement Property Address 3 Case Lvl": "", + "Docket Date 1 Case Lvl": "", + "Docket Date 2 Case Lvl": "", + "Docket Date 3 Case Lvl": "", + "Stip Payment Amount Case Lvl": "", + "Stip Payment Frequency Case Lvl": "", + "Stip Total Amount Case Level": "", + "Legal Closed Reason Case Lvl": "" + }, + "dateRepossessed": null, + "repoTypeId": "", + "repoType": 0, + "dateRepoAssigned": null, + "repoAgentId": null + }, + { + "caseId": 479, + "caseNumber": "RPP-00000479", + "caseDescription": "", + "caseStageId": 2000125, + "repoStatus": 600, + "caseStatusId": 33, + "caseTitle": "RPP-00000479", + "caseTypeBasisId": 6, + "caseTypeId": 7, + "closedDate": null, + "createdDate": "2020-10-05T08:52:35.89", + "createdUserId": 52, + "currentStageDate": "2020-10-05T08:52:35.343", + "currentStatusDate": "2020-10-05T08:52:35.343", + "lastReviewDate": null, + "nextReviewDate": null, + "stage1CompletionDate": null, + "stage2CompletionDate": null, + "stage3CompletionDate": null, + "stage4CompletionDate": null, + "stage5CompletionDate": null, + "titleOrdered": false, + "titleOrderedDate": null, + "redemptionExpiredDateIl": null, + "redemptionExpiredDateWi": null, + "customFieldMap": { + "Case Modification Status": "", + "Case Loss Mitigation Stage": "", + "Case Loss Mitigation Type": "", + "Case Loss Mitigation Status": "", + "BRP Hardship Letter": "", + "BRP Bank Statements": "", + "BRP Paycheck Stubs": "", + "BRP Other Income If Applicable": "", + "BRP Tax Returns": "", + "BRP 4506T Form Signed": "", + "BRP Financial Worksheet": "", + "BRP 1st Mortgage Statement": "", + "BRP HOI Declaration Page": "", + "BRP Escrow Authorization Signed": "", + "BRP Additional Information Needed": "", + "Def Fore Financial Filed": "", + "Def Fore Case Number": "", + "Def Fore Date Filed": "", + "Def Fore Property Address is Mailing Address": "", + "Def Fore Property Address if not Mailing Address": "", + "Def Fore Attorney Name": "", + "Def Fore Attorney Number": "", + "Fore Referral Date": "", + "Fore SCRA Checked Date": "", + "Fore RTC Expiration Date": "", + "Fore On Hold Date": "", + "Fore On Hold Reason": "", + "Fore Reinstated Date": "", + "Fore Withdrawn Date": "", + "Fore Withdrawn Reason": "", + "Fore Withdrawn Reason If Other": "", + "Fore Date Last Payment": "", + "Fore Sale Scheduled Date": "", + "Fore Confirmation Scheduled Date": "", + "Fore Confirmation Complete Date": "", + "Fore Sale Result": "", + "Collection Agency": "False", + "Todays Date Case Lvl": "", + "DQ Amount Case Lvl": "", + "Performance Pymnts Case Lvl": "", + "Late Charges Case Lvl": "", + "Repo Fees Case Lvl": "", + "Redemption Amount Case Lvl": "0.0000", + "Balance Due Case Lvl": "", + "Legal Requested State Case Lvl": "", + "Judgement Dropdown Case Lvl": "", + "Attorney Firm Case Lvl": "", + "Documents Sent Date Case Lvl": "", + "Date Sent to Attorney Case Lvl": "", + "Date Served Case Lvl": "", + "Attorney Invoice Number Case Lvl": "", + "WRIT Flag Case Lvl": "False", + "Date Last RTC Letter Sent Case Lvl": "", + "RTC Sent Flag Case Lvl": "False", + "WRIT Date Case Lvl": "", + "Bond Obtained Flag Case Lvl": "False", + "Bond Obtained Date Case Lvl": "", + "Sent to Sheriff Date Case Lvl": "", + "Garnishment Employer Case Lvl": "", + "Financial Disclosure Sent Flag Case Lvl": "False", + "Garnishment Paying Flag Case Lvl": "False", + "Garnishment Review Date Case Lvl": "", + "Post Judgement Rate Case Lvl": "", + "Judgement Property Address 1 Case Lvl": "", + "Judgement Property Address 2 Case Lvl": "", + "Judgement Property Address 3 Case Lvl": "", + "Docket Date 1 Case Lvl": "", + "Docket Date 2 Case Lvl": "", + "Docket Date 3 Case Lvl": "", + "Stip Payment Amount Case Lvl": "", + "Stip Payment Frequency Case Lvl": "", + "Stip Total Amount Case Level": "", + "Legal Closed Reason Case Lvl": "" + }, + "dateRepossessed": null, + "repoTypeId": "", + "repoType": 0, + "dateRepoAssigned": null, + "repoAgentId": null + } + ], + "customFieldMap": { + "Charge Off Status": "", + "Foreclosure Status - Lookup": "", + "Reason for Charge Off": "", + "Post Charge Off Intentions": "", + "BK Discharged Flag": "False", + "BK Reaffirmed Flag": "False", + "Fraud Suspected Flag": "False", + "Management Review Flag": "False", + "Balance at time of Charge Off": "", + "Date Approved for Charge Off": "", + "Date Approved for Foreclosure": "", + "Date Approved for Legal": "", + "Date Approved for Repo": "", + "Foreclosure Requested Flag": "False", + "Legal Requested Flag": "False", + "Lookup Value 4 - Lookup": "", + "Lookup Value 5 - Lookup": "", + "Repo Requested Flag": "False", + "Status Code 1": "", + "Status Code 2": "", + "Status Code 3": "", + "Status Code 4": "", + "Status Code 5": "", + "External Loan Number": "", + "Product Code": "204459", + "Product Name": "LOANS WRITTEN OFF", + "CORS Court Name": "", + "Loan Type": "98", + "Original Interest Rate": "9.4500", + "Original Rate Type": "F", + "Current Rate Type": "", + "Current Rate Term": "75", + "Required Payment Amount": "0.0000", + "Times Late Count": "", + "Times Late 30 Days Count": "7", + "Times Late 60 Days Count": "3", + "Times Late 90 Days Count": "2", + "Troubled Debt Restructure": "False", + "Modification Date": "", + "Modification Count": "", + "Modification Type": "", + "Financial Condition": "", + "Modification Reason": "", + "Membership Address 1": "", + "Membership Address 2": "", + "Membership City": "", + "Membership State Code": "", + "Membership Postal Code": "", + "User Status Code 1": "O4R", + "User Status Code 2": "TCIN", + "Intellect Permanent Comments": "**********************OUT FOR REPO 6/18/20CC************************** 143 RTC $975.11 Exp.2/12/20 143-file scanned 7/26/18 POEU/E**6/8/20CA TCPA 8-12-19 SW", + "PRI Metro 2 Code": "", + "S1 Metro 2 Code": "", + "S2 Metro 2 Code": "", + "PRI Metro 2 Code Description": "", + "S1 Metro 2 Code Description": "", + "S2 Metro 2 Code Description": "", + "PRI Affiliation Description": "", + "S1 Affiliation Description": "", + "S2 Affiliation Description": "", + "CORS Employer Address 1": "", + "CORS Employer Address 2": "", + "CORS Employer City": "", + "CORS Employer State Code": "", + "CORS Employer Postal Code": "", + "CORS Employer Comment": "", + "CORS Loan CORS date": "", + "CORS Demand Agency": "", + "CORS Assigned Agency": "", + "CORS Bankruptcy Case Number": "", + "CORS Bankruptcy File Date": "", + "CORS Bankruptcy Discharged Date": "", + "CORS Consumer Info Indicator": "False", + "CORS Trustee Name": "", + "CORS Bankruptcy Comment": "", + "CORS Motion Date": "", + "CORS Judgement Recordation": "", + "CORS Judgement Amount": "", + "CORS Judgement Status": "", + "CORS Judgement Comment": "", + "CORS Transaction Code": "", + "CORS Payment Amount": "", + "CORS Payment Frequency": "", + "CORS Payment Start Date": "", + "CORS User Assigned Name": "", + "CORS User Assigned Start Date": "", + "CORS User Assigned End Date": "", + "CORS Workflow Entered Date": "", + "CORS Workflow To Do Date": "", + "CORS Workflow Completed By Date": "", + "CORS Workflow User Name": "JEANNE STELLA", + "CORS Workflow Action Description": "Loan Comment", + "CORS Workflow Comment": "incoming call from 608-206-92", + "Organization Number": "", + "Client Number": "", + "Date High Balance": "", + "External Status Date 1": "", + "External Status 2": "", + "External Status Date 2": "", + "Insurance Code 1": "", + "Insurance Status 1": "", + "Insurance Status 2": "", + "Insurance Code 2": "", + "Insurance Status 3": "", + "Insurance Code 3": "", + "Most Recent Credit Score": "", + "Credit Score Less Recent": "", + "Relationship Flag": "", + "Relationship Number": "", + "S1 Original Credit Union": "", + "S1 Most Recent Credit Score": "", + "S1 Credit Score Less Recent": "", + "Client Name": "", + "Mortgage Insurer": "", + "Last Analyzed Date": "", + "Deferred Principal Balance": "", + "Prepetition Unapplied Balance": "", + "Stipulation Unapplied Balance": "", + "Other Funds Payment Amount": "", + "Assistance Payment Amount": "", + "Reserve Account Payment Amount": "", + "Default Interest Amount": "", + "Last NSF Fee Date": "", + "Last Letter Date": "", + "Other Fee Amount": "", + "Last Late Charge Waived Date": "", + "Last Late Charge Waived Amount": "", + "Next Late Charge Amount": "", + "Times Late LOL Count": "", + "Times Late Last 12 Months Count": "", + "Times Late 120 Days Count": "", + "Times Late 150 Days Count": "", + "Times Late 180 Days Count": "", + "First Payment Due Date": "", + "Maturity Type Description": "", + "Inspection Ordered Date": "", + "Last Inspection Date": "", + "Inspection Received Date": "", + "Current Occupancy Code": "", + "Inspected By": "", + "Property Type Description": "", + "Property Condition Description": "", + "Neighborhood Condition": "", + "Collateral 1 Property Type Code": "", + "Collateral 1 Lein Position": "", + "Bankruptcy Case Number": "", + "Bankruptcy Date Filed": "", + "DNU Bankruptcy Chapter Filed": "", + "Bankruptcy Claim Number": "", + "Bankruptcy Trustee Claim Number 1": "", + "Bankruptcy Trustee Claim Number 2": "", + "Bankruptcy Trustee Claim Number 3": "", + "Bankruptcy Name": "", + "Bankruptcy Event Code": "", + "Bankruptcy Event Legal": "", + "Bankruptcy Event Warning": "", + "Active Bankruptcy Flag": "False", + "Active Bankruptcy Plan Flag": "False", + "Bankruptcy Payment Status Date": "", + "Bankruptcy Milestone Due Date": "", + "Bankruptcy Milestone Completion Date": "", + "Bankruptcy Milestone Scheduled Date": "", + "Bankruptcy Milestone Actual Date": "", + "Bankruptcy Servicer Only": "", + "Contact Promise Date 1": "", + "Contact Promise Amount 1": "", + "Contact Promise Date 2": "", + "Contact Promise Amount 2": "", + "Contact Promise Date 3": "", + "Contact Promise Amount 3": "", + "Contact Reason": "", + "Contact Demeanor": "", + "Contact Outcome": "", + "Contact Permanent Comments": "", + "Legal Fee Amount": "", + "Collateral 1 Seller Name": "", + "Collateral 2 Seller Name": "", + "Collateral 3 Seller Name": "", + "Net Capitalized Cost Amount": "", + "Total Payments Count": "", + "Times Late 90 Plus Days Count": "", + "Late Fee Amount": "", + "Date 22 Day Letter Sent": "", + "Date 32 Day Letter Sent": "", + "Date 60 Day Letter Sent": "", + "Collateral 1 Legal Description": "", + "Collateral 2 Legal Description": "", + "Collateral 3 Legal Description": "", + "Collateral 4 Legal Description": "", + "SD Contact Follow Up Date": "", + "CORS Next Follow Up Date": "7/20/2020 12:00:00 AM", + "Waive Fee Reason DropDown": "", + "Waive Fee Reason Dropdown Spanish": "", + "Case Stages 1": "2000122", + "Dollar Amount": "", + "Case Stages 2": "", + "SCRA Flag": "False", + "TCPA Consent": "7003", + "Request Outcome": "", + "Request Outcome Date": "", + "Offset Request Reason DropDown": "", + "Intellect Next Follow Up Date": "7/15/2020 12:00:00 AM", + "Original Product Type": "67", + "Recovery Branch": "1", + "Reason For Repo": "", + "Repo Recovery Address": "", + "Right to Cure Expired": "False", + "RTC Expiration Date": "", + "Repo Type": "", + "Repossession Type": "", + "Secondary Recovery Address": "", + "Redemption Calc WI Perfrmnce Pymnts": "1467.2700", + "Redemption Calc WI Repo Fees": "", + "Redemption Calc WI Total Due": "1477.2700", + "Redemption Calc WI Exp Date": "", + "Redemption Date Current Date": "10/12/2020 12:00:00 AM", + "Redemption Calc WI Expiration Date": "10/27/2020 12:00:00 AM", + "Investor": "", + "Money Field 2": "", + "Money Field 1": "", + "Loan Status": "Payment Scheduled Q", + "Redemption Calc IL 30 Percent Amnt Paid": "6781.2870", + "Redemption Calc IL 30 Percent Yes or No": "True", + "Redemption Calc IL Total Due": "10.0000", + "Redemption Calc IL Exp Date": "", + "Current LTV Amount": "", + "Original LTV Amount": "", + "Redemption Calc IL Repo Fees": "", + "Redemption Calc IL Expiration Date": "11/2/2020 12:00:00 AM", + "Repo Agencies": "", + "Bankruptcy Trustee": "", + "Title Ordered": "False", + "Title Received": "False", + "Vehicle ReTitled": "False", + "Title Ordered Date": "", + "ReTitled Date": "", + "Title Received Date": "", + "X Deceased Flag Dont Use": "False", + "CPI Active": "False", + "Branch Location": "", + "Collection Agency": "2000177", + "Consumer Credit Counseling Services Flag": "False", + "Skip Trace Requested": "False", + "Loss Mitigation Status": "", + "Judgement Dropdown": "", + "Claim Type": "", + "Refund Status": "", + "Maintenance Requested": "False", + "BK Chapter": "", + "Settlement": "False", + "Repayment Plan Status": "8786", + "BK No Reaffirmation Flag": "False", + "test": "", + "Totaled Vehicle": "False", + "Fees Due": "0.0000", + "Original Input Code": "P1", + "Fraud Status": "", + "CORS Recovery Amt": "900.0000", + "CORS Recovery Amount Principal": "900.0000", + "Expense Applied Amount": "0.0000", + "Interest Applied Amount": "0.0000", + "Exp Amp": "52.9000", + "Input Code": "L-WO", + "Report Blank": "", + "Totaled Vehicle Notification Date": "", + "Warranty Cancellation Date": "", + "Refunds Requested Date": "", + "Repayment Plan Active": "True", + "Estate Attorney": "", + "Estate Attorney Phone Number": "", + "Personal Representative": "", + "Final Date to File Claim": "", + "Estate Closing Dates": "", + "Date Entered to Probate Finder": "", + "Date Notified Deceased": "", + "Death Notification Type": "", + "Visible Assets": "False", + "CCCS Status": "", + "Consumer Credit Counseling Service Company": "", + "CCCS Amount Approved": "", + "CCCS Decision Date": "", + "Settlement Amount": "", + "Primary Insurance Company": "", + "Primary Insurance Company Phone Number": "", + "Claim Number": "", + "Date of Loss": "", + "Totaled Vehicle Mileage": "", + "Totaled Vehicle Settlement Amount": "", + "Totaled Vehicle Warranty Refund": "", + "Totaled Vehicle Refunds Received Date": "", + "Totaled Vehicle Refunds Received Amount": "", + "GAP Payment Received Date": "", + "Defensive Foreclosure Flag Do Not Use": "False", + "Defensive Foreclosure Flag": "False", + "Collateral Still Exists Flags": "False", + "Bankrupt Collectible Non Filing Borrower Flag": "False", + "Manual Transfer Amount": "", + "Manual Transfer Frequency": "", + "Transfer From Account": "", + "Transfer To Account": "", + "CBR Request": "", + "CBR Date Received": "", + "Additional CBR Information Needed": "", + "CBR Approved": "", + "CBR Yes No Reason": "", + "BRP Sent Flag": "False", + "BRP Sent Date": "", + "Manual Transfer Start Date": "", + "Loss Mitigation Stage": "", + "Loss Mitigation Type": "", + "Date Last RTC Letter Sent": "", + "Skip Trace Phone No1": "", + "Skip Trace Phone No2": "", + "Skip Trace Phone No3": "", + "Skip Trace Phone No4": "", + "Skip Trace Phone No5": "", + "Skip Trace Phone No6": "", + "Skip Trace Phone No7": "", + "Skip Trace Phone No8": "", + "Skip Trace Phone No9": "", + "Skip Trace Phone No10": "", + "Skip Trace Address No1": "", + "Skip Trace Address No2": "", + "Skip Trace Address No3": "", + "Skip Trace Address No4": "", + "Skip Trace Address No5": "", + "Skip Trace Address No6": "", + "Skip Trace Email No1": "", + "Skip Trace Email No2": "", + "Skip Trace Email No3": "", + "Skip Trace Email No4": "", + "Skip Trace Email No5": "", + "Skip Trace POE No1": "", + "Skip Trace POE No2": "", + "Skip Trace Comments": "", + "TLO Basic Flag": "False", + "TLO Comprehensive Flag": "False", + "DRN Flag": "False", + "RDN Flag": "False", + "CarFax Flag": "False", + "Equifax Flag": "False", + "Facebook Flag": "False", + "Skip Trace Date": "", + "GainLoss Value Amount": "", + "GainLoss Value Date": "", + "GainLoss Senior Balance": "", + "GainLoss Senior Name": "", + "GainLoss Value Source": "", + "GainLoss Outstanding Taxes": "", + "GainLoss Marketing Costs": "5000.0000", + "GainLoss 1yr Taxes": "", + "GainLoss Review Date": "", + "GainLoss Marketing Commission": "0.0000", + "GainLoss Total Amount": "-18862.4600", + "Collection Agency Flag": "False", + "Chapter 128 Flag": "False", + "Chapter 128 Case Number": "", + "Chapter 128 Date Filed": "", + "CORS Trustee Number": "", + "CORS Trustee Address": "", + "CORS Trustee Email": "", + "CORS Loan type Description": "L-P1- Dealer Used Auto/Truck", + "Host Code": "L-P1", + "CORS Initial Charge Off Balance Amount": "14762.4600", + "CORS Initial Charge Off Date": "7/8/2020 12:00:00 AM", + "CORS Initial Principal Amount": "14762.4600", + "CORS Initial Interest Amount": "449.7700", + "CORS Initial Expense Amount": "52.9000", + "CORS Transfer Date": "7/8/2020 12:00:00 AM", + "CORS Initial Interest Rate Type": "Fixed Rate", + "CORS Initial Interest Rate Percent": "9.4500", + "CORS Initial Day Count": "", + "CORS Current Principal Amount": "13862.4600", + "CORS Current Interest Amount": "801.6000", + "CORS Current Expense Amount": "52.9000", + "CORS Curent Non Reimbursable Expense Amount": "0.0000", + "CORS Current Other Amount": "0.0000", + "CORS Non Reimbursable Other Amount": "0.0000", + "CORS Current Loan Balance Amount": "14716.9600", + "Attorney Firm": "", + "Legal Requested State": "", + "Garnishment Flag": "False", + "Money Judgement Flag": "False", + "Replevin Judgement Flag": "False", + "Stipulation Flag": "False", + "Summary Judgement Flag": "False", + "Wage Assignment Flag": "False", + "Date No Phone Number Letter Sent": "" + } + }, + "loanDetail" : { + "MemberId": 6466120, + "LoanId": 143, + "ExternalLoanId": 0, + "IndividualId": [ + 943900 + ], + "Borrowers": [ + { + "IndividualId": 943900, + "Name": "MEMBER MEMBER", + "Type": "Borrower", + "Address": "18 WOODRIDGE CT APT 7 , MADISON, WI 53704-7889", + "TaxId": "399-04-1120", + "Association": "Individual Contract (Primary)", + "LastAssociationCodeChangedDate": "2017-02-03T00:00:00", + "Metro2ConsumerInformationIndicator": "", + "CoborrowerIsSpouse": false, + "OwnershipPercentage": 0.0, + "PercentageDescription": "" + } + ], + "LoanType": "Regular Loan", + "Title": "LOANS WRITTEN OFF", + "Alerts": "0", + "Product": "LOANS WRITTEN OFF", + "ProductCode": 98, + "Template": "Regular Loan", + "ProductId": 204459, + "ProductDescription": "", + "ProductCategory": "Loan", + "ProductClass": "Regular Loan", + "AccountType": 98, + "Status": "Written Off", + "ClosedDate": "0001-01-01T00:00:00", + "Category": "", + "Classification": "", + "MetroAcctType": "00", + "SMSA": "", + "Officer": "5749", + "OtherSecurity": " ", + "NoteNumber": "997071", + "LastMaintenance": "0001-01-01T00:00:00", + "WrittenOffDate": "2020-07-08T00:00:00", + "CreditCardNumber": "", + "LastCycleDate": "0001-01-01T00:00:00", + "LegalDescription": "", + "PropertyType": "", + "PurposeCode": "", + "CollateralCode": "", + "RefinanceCount": "0", + "LastRefinanceDate": "0001-01-01T00:00:00", + "LdcNumber": "", + "Messages": "", + "OriginalAmount": 22604.29, + "OriginationDate": "2016-12-27T00:00:00", + "Balance": 13862.46, + "AvailableBalance": 0.0, + "Limit": 0.0, + "EscrowBalance": 0.0, + "Payoff": 13862.46, + "UnappliedFundsBalance": 0.0, + "CashAdvanceBalance": 0.0, + "PurchaseAdvanceBalance": 0.0, + "ActiveAuthorizationAmount": 0.00, + "EscrowDividends": 0.0, + "PledgeType": "", + "MiscCharge1": "$0.00", + "MiscCharge2": "$0.00", + "MiscCharge3": "", + "MiscChargeCode1": "", + "MiscChargeCode2": "", + "MiscChargeCode3": "", + "InterestMemoed": 0.00, + "InterestAccruedDate": "2020-07-29T00:00:00", + "PaymentInterestDue": 0.00, + "PayoffInterestDue": 0.00, + "LateChargeMethod": "Not Assessed", + "LateCharge": 0.0, + "LateChargeDate": "2020-06-10T00:00:00", + "CashAdvance": 0.0, + "Insurance": "XX", + "LastStatementLateCharges": 0.0, + "LastStatementMiscFees": 0.0, + "LastStatementPurchaseAdvances": 0.0, + "LastStatementCashAdvances": 0.0, + "LastStatementCashAdvanceFees": 0.0, + "LastStatementMiscDebits": 0.0, + "LastStatementTotalPayments": 0.0, + "LastStatementCreditsPosted": 0.0, + "LastStatementAccruedInterest": 0.0, + "LastStatementDate": "0001-01-01T00:00:00", + "LastStatementPurchaseAdvanceBalance": 0.0, + "LastStatementEndingBalance": 0.0, + "DelinquentAmount": 0.0, + "LastStatementMonthlyMinimum": 0.0, + "LastStatementRequiredDue": 0.0, + "LastStatementRequiredPayment": 0.0, + "ScheduledPayment": 489.09, + "NextDueDate": "2020-02-10T00:00:00", + "PartialPaymentAmount": 354.34, + "PreviousDate": "2019-12-10T00:00:00", + "PaymentFrequency": "Monthly", + "AlignmentDate": "0001-01-01T00:00:00", + "PaymentMethod": "Counter Item", + "SourceAccount": "", + "ProcessingGroup": "0", + "LoanCouponDate": "0001-01-01T00:00:00", + "RequiredPaymentDue": 489.09, + "FirstPaymentDate": "2017-02-10T00:00:00", + "AlternatePaymentAmount": 0.00, + "AlternateBeginDate": "0001-01-01T00:00:00", + "AlternateEndDate": "0001-01-01T00:00:00", + "PaymentSkips": 0, + "FinalPaymentAmount": 401.81, + "FinalPaymentDate": "2023-04-10T00:00:00", + "CycleAmount": 0.0, + "VariableRatePaymentChange": "Default Product", + "VariableRateCode": "F", + "MinimumDue": 0.00, + "FrequencyPayment": 0.0, + "EscrowPayment": 0.0, + "PrincipalAndInterestPayment": 0.0, + "PaymentLoanDefinitionNumber": "", + "RateLoanDefinitionNumber": "", + "VacationWeeks": 0, + "PayrollRepaidWeeklyPaymentCount": 0, + "BaseRate": 0.000, + "TieredRateAdj": 0.000, + "ManualRateAdj": 0.000, + "Rate": 0.000, + "ManualRate": 0.0, + "APR": 9.450, + "OriginalInterestRate": 9.450, + "AlternateInterestRate": 0.000, + "LastRateChange": "2016-12-27T00:00:00", + "RealEstateMargin": 0.0, + "Amortization": "P & I Amt", + "AmortizationTerm": 0, + "MonthlyTerm": 75, + "NumberOfPayments": 75, + "InterestYTD": 317.91, + "InterestPYTD": 1663.88, + "InterestDaily": 0.01, + "PrincipalYTD": 16504.55, + "PrincipalPYTD": 3869.89, + "LateChargeYTD": 10.00, + "LateChargePYTD": 85.35, + "PaymentHistory": "065432123210", + "LastPaymentDue": "0001-01-01T00:00:00", + "PaymentsPastDue": 0, + "DaysPastDue": 0, + "MonthsPastDue": 0, + "CurrentStatementLateCharges": 0.0, + "CurrentStatementMiscFees": 0.0, + "CurrentStatementPurchaseAdvances": 0.0, + "CurrentStatementCashAdvances": 0.0, + "CurrentStatementCashAdvanceFees": 0.0, + "CurrentStatementMiscDebits": 0.0, + "CurrentStatementTotalPayments": 0.0, + "CurrentStatementTotalCredits": 0.0, + "DelinquentPaymentDueDate": "0001-01-01T00:00:00", + "IsInactive": false, + "StatementFrequency": "Default:N", + "AppraisedValue": 0.0, + "LocCycleDay": 0, + "IgnorePledge": false, + "OpenEndPlan": false, + "OpenEndCategory": "None", + "PointsPaid": 0.00, + "CurtailmentAmount": 0.0, + "CurtailmentDate": "0001-01-01T00:00:00", + "InsuranceExpirationDate": "2023-04-10T00:00:00", + "LifeInsuranceMI": "XX", + "DisabilityInsuranceMI": " ", + "LifeActivityInsuranceCode": " ", + "DisabilityActivityInsuranceCode": " ", + "LoanCoupons": true, + "PaidbyGrace": false, + "EscrowAccount": "", + "EscrowInterestPaid": false, + "NextPaymentAdjustmentDate": "0001-01-01T00:00:00", + "EffectivePayment": 489.09, + "InterestRate": 0.000, + "LastPaymentDate": "2020-07-29T00:00:00", + "LastPurchaseDate": "0001-01-01T00:00:00", + "LastCashAdvanceDate": "0001-01-01T00:00:00", + "BlockCode": "", + "ReclassCode": "", + "OutstandingAuthCount": 0, + "OutstandingAuthAmount": 0.0, + "InterestType": "Fixed", + "AlternateLoanNumber": "", + "ArmIndex": 0, + "DeductionOption": "", + "DelinquentPaymentSkips": false, + "FirstPayment": false, + "InterestDue": 0.00, + "LoanLevelSkips": false, + "PaymentReduction": false, + "WaiveLateCharge": false, + "ExcessPaymentTargetAccountId": 0, + "ExcessPaymentMemberId": 0, + "CustRate": false, + "IntRateMethod": "", + "Margin": 0.0, + "Index": "", + "RndFactPct": 0.0, + "RndFactOpt": "", + "IntRateCeiling": 0.0, + "IntRateFloor": 0.0, + "MaxDnRateChgLife": 0.0, + "MaxUpRateChgLife": 0.0, + "MaxDnRateChgPeriod": 0.0, + "MaxUpRateChgPeriod": 0.0, + "MinDnRateChgPeriod": 0.0, + "MinUpRateChgPeriod": 0.0, + "PmtAdjPeriod": 0, + "DaysPriorToPeriodicRateAdj": 0, + "DaysPriorToInitialRateAdjustment": 0, + "FirstAdjustmentIsEstimate": false, + "InitialAnalysisEstimateDate": "0001-01-01T00:00:00", + "EstimatePerformed": "", + "BalloonTerm": 0, + "PledgeTypeDescription": "", + "SystemApproved": "Yes", + "VINList": [ + "5XXGR4A63CG061909" + ], + "MortgageLoanOriginator": 0, + "LastPaymentPrincipal": 900.00, + "LastPaymentInterest": 0.00, + "LastPaymentFees": 0.00, + "LastPaymentLateCharges": 0.00, + "LastPaymentEscrowImpound": null, + "LastPaymentCurtailment": null, + "LastPaymentTotal": 900.00, + "TransferDay": 0, + "SourceMember": 0, + "AdjustPurchaseAccrual": false, + "AnnualFee": false, + "AnnualFeeDate": "0001-01-01T00:00:00", + "BalaceLimit": 0.00, + "CloseOnZero": false, + "DrawDate": "0001-01-01T00:00:00", + "Form1098Option": "N", + "MethodADelinquency": false, + "NumberofSkips": 0, + "OverlimitAmount": 0.00, + "OverlimitDate": "0001-01-01T00:00:00", + "PurchaseAdvBalance": 0.00, + "SkipDate": "0001-01-01T00:00:00", + "ToBeDelinquent": false, + "WaiveDelinquencyNotice": false, + "WaiveBillingNotice": false, + "WaiveInterest": false, + "LastStatementMinimumPayment": 0.0, + "LastStatementCycleRequiredPayment": 0.0, + "ExemptNonResident": false, + "YTDNonresidentWithholding": null, + "PYTDNonresidentWithholding": null, + "InCollection": "OUT", + "UniversalLoanId": "", + "RateLockDate": "0001-01-01T00:00:00", + "ActiveStopPays": "", + "ErrorMessage": [] + }, + "memberDetail" : { + "MemberId": 6466120, + "MemberName": "Jonathan Doerson", + "PrimaryIndividualId": 943900, + "MemberType": "REGULAR", + "Affiliation": "", + "MemberSince": "2017-02-03T00:00:00", + "Miscellaneous1": "", + "Miscellaneous2": "", + "OriginalOpenBranch": "INDIRECT LENDING DEPT", + "WithholdingCode": "", + "ExpeditedFunds": 0.00, + "ExpeditedFundsDate": "0001-01-01T00:00:00", + "AccessLevel": 1, + "StandardStatementCycle": 1, + "StandardStatementCode": "", + "StandardStatementMethod": "Microfiche", + "CATFeeCounter": 0, + "CATFeeDate": "0001-01-01T00:00:00", + "CreditCardStatementCycle": 1, + "CreditCardStatementCode": "", + "CreditCardStatementMethod": "Hold", + "AccountCount": 1, + "AccountBalance": 0.00, + "LoanCount": 1, + "LoanBalance": 13862.46, + "LoansDelinquentCount": 1, + "LoansDelinquent": 13862.46, + "LoansWrittenOffCount": 1, + "LoansWrittenOff": 13862.46, + "LoansInCollectionCount": 0, + "LoansInCollection": 0.0, + "Password": "", + "PinLock": "Unlock", + "BranchId": 57, + "RelationshipPricingLevel": 0, + "RelationshipPricingLevelPermanent": "No", + "RelationshipPricingDescription": "", + "PreviousRelationshipPricingLevel": 0, + "LastRelationshipPricingLevelAnalysisDate": "", + "LastRelationshipPricingLevelChangeDate": "7/8/2020 12:00:00 AM", + "InhibitActivity": "No", + "WrittenOffLoan": "Yes", + "LoanInCollection": "No", + "PurgeMembership": "Yes", + "Address": { + "AddressId": 3308623, + "Line1": "18 WOODRIDGE CT APT 7", + "Line2": "", + "Line3": "", + "City": "MADISON", + "State": "WI", + "ZipCode": "53704-7889", + "Country": "US", + "CountyName": "", + "AddressType": "", + "IsPrimary": true, + "IsInternational": false, + "AddressVerification": 18, + "Occupancy": "", + "StartDate": "0001-01-01T00:00:00", + "EndDate": "0001-01-01T00:00:00", + "LongAddress1": "18 WOODRIDGE CT APT 7", + "LongAddress2": "", + "Membership": [], + "CoBorrower": [], + "UseAlternateAsOf": "0001-01-01T00:00:00", + "RestorePrimaryAsOf": "0001-01-01T00:00:00", + "AlternateType": "", + "Comments": "", + "Met2AddressIndicator": "", + "UspsVerified": false, + "AddressMatchStatus": null, + "IsHSA": false + } + }, + "collateralDetails": [ + { + "CollateralId": 636874, + "OwnerId": 0, + "OwnerName": "", + "CollateralType": "VE", + "NameOnTitle": "", + "Description": "2012 KIA", + "PurchasePrice": 0, + "CurrentValue": 17700, + "SourceOfEvaluation": "None", + "EvaluationDate": "0001-01-01T00:00:00", + "ValueVerifiedByOperatorNumber": 0, + "ValueVerifiedByOperatorName": "", + "VerificationMethod": "None", + "VerificationDate": "0001-01-01T00:00:00", + "VerifiedBy": 0, + "SerialNumber": "", + "Vehicle": { + "VIN": "5XXGR4A63CG061909", + "Year": 2012, + "Make": "KIA", + "Model": "Optima-4 C", + "LicensePlate": "", + "LicenseState": "", + "CountryLicensed": "United States", + "Mileage": 23313, + "BodyStyle": "Sedan 4D SX Limited Turb", + "Color": "evh", + "KeyCode": "", + "SellerName": "R61", + "LowBookValue": 0, + "HighBookValue": 0 + }, + "Other": null + } + ] +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/Processor/repoSettings.json b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/Processor/repoSettings.json new file mode 100644 index 0000000..7373005 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/Processor/repoSettings.json @@ -0,0 +1,3228 @@ +{ + "accountTypes": [ + { + "id": 10, + "accountTypeCode": "L-A3 ", + "description": "36 MO USED AUTO RPM LOAN", + "isVisible": true, + "categoryId": 1 + }, + { + "id": 11, + "accountTypeCode": "L-A4 ", + "description": "48 MO USED AUTO RPM LOAN", + "isVisible": true, + "categoryId": 1 + }, + { + "id": 12, + "accountTypeCode": "L-A5 ", + "description": "60 MO USED AUTO RPM LOAN", + "isVisible": true, + "categoryId": 1 + }, + { + "id": 13, + "accountTypeCode": "L-AB ", + "description": "NEW AUTOS/TRUCKS", + "isVisible": true, + "categoryId": 1 + }, + { + "id": 14, + "accountTypeCode": "L-AC ", + "description": "USED AUTO/TRUCK", + "isVisible": true, + "categoryId": 1 + }, + { + "id": 15, + "accountTypeCode": "L-AD ", + "description": "MOTORCYCLES NEW", + "isVisible": true, + "categoryId": 4 + }, + { + "id": 16, + "accountTypeCode": "L-AE ", + "description": "RECREATIONAL VEHICLE", + "isVisible": true, + "categoryId": 3 + }, + { + "id": 17, + "accountTypeCode": "L-AF ", + "description": "MOTORCYCLES USED", + "isVisible": true, + "categoryId": 4 + }, + { + "id": 18, + "accountTypeCode": "L-AN ", + "description": "NEW INDIRECT REC VEHICLE", + "isVisible": true, + "categoryId": 3 + }, + { + "id": 19, + "accountTypeCode": "L-AU ", + "description": "USED INDIRECT REC VEHICLE", + "isVisible": true, + "categoryId": 3 + }, + { + "id": 20, + "accountTypeCode": "L-B4 ", + "description": "NEW BOAT DEALER", + "isVisible": true, + "categoryId": 2 + }, + { + "id": 21, + "accountTypeCode": "L-B5 ", + "description": "BOAT LOAN", + "isVisible": true, + "categoryId": 2 + }, + { + "id": 23, + "accountTypeCode": "L-BN ", + "description": "DEALER NEW MOTORCYCLE", + "isVisible": true, + "categoryId": 4 + }, + { + "id": 24, + "accountTypeCode": "L-BO ", + "description": "BOATS", + "isVisible": true, + "categoryId": 2 + }, + { + "id": 25, + "accountTypeCode": "L-BU ", + "description": "DEALER USED MOTORCYCLE", + "isVisible": true, + "categoryId": 4 + }, + { + "id": 26, + "accountTypeCode": "L-CA ", + "description": "CENTRIX AUTO", + "isVisible": true, + "categoryId": 1 + }, + { + "id": 36, + "accountTypeCode": "L-H1 ", + "description": "FIXED AUTO/TRUCK", + "isVisible": true, + "categoryId": 1 + }, + { + "id": 50, + "accountTypeCode": "L-HT ", + "description": "HARTFORD-USED AUTO/TRUCK", + "isVisible": true, + "categoryId": 1 + }, + { + "id": 61, + "accountTypeCode": "L-NB ", + "description": "DEALER BUS NEW VEHICLE", + "isVisible": true, + "categoryId": 1 + }, + { + "id": 62, + "accountTypeCode": "L-NF ", + "description": "DEALER NEW FRESH START", + "isVisible": true, + "categoryId": 1 + }, + { + "id": 63, + "accountTypeCode": "L-NR ", + "description": "Dealer New Rec. Vehicle-IL", + "isVisible": true, + "categoryId": 3 + }, + { + "id": 69, + "accountTypeCode": "L-P1 ", + "description": "DEALER USED 1YR OLD", + "isVisible": true, + "categoryId": 1 + }, + { + "id": 70, + "accountTypeCode": "L-P2 ", + "description": "DEALER USED 2YRS OLD", + "isVisible": true, + "categoryId": 1 + }, + { + "id": 71, + "accountTypeCode": "L-P3 ", + "description": "DEALER USED 3YRS OLD", + "isVisible": true, + "categoryId": 1 + }, + { + "id": 72, + "accountTypeCode": "L-P4 ", + "description": "DEALER USED 4YRS OLD", + "isVisible": true, + "categoryId": 1 + }, + { + "id": 73, + "accountTypeCode": "L-P5 ", + "description": "DEALER USED 5 +YRS OLD", + "isVisible": true, + "categoryId": 1 + }, + { + "id": 74, + "accountTypeCode": "L-P6 ", + "description": "Dealer 1st Time Buyer New-IL", + "isVisible": true, + "categoryId": 1 + }, + { + "id": 75, + "accountTypeCode": "L-P7 ", + "description": "Dealer 1st Time Buyer Used-IL", + "isVisible": true, + "categoryId": 1 + }, + { + "id": 76, + "accountTypeCode": "L-P8 ", + "description": "Dealer College Grad New-IL", + "isVisible": true, + "categoryId": 1 + }, + { + "id": 77, + "accountTypeCode": "L-P9 ", + "description": "Dealer College Grad Used-IL", + "isVisible": true, + "categoryId": 1 + }, + { + "id": 80, + "accountTypeCode": "L-PN ", + "description": "DEALER NEW", + "isVisible": true, + "categoryId": 1 + }, + { + "id": 113, + "accountTypeCode": "L-UB ", + "description": "DEALER BUS USED VEHICLE", + "isVisible": true, + "categoryId": 1 + }, + { + "id": 114, + "accountTypeCode": "L-UF ", + "description": "DEALER USER FRESH START", + "isVisible": true, + "categoryId": 1 + }, + { + "id": 115, + "accountTypeCode": "L-UM ", + "description": "Dealer Used Motorcycle-IL", + "isVisible": true, + "categoryId": 4 + }, + { + "id": 116, + "accountTypeCode": "L-UV ", + "description": "BRANCH USED DEALER", + "isVisible": true, + "categoryId": 1 + }, + { + "id": 120, + "accountTypeCode": "L-X4 ", + "description": "DEALER USED RPM LOAN", + "isVisible": true, + "categoryId": 1 + }, + { + "id": 121, + "accountTypeCode": "L-XB ", + "description": "DEALER NEW 1ST TIME BUYER", + "isVisible": true, + "categoryId": 1 + }, + { + "id": 123, + "accountTypeCode": "L-XL ", + "description": "USED DEALER 1ST TIME BUYER", + "isVisible": true, + "categoryId": 1 + }, + { + "id": 178, + "accountTypeCode": "L-NI", + "description": "Dealer New Auto-IL", + "isVisible": true, + "categoryId": 1 + } + ], + "allowedStatusChanges": [ + { + "id": 1, + "currentStatus": "REPO", + "allowedChangeStatus": "SOLD" + }, + { + "id": 3, + "currentStatus": "O4R", + "allowedChangeStatus": "REPO" + }, + { + "id": 4, + "currentStatus": "O4R", + "allowedChangeStatus": "REHO" + }, + { + "id": 5, + "currentStatus": "O4R", + "allowedChangeStatus": "RECA" + }, + { + "id": 6, + "currentStatus": "O4R", + "allowedChangeStatus": "PSKP" + }, + { + "id": 7, + "currentStatus": "REDEEMED", + "allowedChangeStatus": "O4R" + }, + { + "id": 8, + "currentStatus": "RECA", + "allowedChangeStatus": "O4R" + }, + { + "id": 9, + "currentStatus": "REHO", + "allowedChangeStatus": "O4R" + }, + { + "id": 10, + "currentStatus": "REHO", + "allowedChangeStatus": "O4R" + }, + { + "id": 12, + "currentStatus": "REPO", + "allowedChangeStatus": "REDEEMED" + }, + { + "id": 15, + "currentStatus": "REDEEMED", + "allowedChangeStatus": "REPO" + }, + { + "id": 16, + "currentStatus": "REHO", + "allowedChangeStatus": "RECA" + } + ], + "bodyStyles": [ + { + "code": "2CUV", + "description": "2 Door Crossover Utility Vehicle" + }, + { + "code": "2D", + "description": "2 Door Vehicle" + }, + { + "code": "2DCP", + "description": "2 Door Coupe" + }, + { + "code": "2DCV", + "description": "2 Door Convertible" + }, + { + "code": "2DHB", + "description": "2 Door Hatch Back" + }, + { + "code": "2DHT", + "description": "2 Door Hard Top" + }, + { + "code": "2DLB", + "description": "2 Door Lift Back" + }, + { + "code": "2DSN", + "description": "2 Door Sedan" + }, + { + "code": "2DST", + "description": "2 Door Soft Top" + }, + { + "code": "2MPV", + "description": "2 Door Multi-Purpose Vehicle" + }, + { + "code": "2PUT", + "description": "2 Door Pickup Truck" + }, + { + "code": "2STK", + "description": "Stake Bed Truck" + }, + { + "code": "2SUT", + "description": "2 Door Sport Utility Truck" + }, + { + "code": "2SUV", + "description": "2 Door Sport Utility Vehicle" + }, + { + "code": "2VAN", + "description": "2 Door Van" + }, + { + "code": "3APV", + "description": "3 Door All Purpose Vehicle" + }, + { + "code": "3D", + "description": "3 Door Vehicle" + }, + { + "code": "3DCP", + "description": "3 Door Coupe" + }, + { + "code": "3DHB", + "description": "3 Door Hatch Back" + }, + { + "code": "3DLB", + "description": "3 Door Lift Back" + }, + { + "code": "3DSN", + "description": "3 Door Sedan" + }, + { + "code": "3DTT", + "description": "3 Door T-Top" + }, + { + "code": "3DVN", + "description": "3 Door Van" + }, + { + "code": "3MPV", + "description": "3 Door Multi-Purpose Vehicle" + }, + { + "code": "3PUT", + "description": "3 Door Extended Cab Pickup Truck" + }, + { + "code": "3TRK", + "description": "3 Door Truck" + }, + { + "code": "3VAN", + "description": "3 Door Cargo Van" + }, + { + "code": "3WGN", + "description": "3 Door Wagon" + }, + { + "code": "4APV", + "description": "4 Door All Purpose Vehicle" + }, + { + "code": "4CAB", + "description": "Crew Cab" + }, + { + "code": "4CUV", + "description": "4 Door Crossover Utility Vehicle" + }, + { + "code": "4D", + "description": "4 Door Vehicle" + }, + { + "code": "4DCP", + "description": "4 Door Coupe" + }, + { + "code": "4DHB", + "description": "4 Door Hatch Back" + }, + { + "code": "4DHT", + "description": "4 Door Hard Top" + }, + { + "code": "4DLB", + "description": "4 Door Lift Back" + }, + { + "code": "4DSN", + "description": "4 Door Sedan" + }, + { + "code": "4MPV", + "description": "4 Door Multi-Purpose Vehicle" + }, + { + "code": "4PUT", + "description": "4 Door Pickup Truck" + }, + { + "code": "4SUT", + "description": "4 Door Sport Utility Truck" + }, + { + "code": "4SUV", + "description": "4 Door Sport Utility Vehicle" + }, + { + "code": "4VAN", + "description": "4 Door Van" + }, + { + "code": "4WGN", + "description": "4 Door Wagon" + }, + { + "code": "5DHB", + "description": "5 Door Hatch Back" + }, + { + "code": "5DLB", + "description": "5 Door Lift Back" + }, + { + "code": "5DSN", + "description": "5 Door Sedan" + }, + { + "code": "5MPV", + "description": "5 Door Multi-Purpose Vehicle" + }, + { + "code": "5WHL", + "description": "5th Wheel" + }, + { + "code": "APV", + "description": "All Purpose Vehicle" + }, + { + "code": "ATV", + "description": "All Terrain Vehicle" + }, + { + "code": "BBOW", + "description": "Bowrider" + }, + { + "code": "BCAB", + "description": "Cabin/Cuddy" + }, + { + "code": "BDCK", + "description": "Deck" + }, + { + "code": "BDIN", + "description": "Canoe/Dinghie" + }, + { + "code": "BFIS", + "description": "Fishing" + }, + { + "code": "BHOU", + "description": "House Boat" + }, + { + "code": "BOAT", + "description": "Boat" + }, + { + "code": "BPER", + "description": "Performance" + }, + { + "code": "BPON", + "description": "Pontoon" + }, + { + "code": "BSAI", + "description": "Sail Boat" + }, + { + "code": "BSKI", + "description": "Skiboat" + }, + { + "code": "BUS", + "description": "Bus" + }, + { + "code": "CABO", + "description": "Cabover Tractor" + }, + { + "code": "CAMP", + "description": "Camper" + }, + { + "code": "CBKT", + "description": "Bucket Truck" + }, + { + "code": "CCMP", + "description": "Air Compressor" + }, + { + "code": "CCRN", + "description": "Crane" + }, + { + "code": "CDD", + "description": "Digger Derrick" + }, + { + "code": "CDOZ", + "description": "Bulldozer" + }, + { + "code": "CEXE", + "description": "Excavator" + }, + { + "code": "CFRK", + "description": "Forklift" + }, + { + "code": "CGEN", + "description": "Generator" + }, + { + "code": "CLOD", + "description": "Loader" + }, + { + "code": "CONS", + "description": "Construction Equip." + }, + { + "code": "CONV", + "description": "Conventional Tractor" + }, + { + "code": "CPAC", + "description": "Packer Truck" + }, + { + "code": "CREW", + "description": "4 Door Full Rear Door Cab" + }, + { + "code": "CTRN", + "description": "Trencher" + }, + { + "code": "CVAN", + "description": "Cargo Van" + }, + { + "code": "CWLD", + "description": "Welder" + }, + { + "code": "DCAB", + "description": "Double Cab Truck" + }, + { + "code": "FARM", + "description": "Farm Equip." + }, + { + "code": "GOLF", + "description": "Golf Cart" + }, + { + "code": "HBOX", + "description": "Box Truck" + }, + { + "code": "HC3", + "description": "Class 3" + }, + { + "code": "HC4", + "description": "Class 4" + }, + { + "code": "HC5", + "description": "Class 5" + }, + { + "code": "HC6", + "description": "Class 6" + }, + { + "code": "HC7", + "description": "Class 7" + }, + { + "code": "HC8", + "description": "Class 8" + }, + { + "code": "HCAB", + "description": "Cab/Chassis" + }, + { + "code": "HCR", + "description": "Car Carrier" + }, + { + "code": "HDMP", + "description": "Dump" + }, + { + "code": "HFLT", + "description": "Flatbed" + }, + { + "code": "HLFT", + "description": "Lift Platform" + }, + { + "code": "HSTP", + "description": "Stepvan" + }, + { + "code": "HTNK", + "description": "Tanker" + }, + { + "code": "HTRK", + "description": "Heavy Truck" + }, + { + "code": "HTRL", + "description": "Horse Trailer" + }, + { + "code": "HUSV", + "description": "Cutaway Chassis w/UB" + }, + { + "code": "HUTL", + "description": "Utility Truck" + }, + { + "code": "INC", + "description": "Incomplete Truck" + }, + { + "code": "JSKI", + "description": "Jet Ski" + }, + { + "code": "KOMB", + "description": "Volkswagen Bus (Truck)" + }, + { + "code": "LIMO", + "description": "Limousine" + }, + { + "code": "M/C", + "description": "Motorcycle" + }, + { + "code": "MEGA", + "description": "Mega Body" + }, + { + "code": "MH", + "description": "Motor Home" + }, + { + "code": "MIC", + "description": "Motorcycle" + }, + { + "code": "MPV", + "description": "Multi-Purpose Vehicle" + }, + { + "code": "OTH", + "description": "Other" + }, + { + "code": "PART", + "description": "Parts" + }, + { + "code": "PDIR", + "description": "Dirt Bike" + }, + { + "code": "PDUN", + "description": "Dune Buggy" + }, + { + "code": "PMTR", + "description": "Park Model Trailer" + }, + { + "code": "PS", + "description": "Powersports" + }, + { + "code": "PUT", + "description": "Pickup Truck" + }, + { + "code": "PWTR", + "description": "Personal Watercraft" + }, + { + "code": "QUAD", + "description": "Quad Cab" + }, + { + "code": "RCAB", + "description": "Regular Cab" + }, + { + "code": "RMOB", + "description": "Mobile Home" + }, + { + "code": "RV", + "description": "Recreation Vehicle" + }, + { + "code": "RVCA", + "description": "RV Class A" + }, + { + "code": "RVCB", + "description": "RV Class B" + }, + { + "code": "RVCC", + "description": "RV Class C" + }, + { + "code": "RVFD", + "description": "Fold Down" + }, + { + "code": "RVFW", + "description": "Fifth Wheel" + }, + { + "code": "RVHT", + "description": "Horse Trailer w/Living" + }, + { + "code": "RVSU", + "description": "SURV-w/Garage" + }, + { + "code": "RVTC", + "description": "Truck Camper" + }, + { + "code": "SEMI", + "description": "Semi Tractor" + }, + { + "code": "SNOW", + "description": "Snowmobile" + }, + { + "code": "SUV", + "description": "Sport Utility Vehicle" + }, + { + "code": "SW2D", + "description": "2 Door Station Wagon" + }, + { + "code": "SW4D", + "description": "4 Door Station Wagon" + }, + { + "code": "SW5D", + "description": "5 Door Station Wagon" + }, + { + "code": "TNTR", + "description": "Tent Trailer" + }, + { + "code": "TRAC", + "description": "Tractor Trailer" + }, + { + "code": "TRB", + "description": "Boat Trailer" + }, + { + "code": "TRCM", + "description": "Truck Camper" + }, + { + "code": "TREN", + "description": "Utility Enclosed" + }, + { + "code": "TRK", + "description": "Truck" + }, + { + "code": "TRLR", + "description": "Trailer" + }, + { + "code": "TRMC", + "description": "Rail Motorcycle" + }, + { + "code": "TROP", + "description": "Utility Open" + }, + { + "code": "TRSE", + "description": "Semi Trailer" + }, + { + "code": "TTRL", + "description": "Travel Trailer" + }, + { + "code": "UTIL", + "description": "Heavy Equipment" + }, + { + "code": "VAN", + "description": "Van" + }, + { + "code": "WGN", + "description": "Wagon" + }, + { + "code": "XC2D", + "description": "Extended Cab - 2 Doors" + }, + { + "code": "XC3D", + "description": "Extended Cab - 3 Doors" + }, + { + "code": "XC4D", + "description": "Extended Cab - 4 Doors (Not Crew)" + }, + { + "code": "XCAB", + "description": "Extended Cab" + } + ], + "cleaningLevels": [ + { + "code": 1, + "description": "No Cleaning" + }, + { + "code": 2, + "description": "Full Detail" + }, + { + "code": 3, + "description": "Wash and Vacuum Only" + }, + { + "code": 4, + "description": "Value/Standard" + }, + { + "code": 5, + "description": "Deluxe/Front Line Ready" + }, + { + "code": 6, + "description": "Deluxe/High Line Detail" + }, + { + "code": 7, + "description": "Deluxe/Sponsored Plus" + }, + { + "code": 8, + "description": "Deluxe/Extra Step" + }, + { + "code": 9, + "description": "Partial Detail" + }, + { + "code": 10, + "description": "Ultra Detail" + } + ], + "collateralTypes": [ + { + "id": 2, + "description": "Vehicle", + "lookupHandler": "NADAValueLookup" + }, + { + "id": 6, + "description": "Motorcycle", + "lookupHandler": "" + }, + { + "id": 7, + "description": "Boat", + "lookupHandler": "" + }, + { + "id": 8, + "description": "Motor", + "lookupHandler": "" + }, + { + "id": 9, + "description": "Trailer", + "lookupHandler": "" + }, + { + "id": 10, + "description": "Powersport", + "lookupHandler": "" + }, + { + "id": 11, + "description": "Other", + "lookupHandler": "" + }, + { + "id": 12, + "description": "Camper", + "lookupHandler": "" + } + ], + "collateralTypesToVehicleTypes": [ + { + "id": 1, + "collateralTypeId": 2, + "vehicleTypeId": 0 + }, + { + "id": 2, + "collateralTypeId": 2, + "vehicleTypeId": 1 + }, + { + "id": 3, + "collateralTypeId": 2, + "vehicleTypeId": 8 + }, + { + "id": 4, + "collateralTypeId": 6, + "vehicleTypeId": 4 + }, + { + "id": 5, + "collateralTypeId": 7, + "vehicleTypeId": 3 + }, + { + "id": 6, + "collateralTypeId": 8, + "vehicleTypeId": 3 + }, + { + "id": 7, + "collateralTypeId": 9, + "vehicleTypeId": 3 + }, + { + "id": 8, + "collateralTypeId": 9, + "vehicleTypeId": 7 + }, + { + "id": 9, + "collateralTypeId": 6, + "vehicleTypeId": 13 + }, + { + "id": 10, + "collateralTypeId": 10, + "vehicleTypeId": 11 + }, + { + "id": 11, + "collateralTypeId": 10, + "vehicleTypeId": 12 + }, + { + "id": 12, + "collateralTypeId": 10, + "vehicleTypeId": 14 + }, + { + "id": 13, + "collateralTypeId": 10, + "vehicleTypeId": 6 + }, + { + "id": 14, + "collateralTypeId": 2, + "vehicleTypeId": 9 + }, + { + "id": 15, + "collateralTypeId": 11, + "vehicleTypeId": 5 + }, + { + "id": 16, + "collateralTypeId": 11, + "vehicleTypeId": 10 + }, + { + "id": 17, + "collateralTypeId": 12, + "vehicleTypeId": 2 + }, + { + "id": 18, + "collateralTypeId": 9, + "vehicleTypeId": 6 + } + ], + "holdStatuses": [ + { + "code": 0, + "description": "No Hold" + }, + { + "code": 1, + "description": "Bankruptcy" + }, + { + "code": 2, + "description": "Insurance" + }, + { + "code": 3, + "description": "Legal" + }, + { + "code": 4, + "description": "Other Buyer" + }, + { + "code": 5, + "description": "Repo" + }, + { + "code": 6, + "description": "Special Promotion" + }, + { + "code": 7, + "description": "Moved" + }, + { + "code": 9, + "description": "Other" + }, + { + "code": 10, + "description": "Error" + }, + { + "code": 11, + "description": "Inspection" + }, + { + "code": 12, + "description": "Title Problem" + }, + { + "code": 13, + "description": "Redemption" + }, + { + "code": 14, + "description": "Dealer Repurchase" + }, + { + "code": 15, + "description": "Keys" + }, + { + "code": 16, + "description": "Mechanical" + }, + { + "code": 17, + "description": "Paint & Body" + }, + { + "code": 18, + "description": "Transportation Delay" + }, + { + "code": 19, + "description": "Corrections" + }, + { + "code": 20, + "description": "Military" + }, + { + "code": 21, + "description": "Notice Of Intent" + }, + { + "code": 22, + "description": "Notice Of Sale" + }, + { + "code": 23, + "description": "Upstream/Online Sale" + }, + { + "code": 24, + "description": "Recall" + } + ], + "loanCategories": [ + { + "id": 1, + "categoryName": "Vehicle" + }, + { + "id": 2, + "categoryName": "Marine" + }, + { + "id": 3, + "categoryName": "Recreation" + }, + { + "id": 4, + "categoryName": "Motorcycle" + } + ], + "locationTypes": [ + { + "code": 1, + "description": "Business" + }, + { + "code": 2, + "description": "Residence" + }, + { + "code": 3, + "description": "Marshalling Yard" + }, + { + "code": 4, + "description": "Auction" + }, + { + "code": 5, + "description": "Dealership" + }, + { + "code": 6, + "description": "Impound Lot" + }, + { + "code": 7, + "description": "Repo Agent" + }, + { + "code": 8, + "description": "Body Shop" + }, + { + "code": 9, + "description": "Repair Shop" + }, + { + "code": 10, + "description": "Government" + }, + { + "code": 11, + "description": "Tow Company" + }, + { + "code": 12, + "description": "Street" + }, + { + "code": 13, + "description": "Unknown" + } + ], + "vehicleTypes": [ + { + "code": "0", + "description": "Car or Light Truck" + }, + { + "code": "1", + "description": "Medium or Heavy Truck" + }, + { + "code": "10", + "description": "Yellow Steel" + }, + { + "code": "11", + "description": "jet Ski" + }, + { + "code": "12", + "description": "ATV" + }, + { + "code": "13", + "description": "Moped" + }, + { + "code": "14", + "description": "Snowmobile" + }, + { + "code": "2", + "description": "RV" + }, + { + "code": "3", + "description": "Boat" + }, + { + "code": "4", + "description": "Motorcycle" + }, + { + "code": "5", + "description": "Other" + }, + { + "code": "6", + "description": "Powersport" + }, + { + "code": "7", + "description": "Trailer" + }, + { + "code": "8", + "description": "Box Truck" + }, + { + "code": "9", + "description": "Tractor Trailer" + } + ], + "branchSet": [ + { + "branchId": "1", + "branchName": "WEST MILWAUKEE" + }, + { + "branchId": "2", + "branchName": "NEW BERLIN" + }, + { + "branchId": "3", + "branchName": "OCONOMOWOC" + }, + { + "branchId": "4", + "branchName": "WAUWATOSA" + }, + { + "branchId": "5", + "branchName": "WAUKESHA" + }, + { + "branchId": "6", + "branchName": "SUSSEX" + }, + { + "branchId": "7", + "branchName": "HARTLAND" + }, + { + "branchId": "8", + "branchName": "MILWAUKEE SOUTH" + }, + { + "branchId": "9", + "branchName": "WATERTOWN" + }, + { + "branchId": "10", + "branchName": "RACINE RAPIDS DRIVE" + }, + { + "branchId": "11", + "branchName": "DO NOT USE/MID" + }, + { + "branchId": "13", + "branchName": "GERMANTOWN" + }, + { + "branchId": "14", + "branchName": "FRANKLIN RAWSON" + }, + { + "branchId": "15", + "branchName": "WEST ALLIS" + }, + { + "branchId": "16", + "branchName": "BROOKFIELD EAST" + }, + { + "branchId": "18", + "branchName": "GRAFTON" + }, + { + "branchId": "19", + "branchName": "OAK CREEK" + }, + { + "branchId": "20", + "branchName": "WEST BEND-WASHINGTON ST" + }, + { + "branchId": "21", + "branchName": "WEST BEND-MAIN ST" + }, + { + "branchId": "22", + "branchName": "BAY VIEW" + }, + { + "branchId": "23", + "branchName": "CUDAHY" + }, + { + "branchId": "24", + "branchName": "RACINE WASHINGTON AVE" + }, + { + "branchId": "25", + "branchName": "BURLINGTON" + }, + { + "branchId": "26", + "branchName": "RACINE GROVE AVE" + }, + { + "branchId": "27", + "branchName": "BEAVER DAM" + }, + { + "branchId": "29", + "branchName": "MAYVILLE" + }, + { + "branchId": "30", + "branchName": "FALL RIVER" + }, + { + "branchId": "31", + "branchName": "MADISON SPRING STREET" + }, + { + "branchId": "32", + "branchName": "HARTFORD" + }, + { + "branchId": "33", + "branchName": "HUBERTUS" + }, + { + "branchId": "34", + "branchName": "JUNEAU MAIN ST" + }, + { + "branchId": "36", + "branchName": "MUSKEGO" + }, + { + "branchId": "37", + "branchName": "BROOKFIELD WEST" + }, + { + "branchId": "38", + "branchName": "GREENFIELD" + }, + { + "branchId": "39", + "branchName": "GLENDALE" + }, + { + "branchId": "43", + "branchName": "ACCOUNTING" + }, + { + "branchId": "44", + "branchName": "CENTRAL LOAN PROCESSING" + }, + { + "branchId": "47", + "branchName": "COLLECTIONS" + }, + { + "branchId": "50", + "branchName": "LOAN PROCESSING CENTER" + }, + { + "branchId": "51", + "branchName": "INFORMATION TECHNOLOGY" + }, + { + "branchId": "52", + "branchName": "LIC DEPT" + }, + { + "branchId": "53", + "branchName": "CREDIT CARDS" + }, + { + "branchId": "54", + "branchName": "DIGITAL BANKING" + }, + { + "branchId": "55", + "branchName": "MEMBER SERVICE CENTER" + }, + { + "branchId": "56", + "branchName": "INTERNAL AUDITORS" + }, + { + "branchId": "57", + "branchName": "INDIRECT LENDING DEPT" + }, + { + "branchId": "58", + "branchName": "MORTGAGE LOAN DEPARTMENT" + }, + { + "branchId": "59", + "branchName": "ADMINISTRATIVE DEPTS" + }, + { + "branchId": "60", + "branchName": "BATCH PROCESSING" + }, + { + "branchId": "75", + "branchName": "DO NOT USE/BROWNBERRY" + }, + { + "branchId": "80", + "branchName": "XP2 TRAINING" + } + ], + "externalUsers": [ + { + "id": 1, + "referenceId": -10, + "name": "System, System", + "code": "System" + }, + { + "id": 2, + "referenceId": 224, + "name": "Robertson, June", + "code": "JRobertson" + }, + { + "id": 3, + "referenceId": 225, + "name": "Schlueter, Judy", + "code": "JSchlueter" + }, + { + "id": 4, + "referenceId": 226, + "name": "Ruiz, Juan", + "code": "JRuiz" + }, + { + "id": 5, + "referenceId": 227, + "name": "Nichols, Josh", + "code": "JNichols" + }, + { + "id": 6, + "referenceId": 228, + "name": "Hopkins, Jonathan", + "code": "JHopkins" + }, + { + "id": 7, + "referenceId": 229, + "name": "Runte, Jody", + "code": "JRunte" + }, + { + "id": 8, + "referenceId": 23, + "name": "Olson, Barb", + "code": "BOlson" + }, + { + "id": 9, + "referenceId": 230, + "name": "Moen, Joanie", + "code": "JMoen" + }, + { + "id": 10, + "referenceId": 231, + "name": "Steagall, Jill", + "code": "JSteagall" + }, + { + "id": 11, + "referenceId": 232, + "name": "Manganaro, Jill", + "code": "JManganaro" + }, + { + "id": 12, + "referenceId": 233, + "name": "Krawczyk, Jessica", + "code": "JKrawczyk" + }, + { + "id": 13, + "referenceId": 24, + "name": "Calmes, Mary", + "code": "MCalmes" + }, + { + "id": 14, + "referenceId": 223, + "name": "Miller, Karen", + "code": "KMiller" + }, + { + "id": 15, + "referenceId": 25, + "name": "Powers, Richard", + "code": "RPowers" + }, + { + "id": 16, + "referenceId": 27, + "name": "Miranda, Nancy", + "code": "NMiranda" + }, + { + "id": 17, + "referenceId": 28, + "name": "Cotton, Tranace", + "code": "TCotton" + }, + { + "id": 18, + "referenceId": 29, + "name": "Throndsen, Mike", + "code": "MThrondsen" + }, + { + "id": 19, + "referenceId": 3, + "name": "Template, Collector", + "code": "CollectorTemplate" + }, + { + "id": 20, + "referenceId": 30, + "name": "Garza-Sotelo, Sandra", + "code": "SGarzaSotelo" + }, + { + "id": 21, + "referenceId": 31, + "name": "Rounds, Tonia", + "code": "TRounds" + }, + { + "id": 22, + "referenceId": 32, + "name": "Whitsell, Donna", + "code": "DWhitsell" + }, + { + "id": 23, + "referenceId": 33, + "name": "Jones, Asia", + "code": "AJones" + }, + { + "id": 24, + "referenceId": 34, + "name": "Alva, Pedro", + "code": "PAlva" + }, + { + "id": 25, + "referenceId": 35, + "name": "Davies, Nicole", + "code": "NDavies" + }, + { + "id": 26, + "referenceId": 36, + "name": "Williams, Synethia", + "code": "SWilliams" + }, + { + "id": 27, + "referenceId": 37, + "name": "Elwing, Holly", + "code": "HElwing" + }, + { + "id": 28, + "referenceId": 26, + "name": "Mazur, Austin", + "code": "AMazur" + }, + { + "id": 29, + "referenceId": 222, + "name": "Kennelly, Kari", + "code": "KKennelly" + }, + { + "id": 30, + "referenceId": 221, + "name": "Thurman, Karling", + "code": "KThurman" + }, + { + "id": 31, + "referenceId": 220, + "name": "Carlton, Kathryn", + "code": "KCarlton" + }, + { + "id": 32, + "referenceId": 196, + "name": "Garcia, Magdalina", + "code": "MGarcia" + }, + { + "id": 33, + "referenceId": 197, + "name": "Wright, Lori", + "code": "LWright" + }, + { + "id": 34, + "referenceId": 198, + "name": "McGarry, Lisa", + "code": "LMcGarry" + }, + { + "id": 35, + "referenceId": 199, + "name": "Sheridan, Linda", + "code": "LSheridan" + }, + { + "id": 36, + "referenceId": 2, + "name": "Temenos, Dorothy", + "code": "Temenos" + }, + { + "id": 37, + "referenceId": 20, + "name": "Kaye, Cheryl", + "code": "CKaye" + }, + { + "id": 38, + "referenceId": 200, + "name": "Kreutzer, Linda", + "code": "LKreutzer" + }, + { + "id": 39, + "referenceId": 201, + "name": "Hoerl, Linda", + "code": "LHoerl" + }, + { + "id": 40, + "referenceId": 202, + "name": "Nelson, Leslie", + "code": "LNelson" + }, + { + "id": 41, + "referenceId": 203, + "name": "Hanrahan, Leigha", + "code": "LHanrahan" + }, + { + "id": 42, + "referenceId": 204, + "name": "Moelk, Leanne", + "code": "LMoelk" + }, + { + "id": 43, + "referenceId": 205, + "name": "Duff, Leann", + "code": "LDuff" + }, + { + "id": 44, + "referenceId": 206, + "name": "VanHulst, Laura", + "code": "LVanHulst" + }, + { + "id": 45, + "referenceId": 207, + "name": "Scott, Laura", + "code": "LScott" + }, + { + "id": 46, + "referenceId": 208, + "name": "Sims, Latasha", + "code": "LSims" + }, + { + "id": 47, + "referenceId": 209, + "name": "Morris, Koleen", + "code": "KMorris" + }, + { + "id": 48, + "referenceId": 210, + "name": "Brzozowski, Kitty", + "code": "KBrzozowski" + }, + { + "id": 49, + "referenceId": 211, + "name": "Gemoll, Kirsten", + "code": "KGemoll" + }, + { + "id": 50, + "referenceId": 212, + "name": "Calliari, Kim", + "code": "KCalliari" + }, + { + "id": 51, + "referenceId": 213, + "name": "Laviolette, Ken", + "code": "KLaviolette" + }, + { + "id": 52, + "referenceId": 214, + "name": "Her, Ken", + "code": "KHer" + }, + { + "id": 53, + "referenceId": 215, + "name": "Osorio, Keith", + "code": "KOsorio" + }, + { + "id": 54, + "referenceId": 216, + "name": "Speidel, Kayla", + "code": "KSpeidel" + }, + { + "id": 55, + "referenceId": 217, + "name": "Colon, Katy", + "code": "KColon" + }, + { + "id": 56, + "referenceId": 218, + "name": "Johnson, Katie", + "code": "KJohnson" + }, + { + "id": 57, + "referenceId": 219, + "name": "Swenson, Kathy", + "code": "KSwenson" + }, + { + "id": 58, + "referenceId": 22, + "name": "Oakes, Melinda", + "code": "MOakes" + }, + { + "id": 59, + "referenceId": 38, + "name": "Cudmore, Linda", + "code": "LCudmore" + }, + { + "id": 60, + "referenceId": 39, + "name": "Pozza, Koreen", + "code": "KPozza" + }, + { + "id": 61, + "referenceId": 4, + "name": "Berendt, Dean", + "code": "DBerendt" + }, + { + "id": 62, + "referenceId": 40, + "name": "Blagojevic, Ana", + "code": "ABlagojevic" + }, + { + "id": 63, + "referenceId": 73, + "name": "Malmquist, Amanda ", + "code": "AMalmquist" + }, + { + "id": 64, + "referenceId": 74, + "name": "Porter, Amanda ", + "code": "APorter" + }, + { + "id": 65, + "referenceId": 75, + "name": "Peterson, Amy", + "code": "APeterson" + }, + { + "id": 66, + "referenceId": 76, + "name": "Kosky, Anne", + "code": "AKosky" + }, + { + "id": 67, + "referenceId": 77, + "name": "Berry, April ", + "code": "ABerry" + }, + { + "id": 68, + "referenceId": 78, + "name": "Hefner, April", + "code": "AHefner" + }, + { + "id": 69, + "referenceId": 79, + "name": "Platt, Ashley", + "code": "APlatt" + }, + { + "id": 70, + "referenceId": 8, + "name": "VandeZande, Dan", + "code": "DVandeZande" + }, + { + "id": 71, + "referenceId": 80, + "name": "Vandervort, Ben", + "code": "BVandervort" + }, + { + "id": 72, + "referenceId": 81, + "name": "Wieland, Bill", + "code": "BWieland" + }, + { + "id": 73, + "referenceId": 82, + "name": "Hall, Bob", + "code": "BHall" + }, + { + "id": 74, + "referenceId": 83, + "name": "Schleicher, Brian", + "code": "BSchleicher" + }, + { + "id": 75, + "referenceId": 84, + "name": "Schuyler, Bryan", + "code": "BSchuyler" + }, + { + "id": 76, + "referenceId": 85, + "name": "Rivera, Carmen", + "code": "CRivera" + }, + { + "id": 77, + "referenceId": 86, + "name": "Franz, Caroline", + "code": "CFranz" + }, + { + "id": 78, + "referenceId": 87, + "name": "Moro, Carolyn ", + "code": "CMoro" + }, + { + "id": 79, + "referenceId": 88, + "name": "Westrick, Cheryl", + "code": "CWestrick" + }, + { + "id": 80, + "referenceId": 89, + "name": "Theis, Chris", + "code": "CTheis" + }, + { + "id": 81, + "referenceId": 9, + "name": "Mysliwy, Renee", + "code": "RMysliwy" + }, + { + "id": 82, + "referenceId": 90, + "name": "Sullivan, Christina", + "code": "CSullivan" + }, + { + "id": 83, + "referenceId": 91, + "name": "Radmann, Colleen", + "code": "CRadmann" + }, + { + "id": 84, + "referenceId": 92, + "name": "Lane, Coral", + "code": "CLane" + }, + { + "id": 85, + "referenceId": 93, + "name": "Barbian, Darlene", + "code": "DBarbian" + }, + { + "id": 86, + "referenceId": 94, + "name": "Meisner, Darryl", + "code": "DMeisner" + }, + { + "id": 87, + "referenceId": 95, + "name": "Atherton, Dave", + "code": "DAtherton" + }, + { + "id": 88, + "referenceId": 96, + "name": "Lovejoy, David", + "code": "DLovejoy" + }, + { + "id": 89, + "referenceId": 97, + "name": "Felske, Dean", + "code": "DFelske" + }, + { + "id": 90, + "referenceId": 72, + "name": "Saucedo, Amalia", + "code": "ASaucedo" + }, + { + "id": 91, + "referenceId": 195, + "name": "Mercado, Manuel", + "code": "MMercado" + }, + { + "id": 92, + "referenceId": 71, + "name": "Zeller, Alissha", + "code": "AZeller" + }, + { + "id": 93, + "referenceId": 7, + "name": "Johnson, Benard", + "code": "BJohnson" + }, + { + "id": 94, + "referenceId": 41, + "name": "Pisarek, Becky", + "code": "BPisarek" + }, + { + "id": 95, + "referenceId": 44, + "name": "Abelt, Debby", + "code": "DAbelt" + }, + { + "id": 96, + "referenceId": 45, + "name": "Frederick, Dorene", + "code": "DFrederick" + }, + { + "id": 97, + "referenceId": 47, + "name": "Tomascak, Becky", + "code": "BTomasczak" + }, + { + "id": 98, + "referenceId": 48, + "name": "Woodkey, Cindy", + "code": "CWoodkey" + }, + { + "id": 99, + "referenceId": 5, + "name": "Sternig, Kyle", + "code": "KSternig" + }, + { + "id": 100, + "referenceId": 50, + "name": "Farrar, Joe", + "code": "JFarrar" + }, + { + "id": 101, + "referenceId": 51, + "name": "Frick, George", + "code": "GFrick" + }, + { + "id": 102, + "referenceId": 52, + "name": "Stella, Jeanne", + "code": "JStella" + }, + { + "id": 103, + "referenceId": 53, + "name": "Harmon, Henry", + "code": "HHarmon" + }, + { + "id": 104, + "referenceId": 54, + "name": "Avila, Cynthia", + "code": "CAvila" + }, + { + "id": 105, + "referenceId": 55, + "name": "Tatum, Yasmiean", + "code": "YTatum" + }, + { + "id": 106, + "referenceId": 56, + "name": "Tirado, Jayson", + "code": "JTirado" + }, + { + "id": 107, + "referenceId": 57, + "name": "Account, API", + "code": "APIAccount" + }, + { + "id": 108, + "referenceId": 58, + "name": "Jones, Monet", + "code": "MJones" + }, + { + "id": 109, + "referenceId": 59, + "name": "Schoenke, Sabina", + "code": "SSchoenke" + }, + { + "id": 110, + "referenceId": 6, + "name": "Johns, Bill", + "code": "BJohns" + }, + { + "id": 111, + "referenceId": 60, + "name": "Wilkins, Kevin", + "code": "KWilkins" + }, + { + "id": 112, + "referenceId": 61, + "name": "User, Training", + "code": "Training" + }, + { + "id": 113, + "referenceId": 62, + "name": "Wenzen, Jerry", + "code": "JWenzen" + }, + { + "id": 114, + "referenceId": 63, + "name": "Chojnacki, Yvette ", + "code": "YChojnacki" + }, + { + "id": 115, + "referenceId": 64, + "name": "Alley, William", + "code": "WAlley" + }, + { + "id": 116, + "referenceId": 65, + "name": "Castillo, Abner", + "code": "ACastillo" + }, + { + "id": 117, + "referenceId": 66, + "name": "Griffin, Adreonna", + "code": "AGriffin" + }, + { + "id": 118, + "referenceId": 67, + "name": "Melendez, Adrian", + "code": "AMelendez" + }, + { + "id": 119, + "referenceId": 68, + "name": "Glover, Aleesha ", + "code": "AGlover" + }, + { + "id": 120, + "referenceId": 69, + "name": "Rauch, Alex", + "code": "ARauch" + }, + { + "id": 121, + "referenceId": 70, + "name": "Derge, Alison", + "code": "ADerge" + }, + { + "id": 122, + "referenceId": 98, + "name": "Bienlein, Deb", + "code": "DBienlein" + }, + { + "id": 123, + "referenceId": 194, + "name": "Curley, Mary", + "code": "MCurley" + }, + { + "id": 124, + "referenceId": 192, + "name": "Thomas, Mary", + "code": "MThomas" + }, + { + "id": 125, + "referenceId": 111, + "name": "LaCrosse, Ginger", + "code": "GLaCrosse" + }, + { + "id": 126, + "referenceId": 112, + "name": "Janisch, Greg ", + "code": "GJanisch" + }, + { + "id": 127, + "referenceId": 113, + "name": "Johnson, Greg", + "code": "GJohnson" + }, + { + "id": 128, + "referenceId": 114, + "name": "Waldron, Greg", + "code": "GWaldron" + }, + { + "id": 129, + "referenceId": 115, + "name": "Navarre, Heather", + "code": "HNavarre" + }, + { + "id": 130, + "referenceId": 116, + "name": "Rauen, Heidi", + "code": "HRauen" + }, + { + "id": 131, + "referenceId": 117, + "name": "Artenian, Holly", + "code": "HArtenian" + }, + { + "id": 132, + "referenceId": 118, + "name": "Johnson, Jamie", + "code": "JJohnson" + }, + { + "id": 133, + "referenceId": 119, + "name": "Wojcak, Jamie", + "code": "JWojcak" + }, + { + "id": 134, + "referenceId": 12, + "name": "Peterson, Paul", + "code": "PPeterson" + }, + { + "id": 135, + "referenceId": 120, + "name": "Davis, Jamilah", + "code": "JDavis" + }, + { + "id": 136, + "referenceId": 121, + "name": "Martin, Jane", + "code": "JMartin" + }, + { + "id": 137, + "referenceId": 110, + "name": "Debelack, Fred", + "code": "FDebelack" + }, + { + "id": 138, + "referenceId": 122, + "name": "Holtz, Janel", + "code": "JHoltz" + }, + { + "id": 139, + "referenceId": 124, + "name": "McDowell, Jayleigha", + "code": "JMcDowell" + }, + { + "id": 140, + "referenceId": 125, + "name": "Jackson, Jen", + "code": "JeJackson" + }, + { + "id": 141, + "referenceId": 126, + "name": "DeVeau, Jennifer", + "code": "JDeVeau" + }, + { + "id": 142, + "referenceId": 127, + "name": "Schneck, Jennifer", + "code": "JSchneck" + }, + { + "id": 143, + "referenceId": 128, + "name": "Torres, Jennifer", + "code": "JTorres" + }, + { + "id": 144, + "referenceId": 129, + "name": "Johnson, Julie", + "code": "JuJohnson" + }, + { + "id": 145, + "referenceId": 13, + "name": "Schetter, Laura", + "code": "LSchetter" + }, + { + "id": 146, + "referenceId": 130, + "name": "Gonzalez, Wendy", + "code": "WGonzalez" + }, + { + "id": 147, + "referenceId": 131, + "name": "Maldonado, Veronica", + "code": "VMaldonado" + }, + { + "id": 148, + "referenceId": 132, + "name": "Eggerson, Torrey", + "code": "TEggerson" + }, + { + "id": 149, + "referenceId": 133, + "name": "Morse, Toni", + "code": "TMorse" + }, + { + "id": 150, + "referenceId": 134, + "name": "Kelber, Tim", + "code": "TKelber" + }, + { + "id": 151, + "referenceId": 123, + "name": "Johnson, Javier", + "code": "JaJohnson" + }, + { + "id": 152, + "referenceId": 11, + "name": "Vandebogert, Diana", + "code": "DVandebogert" + }, + { + "id": 153, + "referenceId": 109, + "name": "Kuechenmeister, Eva", + "code": "EKuechenmeister" + }, + { + "id": 154, + "referenceId": 108, + "name": "Brownell, Erin", + "code": "EBrownell" + }, + { + "id": 155, + "referenceId": -13, + "name": "Connector, SNC", + "code": "SNC Connector" + }, + { + "id": 156, + "referenceId": -14, + "name": "FirstClose, FirstClose", + "code": "FirstClose" + }, + { + "id": 157, + "referenceId": -16, + "name": "LendersProtection, LendersProtection", + "code": "LendersProtection" + }, + { + "id": 158, + "referenceId": -17, + "name": "ServerManager, ServerManager", + "code": "ServerManager" + }, + { + "id": 159, + "referenceId": -18, + "name": "MobileLoan, MobileLoan", + "code": "MobileLoan" + }, + { + "id": 160, + "referenceId": -20, + "name": "CURecovery, CURecovery", + "code": "CURecovery" + }, + { + "id": 161, + "referenceId": -21, + "name": "RealEC, RealEC", + "code": "RealEC" + }, + { + "id": 162, + "referenceId": -22, + "name": "CRIFSelect, CRIFSelect", + "code": "CRIFSelect" + }, + { + "id": 163, + "referenceId": -23, + "name": "FICOCCS, FICOCCS", + "code": "FICOCCS" + }, + { + "id": 164, + "referenceId": -24, + "name": "VALUECHECK, VALUECHECK", + "code": "VALUECHECK" + }, + { + "id": 165, + "referenceId": -25, + "name": "PublicApi, PublicApi", + "code": "PublicApi" + }, + { + "id": 166, + "referenceId": -4, + "name": "CUDL, CUDL", + "code": "CUDL" + }, + { + "id": 167, + "referenceId": -5, + "name": "LSI, LSI", + "code": "LSI" + }, + { + "id": 168, + "referenceId": -6, + "name": "System, Lending", + "code": "Lending System" + }, + { + "id": 169, + "referenceId": -7, + "name": "WebLoan, WebLoan", + "code": "WebLoan" + }, + { + "id": 170, + "referenceId": -8, + "name": "Dealertrack, Dealertrack", + "code": "Dealertrack" + }, + { + "id": 171, + "referenceId": -9, + "name": "RouteOne, RouteOne", + "code": "RouteOne" + }, + { + "id": 172, + "referenceId": 1, + "name": "Admin, Admin", + "code": "admin" + }, + { + "id": 173, + "referenceId": 10, + "name": "Wilkinson, Jim", + "code": "JWilkinson" + }, + { + "id": 174, + "referenceId": 100, + "name": "Rezeski, Debra", + "code": "DRezeski" + }, + { + "id": 175, + "referenceId": 101, + "name": "Paskiewicz, Denise", + "code": "DPaskiewicz" + }, + { + "id": 176, + "referenceId": 102, + "name": "Rushlau, Derinda", + "code": "DRushlau" + }, + { + "id": 177, + "referenceId": 103, + "name": "Wilder, Donteria", + "code": "DWilder" + }, + { + "id": 178, + "referenceId": 104, + "name": "Roper, Dontrinese", + "code": "DRoper" + }, + { + "id": 179, + "referenceId": 105, + "name": "Franklin, Ebony", + "code": "EFranklin" + }, + { + "id": 180, + "referenceId": 106, + "name": "Vanden Heuvel, Eric", + "code": "EVandenHeuvel" + }, + { + "id": 181, + "referenceId": 107, + "name": "Mendez, Erika", + "code": "EMendez" + }, + { + "id": 182, + "referenceId": 135, + "name": "Duck, Tiffany", + "code": "TDuck" + }, + { + "id": 183, + "referenceId": 136, + "name": "Cannon, Tiffany", + "code": "TCannon" + }, + { + "id": 184, + "referenceId": 137, + "name": "Wade, Tiara", + "code": "TWade" + }, + { + "id": 185, + "referenceId": 138, + "name": "Neumer, Theresa", + "code": "TNeumer" + }, + { + "id": 186, + "referenceId": 167, + "name": "Hardy, Patricia", + "code": "PHardy" + }, + { + "id": 187, + "referenceId": 168, + "name": "Schrank, Pam", + "code": "PSchrank" + }, + { + "id": 188, + "referenceId": 169, + "name": "Hernandez, Noemi", + "code": "NHernandez" + }, + { + "id": 189, + "referenceId": 17, + "name": "Zellner, Tammy", + "code": "TZellner" + }, + { + "id": 190, + "referenceId": 170, + "name": "Krueger, Nick", + "code": "NKrueger" + }, + { + "id": 191, + "referenceId": 171, + "name": "Hudzinski, Nick", + "code": "NHudzinski" + }, + { + "id": 192, + "referenceId": 172, + "name": "Kryshak, Nathan", + "code": "NKryshak" + }, + { + "id": 193, + "referenceId": 173, + "name": "Dondlinger, Nathan", + "code": "NDondlinger" + }, + { + "id": 194, + "referenceId": 174, + "name": "Mortimore, Natasha", + "code": "NMortimore" + }, + { + "id": 195, + "referenceId": 175, + "name": "Watts, Monica", + "code": "MWatts" + }, + { + "id": 196, + "referenceId": 176, + "name": "Stahl, Mitchell", + "code": "MStahl" + }, + { + "id": 197, + "referenceId": 177, + "name": "Schlarb, Mindy", + "code": "MShlarb" + }, + { + "id": 198, + "referenceId": 178, + "name": "Govani, Mickey", + "code": "MGovani" + }, + { + "id": 199, + "referenceId": 179, + "name": "Paloucek, Michelle ", + "code": "MPaloucek" + }, + { + "id": 200, + "referenceId": 18, + "name": "Koven, Meghan", + "code": "MKoven" + }, + { + "id": 201, + "referenceId": 180, + "name": "Pagenkopf, Michelle", + "code": "MPagenkopf" + }, + { + "id": 202, + "referenceId": 181, + "name": "Mueller, Michelle", + "code": "MMueller" + }, + { + "id": 203, + "referenceId": 182, + "name": "Kurth, Michelle", + "code": "MKurth" + }, + { + "id": 204, + "referenceId": 183, + "name": "Schimp, Michael", + "code": "MSchimp" + }, + { + "id": 205, + "referenceId": 184, + "name": "Maas, Michael", + "code": "MMaas" + }, + { + "id": 206, + "referenceId": 185, + "name": "James, Melita", + "code": "MJames" + }, + { + "id": 207, + "referenceId": 186, + "name": "Rawlins, Melissa", + "code": "MRawlins" + }, + { + "id": 208, + "referenceId": 187, + "name": "Cox, Melissa", + "code": "MCox" + }, + { + "id": 209, + "referenceId": 188, + "name": "Schlieper, Megan", + "code": "MSchlieper" + }, + { + "id": 210, + "referenceId": 189, + "name": "Caraballo, Mara", + "code": "MCaraballo" + }, + { + "id": 211, + "referenceId": 190, + "name": "Selsor, Matt", + "code": "MSelsor" + }, + { + "id": 212, + "referenceId": 191, + "name": "Langoehr, Maryrose", + "code": "MLangoehr" + }, + { + "id": 213, + "referenceId": 166, + "name": "Kurer, Patricia", + "code": "PKurer" + }, + { + "id": 214, + "referenceId": 193, + "name": "Nowak, Mary", + "code": "MNowak" + }, + { + "id": 215, + "referenceId": 165, + "name": "Pimienta, Patty", + "code": "PPimienta" + }, + { + "id": 216, + "referenceId": 163, + "name": "Remmert, Penny", + "code": "PRemmert" + }, + { + "id": 217, + "referenceId": 139, + "name": "Morgan, Terri", + "code": "TMorgan" + }, + { + "id": 218, + "referenceId": 14, + "name": "Bullox, Lakeba", + "code": "LBullox" + }, + { + "id": 219, + "referenceId": 140, + "name": "Gorski, Teri", + "code": "TGorski" + }, + { + "id": 220, + "referenceId": 141, + "name": "Hermanson, Teraesa", + "code": "THermanson" + }, + { + "id": 221, + "referenceId": 142, + "name": "Hermann, Taylor", + "code": "THermann" + }, + { + "id": 222, + "referenceId": 143, + "name": "Gillispie, Tara", + "code": "TGillispie" + }, + { + "id": 223, + "referenceId": 144, + "name": "Mota, Susan", + "code": "SMota" + }, + { + "id": 224, + "referenceId": 145, + "name": "Winters, Sue", + "code": "SWinters" + }, + { + "id": 225, + "referenceId": 146, + "name": "Oertel, Steve", + "code": "SOertel" + }, + { + "id": 226, + "referenceId": 147, + "name": "Hamilton, Stephanie", + "code": "SHamilton" + }, + { + "id": 227, + "referenceId": 148, + "name": "Peterson, Sonia", + "code": "SPeterson" + }, + { + "id": 228, + "referenceId": 149, + "name": "Guzman, Shparadise", + "code": "SGuzman" + }, + { + "id": 229, + "referenceId": 15, + "name": "Achterkirch, Janice", + "code": "JAchterkirch" + }, + { + "id": 230, + "referenceId": 150, + "name": "Xiong, Shoua", + "code": "SXiong" + }, + { + "id": 231, + "referenceId": 151, + "name": "Moore, Sean", + "code": "SMoore" + }, + { + "id": 232, + "referenceId": 152, + "name": "Schmick, Scott", + "code": "SSchmick" + }, + { + "id": 233, + "referenceId": 153, + "name": "Hansen, Scott", + "code": "SHansen" + }, + { + "id": 234, + "referenceId": 154, + "name": "Fellin, Samantha", + "code": "SFellin" + }, + { + "id": 235, + "referenceId": 155, + "name": "Smigh, Sharon", + "code": "SSmith" + }, + { + "id": 236, + "referenceId": 156, + "name": "Hesprich, Ryan", + "code": "RHesprich" + }, + { + "id": 237, + "referenceId": 157, + "name": "Ginning, Roseann", + "code": "RUlmbinning" + }, + { + "id": 238, + "referenceId": 158, + "name": "Rodriquez, Rosa", + "code": "RRodriquez" + }, + { + "id": 239, + "referenceId": 159, + "name": "Raszeja, Rochelle", + "code": "RRaszeja" + }, + { + "id": 240, + "referenceId": 16, + "name": "Kubiak, Virginia", + "code": "VKubiak" + }, + { + "id": 241, + "referenceId": 160, + "name": "Jagmin, Rachel", + "code": "RJagmin" + }, + { + "id": 242, + "referenceId": 161, + "name": "Bichadale, Rachel", + "code": "RBichadale" + }, + { + "id": 243, + "referenceId": 162, + "name": "Brede, Petra", + "code": "PBrede" + }, + { + "id": 244, + "referenceId": 164, + "name": "Hagon, Paul", + "code": "PHagon" + }, + { + "id": 245, + "referenceId": 99, + "name": "Nance, Deb", + "code": "DNance" + } + ], + "repoCompanies": [ + { + "id": 1, + "referenceId": 2000397, + "name": "Par", + "email": "testemail@test.com", + "address_Line_1": null, + "address_Line_2": null, + "city": null, + "state": null, + "zip": null, + "country": null, + "phone": null, + "fax": null, + "disabledBy": null, + "disabledDate": null + }, + { + "id": 2, + "referenceId": null, + "name": "Surrender", + "email": "Email@email.com", + "address_Line_1": null, + "address_Line_2": null, + "city": null, + "state": null, + "zip": null, + "country": null, + "phone": null, + "fax": null, + "disabledBy": "Joe Farrar", + "disabledDate": "2019-11-08T15:12:08.123" + }, + { + "id": 4, + "referenceId": null, + "name": "Repossessors", + "email": "test@gmail.com", + "address_Line_1": null, + "address_Line_2": null, + "city": null, + "state": null, + "zip": null, + "country": null, + "phone": null, + "fax": null, + "disabledBy": null, + "disabledDate": null + }, + { + "id": 5, + "referenceId": 2000069, + "name": "Allied Skip Claim", + "email": "dianavandebogert@landmarkcu.com", + "address_Line_1": null, + "address_Line_2": null, + "city": null, + "state": null, + "zip": null, + "country": null, + "phone": null, + "fax": null, + "disabledBy": null, + "disabledDate": null + }, + { + "id": 7, + "referenceId": 2000067, + "name": "Badgerland", + "email": "test@gmail.com", + "address_Line_1": null, + "address_Line_2": null, + "city": null, + "state": null, + "zip": null, + "country": null, + "phone": "414-529-0260", + "fax": null, + "disabledBy": null, + "disabledDate": null + }, + { + "id": 8, + "referenceId": null, + "name": "No Repo Company Assigned", + "email": "none@none.com", + "address_Line_1": null, + "address_Line_2": null, + "city": null, + "state": null, + "zip": null, + "country": null, + "phone": null, + "fax": null, + "disabledBy": null, + "disabledDate": null + }, + { + "id": 9, + "referenceId": null, + "name": "All City Towing", + "email": "morgan@allcitytowing@yahoo.com", + "address_Line_1": null, + "address_Line_2": null, + "city": null, + "state": null, + "zip": null, + "country": null, + "phone": null, + "fax": null, + "disabledBy": null, + "disabledDate": null + }, + { + "id": 10, + "referenceId": 2000396, + "name": "National Asset Solutions,Inc. ", + "email": "dennis@nas-now.com", + "address_Line_1": null, + "address_Line_2": null, + "city": null, + "state": null, + "zip": null, + "country": null, + "phone": null, + "fax": null, + "disabledBy": null, + "disabledDate": null + }, + { + "id": 11, + "referenceId": 2000068, + "name": "Location Services", + "email": "Jodie.Selby@location-services.com", + "address_Line_1": null, + "address_Line_2": null, + "city": null, + "state": null, + "zip": null, + "country": null, + "phone": null, + "fax": null, + "disabledBy": null, + "disabledDate": null + }, + { + "id": 12, + "referenceId": null, + "name": "Insurance Company", + "email": "billjohns@landmarkcu.com", + "address_Line_1": null, + "address_Line_2": null, + "city": null, + "state": null, + "zip": null, + "country": null, + "phone": null, + "fax": null, + "disabledBy": null, + "disabledDate": null + }, + { + "id": 13, + "referenceId": 2000398, + "name": "Primeritus", + "email": "rebeccam@reporemarketing.com", + "address_Line_1": "435 Metroplex Dr.", + "address_Line_2": null, + "city": "Nashville", + "state": "TN", + "zip": "37211", + "country": "USA", + "phone": "916-725-2708", + "fax": "615-332-8272", + "disabledBy": null, + "disabledDate": null + } + ], + "repoTypeMap": { + "0": "Unknown", + "1": "Involuntary", + "2": "Voluntary", + "3": "PreSkip", + "4": "Skip" + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/Processor/selectCorrectCase.json b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/Processor/selectCorrectCase.json new file mode 100644 index 0000000..e268056 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/Processor/selectCorrectCase.json @@ -0,0 +1,761 @@ +{ + "repoLetters": [], + "coreTransactions": [], + "temenosHistory": [], + "temenosAccount": { + "accountId": 875981, + "accountIdentifier": "2035090143", + "accountNumber": "2035090", + "accountStatus": "", + "accountTypeId": 1005, + "accountType": { + "id": 1005, + "description": "Auto New Indirect", + "code": "ANI" + }, + "activeFlag": true, + "amountLastPaid": null, + "balance": 41637.96, + "bankruptcyFlag": false, + "branch": null, + "dueDate": null, + "firstPaymentDueDate": null, + "loanOfficer": "", + "originalLoanAmount": null, + "originalLoanDate": null, + "dqAmount": null, + "daysDq": null, + "suffix": "143", + "linkedAccount": "2035090143", + "productType": "", + "closedDate": null, + "dateLastPaid": null, + "dateFirstDelinquent": "7/7/2020 12:00:00 AM", + "cases": [ + { + "caseId": 24, + "caseNumber": "DE-00000024", + "caseDescription": "", + "caseStageId": 0, + "repoStatus": 0, + "caseStatusId": 33, + "caseTitle": "DE-00000024", + "caseTypeBasisId": 6, + "caseTypeId": 44, + "closedDate": null, + "createdDate": "2021-04-13T11:10:52.32", + "createdUserId": 13, + "currentStageDate": "2021-04-13T11:10:51.85", + "currentStatusDate": "2021-04-13T11:10:51.85", + "lastReviewDate": null, + "nextReviewDate": null, + "stage1CompletionDate": null, + "stage2CompletionDate": null, + "stage3CompletionDate": null, + "stage4CompletionDate": null, + "stage5CompletionDate": null, + "titleOrdered": false, + "titleOrderedDate": null, + "redemptionExpiredDateIl": null, + "redemptionExpiredDateWi": null, + "customFieldMap": { + "Case Modification Status": "", + "Case Loss Mitigation Stage": "", + "Case Loss Mitigation Type": "", + "Case Loss Mitigation Status": "", + "BRP Hardship Letter": "", + "BRP Bank Statements": "", + "BRP Paycheck Stubs": "", + "BRP Other Income If Applicable": "", + "BRP Tax Returns": "", + "BRP 4506T Form Signed": "", + "BRP Financial Worksheet": "", + "BRP 1st Mortgage Statement": "", + "BRP HOI Declaration Page": "", + "BRP Escrow Authorization Signed": "", + "BRP Additional Information Needed": "", + "Def Fore Financial Filed": "", + "Def Fore Case Number": "", + "Def Fore Date Filed": "", + "Def Fore Property Address is Mailing Address": "", + "Def Fore Property Address if not Mailing Address": "", + "Def Fore Attorney Name": "", + "Def Fore Attorney Number": "", + "Fore Referral Date": "", + "Fore SCRA Checked Date": "", + "Fore RTC Expiration Date": "", + "Fore On Hold Date": "", + "Fore On Hold Reason": "", + "Fore Reinstated Date": "", + "Fore Withdrawn Date": "", + "Fore Withdrawn Reason": "", + "Fore Withdrawn Reason If Other": "", + "Fore Date Last Payment": "", + "Fore Sale Scheduled Date": "", + "Fore Confirmation Scheduled Date": "", + "Fore Confirmation Complete Date": "", + "Fore Sale Result": "", + "Collection Agency": "False", + "Todays Date Case Lvl": "", + "DQ Amount Case Lvl": "", + "Performance Pymnts Case Lvl": "", + "Late Charges Case Lvl": "", + "Repo Fees Case Lvl": "", + "Redemption Amount Case Lvl": "0.0000", + "Balance Due Case Lvl": "", + "Legal Requested State Case Lvl": "", + "Judgement Dropdown Case Lvl": "", + "Attorney Firm Case Lvl": "", + "Documents Sent Date Case Lvl": "", + "Date Sent to Attorney Case Lvl": "", + "Date Served Case Lvl": "", + "Attorney Invoice Number Case Lvl": "", + "WRIT Flag Case Lvl": "False", + "Date Last RTC Letter Sent Case Lvl": "", + "RTC Sent Flag Case Lvl": "False", + "WRIT Date Case Lvl": "", + "Bond Obtained Flag Case Lvl": "False", + "Bond Obtained Date Case Lvl": "", + "Sent to Sheriff Date Case Lvl": "", + "Garnishment Employer Case Lvl": "", + "Financial Disclosure Sent Flag Case Lvl": "False", + "Garnishment Paying Flag Case Lvl": "False", + "Garnishment Review Date Case Lvl": "", + "Post Judgement Rate Case Lvl": "", + "Judgement Property Address 1 Case Lvl": "", + "Judgement Property Address 2 Case Lvl": "", + "Judgement Property Address 3 Case Lvl": "", + "Docket Date 1 Case Lvl": "", + "Docket Date 2 Case Lvl": "", + "Docket Date 3 Case Lvl": "", + "Stip Payment Amount Case Lvl": "", + "Stip Payment Frequency Case Lvl": "", + "Stip Total Amount Case Level": "", + "Legal Closed Reason Case Lvl": "", + "Date Redeemed Repo": "" + }, + "dateRepossessed": null, + "repoTypeId": "", + "repoType": 0, + "dateRepoAssigned": null, + "repoAgentId": null + }, + { + "caseId": 25, + "caseNumber": "DE-00000025", + "caseDescription": "", + "caseStageId": 2000067, + "repoStatus": 999, + "caseStatusId": 33, + "caseTitle": "DE-00000024", + "caseTypeBasisId": 6, + "caseTypeId": 7, + "closedDate": null, + "createdDate": "2021-04-17T11:10:52.32", + "createdUserId": 13, + "currentStageDate": "2021-04-17T11:10:51.85", + "currentStatusDate": "2021-04-17T11:10:51.85", + "lastReviewDate": null, + "nextReviewDate": null, + "stage1CompletionDate": null, + "stage2CompletionDate": null, + "stage3CompletionDate": null, + "stage4CompletionDate": null, + "stage5CompletionDate": null, + "titleOrdered": false, + "titleOrderedDate": null, + "redemptionExpiredDateIl": null, + "redemptionExpiredDateWi": null, + "customFieldMap": { + "Case Modification Status": "", + "Case Loss Mitigation Stage": "", + "Case Loss Mitigation Type": "", + "Case Loss Mitigation Status": "", + "BRP Hardship Letter": "", + "BRP Bank Statements": "", + "BRP Paycheck Stubs": "", + "BRP Other Income If Applicable": "", + "BRP Tax Returns": "", + "BRP 4506T Form Signed": "", + "BRP Financial Worksheet": "", + "BRP 1st Mortgage Statement": "", + "BRP HOI Declaration Page": "", + "BRP Escrow Authorization Signed": "", + "BRP Additional Information Needed": "", + "Def Fore Financial Filed": "", + "Def Fore Case Number": "", + "Def Fore Date Filed": "", + "Def Fore Property Address is Mailing Address": "", + "Def Fore Property Address if not Mailing Address": "", + "Def Fore Attorney Name": "", + "Def Fore Attorney Number": "", + "Fore Referral Date": "", + "Fore SCRA Checked Date": "", + "Fore RTC Expiration Date": "", + "Fore On Hold Date": "", + "Fore On Hold Reason": "", + "Fore Reinstated Date": "", + "Fore Withdrawn Date": "", + "Fore Withdrawn Reason": "", + "Fore Withdrawn Reason If Other": "", + "Fore Date Last Payment": "", + "Fore Sale Scheduled Date": "", + "Fore Confirmation Scheduled Date": "", + "Fore Confirmation Complete Date": "", + "Fore Sale Result": "", + "Collection Agency": "False", + "Todays Date Case Lvl": "", + "DQ Amount Case Lvl": "", + "Performance Pymnts Case Lvl": "", + "Late Charges Case Lvl": "", + "Repo Fees Case Lvl": "", + "Redemption Amount Case Lvl": "0.0000", + "Balance Due Case Lvl": "", + "Legal Requested State Case Lvl": "", + "Judgement Dropdown Case Lvl": "", + "Attorney Firm Case Lvl": "", + "Documents Sent Date Case Lvl": "", + "Date Sent to Attorney Case Lvl": "", + "Date Served Case Lvl": "", + "Attorney Invoice Number Case Lvl": "", + "WRIT Flag Case Lvl": "False", + "Date Last RTC Letter Sent Case Lvl": "", + "RTC Sent Flag Case Lvl": "False", + "WRIT Date Case Lvl": "", + "Bond Obtained Flag Case Lvl": "False", + "Bond Obtained Date Case Lvl": "", + "Sent to Sheriff Date Case Lvl": "", + "Garnishment Employer Case Lvl": "", + "Financial Disclosure Sent Flag Case Lvl": "False", + "Garnishment Paying Flag Case Lvl": "False", + "Garnishment Review Date Case Lvl": "", + "Post Judgement Rate Case Lvl": "", + "Judgement Property Address 1 Case Lvl": "", + "Judgement Property Address 2 Case Lvl": "", + "Judgement Property Address 3 Case Lvl": "", + "Docket Date 1 Case Lvl": "", + "Docket Date 2 Case Lvl": "", + "Docket Date 3 Case Lvl": "", + "Stip Payment Amount Case Lvl": "", + "Stip Payment Frequency Case Lvl": "", + "Stip Total Amount Case Level": "", + "Legal Closed Reason Case Lvl": "", + "Date Redeemed Repo": "" + }, + "dateRepossessed": null, + "repoTypeId": "", + "repoType": 0, + "dateRepoAssigned": null, + "repoAgentId": null + }, + { + "caseId": 342, + "caseNumber": "REPO-00000342", + "caseDescription": "", + "caseStageId": 2000122, + "repoStatus": 100, + "caseStatusId": 33, + "caseTitle": "REPO-00000342", + "caseTypeBasisId": 2, + "caseTypeId": 7, + "closedDate": null, + "createdDate": "2021-04-15T12:41:53.23", + "createdUserId": 6, + "currentStageDate": "2021-04-15T12:41:52.497", + "currentStatusDate": "2021-04-15T12:41:52.497", + "lastReviewDate": null, + "nextReviewDate": null, + "stage1CompletionDate": null, + "stage2CompletionDate": null, + "stage3CompletionDate": null, + "stage4CompletionDate": null, + "stage5CompletionDate": null, + "titleOrdered": false, + "titleOrderedDate": null, + "redemptionExpiredDateIl": null, + "redemptionExpiredDateWi": null, + "customFieldMap": { + "Case Modification Status": "", + "Case Loss Mitigation Stage": "", + "Case Loss Mitigation Type": "", + "Case Loss Mitigation Status": "", + "BRP Hardship Letter": "", + "BRP Bank Statements": "", + "BRP Paycheck Stubs": "", + "BRP Other Income If Applicable": "", + "BRP Tax Returns": "", + "BRP 4506T Form Signed": "", + "BRP Financial Worksheet": "", + "BRP 1st Mortgage Statement": "", + "BRP HOI Declaration Page": "", + "BRP Escrow Authorization Signed": "", + "BRP Additional Information Needed": "", + "Def Fore Financial Filed": "", + "Def Fore Case Number": "", + "Def Fore Date Filed": "", + "Def Fore Property Address is Mailing Address": "", + "Def Fore Property Address if not Mailing Address": "", + "Def Fore Attorney Name": "", + "Def Fore Attorney Number": "", + "Fore Referral Date": "", + "Fore SCRA Checked Date": "", + "Fore RTC Expiration Date": "", + "Fore On Hold Date": "", + "Fore On Hold Reason": "", + "Fore Reinstated Date": "", + "Fore Withdrawn Date": "", + "Fore Withdrawn Reason": "", + "Fore Withdrawn Reason If Other": "", + "Fore Date Last Payment": "", + "Fore Sale Scheduled Date": "", + "Fore Confirmation Scheduled Date": "", + "Fore Confirmation Complete Date": "", + "Fore Sale Result": "", + "Collection Agency": "False", + "Todays Date Case Lvl": "", + "DQ Amount Case Lvl": "", + "Performance Pymnts Case Lvl": "", + "Late Charges Case Lvl": "", + "Repo Fees Case Lvl": "", + "Redemption Amount Case Lvl": "0.0000", + "Balance Due Case Lvl": "", + "Legal Requested State Case Lvl": "", + "Judgement Dropdown Case Lvl": "", + "Attorney Firm Case Lvl": "", + "Documents Sent Date Case Lvl": "", + "Date Sent to Attorney Case Lvl": "", + "Date Served Case Lvl": "", + "Attorney Invoice Number Case Lvl": "", + "WRIT Flag Case Lvl": "False", + "Date Last RTC Letter Sent Case Lvl": "", + "RTC Sent Flag Case Lvl": "False", + "WRIT Date Case Lvl": "", + "Bond Obtained Flag Case Lvl": "False", + "Bond Obtained Date Case Lvl": "", + "Sent to Sheriff Date Case Lvl": "", + "Garnishment Employer Case Lvl": "", + "Financial Disclosure Sent Flag Case Lvl": "False", + "Garnishment Paying Flag Case Lvl": "False", + "Garnishment Review Date Case Lvl": "", + "Post Judgement Rate Case Lvl": "", + "Judgement Property Address 1 Case Lvl": "", + "Judgement Property Address 2 Case Lvl": "", + "Judgement Property Address 3 Case Lvl": "", + "Docket Date 1 Case Lvl": "", + "Docket Date 2 Case Lvl": "", + "Docket Date 3 Case Lvl": "", + "Stip Payment Amount Case Lvl": "", + "Stip Payment Frequency Case Lvl": "", + "Stip Total Amount Case Level": "", + "Legal Closed Reason Case Lvl": "", + "Date Redeemed Repo": "" + }, + "dateRepossessed": null, + "repoTypeId": "2000143", + "repoType": 1, + "dateRepoAssigned": "2021-04-15T00:00:00", + "repoAgentId": "2000399" + } + ], + "customFieldMap": { + "Charge Off Status": "", + "Foreclosure Status - Lookup": "", + "Reason for Charge Off": "", + "Post Charge Off Intentions": "", + "BK Discharged Flag": "False", + "BK Reaffirmed Flag": "False", + "Fraud Suspected Flag": "False", + "Management Review Flag": "False", + "Balance at time of Charge Off": "", + "Date Approved for Charge Off": "", + "Date Approved for Foreclosure": "", + "Date Approved for Legal": "", + "Date Approved for Repo": "", + "Foreclosure Requested Flag": "False", + "Legal Requested Flag": "False", + "Lookup Value 4 - Lookup": "", + "Lookup Value 5 - Lookup": "", + "Repo Requested Flag": "True", + "Status Code 1": "", + "Status Code 2": "", + "Status Code 3": "", + "Status Code 4": "", + "Status Code 5": "", + "External Loan Number": "", + "Product Code": "", + "Product Name": "L-PN- Dealer New Vehicle", + "CORS Court Name": "", + "Loan Type": "", + "Original Interest Rate": "", + "Original Rate Type": "", + "Current Rate Type": "", + "Current Rate Term": "", + "Required Payment Amount": "", + "Times Late Count": "", + "Times Late 30 Days Count": "", + "Times Late 60 Days Count": "", + "Times Late 90 Days Count": "", + "Troubled Debt Restructure": "False", + "Modification Date": "", + "Modification Count": "", + "Modification Type": "", + "Financial Condition": "", + "Modification Reason": "", + "Membership Address 1": "", + "Membership Address 2": "", + "Membership City": "", + "Membership State Code": "", + "Membership Postal Code": "", + "User Status Code 1": "CLEX", + "User Status Code 2": "DE", + "Intellect Permanent Comments": "143 RTC $1,851.20 Exp. 8/4/20 DOD 8/15/19 death cert, added to PBF 8/21/19 Fontessa Moore 414-202-4706 temp disc wi number & **cell 803-387-8944 / 803-662-6311 transfer by affidavit on file ftezzm", + "PRI Metro 2 Code": "", + "S1 Metro 2 Code": "", + "S2 Metro 2 Code": "", + "PRI Metro 2 Code Description": "", + "S1 Metro 2 Code Description": "", + "S2 Metro 2 Code Description": "", + "PRI Affiliation Description": "", + "S1 Affiliation Description": "", + "S2 Affiliation Description": "", + "CORS Employer Address 1": "", + "CORS Employer Address 2": "", + "CORS Employer City": "", + "CORS Employer State Code": "", + "CORS Employer Postal Code": "", + "CORS Employer Comment": "", + "CORS Loan CORS date": "", + "CORS Demand Agency": "", + "CORS Assigned Agency": "", + "CORS Bankruptcy Case Number": "", + "CORS Bankruptcy File Date": "", + "CORS Bankruptcy Discharged Date": "", + "CORS Consumer Info Indicator": "False", + "CORS Trustee Name": "", + "CORS Bankruptcy Comment": "", + "CORS Motion Date": "", + "CORS Judgement Recordation": "", + "CORS Judgement Amount": "", + "CORS Judgement Status": "", + "CORS Judgement Comment": "", + "CORS Transaction Code": "", + "CORS Payment Amount": "", + "CORS Payment Frequency": "", + "CORS Payment Start Date": "", + "CORS User Assigned Name": "", + "CORS User Assigned Start Date": "", + "CORS User Assigned End Date": "", + "CORS Workflow Entered Date": "", + "CORS Workflow To Do Date": "", + "CORS Workflow Completed By Date": "", + "CORS Workflow User Name": "Schetter", + "CORS Workflow Action Description": "Loan Comment", + "CORS Workflow Comment": "emailed fontessa for update on", + "Organization Number": "", + "Client Number": "", + "Date High Balance": "", + "External Status Date 1": "", + "External Status 2": "", + "External Status Date 2": "", + "Insurance Code 1": "", + "Insurance Status 1": "", + "Insurance Status 2": "", + "Insurance Code 2": "", + "Insurance Status 3": "", + "Insurance Code 3": "", + "Most Recent Credit Score": "", + "Credit Score Less Recent": "", + "Relationship Flag": "", + "Relationship Number": "", + "S1 Original Credit Union": "", + "S1 Most Recent Credit Score": "", + "S1 Credit Score Less Recent": "", + "Client Name": "", + "Mortgage Insurer": "", + "Last Analyzed Date": "", + "Deferred Principal Balance": "", + "Prepetition Unapplied Balance": "", + "Stipulation Unapplied Balance": "", + "Other Funds Payment Amount": "", + "Assistance Payment Amount": "", + "Reserve Account Payment Amount": "", + "Default Interest Amount": "", + "Last NSF Fee Date": "", + "Last Letter Date": "", + "Other Fee Amount": "", + "Last Late Charge Waived Date": "", + "Last Late Charge Waived Amount": "", + "Next Late Charge Amount": "", + "Times Late LOL Count": "", + "Times Late Last 12 Months Count": "", + "Times Late 120 Days Count": "", + "Times Late 150 Days Count": "", + "Times Late 180 Days Count": "", + "First Payment Due Date": "", + "Maturity Type Description": "", + "Inspection Ordered Date": "", + "Last Inspection Date": "", + "Inspection Received Date": "", + "Current Occupancy Code": "", + "Inspected By": "", + "Property Type Description": "", + "Property Condition Description": "", + "Neighborhood Condition": "", + "Collateral 1 Property Type Code": "", + "Collateral 1 Lein Position": "", + "Bankruptcy Case Number": "", + "Bankruptcy Date Filed": "", + "DNU Bankruptcy Chapter Filed": "", + "Bankruptcy Claim Number": "", + "Bankruptcy Trustee Claim Number 1": "", + "Bankruptcy Trustee Claim Number 2": "", + "Bankruptcy Trustee Claim Number 3": "", + "Bankruptcy Name": "", + "Bankruptcy Event Code": "", + "Bankruptcy Event Legal": "", + "Bankruptcy Event Warning": "", + "Active Bankruptcy Flag": "False", + "Active Bankruptcy Plan Flag": "False", + "Bankruptcy Payment Status Date": "", + "Bankruptcy Milestone Due Date": "", + "Bankruptcy Milestone Completion Date": "", + "Bankruptcy Milestone Scheduled Date": "", + "Bankruptcy Milestone Actual Date": "", + "Bankruptcy Servicer Only": "", + "Contact Promise Date 1": "", + "Contact Promise Amount 1": "", + "Contact Promise Date 2": "", + "Contact Promise Amount 2": "", + "Contact Promise Date 3": "", + "Contact Promise Amount 3": "", + "Contact Reason": "", + "Contact Demeanor": "", + "Contact Outcome": "", + "Contact Permanent Comments": "", + "Legal Fee Amount": "", + "Collateral 1 Seller Name": "", + "Collateral 2 Seller Name": "", + "Collateral 3 Seller Name": "", + "Net Capitalized Cost Amount": "", + "Total Payments Count": "", + "Times Late 90 Plus Days Count": "", + "Late Fee Amount": "", + "Date 22 Day Letter Sent": "", + "Date 32 Day Letter Sent": "", + "Date 60 Day Letter Sent": "", + "Collateral 1 Legal Description": "", + "Collateral 2 Legal Description": "", + "Collateral 3 Legal Description": "", + "Collateral 4 Legal Description": "", + "SD Contact Follow Up Date": "", + "CORS Next Follow Up Date": "2/15/2021 12:00:00 AM", + "Waive Fee Reason DropDown": "", + "Waive Fee Reason Dropdown Spanish": "", + "Case Stages 1": "2000122", + "Dollar Amount": "", + "Case Stages 2": "", + "SCRA Flag": "False", + "TCPA Consent": "", + "Request Outcome": "", + "Request Outcome Date": "", + "Offset Request Reason DropDown": "", + "Intellect Next Follow Up Date": "9/10/2020 12:00:00 AM", + "Original Product Type": "", + "Recovery Branch": "57", + "Reason For Repo": "deceased account 3rd party can't afford to keep it", + "Repo Recovery Address": "2000141", + "Right to Cure Expired": "False", + "RTC Expiration Date": "", + "Repo Type": "", + "Repossession Type": "2000143", + "Secondary Recovery Address": "2000141", + "Redemption Calc WI Perfrmnce Pymnts": "0.0000", + "Redemption Calc WI Repo Fees": "", + "Redemption Calc WI Total Due": "80.0000", + "Redemption Calc WI Exp Date": "", + "Redemption Date Current Date": "", + "Redemption Calc WI Expiration Date": "", + "Investor": "", + "Money Field 2": "", + "Money Field 1": "", + "Loan Status": "L (From INTELLECT)", + "Redemption Calc IL 30 Percent Amnt Paid": "0.0000", + "Redemption Calc IL 30 Percent Yes or No": "True", + "Redemption Calc IL Total Due": "80.0000", + "Redemption Calc IL Exp Date": "", + "Current LTV Amount": "", + "Original LTV Amount": "", + "Redemption Calc IL Repo Fees": "", + "Redemption Calc IL Expiration Date": "", + "Repo Agencies": "", + "Bankruptcy Trustee": "", + "Title Ordered": "False", + "Title Received": "False", + "Vehicle ReTitled": "False", + "Title Ordered Date": "", + "ReTitled Date": "", + "Title Received Date": "", + "X Deceased Flag Dont Use": "True", + "CPI Active": "False", + "Branch Location": "", + "Collection Agency": "", + "Consumer Credit Counseling Services Flag": "False", + "Skip Trace Requested": "False", + "Loss Mitigation Status": "", + "Judgement Dropdown": "", + "Claim Type": "", + "Refund Status": "", + "Maintenance Requested": "False", + "BK Chapter": "", + "Settlement": "False", + "Repayment Plan Status": "", + "BK No Reaffirmation Flag": "False", + "test": "", + "Totaled Vehicle": "False", + "Fees Due": "", + "Original Input Code": "", + "Fraud Status": "", + "CORS Recovery Amt": "0.0000", + "CORS Recovery Amount Principal": "0.0000", + "Expense Applied Amount": "0.0000", + "Interest Applied Amount": "0.0000", + "Exp Amp": "80.0000", + "Input Code": "", + "Report Blank": "", + "Totaled Vehicle Notification Date": "", + "Warranty Cancellation Date": "", + "Refunds Requested Date": "", + "Repayment Plan Active": "False", + "Estate Attorney": "", + "Estate Attorney Phone Number": "", + "Personal Representative": "", + "Final Date to File Claim": "", + "Estate Closing Dates": "", + "Date Entered to Probate Finder": "8/21/2019 12:00:00 AM", + "Date Notified Deceased": "8/21/2019 12:00:00 AM", + "Death Notification Type": "2000224", + "Visible Assets": "False", + "CCCS Status": "", + "Consumer Credit Counseling Service Company": "", + "CCCS Amount Approved": "", + "CCCS Decision Date": "", + "Settlement Amount": "", + "Primary Insurance Company": "", + "Primary Insurance Company Phone Number": "", + "Claim Number": "", + "Date of Loss": "", + "Totaled Vehicle Mileage": "", + "Totaled Vehicle Settlement Amount": "", + "Totaled Vehicle Warranty Refund": "", + "Totaled Vehicle Refunds Received Date": "", + "Totaled Vehicle Refunds Received Amount": "", + "GAP Payment Received Date": "", + "Defensive Foreclosure Flag Do Not Use": "False", + "Defensive Foreclosure Flag": "False", + "Collateral Still Exists Flags": "False", + "Bankrupt Collectible Non Filing Borrower Flag": "False", + "Manual Transfer Amount": "", + "Manual Transfer Frequency": "", + "Transfer From Account": "", + "Transfer To Account": "", + "CBR Request": "", + "CBR Date Received": "", + "Additional CBR Information Needed": "", + "CBR Approved": "", + "CBR Yes No Reason": "", + "BRP Sent Flag": "False", + "BRP Sent Date": "", + "Manual Transfer Start Date": "", + "Loss Mitigation Stage": "", + "Loss Mitigation Type": "", + "Date Last RTC Letter Sent": "", + "Skip Trace Phone No1": "", + "Skip Trace Phone No2": "", + "Skip Trace Phone No3": "", + "Skip Trace Phone No4": "", + "Skip Trace Phone No5": "", + "Skip Trace Phone No6": "", + "Skip Trace Phone No7": "", + "Skip Trace Phone No8": "", + "Skip Trace Phone No9": "", + "Skip Trace Phone No10": "", + "Skip Trace Address No1": "", + "Skip Trace Address No2": "", + "Skip Trace Address No3": "", + "Skip Trace Address No4": "", + "Skip Trace Address No5": "", + "Skip Trace Address No6": "", + "Skip Trace Email No1": "", + "Skip Trace Email No2": "", + "Skip Trace Email No3": "", + "Skip Trace Email No4": "", + "Skip Trace Email No5": "", + "Skip Trace POE No1": "", + "Skip Trace POE No2": "", + "Skip Trace Comments": "", + "TLO Basic Flag": "False", + "TLO Comprehensive Flag": "False", + "DRN Flag": "False", + "RDN Flag": "False", + "CarFax Flag": "False", + "Equifax Flag": "False", + "Facebook Flag": "False", + "Skip Trace Date": "", + "GainLoss Value Amount": "", + "GainLoss Value Date": "", + "GainLoss Senior Balance": "", + "GainLoss Senior Name": "", + "GainLoss Value Source": "", + "GainLoss Outstanding Taxes": "", + "GainLoss Marketing Costs": "5000.0000", + "GainLoss 1yr Taxes": "", + "GainLoss Review Date": "", + "GainLoss Marketing Commission": "0.0000", + "GainLoss Total Amount": "-46637.9600", + "Collection Agency Flag": "False", + "Chapter 128 Flag": "False", + "Chapter 128 Case Number": "", + "Chapter 128 Date Filed": "", + "CORS Trustee Number": "", + "CORS Trustee Address": "", + "CORS Trustee Email": "", + "CORS Loan type Description": "L-PN- Dealer New Vehicle", + "Host Code": "L-PN", + "CORS Initial Charge Off Balance Amount": "41637.9600", + "CORS Initial Charge Off Date": "1/5/2021 12:00:00 AM", + "CORS Initial Principal Amount": "41637.9600", + "CORS Initial Interest Amount": "1559.9500", + "CORS Initial Expense Amount": "80.0000", + "CORS Transfer Date": "1/5/2021 12:00:00 AM", + "CORS Initial Interest Rate Type": "Fixed Rate", + "CORS Initial Interest Rate Percent": "7.3000", + "CORS Initial Day Count": "", + "CORS Current Principal Amount": "41637.9600", + "CORS Current Interest Amount": "2334.4200", + "CORS Current Expense Amount": "80.0000", + "CORS Curent Non Reimbursable Expense Amount": "0.0000", + "CORS Current Other Amount": "0.0000", + "CORS Non Reimbursable Other Amount": "0.0000", + "CORS Current Loan Balance Amount": "44052.3800", + "Attorney Firm": "", + "Legal Requested State": "", + "Garnishment Flag": "False", + "Money Judgement Flag": "False", + "Replevin Judgement Flag": "False", + "Stipulation Flag": "False", + "Summary Judgement Flag": "False", + "Wage Assignment Flag": "False", + "Date No Phone Number Letter Sent": "", + "Fraud Data Type": "", + "Active Fraud CRIF File": "", + "Repo User Assigned": "2000440", + "Skip Trace Reason": "", + "CORS Branch Number": "01", + "CORS Bankruptcy Chapter": "", + "Judgement Status": "" + } + }, + "loanDetail" :{}, + "memberDetail" : {}, + "collateralDetails": [] +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/Processor/update-retitle-redemption-exp.json b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/Processor/update-retitle-redemption-exp.json new file mode 100644 index 0000000..f130eea --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/Processor/update-retitle-redemption-exp.json @@ -0,0 +1,2464 @@ +{ + "repoLetters": [ + { + "ActionCode": "700", + "Description": "RTC-Illinois", + "DaysToWait": 15, + "WhenLetterIsSent": "BeforeO4R", + "LetterDescription": "None" + }, + { + "ActionCode": "701", + "Description": "Right to Reinstate/Redeem-Illinois", + "DaysToWait": 22, + "WhenLetterIsSent": "AfterO4R", + "LetterDescription": "Right to Reinstate/Redeem" + }, + { + "ActionCode": "702", + "Description": "Affidavit of Defense-Illinois", + "DaysToWait": 22, + "WhenLetterIsSent": "AfterO4R", + "LetterDescription": "None" + }, + { + "ActionCode": "703", + "Description": "Notice of Plan to Sell-Illinois", + "DaysToWait": 22, + "WhenLetterIsSent": "AfterO4R", + "LetterDescription": "None" + }, + { + "ActionCode": "704", + "Description": "Repo: Surplus-Deficiency Notice", + "DaysToWait": 0, + "WhenLetterIsSent": "AfterSale", + "LetterDescription": "None" + }, + { + "ActionCode": "ILLSU", + "Description": "ILLINOIS SURRENDER", + "DaysToWait": 0, + "WhenLetterIsSent": "BeforeO4R", + "LetterDescription": "Surrender (Illinois)" + }, + { + "ActionCode": "LTR34", + "Description": "Repo-Notice of Repossession", + "DaysToWait": 15, + "WhenLetterIsSent": "AfterO4R", + "LetterDescription": "Notice of Repossession" + }, + { + "ActionCode": "LTR35", + "Description": "WI Repo-Notice of Sale", + "DaysToWait": 15, + "WhenLetterIsSent": "AfterO4R", + "LetterDescription": "Notice of Plan to Sell - WI" + }, + { + "ActionCode": "LTR36", + "Description": "WI Repo-Sale of Collateral Notice", + "DaysToWait": 15, + "WhenLetterIsSent": "AfterO4R", + "LetterDescription": "None" + }, + { + "ActionCode": "RTC", + "Description": "Notice to repossess/prior expired RTC", + "DaysToWait": 0, + "WhenLetterIsSent": "BeforeO4R", + "LetterDescription": "None" + }, + { + "ActionCode": "RTC, 1", + "Description": "RTC Non Auto & Non Cycle", + "DaysToWait": 15, + "WhenLetterIsSent": "BeforeO4R", + "LetterDescription": "WI Unsecured RTC" + }, + { + "ActionCode": "RTC, 3", + "Description": "RTC-AUTO LOANS-WI", + "DaysToWait": 15, + "WhenLetterIsSent": "BeforeO4R", + "LetterDescription": "WI Auto RTC" + }, + { + "ActionCode": "RTC2", + "Description": "RTC New Law", + "DaysToWait": 15, + "WhenLetterIsSent": "BeforeO4R", + "LetterDescription": "None" + }, + { + "ActionCode": "RTCSP", + "Description": "SPANISH RTC WI AUTO LOANS", + "DaysToWait": 15, + "WhenLetterIsSent": "BeforeO4R", + "LetterDescription": "None" + }, + { + "ActionCode": "VOL", + "Description": "Wisconsin Surrender", + "DaysToWait": 0, + "WhenLetterIsSent": "BeforeO4R", + "LetterDescription": "Surrender (Wisconsin)" + } +], + "coreTransactions": [ + { + "postingDate": "2020-10-09T00:00:00", + "effectiveDate": "2020-10-09T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "FLEXIBLE LOAN CHANGE", + "transactionNumber": 289, + "transactionTypeCode": "MAN ", + "transactionAmount": 0, + "balance": 77729.14, + "principalAmount": 0, + "interest": 0, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 671333980, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": " OLD PMT=1,221.19 NEW PMT=2,231.90 Policy #AKH0014894" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2020-10-08T00:00:00", + "effectiveDate": "2020-10-08T00:00:00", + "operatorId": 6056, + "drawerName": "", + "drawerBranch": "", + "transactionType": "LOAN ADVANCE", + "transactionNumber": 230, + "transactionTypeCode": "C ", + "transactionAmount": 11807, + "balance": 77729.14, + "principalAmount": 11807, + "interest": 0, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 7208, + "historyItemId": 671295956, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "Policy #AKH0014894" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2020-02-20T00:00:00", + "effectiveDate": "2020-02-19T00:00:00", + "operatorId": 6051, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ELECTRONIC LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "PR ", + "transactionAmount": 1221.19, + "balance": 65922.14, + "principalAmount": -850.6, + "interest": 309.53, + "escrowAmount": 0, + "processingGroup": "111", + "batchControlId": 4172, + "historyItemId": 618971875, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 61.06, + "lateCharge": "61.06", + "historyDetails": { + "transactionDescription": "LandmarkCU TRANSFER 021920" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2020-01-17T00:00:00", + "effectiveDate": "2020-01-16T00:00:00", + "operatorId": 6051, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ELECTRONIC LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "PR ", + "transactionAmount": 1221.19, + "balance": 66772.74, + "principalAmount": -772.67, + "interest": 387.46, + "escrowAmount": 0, + "processingGroup": "111", + "batchControlId": 3735, + "historyItemId": 611525926, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 61.06, + "lateCharge": "61.06", + "historyDetails": { + "transactionDescription": "LandmarkCU TRANSFER 011620" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-12-06T00:00:00", + "effectiveDate": "2019-12-05T00:00:00", + "operatorId": 6051, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ELECTRONIC LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "PR ", + "transactionAmount": 1221.19, + "balance": 67545.41, + "principalAmount": -809.38, + "interest": 289.69, + "escrowAmount": 0, + "processingGroup": "111", + "batchControlId": 3164, + "historyItemId": 602261979, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 122.12, + "lateCharge": "122.12", + "historyDetails": { + "transactionDescription": "LandmarkCU TRANSFER 120519" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-11-05T00:00:00", + "effectiveDate": "2019-11-04T00:00:00", + "operatorId": 6051, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ELECTRONIC LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "PR ", + "transactionAmount": 1221.19, + "balance": 68354.79, + "principalAmount": -838.5, + "interest": 321.63, + "escrowAmount": 0, + "processingGroup": "111", + "batchControlId": 2724, + "historyItemId": 595262304, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 61.06, + "lateCharge": "61.06", + "historyDetails": { + "transactionDescription": "LandmarkCU TRANSFER 110419" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-10-02T00:00:00", + "effectiveDate": "2019-10-01T00:00:00", + "operatorId": 6051, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ELECTRONIC LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "PR ", + "transactionAmount": 1221.19, + "balance": 69193.29, + "principalAmount": -305.02, + "interest": 855.11, + "escrowAmount": 0, + "processingGroup": "111", + "batchControlId": 2239, + "historyItemId": 587659898, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 61.06, + "lateCharge": "61.06", + "historyDetails": { + "transactionDescription": "LandmarkCU TRANSFER 100119" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-09-25T15:42:15", + "effectiveDate": "2019-09-23T00:00:00", + "operatorId": 5139, + "drawerName": "", + "drawerBranch": "", + "transactionType": "CREDIT ADJUSTMENT", + "transactionNumber": 215, + "transactionTypeCode": "JANC", + "transactionAmount": 1221.19, + "balance": 69498.31, + "principalAmount": 381.03, + "interest": -779.1, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 585925032, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "803-100", + "totalFee": -61.06, + "lateCharge": "-61.06", + "historyDetails": { + "transactionDescription": "REVERSE Landmark CU TRANSFER RTN R03 UNABLE TO LOCATE" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-09-24T00:00:00", + "effectiveDate": "2019-09-23T00:00:00", + "operatorId": 6051, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ELECTRONIC LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "PR ", + "transactionAmount": 1221.19, + "balance": 69117.28, + "principalAmount": -381.03, + "interest": 779.1, + "escrowAmount": 0, + "processingGroup": "111", + "batchControlId": 2107, + "historyItemId": 585621944, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 61.06, + "lateCharge": "61.06", + "historyDetails": { + "transactionDescription": "LandmarkCU TRANSFER 092319" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-07-05T00:00:00", + "effectiveDate": "2019-07-03T00:00:00", + "operatorId": 6051, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ELECTRONIC LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "PR ", + "transactionAmount": 1221.19, + "balance": 69498.31, + "principalAmount": -932.33, + "interest": 288.86, + "escrowAmount": 0, + "processingGroup": "111", + "batchControlId": 975, + "historyItemId": 567927488, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "LandmarkCU TRANSFER 070319" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-06-04T00:00:00", + "effectiveDate": "2019-06-03T00:00:00", + "operatorId": 6051, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ELECTRONIC LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "PR ", + "transactionAmount": 1221.19, + "balance": 70430.64, + "principalAmount": -879.97, + "interest": 341.22, + "escrowAmount": 0, + "processingGroup": "111", + "batchControlId": 548, + "historyItemId": 561000995, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "LandmarkCU TRANSFER 060319" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-04-30T00:00:00", + "effectiveDate": "2019-04-29T00:00:00", + "operatorId": 6051, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ELECTRONIC LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "PR ", + "transactionAmount": 1221.19, + "balance": 71310.61, + "principalAmount": -885.61, + "interest": 335.58, + "escrowAmount": 0, + "processingGroup": "111", + "batchControlId": 64, + "historyItemId": 552949928, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "LandmarkCU TRANSFER 042919" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-03-27T00:00:00", + "effectiveDate": "2019-03-26T00:00:00", + "operatorId": 6051, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ELECTRONIC LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "PR ", + "transactionAmount": 1221.19, + "balance": 72196.22, + "principalAmount": -1030.98, + "interest": 190.21, + "escrowAmount": 0, + "processingGroup": "111", + "batchControlId": 9579, + "historyItemId": 545503477, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "LandmarkCU TRANSFER 032619" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-03-08T00:00:00", + "effectiveDate": "2019-03-07T00:00:00", + "operatorId": 6051, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ELECTRONIC LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "PR ", + "transactionAmount": 1221.19, + "balance": 73227.2, + "principalAmount": -776.04, + "interest": 445.15, + "escrowAmount": 0, + "processingGroup": "111", + "batchControlId": 9340, + "historyItemId": 541637171, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "LandmarkCU TRANSFER 030719" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-01-23T00:00:00", + "effectiveDate": "2019-01-22T00:00:00", + "operatorId": 6051, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ELECTRONIC LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "PR ", + "transactionAmount": 1221.19, + "balance": 74003.24, + "principalAmount": -873.15, + "interest": 348.04, + "escrowAmount": 0, + "processingGroup": "111", + "batchControlId": 8719, + "historyItemId": 532192666, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "LandmarkCU TRANSFER 012219" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2018-12-20T00:00:00", + "effectiveDate": "2018-12-19T00:00:00", + "operatorId": 6051, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ELECTRONIC LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "PR ", + "transactionAmount": 1221.19, + "balance": 74876.39, + "principalAmount": -817.61, + "interest": 403.58, + "escrowAmount": 0, + "processingGroup": "111", + "batchControlId": 8286, + "historyItemId": 525483966, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "LandmarkCU TRANSFER 121918" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2018-11-14T15:21:05", + "effectiveDate": "2018-11-10T00:00:00", + "operatorId": 6014, + "drawerName": "6014", + "drawerBranch": "60", + "transactionType": "NEW LOAN", + "transactionNumber": 250, + "transactionTypeCode": "JNC ", + "transactionAmount": 75694, + "balance": 75694, + "principalAmount": 75694, + "interest": 0, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 518002075, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "799-999", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "" + }, + "amountToCurtailment": 0 + } + ], + "temenosHistory": [ + { + "name": "Case Stage - REPO", + "message": "REHO", + "userId": 6, + "created": "2021-04-16T10:46:34.03", + "type": 1 + }, + { + "name": "Set Branch Number", + "message": "Branch Number", + "userId": 5, + "created": "2021-03-25T16:18:15.983", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2021-03-05T09:08:17.523", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2021-03-05T07:19:02.083", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2021-03-04T09:01:26.047", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2021-03-04T08:50:09.063", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2021-03-03T08:55:44.877", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2021-03-03T08:44:48.267", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2021-03-02T08:54:23.97", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2021-03-02T06:13:33.013", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2021-02-26T08:36:17.17", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2021-02-26T06:16:19.233", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2020-11-19T08:07:39.293", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-11-19T06:09:36.38", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2020-10-23T08:16:30.833", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-23T06:25:26.073", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2020-10-22T08:10:52.283", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-22T06:23:40.25", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2020-10-21T08:19:35.477", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-21T06:24:19.993", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2020-10-20T08:16:03.967", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-20T06:28:14.56", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2020-10-19T13:00:57.877", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-19T12:39:04.653", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2020-10-18T08:03:50.893", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-18T06:08:46.837", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2020-10-17T08:15:25.307", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-17T06:18:29.153", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2020-10-16T08:13:31.363", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-16T06:24:02.993", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2020-10-14T12:24:15.497", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-14T06:15:19.97", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-13T06:12:27.7", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-12T12:06:39.033", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-09T06:23:30.51", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-08T06:19:19.987", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-07T06:23:32.57", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2020-10-06T20:12:19.227", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-06T06:18:30.15", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-05T06:15:05.783", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-04T06:08:47.52", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-03T06:22:30.847", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-02T06:16:59.957", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-10-01T06:12:16.213", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-30T06:12:07.517", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-29T06:09:53.79", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-27T06:26:48.93", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-26T06:24:10.287", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-25T06:12:56.697", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-23T06:14:47.267", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-22T06:16:19.66", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-19T06:12:30.353", + "type": 1 + }, + { + "name": "AUTO - Collection Agency ACSI", + "message": "Flip to ACSI", + "userId": 5, + "created": "2020-09-18T14:53:13.453", + "type": 1 + }, + { + "name": "AUTO - Collection Agency ACSI", + "message": "Flip to ACSI", + "userId": 5, + "created": "2020-09-18T14:52:03.953", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-18T06:13:41.53", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2020-09-17T08:15:22.157", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-17T06:47:59.923", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 5, + "created": "2020-09-16T21:55:52.017", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2020-09-16T20:14:27.08", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-16T06:16:20.643", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-15T06:50:03.987", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-14T12:10:56.093", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-12T06:48:45.99", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-11T06:39:08.873", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 5, + "created": "2020-09-10T14:31:16.237", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-10T06:18:34.783", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2020-09-09T06:42:54.727", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-09T06:14:14.25", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2020-09-05T06:20:18.967", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-05T06:14:12.077", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2020-09-04T06:15:18.257", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-04T06:08:42.553", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 0, + "created": "2020-09-03T20:05:39.41", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-03T06:21:07.61", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-09-02T06:18:45.17", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-08-29T06:05:38.457", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-08-28T06:12:52.57", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-08-27T06:14:06.03", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-08-26T06:22:32.66", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-08-25T06:31:45.287", + "type": 1 + }, + { + "name": "AUTO - Collection Agency Aries Data", + "message": "Flip to Aries Data", + "userId": 5, + "created": "2020-08-24T11:20:32.547", + "type": 1 + }, + { + "name": "AUTO - Collection Agency ACSI", + "message": "Flip to ACSI", + "userId": 5, + "created": "2020-08-24T10:39:51.947", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-08-21T06:17:07.81", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 5, + "created": "2020-08-19T22:53:27.66", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 5, + "created": "2020-08-19T16:06:08.497", + "type": 1 + }, + { + "name": "AUTO - Status TCPA In Account", + "message": "TCPA Yes Flag", + "userId": 5, + "created": "2020-08-19T16:02:20.637", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-08-15T06:10:36.533", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-08-14T06:20:54.92", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-08-12T06:20:44.067", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-08-11T06:22:09.27", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-08-08T08:16:57.117", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-08-07T06:13:22.437", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-08-06T20:08:55.037", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-08-05T20:19:54.533", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "Intellect Permanent Comments - Blank", + "userId": 2, + "created": "2020-07-29T15:19:21.987", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "User Status Code 2 - Blank", + "userId": 2, + "created": "2020-07-29T15:19:21.987", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "User Status Code 1 - Blank", + "userId": 2, + "created": "2020-07-29T15:19:21.987", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "Intellect Next Follow Up Date - 1/1/20", + "userId": 2, + "created": "2020-07-29T15:19:21.987", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "Last Contact Date - 1/1/2020", + "userId": 2, + "created": "2020-07-29T15:19:21.987", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "Intellect Permanent Comments - Blank", + "userId": 2, + "created": "2020-07-29T15:11:25.08", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "User Status Code 2 - Blank", + "userId": 2, + "created": "2020-07-29T15:11:25.08", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "User Status Code 1 - Blank", + "userId": 2, + "created": "2020-07-29T15:11:25.08", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "Intellect Next Follow Up Date - 1/1/20", + "userId": 2, + "created": "2020-07-29T15:11:25.08", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "Last Contact Date - 1/1/2020", + "userId": 2, + "created": "2020-07-29T15:11:25.08", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "Intellect Permanent Comments - Blank", + "userId": 2, + "created": "2020-07-29T15:07:10.89", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "User Status Code 2 - Blank", + "userId": 2, + "created": "2020-07-29T15:07:10.89", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "User Status Code 1 - Blank", + "userId": 2, + "created": "2020-07-29T15:07:10.89", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "Intellect Next Follow Up Date - 1/1/20", + "userId": 2, + "created": "2020-07-29T15:07:10.89", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "Last Contact Date - 1/1/2020", + "userId": 2, + "created": "2020-07-29T15:07:10.89", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "Intellect Permanent Comments - Blank", + "userId": 2, + "created": "2020-07-29T14:38:58.977", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "User Status Code 2 - Blank", + "userId": 2, + "created": "2020-07-29T14:38:58.977", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "User Status Code 1 - Blank", + "userId": 2, + "created": "2020-07-29T14:38:58.977", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "Intellect Next Follow Up Date - 1/1/20", + "userId": 2, + "created": "2020-07-29T14:38:58.977", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "Last Contact Date - 1/1/2020", + "userId": 2, + "created": "2020-07-29T14:38:58.977", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "Intellect Permanent Comments - Blank", + "userId": 2, + "created": "2020-07-29T14:36:10.507", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "User Status Code 2 - Blank", + "userId": 2, + "created": "2020-07-29T14:36:10.507", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "User Status Code 1 - Blank", + "userId": 2, + "created": "2020-07-29T14:36:10.507", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "Intellect Next Follow Up Date - 1/1/20", + "userId": 2, + "created": "2020-07-29T14:36:10.507", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "Last Contact Date - 1/1/2020", + "userId": 2, + "created": "2020-07-29T14:36:10.507", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "Intellect Permanent Comments - Blank", + "userId": 2, + "created": "2020-07-29T14:25:59.413", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "User Status Code 2 - Blank", + "userId": 2, + "created": "2020-07-29T14:25:59.413", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "User Status Code 1 - Blank", + "userId": 2, + "created": "2020-07-29T14:25:59.413", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "Intellect Next Follow Up Date - 1/1/20", + "userId": 2, + "created": "2020-07-29T14:25:59.413", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "Last Contact Date - 1/1/2020", + "userId": 2, + "created": "2020-07-29T14:25:59.413", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-07-27T08:29:20.55", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2020-07-22T08:35:13.453", + "type": 1 + }, + { + "name": "Comment", + "message": "NANCY Comment: TT JEHAD RFD BUSINESS HAS GONE DOWN DUE TOCORONAVIRUS AND HAD ONLY 20DOL IN SALES YESTERDAY NOT NENOUGHT TO PAY A BILL WOULD LIKE TO GET 1 MONTH DEFERAL WILL PUT IT THRU VERIFIED DEMOS \r\n7584700143 02/21/2020 08:00:13 AMDIALE PAID: PAID \r\n7584920143 05/04/2020 12:18:11 PMSYNW Comment: ISRAEL CALLED, VERF DEMOS ------11 DAYS PAST DUE HE PROVIDED HIS UPDATED ADDRESS AND WILL FORWARD THE LETTER, HE WAS RETURNING OUR CALL AND STATES WE WILL GET A PAYMENT THE NEXT TIME SHE MAKES ONE -------UPDATED ADDRESS: 4381 SODA CREEK ROAD/ APT#5/ OSH \r\n7584920143 04/17/2020 07:35:06 AMDIALE PAID: PAID", + "userId": 1, + "created": "2020-03-11T14:20:13", + "type": 0 + }, + { + "name": "Comment", + "message": "SYNW Message: John d doe @ 630-402-5919 \r\n7584700143 05/19/2020 11:33:02 AMNANCY Comment: member would like to 3 month defferal due to covid19 not working not able to make pmt on account will b asking a friend to borrow money to make at least 1 pmt will put in defferal verified denmos \r\n7584700143 03/30/2020 10:04:55 AM4735 Ltr-File: 32 DPD-Non Real Estate \r\n7584700143 03/18/2020 08:22:31 AM4735 Ltr-File: 22 Day Past Due Letter", + "userId": 1, + "created": "2020-02-14T11:27:46", + "type": 0 + }, + { + "name": "Comment", + "message": "NANCY Message: John d doe @ (773)980-8080 \r\n7584700143 02/06/2020 03:06:27 PMAMAZ Comment: mb full \r\n7584700143 03/11/2020 02:20:13 PMNANCY Call: Call Follow Up \r\n7584700143 03/11/2020 02:14:41 PMNANCY Contact In: Inbound call John d doe @ (773)980-8080", + "userId": 1, + "created": "2020-02-11T11:19:59", + "type": 0 + }, + { + "name": "Comment", + "message": "DIALE PAID: PAID \r\n7584700143 02/06/2020 03:06:20 PMAMAZ Message: John d doe @ (773)980-8080 \r\n7584700143 02/06/2020 03:06:27 PMAMAZ Call: Call Follow Up \r\n7584700143 01/21/2020 10:54:15 AMHELW Comment: Member has paid for November. E-mailed 4711 to review for an OOP deferral for December.", + "userId": 1, + "created": "2020-01-22T08:08:08", + "type": 0 + }, + { + "name": "Comment", + "message": "HELW Comment: TT member and explained the deferral process. Sent docs to myccalerts@yahoo.com while on the phone with the member and walked him through the process. \r\n7584700143 01/20/2020 10:05:12 AM4735 Ltr-File: 22 Day Past Due Letter \r\n7584700143 01/21/2020 11:17:54 AMHELW Comment: 4711 OOP request because it's 2nd req in last 12, this will be 2nd deferral. I approve. \r\n7584700143 02/11/2020 11:20:00 AMNANCY Call: Call Follow Up", + "userId": 1, + "created": "2020-01-21T12:02:09", + "type": 0 + } + ], + "temenosAccount": { + "accountId": 669712, + "accountIdentifier": "7584700143", + "accountNumber": "7584700", + "accountStatus": "Open", + "accountTypeId": 1030, + "accountType": { + "id": 1030, + "description": "Auto New Indirect IL", + "code": "ANIIL" + }, + "activeFlag": true, + "amountLastPaid": 1221.19, + "balance": 77729.14, + "bankruptcyFlag": false, + "branch": "57", + "dueDate": "2020-08-25T00:00:00", + "firstPaymentDueDate": "2020-08-25T00:00:00", + "loanOfficer": "ROSEANN Ginning", + "originalLoanAmount": 75694, + "originalLoanDate": "2018-11-10T00:00:00", + "dqAmount": 15623.3, + "daysDq": 192, + "suffix": "143", + "linkedAccount": "7584700143", + "productType": "46", + "closedDate": null, + "dateLastPaid": "2/20/2020 12:00:00 AM", + "dateFirstDelinquent": "9/24/2020 12:00:00 AM", + "cases": [ + { + "caseId": 609, + "caseNumber": "REPO-00000609", + "caseDescription": "", + "caseStageId": 2000124, + "repoStatus": 200, + "caseStatusId": 33, + "caseTitle": "REPO-00000609", + "caseTypeBasisId": 2, + "caseTypeId": 7, + "closedDate": null, + "createdDate": "2021-04-16T10:46:03.293", + "createdUserId": 6, + "currentStageDate": "2021-04-16T10:46:03.23", + "currentStatusDate": "2021-04-16T10:46:03.23", + "lastReviewDate": null, + "nextReviewDate": null, + "stage1CompletionDate": null, + "stage2CompletionDate": null, + "stage3CompletionDate": null, + "stage4CompletionDate": null, + "stage5CompletionDate": null, + "titleOrdered": true, + "titleOrderedDate": "2021-04-08T00:00:00", + "redemptionExpiredDateIl": null, + "redemptionExpiredDateWi": "2021-04-24T00:00:00", + "customFieldMap": { + "Case Modification Status": "", + "Case Loss Mitigation Stage": "", + "Case Loss Mitigation Type": "", + "Case Loss Mitigation Status": "", + "BRP Hardship Letter": "", + "BRP Bank Statements": "", + "BRP Paycheck Stubs": "", + "BRP Other Income If Applicable": "", + "BRP Tax Returns": "", + "BRP 4506T Form Signed": "", + "BRP Financial Worksheet": "", + "BRP 1st Mortgage Statement": "", + "BRP HOI Declaration Page": "", + "BRP Escrow Authorization Signed": "", + "BRP Additional Information Needed": "", + "Def Fore Financial Filed": "", + "Def Fore Case Number": "", + "Def Fore Date Filed": "", + "Def Fore Property Address is Mailing Address": "", + "Def Fore Property Address if not Mailing Address": "", + "Def Fore Attorney Name": "", + "Def Fore Attorney Number": "", + "Fore Referral Date": "", + "Fore SCRA Checked Date": "", + "Fore RTC Expiration Date": "", + "Fore On Hold Date": "", + "Fore On Hold Reason": "", + "Fore Reinstated Date": "", + "Fore Withdrawn Date": "", + "Fore Withdrawn Reason": "", + "Fore Withdrawn Reason If Other": "", + "Fore Date Last Payment": "", + "Fore Sale Scheduled Date": "", + "Fore Confirmation Scheduled Date": "", + "Fore Confirmation Complete Date": "", + "Fore Sale Result": "", + "Collection Agency": "False", + "Todays Date Case Lvl": "4/8/2021 12:00:00 AM", + "DQ Amount Case Lvl": "1000.0000", + "Performance Pymnts Case Lvl": "250.0000", + "Late Charges Case Lvl": "25.0000", + "Repo Fees Case Lvl": "450.0000", + "Redemption Amount Case Lvl": "1725.0000", + "Balance Due Case Lvl": "", + "Legal Requested State Case Lvl": "", + "Judgement Dropdown Case Lvl": "", + "Attorney Firm Case Lvl": "", + "Documents Sent Date Case Lvl": "", + "Date Sent to Attorney Case Lvl": "", + "Date Served Case Lvl": "", + "Attorney Invoice Number Case Lvl": "", + "WRIT Flag Case Lvl": "False", + "Date Last RTC Letter Sent Case Lvl": "", + "RTC Sent Flag Case Lvl": "False", + "WRIT Date Case Lvl": "", + "Bond Obtained Flag Case Lvl": "False", + "Bond Obtained Date Case Lvl": "", + "Sent to Sheriff Date Case Lvl": "", + "Garnishment Employer Case Lvl": "", + "Financial Disclosure Sent Flag Case Lvl": "False", + "Garnishment Paying Flag Case Lvl": "False", + "Garnishment Review Date Case Lvl": "", + "Post Judgement Rate Case Lvl": "", + "Judgement Property Address 1 Case Lvl": "", + "Judgement Property Address 2 Case Lvl": "", + "Judgement Property Address 3 Case Lvl": "", + "Docket Date 1 Case Lvl": "", + "Docket Date 2 Case Lvl": "", + "Docket Date 3 Case Lvl": "", + "Stip Payment Amount Case Lvl": "", + "Stip Payment Frequency Case Lvl": "", + "Stip Total Amount Case Level": "", + "Legal Closed Reason Case Lvl": "" + }, + "dateRepossessed": "2021-04-09T00:00:00", + "repoTypeId": "2000144", + "repoType": 4, + "dateRepoAssigned": "2021-02-19T00:00:00", + "repoAgentId": "2000069" + } + ], + "customFieldMap": { + "Charge Off Status": "", + "Foreclosure Status - Lookup": "", + "Reason for Charge Off": "", + "Post Charge Off Intentions": "", + "BK Discharged Flag": "False", + "BK Reaffirmed Flag": "False", + "Fraud Suspected Flag": "False", + "Management Review Flag": "False", + "Balance at time of Charge Off": "", + "Date Approved for Charge Off": "", + "Date Approved for Foreclosure": "", + "Date Approved for Legal": "", + "Date Approved for Repo": "", + "Foreclosure Requested Flag": "False", + "Legal Requested Flag": "False", + "Lookup Value 4 - Lookup": "", + "Lookup Value 5 - Lookup": "", + "Repo Requested Flag": "False", + "Status Code 1": "", + "Status Code 2": "", + "Status Code 3": "", + "Status Code 4": "", + "Status Code 5": "", + "External Loan Number": "", + "Product Code": "213177", + "Product Name": "DEALER AUTO NEW - IL", + "CORS Court Name": "", + "Loan Type": "46", + "Original Interest Rate": "4.9900", + "Original Rate Type": "F", + "Current Rate Type": "0", + "Current Rate Term": "", + "Required Payment Amount": "1221.1900", + "Times Late Count": "", + "Times Late 30 Days Count": "6", + "Times Late 60 Days Count": "2", + "Times Late 90 Days Count": "2", + "Troubled Debt Restructure": "False", + "Modification Date": "8/13/2020 12:00:00 AM", + "Modification Count": "0", + "Modification Type": "Defer", + "Financial Condition": "Sufficient collectability at new terms", + "Modification Reason": "Reduction in employment", + "Membership Address 1": "", + "Membership Address 2": "", + "Membership City": "", + "Membership State Code": "", + "Membership Postal Code": "", + "User Status Code 1": "TCIN", + "User Status Code 2": "", + "Intellect Permanent Comments": "POE: A 1 LIMO SERVICE/ Drives Limo 5/19/20 NM TCPA OPT IN 10-01-19 SW 143-file scanned 10/28/19 EMAIL myccalert@yahoo.com", + "PRI Metro 2 Code": "", + "S1 Metro 2 Code": "", + "S2 Metro 2 Code": "", + "PRI Metro 2 Code Description": "", + "S1 Metro 2 Code Description": "", + "S2 Metro 2 Code Description": "", + "PRI Affiliation Description": "", + "S1 Affiliation Description": "", + "S2 Affiliation Description": "", + "CORS Employer Address 1": "", + "CORS Employer Address 2": "", + "CORS Employer City": "", + "CORS Employer State Code": "", + "CORS Employer Postal Code": "", + "CORS Employer Comment": "", + "CORS Loan CORS date": "", + "CORS Demand Agency": "", + "CORS Assigned Agency": "", + "CORS Bankruptcy Case Number": "", + "CORS Bankruptcy File Date": "", + "CORS Bankruptcy Discharged Date": "", + "CORS Consumer Info Indicator": "False", + "CORS Trustee Name": "", + "CORS Bankruptcy Comment": "", + "CORS Motion Date": "", + "CORS Judgement Recordation": "", + "CORS Judgement Amount": "", + "CORS Judgement Status": "", + "CORS Judgement Comment": "", + "CORS Transaction Code": "", + "CORS Payment Amount": "", + "CORS Payment Frequency": "", + "CORS Payment Start Date": "", + "CORS User Assigned Name": "", + "CORS User Assigned Start Date": "", + "CORS User Assigned End Date": "", + "CORS Workflow Entered Date": "", + "CORS Workflow To Do Date": "", + "CORS Workflow Completed By Date": "", + "CORS Workflow User Name": "", + "CORS Workflow Action Description": "", + "CORS Workflow Comment": "", + "Organization Number": "", + "Client Number": "", + "Date High Balance": "", + "External Status Date 1": "", + "External Status 2": "", + "External Status Date 2": "", + "Insurance Code 1": "", + "Insurance Status 1": "", + "Insurance Status 2": "", + "Insurance Code 2": "", + "Insurance Status 3": "", + "Insurance Code 3": "", + "Most Recent Credit Score": "", + "Credit Score Less Recent": "", + "Relationship Flag": "", + "Relationship Number": "", + "S1 Original Credit Union": "", + "S1 Most Recent Credit Score": "", + "S1 Credit Score Less Recent": "", + "Client Name": "", + "Mortgage Insurer": "", + "Last Analyzed Date": "", + "Deferred Principal Balance": "", + "Prepetition Unapplied Balance": "", + "Stipulation Unapplied Balance": "", + "Other Funds Payment Amount": "", + "Assistance Payment Amount": "", + "Reserve Account Payment Amount": "", + "Default Interest Amount": "", + "Last NSF Fee Date": "", + "Last Letter Date": "", + "Other Fee Amount": "", + "Last Late Charge Waived Date": "", + "Last Late Charge Waived Amount": "", + "Next Late Charge Amount": "", + "Times Late LOL Count": "", + "Times Late Last 12 Months Count": "", + "Times Late 120 Days Count": "", + "Times Late 150 Days Count": "", + "Times Late 180 Days Count": "", + "First Payment Due Date": "", + "Maturity Type Description": "", + "Inspection Ordered Date": "", + "Last Inspection Date": "", + "Inspection Received Date": "", + "Current Occupancy Code": "", + "Inspected By": "", + "Property Type Description": "", + "Property Condition Description": "", + "Neighborhood Condition": "", + "Collateral 1 Property Type Code": "", + "Collateral 1 Lein Position": "", + "Bankruptcy Case Number": "", + "Bankruptcy Date Filed": "", + "DNU Bankruptcy Chapter Filed": "", + "Bankruptcy Claim Number": "", + "Bankruptcy Trustee Claim Number 1": "", + "Bankruptcy Trustee Claim Number 2": "", + "Bankruptcy Trustee Claim Number 3": "", + "Bankruptcy Name": "", + "Bankruptcy Event Code": "", + "Bankruptcy Event Legal": "", + "Bankruptcy Event Warning": "", + "Active Bankruptcy Flag": "False", + "Active Bankruptcy Plan Flag": "False", + "Bankruptcy Payment Status Date": "", + "Bankruptcy Milestone Due Date": "", + "Bankruptcy Milestone Completion Date": "", + "Bankruptcy Milestone Scheduled Date": "", + "Bankruptcy Milestone Actual Date": "", + "Bankruptcy Servicer Only": "", + "Contact Promise Date 1": "", + "Contact Promise Amount 1": "", + "Contact Promise Date 2": "", + "Contact Promise Amount 2": "", + "Contact Promise Date 3": "", + "Contact Promise Amount 3": "", + "Contact Reason": "", + "Contact Demeanor": "", + "Contact Outcome": "", + "Contact Permanent Comments": "", + "Legal Fee Amount": "", + "Collateral 1 Seller Name": "", + "Collateral 2 Seller Name": "", + "Collateral 3 Seller Name": "", + "Net Capitalized Cost Amount": "", + "Total Payments Count": "", + "Times Late 90 Plus Days Count": "", + "Late Fee Amount": "", + "Date 22 Day Letter Sent": "", + "Date 32 Day Letter Sent": "", + "Date 60 Day Letter Sent": "", + "Collateral 1 Legal Description": "", + "Collateral 2 Legal Description": "", + "Collateral 3 Legal Description": "", + "Collateral 4 Legal Description": "", + "SD Contact Follow Up Date": "", + "CORS Next Follow Up Date": "", + "Waive Fee Reason DropDown": "", + "Waive Fee Reason Dropdown Spanish": "", + "Case Stages 1": "", + "Dollar Amount": "", + "Case Stages 2": "", + "SCRA Flag": "False", + "TCPA Consent": "7003", + "Request Outcome": "", + "Request Outcome Date": "", + "Offset Request Reason DropDown": "", + "Intellect Next Follow Up Date": "", + "Original Product Type": "", + "Recovery Branch": "57", + "Reason For Repo": "", + "Repo Recovery Address": "", + "Right to Cure Expired": "False", + "RTC Expiration Date": "", + "Repo Type": "", + "Repossession Type": "", + "Secondary Recovery Address": "", + "Redemption Calc WI Perfrmnce Pymnts": "6695.7000", + "Redemption Calc WI Repo Fees": "", + "Redemption Calc WI Total Due": "6695.7000", + "Redemption Calc WI Exp Date": "", + "Redemption Date Current Date": "", + "Redemption Calc WI Expiration Date": "", + "Investor": "", + "Money Field 2": "", + "Money Field 1": "", + "Loan Status": "", + "Redemption Calc IL 30 Percent Amnt Paid": "22708.2000", + "Redemption Calc IL 30 Percent Yes or No": "True", + "Redemption Calc IL Total Due": "0.0000", + "Redemption Calc IL Exp Date": "", + "Current LTV Amount": "", + "Original LTV Amount": "", + "Redemption Calc IL Repo Fees": "", + "Redemption Calc IL Expiration Date": "", + "Repo Agencies": "", + "Bankruptcy Trustee": "", + "Title Ordered": "False", + "Title Received": "False", + "Vehicle ReTitled": "False", + "Title Ordered Date": "", + "ReTitled Date": "", + "Title Received Date": "", + "X Deceased Flag Dont Use": "False", + "CPI Active": "False", + "Branch Location": "", + "Collection Agency": "2000177", + "Consumer Credit Counseling Services Flag": "False", + "Skip Trace Requested": "False", + "Loss Mitigation Status": "", + "Judgement Dropdown": "", + "Claim Type": "", + "Refund Status": "", + "Maintenance Requested": "False", + "BK Chapter": "", + "Settlement": "False", + "Repayment Plan Status": "", + "BK No Reaffirmation Flag": "False", + "test": "", + "Totaled Vehicle": "False", + "Fees Due": "0.0000", + "Original Input Code": "", + "Fraud Status": "", + "CORS Recovery Amt": "", + "CORS Recovery Amount Principal": "", + "Expense Applied Amount": "", + "Interest Applied Amount": "", + "Exp Amp": "", + "Input Code": "L-NI", + "Report Blank": "", + "Totaled Vehicle Notification Date": "", + "Warranty Cancellation Date": "", + "Refunds Requested Date": "", + "Repayment Plan Active": "False", + "Estate Attorney": "", + "Estate Attorney Phone Number": "", + "Personal Representative": "", + "Final Date to File Claim": "", + "Estate Closing Dates": "", + "Date Entered to Probate Finder": "", + "Date Notified Deceased": "", + "Death Notification Type": "", + "Visible Assets": "False", + "CCCS Status": "", + "Consumer Credit Counseling Service Company": "", + "CCCS Amount Approved": "", + "CCCS Decision Date": "", + "Settlement Amount": "", + "Primary Insurance Company": "", + "Primary Insurance Company Phone Number": "", + "Claim Number": "", + "Date of Loss": "", + "Totaled Vehicle Mileage": "", + "Totaled Vehicle Settlement Amount": "", + "Totaled Vehicle Warranty Refund": "", + "Totaled Vehicle Refunds Received Date": "", + "Totaled Vehicle Refunds Received Amount": "", + "GAP Payment Received Date": "", + "Defensive Foreclosure Flag Do Not Use": "False", + "Defensive Foreclosure Flag": "False", + "Collateral Still Exists Flags": "False", + "Bankrupt Collectible Non Filing Borrower Flag": "False", + "Manual Transfer Amount": "", + "Manual Transfer Frequency": "", + "Transfer From Account": "", + "Transfer To Account": "", + "CBR Request": "", + "CBR Date Received": "", + "Additional CBR Information Needed": "", + "CBR Approved": "", + "CBR Yes No Reason": "", + "BRP Sent Flag": "False", + "BRP Sent Date": "", + "Manual Transfer Start Date": "", + "Loss Mitigation Stage": "", + "Loss Mitigation Type": "", + "Date Last RTC Letter Sent": "", + "Skip Trace Phone No1": "", + "Skip Trace Phone No2": "", + "Skip Trace Phone No3": "", + "Skip Trace Phone No4": "", + "Skip Trace Phone No5": "", + "Skip Trace Phone No6": "", + "Skip Trace Phone No7": "", + "Skip Trace Phone No8": "", + "Skip Trace Phone No9": "", + "Skip Trace Phone No10": "", + "Skip Trace Address No1": "", + "Skip Trace Address No2": "", + "Skip Trace Address No3": "", + "Skip Trace Address No4": "", + "Skip Trace Address No5": "", + "Skip Trace Address No6": "", + "Skip Trace Email No1": "", + "Skip Trace Email No2": "", + "Skip Trace Email No3": "", + "Skip Trace Email No4": "", + "Skip Trace Email No5": "", + "Skip Trace POE No1": "", + "Skip Trace POE No2": "", + "Skip Trace Comments": "", + "TLO Basic Flag": "False", + "TLO Comprehensive Flag": "False", + "DRN Flag": "False", + "RDN Flag": "False", + "CarFax Flag": "False", + "Equifax Flag": "False", + "Facebook Flag": "False", + "Skip Trace Date": "", + "GainLoss Value Amount": "", + "GainLoss Value Date": "", + "GainLoss Senior Balance": "", + "GainLoss Senior Name": "", + "GainLoss Value Source": "", + "GainLoss Outstanding Taxes": "", + "GainLoss Marketing Costs": "5000.0000", + "GainLoss 1yr Taxes": "", + "GainLoss Review Date": "", + "GainLoss Marketing Commission": "0.0000", + "GainLoss Total Amount": "-82729.1400", + "Collection Agency Flag": "False", + "Chapter 128 Flag": "False", + "Chapter 128 Case Number": "", + "Chapter 128 Date Filed": "", + "CORS Trustee Number": "", + "CORS Trustee Address": "", + "CORS Trustee Email": "", + "CORS Loan type Description": "", + "Host Code": "", + "CORS Initial Charge Off Balance Amount": "", + "CORS Initial Charge Off Date": "", + "CORS Initial Principal Amount": "", + "CORS Initial Interest Amount": "", + "CORS Initial Expense Amount": "", + "CORS Transfer Date": "", + "CORS Initial Interest Rate Type": "", + "CORS Initial Interest Rate Percent": "", + "CORS Initial Day Count": "", + "CORS Current Principal Amount": "", + "CORS Current Interest Amount": "", + "CORS Current Expense Amount": "", + "CORS Curent Non Reimbursable Expense Amount": "", + "CORS Current Other Amount": "", + "CORS Non Reimbursable Other Amount": "", + "CORS Current Loan Balance Amount": "", + "Attorney Firm": "", + "Legal Requested State": "", + "Garnishment Flag": "False", + "Money Judgement Flag": "False", + "Replevin Judgement Flag": "False", + "Stipulation Flag": "False", + "Summary Judgement Flag": "False", + "Wage Assignment Flag": "False", + "Date No Phone Number Letter Sent": "", + "Fraud Data Type": "", + "Active Fraud CRIF File": "", + "Charge Off Amount Test": "79814.3000", + "CORS Branch Number": "57" + } + }, + "loanDetail" : { + "MemberId": 7584700, + "LoanId": 143, + "ExternalLoanId": 0, + "IndividualId": [ + 1069994 + ], + "Borrowers": [ + { + "IndividualId": 1069994, + "Name": "John d doe", + "Type": "Borrower", + "Address": "2811 S SCOTT ST , DES PLAINES, IL 60018-3981", + "TaxId": "324-82-1394", + "Association": "Individual Contract (Primary)", + "LastAssociationCodeChangedDate": "2018-11-14T00:00:00", + "Metro2ConsumerInformationIndicator": "", + "CoborrowerIsSpouse": false, + "OwnershipPercentage": 0, + "PercentageDescription": "" + } + ], + "LoanType": "Regular Loan", + "Title": "DEALER AUTO TRUCK", + "Alerts": "0", + "Product": "DEALER AUTO NEW - IL", + "ProductCode": 213177, + "Template": "Regular Loan", + "ProductId": 213177, + "ProductDescription": "", + "ProductCategory": "Loan", + "ProductClass": "Regular Loan", + "AccountType": 46, + "Status": "Opened", + "ClosedDate": "0001-01-01T00:00:00", + "Category": "Secured", + "Classification": " ", + "MetroAcctType": "00", + "SMSA": "", + "Officer": "5733", + "OtherSecurity": " ", + "NoteNumber": "1151519", + "LastMaintenance": "0001-01-01T00:00:00", + "WrittenOffDate": "0001-01-01T00:00:00", + "CreditCardNumber": "", + "LastCycleDate": "0001-01-01T00:00:00", + "LegalDescription": "", + "PropertyType": "", + "PurposeCode": "", + "CollateralCode": "", + "RefinanceCount": "0", + "LastRefinanceDate": "0001-01-01T00:00:00", + "LdcNumber": "", + "Messages": "", + "OriginalAmount": 75694, + "OriginationDate": "2018-11-10T00:00:00", + "Balance": 77729.14, + "AvailableBalance": 0, + "Limit": 0, + "EscrowBalance": 0, + "Payoff": 82659.87, + "UnappliedFundsBalance": 0, + "CashAdvanceBalance": 0, + "PurchaseAdvanceBalance": 0, + "ActiveAuthorizationAmount": 0, + "EscrowDividends": 0, + "PledgeType": "", + "MiscCharge1": "$0.00", + "MiscCharge2": "$0.00", + "MiscCharge3": "", + "MiscChargeCode1": "", + "MiscChargeCode2": "", + "MiscChargeCode3": "", + "InterestMemoed": 2085.16, + "InterestAccruedDate": "2020-10-08T00:00:00", + "PaymentInterestDue": 4037.97, + "PayoffInterestDue": 4037.97, + "LateChargeMethod": "% of Sched Pmts", + "LateCharge": 892.76, + "LateChargeDate": "0001-01-01T00:00:00", + "CashAdvance": 0, + "Insurance": "XX", + "LastStatementLateCharges": 0, + "LastStatementMiscFees": 0, + "LastStatementPurchaseAdvances": 0, + "LastStatementCashAdvances": 0, + "LastStatementCashAdvanceFees": 0, + "LastStatementMiscDebits": 0, + "LastStatementTotalPayments": 0, + "LastStatementCreditsPosted": 0, + "LastStatementAccruedInterest": 0, + "LastStatementDate": "0001-01-01T00:00:00", + "LastStatementPurchaseAdvanceBalance": 0, + "LastStatementEndingBalance": 0, + "DelinquentAmount": 17855.2, + "LastStatementMonthlyMinimum": 0, + "LastStatementRequiredDue": 0, + "LastStatementRequiredPayment": 0, + "ScheduledPayment": 2231.9, + "NextDueDate": "2020-08-25T00:00:00", + "PartialPaymentAmount": 0, + "PreviousDate": "2020-02-25T00:00:00", + "PaymentFrequency": "Monthly", + "AlignmentDate": "0001-01-01T00:00:00", + "PaymentMethod": "Counter Item", + "SourceAccount": "", + "ProcessingGroup": "0", + "LoanCouponDate": "0001-01-01T00:00:00", + "RequiredPaymentDue": 2231.9, + "FirstPaymentDate": "2018-12-25T00:00:00", + "AlternatePaymentAmount": 0, + "AlternateBeginDate": "0001-01-01T00:00:00", + "AlternateEndDate": "0001-01-01T00:00:00", + "PaymentSkips": 0, + "FinalPaymentAmount": 1221.19, + "FinalPaymentDate": "2025-07-25T00:00:00", + "CycleAmount": 0, + "VariableRatePaymentChange": "Default Product", + "VariableRateCode": "F", + "MinimumDue": 0, + "FrequencyPayment": 0, + "EscrowPayment": 0, + "PrincipalAndInterestPayment": 0, + "PaymentLoanDefinitionNumber": "", + "RateLoanDefinitionNumber": "", + "VacationWeeks": 0, + "PayrollRepaidWeeklyPaymentCount": 0, + "BaseRate": 0, + "TieredRateAdj": 0, + "ManualRateAdj": 4.99, + "Rate": 4.99, + "ManualRate": 0, + "APR": 4.99, + "OriginalInterestRate": 4.99, + "AlternateInterestRate": 0, + "LastRateChange": "2018-11-10T00:00:00", + "RealEstateMargin": 0, + "Amortization": "P & I Amt", + "AmortizationTerm": 0, + "MonthlyTerm": 72, + "NumberOfPayments": 72, + "InterestYTD": 0, + "InterestPYTD": 696.99, + "InterestDaily": 10.64, + "PrincipalYTD": 0, + "PrincipalPYTD": 1623.27, + "LateChargeYTD": 0, + "LateChargePYTD": 122.12, + "PaymentHistory": "D00002100432", + "LastPaymentDue": "2021-03-25T00:00:00", + "PaymentsPastDue": 8, + "DaysPastDue": 228, + "MonthsPastDue": 7, + "CurrentStatementLateCharges": 0, + "CurrentStatementMiscFees": 0, + "CurrentStatementPurchaseAdvances": 0, + "CurrentStatementCashAdvances": 0, + "CurrentStatementCashAdvanceFees": 0, + "CurrentStatementMiscDebits": 0, + "CurrentStatementTotalPayments": 0, + "CurrentStatementTotalCredits": 0, + "DelinquentPaymentDueDate": "0001-01-01T00:00:00", + "IsInactive": false, + "StatementFrequency": "Default:Q", + "AppraisedValue": 0, + "LocCycleDay": 0, + "IgnorePledge": false, + "OpenEndPlan": false, + "OpenEndCategory": "None", + "PointsPaid": 0, + "CurtailmentAmount": 0, + "CurtailmentDate": "0001-01-01T00:00:00", + "InsuranceExpirationDate": "2024-11-25T00:00:00", + "LifeInsuranceMI": "XX", + "DisabilityInsuranceMI": " ", + "LifeActivityInsuranceCode": " ", + "DisabilityActivityInsuranceCode": " ", + "LoanCoupons": true, + "PaidbyGrace": false, + "EscrowAccount": "", + "EscrowInterestPaid": false, + "NextPaymentAdjustmentDate": "0001-01-01T00:00:00", + "EffectivePayment": 2231.9, + "InterestRate": 4.99, + "LastPaymentDate": "2020-02-20T00:00:00", + "LastPurchaseDate": "0001-01-01T00:00:00", + "LastCashAdvanceDate": "0001-01-01T00:00:00", + "BlockCode": "", + "ReclassCode": "", + "OutstandingAuthCount": 0, + "OutstandingAuthAmount": 0, + "InterestType": "Fixed", + "AlternateLoanNumber": "", + "ArmIndex": 0, + "DeductionOption": "", + "DelinquentPaymentSkips": false, + "FirstPayment": false, + "InterestDue": 2085.16, + "LoanLevelSkips": false, + "PaymentReduction": false, + "WaiveLateCharge": false, + "ExcessPaymentTargetAccountId": 0, + "ExcessPaymentMemberId": 0, + "CustRate": false, + "IntRateMethod": "", + "Margin": 0, + "Index": "", + "RndFactPct": 0, + "RndFactOpt": "", + "IntRateCeiling": 0, + "IntRateFloor": 0, + "MaxDnRateChgLife": 0, + "MaxUpRateChgLife": 0, + "MaxDnRateChgPeriod": 0, + "MaxUpRateChgPeriod": 0, + "MinDnRateChgPeriod": 0, + "MinUpRateChgPeriod": 0, + "PmtAdjPeriod": 0, + "DaysPriorToPeriodicRateAdj": 0, + "DaysPriorToInitialRateAdjustment": 0, + "FirstAdjustmentIsEstimate": false, + "InitialAnalysisEstimateDate": "0001-01-01T00:00:00", + "EstimatePerformed": "", + "BalloonTerm": 0, + "PledgeTypeDescription": "", + "SystemApproved": "Yes", + "VINList": [ + "5LMJJ3LT0KEL01231" + ], + "MortgageLoanOriginator": 0, + "LastPaymentPrincipal": 850.6, + "LastPaymentInterest": 309.53, + "LastPaymentFees": 0, + "LastPaymentLateCharges": 61.06, + "LastPaymentEscrowImpound": null, + "LastPaymentCurtailment": null, + "LastPaymentTotal": 1221.19, + "TransferDay": 0, + "SourceMember": 0, + "AdjustPurchaseAccrual": false, + "AnnualFee": false, + "AnnualFeeDate": "0001-01-01T00:00:00", + "BalaceLimit": 0, + "CloseOnZero": false, + "DrawDate": "0001-01-01T00:00:00", + "Form1098Option": "N", + "MethodADelinquency": false, + "NumberofSkips": 0, + "OverlimitAmount": 0, + "OverlimitDate": "0001-01-01T00:00:00", + "PurchaseAdvBalance": 0, + "SkipDate": "0001-01-01T00:00:00", + "ToBeDelinquent": false, + "WaiveDelinquencyNotice": false, + "WaiveBillingNotice": false, + "WaiveInterest": false, + "LastStatementMinimumPayment": 0, + "LastStatementCycleRequiredPayment": 0, + "ExemptNonResident": false, + "YTDNonresidentWithholding": null, + "PYTDNonresidentWithholding": null, + "InCollection": "OUT", + "UniversalLoanId": "", + "RateLockDate": "0001-01-01T00:00:00", + "ActiveStopPays": "", + "ErrorMessage": [] + }, + "memberDetail" : { + "MemberId": 7584700, + "MemberName": "John d doe", + "PrimaryIndividualId": 1069994, + "MemberType": "UNITED WAY", + "Affiliation": "", + "MemberSince": "2018-11-14T00:00:00", + "Miscellaneous1": "", + "Miscellaneous2": "", + "OriginalOpenBranch": "INDIRECT LENDING DEPT", + "WithholdingCode": "", + "ExpeditedFunds": 0, + "ExpeditedFundsDate": "0001-01-01T00:00:00", + "AccessLevel": 1, + "StandardStatementCycle": 1, + "StandardStatementCode": "", + "StandardStatementMethod": "Electronic", + "CATFeeCounter": 0, + "CATFeeDate": "0001-01-01T00:00:00", + "CreditCardStatementCycle": 1, + "CreditCardStatementCode": "", + "CreditCardStatementMethod": "Hold", + "AccountCount": 1, + "AccountBalance": 5, + "LoanCount": 1, + "LoanBalance": 77729.14, + "LoansDelinquentCount": 1, + "LoansDelinquent": 77729.14, + "LoansWrittenOffCount": 0, + "LoansWrittenOff": 0, + "LoansInCollectionCount": 0, + "LoansInCollection": 0, + "Password": "", + "PinLock": "Unlock", + "BranchId": 57, + "RelationshipPricingLevel": 0, + "RelationshipPricingLevelPermanent": "No", + "RelationshipPricingDescription": "", + "PreviousRelationshipPricingLevel": 0, + "LastRelationshipPricingLevelAnalysisDate": "", + "LastRelationshipPricingLevelChangeDate": "", + "InhibitActivity": "No", + "WrittenOffLoan": "No", + "LoanInCollection": "No", + "PurgeMembership": "Yes", + "Address": { + "AddressId": 3675505, + "Line1": "2811 S SCOTT ST", + "Line2": "", + "Line3": "", + "City": "DES PLAINES", + "State": "IL", + "ZipCode": "60018-3981", + "Country": "US", + "CountyName": "", + "AddressType": "", + "IsPrimary": true, + "IsInternational": false, + "AddressVerification": 2811, + "Occupancy": "", + "StartDate": "0001-01-01T00:00:00", + "EndDate": "0001-01-01T00:00:00", + "LongAddress1": "2811 S SCOTT ST", + "LongAddress2": "", + "Membership": [], + "CoBorrower": [], + "UseAlternateAsOf": "0001-01-01T00:00:00", + "RestorePrimaryAsOf": "0001-01-01T00:00:00", + "AlternateType": "", + "Comments": "", + "Met2AddressIndicator": "", + "UspsVerified": false, + "AddressMatchStatus": null, + "IsHSA": false + } + }, + "repoAccount": { + "repoId": 5011, + "accountNo": "7584700143", + "status": "REPO", + "memberNo": 7584700, + "loanNo": 143, + "accountTypeCode": "ANIIL", + "origAccountTypeCode": "ANIIL", + "branch": 57, + "collector": "ROSEANN Ginning", + "balance": 77729.14, + "dueToPayDate": "2020-08-25T00:00:00", + "o4RDate": "2021-04-16T10:46:03.293", + "dateFirstDelinquent": "2020-02-20T00:00:00", + "delinquentAmount": 15623.3, + "daysDelinquent": 192, + "paidSkipAmount": null, + "subStatus": "", + "requiredPaymentAmount": 15623.3, + "currentDelinquentAmount": 15623.3, + "lstPmtAmt": 1221.19, + "origAmount": 75694, + "lastPaymentDate": "2020-02-20T00:00:00", + "dateFirstIntellect": "2021-04-16T10:46:03.293", + "primaryIndividualId": "1069994", + "bankruptcy": "False", + "manualRedemptionDate": null, + "redemptionExpiredDate": null, + "borrowers": [ + { + "repoId": 5011, + "individualId": "1069994", + "ownershipType": 6, + "individualName": "John d doe" + } + ], + "collaterals": [ + { + "collateralId": 5196, + "repoId": 5011, + "vin": "5LMJJ3LT0KEL01231", + "make": "Lincoln", + "model": "Navigator ", + "year": 2019, + "description": "2019 Lincoln Navigator", + "vehicleType": null, + "bodyStyle": "", + "inoperable": null, + "collateralTypeId": null, + "retitledInLandmarkName": null, + "refCollateralId": "752135", + "repoCompanySelections": [ + { + "id": 5768, + "collateralId": 5196, + "repoType": 4, + "repoCompanyId": 5, + "repoCompanyAssignmentDate": "2021-02-19T00:00:00", + "dateRepoed": "2021-04-09T00:00:00", + "dateTimeCreated": "2021-04-16T10:12:22.013" + } + ] + } + ], + "repoStatusChanges": [ + { + "id": 17285, + "repoId": 5011, + "statusFrom": "None", + "statusTo": "REPO", + "changedBy": "System", + "changedDate": "2021-04-16T10:07:53.117" + } + ], + "refundStatus": null, + "dateClosed": null, + "referenceId": 669712, + "referenceCaseId": 609, + "referenceStatus": "Open", + "accountLastProcessed": "2021-04-16T10:12:22.007", + "writtenOffDate": null + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/Processor/written-off-account-2.json b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/Processor/written-off-account-2.json new file mode 100644 index 0000000..c98a95e --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/Processor/written-off-account-2.json @@ -0,0 +1,3861 @@ +{ + "repoLetters": [ + { + "ActionCode": "700", + "Description": "RTC-Illinois", + "DaysToWait": 15, + "WhenLetterIsSent": "BeforeO4R", + "LetterDescription": "None" + }, + { + "ActionCode": "701", + "Description": "Right to Reinstate/Redeem-Illinois", + "DaysToWait": 22, + "WhenLetterIsSent": "AfterO4R", + "LetterDescription": "Right to Reinstate/Redeem" + }, + { + "ActionCode": "702", + "Description": "Affidavit of Defense-Illinois", + "DaysToWait": 22, + "WhenLetterIsSent": "AfterO4R", + "LetterDescription": "None" + }, + { + "ActionCode": "703", + "Description": "Notice of Plan to Sell-Illinois", + "DaysToWait": 22, + "WhenLetterIsSent": "AfterO4R", + "LetterDescription": "None" + }, + { + "ActionCode": "704", + "Description": "Repo: Surplus-Deficiency Notice", + "DaysToWait": 0, + "WhenLetterIsSent": "AfterSale", + "LetterDescription": "None" + }, + { + "ActionCode": "ILLSU", + "Description": "ILLINOIS SURRENDER", + "DaysToWait": 0, + "WhenLetterIsSent": "BeforeO4R", + "LetterDescription": "Surrender (Illinois)" + }, + { + "ActionCode": "LTR34", + "Description": "Repo-Notice of Repossession", + "DaysToWait": 15, + "WhenLetterIsSent": "AfterO4R", + "LetterDescription": "Notice of Repossession" + }, + { + "ActionCode": "LTR35", + "Description": "WI Repo-Notice of Sale", + "DaysToWait": 15, + "WhenLetterIsSent": "AfterO4R", + "LetterDescription": "Notice of Plan to Sell - WI" + }, + { + "ActionCode": "LTR36", + "Description": "WI Repo-Sale of Collateral Notice", + "DaysToWait": 15, + "WhenLetterIsSent": "AfterO4R", + "LetterDescription": "None" + }, + { + "ActionCode": "RTC", + "Description": "Notice to repossess/prior expired RTC", + "DaysToWait": 0, + "WhenLetterIsSent": "BeforeO4R", + "LetterDescription": "None" + }, + { + "ActionCode": "RTC, 1", + "Description": "RTC Non Auto & Non Cycle", + "DaysToWait": 15, + "WhenLetterIsSent": "BeforeO4R", + "LetterDescription": "WI Unsecured RTC" + }, + { + "ActionCode": "RTC, 3", + "Description": "RTC-AUTO LOANS-WI", + "DaysToWait": 15, + "WhenLetterIsSent": "BeforeO4R", + "LetterDescription": "WI Auto RTC" + }, + { + "ActionCode": "RTC2", + "Description": "RTC New Law", + "DaysToWait": 15, + "WhenLetterIsSent": "BeforeO4R", + "LetterDescription": "None" + }, + { + "ActionCode": "RTCSP", + "Description": "SPANISH RTC WI AUTO LOANS", + "DaysToWait": 15, + "WhenLetterIsSent": "BeforeO4R", + "LetterDescription": "None" + }, + { + "ActionCode": "VOL", + "Description": "Wisconsin Surrender", + "DaysToWait": 0, + "WhenLetterIsSent": "BeforeO4R", + "LetterDescription": "Surrender (Wisconsin)" + } + ], + "coreTransactions": [ + { + "postingDate": "2020-04-09T11:05:43", + "effectiveDate": "2020-04-09T00:00:00", + "operatorId": 4739, + "drawerName": "", + "drawerBranch": "", + "transactionType": "Write Off Held", + "transactionNumber": 289, + "transactionTypeCode": "HD ", + "transactionAmount": 0, + "balance": 21036.49, + "principalAmount": 0, + "interest": 0, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 629934394, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "*Held Amount= $21,036.49" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2020-04-09T11:05:36", + "effectiveDate": "2020-04-09T00:00:00", + "operatorId": 4739, + "drawerName": "", + "drawerBranch": "", + "transactionType": "LOAN WRITTEN OFF", + "transactionNumber": 260, + "transactionTypeCode": "WOFF", + "transactionAmount": 21036.49, + "balance": 0, + "principalAmount": -21036.49, + "interest": 0, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 629934357, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "719-1", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "LOANS WRITTEN OFF" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2020-03-21T00:00:00", + "effectiveDate": "2020-03-21T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ADJ NON-CASH", + "transactionNumber": 289, + "transactionTypeCode": "ADNC", + "transactionAmount": 0, + "balance": 21036.49, + "principalAmount": 0, + "interest": 0, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 626176545, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "LATE CHARGE ASSESSED: 10.00, LATE DATE: 03-10-20" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2020-02-21T00:00:00", + "effectiveDate": "2020-02-21T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ADJ NON-CASH", + "transactionNumber": 289, + "transactionTypeCode": "ADNC", + "transactionAmount": 0, + "balance": 21036.49, + "principalAmount": 0, + "interest": 0, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 619191348, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "LATE CHARGE ASSESSED: 10.00, LATE DATE: 02-10-20" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2020-02-11T15:54:04", + "effectiveDate": "2020-02-11T00:00:00", + "operatorId": 4768, + "drawerName": "", + "drawerBranch": "", + "transactionType": "LOAN ADVANCE", + "transactionNumber": 230, + "transactionTypeCode": "C ", + "transactionAmount": 200, + "balance": 21036.49, + "principalAmount": 200, + "interest": 0, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 617139365, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "6830-5000", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "WWR LAW INV 1/31" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2020-01-22T00:00:00", + "effectiveDate": "2020-01-21T00:00:00", + "operatorId": 6051, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ELECTRONIC LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "PR ", + "transactionAmount": 100, + "balance": 20836.49, + "principalAmount": 0, + "interest": 100, + "escrowAmount": 0, + "processingGroup": "111", + "batchControlId": 3784, + "historyItemId": 612441738, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "LandmarkCU TRANSFER 012120" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2020-01-21T00:00:00", + "effectiveDate": "2020-01-21T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ADJ NON-CASH", + "transactionNumber": 289, + "transactionTypeCode": "ADNC", + "transactionAmount": 0, + "balance": 20836.49, + "principalAmount": 0, + "interest": 0, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 612158578, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "LATE CHARGE ASSESSED: 10.00, LATE DATE: 01-10-20" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-12-23T00:00:00", + "effectiveDate": "2019-12-20T00:00:00", + "operatorId": 6051, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ELECTRONIC LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "PR ", + "transactionAmount": 100, + "balance": 20836.49, + "principalAmount": 0, + "interest": 100, + "escrowAmount": 0, + "processingGroup": "111", + "batchControlId": 3395, + "historyItemId": 605989967, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "LandmarkCU TRANSFER 122019" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-12-21T00:00:00", + "effectiveDate": "2019-12-21T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ADJ NON-CASH", + "transactionNumber": 289, + "transactionTypeCode": "ADNC", + "transactionAmount": 0, + "balance": 20836.49, + "principalAmount": 0, + "interest": 0, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 605597300, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "LATE CHARGE ASSESSED: 10.00, LATE DATE: 12-10-19" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-12-19T00:00:00", + "effectiveDate": "2019-12-19T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "FLEXIBLE LOAN CHANGE", + "transactionNumber": 289, + "transactionTypeCode": "MAN ", + "transactionAmount": 0, + "balance": 20836.49, + "principalAmount": 0, + "interest": 0, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 605030510, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": " OLD PMT=369.42 NEW PMT=571.04 Policy #AKH0003300" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-12-19T00:00:00", + "effectiveDate": "2019-12-19T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "FLEXIBLE LOAN CHANGE", + "transactionNumber": 289, + "transactionTypeCode": "MAN ", + "transactionAmount": 0, + "balance": 20836.49, + "principalAmount": 0, + "interest": 0, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 605030509, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": " OLD PMT=524.14 NEW PMT=369.42 Policy #MQK0248241" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-12-18T00:00:00", + "effectiveDate": "2019-12-18T00:00:00", + "operatorId": 6056, + "drawerName": "", + "drawerBranch": "", + "transactionType": "LOAN ADVANCE", + "transactionNumber": 230, + "transactionTypeCode": "C ", + "transactionAmount": 2342, + "balance": 20836.49, + "principalAmount": 2342, + "interest": 0, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 3341, + "historyItemId": 604993699, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "Policy #AKH0003300" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-11-21T00:00:00", + "effectiveDate": "2019-11-21T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ADJ NON-CASH", + "transactionNumber": 289, + "transactionTypeCode": "ADNC", + "transactionAmount": 0, + "balance": 18494.49, + "principalAmount": 0, + "interest": 0, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 598585409, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "LATE CHARGE ASSESSED: 10.00, LATE DATE: 11-10-19" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-10-22T00:00:00", + "effectiveDate": "2019-10-22T00:00:00", + "operatorId": 6003, + "drawerName": "", + "drawerBranch": "", + "transactionType": "LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "JNC ", + "transactionAmount": 525, + "balance": 18494.49, + "principalAmount": -380.47, + "interest": 134.53, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 592090830, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "799-500", + "totalFee": 10, + "lateCharge": "10.00", + "historyDetails": { + "transactionDescription": "SBI 1022 1956 037072 4636 WATT AVENUE NORTH HIGHLANCA" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-10-21T00:00:00", + "effectiveDate": "2019-10-21T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ADJ NON-CASH", + "transactionNumber": 289, + "transactionTypeCode": "ADNC", + "transactionAmount": 0, + "balance": 18874.96, + "principalAmount": 0, + "interest": 0, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 591538676, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "LATE CHARGE ASSESSED: 10.00, LATE DATE: 10-10-19" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-09-21T00:00:00", + "effectiveDate": "2019-09-21T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ADJ NON-CASH", + "transactionNumber": 289, + "transactionTypeCode": "ADNC", + "transactionAmount": 0, + "balance": 18874.96, + "principalAmount": 0, + "interest": 0, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 585054575, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "LATE CHARGE ASSESSED: 10.00, LATE DATE: 09-10-19" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-09-09T00:00:00", + "effectiveDate": "2019-09-09T00:00:00", + "operatorId": 6003, + "drawerName": "", + "drawerBranch": "", + "transactionType": "LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "JNC ", + "transactionAmount": 825, + "balance": 18874.96, + "principalAmount": -614.4, + "interest": 190.6, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 582622752, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "799-500", + "totalFee": 20, + "lateCharge": "20.00", + "historyDetails": { + "transactionDescription": "SBI 0909 1749 598577 2901 K STREET, SUITE 10 SACRAMENTO CA" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-08-21T00:00:00", + "effectiveDate": "2019-08-21T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ADJ NON-CASH", + "transactionNumber": 289, + "transactionTypeCode": "ADNC", + "transactionAmount": 0, + "balance": 19489.36, + "principalAmount": 0, + "interest": 0, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 578077578, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "LATE CHARGE ASSESSED: 10.00, LATE DATE: 08-10-19" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-07-22T00:00:00", + "effectiveDate": "2019-07-22T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ADJ NON-CASH", + "transactionNumber": 289, + "transactionTypeCode": "ADNC", + "transactionAmount": 0, + "balance": 19489.36, + "principalAmount": 0, + "interest": 0, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 571237384, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "LATE CHARGE ASSESSED: 10.00, PARTIAL PMT: 224.14, LATE DATE: 07-10-19" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-07-15T00:00:00", + "effectiveDate": "2019-07-12T00:00:00", + "operatorId": 6051, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ELECTRONIC LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "PR ", + "transactionAmount": 224.14, + "balance": 19489.36, + "principalAmount": -52.47, + "interest": 171.67, + "escrowAmount": 0, + "processingGroup": "111", + "batchControlId": 1097, + "historyItemId": 569942848, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "LandmarkCU TRANSFER 071219" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-06-21T00:00:00", + "effectiveDate": "2019-06-21T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ADJ NON-CASH", + "transactionNumber": 289, + "transactionTypeCode": "ADNC", + "transactionAmount": 0, + "balance": 19541.83, + "principalAmount": 0, + "interest": 0, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 564588627, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "LATE CHARGE ASSESSED: 10.00, LATE DATE: 06-10-19" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-05-21T00:00:00", + "effectiveDate": "2019-05-20T00:00:00", + "operatorId": 6051, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ELECTRONIC LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "PR ", + "transactionAmount": 524.14, + "balance": 19541.83, + "principalAmount": -405.03, + "interest": 109.11, + "escrowAmount": 0, + "processingGroup": "111", + "batchControlId": 355, + "historyItemId": 557782908, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 10, + "lateCharge": "10.00", + "historyDetails": { + "transactionDescription": "LandmarkCU TRANSFER 052019" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-05-21T00:00:00", + "effectiveDate": "2019-05-21T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ADJ NON-CASH", + "transactionNumber": 289, + "transactionTypeCode": "ADNC", + "transactionAmount": 0, + "balance": 19946.86, + "principalAmount": 0, + "interest": 0, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 557745230, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "LATE CHARGE ASSESSED: 10.00, LATE DATE: 05-10-19" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-04-22T00:00:00", + "effectiveDate": "2019-04-22T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ADJ NON-CASH", + "transactionNumber": 289, + "transactionTypeCode": "ADNC", + "transactionAmount": 0, + "balance": 19946.86, + "principalAmount": 0, + "interest": 0, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 551168067, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "LATE CHARGE ASSESSED: 10.00, LATE DATE: 04-10-19" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-04-18T00:00:00", + "effectiveDate": "2019-04-17T00:00:00", + "operatorId": 6051, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ELECTRONIC LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "PR ", + "transactionAmount": 224, + "balance": 19946.86, + "principalAmount": -160.68, + "interest": 63.32, + "escrowAmount": 0, + "processingGroup": "111", + "batchControlId": 9913, + "historyItemId": 550524396, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "LandmarkCU TRANSFER 041719" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-04-01T00:00:00", + "effectiveDate": "2019-03-29T00:00:00", + "operatorId": 6051, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ELECTRONIC LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "PR ", + "transactionAmount": 300, + "balance": 20107.54, + "principalAmount": -263.13, + "interest": 27.01, + "escrowAmount": 0, + "processingGroup": "111", + "batchControlId": 9666, + "historyItemId": 546833269, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 9.86, + "lateCharge": "9.86", + "historyDetails": { + "transactionDescription": "LandmarkCU TRANSFER 032919" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-03-22T00:00:00", + "effectiveDate": "2019-03-21T00:00:00", + "operatorId": 6051, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ELECTRONIC LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "PR ", + "transactionAmount": 200.13, + "balance": 20370.67, + "principalAmount": -95.01, + "interest": 94.98, + "escrowAmount": 0, + "processingGroup": "111", + "batchControlId": 9525, + "historyItemId": 544537442, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 10.14, + "lateCharge": "10.14", + "historyDetails": { + "transactionDescription": "LandmarkCU TRANSFER 032119" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-03-21T00:00:00", + "effectiveDate": "2019-03-21T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ADJ NON-CASH", + "transactionNumber": 289, + "transactionTypeCode": "ADNC", + "transactionAmount": 0, + "balance": 20465.68, + "principalAmount": 0, + "interest": 0, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 544262956, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "LATE CHARGE ASSESSED: 10.00, LATE DATE: 03-10-19" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-03-08T00:00:00", + "effectiveDate": "2019-03-08T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ADJ NON-CASH", + "transactionNumber": 289, + "transactionTypeCode": "ADNC", + "transactionAmount": 0, + "balance": 20465.68, + "principalAmount": 0, + "interest": 0, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 541596916, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "LATE CHARGE ASSESSED: 10.00, PARTIAL PMT: 324.15, LATE DATE: 02-10-19" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-03-07T10:30:24", + "effectiveDate": "2019-03-07T00:00:00", + "operatorId": 4707, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ADJ NON-CASH", + "transactionNumber": 289, + "transactionTypeCode": "ADNC", + "transactionAmount": 0, + "balance": 20465.68, + "principalAmount": 0, + "interest": 0, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 541431387, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-02-22T00:00:00", + "effectiveDate": "2019-02-21T00:00:00", + "operatorId": 6051, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ELECTRONIC LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "PR ", + "transactionAmount": 324, + "balance": 20465.68, + "principalAmount": -259.04, + "interest": 54.96, + "escrowAmount": 0, + "processingGroup": "111", + "batchControlId": 9129, + "historyItemId": 538307533, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 10, + "lateCharge": "10.00", + "historyDetails": { + "transactionDescription": "LandmarkCU TRANSFER 022119" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-02-21T00:00:00", + "effectiveDate": "2019-02-21T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ADJ NON-CASH", + "transactionNumber": 289, + "transactionTypeCode": "ADNC", + "transactionAmount": 0, + "balance": 20724.72, + "principalAmount": 0, + "interest": 0, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 538028548, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "LATE CHARGE ASSESSED: 10.00, PARTIAL PMT: 0.15, LATE DATE: 02-10-19" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-02-06T00:00:00", + "effectiveDate": "2019-02-05T00:00:00", + "operatorId": 6051, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ELECTRONIC LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "PR ", + "transactionAmount": 446, + "balance": 20724.72, + "principalAmount": -395.9, + "interest": 49.01, + "escrowAmount": 0, + "processingGroup": "111", + "batchControlId": 8912, + "historyItemId": 535132140, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 1.09, + "lateCharge": "1.09", + "historyDetails": { + "transactionDescription": "LandmarkCU TRANSFER 020519" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-02-04T15:57:47", + "effectiveDate": "2019-02-04T00:00:00", + "operatorId": 4755, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ADJ NON-CASH", + "transactionNumber": 289, + "transactionTypeCode": "ADNC", + "transactionAmount": 0, + "balance": 21120.62, + "principalAmount": 0, + "interest": 0, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 534831861, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-01-23T00:00:00", + "effectiveDate": "2019-01-22T00:00:00", + "operatorId": 6051, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ELECTRONIC LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "PR ", + "transactionAmount": 100.14, + "balance": 21120.62, + "principalAmount": -46.61, + "interest": 53.53, + "escrowAmount": 0, + "processingGroup": "111", + "batchControlId": 8719, + "historyItemId": 532194321, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "LandmarkCU TRANSFER 012219" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-01-21T00:00:00", + "effectiveDate": "2019-01-21T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ADJ NON-CASH", + "transactionNumber": 289, + "transactionTypeCode": "ADNC", + "transactionAmount": 0, + "balance": 21167.23, + "principalAmount": 0, + "interest": 0, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 531704638, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "LATE CHARGE ASSESSED: 1.09, PARTIAL PMT: 502.29, LATE DATE: 01-10-19" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-01-18T00:00:00", + "effectiveDate": "2019-01-18T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "FLEXIBLE LOAN CHANGE", + "transactionNumber": 289, + "transactionTypeCode": "MAN ", + "transactionAmount": 0, + "balance": 21167.23, + "principalAmount": 0, + "interest": 0, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 531272278, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": " OLD PMT=369.42 NEW PMT=524.14 Policy #MQK0248241" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-01-18T00:00:00", + "effectiveDate": "2019-01-18T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "FLEXIBLE LOAN CHANGE", + "transactionNumber": 289, + "transactionTypeCode": "MAN ", + "transactionAmount": 0, + "balance": 21167.23, + "principalAmount": 0, + "interest": 0, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 531272277, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": " OLD PMT=586.45 NEW PMT=369.42 Policy #MQK0248241" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-01-16T00:00:00", + "effectiveDate": "2019-01-16T00:00:00", + "operatorId": 6056, + "drawerName": "", + "drawerBranch": "", + "transactionType": "CREDIT ADJUSTMENT", + "transactionNumber": 225, + "transactionTypeCode": " ", + "transactionAmount": 605, + "balance": 21167.23, + "principalAmount": -605, + "interest": 0, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 8641, + "historyItemId": 531010903, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "Policy #MQK0248241" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-01-08T00:00:00", + "effectiveDate": "2019-01-07T00:00:00", + "operatorId": 6051, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ELECTRONIC LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "PR ", + "transactionAmount": 500, + "balance": 21772.23, + "principalAmount": -401.79, + "interest": 88.21, + "escrowAmount": 0, + "processingGroup": "111", + "batchControlId": 8529, + "historyItemId": 529434852, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 10, + "lateCharge": "10.00", + "historyDetails": { + "transactionDescription": "LandmarkCU TRANSFER 010719" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2018-12-17T00:00:00", + "effectiveDate": "2018-12-14T00:00:00", + "operatorId": 6051, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ELECTRONIC LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "PR ", + "transactionAmount": 586.45, + "balance": 22174.02, + "principalAmount": -492.52, + "interest": 93.93, + "escrowAmount": 0, + "processingGroup": "111", + "batchControlId": 8240, + "historyItemId": 524806573, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "LandmarkCU TRANSFER 121418" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2018-11-21T00:00:00", + "effectiveDate": "2018-11-21T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ADJ NON-CASH", + "transactionNumber": 289, + "transactionTypeCode": "ADNC", + "transactionAmount": 0, + "balance": 22666.54, + "principalAmount": 0, + "interest": 0, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 519311560, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "LATE CHARGE ASSESSED: 10.00, PARTIAL PMT: 2.29, LATE DATE: 11-10-18" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2018-11-20T00:00:00", + "effectiveDate": "2018-11-19T00:00:00", + "operatorId": 6051, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ELECTRONIC LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "PR ", + "transactionAmount": 217, + "balance": 22666.54, + "principalAmount": -122.57, + "interest": 94.43, + "escrowAmount": 0, + "processingGroup": "111", + "batchControlId": 7866, + "historyItemId": 519128304, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "LandmarkCU TRANSFER 111918" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2018-10-25T00:00:00", + "effectiveDate": "2018-10-25T00:00:00", + "operatorId": 6003, + "drawerName": "", + "drawerBranch": "", + "transactionType": "LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "JNC ", + "transactionAmount": 370, + "balance": 22789.11, + "principalAmount": -262.69, + "interest": 97.31, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 513834905, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "799-500", + "totalFee": 10, + "lateCharge": "10.00", + "historyDetails": { + "transactionDescription": "SBI 1025 1515 843333 1335 J STREET SACRAMENTO CA" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2018-10-22T00:00:00", + "effectiveDate": "2018-10-22T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ADJ NON-CASH", + "transactionNumber": 289, + "transactionTypeCode": "ADNC", + "transactionAmount": 0, + "balance": 23051.8, + "principalAmount": 0, + "interest": 0, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 512995812, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "LATE CHARGE ASSESSED: 10.00, PARTIAL PMT: 1.74, LATE DATE: 10-10-18" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2018-10-13T00:00:00", + "effectiveDate": "2018-10-13T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "FLEXIBLE LOAN CHANGE", + "transactionNumber": 289, + "transactionTypeCode": "MAN ", + "transactionAmount": 0, + "balance": 23051.8, + "principalAmount": 0, + "interest": 0, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 511429768, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": " OLD PMT=369.42 NEW PMT=586.45 Policy #MQK0248241" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2018-10-12T00:00:00", + "effectiveDate": "2018-10-12T00:00:00", + "operatorId": 6056, + "drawerName": "", + "drawerBranch": "", + "transactionType": "LOAN ADVANCE", + "transactionNumber": 230, + "transactionTypeCode": "C ", + "transactionAmount": 2521, + "balance": 23051.8, + "principalAmount": 2521, + "interest": 0, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 7328, + "historyItemId": 511319443, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "Policy #MQK0248241" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2018-09-28T00:00:00", + "effectiveDate": "2018-09-28T00:00:00", + "operatorId": 6003, + "drawerName": "", + "drawerBranch": "", + "transactionType": "LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "JNC ", + "transactionAmount": 370, + "balance": 20530.8, + "principalAmount": -215.57, + "interest": 144.43, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 508276237, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "799-500", + "totalFee": 10, + "lateCharge": "10.00", + "historyDetails": { + "transactionDescription": "SBI 0928 1530 094298 1335 J STREET SACRAMENTO CA" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2018-09-21T00:00:00", + "effectiveDate": "2018-09-21T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ADJ NON-CASH", + "transactionNumber": 289, + "transactionTypeCode": "ADNC", + "transactionAmount": 0, + "balance": 20746.37, + "principalAmount": 0, + "interest": 0, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 506806766, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "LATE CHARGE ASSESSED: 10.00, PARTIAL PMT: 1.16, LATE DATE: 09-10-18" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2018-08-17T00:00:00", + "effectiveDate": "2018-08-17T00:00:00", + "operatorId": 6003, + "drawerName": "", + "drawerBranch": "", + "transactionType": "LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "JNC ", + "transactionAmount": 370, + "balance": 20746.37, + "principalAmount": -296.75, + "interest": 73.25, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 499971037, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "799-500", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "SBI 0817 1713 877626 2626 North Illinois R Round Lake BeIL" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2018-07-27T00:00:00", + "effectiveDate": "2018-07-27T00:00:00", + "operatorId": 6003, + "drawerName": "", + "drawerBranch": "", + "transactionType": "LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "JNC ", + "transactionAmount": 370, + "balance": 21043.12, + "principalAmount": -198.04, + "interest": 161.96, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 495456427, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "799-500", + "totalFee": 10, + "lateCharge": "10.00", + "historyDetails": { + "transactionDescription": "SBI 0727 1235 172614 2626 North Illinois R Round Lake BeIL" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2018-07-21T00:00:00", + "effectiveDate": "2018-07-21T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ADJ NON-CASH", + "transactionNumber": 289, + "transactionTypeCode": "ADNC", + "transactionAmount": 0, + "balance": 21241.16, + "principalAmount": 0, + "interest": 0, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 494306614, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "LATE CHARGE ASSESSED: 10.00, LATE DATE: 07-10-18" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2018-06-12T00:00:00", + "effectiveDate": "2018-06-11T00:00:00", + "operatorId": 6051, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ELECTRONIC LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "PR ", + "transactionAmount": 738.84, + "balance": 21241.16, + "principalAmount": -526.79, + "interest": 202.05, + "escrowAmount": 0, + "processingGroup": "26", + "batchControlId": 5451, + "historyItemId": 486462309, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 10, + "lateCharge": "10.00", + "historyDetails": { + "transactionDescription": "" + }, + "amountToCurtailment": 0 + } + ], + "temenosHistory": [ + { + "name": "Case Stage - O4R", + "message": "O4R", + "userId": 6, + "created": "2021-01-14T09:02:58.067", + "type": 1 + }, + { + "name": "Case Stage Account - REHO", + "message": "Account level stage ", + "userId": 0, + "created": "2021-01-14T06:49:32.46", + "type": 1 + }, + { + "name": "AUTO - Status Set Repo Flag", + "message": "set flag", + "userId": 0, + "created": "2021-01-14T06:48:39.083", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2021-01-14T06:38:54.567", + "type": 1 + }, + { + "name": "Remove DQ Flag", + "message": "set flag", + "userId": 0, + "created": "2021-01-14T06:14:00.743", + "type": 1 + }, + { + "name": "Case Stage Account - REHO", + "message": "Account level stage ", + "userId": 0, + "created": "2021-01-13T06:40:37.77", + "type": 1 + }, + { + "name": "AUTO - Status Set Repo Flag", + "message": "set flag", + "userId": 0, + "created": "2021-01-13T06:40:04.52", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2021-01-13T06:31:47.297", + "type": 1 + }, + { + "name": "Case Stage Account - REHO", + "message": "Account level stage ", + "userId": 0, + "created": "2021-01-12T10:41:53.66", + "type": 1 + }, + { + "name": "AUTO - Status Set Repo Flag", + "message": "set flag", + "userId": 0, + "created": "2021-01-12T10:36:16.423", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2021-01-12T10:16:28.48", + "type": 1 + }, + { + "name": "Remove DQ Flag", + "message": "set flag", + "userId": 0, + "created": "2021-01-12T09:42:12.49", + "type": 1 + }, + { + "name": "Assign to Agent - DT", + "message": "Case Stage - O4R", + "userId": 6, + "created": "2021-01-11T17:36:06.617", + "type": 1 + }, + { + "name": "Assign to Agent - DT", + "message": "Account Level Stage - O4R", + "userId": 6, + "created": "2021-01-11T17:36:06.617", + "type": 1 + }, + { + "name": "Assign to Agent - DT", + "message": "Set Repo Flag", + "userId": 6, + "created": "2021-01-11T17:36:06.617", + "type": 1 + }, + { + "name": "Assign to Agent - DT", + "message": "Date Assigned", + "userId": 6, + "created": "2021-01-11T17:36:06.617", + "type": 1 + }, + { + "name": "Assign to Agent - DT", + "message": "Repo Type (Voluntary/Involuntary)", + "userId": 6, + "created": "2021-01-11T17:36:06.617", + "type": 1 + }, + { + "name": "Assign to Agent - DT", + "message": "Update Repo Details", + "userId": 6, + "created": "2021-01-11T17:36:06.617", + "type": 1 + }, + { + "name": "Create Repo Case", + "message": "Create Case", + "userId": 6, + "created": "2021-01-11T17:33:14.473", + "type": 1 + }, + { + "name": "Create Repo Case", + "message": "Set Next Contact Date", + "userId": 6, + "created": "2021-01-11T17:33:14.473", + "type": 1 + }, + { + "name": "Case Stage Account - REHO", + "message": "Account level stage ", + "userId": 0, + "created": "2021-01-11T06:22:01.9", + "type": 1 + }, + { + "name": "AUTO - Status Set Repo Flag", + "message": "set flag", + "userId": 0, + "created": "2021-01-11T06:21:22.043", + "type": 1 + }, + { + "name": "Redemption Calc IL 30%", + "message": "30% Check Box", + "userId": 0, + "created": "2021-01-11T06:16:04.37", + "type": 1 + }, + { + "name": "Automated Charge Off - Indirect", + "message": "Set Branch 57", + "userId": 0, + "created": "2021-01-09T17:58:20.563", + "type": 1 + }, + { + "name": "Automated Charge Off - Indirect", + "message": "Recommend for Charge Off", + "userId": 0, + "created": "2021-01-09T17:58:20.563", + "type": 1 + }, + { + "name": "Automated Charge Off - Indirect", + "message": "Recommendation Approval", + "userId": 0, + "created": "2021-01-09T17:58:20.563", + "type": 1 + }, + { + "name": "Automated Charge Off - Indirect", + "message": "Set GL Amounts", + "userId": 0, + "created": "2021-01-09T17:58:20.563", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "Last Contact Date - 1/1/2020", + "userId": 2, + "created": "2021-01-09T12:54:10.27", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "User Status Code 1 - Blank", + "userId": 2, + "created": "2021-01-09T12:54:10.27", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "User Status Code 2 - Blank", + "userId": 2, + "created": "2021-01-09T12:54:10.27", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "Intellect Permanent Comments - Blank", + "userId": 2, + "created": "2021-01-09T12:54:10.27", + "type": 1 + }, + { + "name": "Clear Intellect Data", + "message": "Intellect Next Follow Up Date - 1/1/20", + "userId": 2, + "created": "2021-01-09T12:54:10.27", + "type": 1 + }, + { + "name": "Comment", + "message": "(called the member at 224)287-2895no id left a message to call.", + "userId": 1, + "created": "2020-09-24T15:13:45", + "type": 0 + }, + { + "name": "Comment", + "message": "gave the agent update to run the POE second shift", + "userId": 1, + "created": "2020-09-17T16:00:02", + "type": 0 + }, + { + "name": "Comment", + "message": "called the number for janice, 847-363-5302 talked to janice autho full name ssn dob, let her know we have assigned the account for repossession, in CA, Melissa Soto is her GF, does baby sitting, same phone number 224-287-9999", + "userId": 1, + "created": "2020-09-02T15:01:41", + "type": 0 + }, + { + "name": "Comment", + "message": "sent Di and Jayson an email that the account is off hold.", + "userId": 1, + "created": "2020-08-31T11:33:56", + "type": 0 + }, + { + "name": "Comment", + "message": "provided the agent with the address information for jane, POE and home address plus alternative address.", + "userId": 1, + "created": "2020-08-31T11:33:33", + "type": 0 + }, + { + "name": "Comment", + "message": "I approve putting out for repo.", + "userId": 1, + "created": "2020-08-31T11:07:20", + "type": 0 + }, + { + "name": "Comment", + "message": "Sent Casey an email to hold off on the replevin,", + "userId": 1, + "created": "2020-08-31T10:36:13", + "type": 0 + }, + { + "name": "Comment", + "message": "I approve putting it out for repo and replevin must be stopped.", + "userId": 1, + "created": "2020-08-31T10:26:40", + "type": 0 + }, + { + "name": "Comment", + "message": "sent Casey an email to see if she is going to charge us any fees, if not will send back to Dan for approval", + "userId": 1, + "created": "2020-08-29T12:42:21", + "type": 0 + }, + { + "name": "Comment", + "message": "email from DanAs long as we don't get charged from Casey and can stop the replevin, then yes I approve putting out for repo.", + "userId": 1, + "created": "2020-08-29T12:41:53", + "type": 0 + }, + { + "name": "Comment", + "message": "SCRANon MilitaryCert ID 3F6W98YCJ77J1HY", + "userId": 1, + "created": "2020-08-27T14:13:25", + "type": 0 + }, + { + "name": "Comment", + "message": "called the number for janice, 847-363-5302 , no id left a message to call.", + "userId": 1, + "created": "2020-08-27T14:05:58", + "type": 0 + }, + { + "name": "Comment", + "message": "called the number for janice, 847-363-5302 , no id left a message to call.", + "userId": 1, + "created": "2020-08-26T16:49:12", + "type": 0 + }, + { + "name": "Comment", + "message": "sent Dan an email to review and see if we can assign for repo in CA", + "userId": 1, + "created": "2020-08-26T16:42:09", + "type": 0 + }, + { + "name": "Comment", + "message": "email back from Casey, We have not filed suit yet. I will contact our CA local counsel about repo in California.", + "userId": 1, + "created": "2020-08-26T12:48:10", + "type": 0 + }, + { + "name": "Comment", + "message": "called Casey 312-253-9620 to see if she filed for a replevin judgment yet. If we filed for replevin we can't release the hold on the repo. Per Dan No answer.", + "userId": 1, + "created": "2020-08-26T12:43:00", + "type": 0 + }, + { + "name": "Comment", + "message": "repossession approved by Dan, sent Diana and Jayson an email to assign the account.", + "userId": 1, + "created": "2020-08-25T10:18:34", + "type": 0 + }, + { + "name": "Comment", + "message": "Called repo remarketing. to see if the repo order is now open in CA. no answer", + "userId": 1, + "created": "2020-08-25T10:11:38", + "type": 0 + }, + { + "name": "Comment", + "message": "still can't repo in CA", + "userId": 1, + "created": "2020-08-20T11:04:06", + "type": 0 + }, + { + "name": "Comment", + "message": "Plate hit on 8-10-20Not her plate", + "userId": 1, + "created": "2020-08-17T08:36:26", + "type": 0 + }, + { + "name": "Comment", + "message": "talked to janice, autho full name ssn dob, she stated she talked to jane and she is still in CA and said she is working and wanted to pay, janice will call me next week", + "userId": 1, + "created": "2020-08-05T11:02:48", + "type": 0 + }, + { + "name": "Comment", + "message": "called the number for janice, 847-363-5302 847-363-5302 no id left a message to call.", + "userId": 1, + "created": "2020-07-31T10:54:22", + "type": 0 + }, + { + "name": "Comment", + "message": "follow up next week with janice", + "userId": 1, + "created": "2020-07-17T14:17:37", + "type": 0 + }, + { + "name": "Comment", + "message": "incoming call from janice, autho full name ssn dob, she said she talked to her granddaughter and jane is going to make a payment however we haven't recieved any payments she will try to get in contact her and let her know we can give her until Friday then will have to start legal next week,", + "userId": 1, + "created": "2020-07-07T11:45:33", + "type": 0 + }, + { + "name": "Comment", + "message": "called the number for janice, 847-363-5302 No id left a message to call.", + "userId": 1, + "created": "2020-07-07T10:23:04", + "type": 0 + }, + { + "name": "Comment", + "message": "called the member 224-287-2895 (jane's number ) not in service", + "userId": 1, + "created": "2020-07-07T10:21:51", + "type": 0 + }, + { + "name": "Comment", + "message": "DRN Hits No current plate hits last one was in February", + "userId": 1, + "created": "2020-07-07T10:16:59", + "type": 0 + }, + { + "name": "Comment", + "message": "called the number for janice, 847-363-5302 847-363-5302 no id left a message to call.", + "userId": 1, + "created": "2020-07-01T16:52:38", + "type": 0 + }, + { + "name": "Comment", + "message": "called the number for janice, 847-363-5302 847-363-5302 talked to janice ssn dob, she stated no word from jane, she is going to call her tomorrow.", + "userId": 1, + "created": "2020-06-19T13:33:37", + "type": 0 + }, + { + "name": "Comment", + "message": "called the member 224-287-2895 this is jane's number, left a message to call.", + "userId": 1, + "created": "2020-06-19T13:31:45", + "type": 0 + }, + { + "name": "Comment", + "message": "incoming call frm the membertalked to janice autho full name, ssn dob home phone, she was following up with me to see if I talked to her granddaughter, I will try to call her later today and follow up with janice next week, jane is still in CA.", + "userId": 1, + "created": "2020-06-12T08:53:05", + "type": 0 + }, + { + "name": "Comment", + "message": "called the number for janice, 847-363-5302 no id left a message to call.", + "userId": 1, + "created": "2020-06-11T10:58:02", + "type": 0 + }, + { + "name": "Comment", + "message": "called the number for janice, CALLED THE POSSIBLE NUMBER IN TLO (847) 363-5302 talked to janice autho full name dob ssn, let her know I spoke to Samanatha and she told me she was coming back she will follow up with me in a few days, address 3910 San Carlos Way Sacremento CA 95820", + "userId": 1, + "created": "2020-06-04T15:45:16", + "type": 0 + }, + { + "name": "Comment", + "message": "called the member 224-287-2895 talked to jane she is in the process of moving back to Illinios, she started moving last weekend, she is looking for a job and trying to get her job back at Amazon, will follow up with her grandmother,", + "userId": 1, + "created": "2020-06-04T12:40:00", + "type": 0 + }, + { + "name": "Comment", + "message": "POE ADDRESS Top Notch MetalsAddress: 1165 National Dr, Sacramento, CA 95834", + "userId": 1, + "created": "2020-05-26T14:14:04", + "type": 0 + }, + { + "name": "Comment", + "message": "TLOCALLED THE POSSIBLE NUMBER IN TLO (847) 363-5302talked to janice autho full name ssn dob, her granddaughter jane Randall, she is living in CA she stated she is working at a sheet metal factory, Top Notch Metals, she will try to call her today gave her my direct line, let her know that the account is now charged off and would need the balance on the loan,", + "userId": 1, + "created": "2020-05-26T14:08:52", + "type": 0 + }, + { + "name": "Comment", + "message": "email sent to the memberSuperman081812@gmail.com", + "userId": 1, + "created": "2020-05-26T13:58:18", + "type": 0 + }, + { + "name": "Comment", + "message": "Called the membercalled 224-287-2895 no id left a message to call.", + "userId": 1, + "created": "2020-05-26T13:58:08", + "type": 0 + }, + { + "name": "Comment", + "message": "Plate hit 10-19 in Sacramento on San Carlos Way", + "userId": 1, + "created": "2020-05-05T11:14:01", + "type": 0 + }, + { + "name": "Comment", + "message": "checked jane in TLO - jane JO-DAWNE DOEPOE - Top Notch Metalslast prop she liveed at in CA was in 2013010 San Carlos Way Sacramento, CA 95820-2710* TLO shows unit still registered in IL", + "userId": 1, + "created": "2020-04-21T16:25:46", + "type": 0 + }, + { + "name": "Comment", + "message": "pulled carfax - last vehicle inspection was in CA", + "userId": 1, + "created": "2020-04-21T16:08:26", + "type": 0 + }, + { + "name": "Comment", + "message": "** information from intellect **** sent to WWR for rep* grandaughter dirves the unit * RESULTS FRM WORK NUMBER FOR jane: Employer Employer: TOPNOTCH METAL PRODUCTS", + "userId": 1, + "created": "2020-04-21T16:05:06", + "type": 0 + }, + { + "name": "Comment", + "message": "** reho due to COVID 19", + "userId": 1, + "created": "2020-04-21T16:01:28", + "type": 0 + }, + { + "name": "Comment", + "message": "* LETTER * Letter for Loan & Dep Accts Pre Coll Agency", + "userId": 1, + "created": "2020-04-10T08:09:18", + "type": 0 + }, + { + "name": "Comment", + "message": "TCOTT Call: Call Follow Up", + "userId": 1, + "created": "2020-03-24T11:07:53", + "type": 0 + }, + { + "name": "Comment", + "message": "TCOTT Comment: 773-554-7454-MB FULL", + "userId": 1, + "created": "2020-03-24T11:07:47", + "type": 0 + }, + { + "name": "Comment", + "message": "773-554-7454-MB FULL", + "userId": 1, + "created": "2020-03-24T11:07:47", + "type": 0 + }, + { + "name": "Comment", + "message": "TCOTT Comment: E/M-superman081812@gmail.com", + "userId": 1, + "created": "2020-03-24T11:07:34", + "type": 0 + }, + { + "name": "Comment", + "message": "E/M-superman081812@gmail.com", + "userId": 1, + "created": "2020-03-24T11:07:34", + "type": 0 + }, + { + "name": "Comment", + "message": "TCOTT Message: janice DOE @ (224)287-2895", + "userId": 1, + "created": "2020-03-24T11:07:29", + "type": 0 + }, + { + "name": "Comment", + "message": "TCOTT Call: Call Follow Up", + "userId": 1, + "created": "2020-03-20T13:21:38", + "type": 0 + }, + { + "name": "Comment", + "message": "TCOTT Comment: USERDEF CHANGED FROM O4R TO REHO-COVID-19", + "userId": 1, + "created": "2020-03-20T13:21:35", + "type": 0 + }, + { + "name": "Comment", + "message": "USERDEF CHANGED FROM O4R TO REHO-COVID-19", + "userId": 1, + "created": "2020-03-20T13:21:35", + "type": 0 + }, + { + "name": "Comment", + "message": "Approved going back to regular repo", + "userId": 1, + "created": "2020-03-20T00:00:00", + "type": 0 + }, + { + "name": "Comment", + "message": "JOHNS Call: Call Follow Up", + "userId": 1, + "created": "2020-03-18T10:35:49", + "type": 0 + }, + { + "name": "Comment", + "message": "JOHNS Comment: Approved going back to regular repo", + "userId": 1, + "created": "2020-03-18T10:35:49", + "type": 0 + }, + { + "name": "Comment", + "message": "5783 Comment: ISSUED TO REPO REMARKETING", + "userId": 1, + "created": "2020-03-18T10:30:53", + "type": 0 + }, + { + "name": "Comment", + "message": "ISSUED TO REPO REMARKETING", + "userId": 1, + "created": "2020-03-18T10:30:53", + "type": 0 + }, + { + "name": "Comment", + "message": "Letter. The letter was sent to Address Home printed on 3/9/2020 3:42:01 PM. Letter", + "userId": 1, + "created": "2020-03-18T09:01:56", + "type": 0 + }, + { + "name": "Comment", + "message": "TCOTT Call: Call Follow Up", + "userId": 1, + "created": "2020-03-18T09:01:53", + "type": 0 + }, + { + "name": "Comment", + "message": "TCOTT Comment: LEGAL DOCS SCANNED AND SENT TO CASEY", + "userId": 1, + "created": "2020-03-18T09:01:13", + "type": 0 + }, + { + "name": "Comment", + "message": "LEGAL DOCS SCANNED AND SENT TO CASEY", + "userId": 1, + "created": "2020-03-18T09:01:13", + "type": 0 + }, + { + "name": "Comment", + "message": "BLAGO Letter: Replevin Request Form", + "userId": 1, + "created": "2020-03-09T15:41:54", + "type": 0 + }, + { + "name": "Comment", + "message": "TCOTT Call: Call Follow Up", + "userId": 1, + "created": "2020-03-03T16:55:10", + "type": 0 + }, + { + "name": "Comment", + "message": "TCOTT Comment: SKIP CLAIM DENIED-GOING BACKTO LEGAL", + "userId": 1, + "created": "2020-03-03T16:55:06", + "type": 0 + }, + { + "name": "Comment", + "message": "SKIP CLAIM DENIED-GOING BACKTO LEGAL", + "userId": 1, + "created": "2020-03-03T16:55:06", + "type": 0 + }, + { + "name": "Comment", + "message": "TCOTT Comment: MNT-QREPLEVIN REQUEST", + "userId": 1, + "created": "2020-03-03T16:54:54", + "type": 0 + }, + { + "name": "Comment", + "message": "MNT-QREPLEVIN REQUEST", + "userId": 1, + "created": "2020-03-03T16:54:54", + "type": 0 + }, + { + "name": "Comment", + "message": "NDAVI Comment: 8/10/2019. The date the claim was reported to us was on 02/13/2020. Since the loan is more than 150 days past due as of the date you reported the claim, we must respectfully deny this claim.No suit, action or proceeding for the recovery of any claim~", + "userId": 1, + "created": "2020-02-26T09:40:56", + "type": 0 + }, + { + "name": "Comment", + "message": "NDAVI Comment: Email from Dana at Allied--CLAIM DENIEDFebruary 26, 2020Attn: CollectionsLandmark Credit Union - WI 5445 South Westridge Drive New Berlin, WI 53151Re:\tOur Insured:\t\tLandmark Credit Union - WIOur Borrower: \tjanice Randall ~", + "userId": 1, + "created": "2020-02-26T09:40:56", + "type": 0 + }, + { + "name": "Comment", + "message": "NDAVI Comment: Loan Number:\t\t7115520143\t\t Date of Loss:\t\t02/19/2020\t\tClaim Type: \t\tSecretion\tVehicle: \t\t2015 Ford ESCAPE\t\tVIN: \t\t\t1FMCU0GX7FUB09590Adjuster: \t\tDana Patterson\t \t\tDear Collections:Allied Solution", + "userId": 1, + "created": "2020-02-26T09:40:56", + "type": 0 + }, + { + "name": "Comment", + "message": "NDAVI Comment: ON COVERAGE ENDORSEMENTThe Policy to which this endorsement is attached is hereby amended as follows:…CONDITIONS PRECEDENT TO LIABILITY: The conditions precedent to the attaching of OUR liability for any loss or damage under this Endorsement are:", + "userId": 1, + "created": "2020-02-26T09:40:56", + "type": 0 + }, + { + "name": "Comment", + "message": "NDAVI Comment: 8. That YOU have reported a loss to US within 150 days after the loan has become delinquent. A loan shall be considered delinquent when one or more loan payments is more than thirty (30) days past its due date.…The next due date on this loan is 0", + "userId": 1, + "created": "2020-02-26T09:40:56", + "type": 0 + }, + { + "name": "Comment", + "message": "NDAVI Comment: s is the claims administrator for Integon National Insurance Company. This letter is written in reference to the above-captioned claim.Please refer to your Collateral Protection Policy, which states:BROAD FORM CONVERSION, SECRETION, AND CONFISCATI", + "userId": 1, + "created": "2020-02-26T09:40:56", + "type": 0 + }, + { + "name": "Comment", + "message": "NDAVI Comment: under this Policy shall be sustainable in any court of law or equity unless it is commenced within twelve (12) months from the time there is a breach of contract.An Insurance Fraud Warning Statement is enclosed, as required by law. Please refer to t", + "userId": 1, + "created": "2020-02-26T09:40:56", + "type": 0 + }, + { + "name": "Comment", + "message": "NDAVI Comment: questions, please do not hesitate to contact us at (800) 998-0641 or claims@alliedsolutions.net.Sincerely,Allied Solutions for Integon National Insurance Company", + "userId": 1, + "created": "2020-02-26T09:40:56", + "type": 0 + }, + { + "name": "Comment", + "message": "NDAVI Comment: he warning statement, if applicable, for the state where your claim is being made.Should you have additional information that would affect the disposition of this claim, we would be happy to review your file for further consideration. If you have any~", + "userId": 1, + "created": "2020-02-26T09:40:56", + "type": 0 + }, + { + "name": "Comment", + "message": "Email from Dana at Allied--CLAIM DENIEDFebruary 26, 2020Attn: CollectionsLandmark Credit Union - WI 5445 South Westridge Drive New Berlin, WI 53151Re:\tOur Insured:\t\tLandmark Credit Union - WIOur Borrower: \tjanice Randall Loan Number:\t\t7115520143\t\t Date of Loss:\t\t02/19/2020\t\tClaim Type: \t\tSecretion\tVehicle: \t\t2015 Ford ESCAPE\t\tVIN: \t\t\t1FMCU0GX7FUB09590Adjuster: \t\tDana Patterson\t \t\tDear Collections:Allied Solutions is the claims administrator for Integon National Insurance Company. This letter is written in reference to the above-captioned claim.Please refer to your Collateral Protection Policy, which states:BROAD FORM CONVERSION, SECRETION, AND CONFISCATION COVERAGE ENDORSEMENTThe Policy to which this endorsement is attached is hereby amended as follows:…CONDITIONS PRECEDENT TO LIABILITY: The conditions precedent to the attaching of OUR liability for any loss or damage under this Endorsement are:8. That YOU have reported a loss to US within 150 days after the loan has become delinquent. A loan shall be considered delinquent when one or more loan payments is more than thirty (30) days past its due date.…The next due date on this loan is 08/10/2019. The date the claim was reported to us was on 02/13/2020. Since the loan is more than 150 days past due as of the date you reported the claim, we must respectfully deny this claim.No suit, action or proceeding for the recovery of any claim under this Policy shall be sustainable in any court of law or equity unless it is commenced within twelve (12) months from the time there is a breach of contract.An Insurance Fraud Warning Statement is enclosed, as required by law. Please refer to the warning statement, if applicable, for the state where your claim is being made.Should you have additional information that would affect the disposition of this claim, we would be happy to review your file for further consideration. If you have any questions, please do not hesitate to contact us at (800) 998-0641 or claims@alliedsolutions.net.Sincerely,Allied Solutions for Integon National Insurance Company", + "userId": 1, + "created": "2020-02-26T09:40:56", + "type": 0 + }, + { + "name": "Comment", + "message": "TCOTT Call: Call Follow Up", + "userId": 1, + "created": "2020-02-25T16:56:32", + "type": 0 + }, + { + "name": "Comment", + "message": "TCOTT Comment: NO SKIP UPDATES AS OF YET", + "userId": 1, + "created": "2020-02-25T16:56:28", + "type": 0 + }, + { + "name": "Comment", + "message": "NO SKIP UPDATES AS OF YET", + "userId": 1, + "created": "2020-02-25T16:56:28", + "type": 0 + }, + { + "name": "Comment", + "message": "TCOTT Comment: EMAILED DANA AT ALLIED THE POE INFO FOR jane", + "userId": 1, + "created": "2020-02-25T16:56:21", + "type": 0 + }, + { + "name": "Comment", + "message": "EMAILED DANA AT ALLIED THE POE INFO FOR jane", + "userId": 1, + "created": "2020-02-25T16:56:21", + "type": 0 + }, + { + "name": "Comment", + "message": "CCABR Call: Call Follow Up", + "userId": 1, + "created": "2020-02-21T15:08:08", + "type": 0 + }, + { + "name": "Comment", + "message": "CCABR Message: janice DOE @ (224)287-2895", + "userId": 1, + "created": "2020-02-21T15:08:04", + "type": 0 + }, + { + "name": "Comment", + "message": "NDAVI Comment: Fax: 1-262-317-5098You're worth more hereFrom: Dana Patterson Sent: Wednesday, February 19, 2020 1:20 PMTo: CPIclaims Subject: [EXTERNAL] Randall, janice-2020178112We ne", + "userId": 1, + "created": "2020-02-19T15:39:57", + "type": 0 + }, + { + "name": "Comment", + "message": "NDAVI Comment: EMail to Dana at AlliedHi Dana,The documents are now attached to the claim.Thank you,Nicole DaviesCollector-CPI Landmark Credit Union5445 S Westridge DrP.O. Box 510870New Berlin WI 53151www.landmarkcu.comPh: 1-262-899-6168", + "userId": 1, + "created": "2020-02-19T15:39:57", + "type": 0 + }, + { + "name": "Comment", + "message": "NDAVI Comment: ed the following documents in order to proceed with the claim: \" Full system generated screen shot showing the next due date, not handwritten or typewritten \" Full clear legible scanned copy of the Security Agreement \" Copy of ~", + "userId": 1, + "created": "2020-02-19T15:39:57", + "type": 0 + }, + { + "name": "Comment", + "message": "NDAVI Comment: title \" Copy of collection notes & repo agent notes Okay to send in advance: \" Last 6 months loan history(to include last payment made to present) Please do not email documents directly to the adjuster. Please label and attach any~", + "userId": 1, + "created": "2020-02-19T15:39:57", + "type": 0 + }, + { + "name": "Comment", + "message": "NDAVI Comment: requested documents directly to the claim file, fax to 800-796-6511 or email to claims@alliedsolutions.net. Dana Patterson Claims Adjuster II Allied Solutions 6111 W. Plano Parkway, Suite 2500 Plano, TX 75093 Phone: 800-998-0641 ext. 13009", + "userId": 1, + "created": "2020-02-19T15:39:57", + "type": 0 + }, + { + "name": "Comment", + "message": "NDAVI Comment: Fax: 800-796-6511 www.AlliedSolutions.net Please consider the environment before printing this email.", + "userId": 1, + "created": "2020-02-19T15:39:57", + "type": 0 + }, + { + "name": "Comment", + "message": "EMail to Dana at AlliedHi Dana,The documents are now attached to the claim.Thank you,Nicole DaviesCollector-CPI Landmark Credit Union5445 S Westridge DrP.O. Box 510870New Berlin WI 53151www.landmarkcu.comPh: 1-262-899-6168Fax: 1-262-317-5098You're worth more hereFrom: Dana Patterson Sent: Wednesday, February 19, 2020 1:20 PMTo: CPIclaims Subject: [EXTERNAL] Randall, janice-2020178112We need the following documents in order to proceed with the claim: \" Full system generated screen shot showing the next due date, not handwritten or typewritten \" Full clear legible scanned copy of the Security Agreement \" Copy of title \" Copy of collection notes & repo agent notes Okay to send in advance: \" Last 6 months loan history(to include last payment made to present) Please do not email documents directly to the adjuster. Please label and attach any requested documents directly to the claim file, fax to 800-796-6511 or email to claims@alliedsolutions.net. Dana Patterson Claims Adjuster II Allied Solutions 6111 W. Plano Parkway, Suite 2500 Plano, TX 75093 Phone: 800-998-0641 ext. 13009 Fax: 800-796-6511 www.AlliedSolutions.net Please consider the environment before printing this email.", + "userId": 1, + "created": "2020-02-19T15:39:57", + "type": 0 + }, + { + "name": "Comment", + "message": "TCOTT Comment: CLSED REPO IN RDN-SKIP CLAIM FILED", + "userId": 1, + "created": "2020-02-18T10:48:36", + "type": 0 + }, + { + "name": "Comment", + "message": "CLSED REPO IN RDN-SKIP CLAIM FILED", + "userId": 1, + "created": "2020-02-18T10:48:36", + "type": 0 + }, + { + "name": "Comment", + "message": "5783 Comment: ***Skip claim filed on 02/13/2020: Claim Number: 2020178112 ClaimId: 1121319", + "userId": 1, + "created": "2020-02-14T09:38:28", + "type": 0 + }, + { + "name": "Comment", + "message": "***Skip claim filed on 02/13/2020: Claim Number: 2020178112 ClaimId: 1121319", + "userId": 1, + "created": "2020-02-14T09:38:28", + "type": 0 + }, + { + "name": "Comment", + "message": "TCOTT Call: Call Follow Up", + "userId": 1, + "created": "2020-02-10T16:35:04", + "type": 0 + }, + { + "name": "Comment", + "message": "TCOTT Comment: CALLED TOPNOTCH METAL 916-381-4742-RECPT TOOK MSG TO GIVE TO HER SHE WASNT SURE IF SHE WAS IN OR NOT", + "userId": 1, + "created": "2020-02-10T16:30:30", + "type": 0 + }, + { + "name": "Comment", + "message": "CALLED TOPNOTCH METAL 916-381-4742-RECPT TOOK MSG TO GIVE TO HER SHE WASNT SURE IF SHE WAS IN OR NOT", + "userId": 1, + "created": "2020-02-10T16:30:30", + "type": 0 + }, + { + "name": "Comment", + "message": "TCOTT Call: Call Follow Up", + "userId": 1, + "created": "2020-01-31T17:31:50", + "type": 0 + }, + { + "name": "Comment", + "message": "TCOTT Comment: ACTIVEMost Recent Start Date:09/16/2019", + "userId": 1, + "created": "2020-01-31T09:00:40", + "type": 0 + }, + { + "name": "Comment", + "message": "TCOTT Comment: RESULTS FRM WORK NUMBER FOR jane:EmployerEmployer:TOPNOTCH METAL PRODUCTS(2425968)Headquarters Address:4920 Raley Blvd Sacramento CA 95838Federal Employer Identification Number (FEIN):Data not providedEmploymentEmployment Status:", + "userId": 1, + "created": "2020-01-31T09:00:40", + "type": 0 + }, + { + "name": "Comment", + "message": "RESULTS FRM WORK NUMBER FOR jane:EmployerEmployer:TOPNOTCH METAL PRODUCTS(2425968)Headquarters Address:4920 Raley Blvd Sacramento CA 95838Federal Employer Identification Number (FEIN):Data not providedEmploymentEmployment Status:ACTIVEMost Recent Start Date:09/16/2019", + "userId": 1, + "created": "2020-01-31T09:00:40", + "type": 0 + }, + { + "name": "Comment", + "message": "TCOTT Comment: 773-554-7454-MB FULL", + "userId": 1, + "created": "2020-01-30T16:53:17", + "type": 0 + }, + { + "name": "Comment", + "message": "773-554-7454-MB FULL", + "userId": 1, + "created": "2020-01-30T16:53:17", + "type": 0 + }, + { + "name": "Comment", + "message": "TCOTT Comment: NO UPDATED DRN HITS", + "userId": 1, + "created": "2020-01-30T16:52:19", + "type": 0 + }, + { + "name": "Comment", + "message": "NO UPDATED DRN HITS", + "userId": 1, + "created": "2020-01-30T16:52:19", + "type": 0 + }, + { + "name": "Comment", + "message": "TCOTT Call: Call Follow Up", + "userId": 1, + "created": "2020-01-28T16:23:35", + "type": 0 + }, + { + "name": "Comment", + "message": "TCOTT Call: Call Follow Up", + "userId": 1, + "created": "2020-01-24T13:08:23", + "type": 0 + }, + { + "name": "Comment", + "message": "TCOTT Comment: SKIP-POSS ADDY FOR jane:\t2320 CANTALIER ST, SACRAMENTO, CA 95815-3045 (SACRAMENTO COUNTY)(09/27/2018 to 12/04/2019)", + "userId": 1, + "created": "2020-01-24T13:00:47", + "type": 0 + }, + { + "name": "Comment", + "message": "SKIP-POSS ADDY FOR jane:\t2320 CANTALIER ST, SACRAMENTO, CA 95815-3045 (SACRAMENTO COUNTY)(09/27/2018 to 12/04/2019)", + "userId": 1, + "created": "2020-01-24T13:00:47", + "type": 0 + }, + { + "name": "Comment", + "message": "TCOTT Comment: 773-554-7454- mb full", + "userId": 1, + "created": "2020-01-24T12:59:18", + "type": 0 + }, + { + "name": "Comment", + "message": "773-554-7454- mb full", + "userId": 1, + "created": "2020-01-24T12:59:18", + "type": 0 + }, + { + "name": "Comment", + "message": "TCOTT Comment: *****LEGAL DOCS WERE NOT SENT TO ATTRNYS-OUT FOR PRESKIP*****", + "userId": 1, + "created": "2020-01-18T09:36:52", + "type": 0 + }, + { + "name": "Comment", + "message": "*****LEGAL DOCS WERE NOT SENT TO ATTRNYS-OUT FOR PRESKIP*****", + "userId": 1, + "created": "2020-01-18T09:36:52", + "type": 0 + }, + { + "name": "Comment", + "message": "Letter. The letter was sent to Address Home printed on 1/9/2020 8:58:39 AM. Letter", + "userId": 1, + "created": "2020-01-16T16:47:50", + "type": 0 + }, + { + "name": "Comment", + "message": "TCOTT Call: Call Follow Up", + "userId": 1, + "created": "2020-01-16T16:47:47", + "type": 0 + }, + { + "name": "Comment", + "message": "TCOTT Comment: 847-363-5358-BUSYY", + "userId": 1, + "created": "2020-01-16T16:47:35", + "type": 0 + }, + { + "name": "Comment", + "message": "847-363-5358-BUSYY", + "userId": 1, + "created": "2020-01-16T16:47:35", + "type": 0 + }, + { + "name": "Comment", + "message": "TCOTT Comment: (224) 241-6288,-NOT REACHABLE", + "userId": 1, + "created": "2020-01-16T16:47:23", + "type": 0 + }, + { + "name": "Comment", + "message": "(224) 241-6288,-NOT REACHABLE", + "userId": 1, + "created": "2020-01-16T16:47:23", + "type": 0 + }, + { + "name": "Comment", + "message": "JWILK Comment: also goes by jane Jo-Dawne Randall", + "userId": 1, + "created": "2020-01-15T12:03:38", + "type": 0 + }, + { + "name": "Comment", + "message": "also goes by jane Jo-Dawne Randall", + "userId": 1, + "created": "2020-01-15T12:03:38", + "type": 0 + }, + { + "name": "Comment", + "message": "JWILK Comment: Lex nexshowing reporting to 528 Meadow Green Ln, Round Lake Beach, IL 773-554-7454 listed to Dustin Dudely and also 224 241 6288 listed to jane no other vehicles listed to her.", + "userId": 1, + "created": "2020-01-15T11:50:33", + "type": 0 + }, + { + "name": "Comment", + "message": "Lex nexshowing reporting to 528 Meadow Green Ln, Round Lake Beach, IL 773-554-7454 listed to Dustin Dudely and also 224 241 6288 listed to jane no other vehicles listed to her.", + "userId": 1, + "created": "2020-01-15T11:50:33", + "type": 0 + }, + { + "name": "Comment", + "message": "JWILK Comment: CCAPs for jane, last showing 2015 showing addy on file as listed home address. 35980 Hunt Ave, ingleside", + "userId": 1, + "created": "2020-01-15T11:42:41", + "type": 0 + }, + { + "name": "Comment", + "message": "CCAPs for jane, last showing 2015 showing addy on file as listed home address. 35980 Hunt Ave, ingleside", + "userId": 1, + "created": "2020-01-15T11:42:41", + "type": 0 + }, + { + "name": "Comment", + "message": "JWILK Comment: skip search/ per CarFax points to California. jane J Randall 27 years of age, skip search finds. DOB 2/1992Adriana C Parsell , Randall Rj jane J Randall is 27 years old. jane's phone numbers include (224) 241-6288, (847) 363-5358", + "userId": 1, + "created": "2020-01-15T11:29:16", + "type": 0 + }, + { + "name": "Comment", + "message": "JWILK Comment: . jane's possible relatives include janice C Randall, R J Randall, Richard Randall, Richard W Randall, Ronald C Randall. jane's most recent address is 1547 39th Ave, APT 1C,Kenosha, WI 53144-1239. jane previously lived at 813 Grand Ave,", + "userId": 1, + "created": "2020-01-15T11:29:16", + "type": 0 + }, + { + "name": "Comment", + "message": "JWILK Comment: Waukegan, IL 60085-4111. jane previously lived at 35980 N Hunt Ave,Ingleside, IL 60041-9174", + "userId": 1, + "created": "2020-01-15T11:29:16", + "type": 0 + }, + { + "name": "Comment", + "message": "skip search/ per CarFax points to California. jane J Randall 27 years of age, skip search finds. DOB 2/1992Adriana C Parsell , Randall Rj jane J Randall is 27 years old. jane's phone numbers include (224) 241-6288, (847) 363-5358. jane's possible relatives include janice C Randall, R J Randall, Richard Randall, Richard W Randall, Ronald C Randall. jane's most recent address is 1547 39th Ave, APT 1C,Kenosha, WI 53144-1239. jane previously lived at 813 Grand Ave,Waukegan, IL 60085-4111. jane previously lived at 35980 N Hunt Ave,Ingleside, IL 60041-9174", + "userId": 1, + "created": "2020-01-15T11:29:16", + "type": 0 + }, + { + "name": "Comment", + "message": "JWILK Comment: Ms janice C Randall is 80 years old. janice's phone numbers include (847) 587-5302, (847) 668-5302, (847) 363-5302. janice's possible relatives include R J Randall, Richard W Randall, Richard Randall, Ronald C Randall, jane J Randall. janice", + "userId": 1, + "created": "2020-01-15T11:21:21", + "type": 0 + }, + { + "name": "Comment", + "message": "JWILK Comment: 's most recent address is 35980 N Hunt Ave,Ingleside, IL 60041-9174. janice previously lived at 400 Hunt Ave,Ingleside, IL 60041. janice previously lived at 7054 Czech Ln,Neshkoro, WI 54960, for 2 years", + "userId": 1, + "created": "2020-01-15T11:21:21", + "type": 0 + }, + { + "name": "Comment", + "message": "Ms janice C Randall is 80 years old. janice's phone numbers include (847) 587-5302, (847) 668-5302, (847) 363-5302. janice's possible relatives include R J Randall, Richard W Randall, Richard Randall, Ronald C Randall, jane J Randall. janice's most recent address is 35980 N Hunt Ave,Ingleside, IL 60041-9174. janice previously lived at 400 Hunt Ave,Ingleside, IL 60041. janice previously lived at 7054 Czech Ln,Neshkoro, WI 54960, for 2 years", + "userId": 1, + "created": "2020-01-15T11:21:21", + "type": 0 + }, + { + "name": "Comment", + "message": "BERIM Comment: EMAILED DOCS AND DROPPED OFF TO TC", + "userId": 1, + "created": "2020-01-09T09:04:21", + "type": 0 + }, + { + "name": "Comment", + "message": "EMAILED DOCS AND DROPPED OFF TO TC", + "userId": 1, + "created": "2020-01-09T09:04:21", + "type": 0 + }, + { + "name": "Comment", + "message": "BERIM Letter: Replevin Request Form", + "userId": 1, + "created": "2020-01-09T08:58:32", + "type": 0 + } + ], + "temenosAccount": { + "accountId": 889577, + "accountIdentifier": "7115520143", + "accountNumber": "7115520", + "accountStatus": "Written Off", + "accountTypeId": 1008, + "accountType": { + "id": 1008, + "description": "Auto Used Indirect", + "code": "AUI" + }, + "activeFlag": true, + "amountLastPaid": null, + "balance": 21036.49, + "bankruptcyFlag": false, + "branch": null, + "dueDate": "2019-08-10T00:00:00", + "firstPaymentDueDate": null, + "loanOfficer": "", + "originalLoanAmount": null, + "originalLoanDate": null, + "dqAmount": 0, + "daysDq": 523, + "suffix": "143", + "linkedAccount": "7115520143", + "productType": "", + "closedDate": null, + "dateLastPaid": "1/22/2020 12:00:00 AM", + "dateFirstDelinquent": "7/1/2020 12:00:00 AM", + "cases": [ + { + "caseId": 1, + "caseNumber": "REPO-00000001", + "caseDescription": "", + "caseStageId": 2000122, + "repoStatus": 100, + "caseStatusId": 33, + "caseTitle": "REPO-00000001", + "caseTypeBasisId": 2, + "caseTypeId": 7, + "closedDate": null, + "createdDate": "2021-01-11T17:33:15.75", + "createdUserId": 6, + "currentStageDate": "2021-01-11T17:33:14.797", + "currentStatusDate": "2021-01-11T17:33:14.797", + "lastReviewDate": null, + "nextReviewDate": null, + "stage1CompletionDate": null, + "stage2CompletionDate": null, + "stage3CompletionDate": null, + "stage4CompletionDate": null, + "stage5CompletionDate": null, + "titleOrdered": false, + "titleOrderedDate": null, + "redemptionExpiredDateIl": null, + "redemptionExpiredDateWi": null, + "customFieldMap": { + "Case Modification Status": "", + "Case Loss Mitigation Stage": "", + "Case Loss Mitigation Type": "", + "Case Loss Mitigation Status": "", + "BRP Hardship Letter": "", + "BRP Bank Statements": "", + "BRP Paycheck Stubs": "", + "BRP Other Income If Applicable": "", + "BRP Tax Returns": "", + "BRP 4506T Form Signed": "", + "BRP Financial Worksheet": "", + "BRP 1st Mortgage Statement": "", + "BRP HOI Declaration Page": "", + "BRP Escrow Authorization Signed": "", + "BRP Additional Information Needed": "", + "Def Fore Financial Filed": "", + "Def Fore Case Number": "", + "Def Fore Date Filed": "", + "Def Fore Property Address is Mailing Address": "", + "Def Fore Property Address if not Mailing Address": "", + "Def Fore Attorney Name": "", + "Def Fore Attorney Number": "", + "Fore Referral Date": "", + "Fore SCRA Checked Date": "", + "Fore RTC Expiration Date": "", + "Fore On Hold Date": "", + "Fore On Hold Reason": "", + "Fore Reinstated Date": "", + "Fore Withdrawn Date": "", + "Fore Withdrawn Reason": "", + "Fore Withdrawn Reason If Other": "", + "Fore Date Last Payment": "", + "Fore Sale Scheduled Date": "", + "Fore Confirmation Scheduled Date": "", + "Fore Confirmation Complete Date": "", + "Fore Sale Result": "", + "Collection Agency": "False", + "Todays Date Case Lvl": "", + "DQ Amount Case Lvl": "", + "Performance Pymnts Case Lvl": "", + "Late Charges Case Lvl": "", + "Repo Fees Case Lvl": "", + "Redemption Amount Case Lvl": "0.0000", + "Balance Due Case Lvl": "", + "Legal Requested State Case Lvl": "", + "Judgement Dropdown Case Lvl": "", + "Attorney Firm Case Lvl": "", + "Documents Sent Date Case Lvl": "", + "Date Sent to Attorney Case Lvl": "", + "Date Served Case Lvl": "", + "Attorney Invoice Number Case Lvl": "", + "WRIT Flag Case Lvl": "False", + "Date Last RTC Letter Sent Case Lvl": "", + "RTC Sent Flag Case Lvl": "False", + "WRIT Date Case Lvl": "", + "Bond Obtained Flag Case Lvl": "False", + "Bond Obtained Date Case Lvl": "", + "Sent to Sheriff Date Case Lvl": "", + "Garnishment Employer Case Lvl": "", + "Financial Disclosure Sent Flag Case Lvl": "False", + "Garnishment Paying Flag Case Lvl": "False", + "Garnishment Review Date Case Lvl": "", + "Post Judgement Rate Case Lvl": "", + "Judgement Property Address 1 Case Lvl": "", + "Judgement Property Address 2 Case Lvl": "", + "Judgement Property Address 3 Case Lvl": "", + "Docket Date 1 Case Lvl": "", + "Docket Date 2 Case Lvl": "", + "Docket Date 3 Case Lvl": "", + "Stip Payment Amount Case Lvl": "", + "Stip Payment Frequency Case Lvl": "", + "Stip Total Amount Case Level": "", + "Legal Closed Reason Case Lvl": "" + }, + "dateRepossessed": null, + "repoTypeId": "2000143", + "repoType": 1, + "dateRepoAssigned": "2021-01-11T00:00:00", + "repoAgentId": "2000398" + } + ], + "customFieldMap": { + "Charge Off Status": "", + "Foreclosure Status - Lookup": "", + "Reason for Charge Off": "", + "Post Charge Off Intentions": "", + "BK Discharged Flag": "False", + "BK Reaffirmed Flag": "False", + "Fraud Suspected Flag": "False", + "Management Review Flag": "False", + "Balance at time of Charge Off": "", + "Date Approved for Charge Off": "", + "Date Approved for Foreclosure": "", + "Date Approved for Legal": "", + "Date Approved for Repo": "", + "Foreclosure Requested Flag": "False", + "Legal Requested Flag": "False", + "Lookup Value 4 - Lookup": "", + "Lookup Value 5 - Lookup": "", + "Repo Requested Flag": "False", + "Status Code 1": "", + "Status Code 2": "", + "Status Code 3": "", + "Status Code 4": "", + "Status Code 5": "", + "External Loan Number": "", + "Product Code": "", + "Product Name": "L-P1- Dealer Used Auto/Truck", + "CORS Court Name": "", + "Loan Type": "", + "Original Interest Rate": "", + "Original Rate Type": "", + "Current Rate Type": "", + "Current Rate Term": "", + "Required Payment Amount": "", + "Times Late Count": "", + "Times Late 30 Days Count": "", + "Times Late 60 Days Count": "", + "Times Late 90 Days Count": "", + "Troubled Debt Restructure": "False", + "Modification Date": "", + "Modification Count": "", + "Modification Type": "", + "Financial Condition": "", + "Modification Reason": "", + "Membership Address 1": "", + "Membership Address 2": "", + "Membership City": "", + "Membership State Code": "", + "Membership Postal Code": "", + "User Status Code 1": "REHO", + "User Status Code 2": "", + "Intellect Permanent Comments": "******OUT FOR REPO/LEGAL****3/18/20 TC Have Written permission to speak with jane 8/1/19 Granddaughter (jane ) drives the vehicle 05/24/18 143-file scanned 6/8/18", + "PRI Metro 2 Code": "", + "S1 Metro 2 Code": "", + "S2 Metro 2 Code": "", + "PRI Metro 2 Code Description": "", + "S1 Metro 2 Code Description": "", + "S2 Metro 2 Code Description": "", + "PRI Affiliation Description": "", + "S1 Affiliation Description": "", + "S2 Affiliation Description": "", + "CORS Employer Address 1": "", + "CORS Employer Address 2": "", + "CORS Employer City": "", + "CORS Employer State Code": "", + "CORS Employer Postal Code": "", + "CORS Employer Comment": "", + "CORS Loan CORS date": "", + "CORS Demand Agency": "", + "CORS Assigned Agency": "", + "CORS Bankruptcy Case Number": "", + "CORS Bankruptcy File Date": "", + "CORS Bankruptcy Discharged Date": "", + "CORS Consumer Info Indicator": "False", + "CORS Trustee Name": "", + "CORS Bankruptcy Comment": "", + "CORS Motion Date": "", + "CORS Judgement Recordation": "", + "CORS Judgement Amount": "", + "CORS Judgement Status": "", + "CORS Judgement Comment": "", + "CORS Transaction Code": "", + "CORS Payment Amount": "", + "CORS Payment Frequency": "", + "CORS Payment Start Date": "", + "CORS User Assigned Name": "", + "CORS User Assigned Start Date": "", + "CORS User Assigned End Date": "", + "CORS Workflow Entered Date": "", + "CORS Workflow To Do Date": "", + "CORS Workflow Completed By Date": "", + "CORS Workflow User Name": "JEANNE STELLA", + "CORS Workflow Action Description": "Loan Comment", + "CORS Workflow Comment": "called jane (224)287-2895", + "Organization Number": "", + "Client Number": "", + "Date High Balance": "", + "External Status Date 1": "", + "External Status 2": "", + "External Status Date 2": "", + "Insurance Code 1": "", + "Insurance Status 1": "", + "Insurance Status 2": "", + "Insurance Code 2": "", + "Insurance Status 3": "", + "Insurance Code 3": "", + "Most Recent Credit Score": "", + "Credit Score Less Recent": "", + "Relationship Flag": "", + "Relationship Number": "", + "S1 Original Credit Union": "", + "S1 Most Recent Credit Score": "", + "S1 Credit Score Less Recent": "", + "Client Name": "", + "Mortgage Insurer": "", + "Last Analyzed Date": "", + "Deferred Principal Balance": "", + "Prepetition Unapplied Balance": "", + "Stipulation Unapplied Balance": "", + "Other Funds Payment Amount": "", + "Assistance Payment Amount": "", + "Reserve Account Payment Amount": "", + "Default Interest Amount": "", + "Last NSF Fee Date": "", + "Last Letter Date": "", + "Other Fee Amount": "", + "Last Late Charge Waived Date": "", + "Last Late Charge Waived Amount": "", + "Next Late Charge Amount": "", + "Times Late LOL Count": "", + "Times Late Last 12 Months Count": "", + "Times Late 120 Days Count": "", + "Times Late 150 Days Count": "", + "Times Late 180 Days Count": "", + "First Payment Due Date": "", + "Maturity Type Description": "", + "Inspection Ordered Date": "", + "Last Inspection Date": "", + "Inspection Received Date": "", + "Current Occupancy Code": "", + "Inspected By": "", + "Property Type Description": "", + "Property Condition Description": "", + "Neighborhood Condition": "", + "Collateral 1 Property Type Code": "", + "Collateral 1 Lein Position": "", + "Bankruptcy Case Number": "", + "Bankruptcy Date Filed": "", + "DNU Bankruptcy Chapter Filed": "", + "Bankruptcy Claim Number": "", + "Bankruptcy Trustee Claim Number 1": "", + "Bankruptcy Trustee Claim Number 2": "", + "Bankruptcy Trustee Claim Number 3": "", + "Bankruptcy Name": "", + "Bankruptcy Event Code": "", + "Bankruptcy Event Legal": "", + "Bankruptcy Event Warning": "", + "Active Bankruptcy Flag": "False", + "Active Bankruptcy Plan Flag": "False", + "Bankruptcy Payment Status Date": "", + "Bankruptcy Milestone Due Date": "", + "Bankruptcy Milestone Completion Date": "", + "Bankruptcy Milestone Scheduled Date": "", + "Bankruptcy Milestone Actual Date": "", + "Bankruptcy Servicer Only": "", + "Contact Promise Date 1": "", + "Contact Promise Amount 1": "", + "Contact Promise Date 2": "", + "Contact Promise Amount 2": "", + "Contact Promise Date 3": "", + "Contact Promise Amount 3": "", + "Contact Reason": "", + "Contact Demeanor": "", + "Contact Outcome": "", + "Contact Permanent Comments": "", + "Legal Fee Amount": "", + "Collateral 1 Seller Name": "", + "Collateral 2 Seller Name": "", + "Collateral 3 Seller Name": "", + "Net Capitalized Cost Amount": "", + "Total Payments Count": "", + "Times Late 90 Plus Days Count": "", + "Late Fee Amount": "", + "Date 22 Day Letter Sent": "", + "Date 32 Day Letter Sent": "", + "Date 60 Day Letter Sent": "", + "Collateral 1 Legal Description": "", + "Collateral 2 Legal Description": "", + "Collateral 3 Legal Description": "", + "Collateral 4 Legal Description": "", + "SD Contact Follow Up Date": "", + "CORS Next Follow Up Date": "4/26/2020 12:00:00 AM", + "Waive Fee Reason DropDown": "", + "Waive Fee Reason Dropdown Spanish": "", + "Case Stages 1": "2000025", + "Dollar Amount": "", + "Case Stages 2": "", + "SCRA Flag": "False", + "TCPA Consent": "", + "Request Outcome": "", + "Request Outcome Date": "", + "Offset Request Reason DropDown": "", + "Intellect Next Follow Up Date": "3/31/2020 12:00:00 AM", + "Original Product Type": "", + "Recovery Branch": "57", + "Reason For Repo": "", + "Repo Recovery Address": "", + "Right to Cure Expired": "False", + "RTC Expiration Date": "", + "Repo Type": "", + "Repossession Type": "", + "Secondary Recovery Address": "", + "Redemption Calc WI Perfrmnce Pymnts": "1713.1200", + "Redemption Calc WI Repo Fees": "", + "Redemption Calc WI Total Due": "1713.1200", + "Redemption Calc WI Exp Date": "", + "Redemption Date Current Date": "", + "Redemption Calc WI Expiration Date": "", + "Investor": "", + "Money Field 2": "", + "Money Field 1": "", + "Loan Status": "Out For Repo", + "Redemption Calc IL 30 Percent Amnt Paid": "0.0000", + "Redemption Calc IL 30 Percent Yes or No": "True", + "Redemption Calc IL Total Due": "0.0000", + "Redemption Calc IL Exp Date": "", + "Current LTV Amount": "", + "Original LTV Amount": "", + "Redemption Calc IL Repo Fees": "", + "Redemption Calc IL Expiration Date": "", + "Repo Agencies": "", + "Bankruptcy Trustee": "", + "Title Ordered": "False", + "Title Received": "False", + "Vehicle ReTitled": "False", + "Title Ordered Date": "", + "ReTitled Date": "", + "Title Received Date": "", + "X Deceased Flag Dont Use": "False", + "CPI Active": "False", + "Branch Location": "", + "Collection Agency": "", + "Consumer Credit Counseling Services Flag": "False", + "Skip Trace Requested": "False", + "Loss Mitigation Status": "", + "Judgement Dropdown": "", + "Claim Type": "", + "Refund Status": "", + "Maintenance Requested": "False", + "BK Chapter": "", + "Settlement": "False", + "Repayment Plan Status": "", + "BK No Reaffirmation Flag": "False", + "test": "", + "Totaled Vehicle": "False", + "Fees Due": "", + "Original Input Code": "", + "Fraud Status": "", + "CORS Recovery Amt": "0.0000", + "CORS Recovery Amount Principal": "0.0000", + "Expense Applied Amount": "0.0000", + "Interest Applied Amount": "0.0000", + "Exp Amp": "1180.0000", + "Input Code": "", + "Report Blank": "", + "Totaled Vehicle Notification Date": "", + "Warranty Cancellation Date": "", + "Refunds Requested Date": "", + "Repayment Plan Active": "False", + "Estate Attorney": "", + "Estate Attorney Phone Number": "", + "Personal Representative": "", + "Final Date to File Claim": "", + "Estate Closing Dates": "", + "Date Entered to Probate Finder": "", + "Date Notified Deceased": "", + "Death Notification Type": "", + "Visible Assets": "False", + "CCCS Status": "", + "Consumer Credit Counseling Service Company": "", + "CCCS Amount Approved": "", + "CCCS Decision Date": "", + "Settlement Amount": "", + "Primary Insurance Company": "", + "Primary Insurance Company Phone Number": "", + "Claim Number": "", + "Date of Loss": "", + "Totaled Vehicle Mileage": "", + "Totaled Vehicle Settlement Amount": "", + "Totaled Vehicle Warranty Refund": "", + "Totaled Vehicle Refunds Received Date": "", + "Totaled Vehicle Refunds Received Amount": "", + "GAP Payment Received Date": "", + "Defensive Foreclosure Flag Do Not Use": "False", + "Defensive Foreclosure Flag": "False", + "Collateral Still Exists Flags": "False", + "Bankrupt Collectible Non Filing Borrower Flag": "False", + "Manual Transfer Amount": "", + "Manual Transfer Frequency": "", + "Transfer From Account": "", + "Transfer To Account": "", + "CBR Request": "", + "CBR Date Received": "", + "Additional CBR Information Needed": "", + "CBR Approved": "", + "CBR Yes No Reason": "", + "BRP Sent Flag": "False", + "BRP Sent Date": "", + "Manual Transfer Start Date": "", + "Loss Mitigation Stage": "", + "Loss Mitigation Type": "", + "Date Last RTC Letter Sent": "", + "Skip Trace Phone No1": "", + "Skip Trace Phone No2": "", + "Skip Trace Phone No3": "", + "Skip Trace Phone No4": "", + "Skip Trace Phone No5": "", + "Skip Trace Phone No6": "", + "Skip Trace Phone No7": "", + "Skip Trace Phone No8": "", + "Skip Trace Phone No9": "", + "Skip Trace Phone No10": "", + "Skip Trace Address No1": "", + "Skip Trace Address No2": "", + "Skip Trace Address No3": "", + "Skip Trace Address No4": "", + "Skip Trace Address No5": "", + "Skip Trace Address No6": "", + "Skip Trace Email No1": "", + "Skip Trace Email No2": "", + "Skip Trace Email No3": "", + "Skip Trace Email No4": "", + "Skip Trace Email No5": "", + "Skip Trace POE No1": "", + "Skip Trace POE No2": "", + "Skip Trace Comments": "", + "TLO Basic Flag": "False", + "TLO Comprehensive Flag": "False", + "DRN Flag": "False", + "RDN Flag": "False", + "CarFax Flag": "False", + "Equifax Flag": "False", + "Facebook Flag": "False", + "Skip Trace Date": "", + "GainLoss Value Amount": "", + "GainLoss Value Date": "", + "GainLoss Senior Balance": "", + "GainLoss Senior Name": "", + "GainLoss Value Source": "", + "GainLoss Outstanding Taxes": "", + "GainLoss Marketing Costs": "5000.0000", + "GainLoss 1yr Taxes": "", + "GainLoss Review Date": "", + "GainLoss Marketing Commission": "0.0000", + "GainLoss Total Amount": "-26036.4900", + "Collection Agency Flag": "False", + "Chapter 128 Flag": "False", + "Chapter 128 Case Number": "", + "Chapter 128 Date Filed": "", + "CORS Trustee Number": "", + "CORS Trustee Address": "", + "CORS Trustee Email": "", + "CORS Loan type Description": "L-P1- Dealer Used Auto/Truck", + "Host Code": "L-P1", + "CORS Initial Charge Off Balance Amount": "21036.4900", + "CORS Initial Charge Off Date": "4/9/2020 12:00:00 AM", + "CORS Initial Principal Amount": "21036.4900", + "CORS Initial Interest Amount": "359.0300", + "CORS Initial Expense Amount": "80.0000", + "CORS Transfer Date": "4/9/2020 12:00:00 AM", + "CORS Initial Interest Rate Type": "Fixed Rate", + "CORS Initial Interest Rate Percent": "6.0500", + "CORS Initial Day Count": "", + "CORS Current Principal Amount": "21036.4900", + "CORS Current Interest Amount": "1311.8900", + "CORS Current Expense Amount": "1180.0000", + "CORS Curent Non Reimbursable Expense Amount": "0.0000", + "CORS Current Other Amount": "0.0000", + "CORS Non Reimbursable Other Amount": "0.0000", + "CORS Current Loan Balance Amount": "23528.3800", + "Attorney Firm": "", + "Legal Requested State": "", + "Garnishment Flag": "False", + "Money Judgement Flag": "False", + "Replevin Judgement Flag": "False", + "Stipulation Flag": "False", + "Summary Judgement Flag": "False", + "Wage Assignment Flag": "False", + "Date No Phone Number Letter Sent": "", + "Fraud Data Type": "Charge Off", + "Active Fraud CRIF File": "TRUE" + } + }, + "loanDetail": { + "MemberId": 7115520, + "LoanId": 143, + "ExternalLoanId": 0, + "IndividualId": [ + 1017491 + ], + "Borrowers": [ + { + "IndividualId": 1017491, + "Name": "janice DOE", + "Type": "Borrower", + "Address": "35980 N HUNT AVE , INGLESIDE, IL 60041-9174", + "TaxId": "330-34-1724", + "Association": "Individual Contract (Primary)", + "LastAssociationCodeChangedDate": "2018-02-19T00:00:00", + "Metro2ConsumerInformationIndicator": "", + "CoborrowerIsSpouse": false, + "OwnershipPercentage": 0.0, + "PercentageDescription": "" + } + ], + "LoanType": "Regular Loan", + "Title": "LOANS WRITTEN OFF", + "Alerts": "0", + "Product": "LOANS WRITTEN OFF", + "ProductCode": 98, + "Template": "Regular Loan", + "ProductId": 204459, + "ProductDescription": "", + "ProductCategory": "Loan", + "ProductClass": "Regular Loan", + "AccountType": 98, + "Status": "Written Off", + "ClosedDate": "0001-01-01T00:00:00", + "Category": "", + "Classification": " ", + "MetroAcctType": "00", + "SMSA": "", + "Officer": "5737", + "OtherSecurity": " ", + "NoteNumber": "1085972", + "LastMaintenance": "0001-01-01T00:00:00", + "WrittenOffDate": "2020-04-09T00:00:00", + "CreditCardNumber": "", + "LastCycleDate": "0001-01-01T00:00:00", + "LegalDescription": "", + "PropertyType": "", + "PurposeCode": "", + "CollateralCode": "", + "RefinanceCount": "0", + "LastRefinanceDate": "0001-01-01T00:00:00", + "LdcNumber": "", + "Messages": "", + "OriginalAmount": 22195.81, + "OriginationDate": "2018-01-24T00:00:00", + "Balance": 21036.49, + "AvailableBalance": 0.0, + "Limit": 0.0, + "EscrowBalance": 0.0, + "Payoff": 21036.49, + "UnappliedFundsBalance": 0.0, + "CashAdvanceBalance": 0.0, + "PurchaseAdvanceBalance": 0.0, + "ActiveAuthorizationAmount": 0.00, + "EscrowDividends": 0.0, + "PledgeType": "", + "MiscCharge1": "", + "MiscCharge2": "", + "MiscCharge3": "", + "MiscChargeCode1": "", + "MiscChargeCode2": "", + "MiscChargeCode3": "", + "InterestMemoed": 0.00, + "InterestAccruedDate": "2020-02-11T00:00:00", + "PaymentInterestDue": 0.00, + "PayoffInterestDue": 0.00, + "LateChargeMethod": "Not Assessed", + "LateCharge": 0.0, + "LateChargeDate": "2020-03-10T00:00:00", + "CashAdvance": 0.0, + "Insurance": "XX", + "LastStatementLateCharges": 0.0, + "LastStatementMiscFees": 0.0, + "LastStatementPurchaseAdvances": 0.0, + "LastStatementCashAdvances": 0.0, + "LastStatementCashAdvanceFees": 0.0, + "LastStatementMiscDebits": 0.0, + "LastStatementTotalPayments": 0.0, + "LastStatementCreditsPosted": 0.0, + "LastStatementAccruedInterest": 0.0, + "LastStatementDate": "0001-01-01T00:00:00", + "LastStatementPurchaseAdvanceBalance": 0.0, + "LastStatementEndingBalance": 0.0, + "DelinquentAmount": 0.0, + "LastStatementMonthlyMinimum": 0.0, + "LastStatementRequiredDue": 0.0, + "LastStatementRequiredPayment": 0.0, + "ScheduledPayment": 571.04, + "NextDueDate": "2019-08-10T00:00:00", + "PartialPaymentAmount": 201.72, + "PreviousDate": "2019-08-10T00:00:00", + "PaymentFrequency": "Monthly", + "AlignmentDate": "0001-01-01T00:00:00", + "PaymentMethod": "Counter Item", + "SourceAccount": "", + "ProcessingGroup": "0", + "LoanCouponDate": "0001-01-01T00:00:00", + "RequiredPaymentDue": 571.04, + "FirstPaymentDate": "2018-03-10T00:00:00", + "AlternatePaymentAmount": 0.00, + "AlternateBeginDate": "0001-01-01T00:00:00", + "AlternateEndDate": "0001-01-01T00:00:00", + "PaymentSkips": 0, + "FinalPaymentAmount": 369.42, + "FinalPaymentDate": "2024-02-10T00:00:00", + "CycleAmount": 0.0, + "VariableRatePaymentChange": "Default Product", + "VariableRateCode": "F", + "MinimumDue": 0.00, + "FrequencyPayment": 0.0, + "EscrowPayment": 0.0, + "PrincipalAndInterestPayment": 0.0, + "PaymentLoanDefinitionNumber": "", + "RateLoanDefinitionNumber": "", + "VacationWeeks": 0, + "PayrollRepaidWeeklyPaymentCount": 0, + "BaseRate": 0.000, + "TieredRateAdj": 0.000, + "ManualRateAdj": 0.000, + "Rate": 0.000, + "ManualRate": 0.0, + "APR": 6.050, + "OriginalInterestRate": 6.050, + "AlternateInterestRate": 0.000, + "LastRateChange": "2018-01-24T00:00:00", + "RealEstateMargin": 0.0, + "Amortization": "P & I Amt", + "AmortizationTerm": 0, + "MonthlyTerm": 72, + "NumberOfPayments": 72, + "InterestYTD": 100.00, + "InterestPYTD": 1136.93, + "InterestDaily": 0.01, + "PrincipalYTD": 21036.49, + "PrincipalPYTD": 3679.53, + "LateChargeYTD": 0.00, + "LateChargePYTD": 81.09, + "PaymentHistory": "D00000665432", + "LastPaymentDue": "0001-01-01T00:00:00", + "PaymentsPastDue": 0, + "DaysPastDue": 0, + "MonthsPastDue": 0, + "CurrentStatementLateCharges": 0.0, + "CurrentStatementMiscFees": 0.0, + "CurrentStatementPurchaseAdvances": 0.0, + "CurrentStatementCashAdvances": 0.0, + "CurrentStatementCashAdvanceFees": 0.0, + "CurrentStatementMiscDebits": 0.0, + "CurrentStatementTotalPayments": 0.0, + "CurrentStatementTotalCredits": 0.0, + "DelinquentPaymentDueDate": "0001-01-01T00:00:00", + "IsInactive": false, + "StatementFrequency": "Default:N", + "AppraisedValue": 0.0, + "LocCycleDay": 0, + "IgnorePledge": false, + "OpenEndPlan": false, + "OpenEndCategory": "None", + "PointsPaid": 0.00, + "CurtailmentAmount": 0.0, + "CurtailmentDate": "0001-01-01T00:00:00", + "InsuranceExpirationDate": "2024-02-10T00:00:00", + "LifeInsuranceMI": "XX", + "DisabilityInsuranceMI": " ", + "LifeActivityInsuranceCode": " ", + "DisabilityActivityInsuranceCode": " ", + "LoanCoupons": true, + "PaidbyGrace": false, + "EscrowAccount": "", + "EscrowInterestPaid": false, + "NextPaymentAdjustmentDate": "0001-01-01T00:00:00", + "EffectivePayment": 571.04, + "InterestRate": 0.000, + "LastPaymentDate": "2020-01-22T00:00:00", + "LastPurchaseDate": "0001-01-01T00:00:00", + "LastCashAdvanceDate": "0001-01-01T00:00:00", + "BlockCode": "", + "ReclassCode": "", + "OutstandingAuthCount": 0, + "OutstandingAuthAmount": 0.0, + "InterestType": "Fixed", + "AlternateLoanNumber": "", + "ArmIndex": 0, + "DeductionOption": "", + "DelinquentPaymentSkips": false, + "FirstPayment": false, + "InterestDue": 0.00, + "LoanLevelSkips": false, + "PaymentReduction": false, + "WaiveLateCharge": false, + "ExcessPaymentTargetAccountId": 0, + "ExcessPaymentMemberId": 0, + "CustRate": false, + "IntRateMethod": "", + "Margin": 0.0, + "Index": "", + "RndFactPct": 0.0, + "RndFactOpt": "", + "IntRateCeiling": 0.0, + "IntRateFloor": 0.0, + "MaxDnRateChgLife": 0.0, + "MaxUpRateChgLife": 0.0, + "MaxDnRateChgPeriod": 0.0, + "MaxUpRateChgPeriod": 0.0, + "MinDnRateChgPeriod": 0.0, + "MinUpRateChgPeriod": 0.0, + "PmtAdjPeriod": 0, + "DaysPriorToPeriodicRateAdj": 0, + "DaysPriorToInitialRateAdjustment": 0, + "FirstAdjustmentIsEstimate": false, + "InitialAnalysisEstimateDate": "0001-01-01T00:00:00", + "EstimatePerformed": "", + "BalloonTerm": 0, + "PledgeTypeDescription": "", + "SystemApproved": "Yes", + "VINList": [ + "1FMCU0GX7FUB09590" + ], + "MortgageLoanOriginator": 0, + "LastPaymentPrincipal": 0.00, + "LastPaymentInterest": 100.00, + "LastPaymentFees": 0.00, + "LastPaymentLateCharges": 0.00, + "LastPaymentEscrowImpound": null, + "LastPaymentCurtailment": null, + "LastPaymentTotal": 100.00, + "TransferDay": 0, + "SourceMember": 0, + "AdjustPurchaseAccrual": false, + "AnnualFee": false, + "AnnualFeeDate": "0001-01-01T00:00:00", + "BalaceLimit": 0.00, + "CloseOnZero": false, + "DrawDate": "0001-01-01T00:00:00", + "Form1098Option": "", + "MethodADelinquency": false, + "NumberofSkips": 0, + "OverlimitAmount": 0.00, + "OverlimitDate": "0001-01-01T00:00:00", + "PurchaseAdvBalance": 0.00, + "SkipDate": "0001-01-01T00:00:00", + "ToBeDelinquent": true, + "WaiveDelinquencyNotice": false, + "WaiveBillingNotice": false, + "WaiveInterest": false, + "LastStatementMinimumPayment": 0.0, + "LastStatementCycleRequiredPayment": 0.0, + "ExemptNonResident": false, + "YTDNonresidentWithholding": null, + "PYTDNonresidentWithholding": null, + "InCollection": "OUT", + "UniversalLoanId": "", + "RateLockDate": "0001-01-01T00:00:00", + "ActiveStopPays": "", + "ErrorMessage": [] + }, + "memberDetail": { + "MemberId": 7115520, + "MemberName": "janice DOE", + "PrimaryIndividualId": 1017491, + "MemberType": "REGULAR", + "Affiliation": "", + "MemberSince": "2018-02-19T00:00:00", + "Miscellaneous1": "", + "Miscellaneous2": "", + "OriginalOpenBranch": "INDIRECT LENDING DEPT", + "WithholdingCode": "", + "ExpeditedFunds": 0.00, + "ExpeditedFundsDate": "0001-01-01T00:00:00", + "AccessLevel": 1, + "StandardStatementCycle": 1, + "StandardStatementCode": "", + "StandardStatementMethod": "Microfiche", + "CATFeeCounter": 0, + "CATFeeDate": "0001-01-01T00:00:00", + "CreditCardStatementCycle": 1, + "CreditCardStatementCode": "", + "CreditCardStatementMethod": "Hold", + "AccountCount": 1, + "AccountBalance": 0.00, + "LoanCount": 1, + "LoanBalance": 21036.49, + "LoansDelinquentCount": 1, + "LoansDelinquent": 21036.49, + "LoansWrittenOffCount": 1, + "LoansWrittenOff": 21036.49, + "LoansInCollectionCount": 0, + "LoansInCollection": 0.0, + "Password": "", + "PinLock": "Unlock", + "BranchId": 57, + "RelationshipPricingLevel": 0, + "RelationshipPricingLevelPermanent": "No", + "RelationshipPricingDescription": "", + "PreviousRelationshipPricingLevel": 0, + "LastRelationshipPricingLevelAnalysisDate": "", + "LastRelationshipPricingLevelChangeDate": "4/9/2020 12:00:00 AM", + "InhibitActivity": "No", + "WrittenOffLoan": "Yes", + "LoanInCollection": "No", + "PurgeMembership": "Yes", + "Address": { + "AddressId": 3520187, + "Line1": "35980 N HUNT AVE", + "Line2": "", + "Line3": "", + "City": "INGLESIDE", + "State": "IL", + "ZipCode": "60041-9174", + "Country": "US", + "CountyName": "", + "AddressType": "", + "IsPrimary": true, + "IsInternational": false, + "AddressVerification": 35980, + "Occupancy": "", + "StartDate": "0001-01-01T00:00:00", + "EndDate": "0001-01-01T00:00:00", + "LongAddress1": "35980 N HUNT AVE", + "LongAddress2": "", + "Membership": [], + "CoBorrower": [], + "UseAlternateAsOf": "0001-01-01T00:00:00", + "RestorePrimaryAsOf": "0001-01-01T00:00:00", + "AlternateType": "", + "Comments": "", + "Met2AddressIndicator": "", + "UspsVerified": false, + "AddressMatchStatus": null, + "IsHSA": false + } + }, + "repoAccount": { + "repoId": 465, + "accountNo": "7115520143", + "status": "O4R", + "memberNo": 7115520, + "loanNo": 143, + "accountTypeCode": "AUI", + "origAccountTypeCode": null, + "branch": 57, + "collector": "", + "balance": 21036.49, + "dueToPayDate": "2019-08-10T00:00:00", + "o4RDate": "2020-03-18T10:00:00", + "dateFirstDelinquent": "2020-07-01T00:00:00", + "delinquentAmount": 0, + "daysDelinquent": 221, + "paidSkipAmount": null, + "subStatus": "", + "requiredPaymentAmount": 0, + "currentDelinquentAmount": 0, + "lstPmtAmt": 0, + "origAmount": 0, + "lastPaymentDate": "2020-01-22T00:00:00", + "dateFirstIntellect": "2018-03-15T15:00:00", + "primaryIndividualId": "1017491", + "bankruptcy": "False", + "manualRedemptionDate": null, + "redemptionExpiredDate": null, + "borrowers": [ + { + "repoId": 465, + "individualId": "1017491", + "ownershipType": 6, + "individualName": "janice DOE" + } + ], + "collaterals": [ + { + "collateralId": 470, + "repoId": 465, + "vin": "1FMCU0GX7FUB09590", + "make": "FORD TRUCK", + "model": "Escape", + "year": 2015, + "description": "2015 FORD TRUCK", + "vehicleType": null, + "bodyStyle": null, + "inoperable": null, + "collateralTypeId": null, + "retitledInLandmarkName": null, + "refCollateralId": null, + "repoCompanySelections": [ + { + "id": 470, + "collateralId": 470, + "repoType": 1, + "repoCompanyId": 11, + "repoCompanyAssignmentDate": "2019-10-07T00:00:00", + "dateRepoed": null, + "dateTimeCreated": "2019-11-04T15:29:34.917" + }, + { + "id": 4426, + "collateralId": 470, + "repoType": 1, + "repoCompanyId": 11, + "repoCompanyAssignmentDate": "2019-11-22T12:00:00", + "dateRepoed": "2020-01-04T06:00:00", + "dateTimeCreated": "2019-11-22T14:02:56.67" + }, + { + "id": 4735, + "collateralId": 470, + "repoType": 3, + "repoCompanyId": 1, + "repoCompanyAssignmentDate": "2020-01-04T12:00:00", + "dateRepoed": "2020-02-13T06:00:00", + "dateTimeCreated": "2020-01-04T12:58:45.74" + }, + { + "id": 5083, + "collateralId": 470, + "repoType": 4, + "repoCompanyId": 5, + "repoCompanyAssignmentDate": "2020-02-13T12:00:00", + "dateRepoed": "2020-03-18T05:00:00", + "dateTimeCreated": "2020-02-14T09:34:30.053" + }, + { + "id": 5295, + "collateralId": 470, + "repoType": 1, + "repoCompanyId": 13, + "repoCompanyAssignmentDate": "2020-08-31T05:00:00", + "dateRepoed": "2021-01-12T14:01:06.067", + "dateTimeCreated": "2020-03-18T11:01:41.74" + }, + { + "id": 6075, + "collateralId": 470, + "repoType": 1, + "repoCompanyId": 13, + "repoCompanyAssignmentDate": "2021-01-11T00:00:00", + "dateRepoed": null, + "dateTimeCreated": "2021-01-12T14:01:06.067" + } + ] + } + ], + "repoStatusChanges": [ + { + "id": 1356, + "repoId": 465, + "statusFrom": "None", + "statusTo": "O4R", + "changedBy": "Importer", + "changedDate": "2019-08-14T10:01:12.663" + }, + { + "id": 1357, + "repoId": 465, + "statusFrom": "O4R", + "statusTo": "REHO", + "changedBy": "Diana Vandebogert", + "changedDate": "2019-09-10T08:46:27.983" + }, + { + "id": 1358, + "repoId": 465, + "statusFrom": "REHO", + "statusTo": "O4R", + "changedBy": "Importer", + "changedDate": "2019-10-07T15:01:02.717" + }, + { + "id": 1359, + "repoId": 465, + "statusFrom": "O4R", + "statusTo": "REHO", + "changedBy": "Importer", + "changedDate": "2019-10-22T13:01:14.183" + }, + { + "id": 13770, + "repoId": 465, + "statusFrom": "REHO", + "statusTo": "O4R", + "changedBy": "System User", + "changedDate": "2019-11-22T14:02:56.6" + }, + { + "id": 15862, + "repoId": 465, + "statusFrom": "O4R", + "statusTo": "RECA", + "changedBy": "Diana Vandebogert", + "changedDate": "2020-03-18T10:27:22.81" + }, + { + "id": 15868, + "repoId": 465, + "statusFrom": "RECA", + "statusTo": "O4R", + "changedBy": "System User", + "changedDate": "2020-03-18T11:01:41.713" + }, + { + "id": 16038, + "repoId": 465, + "statusFrom": "O4R", + "statusTo": "REHO", + "changedBy": "System User", + "changedDate": "2020-03-20T14:04:57.58" + }, + { + "id": 17169, + "repoId": 465, + "statusFrom": "REHO", + "statusTo": "O4R", + "changedBy": "Jayson Tirado", + "changedDate": "2020-08-31T16:03:23.16" + }, + { + "id": 18331, + "repoId": 465, + "statusFrom": "O4R", + "statusTo": "REHO", + "changedBy": "System System", + "changedDate": "2021-01-12T14:01:06.093" + }, + { + "id": 18333, + "repoId": 465, + "statusFrom": "REHO", + "statusTo": "O4R", + "changedBy": "System System", + "changedDate": "2021-01-14T09:01:10.217" + } + ], + "refundStatus": null, + "dateClosed": null, + "referenceId": 889577, + "referenceCaseId": 1, + "referenceStatus": "Written Off", + "accountLastProcessed": "2021-01-14T11:31:28.98", + "writtenOffDate": null + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/Processor/written-off-account.json b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/Processor/written-off-account.json new file mode 100644 index 0000000..229cbfe --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/Processor/written-off-account.json @@ -0,0 +1,2033 @@ +{ + "repoLetters": [ + { + "ActionCode": "700", + "Description": "RTC-Illinois", + "DaysToWait": 15, + "WhenLetterIsSent": "BeforeO4R", + "LetterDescription": "None" + }, + { + "ActionCode": "701", + "Description": "Right to Reinstate/Redeem-Illinois", + "DaysToWait": 22, + "WhenLetterIsSent": "AfterO4R", + "LetterDescription": "Right to Reinstate/Redeem" + }, + { + "ActionCode": "702", + "Description": "Affidavit of Defense-Illinois", + "DaysToWait": 22, + "WhenLetterIsSent": "AfterO4R", + "LetterDescription": "None" + }, + { + "ActionCode": "703", + "Description": "Notice of Plan to Sell-Illinois", + "DaysToWait": 22, + "WhenLetterIsSent": "AfterO4R", + "LetterDescription": "None" + }, + { + "ActionCode": "704", + "Description": "Repo: Surplus-Deficiency Notice", + "DaysToWait": 0, + "WhenLetterIsSent": "AfterSale", + "LetterDescription": "None" + }, + { + "ActionCode": "ILLSU", + "Description": "ILLINOIS SURRENDER", + "DaysToWait": 0, + "WhenLetterIsSent": "BeforeO4R", + "LetterDescription": "Surrender (Illinois)" + }, + { + "ActionCode": "LTR34", + "Description": "Repo-Notice of Repossession", + "DaysToWait": 15, + "WhenLetterIsSent": "AfterO4R", + "LetterDescription": "Notice of Repossession" + }, + { + "ActionCode": "LTR35", + "Description": "WI Repo-Notice of Sale", + "DaysToWait": 15, + "WhenLetterIsSent": "AfterO4R", + "LetterDescription": "Notice of Plan to Sell - WI" + }, + { + "ActionCode": "LTR36", + "Description": "WI Repo-Sale of Collateral Notice", + "DaysToWait": 15, + "WhenLetterIsSent": "AfterO4R", + "LetterDescription": "None" + }, + { + "ActionCode": "RTC", + "Description": "Notice to repossess/prior expired RTC", + "DaysToWait": 0, + "WhenLetterIsSent": "BeforeO4R", + "LetterDescription": "None" + }, + { + "ActionCode": "RTC, 1", + "Description": "RTC Non Auto & Non Cycle", + "DaysToWait": 15, + "WhenLetterIsSent": "BeforeO4R", + "LetterDescription": "WI Unsecured RTC" + }, + { + "ActionCode": "RTC, 3", + "Description": "RTC-AUTO LOANS-WI", + "DaysToWait": 15, + "WhenLetterIsSent": "BeforeO4R", + "LetterDescription": "WI Auto RTC" + }, + { + "ActionCode": "RTC2", + "Description": "RTC New Law", + "DaysToWait": 15, + "WhenLetterIsSent": "BeforeO4R", + "LetterDescription": "None" + }, + { + "ActionCode": "RTCSP", + "Description": "SPANISH RTC WI AUTO LOANS", + "DaysToWait": 15, + "WhenLetterIsSent": "BeforeO4R", + "LetterDescription": "None" + }, + { + "ActionCode": "VOL", + "Description": "Wisconsin Surrender", + "DaysToWait": 0, + "WhenLetterIsSent": "BeforeO4R", + "LetterDescription": "Surrender (Wisconsin)" + } +], + "coreTransactions": [ + { + "postingDate": "2020-10-08T12:24:22", + "effectiveDate": "2020-10-08T00:00:00", + "operatorId": 4739, + "drawerName": "", + "drawerBranch": "", + "transactionType": "Write Off Held", + "transactionNumber": 289, + "transactionTypeCode": "HD ", + "transactionAmount": 0, + "balance": 7688.78, + "principalAmount": 0, + "interest": 0, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 671259558, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "*Held Amount= $7,688.78" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2020-10-08T12:24:20", + "effectiveDate": "2020-10-08T00:00:00", + "operatorId": 4739, + "drawerName": "", + "drawerBranch": "", + "transactionType": "LOAN WRITTEN OFF", + "transactionNumber": 260, + "transactionTypeCode": "WOFF", + "transactionAmount": 7688.78, + "balance": 0, + "principalAmount": -7688.78, + "interest": 0, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 671259555, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "719-1", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "LOANS WRITTEN OFF" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2020-08-05T00:00:00", + "effectiveDate": "2020-08-04T00:00:00", + "operatorId": 6051, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ELECTRONIC LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "PR ", + "transactionAmount": 200, + "balance": 7688.78, + "principalAmount": 0, + "interest": 63.19, + "escrowAmount": 0, + "processingGroup": "111", + "batchControlId": 6387, + "historyItemId": 656466608, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 136.81, + "lateCharge": "136.81", + "historyDetails": { + "transactionDescription": "LandmarkCU TRANSFER 080420" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2020-01-24T00:00:00", + "effectiveDate": "2020-01-23T00:00:00", + "operatorId": 6051, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ELECTRONIC LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "PR ", + "transactionAmount": 600, + "balance": 7688.78, + "principalAmount": -477.39, + "interest": 99.81, + "escrowAmount": 0, + "processingGroup": "111", + "batchControlId": 3814, + "historyItemId": 612907268, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 22.8, + "lateCharge": "22.80", + "historyDetails": { + "transactionDescription": "LandmarkCU TRANSFER 012320" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-12-27T00:00:00", + "effectiveDate": "2019-12-27T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "FLEXIBLE LOAN CHANGE", + "transactionNumber": 289, + "transactionTypeCode": "MAN ", + "transactionAmount": 0, + "balance": 8166.17, + "principalAmount": 0, + "interest": 0, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 606719571, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": " OLD PMT=538.26 NEW PMT=456.04 Policy #MQK0296512" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-12-26T00:00:00", + "effectiveDate": "2019-12-24T00:00:00", + "operatorId": 6051, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ELECTRONIC LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "PR ", + "transactionAmount": 538.26, + "balance": 8166.17, + "principalAmount": -462.04, + "interest": 49.31, + "escrowAmount": 0, + "processingGroup": "111", + "batchControlId": 3430, + "historyItemId": 606571940, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 26.91, + "lateCharge": "26.91", + "historyDetails": { + "transactionDescription": "LandmarkCU TRANSFER 122419" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-12-11T00:00:00", + "effectiveDate": "2019-12-10T00:00:00", + "operatorId": 6051, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ELECTRONIC LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "PR ", + "transactionAmount": 538.26, + "balance": 8628.21, + "principalAmount": -482.47, + "interest": 55.79, + "escrowAmount": 0, + "processingGroup": "111", + "batchControlId": 3230, + "historyItemId": 603289438, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "LandmarkCU TRANSFER 121019" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-11-26T00:00:00", + "effectiveDate": "2019-11-25T00:00:00", + "operatorId": 6051, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ELECTRONIC LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "PR ", + "transactionAmount": 538.26, + "balance": 9110.68, + "principalAmount": -526.46, + "interest": 11.8, + "escrowAmount": 0, + "processingGroup": "111", + "batchControlId": 3014, + "historyItemId": 599642413, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "LandmarkCU TRANSFER 112519" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-11-25T00:00:00", + "effectiveDate": "2019-11-22T00:00:00", + "operatorId": 6051, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ELECTRONIC LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "PR ", + "transactionAmount": 538.26, + "balance": 9637.14, + "principalAmount": -474.2, + "interest": 37.15, + "escrowAmount": 0, + "processingGroup": "111", + "batchControlId": 2993, + "historyItemId": 599418090, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 26.91, + "lateCharge": "26.91", + "historyDetails": { + "transactionDescription": "LandmarkCU TRANSFER 112219" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-11-14T00:00:00", + "effectiveDate": "2019-11-13T00:00:00", + "operatorId": 6051, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ELECTRONIC LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "PR ", + "transactionAmount": 538.26, + "balance": 10111.34, + "principalAmount": -452.02, + "interest": 86.24, + "escrowAmount": 0, + "processingGroup": "111", + "batchControlId": 2850, + "historyItemId": 597101286, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "LandmarkCU TRANSFER 111319" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-10-25T00:00:00", + "effectiveDate": "2019-10-24T00:00:00", + "operatorId": 6051, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ELECTRONIC LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "PR ", + "transactionAmount": 538.26, + "balance": 10563.36, + "principalAmount": -198.86, + "interest": 285.57, + "escrowAmount": 0, + "processingGroup": "111", + "batchControlId": 2563, + "historyItemId": 592601126, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 53.83, + "lateCharge": "53.83", + "historyDetails": { + "transactionDescription": "LandmarkCU TRANSFER 102419" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-08-21T00:00:00", + "effectiveDate": "2019-08-20T00:00:00", + "operatorId": 6051, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ELECTRONIC LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "PR ", + "transactionAmount": 600, + "balance": 10762.22, + "principalAmount": -441.88, + "interest": 131.21, + "escrowAmount": 0, + "processingGroup": "111", + "batchControlId": 1629, + "historyItemId": 578113138, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 26.91, + "lateCharge": "26.91", + "historyDetails": { + "transactionDescription": "LandmarkCU TRANSFER 082019" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-08-16T00:00:00", + "effectiveDate": "2019-08-16T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "FLEXIBLE LOAN CHANGE", + "transactionNumber": 289, + "transactionTypeCode": "MAN ", + "transactionAmount": 0, + "balance": 11204.1, + "principalAmount": 0, + "interest": 0, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 577002288, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": " OLD PMT=456.04 NEW PMT=538.26 Policy #MQK0296512" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-08-16T00:00:00", + "effectiveDate": "2019-08-16T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "FLEXIBLE LOAN CHANGE", + "transactionNumber": 289, + "transactionTypeCode": "MAN ", + "transactionAmount": 0, + "balance": 11204.1, + "principalAmount": 0, + "interest": 0, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 577002286, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": " OLD PMT=593.43 NEW PMT=456.04 Policy #MQK0296512" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-08-13T00:00:00", + "effectiveDate": "2019-08-13T00:00:00", + "operatorId": 6056, + "drawerName": "", + "drawerBranch": "", + "transactionType": "CREDIT ADJUSTMENT", + "transactionNumber": 225, + "transactionTypeCode": " ", + "transactionAmount": 366, + "balance": 11204.1, + "principalAmount": -366, + "interest": 0, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 1519, + "historyItemId": 576472365, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "Policy #MQK0296512" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-07-24T00:00:00", + "effectiveDate": "2019-07-23T00:00:00", + "operatorId": 6051, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ELECTRONIC LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "PR ", + "transactionAmount": 593.43, + "balance": 11570.1, + "principalAmount": -363.59, + "interest": 170.5, + "escrowAmount": 0, + "processingGroup": "111", + "batchControlId": 1220, + "historyItemId": 571833995, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 59.34, + "lateCharge": "59.34", + "historyDetails": { + "transactionDescription": "LandmarkCU TRANSFER 072319" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-07-11T10:03:44", + "effectiveDate": "2019-07-08T00:00:00", + "operatorId": 5135, + "drawerName": "", + "drawerBranch": "", + "transactionType": "CREDIT ADJUSTMENT", + "transactionNumber": 215, + "transactionTypeCode": "JANC", + "transactionAmount": 593.43, + "balance": 11933.69, + "principalAmount": 466.33, + "interest": -97.43, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 569166437, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "803-100", + "totalFee": -29.67, + "lateCharge": "-29.67", + "historyDetails": { + "transactionDescription": "REVERSE LandmarkCU TRANSFER RETURNED R01 INSUFFICIENT FUNDS" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-07-09T00:00:00", + "effectiveDate": "2019-07-08T00:00:00", + "operatorId": 6051, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ELECTRONIC LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "PR ", + "transactionAmount": 593.43, + "balance": 11467.36, + "principalAmount": -466.33, + "interest": 97.43, + "escrowAmount": 0, + "processingGroup": "111", + "batchControlId": 1021, + "historyItemId": 568698791, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 29.67, + "lateCharge": "29.67", + "historyDetails": { + "transactionDescription": "LandmarkCU TRANSFER 070819" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-06-19T00:00:00", + "effectiveDate": "2019-06-18T00:00:00", + "operatorId": 6051, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ELECTRONIC LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "PR ", + "transactionAmount": 593.43, + "balance": 11933.69, + "principalAmount": -486.95, + "interest": 106.48, + "escrowAmount": 0, + "processingGroup": "111", + "batchControlId": 751, + "historyItemId": 564184070, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "LandmarkCU TRANSFER 061819" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-05-29T00:00:00", + "effectiveDate": "2019-05-28T00:00:00", + "operatorId": 6051, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ELECTRONIC LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "PR ", + "transactionAmount": 593.43, + "balance": 12420.64, + "principalAmount": -290.22, + "interest": 243.87, + "escrowAmount": 0, + "processingGroup": "111", + "batchControlId": 448, + "historyItemId": 559317582, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 59.34, + "lateCharge": "59.34", + "historyDetails": { + "transactionDescription": "LandmarkCU TRANSFER 052819" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-04-12T00:00:00", + "effectiveDate": "2019-04-11T00:00:00", + "operatorId": 6051, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ELECTRONIC LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "PR ", + "transactionAmount": 593.43, + "balance": 12710.86, + "principalAmount": -345.24, + "interest": 218.52, + "escrowAmount": 0, + "processingGroup": "111", + "batchControlId": 9835, + "historyItemId": 549275726, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 29.67, + "lateCharge": "29.67", + "historyDetails": { + "transactionDescription": "LandmarkCU TRANSFER 041119" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-03-04T00:00:00", + "effectiveDate": "2019-03-01T00:00:00", + "operatorId": 6051, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ELECTRONIC LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "PR ", + "transactionAmount": 593.43, + "balance": 13056.1, + "principalAmount": -301.9, + "interest": 232.19, + "escrowAmount": 0, + "processingGroup": "111", + "batchControlId": 9264, + "historyItemId": 540696012, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 59.34, + "lateCharge": "59.34", + "historyDetails": { + "transactionDescription": "LandmarkCU TRANSFER 030119" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-02-14T00:00:00", + "effectiveDate": "2019-02-14T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "FLEXIBLE LOAN CHANGE", + "transactionNumber": 289, + "transactionTypeCode": "MAN ", + "transactionAmount": 0, + "balance": 13358, + "principalAmount": 0, + "interest": 0, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 536605778, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": " OLD PMT=456.04 NEW PMT=593.43 Policy #MQK0296512" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-02-14T00:00:00", + "effectiveDate": "2019-02-14T00:00:00", + "operatorId": 0, + "drawerName": "", + "drawerBranch": "", + "transactionType": "FLEXIBLE LOAN CHANGE", + "transactionNumber": 289, + "transactionTypeCode": "MAN ", + "transactionAmount": 0, + "balance": 13358, + "principalAmount": 0, + "interest": 0, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 0, + "historyItemId": 536605777, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": " OLD PMT=608.59 NEW PMT=456.04 Policy #MQK0183130" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-02-13T00:00:00", + "effectiveDate": "2019-02-13T00:00:00", + "operatorId": 6056, + "drawerName": "", + "drawerBranch": "", + "transactionType": "LOAN ADVANCE", + "transactionNumber": 230, + "transactionTypeCode": "C ", + "transactionAmount": 1523, + "balance": 13358, + "principalAmount": 1523, + "interest": 0, + "escrowAmount": 0, + "processingGroup": "", + "batchControlId": 9010, + "historyItemId": 536535097, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "Policy #MQK0296512" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2019-01-15T00:00:00", + "effectiveDate": "2019-01-14T00:00:00", + "operatorId": 6051, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ELECTRONIC LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "PR ", + "transactionAmount": 608.59, + "balance": 11835, + "principalAmount": -437.88, + "interest": 140.28, + "escrowAmount": 0, + "processingGroup": "111", + "batchControlId": 8621, + "historyItemId": 530747629, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 30.43, + "lateCharge": "30.43", + "historyDetails": { + "transactionDescription": "LandmarkCU TRANSFER 011419" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2018-12-18T00:00:00", + "effectiveDate": "2018-12-17T00:00:00", + "operatorId": 6051, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ELECTRONIC LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "PR ", + "transactionAmount": 608.59, + "balance": 12272.88, + "principalAmount": -571.89, + "interest": 36.7, + "escrowAmount": 0, + "processingGroup": "111", + "batchControlId": 8256, + "historyItemId": 525051593, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 0, + "lateCharge": "", + "historyDetails": { + "transactionDescription": "LandmarkCU TRANSFER 121718" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2018-12-11T00:00:00", + "effectiveDate": "2018-12-10T00:00:00", + "operatorId": 6051, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ELECTRONIC LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "PR ", + "transactionAmount": 608.59, + "balance": 12844.77, + "principalAmount": -217.14, + "interest": 330.59, + "escrowAmount": 0, + "processingGroup": "111", + "batchControlId": 8158, + "historyItemId": 523593960, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 60.86, + "lateCharge": "60.86", + "historyDetails": { + "transactionDescription": "LandmarkCU TRANSFER 121018" + }, + "amountToCurtailment": 0 + }, + { + "postingDate": "2018-10-10T00:00:00", + "effectiveDate": "2018-10-09T00:00:00", + "operatorId": 6051, + "drawerName": "", + "drawerBranch": "", + "transactionType": "ELECTRONIC LOAN PAYMENT", + "transactionNumber": 200, + "transactionTypeCode": "PR ", + "transactionAmount": 608.59, + "balance": 13061.91, + "principalAmount": -429.46, + "interest": 148.7, + "escrowAmount": 0, + "processingGroup": "111", + "batchControlId": 7281, + "historyItemId": 510829399, + "historyDescription": "", + "referencedMemberAccountId": "", + "checkNumber": "", + "glAccount": "", + "totalFee": 30.43, + "lateCharge": "30.43", + "historyDetails": { + "transactionDescription": "LandmarkCU TRANSFER 100918" + }, + "amountToCurtailment": 0 + } + ], + "temenosHistory": [ + { + "name": "Case Stage - O4R", + "message": "O4R", + "userId": 0, + "created": "2020-11-25T06:13:12.643", + "type": 1 + }, + { + "name": "Case Stage - O4R", + "message": "O4R", + "userId": 0, + "created": "2020-11-24T06:20:56.947", + "type": 1 + }, + { + "name": "Case Stage - O4R", + "message": "O4R", + "userId": 0, + "created": "2020-11-23T06:22:54.857", + "type": 1 + }, + { + "name": "Case Stage - O4R", + "message": "O4R", + "userId": 0, + "created": "2020-11-22T06:13:56.033", + "type": 1 + }, + { + "name": "Case Stage - O4R", + "message": "O4R", + "userId": 0, + "created": "2020-11-21T06:19:58.317", + "type": 1 + }, + { + "name": "Case Stage - O4R", + "message": "O4R", + "userId": 0, + "created": "2020-11-20T06:12:57.97", + "type": 1 + }, + { + "name": "Case Stage - O4R", + "message": "O4R", + "userId": 0, + "created": "2020-11-19T06:23:57.17", + "type": 1 + }, + { + "name": "Case Stage - O4R", + "message": "O4R", + "userId": 0, + "created": "2020-11-16T07:02:14.77", + "type": 1 + }, + { + "name": "Case Stage - O4R", + "message": "O4R", + "userId": 0, + "created": "2020-11-13T06:15:49.33", + "type": 1 + }, + { + "name": "Case Stage - PSKP", + "message": "PSKP", + "userId": 0, + "created": "2020-11-12T06:22:36.17", + "type": 1 + }, + { + "name": "Case Stage - O4R", + "message": "O4R", + "userId": 0, + "created": "2020-11-12T06:22:06.25", + "type": 1 + }, + { + "name": "Assign to Agent - DT", + "message": "Case Stage - O4R", + "userId": 6, + "created": "2020-11-11T13:25:38.69", + "type": 1 + }, + { + "name": "Assign to Agent - DT", + "message": "Account Level Stage - O4R", + "userId": 6, + "created": "2020-11-11T13:25:38.69", + "type": 1 + }, + { + "name": "Assign to Agent - DT", + "message": "Set Repo Flag", + "userId": 6, + "created": "2020-11-11T13:25:38.69", + "type": 1 + }, + { + "name": "Assign to Agent - DT", + "message": "Date Assigned", + "userId": 6, + "created": "2020-11-11T13:25:38.69", + "type": 1 + }, + { + "name": "Assign to Agent - DT", + "message": "Repo Type (Voluntary/Involuntary)", + "userId": 6, + "created": "2020-11-11T13:25:38.69", + "type": 1 + }, + { + "name": "Assign to Agent - DT", + "message": "Update Repo Details", + "userId": 6, + "created": "2020-11-11T13:25:38.69", + "type": 1 + } + ], + "temenosAccount": { + "accountId": 883841, + "accountIdentifier": "5730350143", + "accountNumber": "5730350", + "accountStatus": "Written Off", + "accountTypeId": 1029, + "accountType": { + "id": 1029, + "description": "Auto Used Indirect IL", + "code": "AUIIL" + }, + "activeFlag": true, + "amountLastPaid": null, + "balance": 7688.78, + "bankruptcyFlag": false, + "branch": null, + "dueDate": "2020-03-09T00:00:00", + "firstPaymentDueDate": null, + "loanOfficer": "", + "originalLoanAmount": null, + "originalLoanDate": null, + "dqAmount": 0, + "daysDq": 260, + "suffix": "143", + "linkedAccount": "5730350143", + "productType": "", + "closedDate": null, + "dateLastPaid": "8/5/2020 12:00:00 AM", + "dateFirstDelinquent": "11/24/2020 12:00:00 AM", + "cases": [ + { + "caseId": 5, + "caseNumber": "REPO-00000005", + "caseDescription": "", + "caseStageId": 2000122, + "repoStatus": 100, + "caseStatusId": 33, + "caseTitle": "REPO-00000005", + "caseTypeBasisId": 2, + "caseTypeId": 7, + "closedDate": null, + "createdDate": "2020-11-11T13:24:10.34", + "createdUserId": 6, + "currentStageDate": "2020-11-11T13:24:09.153", + "currentStatusDate": "2020-11-11T13:24:09.153", + "lastReviewDate": null, + "nextReviewDate": null, + "stage1CompletionDate": null, + "stage2CompletionDate": null, + "stage3CompletionDate": null, + "stage4CompletionDate": null, + "stage5CompletionDate": null, + "titleOrdered": false, + "titleOrderedDate": null, + "redemptionExpiredDateIl": null, + "redemptionExpiredDateWi": null, + "customFieldMap": { + "Case Modification Status": "", + "Case Loss Mitigation Stage": "", + "Case Loss Mitigation Type": "", + "Case Loss Mitigation Status": "", + "BRP Hardship Letter": "", + "BRP Bank Statements": "", + "BRP Paycheck Stubs": "", + "BRP Other Income If Applicable": "", + "BRP Tax Returns": "", + "BRP 4506T Form Signed": "", + "BRP Financial Worksheet": "", + "BRP 1st Mortgage Statement": "", + "BRP HOI Declaration Page": "", + "BRP Escrow Authorization Signed": "", + "BRP Additional Information Needed": "", + "Def Fore Financial Filed": "", + "Def Fore Case Number": "", + "Def Fore Date Filed": "", + "Def Fore Property Address is Mailing Address": "", + "Def Fore Property Address if not Mailing Address": "", + "Def Fore Attorney Name": "", + "Def Fore Attorney Number": "", + "Fore Referral Date": "", + "Fore SCRA Checked Date": "", + "Fore RTC Expiration Date": "", + "Fore On Hold Date": "", + "Fore On Hold Reason": "", + "Fore Reinstated Date": "", + "Fore Withdrawn Date": "", + "Fore Withdrawn Reason": "", + "Fore Withdrawn Reason If Other": "", + "Fore Date Last Payment": "", + "Fore Sale Scheduled Date": "", + "Fore Confirmation Scheduled Date": "", + "Fore Confirmation Complete Date": "", + "Fore Sale Result": "", + "Collection Agency": "False", + "Todays Date Case Lvl": "", + "DQ Amount Case Lvl": "", + "Performance Pymnts Case Lvl": "", + "Late Charges Case Lvl": "", + "Repo Fees Case Lvl": "", + "Redemption Amount Case Lvl": "0.0000", + "Balance Due Case Lvl": "", + "Legal Requested State Case Lvl": "", + "Judgement Dropdown Case Lvl": "", + "Attorney Firm Case Lvl": "", + "Documents Sent Date Case Lvl": "", + "Date Sent to Attorney Case Lvl": "", + "Date Served Case Lvl": "", + "Attorney Invoice Number Case Lvl": "", + "WRIT Flag Case Lvl": "False", + "Date Last RTC Letter Sent Case Lvl": "", + "RTC Sent Flag Case Lvl": "False", + "WRIT Date Case Lvl": "", + "Bond Obtained Flag Case Lvl": "False", + "Bond Obtained Date Case Lvl": "", + "Sent to Sheriff Date Case Lvl": "", + "Garnishment Employer Case Lvl": "", + "Financial Disclosure Sent Flag Case Lvl": "False", + "Garnishment Paying Flag Case Lvl": "False", + "Garnishment Review Date Case Lvl": "", + "Post Judgement Rate Case Lvl": "", + "Judgement Property Address 1 Case Lvl": "", + "Judgement Property Address 2 Case Lvl": "", + "Judgement Property Address 3 Case Lvl": "", + "Docket Date 1 Case Lvl": "", + "Docket Date 2 Case Lvl": "", + "Docket Date 3 Case Lvl": "", + "Stip Payment Amount Case Lvl": "", + "Stip Payment Frequency Case Lvl": "", + "Stip Total Amount Case Level": "", + "Legal Closed Reason Case Lvl": "" + }, + "dateRepossessed": null, + "repoTypeId": "2000143", + "repoType": 1, + "dateRepoAssigned": "2020-11-18T00:00:00", + "repoAgentId": "2000067" + } + ], + "customFieldMap": { + "Charge Off Status": "", + "Foreclosure Status - Lookup": "", + "Reason for Charge Off": "", + "Post Charge Off Intentions": "", + "BK Discharged Flag": "False", + "BK Reaffirmed Flag": "False", + "Fraud Suspected Flag": "False", + "Management Review Flag": "False", + "Balance at time of Charge Off": "", + "Date Approved for Charge Off": "", + "Date Approved for Foreclosure": "", + "Date Approved for Legal": "", + "Date Approved for Repo": "", + "Foreclosure Requested Flag": "False", + "Legal Requested Flag": "False", + "Lookup Value 4 - Lookup": "", + "Lookup Value 5 - Lookup": "", + "Repo Requested Flag": "False", + "Status Code 1": "", + "Status Code 2": "", + "Status Code 3": "", + "Status Code 4": "", + "Status Code 5": "", + "External Loan Number": "", + "Product Code": "", + "Product Name": "L-P7 Dealer 1st Time Buyer Used-IL", + "CORS Court Name": "", + "Loan Type": "", + "Original Interest Rate": "", + "Original Rate Type": "", + "Current Rate Type": "", + "Current Rate Term": "", + "Required Payment Amount": "", + "Times Late Count": "", + "Times Late 30 Days Count": "", + "Times Late 60 Days Count": "", + "Times Late 90 Days Count": "", + "Troubled Debt Restructure": "False", + "Modification Date": "", + "Modification Count": "", + "Modification Type": "", + "Financial Condition": "", + "Modification Reason": "", + "Membership Address 1": "", + "Membership Address 2": "", + "Membership City": "", + "Membership State Code": "", + "Membership Postal Code": "", + "User Status Code 1": "O4R", + "User Status Code 2": "TCIN", + "Intellect Permanent Comments": "*********************OUT FOR REPO 09/17/2020 ********************* GOES BY PAUL *143 RTC $1222.39 EXP 12/11/2018 143-file scanned 10/23/16 Lapse 1/2019-8/8/2019 POE: Network Solutions 07/09/18 ", + "PRI Metro 2 Code": "", + "S1 Metro 2 Code": "", + "S2 Metro 2 Code": "", + "PRI Metro 2 Code Description": "", + "S1 Metro 2 Code Description": "", + "S2 Metro 2 Code Description": "", + "PRI Affiliation Description": "", + "S1 Affiliation Description": "", + "S2 Affiliation Description": "", + "CORS Employer Address 1": "", + "CORS Employer Address 2": "", + "CORS Employer City": "", + "CORS Employer State Code": "", + "CORS Employer Postal Code": "", + "CORS Employer Comment": "", + "CORS Loan CORS date": "", + "CORS Demand Agency": "", + "CORS Assigned Agency": "", + "CORS Bankruptcy Case Number": "", + "CORS Bankruptcy File Date": "", + "CORS Bankruptcy Discharged Date": "", + "CORS Consumer Info Indicator": "False", + "CORS Trustee Name": "", + "CORS Bankruptcy Comment": "", + "CORS Motion Date": "", + "CORS Judgement Recordation": "", + "CORS Judgement Amount": "", + "CORS Judgement Status": "", + "CORS Judgement Comment": "", + "CORS Transaction Code": "", + "CORS Payment Amount": "", + "CORS Payment Frequency": "", + "CORS Payment Start Date": "", + "CORS User Assigned Name": "", + "CORS User Assigned Start Date": "", + "CORS User Assigned End Date": "", + "CORS Workflow Entered Date": "", + "CORS Workflow To Do Date": "", + "CORS Workflow Completed By Date": "", + "CORS Workflow User Name": "JEANNE STELLA", + "CORS Workflow Action Description": "Loan Comment", + "CORS Workflow Comment": "TLO phone (312) 561-7676", + "Organization Number": "", + "Client Number": "", + "Date High Balance": "", + "External Status Date 1": "", + "External Status 2": "", + "External Status Date 2": "", + "Insurance Code 1": "", + "Insurance Status 1": "", + "Insurance Status 2": "", + "Insurance Code 2": "", + "Insurance Status 3": "", + "Insurance Code 3": "", + "Most Recent Credit Score": "", + "Credit Score Less Recent": "", + "Relationship Flag": "", + "Relationship Number": "", + "S1 Original Credit Union": "", + "S1 Most Recent Credit Score": "", + "S1 Credit Score Less Recent": "", + "Client Name": "", + "Mortgage Insurer": "", + "Last Analyzed Date": "", + "Deferred Principal Balance": "", + "Prepetition Unapplied Balance": "", + "Stipulation Unapplied Balance": "", + "Other Funds Payment Amount": "", + "Assistance Payment Amount": "", + "Reserve Account Payment Amount": "", + "Default Interest Amount": "", + "Last NSF Fee Date": "", + "Last Letter Date": "", + "Other Fee Amount": "", + "Last Late Charge Waived Date": "", + "Last Late Charge Waived Amount": "", + "Next Late Charge Amount": "", + "Times Late LOL Count": "", + "Times Late Last 12 Months Count": "", + "Times Late 120 Days Count": "", + "Times Late 150 Days Count": "", + "Times Late 180 Days Count": "", + "First Payment Due Date": "", + "Maturity Type Description": "", + "Inspection Ordered Date": "", + "Last Inspection Date": "", + "Inspection Received Date": "", + "Current Occupancy Code": "", + "Inspected By": "", + "Property Type Description": "", + "Property Condition Description": "", + "Neighborhood Condition": "", + "Collateral 1 Property Type Code": "", + "Collateral 1 Lein Position": "", + "Bankruptcy Case Number": "", + "Bankruptcy Date Filed": "", + "DNU Bankruptcy Chapter Filed": "", + "Bankruptcy Claim Number": "", + "Bankruptcy Trustee Claim Number 1": "", + "Bankruptcy Trustee Claim Number 2": "", + "Bankruptcy Trustee Claim Number 3": "", + "Bankruptcy Name": "", + "Bankruptcy Event Code": "", + "Bankruptcy Event Legal": "", + "Bankruptcy Event Warning": "", + "Active Bankruptcy Flag": "False", + "Active Bankruptcy Plan Flag": "False", + "Bankruptcy Payment Status Date": "", + "Bankruptcy Milestone Due Date": "", + "Bankruptcy Milestone Completion Date": "", + "Bankruptcy Milestone Scheduled Date": "", + "Bankruptcy Milestone Actual Date": "", + "Bankruptcy Servicer Only": "", + "Contact Promise Date 1": "", + "Contact Promise Amount 1": "", + "Contact Promise Date 2": "", + "Contact Promise Amount 2": "", + "Contact Promise Date 3": "", + "Contact Promise Amount 3": "", + "Contact Reason": "", + "Contact Demeanor": "", + "Contact Outcome": "", + "Contact Permanent Comments": "", + "Legal Fee Amount": "", + "Collateral 1 Seller Name": "", + "Collateral 2 Seller Name": "", + "Collateral 3 Seller Name": "", + "Net Capitalized Cost Amount": "", + "Total Payments Count": "", + "Times Late 90 Plus Days Count": "", + "Late Fee Amount": "", + "Date 22 Day Letter Sent": "", + "Date 32 Day Letter Sent": "", + "Date 60 Day Letter Sent": "", + "Collateral 1 Legal Description": "", + "Collateral 2 Legal Description": "", + "Collateral 3 Legal Description": "", + "Collateral 4 Legal Description": "", + "SD Contact Follow Up Date": "", + "CORS Next Follow Up Date": "10/18/2020 12:00:00 AM", + "Waive Fee Reason DropDown": "", + "Waive Fee Reason Dropdown Spanish": "", + "Case Stages 1": "2000122", + "Dollar Amount": "", + "Case Stages 2": "", + "SCRA Flag": "False", + "TCPA Consent": "7003", + "Request Outcome": "", + "Request Outcome Date": "", + "Offset Request Reason DropDown": "", + "Intellect Next Follow Up Date": "3/26/2020 12:00:00 AM", + "Original Product Type": "", + "Recovery Branch": "57", + "Reason For Repo": "", + "Repo Recovery Address": "", + "Right to Cure Expired": "False", + "RTC Expiration Date": "", + "Repo Type": "", + "Repossession Type": "", + "Secondary Recovery Address": "", + "Redemption Calc WI Perfrmnce Pymnts": "1368.1200", + "Redemption Calc WI Repo Fees": "", + "Redemption Calc WI Total Due": "1368.1200", + "Redemption Calc WI Exp Date": "", + "Redemption Date Current Date": "", + "Redemption Calc WI Expiration Date": "", + "Investor": "", + "Money Field 2": "", + "Money Field 1": "", + "Loan Status": "Out For Repo", + "Redemption Calc IL 30 Percent Amnt Paid": "0.0000", + "Redemption Calc IL 30 Percent Yes or No": "True", + "Redemption Calc IL Total Due": "0.0000", + "Redemption Calc IL Exp Date": "", + "Current LTV Amount": "", + "Original LTV Amount": "", + "Redemption Calc IL Repo Fees": "", + "Redemption Calc IL Expiration Date": "", + "Repo Agencies": "", + "Bankruptcy Trustee": "", + "Title Ordered": "False", + "Title Received": "False", + "Vehicle ReTitled": "False", + "Title Ordered Date": "", + "ReTitled Date": "", + "Title Received Date": "", + "X Deceased Flag Dont Use": "False", + "CPI Active": "False", + "Branch Location": "", + "Collection Agency": "", + "Consumer Credit Counseling Services Flag": "False", + "Skip Trace Requested": "False", + "Loss Mitigation Status": "", + "Judgement Dropdown": "", + "Claim Type": "", + "Refund Status": "", + "Maintenance Requested": "False", + "BK Chapter": "", + "Settlement": "False", + "Repayment Plan Status": "", + "BK No Reaffirmation Flag": "False", + "test": "", + "Totaled Vehicle": "False", + "Fees Due": "", + "Original Input Code": "", + "Fraud Status": "", + "CORS Recovery Amt": "0.0000", + "CORS Recovery Amount Principal": "0.0000", + "Expense Applied Amount": "0.0000", + "Interest Applied Amount": "0.0000", + "Exp Amp": "45.6000", + "Input Code": "", + "Report Blank": "", + "Totaled Vehicle Notification Date": "", + "Warranty Cancellation Date": "", + "Refunds Requested Date": "", + "Repayment Plan Active": "False", + "Estate Attorney": "", + "Estate Attorney Phone Number": "", + "Personal Representative": "", + "Final Date to File Claim": "", + "Estate Closing Dates": "", + "Date Entered to Probate Finder": "", + "Date Notified Deceased": "", + "Death Notification Type": "", + "Visible Assets": "False", + "CCCS Status": "", + "Consumer Credit Counseling Service Company": "", + "CCCS Amount Approved": "", + "CCCS Decision Date": "", + "Settlement Amount": "", + "Primary Insurance Company": "", + "Primary Insurance Company Phone Number": "", + "Claim Number": "", + "Date of Loss": "", + "Totaled Vehicle Mileage": "", + "Totaled Vehicle Settlement Amount": "", + "Totaled Vehicle Warranty Refund": "", + "Totaled Vehicle Refunds Received Date": "", + "Totaled Vehicle Refunds Received Amount": "", + "GAP Payment Received Date": "", + "Defensive Foreclosure Flag Do Not Use": "False", + "Defensive Foreclosure Flag": "False", + "Collateral Still Exists Flags": "False", + "Bankrupt Collectible Non Filing Borrower Flag": "False", + "Manual Transfer Amount": "", + "Manual Transfer Frequency": "", + "Transfer From Account": "", + "Transfer To Account": "", + "CBR Request": "", + "CBR Date Received": "", + "Additional CBR Information Needed": "", + "CBR Approved": "", + "CBR Yes No Reason": "", + "BRP Sent Flag": "False", + "BRP Sent Date": "", + "Manual Transfer Start Date": "", + "Loss Mitigation Stage": "", + "Loss Mitigation Type": "", + "Date Last RTC Letter Sent": "", + "Skip Trace Phone No1": "", + "Skip Trace Phone No2": "", + "Skip Trace Phone No3": "", + "Skip Trace Phone No4": "", + "Skip Trace Phone No5": "", + "Skip Trace Phone No6": "", + "Skip Trace Phone No7": "", + "Skip Trace Phone No8": "", + "Skip Trace Phone No9": "", + "Skip Trace Phone No10": "", + "Skip Trace Address No1": "", + "Skip Trace Address No2": "", + "Skip Trace Address No3": "", + "Skip Trace Address No4": "", + "Skip Trace Address No5": "", + "Skip Trace Address No6": "", + "Skip Trace Email No1": "", + "Skip Trace Email No2": "", + "Skip Trace Email No3": "", + "Skip Trace Email No4": "", + "Skip Trace Email No5": "", + "Skip Trace POE No1": "", + "Skip Trace POE No2": "", + "Skip Trace Comments": "", + "TLO Basic Flag": "False", + "TLO Comprehensive Flag": "False", + "DRN Flag": "False", + "RDN Flag": "False", + "CarFax Flag": "False", + "Equifax Flag": "False", + "Facebook Flag": "False", + "Skip Trace Date": "", + "GainLoss Value Amount": "", + "GainLoss Value Date": "", + "GainLoss Senior Balance": "", + "GainLoss Senior Name": "", + "GainLoss Value Source": "", + "GainLoss Outstanding Taxes": "", + "GainLoss Marketing Costs": "5000.0000", + "GainLoss 1yr Taxes": "", + "GainLoss Review Date": "", + "GainLoss Marketing Commission": "0.0000", + "GainLoss Total Amount": "-12688.7800", + "Collection Agency Flag": "False", + "Chapter 128 Flag": "False", + "Chapter 128 Case Number": "", + "Chapter 128 Date Filed": "", + "CORS Trustee Number": "", + "CORS Trustee Address": "", + "CORS Trustee Email": "", + "CORS Loan type Description": "L-P7 Dealer 1st Time Buyer Used-IL", + "Host Code": "L-P7", + "CORS Initial Charge Off Balance Amount": "7688.7800", + "CORS Initial Charge Off Date": "10/8/2020 12:00:00 AM", + "CORS Initial Principal Amount": "7688.7800", + "CORS Initial Interest Amount": "741.2600", + "CORS Initial Expense Amount": "45.6000", + "CORS Transfer Date": "10/8/2020 12:00:00 AM", + "CORS Initial Interest Rate Type": "Fixed Rate", + "CORS Initial Interest Rate Percent": "14.9000", + "CORS Initial Day Count": "", + "CORS Current Principal Amount": "7688.7800", + "CORS Current Interest Amount": "832.0300", + "CORS Current Expense Amount": "45.6000", + "CORS Curent Non Reimbursable Expense Amount": "0.0000", + "CORS Current Other Amount": "0.0000", + "CORS Non Reimbursable Other Amount": "0.0000", + "CORS Current Loan Balance Amount": "8566.4100", + "Attorney Firm": "", + "Legal Requested State": "", + "Garnishment Flag": "False", + "Money Judgement Flag": "False", + "Replevin Judgement Flag": "False", + "Stipulation Flag": "False", + "Summary Judgement Flag": "False", + "Wage Assignment Flag": "False", + "Date No Phone Number Letter Sent": "", + "Fraud Data Type": "Charge Off", + "Active Fraud CRIF File": "TRUE" + } +}, + "loanDetail" : { + "MemberId": 5730350, + "LoanId": 143, + "ExternalLoanId": 0, + "IndividualId": [ + 858924 + ], + "Borrowers": [ + { + "IndividualId": 858924, + "Name": "RADOSLAW TESTER1", + "Type": "Borrower", + "Address": "4934 HAROLD AVE , APT.: 3D, SCHILLER PARK, IL 60176", + "TaxId": "950-99-9999", + "Association": "Individual Contract (Primary)", + "LastAssociationCodeChangedDate": "2015-10-14T00:00:00", + "Metro2ConsumerInformationIndicator": "", + "CoborrowerIsSpouse": false, + "OwnershipPercentage": 0, + "PercentageDescription": "" + } + ], + "LoanType": "Regular Loan", + "Title": "LOANS WRITTEN OFF", + "Alerts": "0", + "Product": "LOANS WRITTEN OFF", + "ProductCode": 98, + "Template": "Regular Loan", + "ProductId": 204459, + "ProductDescription": "", + "ProductCategory": "Loan", + "ProductClass": "Regular Loan", + "AccountType": 98, + "Status": "Written Off", + "ClosedDate": "0001-01-01T00:00:00", + "Category": "", + "Classification": " ", + "MetroAcctType": "00", + "SMSA": "", + "Officer": "5756", + "OtherSecurity": " ", + "NoteNumber": "890971", + "LastMaintenance": "0001-01-01T00:00:00", + "WrittenOffDate": "2020-10-08T00:00:00", + "CreditCardNumber": "", + "LastCycleDate": "0001-01-01T00:00:00", + "LegalDescription": "", + "PropertyType": "", + "PurposeCode": "", + "CollateralCode": "", + "RefinanceCount": "0", + "LastRefinanceDate": "0001-01-01T00:00:00", + "LdcNumber": "", + "Messages": "", + "OriginalAmount": 19099.53, + "OriginationDate": "2015-09-25T00:00:00", + "Balance": 7688.78, + "AvailableBalance": 0, + "Limit": 0, + "EscrowBalance": 0, + "Payoff": 7688.78, + "UnappliedFundsBalance": 0, + "CashAdvanceBalance": 0, + "PurchaseAdvanceBalance": 0, + "ActiveAuthorizationAmount": 0, + "EscrowDividends": 0, + "PledgeType": "", + "MiscCharge1": "", + "MiscCharge2": "", + "MiscCharge3": "", + "MiscChargeCode1": "", + "MiscChargeCode2": "", + "MiscChargeCode3": "", + "InterestMemoed": 0, + "InterestAccruedDate": "2020-08-04T00:00:00", + "PaymentInterestDue": 0, + "PayoffInterestDue": 0, + "LateChargeMethod": "Not Assessed", + "LateCharge": 0, + "LateChargeDate": "2020-08-09T00:00:00", + "CashAdvance": 0, + "Insurance": "XX", + "LastStatementLateCharges": 0, + "LastStatementMiscFees": 0, + "LastStatementPurchaseAdvances": 0, + "LastStatementCashAdvances": 0, + "LastStatementCashAdvanceFees": 0, + "LastStatementMiscDebits": 0, + "LastStatementTotalPayments": 0, + "LastStatementCreditsPosted": 0, + "LastStatementAccruedInterest": 0, + "LastStatementDate": "0001-01-01T00:00:00", + "LastStatementPurchaseAdvanceBalance": 0, + "LastStatementEndingBalance": 0, + "DelinquentAmount": 0, + "LastStatementMonthlyMinimum": 0, + "LastStatementRequiredDue": 0, + "LastStatementRequiredPayment": 0, + "ScheduledPayment": 456.04, + "NextDueDate": "2020-03-09T00:00:00", + "PartialPaymentAmount": 5.31, + "PreviousDate": "2020-02-09T00:00:00", + "PaymentFrequency": "Monthly", + "AlignmentDate": "0001-01-01T00:00:00", + "PaymentMethod": "Counter Item", + "SourceAccount": "", + "ProcessingGroup": "0", + "LoanCouponDate": "0001-01-01T00:00:00", + "RequiredPaymentDue": 456.04, + "FirstPaymentDate": "2015-11-09T00:00:00", + "AlternatePaymentAmount": 0, + "AlternateBeginDate": "0001-01-01T00:00:00", + "AlternateEndDate": "0001-01-01T00:00:00", + "PaymentSkips": 0, + "FinalPaymentAmount": 456.04, + "FinalPaymentDate": "2020-12-09T00:00:00", + "CycleAmount": 0, + "VariableRatePaymentChange": "Default Product", + "VariableRateCode": "F", + "MinimumDue": 0, + "FrequencyPayment": 0, + "EscrowPayment": 0, + "PrincipalAndInterestPayment": 0, + "PaymentLoanDefinitionNumber": "", + "RateLoanDefinitionNumber": "", + "VacationWeeks": 0, + "PayrollRepaidWeeklyPaymentCount": 0, + "BaseRate": 0, + "TieredRateAdj": 0, + "ManualRateAdj": 0, + "Rate": 0, + "ManualRate": 0, + "APR": 14.9, + "OriginalInterestRate": 14.9, + "AlternateInterestRate": 0, + "LastRateChange": "2015-09-25T00:00:00", + "RealEstateMargin": 0, + "Amortization": "P & I Amt", + "AmortizationTerm": 0, + "MonthlyTerm": 60, + "NumberOfPayments": 60, + "InterestYTD": 163, + "InterestPYTD": 1768.91, + "InterestDaily": 0.01, + "PrincipalYTD": 8166.17, + "PrincipalPYTD": 5629.71, + "LateChargeYTD": 159.61, + "LateChargePYTD": 372.68, + "PaymentHistory": "065543210000", + "LastPaymentDue": "0001-01-01T00:00:00", + "PaymentsPastDue": 0, + "DaysPastDue": 0, + "MonthsPastDue": 0, + "CurrentStatementLateCharges": 0, + "CurrentStatementMiscFees": 0, + "CurrentStatementPurchaseAdvances": 0, + "CurrentStatementCashAdvances": 0, + "CurrentStatementCashAdvanceFees": 0, + "CurrentStatementMiscDebits": 0, + "CurrentStatementTotalPayments": 0, + "CurrentStatementTotalCredits": 0, + "DelinquentPaymentDueDate": "0001-01-01T00:00:00", + "IsInactive": false, + "StatementFrequency": "Default:N", + "AppraisedValue": 0, + "LocCycleDay": 0, + "IgnorePledge": false, + "OpenEndPlan": false, + "OpenEndCategory": "None", + "PointsPaid": 0, + "CurtailmentAmount": 0, + "CurtailmentDate": "0001-01-01T00:00:00", + "InsuranceExpirationDate": "2020-10-09T00:00:00", + "LifeInsuranceMI": "XX", + "DisabilityInsuranceMI": " ", + "LifeActivityInsuranceCode": " ", + "DisabilityActivityInsuranceCode": " ", + "LoanCoupons": true, + "PaidbyGrace": false, + "EscrowAccount": "", + "EscrowInterestPaid": false, + "NextPaymentAdjustmentDate": "0001-01-01T00:00:00", + "EffectivePayment": 456.04, + "InterestRate": 0, + "LastPaymentDate": "2020-08-05T00:00:00", + "LastPurchaseDate": "0001-01-01T00:00:00", + "LastCashAdvanceDate": "0001-01-01T00:00:00", + "BlockCode": "", + "ReclassCode": "", + "OutstandingAuthCount": 0, + "OutstandingAuthAmount": 0, + "InterestType": "Fixed", + "AlternateLoanNumber": "", + "ArmIndex": 0, + "DeductionOption": "", + "DelinquentPaymentSkips": false, + "FirstPayment": false, + "InterestDue": 0, + "LoanLevelSkips": false, + "PaymentReduction": false, + "WaiveLateCharge": false, + "ExcessPaymentTargetAccountId": 0, + "ExcessPaymentMemberId": 0, + "CustRate": false, + "IntRateMethod": "", + "Margin": 0, + "Index": "", + "RndFactPct": 0, + "RndFactOpt": "", + "IntRateCeiling": 0, + "IntRateFloor": 0, + "MaxDnRateChgLife": 0, + "MaxUpRateChgLife": 0, + "MaxDnRateChgPeriod": 0, + "MaxUpRateChgPeriod": 0, + "MinDnRateChgPeriod": 0, + "MinUpRateChgPeriod": 0, + "PmtAdjPeriod": 0, + "DaysPriorToPeriodicRateAdj": 0, + "DaysPriorToInitialRateAdjustment": 0, + "FirstAdjustmentIsEstimate": false, + "InitialAnalysisEstimateDate": "0001-01-01T00:00:00", + "EstimatePerformed": "", + "BalloonTerm": 0, + "PledgeTypeDescription": "", + "SystemApproved": "Yes", + "VINList": [ + "JN8AF5MVXBT022809" + ], + "MortgageLoanOriginator": 0, + "LastPaymentPrincipal": 0, + "LastPaymentInterest": 63.19, + "LastPaymentFees": 0, + "LastPaymentLateCharges": 136.81, + "LastPaymentEscrowImpound": null, + "LastPaymentCurtailment": null, + "LastPaymentTotal": 200, + "TransferDay": 0, + "SourceMember": 0, + "AdjustPurchaseAccrual": false, + "AnnualFee": false, + "AnnualFeeDate": "0001-01-01T00:00:00", + "BalaceLimit": 0, + "CloseOnZero": false, + "DrawDate": "0001-01-01T00:00:00", + "Form1098Option": "N", + "MethodADelinquency": false, + "NumberofSkips": 0, + "OverlimitAmount": 0, + "OverlimitDate": "0001-01-01T00:00:00", + "PurchaseAdvBalance": 0, + "SkipDate": "0001-01-01T00:00:00", + "ToBeDelinquent": false, + "WaiveDelinquencyNotice": false, + "WaiveBillingNotice": false, + "WaiveInterest": false, + "LastStatementMinimumPayment": 0, + "LastStatementCycleRequiredPayment": 0, + "ExemptNonResident": false, + "YTDNonresidentWithholding": null, + "PYTDNonresidentWithholding": null, + "InCollection": "OUT", + "UniversalLoanId": "", + "RateLockDate": "0001-01-01T00:00:00", + "ActiveStopPays": "", + "ErrorMessage": [] + }, + "memberDetail" : { + "MemberId": 5730350, + "MemberName": "RADOSLAW TESTER1", + "PrimaryIndividualId": 858924, + "MemberType": "UNITED WAY", + "Affiliation": "", + "MemberSince": "2015-10-14T00:00:00", + "Miscellaneous1": "", + "Miscellaneous2": "", + "OriginalOpenBranch": "INDIRECT LENDING DEPT", + "WithholdingCode": "", + "ExpeditedFunds": 0, + "ExpeditedFundsDate": "0001-01-01T00:00:00", + "AccessLevel": 1, + "StandardStatementCycle": 1, + "StandardStatementCode": "", + "StandardStatementMethod": "Microfiche", + "CATFeeCounter": 0, + "CATFeeDate": "0001-01-01T00:00:00", + "CreditCardStatementCycle": 1, + "CreditCardStatementCode": "", + "CreditCardStatementMethod": "Hold", + "AccountCount": 1, + "AccountBalance": 0, + "LoanCount": 1, + "LoanBalance": 7688.78, + "LoansDelinquentCount": 1, + "LoansDelinquent": 7688.78, + "LoansWrittenOffCount": 1, + "LoansWrittenOff": 7688.78, + "LoansInCollectionCount": 0, + "LoansInCollection": 0, + "Password": "", + "PinLock": "Unlock", + "BranchId": 57, + "RelationshipPricingLevel": 0, + "RelationshipPricingLevelPermanent": "No", + "RelationshipPricingDescription": "", + "PreviousRelationshipPricingLevel": 0, + "LastRelationshipPricingLevelAnalysisDate": "", + "LastRelationshipPricingLevelChangeDate": "10/8/2020 12:00:00 AM", + "InhibitActivity": "No", + "WrittenOffLoan": "Yes", + "LoanInCollection": "No", + "PurgeMembership": "Yes", + "Address": { + "AddressId": 3559452, + "Line1": "4934 HAROLD AVE", + "Line2": "APT.: 3D", + "Line3": "", + "City": "SCHILLER PARK", + "State": "IL", + "ZipCode": "60176-", + "Country": "US", + "CountyName": "", + "AddressType": "", + "IsPrimary": true, + "IsInternational": false, + "AddressVerification": 4934, + "Occupancy": "", + "StartDate": "0001-01-01T00:00:00", + "EndDate": "0001-01-01T00:00:00", + "LongAddress1": "", + "LongAddress2": "", + "Membership": [], + "CoBorrower": [], + "UseAlternateAsOf": "0001-01-01T00:00:00", + "RestorePrimaryAsOf": "0001-01-01T00:00:00", + "AlternateType": "", + "Comments": "", + "Met2AddressIndicator": "", + "UspsVerified": false, + "AddressMatchStatus": null, + "IsHSA": false + } + }, + "repoAccount": { + "repoId": 2662, + "accountNo": "5730350143", + "status": "O4R", + "memberNo": 5730350, + "loanNo": 143, + "accountTypeCode": "AUIIL", + "origAccountTypeCode": null, + "branch": 57, + "collector": "", + "balance": 7688.78, + "dueToPayDate": "2020-03-09T00:00:00", + "o4RDate": "2020-09-17T00:00:00", + "dateFirstDelinquent": "2020-11-24T00:00:00", + "delinquentAmount": 0, + "daysDelinquent": 192, + "paidSkipAmount": null, + "subStatus": "", + "requiredPaymentAmount": 0, + "currentDelinquentAmount": 0, + "lstPmtAmt": 0, + "origAmount": 0, + "lastPaymentDate": "2020-08-05T00:00:00", + "dateFirstIntellect": "2015-12-14T00:00:00", + "primaryIndividualId": "858924", + "bankruptcy": "False", + "manualRedemptionDate": null, + "redemptionExpiredDate": null, + "borrowers": [ + { + "repoId": 2662, + "individualId": "858924", + "ownershipType": 6, + "individualName": "RADOSLAW TESTER1 " + } + ], + "collaterals": [ + { + "collateralId": 2727, + "repoId": 2662, + "vin": "JN8AF5MVXBT022809", + "make": "NISSAN", + "model": "Juke-4 Cyl", + "year": 2011, + "description": "", + "vehicleType": null, + "bodyStyle": null, + "inoperable": null, + "collateralTypeId": null, + "retitledInLandmarkName": null, + "refCollateralId": null, + "repoCompanySelections": [ + { + "id": 2727, + "collateralId": 2727, + "repoType": 1, + "repoCompanyId": 4, + "repoCompanyAssignmentDate": "2017-10-12T00:00:00", + "dateRepoed": null, + "dateTimeCreated": "2019-11-04T15:58:14.39" + }, + { + "id": 5732, + "collateralId": 2727, + "repoType": 1, + "repoCompanyId": 13, + "repoCompanyAssignmentDate": "2020-09-17T05:00:00", + "dateRepoed": null, + "dateTimeCreated": "2020-09-17T10:02:26.247" + } + ] + } + ], + "repoStatusChanges": [ + { + "id": 8602, + "repoId": 2662, + "statusFrom": "None", + "statusTo": "O4R", + "changedBy": "Importer", + "changedDate": "2017-10-12T09:49:10.943" + }, + { + "id": 8603, + "repoId": 2662, + "statusFrom": "O4R", + "statusTo": "REHO", + "changedBy": "Diana Vandebogert", + "changedDate": "2017-10-26T10:20:49.39" + }, + { + "id": 8604, + "repoId": 2662, + "statusFrom": "REHO", + "statusTo": "RECA", + "changedBy": "Diana Vandebogert", + "changedDate": "2017-10-27T12:58:03.98" + }, + { + "id": 17338, + "repoId": 2662, + "statusFrom": "RECA", + "statusTo": "O4R", + "changedBy": "System User", + "changedDate": "2020-09-17T10:02:26.223" + } + ], + "refundStatus": null, + "dateClosed": null, + "referenceId": 883841, + "referenceCaseId": 5, + "referenceStatus": null, + "accountLastProcessed": "2020-11-25T08:07:41.397", + "writtenOffDate": null + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/RefundStatusServiceTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/RefundStatusServiceTest.cs new file mode 100644 index 0000000..9547105 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/RefundStatusServiceTest.cs @@ -0,0 +1,180 @@ +using System; +using System.Net.Http; +using LCU.API.Collections.RepoApi.Exceptions; +using LCU.API.Collections.RepoApi.Services; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using Moq; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.Services +{ + public class RefundStatusServiceTest + { + private IRefundStatusService _refundStatusService; + private Mock _refundStatusRepository; + private Mock _unitOfWork; + private Mock _repoAccountService; + private Mock _emailer; + + public RefundStatusServiceTest() + { + _refundStatusRepository = new Mock(); + _unitOfWork = new Mock(); + _repoAccountService = new Mock(); + _emailer = new Mock(); + _refundStatusService = new RefundStatusService( + _refundStatusRepository.Object, + _unitOfWork.Object, + _repoAccountService.Object, + _emailer.Object); + } + + [Fact] + public async void GetAsync_Ok() + { + // Arrange + _refundStatusRepository.Setup(repo => repo.FindByRepoIdAsync(It.IsAny())).ReturnsAsync( + new RefundStatus()); + + // Act + var result = await _refundStatusService.GetAsync(1); + + // Assert + Assert.NotNull(result); + } + + [Fact] + public async void GetAsync_Throws_NFE_When_RefundStatusRepository_Throws_Exception() + { + // Arrange + _refundStatusRepository.Setup(repo => repo.FindByRepoIdAsync(It.IsAny())).ThrowsAsync( + new Exception()); + + // Act / Assert + try + { + var result = await _refundStatusService.GetAsync(1); + Assert.True(false, "An Exception in the RefundStatusRepository should have triggered an Exception upward. No Exception triggered."); + } + catch (NotFoundException) { } + catch (Exception) + { + Assert.True(false, "A NotFoundException should be thrown when any Exception occurs in RefundStatusRepository. Another Exception was thrown instead."); + } + } + + [Fact] + public async void GetAsync_Throws_NFE_When_RefundStatusRepository_Returns_Null() + { + // Arrange + _refundStatusRepository.Setup(repo => repo.FindByRepoIdAsync(It.IsAny())).ReturnsAsync((RefundStatus) null); + + // Act / Assert + try + { + var result = await _refundStatusService.GetAsync(1); + Assert.True(false, "An Exception should have been thrown when the RefundStatusRepository returns a null value. No Exception triggered."); + } + catch (NotFoundException) { } + catch (Exception) + { + Assert.True(false, "A NotFoundException should be thrown when the RefundStatusRepository returns a null value. Another Exception was thrown instead."); + } + } + + [Fact] + public async void SaveASync_Ok() + { + // Arrange + _refundStatusRepository.Setup(repo => repo.AddAsync(It.IsAny())).ReturnsAsync( + new RefundStatus()); + + // Act + var result = await _refundStatusService.SaveAsync(new RefundStatus() + { + RepoId = 123 + }); + + // Assert + Assert.NotNull(result); + } + + [Fact] + public async void SaveAsynhc_Throws_Exception_When_RepoAccountService_Throws_Exception() + { + // Arrange + _repoAccountService.Setup(service => service.Get(It.IsAny())).ThrowsAsync( + new Exception()); + + // Act / Assert + try + { + var result = await _refundStatusService.SaveAsync(new RefundStatus() { RepoId = 123 }); + Assert.True(false, "An Exception in the RefundStatusRepository should have triggered an Exception upward. No Exception triggered."); + } + catch (Exception) { } + } + + [Fact] + public async void UpdateAsync_Ok() + { + // Arrange + _refundStatusRepository.Setup(repo => repo.FindByRepoIdAsync(It.IsAny())).ReturnsAsync( + new RefundStatus()); + _repoAccountService.Setup(service => service.Get(It.IsAny())).ReturnsAsync( + new RepoAccount()); + + // Act + var result = await _refundStatusService.UpdateAsync(new RefundStatus() + { + RepoId = 123 + }); + + // Assert + Assert.NotNull(result); + } + + [Fact] + public async void UpdateAsync_With_Refunds_Received_Date_Sends_Email() + { + // Arrange + _refundStatusRepository.Setup(repo => repo.FindByRepoIdAsync(It.IsAny())).ReturnsAsync( + new RefundStatus()); + _repoAccountService.Setup(service => service.Get(It.IsAny())).ReturnsAsync( + new RepoAccount()); + _emailer.Setup(emailer => emailer.SendSurplusDeficiencyLetterEmailAsync(It.IsAny())).ReturnsAsync(new HttpResponseMessage(System.Net.HttpStatusCode.OK)); + + // Act + var result = await _refundStatusService.UpdateAsync(new RefundStatus() + { + RepoId = 123, + RefundsReceivedDate = DateTime.Now + }); + + // Assert + Assert.NotNull(result); + Assert.NotNull(result.RefundsReceivedDate); + _emailer.Verify(x => x.SendSurplusDeficiencyLetterEmailAsync(It.IsAny()), Times.Once); + } + + [Fact] + public async void UpdateAsync_Returns_NFE_When_RefundStatusRepository_Throws_NFE() + { + // Act / Assert + try + { + await _refundStatusService.UpdateAsync(new RefundStatus() + { + RepoId = 123 + }); + Assert.True(false, "A Failure to Find a RefundStatus should have sent an Exception upward. No Exception triggered."); + } + catch (NotFoundException) { } + catch (Exception) + { + Assert.True(false, "A Failure to Find a RefundStatus should have trigerred a NotFoundException. Another Exception was thrown instead."); + } + } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/RepoAccountServiceTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/RepoAccountServiceTest.cs new file mode 100644 index 0000000..6a8ce68 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/RepoAccountServiceTest.cs @@ -0,0 +1,544 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using LCU.API.Collections.RepoApi.Exceptions; +using LCU.API.Collections.RepoApi.Models; +using LCU.API.Collections.RepoApi.Models.Filters; +using LCU.API.Collections.RepoApi.Services; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.Producer; +using LCU.Shared.Collections.RepoApiLib.Models.Results; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using Moq; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.Services +{ + public class RepoAccountServiceTest + { + private readonly Mock _mockRepoAccountRepository; + private readonly Mock _mockStatusChangeRepository; + private readonly Mock _mockRepoManualStatusRepository; + private readonly IRepoAccountService _repoAccountService; + + public RepoAccountServiceTest() + { + _mockRepoAccountRepository = new Mock(); + _mockStatusChangeRepository = new Mock(); + _mockRepoManualStatusRepository = new Mock(); + var mockUnitOfWrk = new Mock(); + _repoAccountService = new RepoAccountService(_mockRepoAccountRepository.Object, _mockStatusChangeRepository.Object, + _mockRepoManualStatusRepository.Object, mockUnitOfWrk.Object); + } + + [Fact] + public async void ListAccounts_Ok() + { + // arrange + var repos = new List + { + new RepoAccount() + { + RepoId = 5, + AccountNo = "1234567-98" + } + }; + var paged = new PagedResult() { Total = 1, Items = repos }; + _mockRepoAccountRepository + .Setup(x => x.ListAsync(It.IsAny>(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) + .ReturnsAsync(paged); + + // act + var result = await _repoAccountService.ListAll(new PageFilter()); + + // Assert + Assert.NotNull(result); + Assert.Equal(1, result.Total); + Assert.True(repos.SequenceEqual(result.Items)); + } + + [Fact] + public async void List_Pollable_Accounts_Ok() + { + // arrange + var statusList = new List + { + "O4R", "REPO", "REDEEMED" + }; + var repos = new List + { + new ProcessingItem() + { + AccountNo = "1234567-98" + } + }; + + _mockRepoManualStatusRepository.Setup(x => x.ListWatchStatusesAsync()) + .ReturnsAsync(statusList); + _mockRepoAccountRepository + .Setup(x => x.GetItemsForProcessing(statusList)) + .ReturnsAsync(repos); + + // act + var result = await _repoAccountService.GetItemsForProcessing(); + + // Assert + Assert.NotNull(result); + Assert.Equal(1, result.Count); + } + + [Fact] + public async void Save_With_Borrower_OK() + { + // arrange + var repo = new RepoAccount() + { + RepoId = 5, + AccountNo = "1234567-98", + Status = "O4R", + Borrowers = new List() + { + new Borrower() + { + IndividualName = "John Doe", + OwnershipType = 6, + IndividualId = "123456" + } + } + }; + var statusChange = new RepoStatusChange() + { + RepoId = 5, + ChangedBy = "System", + StatusTo = "O4R", + StatusFrom = "None" + }; + _mockRepoAccountRepository.Setup(x => x.AddAsync(It.IsAny())).ReturnsAsync(repo); + _mockStatusChangeRepository.Setup(x => x.AddAsync(It.IsAny())).ReturnsAsync(statusChange); + + // act + var result = await _repoAccountService.SaveAsync(repo); + + // Assert + Assert.NotNull(result); + Assert.Equal(repo, result); + + _mockStatusChangeRepository.Verify(x => x.AddAsync(It.IsAny()), Times.Once); + } + + [Fact] + public async void Update_With_Borrower_OK() + { + // arrange + var oldRepo = new RepoAccount() + { + RepoId = 5, + AccountNo = "1234567-98", + Status = "O4R", + Borrowers = new List() + { + new Borrower() + { + IndividualName = "John Doe", + OwnershipType = 6, + IndividualId = "123456" + } + }, + Collaterals = new List() + { + new Collateral() + { + Description = "used mitsubishi", + Inoperable = true, // Inoperable = (Make == "Mitsubishi") + Make = "Mitsubishi", + RepoId = 5, + CollateralId = 919, + RetitledInLandmarkName = null + } + } + }; + var repo = new RepoAccount() + { + RepoId = 5, + AccountNo = "1234567-98", + Status = "REPO", + Borrowers = new List() + { + new Borrower() + { + IndividualName = "John Doe", + OwnershipType = 6, + IndividualId = "123456" + } + }, + Collaterals = new List() + { + new Collateral() + { + Description = "used mitsubishi", + Inoperable = true, // Inoperable = (Make == "Mitsubishi") + Make = "Mitsubishi", + RepoId = 5, + CollateralId = 919, + RetitledInLandmarkName = null + } + } + }; + var statusChange = new RepoStatusChange() + { + RepoId = 5, + ChangedBy = "System", + StatusTo = "O4R", + StatusFrom = "None" + }; + _mockRepoAccountRepository.Setup(x => x.Update(It.IsAny())).Verifiable(); + _mockRepoAccountRepository.Setup(x => x.FindByIdAsync(It.IsAny())).ReturnsAsync(oldRepo); + _mockStatusChangeRepository.Setup(x => x.AddAsync(It.IsAny())).ReturnsAsync(statusChange); + + // act + var result = await _repoAccountService.UpdateAsync(repo, new AppUser() + { + FirstName = "TEst", + LastName = "test" + }); + + // Assert + Assert.NotNull(result); + Assert.Equal(oldRepo, result); + Assert.Equal("REPO", oldRepo.Status); + + _mockStatusChangeRepository.Verify(x => x.AddAsync(It.IsAny()), Times.Once); + } + + [Fact] + public async void Update_With_Borrower_No_Status_Change_OK() + { + // arrange + var oldRepo = new RepoAccount() + { + RepoId = 5, + AccountNo = "1234567-98", + Status = "REPO", + Borrowers = new List() + { + new Borrower() + { + IndividualName = "John Doe", + OwnershipType = 6, + IndividualId = "123456" + } + }, + Collaterals = new List() + { + new Collateral() + { + Description = "used mitsubishi", + Inoperable = true, // Inoperable = (Make == "Mitsubishi") + Make = "Mitsubishi", + RepoId = 5, + CollateralId = 919, + RetitledInLandmarkName = null + } + } + }; + var repo = new RepoAccount() + { + RepoId = 5, + AccountNo = "1234567-98", + Status = "REPO", + Collector = "collector_changed", + Borrowers = new List() + { + new Borrower() + { + IndividualName = "John Doe", + OwnershipType = 6, + IndividualId = "123456" + } + }, + Collaterals = new List() + { + new Collateral() + { + Description = "used mitsubishi", + Inoperable = true, // Inoperable = (Make == "Mitsubishi") + Make = "Mitsubishi", + RepoId = 5, + CollateralId = 919, + RetitledInLandmarkName = null + } + } + }; + var statusChange = new RepoStatusChange() + { + RepoId = 5, + ChangedBy = "System", + StatusTo = "O4R", + StatusFrom = "None" + }; + _mockRepoAccountRepository.Setup(x => x.Update(It.IsAny())).Verifiable(); + _mockRepoAccountRepository.Setup(x => x.FindByIdAsync(It.IsAny())).ReturnsAsync(oldRepo); + _mockStatusChangeRepository.Setup(x => x.AddAsync(It.IsAny())).ReturnsAsync(statusChange); + + // act + var result = await _repoAccountService.UpdateAsync(repo, new AppUser() + { + FirstName = "TEst", + LastName = "test" + }); + + // Assert + Assert.NotNull(result); + Assert.Equal(oldRepo, result); + Assert.Equal("REPO", oldRepo.Status); + + _mockStatusChangeRepository.Verify(x => x.AddAsync(It.IsAny()), Times.Never); + } + + [Fact] + public async void GetAccount_Id_Ok() + { + // arrange + var repo = new RepoAccount() + { + RepoId = 5, + AccountNo = "1234567-98" + }; + _mockRepoAccountRepository.Setup(x => x.FindByIdAsync(It.IsAny())).ReturnsAsync(repo); + + // act + var result = await _repoAccountService.Get(4); + + // Assert + Assert.NotNull(result); + Assert.Equal(repo, result); + } + + [Fact] + public async void GetAccount_AccountNo_Ok() + { + // arrange + var repos = new List() + { + new RepoAccount() + { + RepoId = 5, + AccountNo = "1234567-98" + } + }; + _mockRepoAccountRepository.Setup(x => x.FindByAccountNoAsync(It.IsAny())).ReturnsAsync(repos); + + // act + var result = await _repoAccountService.GetByAccountNo("4567"); + + // Assert + Assert.NotNull(result); + Assert.Equal(repos, result); + } + + [Fact] + public async void GetNewestOpenAccount_AccountNo_Open_Ok() + { + + // arrange + var repos = new List() + { + new RepoAccount() + { + RepoId = 5, + AccountNo = "1234567-98", + DateClosed = DateTime.Parse("12-01-2010") + }, + new RepoAccount() + { + RepoId = 6, + AccountNo = "1234567-98", + DateClosed = null + } + }; + _mockRepoAccountRepository.Setup(x => x.FindByAccountNoAsync(It.IsAny())).ReturnsAsync(repos); + + // act + var result = await _repoAccountService.GetNewestOpenAccount("4567"); + + // Assert + Assert.NotNull(result); + Assert.True(result.RepoId == 6 && result.DateClosed == null); + } + + [Fact] + public void SelectAccount_AccountNo_Multi_Ok() + { + + // arrange + var repos = new List() + { + new RepoAccount() + { + RepoId = 5, + AccountNo = "1234567-98", + DateClosed = DateTime.Parse("12-01-2010") + }, + new RepoAccount() + { + RepoId = 6, + AccountNo = "1234567-98", + DateClosed = null + } + }; + + // act + var result = _repoAccountService.SelectFirstOpenAccount(repos); + + // Assert + Assert.NotNull(result); + Assert.True(result.RepoId == 6 && result.DateClosed == null); + } + + [Fact] + public void SelectAccount_AccountNo_Single_Ok() + { + + // arrange + var repos = new List() + { + new RepoAccount() + { + RepoId = 5, + AccountNo = "1234567-98", + DateClosed = DateTime.Parse("12-01-2010") + } + }; + + // act + var result = _repoAccountService.SelectFirstOpenAccount(repos); + + // Assert + Assert.NotNull(result); + Assert.True(result.RepoId == 5 && result.DateClosed != null); + } + + [Fact] + public async void GetNewestOpenAccount_AccountNo_Newest_Ok() + { + + // arrange + var repos = new List() + { + new RepoAccount() + { + RepoId = 5, + AccountNo = "1234567-98", + DateClosed = DateTime.Parse("12-01-2010") + }, + new RepoAccount() + { + RepoId = 6, + AccountNo = "1234567-98", + DateClosed = DateTime.Parse("04-01-2019") + } + }; + _mockRepoAccountRepository.Setup(x => x.FindByAccountNoAsync(It.IsAny())).ReturnsAsync(repos); + + // act + var result = await _repoAccountService.GetNewestOpenAccount("4567"); + + // Assert + Assert.NotNull(result); + Assert.True(result.RepoId == 6 && result.DateClosed == DateTime.Parse("04-01-2019")); + } + + [Fact] + public async void GetNewestOpenAccount_AccountNo_Single_Ok() + { + + // arrange + var repos = new List() + { + new RepoAccount() + { + RepoId = 5, + AccountNo = "1234567-98", + DateClosed = DateTime.Parse("12-01-2010") + } + }; + _mockRepoAccountRepository.Setup(x => x.FindByAccountNoAsync(It.IsAny())).ReturnsAsync(repos); + + // act + var result = await _repoAccountService.GetNewestOpenAccount("4567"); + + // Assert + Assert.NotNull(result); + Assert.True(result.RepoId == 5 && result.DateClosed == DateTime.Parse("12-01-2010")); + } + + [Fact] + public async void GetNewestOpenAccount_AccountNo_Null_Ok() + { + // arrange + _mockRepoAccountRepository.Setup(x => x.FindByAccountNoAsync(It.IsAny())).ReturnsAsync(new List()); + + // act + var result = await _repoAccountService.GetNewestOpenAccount("4567"); + + // Assert + Assert.Null(result); + } + + [Fact] + public async void DeleteAsync_Ok() + { + var repo = new RepoAccount() + { + RepoId = 5, + AccountNo = "1234567-98", + DateClosed = DateTime.Parse("12-01-2010") + }; + + _mockRepoAccountRepository.Setup(x => x.FindByIdAsync(It.IsAny())).ReturnsAsync(repo); + + //act + var result = await _repoAccountService.DeleteAsync (5); + + //assert + Assert.NotNull(result); + Assert.Equal(5, result.RepoId); + } + + [Fact] + public async void DeleteAsync_Existing_Null() + { + _mockRepoAccountRepository.Setup(x => x.FindByIdAsync(It.IsAny())).Returns(Task.FromResult(null)); + + //act + await Assert.ThrowsAsync(async () => await _repoAccountService.DeleteAsync(5)); + } + + [Fact] + public async void DeleteAsync_Existing_Exception() + { + _mockRepoAccountRepository.Setup(x => x.FindByIdAsync(It.IsAny())).ThrowsAsync(new Exception("oops")); + + //act + await Assert.ThrowsAsync(async () => await _repoAccountService.DeleteAsync(5)); + } + + [Fact] + public async void DeleteAsync_Remove_Exception() + { + var repo = new RepoAccount() + { + RepoId = 5, + AccountNo = "1234567-98", + DateClosed = DateTime.Parse("12-01-2010") + }; + + _mockRepoAccountRepository.Setup(x => x.FindByIdAsync(It.IsAny())).ReturnsAsync(repo); + _mockRepoAccountRepository.Setup(x => x.Remove(It.IsAny())).Throws(new Exception("oops")); + + //act + await Assert.ThrowsAsync(async () => await _repoAccountService.DeleteAsync(5)); + } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/RepoCompanyReportingServiceTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/RepoCompanyReportingServiceTest.cs new file mode 100644 index 0000000..018ad87 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/RepoCompanyReportingServiceTest.cs @@ -0,0 +1,334 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using LCU.API.Collections.RepoApi.Services.Reporting; +using LCU.Shared.Collections.RepoApiLib.Models.Reporting; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using Moq; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.Services +{ + public class RepoCompanyReportingServiceTest + { + private IRepoCompanyReportingService _repoCompanyReportingService; + private Mock _mockReportingRepository; + + public RepoCompanyReportingServiceTest() + { + _mockReportingRepository = new Mock(); + _repoCompanyReportingService = + new RepoCompanyReportingService(_mockReportingRepository.Object); + } + + [Fact] + public async void GetActiveCountReport_Ok() + { + // Arrange + var reportData = new List() + { + new StdReportEntry() + { + CollateralId = 1, + RepoCompanyAssignmentDate = DateTime.Parse("11/05/2019"), + RepoCompany = "Company A" + }, + new StdReportEntry() + { + CollateralId = 1, + RepoCompanyAssignmentDate = DateTime.Parse("11/05/2019"), + RepoCompany = "Company A" + }, + new StdReportEntry() + { + CollateralId = 2, + RepoCompanyAssignmentDate = DateTime.Parse("11/15/2019"), + RepoCompany = "Company A" + }, + new StdReportEntry() + { + CollateralId = 3, + RepoCompanyAssignmentDate = DateTime.Parse("11/15/2019"), + RepoCompany = "Company B" + }, + new StdReportEntry() + { + CollateralId = 4, + RepoCompanyAssignmentDate = DateTime.Parse("12/20/2019"), + RepoCompany = "Company B" + }, + new StdReportEntry() + { + CollateralId = 5, + RepoCompanyAssignmentDate = DateTime.Parse("12/22/2019") + } + }; + _mockReportingRepository.Setup(x => x.GetAccountsByDateAssigned(It.IsAny(), It.IsAny())) + .ReturnsAsync(reportData); + + // act + var result = + await _repoCompanyReportingService.GetAssignmentCountReport(DateTime.Parse("11/01/2019"), + DateTime.Parse("12/31/2019")); + + // assert + Assert.NotNull(result); + Assert.Equal(6, result.DataTable.Rows.Count()); + Assert.Equal(16, result.ReportTable.Cells.Length); // 4 rows of 4. + + Assert.Equal("All Repo Companies", result.ReportTable.Cells[0, 0].Display); + Assert.Equal("3", result.ReportTable.Cells[0, 1].Display); + Assert.Equal("2", result.ReportTable.Cells[0, 2].Display); + Assert.Equal("5", result.ReportTable.Cells[0, 3].Display); + + Assert.Equal("Company A", result.ReportTable.Cells[1, 0].Display); + Assert.Equal("2", result.ReportTable.Cells[1, 1].Display); + Assert.Equal("-", result.ReportTable.Cells[1, 2].Display); + Assert.Equal("2", result.ReportTable.Cells[1, 3].Display); + + Assert.Equal("Company B", result.ReportTable.Cells[2, 0].Display); + Assert.Equal("1", result.ReportTable.Cells[2, 1].Display); + Assert.Equal("1", result.ReportTable.Cells[2, 2].Display); + Assert.Equal("2", result.ReportTable.Cells[2, 3].Display); + + Assert.Equal("No Repo Companies", result.ReportTable.Cells[3, 0].Display); + Assert.Equal("-", result.ReportTable.Cells[3, 1].Display); + Assert.Equal("1", result.ReportTable.Cells[3, 2].Display); + Assert.Equal("1", result.ReportTable.Cells[3, 3].Display); + } + + [Fact] + public async void GetAvgDaysAssignedToRepoed_Ok() + { + // Arrange + var reportData = new List() + { + new StdReportEntry() + { + CollateralId = 1, + RepoDuration = 10, + DateRepoed = DateTime.Parse("11/05/2019"), + RepoCompany = "Company A" + }, + new StdReportEntry() + { + CollateralId = 2, + RepoDuration = 20, + DateRepoed = DateTime.Parse("11/01/2019"), + RepoCompany = "Company A" + }, + new StdReportEntry() + { + CollateralId = 3, + RepoDuration = 5, + DateRepoed = DateTime.Parse("11/29/2019"), + RepoCompany = "Company A" + }, + new StdReportEntry() + { + CollateralId = 4, + RepoDuration = 1, + DateRepoed = DateTime.Parse("12/08/2019"), + RepoCompany = "Company B" + }, + new StdReportEntry() + { + CollateralId = 5, + RepoDuration = 5, + DateRepoed = DateTime.Parse("12/31/2019"), + RepoCompany = "Company B" + }, + new StdReportEntry() + { + CollateralId = 6, + DateRepoed = DateTime.Parse("11/21/2019"), + } + }; + _mockReportingRepository.Setup(x => x.GetAccountsByDateRepoed(It.IsAny(), It.IsAny())) + .ReturnsAsync(reportData); + + // act + var result = + await _repoCompanyReportingService.GetAvgDaysAssignedToRepoed(DateTime.Parse("11/01/2019"), + DateTime.Parse("12/31/2019")); + + // assert + Assert.NotNull(result); + Assert.Equal(6, result.DataTable.Rows.Count()); + Assert.Equal(12, result.ReportTable.Cells.Length); + + Assert.Equal("All Repo Companies", result.ReportTable.Cells[0, 0].Display); + Assert.Equal("12", result.ReportTable.Cells[0, 1].Display); + Assert.Equal("3", result.ReportTable.Cells[0, 2].Display); + Assert.Equal("8", result.ReportTable.Cells[0, 3].Display); + + Assert.Equal("Company A", result.ReportTable.Cells[1, 0].Display); + Assert.Equal("12", result.ReportTable.Cells[1, 1].Display); + Assert.Equal("-", result.ReportTable.Cells[1, 2].Display); + Assert.Equal("12", result.ReportTable.Cells[1, 3].Display); + + Assert.Equal("Company B", result.ReportTable.Cells[2, 0].Display); + Assert.Equal("-", result.ReportTable.Cells[2, 1].Display); + Assert.Equal("3", result.ReportTable.Cells[2, 2].Display); + Assert.Equal("3", result.ReportTable.Cells[2, 3].Display); + } + + [Fact] + public async void GetRepoCountReport_Ok() + { + // Arrange + var reportData = new List() + { + new StdReportEntry() + { + CollateralId = 1, + DateRepoed = DateTime.Parse("11/05/2019"), + RepoCompany = "Company A" + }, + new StdReportEntry() + { + CollateralId = 8, + DateRepoed = DateTime.Parse("11/05/2019"), + RepoCompany = "Company A" + }, + new StdReportEntry() + { + CollateralId = 2, + DateRepoed = DateTime.Parse("11/15/2019"), + RepoCompany = "Company A" + }, + new StdReportEntry() + { + CollateralId = 3, + DateRepoed = DateTime.Parse("11/15/2019"), + RepoCompany = "Company B" + }, + new StdReportEntry() + { + CollateralId = 4, + DateRepoed = DateTime.Parse("12/20/2019"), + RepoCompany = "Company B" + }, + new StdReportEntry() + { + CollateralId = 5, + DateRepoed = DateTime.Parse("12/22/2019") + } + }; + _mockReportingRepository.Setup(x => x.GetAccountsByDateRepoed(It.IsAny(), It.IsAny())) + .ReturnsAsync(reportData); + + // act + var result = + await _repoCompanyReportingService.GetRepoedCountReport(DateTime.Parse("11/01/2019"), + DateTime.Parse("12/31/2019")); + + // assert + Assert.NotNull(result); + Assert.Equal(6, result.DataTable.Rows.Count()); + Assert.Equal(16, result.ReportTable.Cells.Length); // 4 rows of 4. + + Assert.Equal("All Repo Companies", result.ReportTable.Cells[0, 0].Display); + Assert.Equal("4", result.ReportTable.Cells[0, 1].Display); + Assert.Equal("2", result.ReportTable.Cells[0, 2].Display); + Assert.Equal("6", result.ReportTable.Cells[0, 3].Display); + + Assert.Equal("Company A", result.ReportTable.Cells[1, 0].Display); + Assert.Equal("3", result.ReportTable.Cells[1, 1].Display); + Assert.Equal("-", result.ReportTable.Cells[1, 2].Display); + Assert.Equal("3", result.ReportTable.Cells[1, 3].Display); + + Assert.Equal("Company B", result.ReportTable.Cells[2, 0].Display); + Assert.Equal("1", result.ReportTable.Cells[2, 1].Display); + Assert.Equal("1", result.ReportTable.Cells[2, 2].Display); + Assert.Equal("2", result.ReportTable.Cells[2, 3].Display); + + Assert.Equal("No Repo Companies", result.ReportTable.Cells[3, 0].Display); + Assert.Equal("-", result.ReportTable.Cells[3, 1].Display); + Assert.Equal("1", result.ReportTable.Cells[3, 2].Display); + Assert.Equal("1", result.ReportTable.Cells[3, 3].Display); + } + + [Fact] + public async void GetAssignedBalance_Ok() + { + // Arrange + var reportData = new List() + { + new StdReportEntry() + { + CollateralId = 1, + Balance = 500, + RepoCompanyAssignmentDate = DateTime.Parse("11/05/2019"), + RepoCompany = "Company A" + }, + new StdReportEntry() + { + CollateralId = 8, + Balance = 425.51m, + RepoCompanyAssignmentDate = DateTime.Parse("11/05/2019"), + RepoCompany = "Company A" + }, + new StdReportEntry() + { + CollateralId = 2, + Balance = 121, + RepoCompanyAssignmentDate = DateTime.Parse("11/15/2019"), + RepoCompany = "Company A" + }, + new StdReportEntry() + { + CollateralId = 3, + Balance = 383, + RepoCompanyAssignmentDate = DateTime.Parse("11/15/2019"), + RepoCompany = "Company B" + }, + new StdReportEntry() + { + CollateralId = 4, + Balance = 99.011m, + RepoCompanyAssignmentDate = DateTime.Parse("12/20/2019"), + RepoCompany = "Company B" + }, + new StdReportEntry() + { + CollateralId = 5, + Balance = 4, + RepoCompanyAssignmentDate = DateTime.Parse("12/22/2019") + } + }; + _mockReportingRepository.Setup(x => x.GetAccountsByDateAssigned(It.IsAny(), It.IsAny())) + .ReturnsAsync(reportData); + + // act + var result = + await _repoCompanyReportingService.GetAssignedBalance(DateTime.Parse("11/01/2019"), + DateTime.Parse("12/31/2019")); + + // assert + Assert.NotNull(result); + Assert.Equal(6, result.DataTable.Rows.Count()); + Assert.Equal(16, result.ReportTable.Cells.Length); // 4 rows of 4. + + Assert.Equal("All Repo Companies", result.ReportTable.Cells[0, 0].Display); + Assert.Equal("$1,429.51", result.ReportTable.Cells[0, 1].Display); + Assert.Equal("$103.01", result.ReportTable.Cells[0, 2].Display); + Assert.Equal("$1,532.52", result.ReportTable.Cells[0, 3].Display); + + Assert.Equal("Company A", result.ReportTable.Cells[1, 0].Display); + Assert.Equal("$1,046.51", result.ReportTable.Cells[1, 1].Display); + Assert.Equal("-", result.ReportTable.Cells[1, 2].Display); + Assert.Equal("$1,046.51", result.ReportTable.Cells[1, 3].Display); + + Assert.Equal("Company B", result.ReportTable.Cells[2, 0].Display); + Assert.Equal("$383.00", result.ReportTable.Cells[2, 1].Display); + Assert.Equal("$99.01", result.ReportTable.Cells[2, 2].Display); + Assert.Equal("$482.01", result.ReportTable.Cells[2, 3].Display); + + Assert.Equal("No Repo Companies", result.ReportTable.Cells[3, 0].Display); + Assert.Equal("-", result.ReportTable.Cells[3, 1].Display); + Assert.Equal("$4.00", result.ReportTable.Cells[3, 2].Display); + Assert.Equal("$4.00", result.ReportTable.Cells[3, 3].Display); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/RepoCompanySelectionServiceTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/RepoCompanySelectionServiceTest.cs new file mode 100644 index 0000000..8f0a407 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/RepoCompanySelectionServiceTest.cs @@ -0,0 +1,82 @@ +using System; +using System.Collections.Generic; +using LCU.API.Collections.CollectionsApiLib.Models; +using LCU.API.Collections.RepoApi.Services; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using Moq; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.Services +{ + public class RepoCompanySelectionServiceTest + { + private RepoCompanySelectionService _repoCompanySelectionService; + private Mock _mockRepository; + private Mock _mockUnitOfWork; + + public RepoCompanySelectionServiceTest() + { + _mockRepository = new Mock(); + _mockUnitOfWork = new Mock(); + _repoCompanySelectionService = new RepoCompanySelectionService( + _mockRepository.Object, + _mockUnitOfWork.Object); + } + + [Fact] + public async void UpdateAsync_Success() + { + // Arrange + var list = new List() + { + new RepoCompanySelection() + { + Id = 1, + CollateralId = 2, + RepoCompanyId = 3, + RepoType = RepoType.Involuntary, + DateTimeCreated = DateTime.Parse("08/14/1945"), + RepoCompanyAssignmentDate = DateTime.Parse("04/24/1916"), + DateRepoed = DateTime.Parse("04/29/1916") + }, + new RepoCompanySelection() + { + CollateralId = 2, + RepoCompanyId = 13, + RepoType = RepoType.Involuntary, + DateTimeCreated = DateTime.Parse("08/14/1945"), + RepoCompanyAssignmentDate = DateTime.Parse("04/24/1916"), + DateRepoed = DateTime.Parse("04/29/1916") + } + }; + + _mockRepository.Setup(repository => repository.FindByIdAsync(It.IsAny())).ReturnsAsync(new RepoCompanySelection() + { + RepoCompanyId = 3 + }); + + _mockRepository.Setup(repository => repository.FindByCollateralIdAsync(It.IsAny())).ReturnsAsync(new List() + { + new RepoCompanySelection() + { + Id = 1 + } + }); + + // Act + await _repoCompanySelectionService.SaveChangesAsync(list); + + Assert.Collection(list, + item => + { + Assert.NotNull(item.DateTimeCreated); + }, + item => + { + Assert.NotNull(item.DateTimeCreated); + }); + } + + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/RepoCompanyServiceTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/RepoCompanyServiceTest.cs new file mode 100644 index 0000000..62a305a --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/RepoCompanyServiceTest.cs @@ -0,0 +1,124 @@ +using System; +using System.Collections.Generic; +using LCU.API.Collections.RepoApi.Models; +using LCU.API.Collections.RepoApi.Services; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using Moq; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.Services +{ + public class RepoCompanyServiceTest + { + [Fact] + public async void ListAll_Ok() + { + var mockCompany = getMockCompany(); + var repoCompanyService = getRepoCompanyService(); + + var result = await repoCompanyService.ListAll(); + var companyEnumerator = result.GetEnumerator(); + + companyEnumerator.MoveNext(); + var firstCompanyFromService = companyEnumerator.Current; + Assert.Equal(mockCompany.ID, firstCompanyFromService.ID); + Assert.Equal(mockCompany.Name, firstCompanyFromService.Name); + Assert.Equal(mockCompany.Email, firstCompanyFromService.Email); + } + + [Fact] + public async void GetOne_Ok() + { + var mockCompany = getMockCompany(); + var repoCompanyService = getRepoCompanyService(); + + var result = await repoCompanyService.Get(1); + Assert.Equal(mockCompany.ID, result.ID); + Assert.Equal(mockCompany.Name, result.Name); + Assert.Equal(mockCompany.Email, result.Email); + } + + [Fact] + public async void Update_Ok() + { + var mockCompany = getMockCompany(); + var repoCompanyService = getRepoCompanyService(); + + var oldId = mockCompany.ID; + mockCompany.ID = 2; + mockCompany.Name = "New Name"; + mockCompany.Email = "New Email"; + + var result = await repoCompanyService.Update(mockCompany, new AppUser()); + Assert.Equal(mockCompany.Name, result.Name); + Assert.Equal(mockCompany.Email, result.Email); + Assert.Equal(oldId, result.ID); + } + + [Fact] + public async void Update_Date_Disabled_Saves_User() + { + var mockCompany = getMockCompany(); + var repoCompanyService = getRepoCompanyService(); + + mockCompany.ID = 2; + mockCompany.Name = "New Name"; + mockCompany.Email = "New Email"; + mockCompany.DisabledDate = DateTime.Now; + + var result = await repoCompanyService.Update(mockCompany, new AppUser() + { + FirstName = "John", + LastName = "Doe" + }); + Assert.Equal("John Doe", result.DisabledBy); + } + + [Fact] + public async void Update_Date_Disabled__NUll_Clears_User() + { + var mockCompany = getMockCompany(); + var repoCompanyService = getRepoCompanyService(); + + mockCompany.ID = 2; + mockCompany.Name = "New Name"; + mockCompany.Email = "New Email"; + mockCompany.DisabledBy = "Bobby Boy"; + + var result = await repoCompanyService.Update(mockCompany, new AppUser() + { + FirstName = "John", + LastName = "Doe" + }); + Assert.Null(result.DisabledBy); + } + + private RepoCompanyService getRepoCompanyService() + { + var companies = getMockCompanyList(); + + var mockRepository = new Mock(); + var mockUnitOfWork = new Mock(); + + mockRepository.Setup(repo => repo.ListAsync()).ReturnsAsync(companies); + mockRepository.Setup(repo => repo.FindByIdAsync(It.IsAny())).ReturnsAsync(companies[0]); + mockRepository.Setup(repo => repo.Update(It.IsAny())); + + return new RepoCompanyService(mockRepository.Object, mockUnitOfWork.Object); + } + + private IList getMockCompanyList() + { + return new List + { + getMockCompany() + }; + } + + private RepoCompany getMockCompany() + { + return new RepoCompany() {ID = 1, Email = "test1@test1.com", Name = "A Inc."}; + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/RepoLetterServiceTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/RepoLetterServiceTest.cs new file mode 100644 index 0000000..d6ba9ed --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/RepoLetterServiceTest.cs @@ -0,0 +1,72 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using LCU.API.Collections.CollectionsApiLib.Models; +using LCU.API.Collections.RepoApi.Services; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.API.Collections.RepoApi.DataAccess; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using Moq; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.Services +{ + public class RepoLetterServiceTest + { + [Fact] + public async void ListByRepoId_Ok() + { + var mockLetterRepository = new Mock(); + var mockCollectionsDao = new Mock(); + + var collectionsLetters = new List + { + new TemenosHistory() + { + Name= "Comment", + Message= "Sent letter(s): Repo Assignment Form.", + UserId= 56, + Created = DateTime.Parse("2015-05-09"), + Type = (HistoryType)2 + }, + new TemenosHistory() + { + Name= "Comment", + Message= "asdfasdfsda", + UserId= 56, + Created = DateTime.Parse("2015-05-09"), + Type = (HistoryType)1 + } + }; + + var letters = new List + { + new Letter + { + ActionCode = "RTC 3", + DaysToWait = 10, + LetterDescription = "Sent letter(s): Repo Assignment Form." + } + }; + + mockCollectionsDao.Setup(x => x.RetrieveHistoryAsync(It.IsAny())).ReturnsAsync(collectionsLetters); + mockLetterRepository.Setup(x => x.ListAsync()).ReturnsAsync(letters); + + // arrange + var service = new RepoLetterService( mockLetterRepository.Object, mockCollectionsDao.Object); + + // act + var result = await service.ListByAccountIdAsync(1234567); + + Assert.NotNull(result); + Assert.Single(result); + + RepoLetter first = result.First(); + Assert.Equal("Sent letter(s): Repo Assignment Form.", first.NoticeType); + Assert.Equal(DateTime.Parse("2015-05-09"), first.DateSent); + Assert.Equal(DateTime.Parse("2015-05-19"), first.DateExpired); + Assert.Equal(10, first.DaysToRedeem); + Assert.Equal("RTC 3", first.ActionCode); + } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/RepoStatusChangeServiceTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/RepoStatusChangeServiceTest.cs new file mode 100644 index 0000000..3a1b597 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/RepoStatusChangeServiceTest.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using Xunit; +using Moq; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using LCU.API.Collections.RepoApi.Services; +using LCU.API.Collections.RepoApi.Exceptions; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.API.Collections.RepoApiTests.Services +{ + public class RepoStatusChangeServiceTest + { + private readonly Mock _mockStatusChangeRepo; + private readonly RepoStatusChangeService _changeService; + + public RepoStatusChangeServiceTest() + { + _mockStatusChangeRepo = new Mock(); + _changeService = new RepoStatusChangeService(_mockStatusChangeRepo.Object); + } + + [Fact] + public async void ListByAccount_Exception() + { + _mockStatusChangeRepo.Setup(repo => repo.ListForAccountAsync(It.IsAny())) + .ThrowsAsync(new Exception("oops")); + + var res = await Assert.ThrowsAsync(async () => + { + await _changeService.ListByAccount(5); + }); + } + + [Fact] + public async void ListByAccount_Ok() + { + _mockStatusChangeRepo.Setup(repo => repo.ListForAccountAsync(It.IsAny())) + .ReturnsAsync(new List() {new RepoStatusChange() { }}); + + var res = await _changeService.ListByAccount(5); + Assert.NotNull(res); + Assert.Single(res); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/SavedLocationServiceTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/SavedLocationServiceTest.cs new file mode 100644 index 0000000..7a136b0 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/SavedLocationServiceTest.cs @@ -0,0 +1,80 @@ +using System.Collections.Generic; +using LCU.API.Collections.RepoApi.Services; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using Moq; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.Services +{ + public class SavedLocationServiceTest + { + [Fact] + public async void ListAll_Ok() + { + var mockLocation = getMockLocation(); + var savedLocationService = getSavedLocationService(); + + var result = await savedLocationService.ListAllAsync(); + var locationEnumerator = result.GetEnumerator(); + + locationEnumerator.MoveNext(); + var firstLocationFromService = locationEnumerator.Current; + Assert.Equal(mockLocation.ID, firstLocationFromService.ID); + Assert.Equal(mockLocation.Name, firstLocationFromService.Name); + } + + [Fact] + public async void GetOne_Ok() + { + var mockLocation = getMockLocation(); + var savedLocationService = getSavedLocationService(); + + var result = await savedLocationService.GetAsync(1); + Assert.Equal(mockLocation.ID, result.ID); + Assert.Equal(mockLocation.Name, result.Name); + } + + [Fact] + public async void Update_Ok() + { + var mockLocation = getMockLocation(); + var savedLocationService = getSavedLocationService(); + + var oldId = mockLocation.ID; + mockLocation.ID = 2; + mockLocation.Name = "New Name"; + + var result = await savedLocationService.UpdateAsync(mockLocation); + Assert.Equal(mockLocation.Name, result.Name); + Assert.Equal(oldId, result.ID); + } + + private SavedLocationService getSavedLocationService() + { + var savedLocations = getMockLocationList(); + + var mockRepository = new Mock(); + var mockUnitOfWork = new Mock(); + + mockRepository.Setup(repo => repo.ListAsync()).ReturnsAsync(savedLocations); + mockRepository.Setup(repo => repo.FindByIdAsync(It.IsAny())).ReturnsAsync(savedLocations[0]); + mockRepository.Setup(repo => repo.Update(It.IsAny())); + + return new SavedLocationService(mockRepository.Object, mockUnitOfWork.Object); + } + + private IList getMockLocationList() + { + return new List + { + getMockLocation() + }; + } + + private SavedLocation getMockLocation() + { + return new SavedLocation() {ID = 1, Name = "Some Weird Storage Place"}; + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/SettingsServiceTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/SettingsServiceTest.cs new file mode 100644 index 0000000..99a0af6 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/SettingsServiceTest.cs @@ -0,0 +1,595 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using LCU.API.Collections.CollectionsApiLib.Models; +using LCU.API.Collections.RepoApi.Configuration; +using LCU.API.Collections.RepoApi.DataAccess; +using LCU.API.Collections.RepoApi.Services; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.Settings; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using LCU.Shared.Collections.RepoApiLib.Repositories.Settings; +using Microsoft.Extensions.Caching.Memory; +using Moq; +using Xunit; + +namespace LCU.API.Collections.RepoApiTests.Services +{ + public class SettingsServiceTest + { + private Mock _mockAccountTypeRepository; + private Mock _mockAllowedStatusChangeRepository; + private Mock _mockBodyStyleRepository; + private Mock _mockCleaningLevelRepository; + private Mock _mockCollateralTypeRepository; + private Mock _mockCollateralTypeToVehicleTypeRepository; + private Mock _mockHoldStatusRepository; + private Mock _mockLoanCategoryRepository; + private Mock _mockLocationTypeRepository; + private Mock _mockVehicleTypeRepository; + private Mock _mockExternalUserRepository; + private Mock _mockRepoCompanyRepository; + private Mock _mockCollectionsDao; + private Mock _mockUnitOfWork; + private Mock _memoryCache; + private RepoApiConfiguration _configuration; + + private List accountTypes = new List + { + new AccountType() + }; + + private List allowedStatusChanges = new List + { + new AllowedStatusChange() + }; + + private List bodyStyles = new List + { + new BodyStyle() + }; + + List cleaningLevels = new List + { + new CleaningLevel() + }; + + private List collateralTypes = new List + { + new CollateralType() + }; + + + private List collateralTypeToVehicleTypes = new List + { + new CollateralTypeToVehicleType() + }; + + private List holdStatuses = new List + { + new HoldStatus() + }; + + private List loanCategories = new List + { + new LoanCategory() + }; + + private List locationTypes = new List + { + new LocationType() + }; + + private List vehicleTypes = new List + { + new VehicleType() + }; + + private List branchSet = new List + { + new BranchEntry() { BranchId = "5", BranchName = "Mars" } + }; + + private List externalUserSet = new List + { + new ExternalUser() { Id = 10, Code = "jdoe", Name = "John Doe" } + }; + + private List RepoCompanies = new List + { + new RepoCompany() { ID = 5, ReferenceId = 555 } + }; + + private readonly List _transactionTypeCodes = new List { "TEST" }; + private readonly string _transactionTypeCodeQueryPrefix = "TESTPREFIX"; + private readonly string _transactionHistoryParameterDateFormat = "yyyy-MM-dd"; + private readonly int _transactionHistoryStartDateOffset = 120; + + public SettingsServiceTest() + { + _mockAccountTypeRepository = new Mock(); + _mockAllowedStatusChangeRepository = new Mock(); + _mockBodyStyleRepository = new Mock(); + _mockCleaningLevelRepository = new Mock(); + _mockCollateralTypeRepository = new Mock(); + _mockCollateralTypeToVehicleTypeRepository = new Mock(); + _mockHoldStatusRepository = new Mock(); + _mockLoanCategoryRepository = new Mock(); + _mockLocationTypeRepository = new Mock(); + _mockVehicleTypeRepository = new Mock(); + _mockExternalUserRepository = new Mock(); + _mockRepoCompanyRepository = new Mock(); + _mockCollectionsDao = new Mock(); + _mockUnitOfWork = new Mock(); + _memoryCache = new Mock(); + _configuration = new RepoApiConfiguration + { + TransactionTypeCodes = _transactionTypeCodes, + TransactionTypeCodeQueryPrefix = _transactionTypeCodeQueryPrefix, + TransactionHistoryParameterDateFormat = _transactionHistoryParameterDateFormat, + TransactionHistoryStartDateOffset = _transactionHistoryStartDateOffset + }; + + _mockAccountTypeRepository.Setup(x => x.ListAllAsync()).ReturnsAsync(accountTypes); + _mockAllowedStatusChangeRepository.Setup(x => x.ListAllAsync()).ReturnsAsync(allowedStatusChanges); + _mockBodyStyleRepository.Setup(x => x.ListAllAsync()).ReturnsAsync(bodyStyles); + _mockCleaningLevelRepository.Setup(x => x.ListAllAsync()).ReturnsAsync(cleaningLevels); + _mockCollateralTypeRepository.Setup(x => x.ListAllAsync()).ReturnsAsync(collateralTypes); + _mockCollateralTypeToVehicleTypeRepository.Setup(x => x.ListAllAsync()) + .ReturnsAsync(collateralTypeToVehicleTypes); + _mockHoldStatusRepository.Setup(x => x.ListAllAsync()).ReturnsAsync(holdStatuses); + _mockLoanCategoryRepository.Setup(x => x.ListAllAsync()).ReturnsAsync(loanCategories); + _mockLocationTypeRepository.Setup(x => x.ListAllAsync()).ReturnsAsync(locationTypes); + _mockVehicleTypeRepository.Setup(x => x.ListAllAsync()).ReturnsAsync(vehicleTypes); + _mockExternalUserRepository.Setup(x => x.ListAsync()).ReturnsAsync(externalUserSet); + _mockRepoCompanyRepository.Setup(x => x.ListAsync()).ReturnsAsync(RepoCompanies); + _mockCollectionsDao.Setup(x => x.RetrieveBranchSetAsync()).ReturnsAsync(branchSet); + } + + private SettingsService BuildTestSettingsService() + { + return new SettingsService + ( + _mockAccountTypeRepository.Object, + _mockAllowedStatusChangeRepository.Object, + _mockBodyStyleRepository.Object, + _mockCleaningLevelRepository.Object, + _mockCollateralTypeRepository.Object, + _mockCollateralTypeToVehicleTypeRepository.Object, + _mockHoldStatusRepository.Object, + _mockLoanCategoryRepository.Object, + _mockLocationTypeRepository.Object, + _mockVehicleTypeRepository.Object, + _mockExternalUserRepository.Object, + _mockRepoCompanyRepository.Object, + _mockUnitOfWork.Object, + _memoryCache.Object, + _mockCollectionsDao.Object, + _configuration + ); + } + + [Fact] + public async void ListSettings_Ok() + { + // arrange service instance + var service = BuildTestSettingsService(); + + // act + var result = await service.ListAllSettingsAsync(); + + // assert + Assert.NotNull(result); + + Assert.Single(result.AccountTypes); + Assert.True(accountTypes.SequenceEqual(result.AccountTypes)); + + Assert.Single(result.AllowedStatusChanges); + Assert.True(allowedStatusChanges.SequenceEqual(result.AllowedStatusChanges)); + + Assert.Single(result.BodyStyles); + Assert.True(bodyStyles.SequenceEqual(result.BodyStyles)); + + Assert.Single(result.CleaningLevels); + Assert.True(cleaningLevels.SequenceEqual(result.CleaningLevels)); + + Assert.Single(result.CollateralTypes); + Assert.True(collateralTypes.SequenceEqual(result.CollateralTypes)); + + Assert.Single(result.CollateralTypesToVehicleTypes); + Assert.True(collateralTypeToVehicleTypes.SequenceEqual(result.CollateralTypesToVehicleTypes)); + + Assert.Single(result.HoldStatuses); + Assert.True(holdStatuses.SequenceEqual(result.HoldStatuses)); + + Assert.Single(result.LoanCategories); + Assert.True(loanCategories.SequenceEqual(result.LoanCategories)); + + Assert.Single(result.LocationTypes); + Assert.True(locationTypes.SequenceEqual(result.LocationTypes)); + + Assert.Single(result.VehicleTypes); + Assert.True(vehicleTypes.SequenceEqual(result.VehicleTypes)); + + Assert.Single(result.BranchSet); + Assert.True(branchSet.SequenceEqual(result.BranchSet)); + + Assert.Single(result.RepoCompanies); + Assert.True(RepoCompanies.SequenceEqual(result.RepoCompanies)); + + Assert.Single(result.TransactionTypeCodes); + Assert.True(_transactionTypeCodes.SequenceEqual(result.TransactionTypeCodes)); + + Assert.Equal(_transactionHistoryParameterDateFormat.ToUpper(), result.TransactionHistoryParameterDateFormat); + + Assert.Equal(_transactionTypeCodeQueryPrefix, result.TransactionTypeCodeQueryPrefix); + + Assert.Equal(_transactionHistoryStartDateOffset, result.TransactionHistoryStartDateOffset); + + Assert.NotNull((result.RepoTypeMap)); + Assert.Equal(5, result.RepoTypeMap.Count); + Assert.Equal(RepoType.Involuntary.ToString(), result.RepoTypeMap.GetValueOrDefault((int)RepoType.Involuntary)); + Assert.Equal(RepoType.Voluntary.ToString(), result.RepoTypeMap.GetValueOrDefault((int)RepoType.Voluntary)); + Assert.Equal(RepoType.Skip.ToString(), result.RepoTypeMap.GetValueOrDefault((int)RepoType.Skip)); + Assert.Equal(RepoType.PreSkip.ToString(), result.RepoTypeMap.GetValueOrDefault((int)RepoType.PreSkip)); + Assert.Equal(RepoType.Unknown.ToString(), result.RepoTypeMap.GetValueOrDefault((int)RepoType.Unknown)); + } + + [Fact] + public async void Save_Account_Type_OK() + { + var type = new AccountType(); + _mockAccountTypeRepository.Setup(x => x.ListAllAsync()).ReturnsAsync(new List { type }); + + // arrange + var service = BuildTestSettingsService(); + + // act + var result = await service.SaveAsync(type); + + // assert + Assert.NotNull(result); + Assert.Equal(type, result); + } + + [Fact] + public async void Save_Allowed_Status_Change_OK() + { + var statusChange = new AllowedStatusChange(); + _mockAllowedStatusChangeRepository.Setup(x => x.ListAllAsync()) + .ReturnsAsync(new List { statusChange }); + + // arrange + var service = BuildTestSettingsService(); + + // act + var result = await service.SaveAsync(statusChange); + + // assert + Assert.NotNull(result); + Assert.Equal(statusChange, result); + } + + [Fact] + public async void Save_Body_Style_OK() + { + var bodyStyle = new BodyStyle(); + _mockBodyStyleRepository.Setup(x => x.ListAllAsync()).ReturnsAsync(new List { bodyStyle }); + + // arrange + var service = BuildTestSettingsService(); + + // act + var result = await service.SaveAsync(bodyStyle); + + // assert + Assert.NotNull(result); + Assert.Equal(bodyStyle, result); + } + + [Fact] + public async void Save_Cleaning_Level_OK() + { + var cleaningLevel = new CleaningLevel(); + _mockCleaningLevelRepository.Setup(x => x.ListAllAsync()) + .ReturnsAsync(new List { cleaningLevel }); + + // arrange + var service = BuildTestSettingsService(); + + // act + var result = await service.SaveAsync(cleaningLevel); + + // assert + Assert.NotNull(result); + Assert.Equal(cleaningLevel, result); + } + + [Fact] + public async void Save_Collateral_Type_OK() + { + var collateralType = new CollateralType(); + _mockCollateralTypeRepository.Setup(x => x.ListAllAsync()) + .ReturnsAsync(new List { collateralType }); + + // arrange + var service = BuildTestSettingsService(); + + // act + var result = await service.SaveAsync(collateralType); + + // assert + Assert.NotNull(result); + Assert.Equal(collateralType, result); + } + + [Fact] + public async void Save_Collateral_Type_To_Vehicle_Type_OK() + { + var collateralToVehicle = new CollateralTypeToVehicleType(); + _mockCollateralTypeToVehicleTypeRepository.Setup(x => x.ListAllAsync()) + .ReturnsAsync(new List { collateralToVehicle }); + + // arrange + var service = BuildTestSettingsService(); + + // act + var result = await service.SaveAsync(collateralToVehicle); + + // assert + Assert.NotNull(result); + Assert.Equal(collateralToVehicle, result); + } + + [Fact] + public async void Save_Hold_Status_OK() + { + var holdStatus = new HoldStatus(); + _mockHoldStatusRepository.Setup(x => x.ListAllAsync()).ReturnsAsync(new List { holdStatus }); + + // arrange + var service = BuildTestSettingsService(); + + // act + var result = await service.SaveAsync(holdStatus); + + // assert + Assert.NotNull(result); + Assert.Equal(holdStatus, result); + } + + [Fact] + public async void Save_Loan_Category_OK() + { + var loanCategory = new LoanCategory(); + _mockLoanCategoryRepository.Setup(x => x.ListAllAsync()) + .ReturnsAsync(new List { loanCategory }); + + // arrange + var service = BuildTestSettingsService(); + + // act + var result = await service.SaveAsync(loanCategory); + + // assert + Assert.NotNull(result); + Assert.Equal(loanCategory, result); + } + + [Fact] + public async void Save_Location_Type_OK() + { + var locationType = new LocationType(); + _mockLocationTypeRepository.Setup(x => x.ListAllAsync()) + .ReturnsAsync(new List { locationType }); + + // arrange + var service = BuildTestSettingsService(); + + // act + var result = await service.SaveAsync(locationType); + + // assert + Assert.NotNull(result); + Assert.Equal(locationType, result); + } + + [Fact] + public async void Save_Vehicle_Type_OK() + { + var vehicleType = new VehicleType(); + _mockVehicleTypeRepository.Setup(x => x.ListAllAsync()).ReturnsAsync(new List { vehicleType }); + + // arrange + var service = BuildTestSettingsService(); + + // act + var result = await service.SaveAsync(vehicleType); + + // assert + Assert.NotNull(result); + Assert.Equal(vehicleType, result); + } + + [Fact] + public async void Update_Account_Type_OK() + { + var type = new AccountType(); + _mockAccountTypeRepository.Setup(x => x.FindByIdAsync(It.IsAny())).ReturnsAsync(type); + type.Description = "New description"; + + // arrange + var service = BuildTestSettingsService(); + + // act + var result = await service.UpdateAsync(type); + + // assert + Assert.NotNull(result); + Assert.Equal("New description", result.Description); + } + + [Fact] + public async void Update_Allowed_Status_Change_OK() + { + var statusChange = new AllowedStatusChange(); + _mockAllowedStatusChangeRepository.Setup(x => x.FindByIdAsync(It.IsAny())).ReturnsAsync(statusChange); + statusChange.AllowedChangeStatus = "New status"; + + // arrange + var service = BuildTestSettingsService(); + + // act + var result = await service.UpdateAsync(statusChange); + + // assert + Assert.NotNull(result); + Assert.Equal("New status", result.AllowedChangeStatus); + } + + [Fact] + public async void Update_Body_Style_OK() + { + var bodyStyle = new BodyStyle(); + _mockBodyStyleRepository.Setup(x => x.FindByIdAsync(It.IsAny())).ReturnsAsync(bodyStyle); + bodyStyle.Description = "New description"; + + // arrange + var service = BuildTestSettingsService(); + + // act + var result = await service.UpdateAsync(bodyStyle); + + // assert + Assert.NotNull(result); + Assert.Equal("New description", result.Description); + } + + [Fact] + public async void Update_Cleaning_Level_OK() + { + var cleaningLevel = new CleaningLevel(); + _mockCleaningLevelRepository.Setup(x => x.FindByIdAsync(It.IsAny())).ReturnsAsync(cleaningLevel); + cleaningLevel.Description = "New description"; + + // arrange + var service = BuildTestSettingsService(); + + // act + var result = await service.UpdateAsync(cleaningLevel); + + // assert + Assert.NotNull(result); + Assert.Equal("New description", result.Description); + } + + [Fact] + public async void Update_Collateral_Type_OK() + { + var collateralType = new CollateralType(); + _mockCollateralTypeRepository.Setup(x => x.FindByIdAsync(It.IsAny())).ReturnsAsync(collateralType); + collateralType.Description = "New description"; + + // arrange + var service = BuildTestSettingsService(); + + // act + var result = await service.UpdateAsync(collateralType); + + // assert + Assert.NotNull(result); + Assert.Equal("New description", result.Description); + } + + [Fact] + public async void Update_Collateral_Type_To_Vehicle_Type_OK() + { + var collateralToVehicle = new CollateralTypeToVehicleType(); + _mockCollateralTypeToVehicleTypeRepository.Setup(x => x.FindByIdAsync(It.IsAny())) + .ReturnsAsync(collateralToVehicle); + collateralToVehicle.VehicleTypeId = 42; + + // arrange + var service = BuildTestSettingsService(); + + // act + var result = await service.UpdateAsync(collateralToVehicle); + + // assert + Assert.NotNull(result); + Assert.Equal(42, result.VehicleTypeId); + } + + [Fact] + public async void Update_Hold_Status_OK() + { + var holdStatus = new HoldStatus(); + _mockHoldStatusRepository.Setup(x => x.FindByIdAsync(It.IsAny())).ReturnsAsync(holdStatus); + holdStatus.Description = "New description"; + + // arrange + var service = BuildTestSettingsService(); + + // act + var result = await service.UpdateAsync(holdStatus); + + // assert + Assert.NotNull(result); + Assert.Equal("New description", result.Description); + } + + [Fact] + public async void Update_Loan_Category_OK() + { + var loanCategory = new LoanCategory(); + _mockLoanCategoryRepository.Setup(x => x.FindByIdAsync(It.IsAny())).ReturnsAsync(loanCategory); + loanCategory.CategoryName = "New name"; + + // arrange + var service = BuildTestSettingsService(); + + // act + var result = await service.UpdateAsync(loanCategory); + + // assert + Assert.NotNull(result); + Assert.Equal("New name", result.CategoryName); + } + + [Fact] + public async void Update_Location_Type_OK() + { + var locationType = new LocationType(); + _mockLocationTypeRepository.Setup(x => x.FindByIdAsync(It.IsAny())).ReturnsAsync(locationType); + locationType.Description = "New description"; + + // arrange + var service = BuildTestSettingsService(); + + // act + var result = await service.UpdateAsync(locationType); + + // assert + Assert.NotNull(result); + Assert.Equal("New description", result.Description); + } + + [Fact] + public async void Update_Vehicle_Type_OK() + { + var vehicleType = new VehicleType(); + _mockVehicleTypeRepository.Setup(x => x.FindByIdAsync(It.IsAny())).ReturnsAsync(vehicleType); + vehicleType.Description = "New description"; + + // arrange + var service = BuildTestSettingsService(); + + // act + var result = await service.UpdateAsync(vehicleType); + + // assert + Assert.NotNull(result); + Assert.Equal("New description", result.Description); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/StatusServiceTests.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/StatusServiceTests.cs new file mode 100644 index 0000000..721947b --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/StatusServiceTests.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Xunit; +using LCU.API.Collections.RepoApi.Services; +using LCU.API.Collections.CollectionsApiLib.Models; +using LCU.API.Collections.RepoApi.Exceptions; + +namespace LCU.API.Collections.RepoApiTests.Services +{ + public class StatusServiceTests + { + + [Theory] + [InlineData(RepoStatus.REHO, "REHO")] + [InlineData(RepoStatus.RECA, "RECA")] + [InlineData(RepoStatus.O4R, "O4R")] + [InlineData(RepoStatus.REPO, "REPO")] + [InlineData(RepoStatus.REDEEMED, "REDEEMED")] + [InlineData(RepoStatus.SOLD, "SOLD")] + [InlineData(RepoStatus.NOTACTIVE, "SOLD")] + public void MapsProperRepoStatus(RepoStatus oldStatus, string status) + { + var result = StatusService.ConvertStatus(oldStatus); + Assert.Equal(result, status); + } + + [Fact] + public void StatusServiceThrowsOnUnknown() + { + Assert.Throws(() => { StatusService.ConvertStatus(RepoStatus.UNKNOWN); }); + } + + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/VehicleFloorPricingParameterServiceTest.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/VehicleFloorPricingParameterServiceTest.cs new file mode 100644 index 0000000..e6c7588 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/Services/VehicleFloorPricingParameterServiceTest.cs @@ -0,0 +1,192 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Xunit; +using Moq; +using LCU.Shared.Collections.RepoApiLib.Repositories; +using RabbitMQ.Client; +using LCU.API.Collections.RepoApi.Services; +using LCU.API.Collections.RepoApi.Exceptions; +using LCU.Shared.Collections.RepoApiLib.Models; +using System.Threading.Tasks; +using System.Data.SqlClient; + +namespace LCU.API.Collections.RepoApiTests.Services +{ + public class VehicleFloorPricingParameterServiceTest + { + [Fact] + public async void ListAll_Exception() + { + var _mockFloorPricingParamRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockFloorPricingParamRepo.Setup(repo => repo.ListAllAsync()).ThrowsAsync(new Exception("oops")); + VehicleFloorPricingParametersService vehicleFloorPricingService = new VehicleFloorPricingParametersService(_mockFloorPricingParamRepo.Object, _mockUnitOfWork.Object); + + await Assert.ThrowsAsync(async () => await vehicleFloorPricingService.ListAll()); + } + + [Fact] + public async void ListAll_OK() + { + var _mockFloorPricingParamRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockFloorPricingParamRepo.Setup(repo => repo.ListAllAsync()).ReturnsAsync(new List() { new VehicleFloorPricingParameters() { } }); + VehicleFloorPricingParametersService vehicleFloorPricingService = new VehicleFloorPricingParametersService(_mockFloorPricingParamRepo.Object, _mockUnitOfWork.Object); + + + var res = await vehicleFloorPricingService.ListAll(); + Assert.Single(res); + } + + [Fact] + public async void Get_Exception() + { + var _mockFloorPricingParamRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockFloorPricingParamRepo.Setup(repo => repo.FindByIdAsync(It.IsAny())).ThrowsAsync(new Exception("oops")); + VehicleFloorPricingParametersService vehicleFloorPricingService = new VehicleFloorPricingParametersService(_mockFloorPricingParamRepo.Object, _mockUnitOfWork.Object); + + await Assert.ThrowsAsync(async () => await vehicleFloorPricingService.Get(5)); + } + + [Fact] + public async void Get_Ok() + { + var _mockFloorPricingParamRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockFloorPricingParamRepo.Setup(repo => repo.FindByIdAsync(It.IsAny())).ReturnsAsync(new VehicleFloorPricingParameters() { Id = 5 }) ; + VehicleFloorPricingParametersService vehicleFloorPricingService = new VehicleFloorPricingParametersService(_mockFloorPricingParamRepo.Object, _mockUnitOfWork.Object); + + var res = await vehicleFloorPricingService.Get(5); + Assert.NotNull(res); + Assert.Equal(5, res.Id); + } + + [Fact] + public async void Get_Null_Exception() + { + var _mockFloorPricingParamRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockFloorPricingParamRepo.Setup(repo => repo.FindByIdAsync(It.IsAny())).Returns(Task.FromResult(null)); + VehicleFloorPricingParametersService vehicleFloorPricingService = new VehicleFloorPricingParametersService(_mockFloorPricingParamRepo.Object, _mockUnitOfWork.Object); + + await Assert.ThrowsAsync(async () => await vehicleFloorPricingService.Get(5)); + } + + [Fact] + public async void UpdateAsync_Existing_Null() + { + VehicleFloorPricingParameters parameters = new VehicleFloorPricingParameters { + Id = 5, + LowCondition = 1, + HighCondition = 5, + NADAFirstValue = "101.1", + NADASecondValue = "202.2", + MMRAdjustedValue = "303.3", + PercentageOf = 10, + ValuationServiceType = 5 + }; + + var _mockFloorPricingParamRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockFloorPricingParamRepo.Setup(repo => repo.FindByIdAsync(It.IsAny())).Returns(Task.FromResult(null)); + _mockFloorPricingParamRepo.Setup(repo => repo.Update(It.Is(param => param.Id == 5))); + + VehicleFloorPricingParametersService vehicleFloorPricingService = new VehicleFloorPricingParametersService(_mockFloorPricingParamRepo.Object, _mockUnitOfWork.Object); + + await Assert.ThrowsAsync(async () => await vehicleFloorPricingService.UpdateAsync(parameters)); + } + + [Fact] + public async void UpdateAsync_Ok() + { + VehicleFloorPricingParameters parameters = new VehicleFloorPricingParameters + { + Id = 5, + LowCondition = 1, + HighCondition = 3, + NADAFirstValue = "101.1", + NADASecondValue = "202.2", + MMRAdjustedValue = "303.3", + PercentageOf = 10, + ValuationServiceType = 4 + }; + + var _mockFloorPricingParamRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockFloorPricingParamRepo.Setup(repo => repo.FindByIdAsync(It.IsAny())).ReturnsAsync(parameters); + _mockFloorPricingParamRepo.Setup(repo => repo.Update(It.Is(param => param.Id == 5 && param.NADAFirstValue == "101.1"))); + VehicleFloorPricingParametersService vehicleFloorPricingService = new VehicleFloorPricingParametersService(_mockFloorPricingParamRepo.Object, _mockUnitOfWork.Object); + + var res = await vehicleFloorPricingService.UpdateAsync(parameters); + Assert.NotNull(res); + Assert.Equal(1, res.LowCondition); + Assert.Equal(3, res.HighCondition); + Assert.Equal("101.1", res.NADAFirstValue); + Assert.Equal("202.2", res.NADASecondValue); + Assert.Equal("303.3", res.MMRAdjustedValue); + Assert.Equal(10, res.PercentageOf); + Assert.Equal(4, res.ValuationServiceType); + } + + [Fact] + public async void UpdateAsync_Existing_Exception() + { + VehicleFloorPricingParameters parameters = new VehicleFloorPricingParameters + { + Id = 5, + LowCondition = 1, + HighCondition = 5, + NADAFirstValue = "101.1", + NADASecondValue = "202.2", + MMRAdjustedValue = "303.3", + PercentageOf = 10, + ValuationServiceType = 5 + }; + + var _mockFloorPricingParamRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockFloorPricingParamRepo.Setup(repo => repo.FindByIdAsync(It.IsAny())).ThrowsAsync(new Exception("oops")); + _mockFloorPricingParamRepo.Setup(repo => repo.Update(It.Is(param => param.Id == 5))); + + VehicleFloorPricingParametersService vehicleFloorPricingService = new VehicleFloorPricingParametersService(_mockFloorPricingParamRepo.Object, _mockUnitOfWork.Object); + + await Assert.ThrowsAsync(async () => await vehicleFloorPricingService.UpdateAsync(parameters)); + } + + [Fact] + public async void UpdateAsync_Update_Exception() + { + VehicleFloorPricingParameters parameters = new VehicleFloorPricingParameters + { + Id = 5, + LowCondition = 1, + HighCondition = 5, + NADAFirstValue = "101.1", + NADASecondValue = "202.2", + MMRAdjustedValue = "303.3", + PercentageOf = 10, + ValuationServiceType = 5 + }; + + var _mockFloorPricingParamRepo = new Mock(); + var _mockUnitOfWork = new Mock(); + + _mockFloorPricingParamRepo.Setup(repo => repo.FindByIdAsync(It.IsAny())).Returns(Task.FromResult(parameters)); + _mockFloorPricingParamRepo.Setup(repo => repo.Update(It.Is(param => param.Id == 5))).Throws(new Exception("oops")); + + VehicleFloorPricingParametersService vehicleFloorPricingService = new VehicleFloorPricingParametersService(_mockFloorPricingParamRepo.Object, _mockUnitOfWork.Object); + + await Assert.ThrowsAsync(async () => await vehicleFloorPricingService.UpdateAsync(parameters)); + } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/StaticTestConfigs.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/StaticTestConfigs.cs new file mode 100644 index 0000000..201982a --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/StaticTestConfigs.cs @@ -0,0 +1,39 @@ +using System.Collections.Generic; +using LCU.Shared.Realtime.QueueLib.Models; + +namespace LCU.API.Collections.RepoApiTests +{ + public class StaticTestConfigs + { + public static Dictionary GetQueueConsumerConfigs() + { + return new Dictionary() + { + { + "AutoImsTask", new QueueConsumerConfig() + { + QueueName = "LCU.Tasks.AutoImsSync", + ExchangeName = "LCU.TaskTokenExchange", + Subject = "LCU.Tasks.AutoImsSync" + } + }, + { + "RepoProcessorTask", new QueueConsumerConfig() + { + QueueName = "LCU.Tasks.RepoAccountProduce", + ExchangeName = "LCU.TaskTokenExchange", + Subject = "LCU.Tasks.RepoAccountProduce" + } + }, + { + "RepoAccountQueue", new QueueConsumerConfig() + { + QueueName = "LCU.Queue.RepoAccount", + ExchangeName = "LCU.ProcessingExchange", + Subject = "LCU.Process.RepoAccount" + } + } + }; + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/WebServices/AutoImsWebServiceTests.cs b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/WebServices/AutoImsWebServiceTests.cs new file mode 100644 index 0000000..4905ea3 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/WebServices/AutoImsWebServiceTests.cs @@ -0,0 +1,10 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace LCU.API.Collections.RepoApiTests.WebServices +{ + class AutoImsWebServiceTests + { + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/additional_test_args.runsettings b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/additional_test_args.runsettings new file mode 100644 index 0000000..16d6a41 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/additional_test_args.runsettings @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + .*microsoft.* + + + + + + + + + + + diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/event_alert_repository.json b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/event_alert_repository.json new file mode 100644 index 0000000..e0ac919 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/event_alert_repository.json @@ -0,0 +1,796 @@ +{ + "repoAccounts": [ + { + "repoId": 11688, + "accountNo": "6829620143", + "status": "REPO", + "memberNo": 6829620, + "loanNo": 143, + "accountTypeCode": "L-P1 ", + "branch": 57, + "collector": " 5727", + "balance": 17328.82, + "dueToPayDate": "2019-08-25T00:00:00", + "o4RDate": "2019-10-02T16:01:19.6", + "dateFirstDelinquent": "2019-08-30T00:00:00", + "delinquentAmount": 684.52, + "daysDelinquent": 38, + "paidSkipAmount": null, + "subStatus": "RPP", + "requiredPaymentAmount": 362.26, + "currentDelinquentAmount": null, + "lstPmtAmt": 372.26, + "origAmount": 21416.72, + "lastPaymentDate": "2019-06-10T00:00:00", + "dateFirstIntellect": "2018-03-30T00:00:00", + "primaryIndividualId": "985090", + "bankruptcy": null, + "manualRedemptionDate": null, + "redemptionExpiredDate": null, + "borrowers": [ + { + "repoId": 11688, + "individualId": "985090", + "ownershipType": 6, + "individualName": "JOHN J SALOPEK IV" + } + ], + "collaterals": [ + { + "collateralId": 12133, + "repoId": 11688, + "vin": "JA4JZ4AX7EZ003293", + "make": "MITSUBISHI", + "model": "Outlander", + "year": 2014, + "description": "2014 MITSUBISHI", + "vehicleType": 0, + "bodyStyle": "4SUV", + "inoperable": false, + "collateralTypeId": 2, + "retitledInLandmarkName": null, + "refCollateralId": null, + "repoCompanySelections": [ + { + "id": 4970, + "collateralId": 12133, + "repoType": "Voluntary", + "repoCompanyId": 9, + "repoCompanyAssignmentDate": "2019-10-02T00:00:00", + "dateRepoed": "2019-10-04T12:14:01.223", + "dateTimeCreated": "2019-10-20T22:03:56.86" + } + ] + } + ], + "repoStatusChanges": [ + { + "id": 31649, + "repoId": 11688, + "statusFrom": "None", + "statusTo": "O4R", + "changedBy": "Importer", + "changedDate": "2019-10-02T16:01:19.647" + }, + { + "id": 31650, + "repoId": 11688, + "statusFrom": "O4R", + "statusTo": "REPO", + "changedBy": "Diana Vandebogert", + "changedDate": "2019-10-04T12:14:01.24" + } + ], + "refundStatus": null, + "dateClosed": null + }, + { + "repoId": 11677, + "accountNo": "6830620143", + "status": "O4R", + "memberNo": 6830620, + "loanNo": 143, + "accountTypeCode": "L-P1 ", + "branch": 57, + "collector": " 5727", + "balance": 19999.82, + "dueToPayDate": "2019-08-25T00:00:00", + "o4RDate": "2019-10-02T16:01:19.6", + "dateFirstDelinquent": "2019-08-30T00:00:00", + "delinquentAmount": 684.52, + "daysDelinquent": 38, + "paidSkipAmount": null, + "subStatus": "RPP", + "requiredPaymentAmount": 362.26, + "currentDelinquentAmount": null, + "lstPmtAmt": 372.26, + "origAmount": 21416.72, + "lastPaymentDate": "2019-06-10T00:00:00", + "dateFirstIntellect": "2018-03-30T00:00:00", + "primaryIndividualId": "985000", + "bankruptcy": null, + "manualRedemptionDate": null, + "redemptionExpiredDate": null, + "borrowers": [ + { + "repoId": 11677, + "individualId": "985000", + "ownershipType": 6, + "individualName": "TEST DOE" + } + ], + "collaterals": [ + { + "collateralId": 3333, + "repoId": 11677, + "vin": "JA4JZ4AX7EZ0032AA", + "make": "MITSUBISHI", + "model": "Outlander", + "year": 2014, + "description": "2014 MITSUBISHI", + "vehicleType": 0, + "bodyStyle": "4SUV", + "inoperable": false, + "collateralTypeId": 2, + "retitledInLandmarkName": null, + "refCollateralId": null, + "repoCompanySelections": [] + } + ], + "repoStatusChanges": [ + { + "id": 31600, + "repoId": 11677, + "statusFrom": "None", + "statusTo": "O4R", + "changedBy": "Importer", + "changedDate": "2019-10-02T16:01:19.647" + } + ], + "refundStatus": null, + "dateClosed": null + }, + { + "repoId": 13527, + "accountNo": "5686390143", + "status": "REPO", + "memberNo": 5686390, + "loanNo": 143, + "accountTypeCode": "L-XL ", + "branch": 26, + "collector": " 5737", + "balance": 13681.92, + "dueToPayDate": "2019-07-22T00:00:00", + "o4RDate": "2019-02-20T13:00:47.327", + "dateFirstDelinquent": "2019-06-27T00:00:00", + "delinquentAmount": 1562.60, + "daysDelinquent": 87, + "paidSkipAmount": null, + "subStatus": "TCOT", + "requiredPaymentAmount": 540.17, + "currentDelinquentAmount": 1562.60, + "lstPmtAmt": 200.00, + "origAmount": 14803.39, + "lastPaymentDate": "2019-09-16T00:00:00", + "dateFirstIntellect": "2018-08-27T00:00:00", + "primaryIndividualId": "853658", + "bankruptcy": null, + "manualRedemptionDate": null, + "redemptionExpiredDate": "2019-03-10T16:46:49", + "borrowers": [ + { + "repoId": 13527, + "individualId": "853658", + "ownershipType": 6, + "individualName": "DESIREE M EDWARDS" + } + ], + "collaterals": [ + { + "collateralId": 14028, + "repoId": 13527, + "vin": "1HGCR2F59EA076689", + "make": "HONDA", + "model": "Accord", + "year": 2014, + "description": "2014 HONDA", + "vehicleType": 0, + "bodyStyle": "4DHT", + "inoperable": false, + "collateralTypeId": 2, + "retitledInLandmarkName": null, + "refCollateralId": null, + "repoCompanySelections": null + } + ], + "repoStatusChanges": [ + { + "id": 37677, + "repoId": 13527, + "statusFrom": "None", + "statusTo": "O4R", + "changedBy": "Importer", + "changedDate": "2019-02-20T13:00:47.327" + }, + { + "id": 37678, + "repoId": 13527, + "statusFrom": "O4R", + "statusTo": "REPO", + "changedBy": "Diana Vandebogert", + "changedDate": "2019-02-22T15:26:53.77" + }, + { + "id": 37679, + "repoId": 13527, + "statusFrom": "REPO", + "statusTo": "NO STATUS INTELLEC", + "changedBy": "Importer", + "changedDate": "2019-03-07T15:01:02.9" + }, + { + "id": 37680, + "repoId": 13527, + "statusFrom": "NO STATUS INTELLEC", + "statusTo": "REDEEMED", + "changedBy": "Diana Vandebogert", + "changedDate": "2019-03-11T12:42:58.577" + }, + { + "id": 37681, + "repoId": 13527, + "statusFrom": "REDEEMED", + "statusTo": "O4R", + "changedBy": "Importer", + "changedDate": "2019-10-17T16:00:57.837" + }, + { + "id": 42158, + "repoId": 13527, + "statusFrom": "O4R", + "statusTo": "REPO", + "changedBy": "System", + "changedDate": "2019-10-21T09:03:39.71" + } + ], + "refundStatus": null, + "dateClosed": null + }, + { + "repoId": 14883, + "accountNo": "9987149147", + "status": "O4R", + "memberNo": 9987149, + "loanNo": 147, + "accountTypeCode": "L-AC ", + "branch": 0, + "collector": " 1367", + "balance": 7238.03, + "dueToPayDate": "2019-07-02T00:00:00", + "o4RDate": "2019-10-21T09:06:25.677", + "dateFirstDelinquent": "2019-04-08T00:00:00", + "delinquentAmount": 1246.21, + "daysDelinquent": 111, + "paidSkipAmount": null, + "subStatus": "DE", + "requiredPaymentAmount": 449.03, + "currentDelinquentAmount": null, + "lstPmtAmt": 450, + "origAmount": 16594.79, + "lastPaymentDate": "2019-09-25T00:00:00", + "dateFirstIntellect": "2015-12-07T00:00:00", + "primaryIndividualId": "370556", + "bankruptcy": null, + "manualRedemptionDate": null, + "redemptionExpiredDate": null, + "borrowers": [ + { + "repoId": 14883, + "individualId": "370556", + "ownershipType": 6, + "individualName": "MARTHA WASHINGTON" + } + ], + "collaterals": [ + { + "collateralId": 15459, + "repoId": 14883, + "vin": "1C3CCCAB4FN591150", + "make": "CHRYSLER", + "model": "200", + "year": 2015, + "description": "2015 CHRYSLER 200", + "vehicleType": null, + "bodyStyle": "", + "inoperable": null, + "collateralTypeId": null, + "retitledInLandmarkName": null, + "refCollateralId": "550088", + "repoCompanySelections": [ + { + "CollateralId": 15459, + "DateTimeCreated": "2015-12-07T00:00:00", + "RepoType": "Involuntary", + "RepoCompanyAssignmentDate": "2015-12-07T00:00:00", + "RepoCompanyId": null + } + ] + } + ], + "repoStatusChanges": [ + { + "id": 42164, + "repoId": 14883, + "statusFrom": "None", + "statusTo": "O4R", + "changedBy": "System", + "changedDate": "2019-10-21T09:06:25.683" + } + ], + "refundStatus": null, + "dateClosed": "2019-10-04T12:14:01.24" + }, + { + "repoId": 13599, + "accountNo": "5689990143", + "status": "REPO", + "memberNo": 5689990, + "loanNo": 143, + "accountTypeCode": "L-XL ", + "branch": 26, + "collector": " 5737", + "balance": 13681.92, + "dueToPayDate": "2019-07-22T00:00:00", + "o4RDate": "2019-02-20T13:00:47.327", + "dateFirstDelinquent": "2019-06-27T00:00:00", + "delinquentAmount": 1562.60, + "daysDelinquent": 87, + "paidSkipAmount": null, + "subStatus": "TCOT", + "requiredPaymentAmount": 540.17, + "currentDelinquentAmount": 1562.60, + "lstPmtAmt": 200.00, + "origAmount": 14803.39, + "lastPaymentDate": "2019-09-16T00:00:00", + "dateFirstIntellect": "2018-08-27T00:00:00", + "primaryIndividualId": "853658", + "bankruptcy": null, + "manualRedemptionDate": null, + "redemptionExpiredDate": "2019-03-10T16:46:49", + "borrowers": [ + { + "repoId": 13599, + "individualId": "853699", + "ownershipType": 6, + "individualName": "CLOSED, repo company, no auction" + } + ], + "collaterals": [ + { + "collateralId": 14099, + "repoId": 13599, + "vin": "1HGCR2F59EA079989", + "make": "HONDA", + "model": "Accord", + "year": 2014, + "description": "2014 HONDA", + "vehicleType": 0, + "bodyStyle": "4DHT", + "inoperable": false, + "collateralTypeId": 2, + "retitledInLandmarkName": null, + "refCollateralId": null, + "repoCompanySelections": [ + { + "id": 4975, + "collateralId": 14099, + "repoType": "Voluntary", + "repoCompanyId": 9, + "repoCompanyAssignmentDate": "2019-10-02T00:00:00", + "dateRepoed": "2019-10-04T12:14:01.223", + "dateTimeCreated": "2019-10-20T22:03:56.86" + } + ] + } + ], + "repoStatusChanges": [ + { + "id": 39677, + "repoId": 13599, + "statusFrom": "None", + "statusTo": "O4R", + "changedBy": "Importer", + "changedDate": "2019-02-20T13:00:47.327" + }, + { + "id": 39678, + "repoId": 13599, + "statusFrom": "O4R", + "statusTo": "REPO", + "changedBy": "Diana Vandebogert", + "changedDate": "2019-02-22T15:26:53.77" + } + ], + "refundStatus": null, + "dateClosed": "2020-01-22T15:26:53.77" + } + ], + "auctionAssignments": [ + { + "id": 5875, + "auctionId": "MMAA", + "repoId": 11688, + "auctionCustomerNo": "985090143", + "collateralVIN": "JA4JZ4AX7EZ003293", + "dateSubmitted": "2019-10-05T11:02:17.41", + "floorPrice": 0.00, + "floorPriceResponseCode": null, + "floorPriceResponseDescription": null, + "floorPriceSubmissionErrors": null, + "holdStatus": null, + "holdUntil": null, + "redeemedDate": null, + "vehicleType": null, + "bodyStyle": null, + "inoperable": null, + "retailValue": null, + "auctionNotes": null, + "availablePickupDate": null, + "legalSaleDate": null, + "cleaningLevel": null, + "submissionResponseCode": null, + "submissionResponseDescription": null, + "submissionErrors": null, + "sentTitleDocsDate": null, + "titleSentResponseCode": null, + "titleSentResponseDescription": null, + "titleSentSubmissionErrors": null, + "addedThroughRepoDatabase": null, + "isActive": true, + "autoIMS": { + "repoId": 11688, + "vin": "JA4JZ4AX7EZ003293", + "auctionAssignmentId": 5875, + "auctionCustomerNo": "985090143", + "assignmentAccepted": "2019-10-05T00:00:00", + "dateReceivedFromAutoIMS": "2019-10-05T12:36:16.153", + "scheduledSaleDate": null, + "soldDate": null, + "announcedConditions": "", + "arbitrationReason": "", + "asIs100KMiles": false, + "auctionAge": 6, + "auctionGuideBookPrice": 11250.00, + "buyerId": "", + "buyerName": "", + "chargeAmount": 95.48, + "checkAmount": null, + "clientAge": 10, + "clientCancelled": null, + "collisionDamage": "", + "inspectedDate": "2019-10-11T00:00:00", + "dateofLoss": null, + "datePickedUp": "2019-10-10T00:00:00", + "dateEnteredAutoIMS": "2019-10-05T12:02:00", + "daysRun": null, + "daysRunHighestBidRecordedbyAuction": "", + "daystoDelivery": 5, + "description": "JA4JZ4AX7EZ003293 2014 MITSUBISHI OUTLAND 4X4 V6 SUV", + "isDrivable": true, + "floorPriceAccepted": null, + "fundsSent": null, + "grossPercentFloor": 0.00, + "highestBid": null, + "statedMileage": 83189, + "netPercentFloor": 0.00, + "otherAdvanceFees": null, + "otherTotal": "", + "otherAdvancedOther": "", + "otherAdvancedStorage": "", + "otherAdvancedTow": "", + "otherMiscellaneous": "", + "salePrice": null, + "titleNumber": "", + "titleReceived": null, + "titleReturned": null, + "titleState": "", + "titleStatus": "Title Not Sent", + "titleStatusfromAuction": "", + "totalCharges": 95.48, + "approvedVehicleGrade": 2.60, + "isOperable": null, + "shipmentDate": "2019-10-10T00:00:00", + "status": "Awaiting Clearance /Inspected", + "storageCost": null, + "storageRatePerDay": null, + "towCost": null, + "vehicleDecimalGradeCode": 2.60, + "vehicleGrade": 2.60, + "mmrNationalAdjustedPrice": null, + "mmrRegionalAdjustedPrice": null, + "mmr": "", + "conditionReportLink": "http://Ecr.autoims.com/jsp/ConditionReport.jsp?clientid=LAND&iid=7ea5d4126fb2187d4828f535eca9aa1d", + "collateralImagePath": "http://images.cdn.manheim.com/20191011191803-b2269056-9f85-41e9-9126-318cd20a1ef2.jpg" + }, + "auction": { + "auctionID": "MMAA", + "name": "Manheim Milwaukee", + "active": "yes", + "address_Line_1": "561 27th Street", + "address_Line_2": "-", + "city": "Caledonia", + "state": "WI", + "zip": "53108", + "country": "USA", + "phone": "(800) 662-2947", + "fax": "(262) 824-2552", + "latitude": 42.8345829248428, + "longitude": -87.9532619565725 + }, + "auctionAssignmentToCollaterals": [ + { + "auctionAssignmentId": 5875, + "collateralId": 12133, + "collateral": { + "collateralId": 12133, + "repoId": 11688, + "vin": "JA4JZ4AX7EZ003293", + "make": "MITSUBISHI", + "model": "Outlander", + "year": 2014, + "description": "2014 MITSUBISHI", + "vehicleType": 0, + "bodyStyle": "4SUV", + "inoperable": false, + "collateralTypeId": 2, + "retitledInLandmarkName": null, + "refCollateralId": null, + "repoCompanySelections": [ + { + "id": 4970, + "collateralId": 12133, + "repoType": "Voluntary", + "repoCompanyId": 9, + "repoCompanyAssignmentDate": "2019-10-02T00:00:00", + "dateRepoed": "2019-10-04T12:14:01.223", + "dateTimeCreated": "2019-10-20T22:03:56.86" + } + ] + } + } + ], + "floorPriceValuesUsed": null + }, + { + "id": 7122, + "auctionId": "MMAA", + "repoId": 13527, + "auctionCustomerNo": "853658143", + "collateralVIN": "1HGCR2F59EA076689", + "dateSubmitted": "2019-02-22T16:20:17.45", + "floorPrice": 0.00, + "floorPriceResponseCode": null, + "floorPriceResponseDescription": null, + "floorPriceSubmissionErrors": null, + "holdStatus": null, + "holdUntil": null, + "redeemedDate": null, + "vehicleType": null, + "bodyStyle": null, + "inoperable": null, + "retailValue": null, + "auctionNotes": null, + "availablePickupDate": null, + "legalSaleDate": null, + "cleaningLevel": null, + "submissionResponseCode": null, + "submissionResponseDescription": null, + "submissionErrors": null, + "sentTitleDocsDate": null, + "titleSentResponseCode": null, + "titleSentResponseDescription": null, + "titleSentSubmissionErrors": null, + "addedThroughRepoDatabase": null, + "isActive": true, + "autoIMS": { + "repoId": 13527, + "vin": "1HGCR2F59EA076689", + "auctionAssignmentId": 7122, + "auctionCustomerNo": "853658143", + "assignmentAccepted": "2019-02-22T00:00:00", + "dateReceivedFromAutoIMS": "2019-02-23T08:35:23.993", + "scheduledSaleDate": null, + "soldDate": null, + "announcedConditions": "AS IS;", + "arbitrationReason": "", + "asIs100KMiles": true, + "auctionAge": 12, + "auctionGuideBookPrice": 9500.00, + "buyerId": "", + "buyerName": "", + "chargeAmount": 337.48, + "checkAmount": null, + "clientAge": 21, + "clientCancelled": null, + "collisionDamage": "", + "inspectedDate": "2019-03-05T00:00:00", + "dateofLoss": null, + "datePickedUp": "2019-03-04T00:00:00", + "dateEnteredAutoIMS": "2019-02-22T17:20:00", + "daysRun": null, + "daysRunHighestBidRecordedbyAuction": "", + "daystoDelivery": 10, + "description": "1HGCR2F59EA076689 2014 HONDA ACCORD 4C 4DSN", + "isDrivable": false, + "floorPriceAccepted": null, + "fundsSent": null, + "grossPercentFloor": 0.00, + "highestBid": null, + "statedMileage": 104304, + "netPercentFloor": 0.00, + "otherAdvanceFees": null, + "otherTotal": "", + "otherAdvancedOther": "", + "otherAdvancedStorage": "", + "otherAdvancedTow": "", + "otherMiscellaneous": "", + "salePrice": null, + "titleNumber": "", + "titleReceived": null, + "titleReturned": null, + "titleState": "", + "titleStatus": "Title Not Sent", + "titleStatusfromAuction": "", + "totalCharges": 337.48, + "approvedVehicleGrade": null, + "isOperable": null, + "shipmentDate": "2019-03-04T00:00:00", + "status": "Redeemed", + "storageCost": null, + "storageRatePerDay": null, + "towCost": null, + "vehicleDecimalGradeCode": 3.40, + "vehicleGrade": 3.40, + "mmrNationalAdjustedPrice": null, + "mmrRegionalAdjustedPrice": null, + "mmr": "", + "conditionReportLink": "http://Ecr.autoims.com/jsp/ConditionReport.jsp?clientid=LAND&iid=b397d5c88db8da7664f9ffc2877de5a5", + "collateralImagePath": "http://images.cdn.manheim.com/20190307160935-5219895b-ab8a-4839-8cd0-508758640c46.jpg" + }, + "auction": { + "auctionID": "MMAA", + "name": "Manheim Milwaukee", + "active": "yes", + "address_Line_1": "561 27th Street", + "address_Line_2": "-", + "city": "Caledonia", + "state": "WI", + "zip": "53108", + "country": "USA", + "phone": "(800) 662-2947", + "fax": "(262) 824-2552", + "latitude": 42.8345829248428, + "longitude": -87.9532619565725 + }, + "auctionAssignmentToCollaterals": [ + { + "auctionAssignmentId": 7122, + "collateralId": 14028, + "collateral": { + "collateralId": 14028, + "repoId": 13527, + "vin": "1HGCR2F59EA076689", + "make": "HONDA", + "model": "Accord", + "year": 2014, + "description": "2014 HONDA", + "vehicleType": 0, + "bodyStyle": "4DHT", + "inoperable": false, + "collateralTypeId": 2, + "retitledInLandmarkName": null, + "refCollateralId": null, + "repoCompanySelections": [ + { + "id": 6822, + "collateralId": 14028, + "repoType": "PreSkip", + "repoCompanyId": 1, + "repoCompanyAssignmentDate": "2019-10-17T00:00:00", + "dateRepoed": null, + "dateTimeCreated": "2019-10-20T22:28:36.12" + } + ] + } + } + ], + "floorPriceValuesUsed": null + } + ], + "eventAlerts": [ + { + "RepoId": 14883, + "AccountNo": "9987149147", + "Message": "test", + "CreatedBy": "Unit Test", + "DateAdded": "2019-06-27T00:00:00" + }, + { + "RepoId": 14883, + "AccountNo": "9987149147", + "Message": "test", + "CreatedBy": "Unit Test", + "DateAdded": "2019-06-27T00:00:00", + "DateMarkedRead": "2019-06-27T00:00:00", + "MarkedReadBy": "tester" + }, + { + "RepoId": 11688, + "AccountNo": "6829620143", + "Message": "test", + "CreatedBy": "Unit Test", + "DateAdded": "2019-06-27T00:00:00", + "DateMarkedRead": "2019-06-27T00:00:00", + "MarkedReadBy": "tester" + }, + { + "RepoId": 11688, + "AccountNo": "6829620143", + "Message": "RTC Letter Not Found", + "CreatedBy": "Unit Test", + "DateAdded": "2019-06-27T00:00:00", + "DateMarkedRead": "2019-06-27T00:00:00", + "MarkedReadBy": "tester" + } + ], + "repoManualStatus": [ + { + "ID": 1, + "Description": "PSKP", + "IsActiveStatus": false, + "WatchForStatusChanges": false + }, + { + "ID": 2, + "Description": "NOT ACTIVE", + "IsActiveStatus": false, + "WatchForStatusChanges": false + }, + { + "ID": 3, + "Description": "SOLD", + "IsActiveStatus": false, + "WatchForStatusChanges": false + }, + { + "ID": 4, + "Description": "REDEEMED", + "IsActiveStatus": false, + "WatchForStatusChanges": true + }, + { + "ID": 5, + "Description": "O4R", + "IsActiveStatus": true, + "WatchForStatusChanges": true + }, + { + "ID": 6, + "Description": "REPO", + "IsActiveStatus": true, + "WatchForStatusChanges": true + }, + { + "ID": 7, + "Description": "RECA", + "IsActiveStatus": true, + "WatchForStatusChanges": true + }, + { + "ID": 8, + "Description": "REHO", + "IsActiveStatus": true, + "WatchForStatusChanges": true + } + ] +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/test_accounts - RECA.json b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/test_accounts - RECA.json new file mode 100644 index 0000000..ff99353 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/test_accounts - RECA.json @@ -0,0 +1,421 @@ +{ + "newAccountsRECA": [ + [ + { + "CollectionAccount": { + "accountId": 66410, + "accountIdentifier": "5484143", + "accountNumber": "5484", + "accountStatus": "Open", + "accountTypeId": 1007, + "activeFlag": true, + "amountLastPaid": 460, + "balance": 12423.94, + "bankruptcyFlag": false, + "branch": "", + "dueDate": "2020-06-02T00:00:00", + "firstPaymentDueDate": "2017-01-02T00:00:00", + "loanOfficer": "DEAN FELSKE", + "originalLoanAmount": 27500, + "originalLoanDate": "2016-12-02T00:00:00", + "dqAmount": null, + "daysDq": -1, + "cases": [ + { + "caseID": 4, + "caseNumber": "REPO-00000004", + "caseDescription": "", + "caseStageID": 1, + "repoStatus": 300, + "caseStatusID": 33, + "caseTitle": "test", + "caseTypeBasisId": 2, + "caseTypeID": 7, + "closedDate": null, + "createdDate": "2020-05-28T15:40:27.917", + "createdUserID": 5, + "currentStageDate": "2020-05-28T15:40:27.073", + "currentStatusDate": "2020-05-28T15:40:27.073", + "lastReviewDate": null, + "nextReviewDate": null, + "stage1CompletionDate": null, + "stage2CompletionDate": null, + "stage3CompletionDate": null, + "stage4CompletionDate": null, + "stage5CompletionDate": null + } + ] + }, + "CollectionCase": { + "caseID": 4, + "caseNumber": "REPO-00000004", + "caseDescription": "", + "caseStageID": 1, + "repoStatus": 300, + "caseStatusID": 33, + "caseTitle": "test", + "caseTypeBasisId": 2, + "caseTypeID": 7, + "closedDate": null, + "createdDate": "2020-05-28T15:40:27.917", + "createdUserID": 5, + "currentStageDate": "2020-05-28T15:40:27.073", + "currentStatusDate": "2020-05-28T15:40:27.073", + "lastReviewDate": null, + "nextReviewDate": null, + "stage1CompletionDate": null, + "stage2CompletionDate": null, + "stage3CompletionDate": null, + "stage4CompletionDate": null, + "stage5CompletionDate": null + }, + "NewRepoAccount": { + "repoId": 1, + "accountNo": "5484143", + "status": "RECA", + "memberNo": 3212321, + "loanNo": 147, + "accountTypeCode": "L-AC ", + "branch": 13, + "collector": " 1367", + "balance": 7238.03, + "dueToPayDate": "2019-08-02T00:00:00", + "o4RDate": "2019-10-21T09:01:47.383", + "dateFirstDelinquent": "2019-04-08T00:00:00", + "delinquentAmount": 3491.36, + "daysDelinquent": 80, + "paidSkipAmount": null, + "subStatus": "DE", + "requiredPaymentAmount": 449.03, + "currentDelinquentAmount": 3491.36, + "lstPmtAmt": 450.00, + "origAmount": 16594.79, + "lastPaymentDate": "2019-09-25T00:00:00", + "dateFirstIntellect": "2015-12-07T00:00:00", + "primaryIndividualId": "370556", + "bankruptcy": null, + "manualRedemptionDate": null, + "redemptionExpiredDate": null, + "borrowers": [ + { + "repoId": 1, + "individualId": "370556", + "ownershipType": 6, + "individualName": "GEORGE WASHINGTON" + } + ], + "collaterals": [ + { + "collateralId": 1, + "repoId": 1, + "vin": "100000AB4FN591150", + "make": "CHRYSLER", + "model": "200", + "year": 2015, + "description": "2015 CHRYSLER 200", + "vehicleType": null, + "bodyStyle": null, + "inoperable": null, + "collateralTypeId": null, + "retitledInLandmarkName": null, + "refCollateralId": null, + "repoCompanySelections": [ + { + "id": 1, + "collateralId": 1, + "repoType": "PreSkip", + "repoCompanyId": 1, + "repoCompanyAssignmentDate": "2019-10-21T05:00:00", + "dateRepoed": "2019-11-23T06:00:00", + "dateTimeCreated": "2019-11-04T15:22:43.883" + } + ] + } + ], + "repoStatusChanges": [ + { + "id": 1, + "repoId": 1, + "statusFrom": "None", + "statusTo": "O4R", + "changedBy": "Importer", + "changedDate": "2019-10-21T09:01:47.43" + }, + { + "id": 15564, + "repoId": 1, + "statusFrom": "O4R", + "statusTo": "RECA", + "changedBy": "System User", + "changedDate": "2020-03-02T17:04:57.383" + } + ], + "refundStatus": { + "repoId": 1, + "warrantyRefundStatus": null, + "insuranceRefundStatus": null, + "premiumDefiRefundStatus": null, + "cpiRefundStatus": "Received", + "refundsReceivedDate": null + }, + "dateClosed": null + } + } + ] + ], + "existingAccountsRECA": [ + [ + { + "CollectionAccount": { + "accountId": 66410, + "accountIdentifier": "5484143", + "accountNumber": "5484", + "accountStatus": "Open", + "accountTypeId": 1007, + "activeFlag": true, + "amountLastPaid": 460, + "balance": 12423.94, + "bankruptcyFlag": false, + "branch": "", + "dueDate": "2020-06-02T00:00:00", + "firstPaymentDueDate": "2017-01-02T00:00:00", + "loanOfficer": "DEAN FELSKE", + "originalLoanAmount": 27500, + "originalLoanDate": "2016-12-02T00:00:00", + "dqAmount": null, + "daysDq": -1, + "cases": [ + { + "caseID": 4, + "caseNumber": "REPO-00000004", + "caseDescription": "", + "caseStageID": 1, + "repoStatus": 300, + "caseStatusID": 33, + "caseTitle": "test", + "caseTypeBasisId": 2, + "caseTypeID": 7, + "closedDate": null, + "createdDate": "2020-05-28T15:40:27.917", + "createdUserID": 5, + "currentStageDate": "2020-05-28T15:40:27.073", + "currentStatusDate": "2020-05-28T15:40:27.073", + "lastReviewDate": null, + "nextReviewDate": null, + "stage1CompletionDate": null, + "stage2CompletionDate": null, + "stage3CompletionDate": null, + "stage4CompletionDate": null, + "stage5CompletionDate": null + } + ] + }, + "CollectionCase": { + "caseID": 4, + "caseNumber": "REPO-00000004", + "caseDescription": "", + "caseStageID": 1, + "repoStatus": 300, + "caseStatusID": 33, + "caseTitle": "test", + "caseTypeBasisId": 2, + "caseTypeID": 7, + "closedDate": null, + "createdDate": "2020-05-28T15:40:27.917", + "createdUserID": 5, + "currentStageDate": "2020-05-28T15:40:27.073", + "currentStatusDate": "2020-05-28T15:40:27.073", + "lastReviewDate": null, + "nextReviewDate": null, + "stage1CompletionDate": null, + "stage2CompletionDate": null, + "stage3CompletionDate": null, + "stage4CompletionDate": null, + "stage5CompletionDate": null + }, + "ExistingRepoAccount": { + "repoId": 1, + "accountNo": "5484143", + "status": "RECA", + "memberNo": 3212321, + "loanNo": 147, + "accountTypeCode": "L-AC ", + "branch": 13, + "collector": " 1367", + "balance": 7238.03, + "dueToPayDate": "2019-08-02T00:00:00", + "o4RDate": "2019-10-21T09:01:47.383", + "dateFirstDelinquent": "2019-04-08T00:00:00", + "delinquentAmount": 3491.36, + "daysDelinquent": 80, + "paidSkipAmount": null, + "subStatus": "DE", + "requiredPaymentAmount": 449.03, + "currentDelinquentAmount": 3491.36, + "lstPmtAmt": 450.00, + "origAmount": 16594.79, + "lastPaymentDate": "2019-09-25T00:00:00", + "dateFirstIntellect": "2015-12-07T00:00:00", + "primaryIndividualId": "370556", + "bankruptcy": null, + "manualRedemptionDate": null, + "redemptionExpiredDate": null, + "borrowers": [ + { + "repoId": 1, + "individualId": "370556", + "ownershipType": 6, + "individualName": "GEORGE WASHINGTON" + } + ], + "collaterals": [ + { + "collateralId": 1, + "repoId": 1, + "vin": "100000AB4FN591150", + "make": "CHRYSLER", + "model": "200", + "year": 2015, + "description": "2015 CHRYSLER 200", + "vehicleType": null, + "bodyStyle": null, + "inoperable": null, + "collateralTypeId": null, + "retitledInLandmarkName": null, + "refCollateralId": null, + "repoCompanySelections": [ + { + "id": 1, + "collateralId": 1, + "repoType": "PreSkip", + "repoCompanyId": 1, + "repoCompanyAssignmentDate": "2019-10-21T05:00:00", + "dateRepoed": "2019-11-23T06:00:00", + "dateTimeCreated": "2019-11-04T15:22:43.883" + } + ] + } + ], + "repoStatusChanges": [ + { + "id": 1, + "repoId": 1, + "statusFrom": "None", + "statusTo": "O4R", + "changedBy": "Importer", + "changedDate": "2019-10-21T09:01:47.43" + }, + { + "id": 15564, + "repoId": 1, + "statusFrom": "O4R", + "statusTo": "RECA", + "changedBy": "System User", + "changedDate": "2020-03-02T17:04:57.383" + } + ], + "refundStatus": { + "repoId": 1, + "warrantyRefundStatus": null, + "insuranceRefundStatus": null, + "premiumDefiRefundStatus": null, + "cpiRefundStatus": "Received", + "refundsReceivedDate": null + }, + "dateClosed": null + }, + "NewRepoAccount": { + "repoId": 1, + "accountNo": "5484143", + "status": "RECA", + "memberNo": 3212321, + "loanNo": 147, + "accountTypeCode": "L-AC ", + "branch": 13, + "collector": " 1367", + "balance": 7238.03, + "dueToPayDate": "2019-08-02T00:00:00", + "o4RDate": "2019-10-21T09:01:47.383", + "dateFirstDelinquent": "2019-04-08T00:00:00", + "delinquentAmount": 3491.36, + "daysDelinquent": 80, + "paidSkipAmount": null, + "subStatus": "DE", + "requiredPaymentAmount": 449.03, + "currentDelinquentAmount": 3491.36, + "lstPmtAmt": 450.00, + "origAmount": 16594.79, + "lastPaymentDate": "2019-09-25T00:00:00", + "dateFirstIntellect": "2015-12-07T00:00:00", + "primaryIndividualId": "370556", + "bankruptcy": null, + "manualRedemptionDate": null, + "redemptionExpiredDate": null, + "borrowers": [ + { + "repoId": 1, + "individualId": "370556", + "ownershipType": 6, + "individualName": "GEORGE WASHINGTON" + } + ], + "collaterals": [ + { + "collateralId": 1, + "repoId": 1, + "vin": "100000AB4FN591150", + "make": "CHRYSLER", + "model": "200", + "year": 2015, + "description": "2015 CHRYSLER 200", + "vehicleType": null, + "bodyStyle": null, + "inoperable": null, + "collateralTypeId": null, + "retitledInLandmarkName": null, + "refCollateralId": null, + "repoCompanySelections": [ + { + "id": 1, + "collateralId": 1, + "repoType": "PreSkip", + "repoCompanyId": 1, + "repoCompanyAssignmentDate": "2019-10-21T05:00:00", + "dateRepoed": "2019-11-23T06:00:00", + "dateTimeCreated": "2019-11-04T15:22:43.883" + } + ] + } + ], + "repoStatusChanges": [ + { + "id": 1, + "repoId": 1, + "statusFrom": "None", + "statusTo": "O4R", + "changedBy": "Importer", + "changedDate": "2019-10-21T09:01:47.43" + }, + { + "id": 15564, + "repoId": 1, + "statusFrom": "O4R", + "statusTo": "RECA", + "changedBy": "System User", + "changedDate": "2020-03-02T17:04:57.383" + } + ], + "refundStatus": { + "repoId": 1, + "warrantyRefundStatus": null, + "insuranceRefundStatus": null, + "premiumDefiRefundStatus": null, + "cpiRefundStatus": "Received", + "refundsReceivedDate": null + }, + "dateClosed": "2020-03-07T17:04:57.383" + } + } + ] + ] +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/test_accounts.json b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/test_accounts.json new file mode 100644 index 0000000..9db80c7 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/test_accounts.json @@ -0,0 +1,421 @@ +{ + "newAccounts04R": [ + [ + { + "CollectionAccount": { + "accountId": 66410, + "accountIdentifier": "5484143", + "accountNumber": "5484", + "accountStatus": "Open", + "accountTypeId": 1007, + "activeFlag": true, + "amountLastPaid": 460, + "balance": 12423.94, + "bankruptcyFlag": false, + "branch": "", + "dueDate": "2020-06-02T00:00:00", + "firstPaymentDueDate": "2017-01-02T00:00:00", + "loanOfficer": "DEAN FELSKE", + "originalLoanAmount": 27500, + "originalLoanDate": "2016-12-02T00:00:00", + "dqAmount": null, + "daysDq": -1, + "cases": [ + { + "caseID": 4, + "caseNumber": "REPO-00000004", + "caseDescription": "", + "caseStageID": 1, + "repoStatus": 100, + "caseStatusID": 33, + "caseTitle": "test", + "caseTypeBasisId": 2, + "caseTypeID": 7, + "closedDate": null, + "createdDate": "2020-05-28T15:40:27.917", + "createdUserID": 5, + "currentStageDate": "2020-05-28T15:40:27.073", + "currentStatusDate": "2020-05-28T15:40:27.073", + "lastReviewDate": null, + "nextReviewDate": null, + "stage1CompletionDate": null, + "stage2CompletionDate": null, + "stage3CompletionDate": null, + "stage4CompletionDate": null, + "stage5CompletionDate": null + } + ] + }, + "CollectionCase": { + "caseID": 4, + "caseNumber": "REPO-00000004", + "caseDescription": "", + "caseStageID": 1, + "repoStatus": 100, + "caseStatusID": 33, + "caseTitle": "test", + "caseTypeBasisId": 2, + "caseTypeID": 7, + "closedDate": null, + "createdDate": "2020-05-28T15:40:27.917", + "createdUserID": 5, + "currentStageDate": "2020-05-28T15:40:27.073", + "currentStatusDate": "2020-05-28T15:40:27.073", + "lastReviewDate": null, + "nextReviewDate": null, + "stage1CompletionDate": null, + "stage2CompletionDate": null, + "stage3CompletionDate": null, + "stage4CompletionDate": null, + "stage5CompletionDate": null + }, + "NewRepoAccount": { + "repoId": 1, + "accountNo": "5484143", + "status": "O4R", + "memberNo": 3212321, + "loanNo": 147, + "accountTypeCode": "L-AC ", + "branch": 13, + "collector": " 1367", + "balance": 7238.03, + "dueToPayDate": "2019-08-02T00:00:00", + "o4RDate": "2019-10-21T09:01:47.383", + "dateFirstDelinquent": "2019-04-08T00:00:00", + "delinquentAmount": 3491.36, + "daysDelinquent": 80, + "paidSkipAmount": null, + "subStatus": "DE", + "requiredPaymentAmount": 449.03, + "currentDelinquentAmount": 3491.36, + "lstPmtAmt": 450.00, + "origAmount": 16594.79, + "lastPaymentDate": "2019-09-25T00:00:00", + "dateFirstIntellect": "2015-12-07T00:00:00", + "primaryIndividualId": "370556", + "bankruptcy": null, + "manualRedemptionDate": null, + "redemptionExpiredDate": null, + "borrowers": [ + { + "repoId": 1, + "individualId": "370556", + "ownershipType": 6, + "individualName": "GEORGE WASHINGTON" + } + ], + "collaterals": [ + { + "collateralId": 1, + "repoId": 1, + "vin": "100000AB4FN591150", + "make": "CHRYSLER", + "model": "200", + "year": 2015, + "description": "2015 CHRYSLER 200", + "vehicleType": null, + "bodyStyle": null, + "inoperable": null, + "collateralTypeId": null, + "retitledInLandmarkName": null, + "refCollateralId": null, + "repoCompanySelections": [ + { + "id": 1, + "collateralId": 1, + "repoType": "PreSkip", + "repoCompanyId": 1, + "repoCompanyAssignmentDate": "2019-10-21T05:00:00", + "dateRepoed": "2019-11-23T06:00:00", + "dateTimeCreated": "2019-11-04T15:22:43.883" + } + ] + } + ], + "repoStatusChanges": [ + { + "id": 1, + "repoId": 1, + "statusFrom": "None", + "statusTo": "O4R", + "changedBy": "Importer", + "changedDate": "2019-10-21T09:01:47.43" + }, + { + "id": 15564, + "repoId": 1, + "statusFrom": "O4R", + "statusTo": "PSKP", + "changedBy": "System User", + "changedDate": "2020-03-02T17:04:57.383" + } + ], + "refundStatus": { + "repoId": 1, + "warrantyRefundStatus": null, + "insuranceRefundStatus": null, + "premiumDefiRefundStatus": null, + "cpiRefundStatus": "Received", + "refundsReceivedDate": null + }, + "dateClosed": null + } + } + ] + ], + "existingAccounts04R": [ + [ + { + "CollectionAccount": { + "accountId": 66410, + "accountIdentifier": "5484143", + "accountNumber": "5484", + "accountStatus": "Open", + "accountTypeId": 1007, + "activeFlag": true, + "amountLastPaid": 460, + "balance": 12423.94, + "bankruptcyFlag": false, + "branch": "", + "dueDate": "2020-06-02T00:00:00", + "firstPaymentDueDate": "2017-01-02T00:00:00", + "loanOfficer": "DEAN FELSKE", + "originalLoanAmount": 27500, + "originalLoanDate": "2016-12-02T00:00:00", + "dqAmount": null, + "daysDq": -1, + "cases": [ + { + "caseID": 4, + "caseNumber": "REPO-00000004", + "caseDescription": "", + "caseStageID": 1, + "repoStatus": 100, + "caseStatusID": 33, + "caseTitle": "test", + "caseTypeBasisId": 2, + "caseTypeID": 7, + "closedDate": null, + "createdDate": "2020-05-28T15:40:27.917", + "createdUserID": 5, + "currentStageDate": "2020-05-28T15:40:27.073", + "currentStatusDate": "2020-05-28T15:40:27.073", + "lastReviewDate": null, + "nextReviewDate": null, + "stage1CompletionDate": null, + "stage2CompletionDate": null, + "stage3CompletionDate": null, + "stage4CompletionDate": null, + "stage5CompletionDate": null + } + ] + }, + "CollectionCase": { + "caseID": 4, + "caseNumber": "REPO-00000004", + "caseDescription": "", + "caseStageID": 1, + "repoStatus": 100, + "caseStatusID": 33, + "caseTitle": "test", + "caseTypeBasisId": 2, + "caseTypeID": 7, + "closedDate": null, + "createdDate": "2020-05-28T15:40:27.917", + "createdUserID": 5, + "currentStageDate": "2020-05-28T15:40:27.073", + "currentStatusDate": "2020-05-28T15:40:27.073", + "lastReviewDate": null, + "nextReviewDate": null, + "stage1CompletionDate": null, + "stage2CompletionDate": null, + "stage3CompletionDate": null, + "stage4CompletionDate": null, + "stage5CompletionDate": null + }, + "ExistingRepoAccount": { + "repoId": 1, + "accountNo": "5484143", + "status": "O4R", + "memberNo": 3212321, + "loanNo": 147, + "accountTypeCode": "L-AC ", + "branch": 13, + "collector": " 1367", + "balance": 7238.03, + "dueToPayDate": "2019-08-02T00:00:00", + "o4RDate": "2019-10-21T09:01:47.383", + "dateFirstDelinquent": "2019-04-08T00:00:00", + "delinquentAmount": 3491.36, + "daysDelinquent": 80, + "paidSkipAmount": null, + "subStatus": "DE", + "requiredPaymentAmount": 449.03, + "currentDelinquentAmount": 3491.36, + "lstPmtAmt": 450.00, + "origAmount": 16594.79, + "lastPaymentDate": "2019-09-25T00:00:00", + "dateFirstIntellect": "2015-12-07T00:00:00", + "primaryIndividualId": "370556", + "bankruptcy": null, + "manualRedemptionDate": null, + "redemptionExpiredDate": null, + "borrowers": [ + { + "repoId": 1, + "individualId": "370556", + "ownershipType": 6, + "individualName": "GEORGE WASHINGTON" + } + ], + "collaterals": [ + { + "collateralId": 1, + "repoId": 1, + "vin": "100000AB4FN591150", + "make": "CHRYSLER", + "model": "200", + "year": 2015, + "description": "2015 CHRYSLER 200", + "vehicleType": null, + "bodyStyle": null, + "inoperable": null, + "collateralTypeId": null, + "retitledInLandmarkName": null, + "refCollateralId": null, + "repoCompanySelections": [ + { + "id": 1, + "collateralId": 1, + "repoType": "PreSkip", + "repoCompanyId": 1, + "repoCompanyAssignmentDate": "2019-10-21T05:00:00", + "dateRepoed": "2019-11-23T06:00:00", + "dateTimeCreated": "2019-11-04T15:22:43.883" + } + ] + } + ], + "repoStatusChanges": [ + { + "id": 1, + "repoId": 1, + "statusFrom": "None", + "statusTo": "O4R", + "changedBy": "Importer", + "changedDate": "2019-10-21T09:01:47.43" + }, + { + "id": 15564, + "repoId": 1, + "statusFrom": "O4R", + "statusTo": "PSKP", + "changedBy": "System User", + "changedDate": "2020-03-02T17:04:57.383" + } + ], + "refundStatus": { + "repoId": 1, + "warrantyRefundStatus": null, + "insuranceRefundStatus": null, + "premiumDefiRefundStatus": null, + "cpiRefundStatus": "Received", + "refundsReceivedDate": null + }, + "dateClosed": null + }, + "NewRepoAccount": { + "repoId": 1, + "accountNo": "5484143", + "status": "O4R", + "memberNo": 3212321, + "loanNo": 147, + "accountTypeCode": "L-AC ", + "branch": 13, + "collector": " 1367", + "balance": 7238.03, + "dueToPayDate": "2019-08-02T00:00:00", + "o4RDate": "2019-10-21T09:01:47.383", + "dateFirstDelinquent": "2019-04-08T00:00:00", + "delinquentAmount": 3491.36, + "daysDelinquent": 80, + "paidSkipAmount": null, + "subStatus": "DE", + "requiredPaymentAmount": 449.03, + "currentDelinquentAmount": 3491.36, + "lstPmtAmt": 450.00, + "origAmount": 16594.79, + "lastPaymentDate": "2019-09-25T00:00:00", + "dateFirstIntellect": "2015-12-07T00:00:00", + "primaryIndividualId": "370556", + "bankruptcy": null, + "manualRedemptionDate": null, + "redemptionExpiredDate": null, + "borrowers": [ + { + "repoId": 1, + "individualId": "370556", + "ownershipType": 6, + "individualName": "GEORGE WASHINGTON" + } + ], + "collaterals": [ + { + "collateralId": 1, + "repoId": 1, + "vin": "100000AB4FN591150", + "make": "CHRYSLER", + "model": "200", + "year": 2015, + "description": "2015 CHRYSLER 200", + "vehicleType": null, + "bodyStyle": null, + "inoperable": null, + "collateralTypeId": null, + "retitledInLandmarkName": null, + "refCollateralId": null, + "repoCompanySelections": [ + { + "id": 1, + "collateralId": 1, + "repoType": "PreSkip", + "repoCompanyId": 1, + "repoCompanyAssignmentDate": "2019-10-21T05:00:00", + "dateRepoed": "2019-11-23T06:00:00", + "dateTimeCreated": "2019-11-04T15:22:43.883" + } + ] + } + ], + "repoStatusChanges": [ + { + "id": 1, + "repoId": 1, + "statusFrom": "None", + "statusTo": "O4R", + "changedBy": "Importer", + "changedDate": "2019-10-21T09:01:47.43" + }, + { + "id": 15564, + "repoId": 1, + "statusFrom": "O4R", + "statusTo": "PSKP", + "changedBy": "System User", + "changedDate": "2020-03-02T17:04:57.383" + } + ], + "refundStatus": { + "repoId": 1, + "warrantyRefundStatus": null, + "insuranceRefundStatus": null, + "premiumDefiRefundStatus": null, + "cpiRefundStatus": "Received", + "refundsReceivedDate": null + }, + "dateClosed": null + } + } + ] + ] +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Connected Services/JdpLogin/ConnectedService.json b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Connected Services/JdpLogin/ConnectedService.json new file mode 100644 index 0000000..6e94d95 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Connected Services/JdpLogin/ConnectedService.json @@ -0,0 +1,16 @@ +{ + "ExtendedData": { + "inputs": [ + "https://webservice-stage.jdpowervalues.com/vehicles/secure/securelogin.asmx?wsdl" + ], + "collectionTypes": [ + "System.Array", + "System.Collections.Generic.Dictionary`2" + ], + "namespaceMappings": [ + "*, JdpLogin" + ], + "targetFramework": "netcoreapp2.2", + "typeReuseMode": "All" + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Connected Services/JdpLogin/Reference.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Connected Services/JdpLogin/Reference.cs new file mode 100644 index 0000000..ecde21d --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Connected Services/JdpLogin/Reference.cs @@ -0,0 +1,257 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace JdpLogin +{ + using System.Runtime.Serialization; + + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] + [System.Runtime.Serialization.DataContractAttribute(Name="GetTokenRequest", Namespace="http://webservice.jdpowervalues.com/")] + public partial class GetTokenRequest : object + { + + private string UsernameField; + + private string PasswordField; + + [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false)] + public string Username + { + get + { + return this.UsernameField; + } + set + { + this.UsernameField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false, Order=1)] + public string Password + { + get + { + return this.PasswordField; + } + set + { + this.PasswordField = value; + } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] + [System.ServiceModel.ServiceContractAttribute(Namespace="http://webservice.jdpowervalues.com/", ConfigurationName="JdpLogin.SecureLoginSoap")] + public interface SecureLoginSoap + { + + [System.ServiceModel.OperationContractAttribute(Action="http://webservice.jdpowervalues.com/getToken", ReplyAction="*")] + System.Threading.Tasks.Task getTokenAsync(JdpLogin.getTokenRequest1 request); + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + [System.ServiceModel.MessageContractAttribute(IsWrapped=false)] + public partial class getTokenRequest1 + { + + [System.ServiceModel.MessageBodyMemberAttribute(Name="getToken", Namespace="http://webservice.jdpowervalues.com/", Order=0)] + public JdpLogin.getTokenRequest1Body Body; + + public getTokenRequest1() + { + } + + public getTokenRequest1(JdpLogin.getTokenRequest1Body Body) + { + this.Body = Body; + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + [System.Runtime.Serialization.DataContractAttribute(Namespace="http://webservice.jdpowervalues.com/")] + public partial class getTokenRequest1Body + { + + [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false, Order=0)] + public JdpLogin.GetTokenRequest tokenRequest; + + public getTokenRequest1Body() + { + } + + public getTokenRequest1Body(JdpLogin.GetTokenRequest tokenRequest) + { + this.tokenRequest = tokenRequest; + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + [System.ServiceModel.MessageContractAttribute(IsWrapped=false)] + public partial class getTokenResponse + { + + [System.ServiceModel.MessageBodyMemberAttribute(Name="getTokenResponse", Namespace="http://webservice.jdpowervalues.com/", Order=0)] + public JdpLogin.getTokenResponseBody Body; + + public getTokenResponse() + { + } + + public getTokenResponse(JdpLogin.getTokenResponseBody Body) + { + this.Body = Body; + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + [System.Runtime.Serialization.DataContractAttribute(Namespace="http://webservice.jdpowervalues.com/")] + public partial class getTokenResponseBody + { + + [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false, Order=0)] + public string getTokenResult; + + public getTokenResponseBody() + { + } + + public getTokenResponseBody(string getTokenResult) + { + this.getTokenResult = getTokenResult; + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] + public interface SecureLoginSoapChannel : JdpLogin.SecureLoginSoap, System.ServiceModel.IClientChannel + { + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] + public partial class SecureLoginSoapClient : System.ServiceModel.ClientBase, JdpLogin.SecureLoginSoap + { + + /// + /// Implement this partial method to configure the service endpoint. + /// + /// The endpoint to configure + /// The client credentials + static partial void ConfigureEndpoint(System.ServiceModel.Description.ServiceEndpoint serviceEndpoint, System.ServiceModel.Description.ClientCredentials clientCredentials); + + public SecureLoginSoapClient(EndpointConfiguration endpointConfiguration) : + base(SecureLoginSoapClient.GetBindingForEndpoint(endpointConfiguration), SecureLoginSoapClient.GetEndpointAddress(endpointConfiguration)) + { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public SecureLoginSoapClient(EndpointConfiguration endpointConfiguration, string remoteAddress) : + base(SecureLoginSoapClient.GetBindingForEndpoint(endpointConfiguration), new System.ServiceModel.EndpointAddress(remoteAddress)) + { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public SecureLoginSoapClient(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) : + base(SecureLoginSoapClient.GetBindingForEndpoint(endpointConfiguration), remoteAddress) + { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public SecureLoginSoapClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : + base(binding, remoteAddress) + { + } + + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + System.Threading.Tasks.Task JdpLogin.SecureLoginSoap.getTokenAsync(JdpLogin.getTokenRequest1 request) + { + return base.Channel.getTokenAsync(request); + } + + public System.Threading.Tasks.Task getTokenAsync(JdpLogin.GetTokenRequest tokenRequest) + { + JdpLogin.getTokenRequest1 inValue = new JdpLogin.getTokenRequest1(); + inValue.Body = new JdpLogin.getTokenRequest1Body(); + inValue.Body.tokenRequest = tokenRequest; + return ((JdpLogin.SecureLoginSoap)(this)).getTokenAsync(inValue); + } + + public virtual System.Threading.Tasks.Task OpenAsync() + { + return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginOpen(null, null), new System.Action(((System.ServiceModel.ICommunicationObject)(this)).EndOpen)); + } + + public virtual System.Threading.Tasks.Task CloseAsync() + { + return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginClose(null, null), new System.Action(((System.ServiceModel.ICommunicationObject)(this)).EndClose)); + } + + private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(EndpointConfiguration endpointConfiguration) + { + if ((endpointConfiguration == EndpointConfiguration.SecureLoginSoap)) + { + System.ServiceModel.BasicHttpBinding result = new System.ServiceModel.BasicHttpBinding(); + result.MaxBufferSize = int.MaxValue; + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.BasicHttpSecurityMode.Transport; + return result; + } + if ((endpointConfiguration == EndpointConfiguration.SecureLoginSoap12)) + { + System.ServiceModel.Channels.CustomBinding result = new System.ServiceModel.Channels.CustomBinding(); + System.ServiceModel.Channels.TextMessageEncodingBindingElement textBindingElement = new System.ServiceModel.Channels.TextMessageEncodingBindingElement(); + textBindingElement.MessageVersion = System.ServiceModel.Channels.MessageVersion.CreateVersion(System.ServiceModel.EnvelopeVersion.Soap12, System.ServiceModel.Channels.AddressingVersion.None); + result.Elements.Add(textBindingElement); + System.ServiceModel.Channels.HttpsTransportBindingElement httpsBindingElement = new System.ServiceModel.Channels.HttpsTransportBindingElement(); + httpsBindingElement.AllowCookies = true; + httpsBindingElement.MaxBufferSize = int.MaxValue; + httpsBindingElement.MaxReceivedMessageSize = int.MaxValue; + result.Elements.Add(httpsBindingElement); + return result; + } + throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); + } + + private static System.ServiceModel.EndpointAddress GetEndpointAddress(EndpointConfiguration endpointConfiguration) + { + if ((endpointConfiguration == EndpointConfiguration.SecureLoginSoap)) + { + return new System.ServiceModel.EndpointAddress("https://webservice-stage.jdpowervalues.com/vehicles/secure/securelogin.asmx"); + } + if ((endpointConfiguration == EndpointConfiguration.SecureLoginSoap12)) + { + return new System.ServiceModel.EndpointAddress("https://webservice-stage.jdpowervalues.com/vehicles/secure/securelogin.asmx"); + } + throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); + } + + public enum EndpointConfiguration + { + + SecureLoginSoap, + + SecureLoginSoap12, + } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Connected Services/JdpLogin/securelogin.wsdl b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Connected Services/JdpLogin/securelogin.wsdl new file mode 100644 index 0000000..a4bfdb5 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Connected Services/JdpLogin/securelogin.wsdl @@ -0,0 +1,74 @@ + + + This is JDPA Web Service into its Login methods. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Logs the user in and returns a valid token. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This is JDPA Web Service into its Login methods. + + + + + + + + \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Connected Services/JdpVehicle/ConnectedService.json b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Connected Services/JdpVehicle/ConnectedService.json new file mode 100644 index 0000000..74d9b37 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Connected Services/JdpVehicle/ConnectedService.json @@ -0,0 +1,16 @@ +{ + "ExtendedData": { + "inputs": [ + "http://webservice-stage.jdpowervalues.com/vehicles/vehicle.asmx?wsdl" + ], + "collectionTypes": [ + "System.Array", + "System.Collections.Generic.Dictionary`2" + ], + "namespaceMappings": [ + "*, JdpVehicle" + ], + "targetFramework": "netcoreapp2.2", + "typeReuseMode": "All" + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Connected Services/JdpVehicle/Reference.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Connected Services/JdpVehicle/Reference.cs new file mode 100644 index 0000000..9ca6bee --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Connected Services/JdpVehicle/Reference.cs @@ -0,0 +1,3503 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace JdpVehicle +{ + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] + [System.ServiceModel.ServiceContractAttribute(Namespace="http://webservice.jdpowervalues.com/", ConfigurationName="JdpVehicle.VehicleSoap")] + public interface VehicleSoap + { + + [System.ServiceModel.OperationContractAttribute(Action="http://webservice.jdpowervalues.com/ping", ReplyAction="*")] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)] + System.Threading.Tasks.Task pingAsync(string token); + + [System.ServiceModel.OperationContractAttribute(Action="http://webservice.jdpowervalues.com/getYears", ReplyAction="*")] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(NADAValueRequest))] + System.Threading.Tasks.Task getYearsAsync(JdpVehicle.GetYearsRequest l_Request); + + [System.ServiceModel.OperationContractAttribute(Action="http://webservice.jdpowervalues.com/getMakes", ReplyAction="*")] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(NADAValueRequest))] + System.Threading.Tasks.Task getMakesAsync(JdpVehicle.GetMakesRequest l_Request); + + [System.ServiceModel.OperationContractAttribute(Action="http://webservice.jdpowervalues.com/getSeries", ReplyAction="*")] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(NADAValueRequest))] + System.Threading.Tasks.Task getSeriesAsync(JdpVehicle.GetSeriesRequest l_Request); + + [System.ServiceModel.OperationContractAttribute(Action="http://webservice.jdpowervalues.com/getBodyUids", ReplyAction="*")] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(NADAValueRequest))] + System.Threading.Tasks.Task getBodyUidsAsync(JdpVehicle.GetBodyUidsRequest l_Request); + + [System.ServiceModel.OperationContractAttribute(Action="http://webservice.jdpowervalues.com/getVehicles", ReplyAction="*")] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(NADAValueRequest))] + System.Threading.Tasks.Task getVehiclesAsync(JdpVehicle.GetVehiclesByVinRequest vehicleRequest); + + [System.ServiceModel.OperationContractAttribute(Action="http://webservice.jdpowervalues.com/getVehicle", ReplyAction="*")] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(NADAValueRequest))] + System.Threading.Tasks.Task getVehicleAsync(JdpVehicle.GetVehicleByUidRequest vehicleRequest); + + [System.ServiceModel.OperationContractAttribute(Action="http://webservice.jdpowervalues.com/getVehicleByVic", ReplyAction="*")] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(NADAValueRequest))] + System.Threading.Tasks.Task getVehicleByVicAsync(JdpVehicle.GetVehicleByVicRequest vehicleRequest); + + [System.ServiceModel.OperationContractAttribute(Action="http://webservice.jdpowervalues.com/getAccessories", ReplyAction="*")] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(NADAValueRequest))] + System.Threading.Tasks.Task getAccessoriesAsync(JdpVehicle.GetAccessoriesRequest accessoriesRequest); + + [System.ServiceModel.OperationContractAttribute(Action="http://webservice.jdpowervalues.com/getInclusiveAccessories", ReplyAction="*")] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(NADAValueRequest))] + System.Threading.Tasks.Task getInclusiveAccessoriesAsync(JdpVehicle.GetMutualAccessoriesRequest mutualAccessoriesRequest); + + [System.ServiceModel.OperationContractAttribute(Action="http://webservice.jdpowervalues.com/getExclusiveAccessories", ReplyAction="*")] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(NADAValueRequest))] + System.Threading.Tasks.Task getExclusiveAccessoriesAsync(JdpVehicle.GetMutualAccessoriesRequest mutualAccessoriesRequest); + + [System.ServiceModel.OperationContractAttribute(Action="http://webservice.jdpowervalues.com/validateVin", ReplyAction="*")] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(NADAValueRequest))] + System.Threading.Tasks.Task validateVinAsync(JdpVehicle.ValidateVinRequest l_request); + + [System.ServiceModel.OperationContractAttribute(Action="http://webservice.jdpowervalues.com/getMileageAdj", ReplyAction="*")] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(NADAValueRequest))] + System.Threading.Tasks.Task getMileageAdjAsync(JdpVehicle.GetMileageAdjByUidRequest mileageAdjRequest); + + [System.ServiceModel.OperationContractAttribute(Action="http://webservice.jdpowervalues.com/getRegions", ReplyAction="*")] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(NADAValueRequest))] + System.Threading.Tasks.Task getRegionsAsync(JdpVehicle.GetRegionsRequest l_Request); + + [System.ServiceModel.OperationContractAttribute(Action="http://webservice.jdpowervalues.com/getRegionByStateCode", ReplyAction="*")] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(NADAValueRequest))] + System.Threading.Tasks.Task getRegionByStateCodeAsync(JdpVehicle.GetRegionByStateCodeRequest l_Request); + + [System.ServiceModel.OperationContractAttribute(Action="http://webservice.jdpowervalues.com/getTotalAdjFloorValues", ReplyAction="*")] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(NADAValueRequest))] + System.Threading.Tasks.Task getTotalAdjFloorValuesAsync(JdpVehicle.GetVehicleValuesByUidRequest l_Request); + + [System.ServiceModel.OperationContractAttribute(Action="http://webservice.jdpowervalues.com/getVehicleValueByUid", ReplyAction="*")] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(NADAValueRequest))] + System.Threading.Tasks.Task getVehicleValueByUidAsync(JdpVehicle.GetVehicleValuesByUidRequest vehicleRequest); + + [System.ServiceModel.OperationContractAttribute(Action="http://webservice.jdpowervalues.com/getBaseVehicleValueByUid", ReplyAction="*")] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(NADAValueRequest))] + System.Threading.Tasks.Task getBaseVehicleValueByUidAsync(JdpVehicle.GetVehicleValuesByUidRequest vehicleRequest); + + [System.ServiceModel.OperationContractAttribute(Action="http://webservice.jdpowervalues.com/getVehicleAndValueByUid", ReplyAction="*")] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(NADAValueRequest))] + System.Threading.Tasks.Task getVehicleAndValueByUidAsync(JdpVehicle.GetVehicleValuesByUidRequest vehicleRequest); + + [System.ServiceModel.OperationContractAttribute(Action="http://webservice.jdpowervalues.com/getDefaultVehicleAndValueByVin", ReplyAction="*")] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(NADAValueRequest))] + System.Threading.Tasks.Task getDefaultVehicleAndValueByVinAsync(JdpVehicle.GetVehicleValuesByVinRequest vehicleRequest); + + [System.ServiceModel.OperationContractAttribute(Action="http://webservice.jdpowervalues.com/getMsrpVehicleAndValueByVin", ReplyAction="*")] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(NADAValueRequest))] + System.Threading.Tasks.Task getMsrpVehicleAndValueByVinAsync(JdpVehicle.GetVehicleValuesByMsrpRequest vehicleRequest); + + [System.ServiceModel.OperationContractAttribute(Action="http://webservice.jdpowervalues.com/getHighVehicleAndValueByVin", ReplyAction="*")] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(NADAValueRequest))] + System.Threading.Tasks.Task getHighVehicleAndValueByVinAsync(JdpVehicle.GetVehicleValuesByVinRequest vehicleRequest); + + [System.ServiceModel.OperationContractAttribute(Action="http://webservice.jdpowervalues.com/getLowVehicleAndValueByVin", ReplyAction="*")] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(NADAValueRequest))] + System.Threading.Tasks.Task getLowVehicleAndValueByVinAsync(JdpVehicle.GetVehicleValuesByVinRequest vehicleRequest); + + [System.ServiceModel.OperationContractAttribute(Action="http://webservice.jdpowervalues.com/getAdjustedValuesByUid", ReplyAction="*")] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(NADAValueRequest))] + System.Threading.Tasks.Task getAdjustedValuesByUidAsync(JdpVehicle.GetAdjustedValuesByUidRequest request); + + [System.ServiceModel.OperationContractAttribute(Action="http://webservice.jdpowervalues.com/getAuctionValues", ReplyAction="*")] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(NADAValueRequest))] + System.Threading.Tasks.Task getAuctionValuesAsync(JdpVehicle.GetAuctionValuesRequest auctionValuesRequest); + + [System.ServiceModel.OperationContractAttribute(Action="http://webservice.jdpowervalues.com/getExperianAutoCheckReport", ReplyAction="*")] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(NADAValueRequest))] + System.Threading.Tasks.Task getExperianAutoCheckReportAsync(JdpVehicle.GetExperianAutoCheckRequest experianAutocheckRequest); + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://webservice.jdpowervalues.com/")] + public partial class GetYearsRequest : NADAValueRequest + { + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GetAuctionValuesRequest))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GetVehicleValuesByMsrpRequest))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GetVehicleValuesByVinRequest))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GetVehicleValuesByUidRequest))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GetAdjustedValuesByUidRequest))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GetRegionByStateCodeRequest))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GetRegionsRequest))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GetMileageAdjByUidRequest))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ValidateVinRequest))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GetMutualAccessoriesRequest))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GetAccessoriesRequest))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GetVehicleByVicRequest))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GetVehicleByUidRequest))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GetVehiclesByVinRequest))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GetBodyUidsRequest))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GetSeriesRequest))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GetMakesRequest))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GetYearsRequest))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://webservice.jdpowervalues.com/")] + public abstract partial class NADAValueRequest + { + + private string tokenField; + + private int periodField; + + private VehicleTypes vehicleTypeField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=0)] + public string Token + { + get + { + return this.tokenField; + } + set + { + this.tokenField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=1)] + public int Period + { + get + { + return this.periodField; + } + set + { + this.periodField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=2)] + public VehicleTypes VehicleType + { + get + { + return this.vehicleTypeField; + } + set + { + this.vehicleTypeField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://webservice.jdpowervalues.com/")] + public enum VehicleTypes + { + + /// + UsedCar, + + /// + CommercialTruck, + + /// + Motorcycle, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://webservice.jdpowervalues.com/")] + public partial class GetExperianAutoCheckRequest + { + + private string tokenField; + + private string experianAccountNumberField; + + private string vinField; + + private ExperianAutoCheckReportTypes reportTypeField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=0)] + public string Token + { + get + { + return this.tokenField; + } + set + { + this.tokenField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=1)] + public string ExperianAccountNumber + { + get + { + return this.experianAccountNumberField; + } + set + { + this.experianAccountNumberField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=2)] + public string Vin + { + get + { + return this.vinField; + } + set + { + this.vinField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=3)] + public ExperianAutoCheckReportTypes ReportType + { + get + { + return this.reportTypeField; + } + set + { + this.reportTypeField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://webservice.jdpowervalues.com/")] + public enum ExperianAutoCheckReportTypes + { + + /// + VehicleHistory, + + /// + Summary, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://webservice.jdpowervalues.com/")] + public partial class AdjustedAccessories + { + + private string accCodeField; + + private string accDescField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=0)] + public string AccCode + { + get + { + return this.accCodeField; + } + set + { + this.accCodeField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=1)] + public string AccDesc + { + get + { + return this.accDescField; + } + set + { + this.accDescField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://webservice.jdpowervalues.com/")] + public partial class AuctionValue_Struc + { + + private int lowAdjustedAuctionValueField; + + private int averageAdjustedAuctionValueField; + + private int highAdjustedAuctionValueField; + + private string dateRangeField; + + private AdjustedAccessories[] accessoriesAdjustedListField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=0)] + public int LowAdjustedAuctionValue + { + get + { + return this.lowAdjustedAuctionValueField; + } + set + { + this.lowAdjustedAuctionValueField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=1)] + public int AverageAdjustedAuctionValue + { + get + { + return this.averageAdjustedAuctionValueField; + } + set + { + this.averageAdjustedAuctionValueField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=2)] + public int HighAdjustedAuctionValue + { + get + { + return this.highAdjustedAuctionValueField; + } + set + { + this.highAdjustedAuctionValueField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=3)] + public string DateRange + { + get + { + return this.dateRangeField; + } + set + { + this.dateRangeField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayAttribute(Order=4)] + public AdjustedAccessories[] AccessoriesAdjustedList + { + get + { + return this.accessoriesAdjustedListField; + } + set + { + this.accessoriesAdjustedListField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://webservice.jdpowervalues.com/")] + public partial class AdjustedAccessory_Struc + { + + private string vACField; + + private string descriptionField; + + private decimal tradeInField; + + private decimal loanField; + + private decimal retailField; + + private bool isWithBodyField; + + private bool isWithPackageField; + + private bool isIncludedField; + + private bool isEnabledField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=0)] + public string VAC + { + get + { + return this.vACField; + } + set + { + this.vACField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=1)] + public string Description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=2)] + public decimal TradeIn + { + get + { + return this.tradeInField; + } + set + { + this.tradeInField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=3)] + public decimal Loan + { + get + { + return this.loanField; + } + set + { + this.loanField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=4)] + public decimal Retail + { + get + { + return this.retailField; + } + set + { + this.retailField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=5)] + public bool IsWithBody + { + get + { + return this.isWithBodyField; + } + set + { + this.isWithBodyField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=6)] + public bool IsWithPackage + { + get + { + return this.isWithPackageField; + } + set + { + this.isWithPackageField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=7)] + public bool IsIncluded + { + get + { + return this.isIncludedField; + } + set + { + this.isIncludedField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=8)] + public bool IsEnabled + { + get + { + return this.isEnabledField; + } + set + { + this.isEnabledField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://webservice.jdpowervalues.com/")] + public partial class AdjustedValues_Struc + { + + private int periodField; + + private int uIDField; + + private string vinField; + + private int regionField; + + private int mileageField; + + private decimal msrpField; + + private int avgMileageField; + + private decimal mileageAdjustmentField; + + private decimal accessoryAdjustmentTradeInField; + + private decimal accessoryAdjustmentLoanField; + + private decimal accessoryAdjustmentRetailField; + + private decimal baseRoughTradeInField; + + private decimal baseAvgTradeInField; + + private decimal baseCleanTradeInField; + + private decimal baseLoanField; + + private decimal baseRetailField; + + private decimal adjustedRoughTradeInField; + + private decimal adjustedAvgTradeInField; + + private decimal adjustedCleanTradeInField; + + private decimal adjustedLoanField; + + private decimal adjustedRetailField; + + private AdjustedAccessory_Struc[] accessoryListField; + + private BusinessRuleViolationErrorCodes businessRuleViolationErrorCodeField; + + private string businessRuleViolationErrorMessageField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=0)] + public int Period + { + get + { + return this.periodField; + } + set + { + this.periodField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=1)] + public int UID + { + get + { + return this.uIDField; + } + set + { + this.uIDField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=2)] + public string Vin + { + get + { + return this.vinField; + } + set + { + this.vinField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=3)] + public int Region + { + get + { + return this.regionField; + } + set + { + this.regionField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=4)] + public int Mileage + { + get + { + return this.mileageField; + } + set + { + this.mileageField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=5)] + public decimal Msrp + { + get + { + return this.msrpField; + } + set + { + this.msrpField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=6)] + public int AvgMileage + { + get + { + return this.avgMileageField; + } + set + { + this.avgMileageField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=7)] + public decimal MileageAdjustment + { + get + { + return this.mileageAdjustmentField; + } + set + { + this.mileageAdjustmentField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=8)] + public decimal AccessoryAdjustmentTradeIn + { + get + { + return this.accessoryAdjustmentTradeInField; + } + set + { + this.accessoryAdjustmentTradeInField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=9)] + public decimal AccessoryAdjustmentLoan + { + get + { + return this.accessoryAdjustmentLoanField; + } + set + { + this.accessoryAdjustmentLoanField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=10)] + public decimal AccessoryAdjustmentRetail + { + get + { + return this.accessoryAdjustmentRetailField; + } + set + { + this.accessoryAdjustmentRetailField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=11)] + public decimal BaseRoughTradeIn + { + get + { + return this.baseRoughTradeInField; + } + set + { + this.baseRoughTradeInField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=12)] + public decimal BaseAvgTradeIn + { + get + { + return this.baseAvgTradeInField; + } + set + { + this.baseAvgTradeInField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=13)] + public decimal BaseCleanTradeIn + { + get + { + return this.baseCleanTradeInField; + } + set + { + this.baseCleanTradeInField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=14)] + public decimal BaseLoan + { + get + { + return this.baseLoanField; + } + set + { + this.baseLoanField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=15)] + public decimal BaseRetail + { + get + { + return this.baseRetailField; + } + set + { + this.baseRetailField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=16)] + public decimal AdjustedRoughTradeIn + { + get + { + return this.adjustedRoughTradeInField; + } + set + { + this.adjustedRoughTradeInField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=17)] + public decimal AdjustedAvgTradeIn + { + get + { + return this.adjustedAvgTradeInField; + } + set + { + this.adjustedAvgTradeInField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=18)] + public decimal AdjustedCleanTradeIn + { + get + { + return this.adjustedCleanTradeInField; + } + set + { + this.adjustedCleanTradeInField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=19)] + public decimal AdjustedLoan + { + get + { + return this.adjustedLoanField; + } + set + { + this.adjustedLoanField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=20)] + public decimal AdjustedRetail + { + get + { + return this.adjustedRetailField; + } + set + { + this.adjustedRetailField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayAttribute(Order=21)] + public AdjustedAccessory_Struc[] AccessoryList + { + get + { + return this.accessoryListField; + } + set + { + this.accessoryListField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=22)] + public BusinessRuleViolationErrorCodes BusinessRuleViolationErrorCode + { + get + { + return this.businessRuleViolationErrorCodeField; + } + set + { + this.businessRuleViolationErrorCodeField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=23)] + public string BusinessRuleViolationErrorMessage + { + get + { + return this.businessRuleViolationErrorMessageField; + } + set + { + this.businessRuleViolationErrorMessageField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://webservice.jdpowervalues.com/")] + public enum BusinessRuleViolationErrorCodes + { + + /// + NoError, + + /// + MutuallyExclusive, + + /// + UidAndVinMismatch, + + /// + VacCodeNotFound, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://webservice.jdpowervalues.com/")] + public partial class VehicleValue_Struc + { + + private int uidField; + + private int vehicleYearField; + + private int makeCodeField; + + private string makeDescrField; + + private int seriesCodeField; + + private string seriesDescrField; + + private int bodyCodeField; + + private string bodyDescrField; + + private int weightField; + + private decimal msrpField; + + private int aveMileageField; + + private decimal mileageAdjField; + + private decimal tradeInField; + + private decimal tradeInPlusVinAccField; + + private decimal tradeInPlusVinAccMileageField; + + private decimal loanField; + + private decimal loanPlusVinAccField; + + private decimal loanPlusVinAccMileageField; + + private decimal retailField; + + private decimal retailPlusVinAccField; + + private decimal retailPlusVinAccMileageField; + + private decimal avgTradeInField; + + private decimal avgTradeInPlusVinAccField; + + private decimal avgTradeInPlusVinAccMileageField; + + private decimal roughTradeInField; + + private decimal roughTradeInPlusVinAccField; + + private decimal roughTradeInPlusVinAccMileageField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=0)] + public int Uid + { + get + { + return this.uidField; + } + set + { + this.uidField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=1)] + public int VehicleYear + { + get + { + return this.vehicleYearField; + } + set + { + this.vehicleYearField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=2)] + public int MakeCode + { + get + { + return this.makeCodeField; + } + set + { + this.makeCodeField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=3)] + public string MakeDescr + { + get + { + return this.makeDescrField; + } + set + { + this.makeDescrField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=4)] + public int SeriesCode + { + get + { + return this.seriesCodeField; + } + set + { + this.seriesCodeField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=5)] + public string SeriesDescr + { + get + { + return this.seriesDescrField; + } + set + { + this.seriesDescrField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=6)] + public int BodyCode + { + get + { + return this.bodyCodeField; + } + set + { + this.bodyCodeField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=7)] + public string BodyDescr + { + get + { + return this.bodyDescrField; + } + set + { + this.bodyDescrField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=8)] + public int Weight + { + get + { + return this.weightField; + } + set + { + this.weightField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=9)] + public decimal Msrp + { + get + { + return this.msrpField; + } + set + { + this.msrpField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=10)] + public int AveMileage + { + get + { + return this.aveMileageField; + } + set + { + this.aveMileageField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=11)] + public decimal MileageAdj + { + get + { + return this.mileageAdjField; + } + set + { + this.mileageAdjField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=12)] + public decimal TradeIn + { + get + { + return this.tradeInField; + } + set + { + this.tradeInField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=13)] + public decimal TradeInPlusVinAcc + { + get + { + return this.tradeInPlusVinAccField; + } + set + { + this.tradeInPlusVinAccField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=14)] + public decimal TradeInPlusVinAccMileage + { + get + { + return this.tradeInPlusVinAccMileageField; + } + set + { + this.tradeInPlusVinAccMileageField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=15)] + public decimal Loan + { + get + { + return this.loanField; + } + set + { + this.loanField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=16)] + public decimal LoanPlusVinAcc + { + get + { + return this.loanPlusVinAccField; + } + set + { + this.loanPlusVinAccField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=17)] + public decimal LoanPlusVinAccMileage + { + get + { + return this.loanPlusVinAccMileageField; + } + set + { + this.loanPlusVinAccMileageField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=18)] + public decimal Retail + { + get + { + return this.retailField; + } + set + { + this.retailField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=19)] + public decimal RetailPlusVinAcc + { + get + { + return this.retailPlusVinAccField; + } + set + { + this.retailPlusVinAccField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=20)] + public decimal RetailPlusVinAccMileage + { + get + { + return this.retailPlusVinAccMileageField; + } + set + { + this.retailPlusVinAccMileageField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=21)] + public decimal AvgTradeIn + { + get + { + return this.avgTradeInField; + } + set + { + this.avgTradeInField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=22)] + public decimal AvgTradeInPlusVinAcc + { + get + { + return this.avgTradeInPlusVinAccField; + } + set + { + this.avgTradeInPlusVinAccField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=23)] + public decimal AvgTradeInPlusVinAccMileage + { + get + { + return this.avgTradeInPlusVinAccMileageField; + } + set + { + this.avgTradeInPlusVinAccMileageField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=24)] + public decimal RoughTradeIn + { + get + { + return this.roughTradeInField; + } + set + { + this.roughTradeInField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=25)] + public decimal RoughTradeInPlusVinAcc + { + get + { + return this.roughTradeInPlusVinAccField; + } + set + { + this.roughTradeInPlusVinAccField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=26)] + public decimal RoughTradeInPlusVinAccMileage + { + get + { + return this.roughTradeInPlusVinAccMileageField; + } + set + { + this.roughTradeInPlusVinAccMileageField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://webservice.jdpowervalues.com/")] + public partial class StandardValue_Struc + { + + private int uidField; + + private decimal retailField; + + private decimal tradeInField; + + private decimal loanField; + + private decimal roughTradeInField; + + private decimal avgTradeInField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=0)] + public int Uid + { + get + { + return this.uidField; + } + set + { + this.uidField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=1)] + public decimal Retail + { + get + { + return this.retailField; + } + set + { + this.retailField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=2)] + public decimal TradeIn + { + get + { + return this.tradeInField; + } + set + { + this.tradeInField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=3)] + public decimal Loan + { + get + { + return this.loanField; + } + set + { + this.loanField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=4)] + public decimal RoughTradeIn + { + get + { + return this.roughTradeInField; + } + set + { + this.roughTradeInField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=5)] + public decimal AvgTradeIn + { + get + { + return this.avgTradeInField; + } + set + { + this.avgTradeInField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://webservice.jdpowervalues.com/")] + public partial class Value_Struc + { + + private int uidField; + + private decimal msrpField; + + private int aveMileageField; + + private decimal mileageAdjField; + + private decimal retailField; + + private decimal tradeInField; + + private decimal loanField; + + private decimal mileAdjRetailField; + + private decimal mileAdjTradeInField; + + private decimal mileAdjLoanField; + + private decimal avgTradeInField; + + private decimal roughTradeInField; + + private decimal mileAdjAvgTradeInField; + + private decimal mileAdjRoughTradeInField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=0)] + public int Uid + { + get + { + return this.uidField; + } + set + { + this.uidField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=1)] + public decimal Msrp + { + get + { + return this.msrpField; + } + set + { + this.msrpField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=2)] + public int AveMileage + { + get + { + return this.aveMileageField; + } + set + { + this.aveMileageField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=3)] + public decimal MileageAdj + { + get + { + return this.mileageAdjField; + } + set + { + this.mileageAdjField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=4)] + public decimal Retail + { + get + { + return this.retailField; + } + set + { + this.retailField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=5)] + public decimal TradeIn + { + get + { + return this.tradeInField; + } + set + { + this.tradeInField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=6)] + public decimal Loan + { + get + { + return this.loanField; + } + set + { + this.loanField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=7)] + public decimal MileAdjRetail + { + get + { + return this.mileAdjRetailField; + } + set + { + this.mileAdjRetailField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=8)] + public decimal MileAdjTradeIn + { + get + { + return this.mileAdjTradeInField; + } + set + { + this.mileAdjTradeInField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=9)] + public decimal MileAdjLoan + { + get + { + return this.mileAdjLoanField; + } + set + { + this.mileAdjLoanField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=10)] + public decimal AvgTradeIn + { + get + { + return this.avgTradeInField; + } + set + { + this.avgTradeInField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=11)] + public decimal RoughTradeIn + { + get + { + return this.roughTradeInField; + } + set + { + this.roughTradeInField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=12)] + public decimal MileAdjAvgTradeIn + { + get + { + return this.mileAdjAvgTradeInField; + } + set + { + this.mileAdjAvgTradeInField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=13)] + public decimal MileAdjRoughTradeIn + { + get + { + return this.mileAdjRoughTradeInField; + } + set + { + this.mileAdjRoughTradeInField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://webservice.jdpowervalues.com/")] + public partial class FloorValue_Struc + { + + private int uidField; + + private decimal adjustedRetailField; + + private decimal adjustedTradeInField; + + private decimal adjustedLoanField; + + private decimal adjustedRoughTradeInField; + + private decimal adjustedAvgTradeInField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=0)] + public int Uid + { + get + { + return this.uidField; + } + set + { + this.uidField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=1)] + public decimal AdjustedRetail + { + get + { + return this.adjustedRetailField; + } + set + { + this.adjustedRetailField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=2)] + public decimal AdjustedTradeIn + { + get + { + return this.adjustedTradeInField; + } + set + { + this.adjustedTradeInField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=3)] + public decimal AdjustedLoan + { + get + { + return this.adjustedLoanField; + } + set + { + this.adjustedLoanField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=4)] + public decimal AdjustedRoughTradeIn + { + get + { + return this.adjustedRoughTradeInField; + } + set + { + this.adjustedRoughTradeInField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=5)] + public decimal AdjustedAvgTradeIn + { + get + { + return this.adjustedAvgTradeInField; + } + set + { + this.adjustedAvgTradeInField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://webservice.jdpowervalues.com/")] + public partial class MileageTable_Struc + { + + private int lowLevelField; + + private int highLevelField; + + private decimal adjAmountField; + + private decimal ratePerMileField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=0)] + public int LowLevel + { + get + { + return this.lowLevelField; + } + set + { + this.lowLevelField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=1)] + public int HighLevel + { + get + { + return this.highLevelField; + } + set + { + this.highLevelField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=2)] + public decimal AdjAmount + { + get + { + return this.adjAmountField; + } + set + { + this.adjAmountField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=3)] + public decimal RatePerMile + { + get + { + return this.ratePerMileField; + } + set + { + this.ratePerMileField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://webservice.jdpowervalues.com/")] + public partial class Mileage_Struc + { + + private decimal maxAmountField; + + private decimal minAmountField; + + private int averageMileageField; + + private int countField; + + private MileageTable_Struc[] mileageTableField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=0)] + public decimal MaxAmount + { + get + { + return this.maxAmountField; + } + set + { + this.maxAmountField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=1)] + public decimal MinAmount + { + get + { + return this.minAmountField; + } + set + { + this.minAmountField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=2)] + public int AverageMileage + { + get + { + return this.averageMileageField; + } + set + { + this.averageMileageField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=3)] + public int Count + { + get + { + return this.countField; + } + set + { + this.countField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayAttribute(Order=4)] + public MileageTable_Struc[] MileageTable + { + get + { + return this.mileageTableField; + } + set + { + this.mileageTableField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://webservice.jdpowervalues.com/")] + public partial class AccessoryMultExcl_Struc + { + + private string accCodeField; + + private string accMultExclCodeField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=0)] + public string AccCode + { + get + { + return this.accCodeField; + } + set + { + this.accCodeField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=1)] + public string AccMultExclCode + { + get + { + return this.accMultExclCodeField; + } + set + { + this.accMultExclCodeField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://webservice.jdpowervalues.com/")] + public partial class AccessoryPakgIncl_Struc + { + + private string accCodeField; + + private string accPakgInclCodeField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=0)] + public string AccCode + { + get + { + return this.accCodeField; + } + set + { + this.accCodeField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=1)] + public string AccPakgInclCode + { + get + { + return this.accPakgInclCodeField; + } + set + { + this.accPakgInclCodeField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://webservice.jdpowervalues.com/")] + public partial class Accessory_Struc + { + + private int uidField; + + private string accDescField; + + private string accCodeField; + + private decimal tradeInField; + + private decimal retailField; + + private decimal loanField; + + private bool isIncludedField; + + private bool isAddedField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=0)] + public int Uid + { + get + { + return this.uidField; + } + set + { + this.uidField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=1)] + public string AccDesc + { + get + { + return this.accDescField; + } + set + { + this.accDescField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=2)] + public string AccCode + { + get + { + return this.accCodeField; + } + set + { + this.accCodeField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=3)] + public decimal TradeIn + { + get + { + return this.tradeInField; + } + set + { + this.tradeInField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=4)] + public decimal Retail + { + get + { + return this.retailField; + } + set + { + this.retailField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=5)] + public decimal Loan + { + get + { + return this.loanField; + } + set + { + this.loanField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=6)] + public bool IsIncluded + { + get + { + return this.isIncludedField; + } + set + { + this.isIncludedField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=7)] + public bool IsAdded + { + get + { + return this.isAddedField; + } + set + { + this.isAddedField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://webservice.jdpowervalues.com/")] + public partial class Vehicle_Struc + { + + private int uidField; + + private int yearField; + + private int makeCodeField; + + private string makeDescrField; + + private int seriesCodeField; + + private string seriesDescrField; + + private int bodyCodeField; + + private string bodyDescrField; + + private int weightField; + + private string mileageClassField; + + private int gvwField; + + private int gcwField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=0)] + public int Uid + { + get + { + return this.uidField; + } + set + { + this.uidField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=1)] + public int Year + { + get + { + return this.yearField; + } + set + { + this.yearField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=2)] + public int MakeCode + { + get + { + return this.makeCodeField; + } + set + { + this.makeCodeField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=3)] + public string MakeDescr + { + get + { + return this.makeDescrField; + } + set + { + this.makeDescrField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=4)] + public int SeriesCode + { + get + { + return this.seriesCodeField; + } + set + { + this.seriesCodeField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=5)] + public string SeriesDescr + { + get + { + return this.seriesDescrField; + } + set + { + this.seriesDescrField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=6)] + public int BodyCode + { + get + { + return this.bodyCodeField; + } + set + { + this.bodyCodeField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=7)] + public string BodyDescr + { + get + { + return this.bodyDescrField; + } + set + { + this.bodyDescrField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=8)] + public int Weight + { + get + { + return this.weightField; + } + set + { + this.weightField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=9)] + public string MileageClass + { + get + { + return this.mileageClassField; + } + set + { + this.mileageClassField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=10)] + public int Gvw + { + get + { + return this.gvwField; + } + set + { + this.gvwField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=11)] + public int Gcw + { + get + { + return this.gcwField; + } + set + { + this.gcwField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://webservice.jdpowervalues.com/")] + public partial class Lookup_Struc + { + + private int codeField; + + private string descrField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=0)] + public int Code + { + get + { + return this.codeField; + } + set + { + this.codeField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=1)] + public string Descr + { + get + { + return this.descrField; + } + set + { + this.descrField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://webservice.jdpowervalues.com/")] + public partial class CheckedAccessories + { + + private string accCodeField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=0)] + public string AccCode + { + get + { + return this.accCodeField; + } + set + { + this.accCodeField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://webservice.jdpowervalues.com/")] + public partial class GetAuctionValuesRequest : NADAValueRequest + { + + private int uidField; + + private string vicField; + + private int regionField; + + private int mileageField; + + private string customerIdField; + + private int userIdField; + + private string callingApplicationField; + + private CheckedAccessories[] checkedAccessoriesListField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=0)] + public int Uid + { + get + { + return this.uidField; + } + set + { + this.uidField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=1)] + public string Vic + { + get + { + return this.vicField; + } + set + { + this.vicField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=2)] + public int Region + { + get + { + return this.regionField; + } + set + { + this.regionField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=3)] + public int Mileage + { + get + { + return this.mileageField; + } + set + { + this.mileageField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=4)] + public string CustomerId + { + get + { + return this.customerIdField; + } + set + { + this.customerIdField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=5)] + public int UserId + { + get + { + return this.userIdField; + } + set + { + this.userIdField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=6)] + public string CallingApplication + { + get + { + return this.callingApplicationField; + } + set + { + this.callingApplicationField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayAttribute(Order=7)] + public CheckedAccessories[] CheckedAccessoriesList + { + get + { + return this.checkedAccessoriesListField; + } + set + { + this.checkedAccessoriesListField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://webservice.jdpowervalues.com/")] + public partial class GetVehicleValuesByMsrpRequest : NADAValueRequest + { + + private string vinField; + + private int regionField; + + private int mileageField; + + private int msrpField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=0)] + public string Vin + { + get + { + return this.vinField; + } + set + { + this.vinField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=1)] + public int Region + { + get + { + return this.regionField; + } + set + { + this.regionField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=2)] + public int Mileage + { + get + { + return this.mileageField; + } + set + { + this.mileageField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=3)] + public int Msrp + { + get + { + return this.msrpField; + } + set + { + this.msrpField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://webservice.jdpowervalues.com/")] + public partial class GetVehicleValuesByVinRequest : NADAValueRequest + { + + private string vinField; + + private int regionField; + + private int mileageField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=0)] + public string Vin + { + get + { + return this.vinField; + } + set + { + this.vinField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=1)] + public int Region + { + get + { + return this.regionField; + } + set + { + this.regionField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=2)] + public int Mileage + { + get + { + return this.mileageField; + } + set + { + this.mileageField = value; + } + } + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GetAdjustedValuesByUidRequest))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://webservice.jdpowervalues.com/")] + public partial class GetVehicleValuesByUidRequest : NADAValueRequest + { + + private int uidField; + + private int regionField; + + private int mileageField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=0)] + public int Uid + { + get + { + return this.uidField; + } + set + { + this.uidField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=1)] + public int Region + { + get + { + return this.regionField; + } + set + { + this.regionField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=2)] + public int Mileage + { + get + { + return this.mileageField; + } + set + { + this.mileageField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://webservice.jdpowervalues.com/")] + public partial class GetAdjustedValuesByUidRequest : GetVehicleValuesByUidRequest + { + + private string[] accessoryListField; + + private string vinField; + + /// + [System.Xml.Serialization.XmlArrayAttribute(Order=0)] + public string[] AccessoryList + { + get + { + return this.accessoryListField; + } + set + { + this.accessoryListField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=1)] + public string Vin + { + get + { + return this.vinField; + } + set + { + this.vinField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://webservice.jdpowervalues.com/")] + public partial class GetRegionByStateCodeRequest : NADAValueRequest + { + + private string stateCodeField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=0)] + public string StateCode + { + get + { + return this.stateCodeField; + } + set + { + this.stateCodeField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://webservice.jdpowervalues.com/")] + public partial class GetRegionsRequest : NADAValueRequest + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://webservice.jdpowervalues.com/")] + public partial class GetMileageAdjByUidRequest : NADAValueRequest + { + + private int uidField; + + private int regionField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=0)] + public int Uid + { + get + { + return this.uidField; + } + set + { + this.uidField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=1)] + public int Region + { + get + { + return this.regionField; + } + set + { + this.regionField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://webservice.jdpowervalues.com/")] + public partial class ValidateVinRequest : NADAValueRequest + { + + private string vINField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=0)] + public string VIN + { + get + { + return this.vINField; + } + set + { + this.vINField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://webservice.jdpowervalues.com/")] + public partial class GetMutualAccessoriesRequest : NADAValueRequest + { + + private int uidField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=0)] + public int Uid + { + get + { + return this.uidField; + } + set + { + this.uidField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://webservice.jdpowervalues.com/")] + public partial class GetAccessoriesRequest : NADAValueRequest + { + + private int uidField; + + private string vinField; + + private int regionField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=0)] + public int Uid + { + get + { + return this.uidField; + } + set + { + this.uidField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=1)] + public string Vin + { + get + { + return this.vinField; + } + set + { + this.vinField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=2)] + public int Region + { + get + { + return this.regionField; + } + set + { + this.regionField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://webservice.jdpowervalues.com/")] + public partial class GetVehicleByVicRequest : NADAValueRequest + { + + private string vicField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=0)] + public string Vic + { + get + { + return this.vicField; + } + set + { + this.vicField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://webservice.jdpowervalues.com/")] + public partial class GetVehicleByUidRequest : NADAValueRequest + { + + private int uidField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=0)] + public int Uid + { + get + { + return this.uidField; + } + set + { + this.uidField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://webservice.jdpowervalues.com/")] + public partial class GetVehiclesByVinRequest : NADAValueRequest + { + + private string vinField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=0)] + public string Vin + { + get + { + return this.vinField; + } + set + { + this.vinField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://webservice.jdpowervalues.com/")] + public partial class GetBodyUidsRequest : NADAValueRequest + { + + private int yearField; + + private int makeCodeField; + + private int seriesCodeField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=0)] + public int Year + { + get + { + return this.yearField; + } + set + { + this.yearField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=1)] + public int MakeCode + { + get + { + return this.makeCodeField; + } + set + { + this.makeCodeField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=2)] + public int SeriesCode + { + get + { + return this.seriesCodeField; + } + set + { + this.seriesCodeField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://webservice.jdpowervalues.com/")] + public partial class GetSeriesRequest : NADAValueRequest + { + + private int yearField; + + private int makeCodeField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=0)] + public int Year + { + get + { + return this.yearField; + } + set + { + this.yearField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=1)] + public int MakeCode + { + get + { + return this.makeCodeField; + } + set + { + this.makeCodeField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://webservice.jdpowervalues.com/")] + public partial class GetMakesRequest : NADAValueRequest + { + + private int yearField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=0)] + public int Year + { + get + { + return this.yearField; + } + set + { + this.yearField = value; + } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] + public interface VehicleSoapChannel : JdpVehicle.VehicleSoap, System.ServiceModel.IClientChannel + { + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] + public partial class VehicleSoapClient : System.ServiceModel.ClientBase, JdpVehicle.VehicleSoap + { + + /// + /// Implement this partial method to configure the service endpoint. + /// + /// The endpoint to configure + /// The client credentials + static partial void ConfigureEndpoint(System.ServiceModel.Description.ServiceEndpoint serviceEndpoint, System.ServiceModel.Description.ClientCredentials clientCredentials); + + public VehicleSoapClient(EndpointConfiguration endpointConfiguration) : + base(VehicleSoapClient.GetBindingForEndpoint(endpointConfiguration), VehicleSoapClient.GetEndpointAddress(endpointConfiguration)) + { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public VehicleSoapClient(EndpointConfiguration endpointConfiguration, string remoteAddress) : + base(VehicleSoapClient.GetBindingForEndpoint(endpointConfiguration), new System.ServiceModel.EndpointAddress(remoteAddress)) + { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public VehicleSoapClient(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) : + base(VehicleSoapClient.GetBindingForEndpoint(endpointConfiguration), remoteAddress) + { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public VehicleSoapClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : + base(binding, remoteAddress) + { + } + + public System.Threading.Tasks.Task pingAsync(string token) + { + return base.Channel.pingAsync(token); + } + + public System.Threading.Tasks.Task getYearsAsync(JdpVehicle.GetYearsRequest l_Request) + { + return base.Channel.getYearsAsync(l_Request); + } + + public System.Threading.Tasks.Task getMakesAsync(JdpVehicle.GetMakesRequest l_Request) + { + return base.Channel.getMakesAsync(l_Request); + } + + public System.Threading.Tasks.Task getSeriesAsync(JdpVehicle.GetSeriesRequest l_Request) + { + return base.Channel.getSeriesAsync(l_Request); + } + + public System.Threading.Tasks.Task getBodyUidsAsync(JdpVehicle.GetBodyUidsRequest l_Request) + { + return base.Channel.getBodyUidsAsync(l_Request); + } + + public System.Threading.Tasks.Task getVehiclesAsync(JdpVehicle.GetVehiclesByVinRequest vehicleRequest) + { + return base.Channel.getVehiclesAsync(vehicleRequest); + } + + public System.Threading.Tasks.Task getVehicleAsync(JdpVehicle.GetVehicleByUidRequest vehicleRequest) + { + return base.Channel.getVehicleAsync(vehicleRequest); + } + + public System.Threading.Tasks.Task getVehicleByVicAsync(JdpVehicle.GetVehicleByVicRequest vehicleRequest) + { + return base.Channel.getVehicleByVicAsync(vehicleRequest); + } + + public System.Threading.Tasks.Task getAccessoriesAsync(JdpVehicle.GetAccessoriesRequest accessoriesRequest) + { + return base.Channel.getAccessoriesAsync(accessoriesRequest); + } + + public System.Threading.Tasks.Task getInclusiveAccessoriesAsync(JdpVehicle.GetMutualAccessoriesRequest mutualAccessoriesRequest) + { + return base.Channel.getInclusiveAccessoriesAsync(mutualAccessoriesRequest); + } + + public System.Threading.Tasks.Task getExclusiveAccessoriesAsync(JdpVehicle.GetMutualAccessoriesRequest mutualAccessoriesRequest) + { + return base.Channel.getExclusiveAccessoriesAsync(mutualAccessoriesRequest); + } + + public System.Threading.Tasks.Task validateVinAsync(JdpVehicle.ValidateVinRequest l_request) + { + return base.Channel.validateVinAsync(l_request); + } + + public System.Threading.Tasks.Task getMileageAdjAsync(JdpVehicle.GetMileageAdjByUidRequest mileageAdjRequest) + { + return base.Channel.getMileageAdjAsync(mileageAdjRequest); + } + + public System.Threading.Tasks.Task getRegionsAsync(JdpVehicle.GetRegionsRequest l_Request) + { + return base.Channel.getRegionsAsync(l_Request); + } + + public System.Threading.Tasks.Task getRegionByStateCodeAsync(JdpVehicle.GetRegionByStateCodeRequest l_Request) + { + return base.Channel.getRegionByStateCodeAsync(l_Request); + } + + public System.Threading.Tasks.Task getTotalAdjFloorValuesAsync(JdpVehicle.GetVehicleValuesByUidRequest l_Request) + { + return base.Channel.getTotalAdjFloorValuesAsync(l_Request); + } + + public System.Threading.Tasks.Task getVehicleValueByUidAsync(JdpVehicle.GetVehicleValuesByUidRequest vehicleRequest) + { + return base.Channel.getVehicleValueByUidAsync(vehicleRequest); + } + + public System.Threading.Tasks.Task getBaseVehicleValueByUidAsync(JdpVehicle.GetVehicleValuesByUidRequest vehicleRequest) + { + return base.Channel.getBaseVehicleValueByUidAsync(vehicleRequest); + } + + public System.Threading.Tasks.Task getVehicleAndValueByUidAsync(JdpVehicle.GetVehicleValuesByUidRequest vehicleRequest) + { + return base.Channel.getVehicleAndValueByUidAsync(vehicleRequest); + } + + public System.Threading.Tasks.Task getDefaultVehicleAndValueByVinAsync(JdpVehicle.GetVehicleValuesByVinRequest vehicleRequest) + { + return base.Channel.getDefaultVehicleAndValueByVinAsync(vehicleRequest); + } + + public System.Threading.Tasks.Task getMsrpVehicleAndValueByVinAsync(JdpVehicle.GetVehicleValuesByMsrpRequest vehicleRequest) + { + return base.Channel.getMsrpVehicleAndValueByVinAsync(vehicleRequest); + } + + public System.Threading.Tasks.Task getHighVehicleAndValueByVinAsync(JdpVehicle.GetVehicleValuesByVinRequest vehicleRequest) + { + return base.Channel.getHighVehicleAndValueByVinAsync(vehicleRequest); + } + + public System.Threading.Tasks.Task getLowVehicleAndValueByVinAsync(JdpVehicle.GetVehicleValuesByVinRequest vehicleRequest) + { + return base.Channel.getLowVehicleAndValueByVinAsync(vehicleRequest); + } + + public System.Threading.Tasks.Task getAdjustedValuesByUidAsync(JdpVehicle.GetAdjustedValuesByUidRequest request) + { + return base.Channel.getAdjustedValuesByUidAsync(request); + } + + public System.Threading.Tasks.Task getAuctionValuesAsync(JdpVehicle.GetAuctionValuesRequest auctionValuesRequest) + { + return base.Channel.getAuctionValuesAsync(auctionValuesRequest); + } + + public System.Threading.Tasks.Task getExperianAutoCheckReportAsync(JdpVehicle.GetExperianAutoCheckRequest experianAutocheckRequest) + { + return base.Channel.getExperianAutoCheckReportAsync(experianAutocheckRequest); + } + + public virtual System.Threading.Tasks.Task OpenAsync() + { + return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginOpen(null, null), new System.Action(((System.ServiceModel.ICommunicationObject)(this)).EndOpen)); + } + + public virtual System.Threading.Tasks.Task CloseAsync() + { + return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginClose(null, null), new System.Action(((System.ServiceModel.ICommunicationObject)(this)).EndClose)); + } + + private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(EndpointConfiguration endpointConfiguration) + { + if ((endpointConfiguration == EndpointConfiguration.VehicleSoap)) + { + System.ServiceModel.BasicHttpBinding result = new System.ServiceModel.BasicHttpBinding(); + result.MaxBufferSize = int.MaxValue; + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + return result; + } + if ((endpointConfiguration == EndpointConfiguration.VehicleSoap12)) + { + System.ServiceModel.Channels.CustomBinding result = new System.ServiceModel.Channels.CustomBinding(); + System.ServiceModel.Channels.TextMessageEncodingBindingElement textBindingElement = new System.ServiceModel.Channels.TextMessageEncodingBindingElement(); + textBindingElement.MessageVersion = System.ServiceModel.Channels.MessageVersion.CreateVersion(System.ServiceModel.EnvelopeVersion.Soap12, System.ServiceModel.Channels.AddressingVersion.None); + result.Elements.Add(textBindingElement); + System.ServiceModel.Channels.HttpTransportBindingElement httpBindingElement = new System.ServiceModel.Channels.HttpTransportBindingElement(); + httpBindingElement.AllowCookies = true; + httpBindingElement.MaxBufferSize = int.MaxValue; + httpBindingElement.MaxReceivedMessageSize = int.MaxValue; + result.Elements.Add(httpBindingElement); + return result; + } + throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); + } + + private static System.ServiceModel.EndpointAddress GetEndpointAddress(EndpointConfiguration endpointConfiguration) + { + if ((endpointConfiguration == EndpointConfiguration.VehicleSoap)) + { + return new System.ServiceModel.EndpointAddress("http://webservice-stage.jdpowervalues.com/vehicles/vehicle.asmx"); + } + if ((endpointConfiguration == EndpointConfiguration.VehicleSoap12)) + { + return new System.ServiceModel.EndpointAddress("http://webservice-stage.jdpowervalues.com/vehicles/vehicle.asmx"); + } + throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); + } + + public enum EndpointConfiguration + { + + VehicleSoap, + + VehicleSoap12, + } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Connected Services/JdpVehicle/vehicle.wsdl b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Connected Services/JdpVehicle/vehicle.wsdl new file mode 100644 index 0000000..5e02c4f --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Connected Services/JdpVehicle/vehicle.wsdl @@ -0,0 +1,1597 @@ + + + This is JDPA Web Service into its vehicle evaluation data. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns the boolean value true if the service is functioning and the token is valid. + + + + + Returns the valid years for the inputted parameters. + + + + + Returns the valid makes for the inputted parameters. + + + + + Returns the valid series for the inputted parameters. + + + + + Returns the valid bodies for the inputted parameters. + + + + + Returns an array of vehicles associated with the inputted parameters. + + + + + Returns a vehicle associated with the inputted parameters. + + + + + Returns a vehicle associated with the inputted parameters. + + + + + Returns the accessories associated with the inputted parameters. + + + + + Returns the packaged accessories associated with the inputted parameters. + + + + + Returns the mutually exclusive accessories associated with the inputted parameters. + + + + + Returns true if the inputted vin is valid and false if it is not. + + + + + Returns the mileage adjustments associated with the inputted parameters. + + + + + Returns the valid regions for the inputted parameters. + + + + + Returns the valid region id for the inputted two letter state code. + + + + + Returns the minimum total adjusted value for the inputted parameters. + + + + + Returns the vehicle values associated with the inputted parameters. + + + + + Returns the base vehicle values associated with the inputted parameters. + + + + + Returns the vehicle value for the default vehicle associated with the inputted parameters. + + + + + Returns the vehicle value for the default vehicle associated with the inputted parameters. + + + + + Returns the value for vehicle associated with the inputted VIN and MSRP. + + + + + Returns the vehicle value for highest vehicle value associated with the inputted parameters. + + + + + Returns the vehicle value for lowest vehicle value associated with the inputted parameters. + + + + + Returns the adjusted vehicle values associated with the inputted parameters + + + + + Returns the auction values associated with the inputted parameters. + + + + + Returns Experian AutoCheck reports with the inputted parameters. Requires Experian AutoCheck credentials. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This is JDPA Web Service into its vehicle evaluation data. + + + + + + + + \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Exceptions/DuplicateResourceException.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Exceptions/DuplicateResourceException.cs new file mode 100644 index 0000000..7dd777a --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Exceptions/DuplicateResourceException.cs @@ -0,0 +1,9 @@ +using System; + +namespace LCU.Shared.Collections.RepoApiLib.Exceptions +{ + public class DuplicateResourceException : Exception + { + public DuplicateResourceException(string resourceType) : base($"Duplicate Resources of type {resourceType} were found.") { } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Exceptions/MaxItemException.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Exceptions/MaxItemException.cs new file mode 100644 index 0000000..35f5b9d --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Exceptions/MaxItemException.cs @@ -0,0 +1,13 @@ +using System; + +namespace LCU.Shared.Collections.RepoApiLib.Exceptions +{ + public class MaxItemException : Exception + { + public MaxItemException(int itemCount) : base("Too Many Items Were Produced Than Were Allowed.") { + ItemCount = itemCount; + } + + public int ItemCount { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Exceptions/UnwantedStatusException.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Exceptions/UnwantedStatusException.cs new file mode 100644 index 0000000..6338592 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Exceptions/UnwantedStatusException.cs @@ -0,0 +1,9 @@ +using System; + +namespace LCU.Shared.Collections.RepoApiLib.Exceptions +{ + public class UnwantedStatusException : Exception + { + public UnwantedStatusException(int repoId, string accountNo) : base($"Account Number {accountNo} with Repossession ID {repoId} is in Cancelled or Redeemed status") { } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Extensions/QueryableIncludeAll.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Extensions/QueryableIncludeAll.cs new file mode 100644 index 0000000..9ab01b0 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Extensions/QueryableIncludeAll.cs @@ -0,0 +1,37 @@ +using System.Linq; +using LCU.Shared.Collections.RepoApiLib.Models; +using Microsoft.EntityFrameworkCore; + +namespace LCU.Shared.Collections.RepoApiLib.Extensions +{ + public static class QueryableIncludeAll + { + public static IQueryable IncludeAll(this IQueryable queryable) + { + return queryable + .Include(repo => repo.Borrowers) + .Include(repo => repo.Collaterals) + .ThenInclude(collateral => collateral.RepoCompanySelections) + .Include(repo => repo.RepoStatusChanges) + .Include(repo => repo.RefundStatus) + .Include(repo => repo.SixtyPlusCollector) + ; + } + + public static IQueryable IncludeAll(this IQueryable queryable) + { + return queryable + .Include(auctionAssignment => auctionAssignment.Auction) + .Include(auctionAssignment => auctionAssignment.AutoIMS) + .Include(auctionAssignment => auctionAssignment.FloorPriceValuesUsed) + .ThenInclude(fpvu => fpvu.CollateralValuation) + .Include(auctionAssignment => auctionAssignment.AuctionAssignmentToCollaterals) + .ThenInclude(aa2c => aa2c.Collateral); + } + + public static IQueryable IncludeAll(this IQueryable queryable) + { + return queryable.Include(collateral => collateral.RepoCompanySelections); + } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Hosted/HostedTaskQueue.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Hosted/HostedTaskQueue.cs new file mode 100644 index 0000000..143eaf6 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Hosted/HostedTaskQueue.cs @@ -0,0 +1,31 @@ +using System.Collections.Concurrent; +using System.Threading; + +namespace LCU.Shared.Collections.RepoApiLib.Hosted +{ + /** + * Should be injected as a singleton. Can be used by a controller to queue something. + */ + public class HostedTaskQueue : IHostedTaskQueue + { + private readonly BlockingCollection _tasks = new BlockingCollection(); + + // This will not block. + public void Enqueue(TaskSettings settings) + { + _tasks.Add(settings); + } + + // This will block. + public TaskSettings Dequeue(CancellationToken token) + { + return _tasks.Take(token); + } + + public int GetCount() + { + return _tasks.Count; + } + + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Hosted/IHostedTaskQueue.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Hosted/IHostedTaskQueue.cs new file mode 100644 index 0000000..b8f380b --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Hosted/IHostedTaskQueue.cs @@ -0,0 +1,11 @@ +using System.Threading; + +namespace LCU.Shared.Collections.RepoApiLib.Hosted +{ + public interface IHostedTaskQueue + { + void Enqueue(TaskSettings settings); + TaskSettings Dequeue(CancellationToken token); + int GetCount(); + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Hosted/TaskSettings.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Hosted/TaskSettings.cs new file mode 100644 index 0000000..0b8216f --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Hosted/TaskSettings.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; + +namespace LCU.Shared.Collections.RepoApiLib.Hosted +{ + public class TaskSettings : IValidatableObject + { + [Required] + public DateTime StartDate { get; set; } + + [Required] + public DateTime EndDate { get; set; } + + public string TaskUser { get; set; } + + [Required] + [MaxLength(25)] + [MinLength(3)] + public string QueueRoute { get; set; } + + public const string SystemUser = "System"; + + public IEnumerable Validate(ValidationContext validationContext) + { + var results = new List(); + + if (StartDate.Date > DateTime.Today) + { + results.Add(new ValidationResult("StartDate cannot be in future", new[] { "StartDate" })); + } + + if (EndDate.Date < StartDate.Date) + { + results.Add(new ValidationResult("EndDate cannot be before StartDate", new[] { "EndDate" })); + } + + return results; + } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/LCU.Shared.Collections.RepoApiLib.csproj b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/LCU.Shared.Collections.RepoApiLib.csproj new file mode 100644 index 0000000..2ec2388 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/LCU.Shared.Collections.RepoApiLib.csproj @@ -0,0 +1,77 @@ + + + + netcoreapp2.2 + true + This is the models and repository code for Repo related entities. +1.0.5 Added auction assignment note +1.0.6 ? +1.0.7 Add Repo Companies +1.0.8 Add AutoIMS services +1.0.9 Add Auction Note find duplicate method +1.0.10 Add Nada service. +1.0.11 Add set floor pricing, configuration for AutoIms +1.0.12 Add basic reporting models +2.0.0 Replace EventAlert's AlertType with a message string +2.0.1 Add Searching to RepoAccount Repository +2.0.2 Add SubMessage to EventAlerts +2.0.3 Add RedemptionExpiredDate to RepoAccount +2.0.4 Add Average Days O4R to Repo to Reporting +2.0.5 Update MMR parameters in IMSAutoFileData +2.0.6 Add Refund Status Model & Repository +2.0.7 Add DateClosed to RepoAccount Model +2.0.8 Add OwnershipType +2.1.0 Update Database Columns and Relationships. Breaking Changes. +2.1.1 Add RepoCompanySelection Repository +2.1.2 Add FindByCollateralIdAsync() method to RepoCompanySelection Repository +2.1.3 Set DateTimeCreated and null out Id in RepoCompanySelections Repository's AddAsync() +2.1.4 Update RepoCompanySelction to spell "RepoCompanyAssignmentDate" correctly and set AuctionAssignment IsActive field to have a default true value +2.2.0 Environment model for reporting status. +2.2.1 Add RepoManualStatus +2.2.2 Add Validation Constraints to Repo Company Selection +2.2.3 Return added collateral +2.2.4 Get Current Accounts On Hold at an auction +2.2.5 Remove repoStatus class +2.2.6 Add Additional Filter Options to RepoAccount's ListAsync() method +2.2.7 Revert saving style of AutoImsFiles +2.2.8 Add EmailRecipient and EmailBody to EventAlert +2.3.0 Create SavedLocation Table & Endpoints +2.4.0 Refactor Reporting +2.4.1 Create Active Inventory Count +2.4.2 Allow Report Filtering By Status Change in Past +2.4.3 Rename GetAccountsByDateSold -> GetAccountsByDateSoldInAutoIMS +2.4.4 Add 'O4RDate' to Entries & add GetAccountsByO4RDate() Method to Repository +2.4.5 Add 'OrigAccountType' to Repo Table and Add BranchEntry to Models/Settings +2.4.6 Make RepoCompanyAssignments RepoType use CollectionsLib RepoType Enum +2.4.7 Add 'SixtyPlusCollector' to Repo Table +2.4.8 Updated NADA Endpoints to use REST from SOAP + + Landmark Credit Union + Landmark Credit Union + https://landmarkcu.visualstudio.com/Repo/_git/LCU.API.Collections.RepoApi + Git + 2.4.8.0 + + 2.4.8 Updated NADA Endpoints to use REST from SOAP + + 2.4.8.0 + 2.4.8.0 + 2.4.8.0 + + + + + + + + + + + + + + + + + + diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/AuctionAssignment.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/AuctionAssignment.cs new file mode 100644 index 0000000..6b101b2 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/AuctionAssignment.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; + +namespace LCU.Shared.Collections.RepoApiLib.Models +{ + public class AuctionAssignment + { + [Required] + public int ID { get; set; } + [Required] + public string AuctionId { get; set; } + [Required] + public int? RepoId { get; set; } + public string AuctionCustomerNo { get; set; } + public string CollateralVIN { get; set; } + public DateTime? DateSubmitted { get; set; } + public decimal? FloorPrice { get; set; } + public int? FloorPriceResponseCode { get; set; } + public string FloorPriceResponseDescription { get; set; } + public string FloorPriceSubmissionErrors { get; set; } + public int? HoldStatus { get; set; } + public DateTime? HoldUntil { get; set; } + public DateTime? RedeemedDate { get; set; } + public int? VehicleType { get; set; } + public string BodyStyle { get; set; } + public bool? Inoperable { get; set; } + public decimal? RetailValue { get; set; } + public string AuctionNotes { get; set; } + public DateTime? AvailablePickupDate { get; set; } + public DateTime? LegalSaleDate { get; set; } + public int? CleaningLevel { get; set; } + public int? SubmissionResponseCode { get; set; } + public string SubmissionResponseDescription { get; set; } + public string SubmissionErrors { get; set; } + public DateTime? SentTitleDocsDate { get; set; } + public int? TitleSentResponseCode { get; set; } + public string TitleSentResponseDescription { get; set; } + public string TitleSentSubmissionErrors { get; set; } + public bool? AddedThroughRepoDatabase { get; set; } + public bool IsActive { get; set; } + + public ImsAutoFileData AutoIMS { get; set; } + public AuctionHouse Auction { get; set; } + public IEnumerable AuctionAssignmentToCollaterals { get; set; } + public FloorPriceValuesUsed FloorPriceValuesUsed { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/AuctionAssignmentNote.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/AuctionAssignmentNote.cs new file mode 100644 index 0000000..1d33ffe --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/AuctionAssignmentNote.cs @@ -0,0 +1,20 @@ +using System; +using System.ComponentModel.DataAnnotations; + +namespace LCU.Shared.Collections.RepoApiLib.Models +{ + public class AuctionAssignmentNote + { + [Required] + public int Id { get; set; } + [Required] + public int AuctionAssignmentId { get; set; } + [Required] + public string AuctionCustomerNo { get; set; } + public string Origin { get; set; } + public string Writer { get; set; } + public string Type { get; set; } + public string Text { get; set; } + public DateTime? DateWritten { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/AuctionAssignmentToCollateral.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/AuctionAssignmentToCollateral.cs new file mode 100644 index 0000000..3ec9fd6 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/AuctionAssignmentToCollateral.cs @@ -0,0 +1,14 @@ +using System.ComponentModel.DataAnnotations; + +namespace LCU.Shared.Collections.RepoApiLib.Models +{ + public class AuctionAssignmentToCollateral + { + [Key] + public int AuctionAssignmentId { get; set; } + [Key] + public int CollateralId { get; set; } + public AuctionAssignment AuctionAssignment { get; set; } + public Collateral Collateral { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/AuctionHouse.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/AuctionHouse.cs new file mode 100644 index 0000000..14c9168 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/AuctionHouse.cs @@ -0,0 +1,23 @@ +using System.ComponentModel.DataAnnotations; + +namespace LCU.Shared.Collections.RepoApiLib.Models +{ + public class AuctionHouse + { + [Required] + public string AuctionID { get; set; } + [Required] + public string Name { get; set; } + public string Active { get; set; } + public string Address_Line_1 { get; set; } + public string Address_Line_2 { get; set; } + public string City { get; set; } + public string State { get; set; } + public string ZIP { get; set; } + public string Country { get; set; } + public string Phone { get; set; } + public string Fax { get; set; } + public decimal? Latitude { get; set; } + public decimal? Longitude { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/AuditRecord.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/AuditRecord.cs new file mode 100644 index 0000000..4696607 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/AuditRecord.cs @@ -0,0 +1,18 @@ +namespace LCU.Shared.Collections.RepoApiLib.Models +{ + public class AuditRecord + { + public int ID { get; set; } + // Name of object modified + public string ClassName { get; set; } + // category of modification + public string Action { get; set; } + public string Description { get; set; } + public string PerformedBy { get; set; } + public System.DateTime DatePerformed { get; set; } + // The ID representation of the object modified + public string KeyRepresentation { get; set; } + // Don't want to use, but this is a json of the whole object currently + public string PropertyValues { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/AutoIms/FtpConfiguration.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/AutoIms/FtpConfiguration.cs new file mode 100644 index 0000000..d5f3f08 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/AutoIms/FtpConfiguration.cs @@ -0,0 +1,13 @@ + +namespace LCU.Shared.Collections.RepoApiLib.Models.AutoIms +{ + public class FtpConfiguration + { + public string HostName { get; set; } + public string UserName { get; set; } + public int Port { get; set; } + public string ExecutablePath { get; set; } + public string SshHostKeyFingerprint { get; set; } + public string SshPrivateKeyPath { get; set; } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/AutoIms/ImportResultRow.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/AutoIms/ImportResultRow.cs new file mode 100644 index 0000000..353b084 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/AutoIms/ImportResultRow.cs @@ -0,0 +1,42 @@ +using System.Collections.Generic; +using Microsoft.EntityFrameworkCore.Internal; + +namespace LCU.Shared.Collections.RepoApiLib.Models.AutoIms +{ + public class ImportResultRow + { + public bool Success { get; set; } + public List Messages { get; set; } + public string Description { get; set; } + public ImsAutoFileData Data { get; set; } + public RepoAccount RepoAccount { get; set; } + + public string BuildStatusReport(string repoManagerUrl) + { + var report = new List(); + var success = Success ? "Success" : "Failure"; + if (RepoAccount != null) + { + report.Add(CreateRepoLink(RepoAccount, repoManagerUrl)); + } + if(RepoAccount == null && Data != null) + { + report.Add($"Auto IMS Update for {Data.VIN}, no Repo Account."); + } + report.Add($"{success} : {Description}"); + if (Messages != null && Messages.Any()) + { + report.AddRange(Messages); + } + + return report.Join("
"); + } + + public static string CreateRepoLink(RepoAccount account, string repoManagerUrl) + { + var url = repoManagerUrl + account.RepoId; + var link = string.Format("{1}", url, $"Account {account.RepoId} ({account.AccountNo})") ; + return link; + } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/AutoIms/ImsAutoFileImportData.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/AutoIms/ImsAutoFileImportData.cs new file mode 100644 index 0000000..ff2600d --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/AutoIms/ImsAutoFileImportData.cs @@ -0,0 +1,71 @@ +namespace LCU.Shared.Collections.RepoApiLib.Models.AutoIms +{ + /** + * This models the rows in the CSV File so that they can be different from the rows in SQL + */ + public class ImsAutoFileImportData + { + public string AnnouncedConditions { get; set; } + public string ArbitrationReason { get; set; } + public string AsIs100KMiles { get; set; } + public string AssignmentAccepted { get; set; } + public string AuctionAge { get; set; } + public string AuctionGuideBookPrice { get; set; } + public string BuyerID { get; set; } + public string BuyerName { get; set; } + public string ChargeAmount { get; set; } + public string CheckAmount { get; set; } + public string ClientAge { get; set; } + public string ClientCancelled { get; set; } + public string CollisionDamage { get; set; } + public string InspectedDate { get; set; } + public string DateofLoss { get; set; } + public string DatePickedUp { get; set; } + public string DateEnteredAutoIMS { get; set; } + public string DaysRun { get; set; } + public string DaysRunHighestBidRecordedbyAuction { get; set; } + public string DaystoDelivery { get; set; } + public string Description { get; set; } + public string Drivable { get; set; } + public string FloorPriceAccepted { get; set; } + public string FundsSent { get; set; } + public string GrossPercentFloor { get; set; } + public string HighestBid { get; set; } + public string StatedMileage { get; set; } + public string NetPercentFloor { get; set; } + public string OtherAdvanceFees { get; set; } + public string OTHERTotal { get; set; } + public string OTHERAdvancedOther { get; set; } + public string OTHERAdvancedStorage { get; set; } + public string OTHERAdvancedTow { get; set; } + public string OTHERMiscellaneous { get; set; } + public string SalePrice { get; set; } + public string ScheduledSaleDate { get; set; } + public string SoldDate { get; set; } + public string TitleNumber { get; set; } + public string TitleReceived { get; set; } + public string TitleReturned { get; set; } + public string TitleState { get; set; } + public string TitleStatus { get; set; } + public string TitleStatusfromAuction { get; set; } + public string TotalCharges { get; set; } + public string Operable { get; set; } + public string ShipmentDate { get; set; } + public string Status { get; set; } + public string VIN { get; set; } + public string StorageCost { get; set; } + public string StorageRatePerDay { get; set; } + public string TowCost { get; set; } + public string CustomerAccountNumber { get; set; } + public string DateReceivedFromAutoIMS { get; set; } + public string VehicleDecimalGradeCode { get; set; } + public string VehicleGrade { get; set; } + public string VehicleGradeApprovedCR { get; set; } + public string MMRNationalAdjustedPrice { get; set; } + public string MMRRegionalAdjustedPrice { get; set; } + public string MMR { get; set; } + public string ConditionReportLink { get; set; } + public string CollateralImagePath { get; set; } + public string AuctionAssignmentID { get; set; } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Borrower.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Borrower.cs new file mode 100644 index 0000000..9f7d008 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Borrower.cs @@ -0,0 +1,22 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using Newtonsoft.Json; + +namespace LCU.Shared.Collections.RepoApiLib.Models +{ + public class Borrower + { + [Required] + public int RepoId { get; set; } + [Required] + public string IndividualId { get; set; } + [Required] + public int OwnershipType { get; set; } + [Required] + public string IndividualName { get; set; } + + [ForeignKey("RepoId")] + [JsonIgnore] + public RepoAccount RepoAccount { get; set; } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/ClientError.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/ClientError.cs new file mode 100644 index 0000000..3e35887 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/ClientError.cs @@ -0,0 +1,10 @@ + +namespace LCU.Shared.Collections.RepoApiLib.Models +{ + public class ClientError + { + public string Message { get; set; } + public string Name { get; set; } + public string StackTrace { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Collateral.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Collateral.cs new file mode 100644 index 0000000..df5eb38 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Collateral.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using Newtonsoft.Json; + +namespace LCU.Shared.Collections.RepoApiLib.Models +{ + public class Collateral + { + [Required] + public int CollateralId { get; set; } + [Required] + public int RepoId { get; set; } + public string Vin { get; set; } + public string Make { get; set; } + public string Model { get; set; } + public int? Year { get; set; } + public string Description { get; set; } + public int? VehicleType { get; set; } + public string BodyStyle { get; set; } + public bool? Inoperable { get; set; } + public int? CollateralTypeId { get; set; } + public DateTime? RetitledInLandmarkName { get; set; } + public string RefCollateralId { get; set; } + + [ForeignKey("CollateralId")] + public IReadOnlyCollection RepoCompanySelections { get; set; } + + [ForeignKey("RepoId")] + [JsonIgnore] + public RepoAccount RepoAccount { get; set; } + + [JsonIgnore] + public IEnumerable AuctionAssignmentToCollaterals { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Consumer/AddressDetail.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Consumer/AddressDetail.cs new file mode 100644 index 0000000..8d82a58 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Consumer/AddressDetail.cs @@ -0,0 +1,35 @@ + +namespace LCU.Shared.Collections.RepoApiLib.Models.Consumer +{ + public class AddressDetail + { + public int AddressId { get; set; } + public string Line1 { get; set; } + public string Line2 { get; set; } + public string Line3 { get; set; } + public string City { get; set; } + public string State { get; set; } + public string ZipCode { get; set; } + public string Country { get; set; } + public string CountyName { get; set; } + public string AddressType { get; set; } + public bool IsPrimary { get; set; } + public bool IsInternational { get; set; } + public int AddressVerification { get; set; } + public string Occupancy { get; set; } + public System.DateTime StartDate { get; set; } + public System.DateTime EndDate { get; set; } + public string LongAddress1 { get; set; } + public string LongAddress2 { get; set; } + public string[] Membership { get; set; } + public string[] CoBorrower { get; set; } + public System.DateTime UseAlternateAsOf { get; set; } + public System.DateTime RestorePrimaryAsOf { get; set; } + public string AlternateType { get; set; } + public string Comments { get; set; } + public string Met2AddressIndicator { get; set; } + public bool UspsVerified { get; set; } + public string AddressMatchStatus { get; set; } + public bool IsHSA { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Consumer/AppraisalDetail.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Consumer/AppraisalDetail.cs new file mode 100644 index 0000000..155ded8 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Consumer/AppraisalDetail.cs @@ -0,0 +1,25 @@ + +namespace LCU.Shared.Collections.RepoApiLib.Models.Consumer +{ + public class AppraisalDetail + { + public decimal OriginalAppraisedValue { get; set; } + public string OriginalAppraisedBy { get; set; } + public string OriginalAppraisalType { get; set; } + public System.DateTime OriginalAppraisalDate { get; set; } + public decimal LastAppraisedValue { get; set; } + public string LastAppraisedBy { get; set; } + public string LastAppraisalType { get; set; } + public System.DateTime LastAppraisalDate { get; set; } + public bool OriginalAppraisalProvided { get; set; } + public System.DateTime OriginalDateProvided { get; set; } + public int OriginalProvidedByOperatorID { get; set; } + public string OriginalProvidedByOperatorName { get; set; } + public string OriginalDeliveryMethod { get; set; } + public bool LastAppraisalProvided { get; set; } + public System.DateTime LastDateProvided { get; set; } + public int LastProvidedByOperatorID { get; set; } + public string LastProvidedByOperatorName { get; set; } + public string LastDeliveryMethod { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Consumer/CollateralDetail.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Consumer/CollateralDetail.cs new file mode 100644 index 0000000..319b1ed --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Consumer/CollateralDetail.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace LCU.Shared.Collections.RepoApiLib.Models.Consumer +{ + public class CollateralDetail + { + public int CollateralId { get; set; } + public int OwnerId { get; set; } + public string OwnerName { get; set; } + public string CollateralType { get; set; } + public string NameOnTitle { get; set; } + public string Description { get; set; } + public decimal PurchasePrice { get; set; } + public decimal CurrentValue { get; set; } + public string SourceOfEvaluation { get; set; } + public System.DateTime EvaluationDate { get; set; } + public int ValueVerifiedByOperatorNumber { get; set; } + public string ValueVerifiedByOperatorName { get; set; } + public string VerificationMethod { get; set; } + public System.DateTime VerificationDate { get; set; } + public int VerifiedBy { get; set; } + public string SerialNumber { get; set; } + public Vehicle Vehicle { get; set; } + public OtherCollateral Other { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Consumer/CoreTransaction.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Consumer/CoreTransaction.cs new file mode 100644 index 0000000..1550e15 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Consumer/CoreTransaction.cs @@ -0,0 +1,16 @@ +using System; + +namespace LCU.Shared.Collections.RepoApiLib.Models.Consumer +{ + // NOTE: This currently does not contain all possible fields. + // Instead, it only contains the fields necessary. + // NOTE NOTE: This class will change heavily. + public class CoreTransaction + { + public decimal? runningBalance { get; set; } + public DateTime? postingDate { get; set; } + public decimal? amount { get; set; } + public string transactionTypeCode { get; set; } + public string transactionTypeDescription { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Consumer/LoanDetail.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Consumer/LoanDetail.cs new file mode 100644 index 0000000..d22c8cd --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Consumer/LoanDetail.cs @@ -0,0 +1,268 @@ +using System.Collections.Generic; + +namespace LCU.Shared.Collections.RepoApiLib.Models.Consumer +{ + public class LoanDetail + { + public long MemberId { get; set; } + public long LoanId { get; set; } + public long ExternalLoanId { get; set; } + public int[] IndividualId { get; set; } + public List Borrowers { get; set; } + public string LoanType { get; set; } + public string Title { get; set; } + public string Alerts { get; set; } + public string Product { get; set; } + public int ProductCode { get; set; } + public string Template { get; set; } + public int ProductId { get; set; } + public string ProductDescription { get; set; } + public string ProductCategory { get; set; } + public string ProductClass { get; set; } + public int AccountType { get; set; } + public string Status { get; set; } + public System.DateTime ClosedDate { get; set; } + public string Category { get; set; } + public string Classification { get; set; } + public string MetroAcctType { get; set; } + public string SMSA { get; set; } + public string Officer { get; set; } + public string OtherSecurity { get; set; } + public string NoteNumber { get; set; } + public System.DateTime LastMaintenance { get; set; } + public System.DateTime WrittenOffDate { get; set; } + public string CreditCardNumber { get; set; } + public System.DateTime LastCycleDate { get; set; } + public string LegalDescription { get; set; } + public string PropertyType { get; set; } + public string PurposeCode { get; set; } + public string CollateralCode { get; set; } + public string RefinanceCount { get; set; } + public System.DateTime LastRefinanceDate { get; set; } + public string LdcNumber { get; set; } + public string Messages { get; set; } + public decimal OriginalAmount { get; set; } + public System.DateTime OriginationDate { get; set; } + public decimal Balance { get; set; } + public decimal AvailableBalance { get; set; } + public decimal Limit { get; set; } + public decimal EscrowBalance { get; set; } + public decimal Payoff { get; set; } + public decimal UnappliedFundsBalance { get; set; } + public decimal CashAdvanceBalance { get; set; } + public decimal PurchaseAdvanceBalance { get; set; } + public decimal ActiveAuthorizationAmount { get; set; } + public decimal EscrowDividends { get; set; } + public string PledgeType { get; set; } + public string MiscCharge1 { get; set; } + public string MiscCharge2 { get; set; } + public string MiscCharge3 { get; set; } + public string MiscChargeCode1 { get; set; } + public string MiscChargeCode2 { get; set; } + public string MiscChargeCode3 { get; set; } + public decimal InterestMemoed { get; set; } + public System.DateTime InterestAccruedDate { get; set; } + public decimal PaymentInterestDue { get; set; } + public decimal PayoffInterestDue { get; set; } + public string LateChargeMethod { get; set; } + public decimal LateCharge { get; set; } + public System.DateTime LateChargeDate { get; set; } + public decimal CashAdvance { get; set; } + public string Insurance { get; set; } + public decimal LastStatementLateCharges { get; set; } + public decimal LastStatementMiscFees { get; set; } + public decimal LastStatementPurchaseAdvances { get; set; } + public decimal LastStatementCashAdvances { get; set; } + public decimal LastStatementCashAdvanceFees { get; set; } + public decimal LastStatementMiscDebits { get; set; } + public decimal LastStatementTotalPayments { get; set; } + public decimal LastStatementCreditsPosted { get; set; } + public decimal LastStatementAccruedInterest { get; set; } + public System.DateTime LastStatementDate { get; set; } + public decimal LastStatementPurchaseAdvanceBalance { get; set; } + public decimal LastStatementEndingBalance { get; set; } + public decimal DelinquentAmount { get; set; } + public decimal LastStatementMonthlyMinimum { get; set; } + public decimal LastStatementRequiredDue { get; set; } + public decimal LastStatementRequiredPayment { get; set; } + public decimal ScheduledPayment { get; set; } + public System.DateTime NextDueDate { get; set; } + public decimal PartialPaymentAmount { get; set; } + public System.DateTime PreviousDate { get; set; } + public string PaymentFrequency { get; set; } + public System.DateTime AlignmentDate { get; set; } + public string PaymentMethod { get; set; } + public string SourceAccount { get; set; } + public string ProcessingGroup { get; set; } + public System.DateTime LoanCouponDate { get; set; } + public decimal RequiredPaymentDue { get; set; } + public System.DateTime FirstPaymentDate { get; set; } + public decimal AlternatePaymentAmount { get; set; } + public System.DateTime AlternateBeginDate { get; set; } + public System.DateTime AlternateEndDate { get; set; } + public int PaymentSkips { get; set; } + public decimal FinalPaymentAmount { get; set; } + public System.DateTime FinalPaymentDate { get; set; } + public decimal CycleAmount { get; set; } + public string VariableRatePaymentChange { get; set; } + public string VariableRateCode { get; set; } + public decimal MinimumDue { get; set; } + public decimal FrequencyPayment { get; set; } + public decimal EscrowPayment { get; set; } + public decimal PrincipalAndInterestPayment { get; set; } + public string PaymentLoanDefinitionNumber { get; set; } + public string RateLoanDefinitionNumber { get; set; } + public int VacationWeeks { get; set; } + public int PayrollRepaidWeeklyPaymentCount { get; set; } + public decimal BaseRate { get; set; } + public decimal TieredRateAdj { get; set; } + public decimal ManualRateAdj { get; set; } + public decimal Rate { get; set; } + public decimal ManualRate { get; set; } + public decimal APR { get; set; } + public decimal OriginalInterestRate { get; set; } + public decimal AlternateInterestRate { get; set; } + public System.DateTime LastRateChange { get; set; } + public decimal RealEstateMargin { get; set; } + public string Amortization { get; set; } + public int AmortizationTerm { get; set; } + public int MonthlyTerm { get; set; } + public int NumberOfPayments { get; set; } + public decimal InterestYTD { get; set; } + public decimal InterestPYTD { get; set; } + public decimal InterestDaily { get; set; } + public decimal PrincipalYTD { get; set; } + public decimal PrincipalPYTD { get; set; } + public decimal LateChargeYTD { get; set; } + public decimal LateChargePYTD { get; set; } + public string PaymentHistory { get; set; } + public System.DateTime LastPaymentDue { get; set; } + public int PaymentsPastDue { get; set; } + public int DaysPastDue { get; set; } + public int MonthsPastDue { get; set; } + public decimal CurrentStatementLateCharges { get; set; } + public decimal CurrentStatementMiscFees { get; set; } + public decimal CurrentStatementPurchaseAdvances { get; set; } + public decimal CurrentStatementCashAdvances { get; set; } + public decimal CurrentStatementCashAdvanceFees { get; set; } + public decimal CurrentStatementMiscDebits { get; set; } + public decimal CurrentStatementTotalPayments { get; set; } + public decimal CurrentStatementTotalCredits { get; set; } + public System.DateTime DelinquentPaymentDueDate { get; set; } + public bool IsInactive { get; set; } + public string StatementFrequency { get; set; } + public decimal AppraisedValue { get; set; } + public int LocCycleDay { get; set; } + public bool IgnorePledge { get; set; } + public bool OpenEndPlan { get; set; } + public string OpenEndCategory { get; set; } + public decimal PointsPaid { get; set; } + public decimal CurtailmentAmount { get; set; } + public System.DateTime CurtailmentDate { get; set; } + public System.DateTime InsuranceExpirationDate { get; set; } + public string LifeInsuranceMI { get; set; } + public string DisabilityInsuranceMI { get; set; } + public string LifeActivityInsuranceCode { get; set; } + public string DisabilityActivityInsuranceCode { get; set; } + public bool LoanCoupons { get; set; } + public bool PaidbyGrace { get; set; } + public string EscrowAccount { get; set; } + public bool EscrowInterestPaid { get; set; } + public System.DateTime NextPaymentAdjustmentDate { get; set; } + public decimal EffectivePayment { get; set; } + + public decimal InterestRate { get; set; } + + public System.DateTime LastPaymentDate { get; set; } + public System.DateTime LastPurchaseDate { get; set; } + public System.DateTime LastCashAdvanceDate { get; set; } + public string BlockCode { get; set; } + public string ReclassCode { get; set; } + public int OutstandingAuthCount { get; set; } + public decimal OutstandingAuthAmount { get; set; } + public string InterestType { get; set; } + public string AlternateLoanNumber { get; set; } + public int ArmIndex { get; set; } + public string DeductionOption { get; set; } + public bool DelinquentPaymentSkips { get; set; } + public bool FirstPayment { get; set; } + public decimal InterestDue { get; set; } + public bool LoanLevelSkips { get; set; } + public bool PaymentReduction { get; set; } + public bool WaiveLateCharge { get; set; } + public int ExcessPaymentTargetAccountId { get; set; } + public long ExcessPaymentMemberId { get; set; } + public bool CustRate { get; set; } + public string IntRateMethod { get; set; } + public decimal Margin { get; set; } + public string Index { get; set; } + public decimal RndFactPct { get; set; } + public string RndFactOpt { get; set; } + public decimal IntRateCeiling { get; set; } + public decimal IntRateFloor { get; set; } + public decimal MaxDnRateChgLife { get; set; } + public decimal MaxUpRateChgLife { get; set; } + public decimal MaxDnRateChgPeriod { get; set; } + public decimal MaxUpRateChgPeriod { get; set; } + public decimal MinDnRateChgPeriod { get; set; } + public decimal MinUpRateChgPeriod { get; set; } + public short PmtAdjPeriod { get; set; } + public short DaysPriorToPeriodicRateAdj { get; set; } + public short DaysPriorToInitialRateAdjustment { get; set; } + public bool FirstAdjustmentIsEstimate { get; set; } + public System.DateTime InitialAnalysisEstimateDate { get; set; } + public string EstimatePerformed { get; set; } + + public int BalloonTerm { get; set; } + + public string PledgeTypeDescription { get; set; } + + public string SystemApproved { get; set; } + + public string[] VINList { get; set; } + + public long? MortgageLoanOriginator { get; set; } + public decimal? LastPaymentPrincipal { get; set; } + public decimal? LastPaymentInterest { get; set; } + public decimal? LastPaymentFees { get; set; } + public decimal? LastPaymentLateCharges { get; set; } + public decimal? LastPaymentEscrowImpound { get; set; } + public decimal? LastPaymentCurtailment { get; set; } + public decimal? LastPaymentTotal { get; set; } + public short TransferDay { get; set; } + + public long SourceMember { get; set; } + + public bool AdjustPurchaseAccrual { get; set; } + public bool AnnualFee { get; set; } + public System.DateTime AnnualFeeDate { get; set; } + public decimal BalaceLimit { get; set; } + public bool CloseOnZero { get; set; } + public System.DateTime DrawDate { get; set; } + public string Form1098Option { get; set; } + public bool MethodADelinquency { get; set; } + public short? NumberofSkips { get; set; } + public decimal OverlimitAmount { get; set; } + public System.DateTime OverlimitDate { get; set; } + public decimal PurchaseAdvBalance { get; set; } + public System.DateTime SkipDate { get; set; } + public bool ToBeDelinquent { get; set; } + public bool WaiveDelinquencyNotice { get; set; } + public bool WaiveBillingNotice { get; set; } + public bool WaiveInterest { get; set; } + public decimal LastStatementMinimumPayment { get; set; } + + public decimal LastStatementCycleRequiredPayment { get; set; } + + public bool ExemptNonResident { get; set; } + public string YTDNonresidentWithholding { get; set; } + public string PYTDNonresidentWithholding { get; set; } + + public string InCollection { get; set; } + + public string UniversalLoanId { get; set; } + public System.DateTime RateLockDate { get; set; } + public string ActiveStopPays { get; set; } + public string[] ErrorMessage { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Consumer/LoanOwner.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Consumer/LoanOwner.cs new file mode 100644 index 0000000..bd459a8 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Consumer/LoanOwner.cs @@ -0,0 +1,18 @@ + +namespace LCU.Shared.Collections.RepoApiLib.Models.Consumer +{ + public class LoanOwner + { + public int IndividualId { get; set; } + public string Name { get; set; } + public string Type { get; set; } + public string Address { get; set; } + public string TaxId { get; set; } + public string Association { get; set; } + public System.DateTime LastAssociationCodeChangedDate { get; set; } + public string Metro2ConsumerInformationIndicator { get; set; } + public bool CoborrowerIsSpouse { get; set; } + public decimal OwnershipPercentage { get; set; } + public string PercentageDescription { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Consumer/MemberDetail.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Consumer/MemberDetail.cs new file mode 100644 index 0000000..b63ffc3 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Consumer/MemberDetail.cs @@ -0,0 +1,55 @@ + +namespace LCU.Shared.Collections.RepoApiLib.Models.Consumer +{ + public class MemberDetail + { + public long MemberId { get; set; } + public string MemberName { get; set; } + public int PrimaryIndividualId { get; set; } + public string MemberType { get; set; } + public string Affiliation { get; set; } + public System.DateTime MemberSince { get; set; } + public string Miscellaneous1 { get; set; } + public string Miscellaneous2 { get; set; } + public string OriginalOpenBranch { get; set; } + public string WithholdingCode { get; set; } + public decimal ExpeditedFunds { get; set; } + public System.DateTime ExpeditedFundsDate { get; set; } + public int AccessLevel { get; set; } + public int StandardStatementCycle { get; set; } + public string StandardStatementCode { get; set; } + public string StandardStatementMethod { get; set; } + public int CATFeeCounter { get; set; } + public System.DateTime CATFeeDate { get; set; } + public int CreditCardStatementCycle { get; set; } + public string CreditCardStatementCode { get; set; } + public string CreditCardStatementMethod { get; set; } + public int AccountCount { get; set; } + public decimal AccountBalance { get; set; } + public int LoanCount { get; set; } + public decimal LoanBalance { get; set; } + public int LoansDelinquentCount { get; set; } + public decimal LoansDelinquent { get; set; } + public int LoansWrittenOffCount { get; set; } + public decimal LoansWrittenOff { get; set; } + public int LoansInCollectionCount { get; set; } + public decimal LoansInCollection { get; set; } + // public AccountSummary[] Account { get; set; } + // public LoanSummary[] Loan { get; set; } + // public CrossMemberDetails[] CrossMember { get; set; } + public string Password { get; set; } + public string PinLock { get; set; } + public int BranchId { get; set; } + public int RelationshipPricingLevel { get; set; } + public string RelationshipPricingLevelPermanent { get; set; } + public string RelationshipPricingDescription { get; set; } + public int PreviousRelationshipPricingLevel { get; set; } + public string LastRelationshipPricingLevelAnalysisDate { get; set; } + public string LastRelationshipPricingLevelChangeDate { get; set; } + public string InhibitActivity { get; set; } + public string WrittenOffLoan { get; set; } + public string LoanInCollection { get; set; } + public string PurgeMembership { get; set; } + public AddressDetail Address { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Consumer/OtherCollateral.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Consumer/OtherCollateral.cs new file mode 100644 index 0000000..dceae80 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Consumer/OtherCollateral.cs @@ -0,0 +1,10 @@ + +namespace LCU.Shared.Collections.RepoApiLib.Models.Consumer +{ + public class OtherCollateral + { + public string MiscellaneousInformation { get; set; } + public AppraisalDetail Appraisal { get; set; } + public string OtherCollateralType { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Consumer/QueueResult.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Consumer/QueueResult.cs new file mode 100644 index 0000000..f9d96b9 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Consumer/QueueResult.cs @@ -0,0 +1,11 @@ + +using LCU.Shared.Collections.RepoApiLib.Models.Producer; + +namespace LCU.Shared.Collections.RepoApiLib.Models.Consumer +{ + public class QueueResult + { + public ulong DeliveryTag { get; set; } + public ProcessingReceipt Receipt { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Consumer/RepoRunInfo.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Consumer/RepoRunInfo.cs new file mode 100644 index 0000000..071bfdb --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Consumer/RepoRunInfo.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using LCU.Shared.Collections.RepoApiLib.Models.Producer; + +namespace LCU.Shared.Collections.RepoApiLib.Models.Consumer +{ + public class RepoRunInfo + { + public RepoRunInfo() + { + StartDateTime = DateTime.Now; + Receipts = new List(); + } + + public DateTime StartDateTime { get; private set; } + public DateTime? CompleteDateTime { get; set; } + + public List Receipts { get; private set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Consumer/Vehicle.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Consumer/Vehicle.cs new file mode 100644 index 0000000..c548a05 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Consumer/Vehicle.cs @@ -0,0 +1,20 @@ +namespace LCU.Shared.Collections.RepoApiLib.Models.Consumer +{ + public class Vehicle + { + public string VIN { get; set; } + public int Year { get; set; } + public string Make { get; set; } + public string Model { get; set; } + public string LicensePlate { get; set; } + public string LicenseState { get; set; } + public string CountryLicensed { get; set; } + public int Mileage { get; set; } + public string BodyStyle { get; set; } + public string Color { get; set; } + public string KeyCode { get; set; } + public string SellerName { get; set; } + public decimal LowBookValue { get; set; } + public decimal HighBookValue { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/EnvironmentView.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/EnvironmentView.cs new file mode 100644 index 0000000..7967072 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/EnvironmentView.cs @@ -0,0 +1,33 @@ +using System; +using System.Reflection; +using Microsoft.AspNetCore.Hosting; + +namespace LCU.Shared.Collections.RepoApiLib.Models +{ + public class EnvironmentView : IEnvironmentView + { + public string Application => _env.ApplicationName; + public DateTime CurrentDate => DateTime.Now; + public string BuildVersion => Assembly.GetExecutingAssembly().GetName().Version.ToString(); + public DateTime BuildDate => AssemblyBuildDate(); + public string Environment => _env.EnvironmentName; + private readonly IHostingEnvironment _env; + + public EnvironmentView(IHostingEnvironment env) + { + _env = env; + } + + public static DateTime AssemblyBuildDate() + { + //https://stackoverflow.com/a/804310/266594 + //TODO #246: Look up this value at start up to avoid hitting the filesystem repeatedly + System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly(); + System.IO.FileInfo fileInfo = new System.IO.FileInfo(assembly.Location); + DateTime lastModified = fileInfo.LastWriteTime; + + return lastModified; + } + + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/EventAlert.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/EventAlert.cs new file mode 100644 index 0000000..964b61a --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/EventAlert.cs @@ -0,0 +1,26 @@ +using System; +using System.ComponentModel.DataAnnotations; + +namespace LCU.Shared.Collections.RepoApiLib.Models +{ + public class EventAlert + { + public int Id { get; set; } + public int? RepoId { get; set; } + [Required] + public string AccountNo { get; set; } + [Required] + public DateTime DateAdded { get; set; } + public DateTime? DateMarkedRead { get; set; } + [Required] + [MaxLength(25)] + public string CreatedBy { get; set; } + public string MarkedReadBy { get; set; } + [Required] + public string Message { get; set; } + public int? DayCount { get; set; } + public string SubMessage { get; set; } + public string EmailRecipient { get; set; } + public string EmailBody { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/ExternalUser.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/ExternalUser.cs new file mode 100644 index 0000000..4f18fd3 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/ExternalUser.cs @@ -0,0 +1,19 @@ +using System.ComponentModel.DataAnnotations; + +namespace LCU.Shared.Collections.RepoApiLib.Models +{ + public class ExternalUser + { + [Required] + public int Id { get; set; } + + [Required] + public int ReferenceId { get; set; } + + [Required] + public string Name { get; set; } + + [Required] + public string Code { get; set; } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/FloorPriceCalculationParams.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/FloorPriceCalculationParams.cs new file mode 100644 index 0000000..2d213b1 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/FloorPriceCalculationParams.cs @@ -0,0 +1,13 @@ + +using System.Collections.Generic; +using LCU.Shared.Collections.RepoApiLib.WebServices.NADA; + +namespace LCU.Shared.Collections.RepoApiLib.Models +{ + public class FloorPriceCalculationParams + { + public ImsAutoFileData ImsAutoFileData { get; set; } + public CollateralValuation CollateralValuation { get; set; } + public IEnumerable VehicleFloorPricingParameters { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/FloorPriceCalculationResult.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/FloorPriceCalculationResult.cs new file mode 100644 index 0000000..aa5e2c2 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/FloorPriceCalculationResult.cs @@ -0,0 +1,13 @@ +using System; + +namespace LCU.Shared.Collections.RepoApiLib.Models +{ + public class FloorPriceCalculationResult + { + public string StrategyName { get; set; } + public bool Success { get; set; } + public decimal FloorPrice { get; set; } + public int ResultWeight { get; set; } + public string FailureReason { get; set; } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/FloorPriceCalculationResultSet.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/FloorPriceCalculationResultSet.cs new file mode 100644 index 0000000..3cf2faf --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/FloorPriceCalculationResultSet.cs @@ -0,0 +1,11 @@ +using System.Collections.Generic; + +namespace LCU.Shared.Collections.RepoApiLib.Models +{ + public class FloorPriceCalculationResultSet + { + public FloorPriceCalculationResult PrimaryResult { get; set; } + public IEnumerable AllResults { get; set; } + public FloorPriceValuesUsed FloorPriceValuesUsed { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/FloorPriceValuesUsed.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/FloorPriceValuesUsed.cs new file mode 100644 index 0000000..01e6138 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/FloorPriceValuesUsed.cs @@ -0,0 +1,37 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using LCU.Shared.Collections.RepoApiLib.WebServices.NADA; +using Newtonsoft.Json; + +namespace LCU.Shared.Collections.RepoApiLib.Models +{ + public class FloorPriceValuesUsed + { + [Required] + public int AuctionAssignmentId { get; set; } + [Required] + public int RepoId { get; set; } + [Required] + public int CollateralValuationId { get; set; } + + public decimal? Condition { get; set; } + public decimal LowParam { get; set; } + public decimal HighParam { get; set; } + public decimal PercentageOf { get; set; } + public decimal? AuctionGuideBookPrice { get; set; } + public bool WasAuctionGuideBookPriceUsed { get; set; } + public decimal? MMRNationalAdjustedPrice { get; set; } + public decimal? MMRRegionalAdjustedPrice { get; set; } + public bool WasMMRNationalAdjustedPriceUsed { get; set; } + public bool WasMMRRegionalAdjustedPriceUsed { get; set; } + public int NADALowAdjustedAuctionValue { get; set; } + public int NADAAverageAdjustedAuctionValue { get; set; } + public int NADAHighAdjustedAuctionValue { get; set; } + public bool WasNADALowAdjustedAuctionValueUsed { get; set; } + public bool WasNADAAverageAdjustedAuctionValueUsed { get; set; } + public bool WasNADAHighAdjustedAuctionValueUsed { get; set; } + public decimal? NADAMMRFloorPrice { get; set; } + + public CollateralValuation CollateralValuation { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/IEnvironmentView.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/IEnvironmentView.cs new file mode 100644 index 0000000..06b0bc7 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/IEnvironmentView.cs @@ -0,0 +1,13 @@ +using System; + +namespace LCU.Shared.Collections.RepoApiLib.Models +{ + public interface IEnvironmentView + { + string Application { get; } + DateTime CurrentDate { get; } + string BuildVersion { get; } + DateTime BuildDate { get; } + string Environment { get; } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/ImsAutoFileData.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/ImsAutoFileData.cs new file mode 100644 index 0000000..64c9cd7 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/ImsAutoFileData.cs @@ -0,0 +1,77 @@ +using System; +using System.ComponentModel.DataAnnotations; + +namespace LCU.Shared.Collections.RepoApiLib.Models +{ + public class ImsAutoFileData + { + [Required] + public int RepoId { get; set; } + [Required] + public string VIN { get; set; } + [Required] + public int AuctionAssignmentId { get; set; } + [Required] + public string AuctionCustomerNo { get; set; } + + public DateTime? AssignmentAccepted { get; set; } + public DateTime? DateReceivedFromAutoIMS { get; set; } + public DateTime? ScheduledSaleDate { get; set; } + public DateTime? SoldDate { get; set; } + public string AnnouncedConditions { get; set; } + public string ArbitrationReason { get; set; } + public bool? AsIs100KMiles { get; set; } + public int? AuctionAge { get; set; } + public decimal? AuctionGuideBookPrice { get; set; } + public string BuyerId { get; set; } + public string BuyerName { get; set; } + public decimal? ChargeAmount { get; set; } + public decimal? CheckAmount { get; set; } + public int? ClientAge { get; set; } + public DateTime? ClientCancelled { get; set; } + public string CollisionDamage { get; set; } + public DateTime? InspectedDate { get; set; } + public DateTime? DateofLoss { get; set; } + public DateTime? DatePickedUp { get; set; } + public DateTime? DateEnteredAutoIMS { get; set; } + public int? DaysRun { get; set; } + public string DaysRunHighestBidRecordedbyAuction { get; set; } + public int? DaystoDelivery { get; set; } + public string Description { get; set; } + public bool? IsDrivable { get; set; } + public decimal? FloorPriceAccepted { get; set; } + public DateTime? FundsSent { get; set; } + public decimal? GrossPercentFloor { get; set; } + public decimal? HighestBid { get; set; } + public int? StatedMileage { get; set; } + public decimal? NetPercentFloor { get; set; } + public decimal? OtherAdvanceFees { get; set; } + public string OTHERTotal { get; set; } + public string OTHERAdvancedOther { get; set; } + public string OTHERAdvancedStorage { get; set; } + public string OTHERAdvancedTow { get; set; } + public string OTHERMiscellaneous { get; set; } + public decimal? SalePrice { get; set; } + public string TitleNumber { get; set; } + public DateTime? TitleReceived { get; set; } + public DateTime? TitleReturned { get; set; } + public string TitleState { get; set; } + public string TitleStatus { get; set; } + public string TitleStatusfromAuction { get; set; } + public decimal? TotalCharges { get; set; } + public decimal? ApprovedVehicleGrade { get; set; } + public bool? IsOperable { get; set; } + public DateTime? ShipmentDate { get; set; } + public string Status { get; set; } + public decimal? StorageCost { get; set; } + public decimal? StorageRatePerDay { get; set; } + public decimal? TowCost { get; set; } + public decimal? VehicleDecimalGradeCode { get; set; } + public decimal? VehicleGrade { get; set; } + public decimal? MMRNationalAdjustedPrice { get; set; } + public decimal? MMRRegionalAdjustedPrice { get; set; } + public string MMR { get; set; } + public string ConditionReportLink { get; set; } + public string CollateralImagePath { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Letter.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Letter.cs new file mode 100644 index 0000000..832f232 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Letter.cs @@ -0,0 +1,20 @@ + +namespace LCU.Shared.Collections.RepoApiLib.Models +{ + public class Letter + { + public string ActionCode { get; set; } + + // This is the eventual "This works and the code was written well" solution. + // Once letter codes are in place and agreed upon the alerts can be switched from ActionCode to LetterCode + public string LetterCode { get; set; } + public string Description { get; set; } + public int? DaysToWait { get; set; } + public string WhenLetterIsSent { get; set; } + + // This is currently used to match up descriptions from Temenos history/comments. Used to find if a specific + // ActionCode/LetterCode was sent. + public string LetterDescription { get; set; } + + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/OwnershipType.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/OwnershipType.cs new file mode 100644 index 0000000..2c9a44d --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/OwnershipType.cs @@ -0,0 +1,9 @@ +namespace LCU.Shared.Collections.RepoApiLib.Models +{ + public enum OwnershipType + { + Other = 1, + Coborrower = 3, + Borrower = 6 + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/ProcessingReceipt.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/ProcessingReceipt.cs new file mode 100644 index 0000000..069f983 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/ProcessingReceipt.cs @@ -0,0 +1,37 @@ +using System; +using System.ComponentModel.DataAnnotations; +using LCU.Shared.Collections.RepoApiLib.Models.Producer; + +namespace LCU.Shared.Collections.RepoApiLib.Models +{ + public class ProcessingReceipt + { + public ProcessingReceipt(string accountNo) + { + AccountNo = accountNo; + AccountId = ""; + QueuedBy = "Unknown"; + Message = ""; + Outcome = RepoProcessingResult.Error; + Processed = DateTime.Now; + } + + public string AccountNo { get; protected set; } + + [Required] + public string AccountId { get; set; } + [Required] + public string CaseId { get; set; } + [Required] + [MaxLength(40)] + public string QueuedBy { get; set; } + public RepoProcessingResult Outcome { get; set; } + public string Message { get; set; } + public DateTime Processed { get; set; } + + public string Pretty() + { + return $"Key: {AccountNo}|{AccountId}|{CaseId}|{QueuedBy} -> {Outcome} : {Message}"; + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Producer/ProcessingItem.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Producer/ProcessingItem.cs new file mode 100644 index 0000000..c2513ac --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Producer/ProcessingItem.cs @@ -0,0 +1,18 @@ + +using System; + +namespace LCU.Shared.Collections.RepoApiLib.Models.Producer +{ + public class ProcessingItem + { + public string AccountNo { get; set; } + + public string AccountId { get; set; } + public string CaseId { get; set; } + public string QueuedBy { get; set; } + public string DetermineAuditItemKey() + { + return AccountNo + ":" + CaseId; + } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Producer/RepoProcessingResult.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Producer/RepoProcessingResult.cs new file mode 100644 index 0000000..425ef8a --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Producer/RepoProcessingResult.cs @@ -0,0 +1,13 @@ +namespace LCU.Shared.Collections.RepoApiLib.Models.Producer +{ + public enum RepoProcessingResult + { + Autoclosed, + Unconverted, + Created, + Updated, + Ineligible, + MissingRequirement, + Error + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/RefundStatus.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/RefundStatus.cs new file mode 100644 index 0000000..42578ac --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/RefundStatus.cs @@ -0,0 +1,16 @@ +using System; +using System.ComponentModel.DataAnnotations; + +namespace LCU.Shared.Collections.RepoApiLib.Models +{ + public class RefundStatus + { + [Required] + public int? RepoId { get; set; } + public string WarrantyRefundStatus { get; set; } + public string InsuranceRefundStatus { get; set; } + public string PremiumDefiRefundStatus { get; set; } + public string CPIRefundStatus { get; set; } + public DateTime? RefundsReceivedDate { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/RepoAccount.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/RepoAccount.cs new file mode 100644 index 0000000..e86e881 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/RepoAccount.cs @@ -0,0 +1,58 @@ +using LCU.Shared.Collections.RepoApiLib.Models.Consumer; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace LCU.Shared.Collections.RepoApiLib.Models +{ + public class RepoAccount + { + public int RepoId { get; set; } + [Required] + public string AccountNo { get; set; } + [Required] + public string Status { get; set; } + public long MemberNo { get; set; } + public long LoanNo { get; set; } + public string AccountTypeCode { get; set; } + public string OrigAccountTypeCode { get; set; } + public int? Branch { get; set; } + public string Collector { get; set; } + public decimal? Balance { get; set; } + public DateTime? DueToPayDate { get; set; } + public DateTime? O4RDate { get; set; } + public DateTime? DateFirstDelinquent { get; set; } + public decimal? DelinquentAmount { get; set; } + public int? DaysDelinquent { get; set; } + public decimal? PaidSkipAmount { get; set; } + public string SubStatus { get; set; } + public decimal? RequiredPaymentAmount { get; set; } + public decimal? CurrentDelinquentAmount { get; set; } + public decimal? LstPmtAmt { get; set; } + public decimal? OrigAmount { get; set; } + public DateTime? LastPaymentDate { get; set; } + public DateTime? DateFirstIntellect { get; set; } + public string PrimaryIndividualId { get; set; } + public string Bankruptcy { get; set; } + public DateTime? ManualRedemptionDate { get; set; } + public DateTime? RedemptionExpiredDate { get; set; } + public ICollection Borrowers { get; set; } + public ICollection Collaterals { get; set; } + public ICollection RepoStatusChanges { get; set; } + [ForeignKey("RepoId")] + public RefundStatus RefundStatus { get; set; } + public DateTime? DateClosed { get; set; } + // This should reference + // a CaseId for Temenos. + public int? ReferenceId { get; set; } + public int? ReferenceCaseId { get; set; } + // This is the "Account Status" from Temenos so we can "Watch" it. + public string ReferenceStatus { get; set; } + public DateTime? AccountLastProcessed { get; set; } + public DateTime? WrittenOffDate { get; set; } + public int? SixtyPlusCollectorId { get; set; } + [ForeignKey("SixtyPlusCollectorId")] + public SixtyPlusCollector SixtyPlusCollector { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/RepoCompany.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/RepoCompany.cs new file mode 100644 index 0000000..c3f05ae --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/RepoCompany.cs @@ -0,0 +1,23 @@ +using System; + +namespace LCU.Shared.Collections.RepoApiLib.Models +{ + public class RepoCompany + { + public int ID { get; set; } + + public int? ReferenceId { get; set; } + public string Name { get; set; } + public string Email { get; set; } + public string Address_Line_1 { get; set; } + public string Address_Line_2 { get; set; } + public string City { get; set; } + public string State { get; set; } + public string ZIP { get; set; } + public string Country { get; set; } + public string Phone { get; set; } + public string Fax { get; set; } + public string DisabledBy { get; set; } + public DateTime? DisabledDate { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/RepoCompanySelection.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/RepoCompanySelection.cs new file mode 100644 index 0000000..0493376 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/RepoCompanySelection.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using LCU.API.Collections.CollectionsApiLib.Models; + +namespace LCU.Shared.Collections.RepoApiLib.Models +{ + public class RepoCompanySelection : IValidatableObject + { + public int? Id { get; set; } + + [Required] + public int? CollateralId { get; set; } + + public RepoType RepoType { get; set; } + + public int? RepoCompanyId { get; set; } + + public DateTime? RepoCompanyAssignmentDate { get; set; } + + public DateTime? DateRepoed { get; set; } + + public DateTime? DateTimeCreated { get; set; } + + public IEnumerable Validate(ValidationContext validationContext) + { + var failedValidations = new List(); + + // This cannot be a required field on account of it resulting in a SQL error + if (RepoType == null) + { + failedValidations.Add(new ValidationResult("Repo Company Selection: The RepoType cannot be blank")); + } + + if (RepoCompanyAssignmentDate > DateRepoed) + { + failedValidations.Add(new ValidationResult("Repo Company Selection: The date repoed cannot come before the date assigned.")); + } + + if (RepoCompanyId != null && RepoCompanyAssignmentDate == null) + { + failedValidations.Add(new ValidationResult("Repo Company Selection: The Repo Company Assignment date cannot be null when a Repo Company is set.")); + } + + return failedValidations; + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/RepoLetter.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/RepoLetter.cs new file mode 100644 index 0000000..de1fdc6 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/RepoLetter.cs @@ -0,0 +1,14 @@ +using System; + +namespace LCU.Shared.Collections.RepoApiLib.Models +{ + public class RepoLetter + { + public string NoticeType { get; set; } + public DateTime DateSent { get; set; } + public DateTime DateExpired { get; set; } + public int DaysToRedeem { get; set; } + public string ActionCode { get; set; } + + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/RepoManualStatus.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/RepoManualStatus.cs new file mode 100644 index 0000000..e0ad76c --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/RepoManualStatus.cs @@ -0,0 +1,16 @@ +using System.ComponentModel.DataAnnotations; + +namespace LCU.Shared.Collections.RepoApiLib.Models +{ + public class RepoManualStatus + { + [Required] + public int ID { get; set; } + [Required] + public string Description { get; set; } + [Required] + public bool IsActiveStatus { get; set; } + [Required] + public bool WatchForStatusChanges { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/RepoStatusChange.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/RepoStatusChange.cs new file mode 100644 index 0000000..d5b5b72 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/RepoStatusChange.cs @@ -0,0 +1,28 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using Newtonsoft.Json; + +namespace LCU.Shared.Collections.RepoApiLib.Models +{ + public class RepoStatusChange + { + [Required] + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public int Id { get; set; } + [Required] + public int RepoId { get; set; } + [Required] + public string StatusFrom { get; set; } + [Required] + public string StatusTo { get; set; } + [Required] + public string ChangedBy { get; set; } + [Required] + public DateTime ChangedDate { get; set; } + + [ForeignKey("RepoId")] + [JsonIgnore] + public RepoAccount RepoAccount { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Reporting/LandmarkReportAccountEntry.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Reporting/LandmarkReportAccountEntry.cs new file mode 100644 index 0000000..410822a --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Reporting/LandmarkReportAccountEntry.cs @@ -0,0 +1,47 @@ +using System; + +namespace LCU.Shared.Collections.RepoApiLib.Models.Reporting +{ + public class LandmarkReportAccountEntry + { + // Repo + public int RepoId { get; set; } + public string AccountNo { get; set; } + public decimal? Balance { get; set; } + public int? DaysDelinquent { get; set; } + public DateTime? LastPaymentDate { get; set; } + public decimal? LastPaymentAmount { get; set; } + public string AccountTypeCode { get; set; } + public string Bankruptcy { get; set; } + public decimal? DelinquentAmount { get; set; } + public string Collector { get; set; } + public DateTime? DateClosed { get; set; } + // Borrower + public string IndividualName { get; set; } + // Collateral + public string Make { get; set; } + public string Model { get; set; } + public int? Year { get; set; } + // RepoCompanySelection + public string RepoCompany { get; set; } + public DateTime? DateRepoed { get; set; } + public string RepoType { get; set; } + public DateTime? DateAssigned { get; set; } + // RepoStatusChange + public string Status { get; set; } + public int? DaysInStatus { get; set; } + // IMSAutoFile Data + public DateTime? SoldDate { get; set; } + public DateTime? DateEnteredAutoIMS { get; set; } + public DateTime? ScheduledSaleDate { get; set; } + public decimal? FloorPrice { get; set; } + public decimal? Grade { get; set; } + // Auction and AuctionAssignments + public string AuctionHouse { get; set; } + public DateTime? AuctionDate { get; set; } + public decimal? TotalCharges { get; set; } + public decimal? GrossPercentFloor { get; set; } + public decimal? NetPercentFloor { get; set; } + public decimal? GrossSalePrice { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Reporting/Responses/DataTable.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Reporting/Responses/DataTable.cs new file mode 100644 index 0000000..2063fa9 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Reporting/Responses/DataTable.cs @@ -0,0 +1,10 @@ +using System.Collections.Generic; + +namespace LCU.Shared.Collections.RepoApiLib.Models.Reporting.Responses +{ + public class DataTable + { + public string[] Headers { get; set; } + public IEnumerable Rows { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Reporting/Responses/RepoAccountReferenceRow.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Reporting/Responses/RepoAccountReferenceRow.cs new file mode 100644 index 0000000..55987e4 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Reporting/Responses/RepoAccountReferenceRow.cs @@ -0,0 +1,8 @@ +namespace LCU.Shared.Collections.RepoApiLib.Models.Reporting.Responses +{ + public class RepoAccountReferenceRow + { + public int RepoId { get; set; } + public ReportCell[] Cells { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Reporting/Responses/ReportCell.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Reporting/Responses/ReportCell.cs new file mode 100644 index 0000000..63f4bee --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Reporting/Responses/ReportCell.cs @@ -0,0 +1,8 @@ +namespace LCU.Shared.Collections.RepoApiLib.Models.Reporting.Responses +{ + public class ReportCell + { + public string Display { get; set; } + public object Value { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Reporting/Responses/ReportTable.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Reporting/Responses/ReportTable.cs new file mode 100644 index 0000000..2a7bb70 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Reporting/Responses/ReportTable.cs @@ -0,0 +1,8 @@ +namespace LCU.Shared.Collections.RepoApiLib.Models.Reporting.Responses +{ + public class ReportTable + { + public string[] Headers { get; set; } + public ReportCell[,] Cells { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Reporting/Responses/ReportTableResponse.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Reporting/Responses/ReportTableResponse.cs new file mode 100644 index 0000000..3d1e7d8 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Reporting/Responses/ReportTableResponse.cs @@ -0,0 +1,8 @@ +namespace LCU.Shared.Collections.RepoApiLib.Models.Reporting.Responses +{ + public class ReportTableResponse + { + public ReportTable ReportTable { get; set; } + public DataTable DataTable { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Reporting/StdReportEntry.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Reporting/StdReportEntry.cs new file mode 100644 index 0000000..133ecff --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Reporting/StdReportEntry.cs @@ -0,0 +1,53 @@ +using System; + +namespace LCU.Shared.Collections.RepoApiLib.Models.Reporting +{ + public class StdReportEntry + { + // Repo + public int RepoId { get; set; } + public string AccountNo { get; set; } + public string AccountTypeCode { get; set; } + public decimal Balance { get; set; } + public string Status { get; set; } + public int DaysInStatus { get; set; } + public string Bankruptcy { get; set; } + public string Collector { get; set; } + public int? DaysCurrentDelq { get; set; } + public int? DaysDelqWhenAdded { get; set; } + public decimal? DelinquentAmount { get; set; } + public decimal? LastPaymentAmount { get; set; } + public DateTime? LastPaymentDate { get; set; } + public string FilteredStatus { get; set; } + public DateTime? FilteredStatusChangeDate { get; set; } + public DateTime? O4RDate { get; set; } + // Auction Assignment + public string AuctionId { get; set; } + public string AuctionName { get; set; } + // Collateral + public int CollateralId { get; set; } + public int? RepoCompanyId { get; set; } + public string RepoCompany { get; set; } + public string RepoType { get; set; } + public DateTime? RepoCompanyAssignmentDate { get; set; } + public DateTime? DateRepoed { get; set; } + public int? RepoDuration { get; set; } + public int? Year { get; set; } + public string Make { get; set; } + public string Model { get; set; } + // IMSAutoFile Data + public string AutoImsStatus { get; set; } + public DateTime? SoldDate { get; set; } + public DateTime? DateEnteredAutoIMS { get; set; } + public DateTime? ScheduledSaleDate { get; set; } + public decimal? GrossPercentFloor { get; set; } + public decimal? NetPercentFloor { get; set; } + public decimal? TotalCharges { get; set; } + public decimal? Grade { get; set; } + public decimal? FloorPrice { get; set; } + public decimal? GrossSalePrice { get; set; } + // Borrower + public string IndividualName { get; set; } + } + +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Results/AuctionData.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Results/AuctionData.cs new file mode 100644 index 0000000..eb29a64 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Results/AuctionData.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace LCU.Shared.Collections.RepoApiLib.Models.Results +{ + public class AuctionData + { + public int LowAuction { get; set; } + public int AvgAuction { get; set; } + public int HighAuction { get; set; } + public string DateRange { get; set; } + public object AuctionAccessories { get; set; } + public string AcceptableMileage { get; set; } + public string RatePerMile { get; set; } + public string MileageAdjust { get; set; } + public string MinAuctionValue { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Results/AuctionInformation.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Results/AuctionInformation.cs new file mode 100644 index 0000000..c5fe2d8 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Results/AuctionInformation.cs @@ -0,0 +1,13 @@ +using System.Collections.Generic; + +namespace LCU.Shared.Collections.RepoApiLib.Models.Results +{ + public class AuctionInformation + { + public string RequestId { get; set; } + public List Result { get; set; } + public string Userinfo { get; set; } + public string Error { get; set; } + public string AuthId { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Results/PagedResult.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Results/PagedResult.cs new file mode 100644 index 0000000..ef19bfe --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Results/PagedResult.cs @@ -0,0 +1,10 @@ +using System.Collections.Generic; + +namespace LCU.Shared.Collections.RepoApiLib.Models.Results +{ + public class PagedResult where T : class + { + public IEnumerable Items { get; set; } + public int Total { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Results/VehicleData.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Results/VehicleData.cs new file mode 100644 index 0000000..1b4f54d --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Results/VehicleData.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace LCU.Shared.Collections.RepoApiLib.Models.Results +{ + public class VehicleData + { + public int Modelyear { get; set; } + public string Make { get; set; } + public string Model { get; set; } + public string Body { get; set; } + public int Ucgvehicleid { get; set; } + public string Vehicletype { get; set; } + public string Mileageclass { get; set; } + public string Basemsrp { get; set; } + public string Bodytype { get; set; } + public string Doors { get; set; } + public string Trim { get; set; } + public string Trim2 { get; set; } + public string Drivetype { get; set; } + public string Liters { get; set; } + public string Engineconfiguration { get; set; } + public string Cylinders { get; set; } + public string Inductiontype { get; set; } + public string Transmission { get; set; } + public string Fueltype { get; set; } + public string Wheels { get; set; } + public string Curbweight { get; set; } + public string Gvw { get; set; } + public string Gcw { get; set; } + public string Ucgsubsegment { get; set; } + public string Modelnumber { get; set; } + public int Rollupvehicleid { get; set; } + public int Basecleantrade { get; set; } + public int Baseaveragetrade { get; set; } + public int Baseroughtrade { get; set; } + public int Basecleanretail { get; set; } + public int Baseloan { get; set; } + public int Averagemileage { get; set; } + public int Mileageadjustment { get; set; } + public int Vinoptionstrade { get; set; } + public int Vinoptionsretail { get; set; } + public int Vinoptionsloan { get; set; } + public int Adjustedcleantrade { get; set; } + public int Adjustedaveragetrade { get; set; } + public int Adjustedroughtrade { get; set; } + public int Adjustedcleanretail { get; set; } + public int Adjustedloan { get; set; } + public int Maxmileageadj { get; set; } + public int Minmileageadj { get; set; } + public int Minadjretail { get; set; } + public int Minadjcleantrade { get; set; } + public int Minadjaveragetrade { get; set; } + public int Minadjroughtrade { get; set; } + public int Minadjloan { get; set; } + public int Minadjretailforloan { get; set; } + public int Vid { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Results/VehicleInformation.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Results/VehicleInformation.cs new file mode 100644 index 0000000..026c87f --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Results/VehicleInformation.cs @@ -0,0 +1,13 @@ +using System.Collections.Generic; + +namespace LCU.Shared.Collections.RepoApiLib.Models.Results +{ + public class VehicleInformation + { + public string RequestId { get; set; } + public List Result { get; set; } + public string Userinfo { get; set; } + private string AdjustedMileage { get; set; } + private string AuthId { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/SavedLocation.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/SavedLocation.cs new file mode 100644 index 0000000..83eb549 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/SavedLocation.cs @@ -0,0 +1,35 @@ +using System.ComponentModel.DataAnnotations; + +namespace LCU.Shared.Collections.RepoApiLib.Models +{ + public class SavedLocation + { + public int ID { get; set; } + + [Required] + public string Name { get; set; } + + [Required] + public int? LocationType { get; set; } + + [Required] + public string Address_Line_1 { get; set; } + + public string Address_Line_2 { get; set; } + + [Required] + public string City { get; set; } + + [Required] + public string State { get; set; } + + [Required] + public string ZIP { get; set; } + + public string Country { get; set; } + + public string Phone { get; set; } + + public string Fax { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Settings/AccountType.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Settings/AccountType.cs new file mode 100644 index 0000000..0cbcd81 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Settings/AccountType.cs @@ -0,0 +1,23 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using Newtonsoft.Json; + +namespace LCU.Shared.Collections.RepoApiLib.Models.Settings +{ + public class AccountType + { + [Required] + public int ID { get; set; } + [Required] + public string AccountTypeCode { get; set; } + [Required] + public string Description { get; set; } + [Required] + public bool IsVisible { get; set; } + public int? CategoryId { get; set; } + + [ForeignKey("ID")] + [JsonIgnore] + public LoanCategory LoanCategories { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Settings/AllowedStatusChange.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Settings/AllowedStatusChange.cs new file mode 100644 index 0000000..352d42c --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Settings/AllowedStatusChange.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Threading.Tasks; + +namespace LCU.Shared.Collections.RepoApiLib.Models.Settings +{ + public class AllowedStatusChange + { + [Required] + public int ID { get; set; } + [Required] + public string CurrentStatus { get; set; } + [Required] + public string AllowedChangeStatus { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Settings/BodyStyle.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Settings/BodyStyle.cs new file mode 100644 index 0000000..fa70374 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Settings/BodyStyle.cs @@ -0,0 +1,12 @@ +using System.ComponentModel.DataAnnotations; + +namespace LCU.Shared.Collections.RepoApiLib.Models.Settings +{ + public class BodyStyle + { + [Required] + public string Code { get; set; } + [Required] + public string Description { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Settings/BranchEntry.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Settings/BranchEntry.cs new file mode 100644 index 0000000..7e58acd --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Settings/BranchEntry.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace LCU.Shared.Collections.RepoApiLib.Models.Settings +{ + public class BranchEntry + { + public string BranchId { get; set; } + public string BranchName { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Settings/CleaningLevel.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Settings/CleaningLevel.cs new file mode 100644 index 0000000..fbb6633 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Settings/CleaningLevel.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Threading.Tasks; + +namespace LCU.Shared.Collections.RepoApiLib.Models.Settings +{ + public class CleaningLevel + { + [Required] + public int Code { get; set; } + [Required] + public string Description { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Settings/CollateralType.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Settings/CollateralType.cs new file mode 100644 index 0000000..ff4ccd5 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Settings/CollateralType.cs @@ -0,0 +1,14 @@ +using System.ComponentModel.DataAnnotations; + +namespace LCU.Shared.Collections.RepoApiLib.Models.Settings +{ + public class CollateralType + { + [Required] + public int ID { get; set; } + [Required] + public string Description { get; set; } + [Required] + public string LookupHandler { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Settings/CollateralTypeToVehicleType.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Settings/CollateralTypeToVehicleType.cs new file mode 100644 index 0000000..5e1b116 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Settings/CollateralTypeToVehicleType.cs @@ -0,0 +1,14 @@ +using System.ComponentModel.DataAnnotations; + +namespace LCU.Shared.Collections.RepoApiLib.Models.Settings +{ + public class CollateralTypeToVehicleType + { + [Required] + public int ID { get; set; } + [Required] + public int CollateralTypeId { get; set; } + [Required] + public int VehicleTypeId { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Settings/HoldStatus.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Settings/HoldStatus.cs new file mode 100644 index 0000000..3574b13 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Settings/HoldStatus.cs @@ -0,0 +1,12 @@ +using System.ComponentModel.DataAnnotations; + +namespace LCU.Shared.Collections.RepoApiLib.Models.Settings +{ + public class HoldStatus + { + [Required] + public int Code { get; set; } + [Required] + public string Description { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Settings/LoanCategory.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Settings/LoanCategory.cs new file mode 100644 index 0000000..7e83a4d --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Settings/LoanCategory.cs @@ -0,0 +1,12 @@ +using System.ComponentModel.DataAnnotations; + +namespace LCU.Shared.Collections.RepoApiLib.Models.Settings +{ + public class LoanCategory + { + [Required] + public int ID { get; set; } + [Required] + public string CategoryName { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Settings/LocationType.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Settings/LocationType.cs new file mode 100644 index 0000000..3b3128a --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Settings/LocationType.cs @@ -0,0 +1,12 @@ +using System.ComponentModel.DataAnnotations; + +namespace LCU.Shared.Collections.RepoApiLib.Models.Settings +{ + public class LocationType + { + [Required] + public int Code { get; set; } + [Required] + public string Description { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Settings/Settings.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Settings/Settings.cs new file mode 100644 index 0000000..23eef3a --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Settings/Settings.cs @@ -0,0 +1,26 @@ +using System.Collections.Generic; + +namespace LCU.Shared.Collections.RepoApiLib.Models.Settings +{ + public class Settings + { + public IEnumerable AccountTypes { get; set; } + public IEnumerable AllowedStatusChanges { get; set; } + public IEnumerable BodyStyles { get; set; } + public IEnumerable CleaningLevels { get; set; } + public IEnumerable CollateralTypes { get; set; } + public IEnumerable CollateralTypesToVehicleTypes { get; set; } + public IEnumerable HoldStatuses { get; set; } + public IEnumerable LoanCategories { get; set; } + public IEnumerable LocationTypes { get; set; } + public IEnumerable VehicleTypes { get; set; } + public IEnumerable BranchSet { get; set; } + public IReadOnlyCollection ExternalUsers { get; set; } + public IReadOnlyCollection RepoCompanies { get; set; } + public IReadOnlyCollection TransactionTypeCodes { get; set; } + public string TransactionTypeCodeQueryPrefix { get; set; } + public string TransactionHistoryParameterDateFormat { get; set; } + public int TransactionHistoryStartDateOffset { get; set; } + public IReadOnlyDictionary RepoTypeMap { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Settings/VehicleType.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Settings/VehicleType.cs new file mode 100644 index 0000000..575cacb --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/Settings/VehicleType.cs @@ -0,0 +1,12 @@ +using System.ComponentModel.DataAnnotations; + +namespace LCU.Shared.Collections.RepoApiLib.Models.Settings +{ + public class VehicleType + { + [Required] + public string Code { get; set; } + [Required] + public string Description { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/SixtyPlusCollector.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/SixtyPlusCollector.cs new file mode 100644 index 0000000..0cc90f9 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/SixtyPlusCollector.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Text; + +namespace LCU.Shared.Collections.RepoApiLib.Models +{ + public class SixtyPlusCollector + { + [Required] + public int SixtyPlusCollectorId { get; set; } + [Required] + public string SixtyPlusCollectorName { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/VehicleFloorPricingParameters.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/VehicleFloorPricingParameters.cs new file mode 100644 index 0000000..e5eca99 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Models/VehicleFloorPricingParameters.cs @@ -0,0 +1,17 @@ +using System.ComponentModel.DataAnnotations; + +namespace LCU.Shared.Collections.RepoApiLib.Models +{ + public class VehicleFloorPricingParameters + { + [Required] + public int Id { get; set; } + public decimal LowCondition { get; set; } + public decimal HighCondition { get; set; } + public string NADAFirstValue { get; set; } + public string NADASecondValue { get; set; } + public string MMRAdjustedValue { get; set; } + public decimal PercentageOf { get; set; } + public int ValuationServiceType { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Persistence/AppDbContext.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Persistence/AppDbContext.cs new file mode 100644 index 0000000..c7bd2f8 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Persistence/AppDbContext.cs @@ -0,0 +1,447 @@ +using System; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.Producer; +using LCU.Shared.Collections.RepoApiLib.Models.Reporting; +using LCU.Shared.Collections.RepoApiLib.Models.Settings; +using LCU.Shared.Collections.RepoApiLib.WebServices.NADA; +using LCU.API.Collections.CollectionsApiLib.Models; +using Microsoft.EntityFrameworkCore; + +namespace LCU.Shared.Collections.RepoApiLib.Persistence +{ + public class AppDbContext : DbContext + { + public DbSet AccountTypeCodes { get; set; } + public DbSet AllowedStatusChanges { get; set; } + public DbSet Auctions { get; set; } + public DbSet AuctionAssignments { get; set; } + public DbSet AuctionAssignmentNotes { get; set; } + public DbSet AuditRecords { get; set; } + public DbSet BodyStyleCodes { get; set; } + public DbSet Borrowers { get; set; } + public DbSet CleaningLevelCodes { get; set; } + public DbSet Collaterals { get; set; } + public DbSet CollateralTypes { get; set; } + public DbSet CollateralTypesToVehicleTypes { get; set; } + public DbSet EventAlerts { get; set; } + public DbSet FloorPriceValuesUsed { get; set; } + public DbSet HoldStatusCodes { get; set; } + public DbSet ImsAutoFileData { get; set; } + public DbSet Letters { get; set; } + public DbSet LoanCategories { get; set; } + public DbSet LocationTypeCodes { get; set; } + public DbSet ProcessingReceipts { get; set; } + public DbSet RepoAccounts { get; set; } + public DbSet RepoCompanies { get; set; } + public DbSet RepoManualStatuses { get; set; } + public DbSet RepoStatusChanges { get; set; } + public DbSet VehicleTypeCodes { get; set; } + public DbSet VehicleFloorPricingParameters { get; set; } + public DbSet RefundStatuses { get; set; } + public DbSet AuctionAssignmentToCollaterals { get; set; } + public DbSet RepoCompanySelections { get; set; } + public DbSet SavedLocations { get; set; } + + public DbSet ExternalUsers { get; set; } + public DbSet SixtyPLusCollectors { get; set; } + + // Queries for Reporting / etc + public DbQuery StandardReportEntries { get; set; } + public DbQuery ActiveAccountEntries { get; set; } + + public AppDbContext(DbContextOptions options) : base(options) + { + } + + protected override void OnModelCreating(ModelBuilder builder) + { + base.OnModelCreating(builder); + + builder.Entity().ToTable("EventAlert"); + builder.Entity().HasKey(p => p.Id); + builder.Entity().Property(p => p.Id).IsRequired().ValueGeneratedOnAdd(); + builder.Entity().Property(p => p.AccountNo).IsRequired(); + builder.Entity().Property(p => p.DateAdded).IsRequired().ValueGeneratedOnAdd(); + builder.Entity().Property(p => p.CreatedBy).IsRequired().HasMaxLength(25); + builder.Entity().Property(p => p.Message).IsRequired(); + builder.Entity().Property(p => p.EmailRecipient); + builder.Entity().Property(p => p.EmailBody); + + builder.Entity().ToTable("Borrowers"); + builder.Entity().HasKey(p => new {p.RepoId, p.IndividualId}); + builder.Entity().Property(p => p.IndividualName).IsRequired(); + builder.Entity().Property(p => p.OwnershipType).IsRequired(); + + builder.Entity().ToTable("ProcessingReceipt"); + builder.Entity().HasKey(p => new { p.AccountNo, p.AccountId, p.CaseId }); + builder.Entity().Property(p => p.AccountId); + builder.Entity().Property(p => p.CaseId); + builder.Entity().Property(p => p.QueuedBy); + builder.Entity().Property(p => p.Message); + //TODO: DO this for repocompanyselection repo type + builder.Entity().Property(p => p.Outcome) + .HasConversion(x => x.ToString(), + x => (RepoProcessingResult) Enum.Parse(typeof(RepoProcessingResult), x)); + builder.Entity().Property(p => p.Processed); + + builder.Entity().ToTable("Repos"); + builder.Entity().HasKey(p => p.RepoId); + builder.Entity().Property(p => p.RepoId).IsRequired().ValueGeneratedOnAdd(); + builder.Entity().Property(p => p.AccountNo).IsRequired(); + builder.Entity().Property(p => p.Status).IsRequired(); + builder.Entity().Property(p => p.SubStatus); + builder.Entity().HasMany(p => p.Borrowers); + builder.Entity().HasMany(p => p.Collaterals); + builder.Entity().HasMany(p => p.RepoStatusChanges); + builder.Entity().OwnsOne(p => p.RefundStatus); + builder.Entity().Property(p => p.RedemptionExpiredDate); + builder.Entity().HasOne(p => p.SixtyPlusCollector); + + builder.Entity().ToTable("RepoStatusChanges"); + builder.Entity().HasKey(p => new {p.RepoId, p.Id}); + builder.Entity().Property(p => p.RepoId).IsRequired(); + builder.Entity().Property(p => p.StatusFrom).IsRequired(); + builder.Entity().Property(p => p.StatusTo).IsRequired(); + builder.Entity().Property(p => p.ChangedBy).IsRequired(); + builder.Entity().Property(p => p.ChangedDate).IsRequired().ValueGeneratedOnAdd(); + + builder.Entity().ToTable("AuditTable"); + builder.Entity().HasKey(p => p.ID); + builder.Entity().Property(p => p.DatePerformed).IsRequired().ValueGeneratedOnAdd(); + builder.Entity().Property(p => p.Description).IsRequired(); + builder.Entity().Property(p => p.Action).IsRequired(); + builder.Entity().Property(p => p.ClassName).IsRequired(); + builder.Entity().Property(p => p.PerformedBy).IsRequired(); + builder.Entity().Property(p => p.KeyRepresentation).IsRequired(); + builder.Entity().Property(p => p.PropertyValues); + + builder.Entity().ToTable("Collaterals"); + builder.Entity().HasKey(p => p.CollateralId); + builder.Entity().Property(p => p.CollateralId).IsRequired().ValueGeneratedOnAdd(); + builder.Entity().Property(p => p.RepoId).IsRequired(); + builder.Entity().Property(p => p.Vin); + builder.Entity().Property(p => p.Make); + builder.Entity().Property(p => p.Model); + builder.Entity().Property(p => p.Year); + builder.Entity().Property(p => p.Description); + builder.Entity().Property(p => p.VehicleType); + builder.Entity().Property(p => p.BodyStyle); + builder.Entity().Property(p => p.Inoperable); + builder.Entity().Property(p => p.CollateralTypeId); + builder.Entity().Property(p => p.RetitledInLandmarkName); + builder.Entity().Property(p => p.RefCollateralId); + builder.Entity().HasMany(p => p.AuctionAssignmentToCollaterals); + builder.Entity().HasMany(p => p.RepoCompanySelections); + + builder.Entity().ToTable("RepoManualStatus"); + builder.Entity().HasKey(p => p.ID); + builder.Entity().Property(p => p.ID).IsRequired().ValueGeneratedOnAdd(); + builder.Entity().Property(p => p.Description).IsRequired(); + builder.Entity().Property(p => p.IsActiveStatus).IsRequired(); + builder.Entity().Property(p => p.WatchForStatusChanges).IsRequired(); + + builder.Entity().ToTable("AccountTypeCodes"); + builder.Entity().HasKey(p => p.ID); + builder.Entity().Property(p => p.ID).IsRequired().ValueGeneratedOnAdd(); + builder.Entity().Property(p => p.Description).IsRequired(); + builder.Entity().Property(p => p.IsVisible).IsRequired(); + builder.Entity().Property(p => p.CategoryId); + + builder.Entity().ToTable("AllowedStatusChanges"); + builder.Entity().HasKey(p => p.ID); + builder.Entity().Property(p => p.ID).IsRequired().ValueGeneratedOnAdd(); + builder.Entity().Property(p => p.CurrentStatus).IsRequired(); + builder.Entity().Property(p => p.AllowedChangeStatus).IsRequired(); + + builder.Entity().ToTable("BodyStyleCodes"); + builder.Entity().HasKey(p => p.Code); + builder.Entity().Property(p => p.Code).IsRequired(); + builder.Entity().Property(p => p.Description).IsRequired(); + + builder.Entity().ToTable("CleaningLevelCodes"); + builder.Entity().HasKey(p => p.Code); + builder.Entity().Property(p => p.Code).IsRequired(); + builder.Entity().Property(p => p.Description).IsRequired(); + + builder.Entity().ToTable("CollateralTypes"); + builder.Entity().HasKey(p => p.ID); + builder.Entity().Property(p => p.ID).IsRequired().ValueGeneratedOnAdd(); + builder.Entity().Property(p => p.Description).IsRequired(); + builder.Entity().Property(p => p.LookupHandler).IsRequired(); + + builder.Entity().ToTable("HoldStatusCodes"); + builder.Entity().HasKey(p => p.Code); + builder.Entity().Property(p => p.Code).IsRequired(); + builder.Entity().Property(p => p.Description).IsRequired(); + + builder.Entity().ToTable("LoanCategories"); + builder.Entity().HasKey(p => p.ID); + builder.Entity().Property(p => p.ID).IsRequired().ValueGeneratedOnAdd(); + builder.Entity().Property(p => p.CategoryName).IsRequired(); + + builder.Entity().ToTable("LocationTypeCodes"); + builder.Entity().HasKey(p => p.Code); + builder.Entity().Property(p => p.Code).IsRequired(); + builder.Entity().Property(p => p.Description).IsRequired(); + + builder.Entity().ToTable("VehicleTypeCodes"); + builder.Entity().HasKey(p => p.Code); + builder.Entity().Property(p => p.Code).IsRequired(); + builder.Entity().Property(p => p.Description).IsRequired(); + + builder.Entity().ToTable("CollateralTypesToVehicleTypes"); + builder.Entity().HasKey(p => p.ID); + builder.Entity().Property(p => p.ID).IsRequired().ValueGeneratedOnAdd(); + builder.Entity().Property(p => p.VehicleTypeId).IsRequired(); + + builder.Entity().ToTable("VehicleFloorPricingParameters"); + builder.Entity().HasKey(p => p.Id); + builder.Entity().Property(p => p.Id).IsRequired().ValueGeneratedOnAdd(); + builder.Entity().Property(p => p.LowCondition).IsRequired(); + builder.Entity().Property(p => p.HighCondition).IsRequired(); + builder.Entity().Property(p => p.NADAFirstValue).IsRequired(); + builder.Entity().Property(p => p.NADASecondValue).IsRequired(); + builder.Entity().Property(p => p.MMRAdjustedValue).IsRequired(); + builder.Entity().Property(p => p.PercentageOf).IsRequired(); + builder.Entity().Property(p => p.ValuationServiceType).IsRequired(); + + builder.Entity().ToTable("Letters"); + builder.Entity().HasKey(p => p.ActionCode); + builder.Entity().Property(p => p.Description).IsRequired(); + builder.Entity().Property(p => p.DaysToWait); + builder.Entity().Property(p => p.WhenLetterIsSent); + + builder.Entity().ToTable("FloorPriceValuesUsed"); + builder.Entity().HasKey(p => new { p.AuctionAssignmentId, p.CollateralValuationId }); + builder.Entity().Property(p => p.AuctionAssignmentId).IsRequired(); + builder.Entity().Property(p => p.RepoId).IsRequired(); + builder.Entity().Property(p => p.CollateralValuationId).IsRequired(); + builder.Entity().Property(p => p.Condition); + builder.Entity().Property(p => p.LowParam); + builder.Entity().Property(p => p.HighParam); + builder.Entity().Property(p => p.PercentageOf); + builder.Entity().Property(p => p.AuctionGuideBookPrice); + builder.Entity().Property(p => p.WasAuctionGuideBookPriceUsed); + builder.Entity().Property(p => p.MMRNationalAdjustedPrice); + builder.Entity().Property(p => p.MMRRegionalAdjustedPrice); + builder.Entity().Property(p => p.WasMMRNationalAdjustedPriceUsed); + builder.Entity().Property(p => p.WasMMRRegionalAdjustedPriceUsed); + builder.Entity().Property(p => p.NADALowAdjustedAuctionValue); + builder.Entity().Property(p => p.NADAAverageAdjustedAuctionValue); + builder.Entity().Property(p => p.NADAHighAdjustedAuctionValue); + builder.Entity().Property(p => p.WasNADALowAdjustedAuctionValueUsed); + builder.Entity().Property(p => p.WasNADAAverageAdjustedAuctionValueUsed); + builder.Entity().Property(p => p.WasNADAHighAdjustedAuctionValueUsed); + builder.Entity().Property(p => p.NADAMMRFloorPrice); + builder.Entity().HasOne(p => p.CollateralValuation); + + builder.Entity().ToTable("CollateralValuations"); + builder.Entity().HasKey(p => p.Id); + builder.Entity().Property(p => p.Id).IsRequired().ValueGeneratedOnAdd(); + builder.Entity().Property(p => p.Make).IsRequired(); + builder.Entity().Property(p => p.Model).IsRequired(); + builder.Entity().Property(p => p.Uid).IsRequired(); + builder.Entity().Property(p => p.UcgVehicleId).IsRequired(); + builder.Entity().Property(p => p.LookupDate); + builder.Entity().Property(p => p.Mileage_Hours); + builder.Entity().Property(p => p.MakeCode); + builder.Entity().Property(p => p.MakeDescription); + builder.Entity().Property(p => p.SeriesCode); + builder.Entity().Property(p => p.SeriesDescription); + builder.Entity().Property(p => p.BodyCode); + builder.Entity().Property(p => p.BodyDescription); + builder.Entity().Property(p => p.Weight); + builder.Entity().Property(p => p.Msrp); + builder.Entity().Property(p => p.AveMileage); + builder.Entity().Property(p => p.MileageAdjustment); + builder.Entity().Property(p => p.AuctionInfoUnavailable); + builder.Entity().Property(p => p.LowAdjustedAuctionValue); + builder.Entity().Property(p => p.AverageAdjustedAuctionValue); + builder.Entity().Property(p => p.HighAdjustedAuctionValue); + builder.Entity().Property(p => p.DateRange); + builder.Entity().Property(p => p.Loan); + builder.Entity().Property(p => p.LoanPlusVinAcc); + builder.Entity().Property(p => p.LoanPlusVinAccMileage); + builder.Entity().Property(p => p.Retail); + builder.Entity().Property(p => p.RetailPlusVinAcc); + builder.Entity().Property(p => p.RetailPlusVinAccMileage); + builder.Entity().Property(p => p.AvgTradeIn); + builder.Entity().Property(p => p.AvgTradeInPlusVinAcc); + builder.Entity().Property(p => p.AvgTradeInPlusVinAccMileage); + builder.Entity().Property(p => p.RoughTradeIn); + builder.Entity().Property(p => p.RoughTradeInPlusVinAcc); + builder.Entity().Property(p => p.RoughTradeInPlusVinAccMileage); + builder.Entity().Property(p => p.TradeIn); + builder.Entity().Property(p => p.TradeInPlusVinAcc); + builder.Entity().Property(p => p.TradeInPlusVinAccMileage); + + // Only added code-referenced fields for below entities + builder.Entity().ToTable("Auctions"); + builder.Entity().HasKey(p => p.AuctionID); + builder.Entity().Property(p => p.AuctionID).IsRequired(); + builder.Entity().Property(p => p.Name); + builder.Entity().Property(p => p.Active); + builder.Entity().Property(p => p.Address_Line_1); + builder.Entity().Property(p => p.Address_Line_2); + builder.Entity().Property(p => p.City); + builder.Entity().Property(p => p.Country); + builder.Entity().Property(p => p.Fax); + builder.Entity().Property(p => p.Latitude); + builder.Entity().Property(p => p.Longitude); + builder.Entity().Property(p => p.Phone); + builder.Entity().Property(p => p.State); + builder.Entity().Property(p => p.ZIP); + + builder.Entity().ToTable("AuctionAssignments"); + builder.Entity().HasKey(p => p.ID); + builder.Entity().Property(p => p.ID).IsRequired().ValueGeneratedOnAdd(); + builder.Entity().Property(p => p.AuctionId).IsRequired(); + builder.Entity().Property(p => p.AuctionCustomerNo).IsRequired(); + builder.Entity().Property(p => p.CollateralVIN); + builder.Entity().Property(p => p.DateSubmitted); + builder.Entity().Property(p => p.FloorPrice); + builder.Entity().Property(p => p.FloorPriceResponseCode); + builder.Entity().Property(p => p.FloorPriceResponseDescription); + builder.Entity().Property(p => p.FloorPriceSubmissionErrors); + builder.Entity().Property(p => p.HoldStatus); + builder.Entity().Property(p => p.HoldUntil); + builder.Entity().Property(p => p.RedeemedDate); + builder.Entity().Property(p => p.VehicleType); + builder.Entity().Property(p => p.BodyStyle); + builder.Entity().Property(p => p.Inoperable); + builder.Entity().Property(p => p.RetailValue); + builder.Entity().Property(p => p.AuctionNotes); + builder.Entity().Property(p => p.AvailablePickupDate); + builder.Entity().Property(p => p.LegalSaleDate); + builder.Entity().Property(p => p.CleaningLevel); + builder.Entity().Property(p => p.SubmissionErrors); + builder.Entity().Property(p => p.SubmissionResponseCode); + builder.Entity().Property(p => p.SubmissionResponseDescription); + builder.Entity().Property(p => p.SentTitleDocsDate); + builder.Entity().Property(p => p.TitleSentResponseCode); + builder.Entity().Property(p => p.TitleSentResponseDescription); + builder.Entity().Property(p => p.TitleSentSubmissionErrors); + builder.Entity().Property(p => p.AddedThroughRepoDatabase); + builder.Entity().Property(p => p.IsActive).HasDefaultValue(true); + builder.Entity().HasOne(p => p.AutoIMS); + builder.Entity().HasOne(p => p.Auction); + builder.Entity().HasMany(p => p.AuctionAssignmentToCollaterals); + builder.Entity().HasOne(p => p.FloorPriceValuesUsed); + + builder.Entity().ToTable("AuctionAssignmentNotes"); + builder.Entity().HasKey(p => p.Id); + builder.Entity().Property(p => p.Id).IsRequired().ValueGeneratedOnAdd(); + builder.Entity().Property(p => p.AuctionAssignmentId).IsRequired(); + builder.Entity().Property(p => p.AuctionCustomerNo).IsRequired(); + builder.Entity().Property(p => p.DateWritten); + builder.Entity().Property(p => p.Origin); + builder.Entity().Property(p => p.Text); + builder.Entity().Property(p => p.Type); + + builder.Entity().ToTable("ImsAutoFileData"); + builder.Entity().HasKey(p => new {p.VIN, p.RepoId}); + builder.Entity().Property(p => p.RepoId).IsRequired(); + builder.Entity().Property(p => p.AuctionCustomerNo).IsRequired(); + builder.Entity().Property(p => p.VIN).IsRequired(); + builder.Entity().Property(p => p.AssignmentAccepted); + builder.Entity().Property(p => p.AuctionAssignmentId); + builder.Entity().Property(p => p.DateReceivedFromAutoIMS); + builder.Entity().Property(p => p.AnnouncedConditions); + builder.Entity().Property(p => p.ApprovedVehicleGrade); + builder.Entity().Property(p => p.ArbitrationReason); + builder.Entity().Property(p => p.AsIs100KMiles); + builder.Entity().Property(p => p.AuctionAge); + builder.Entity().Property(p => p.AuctionGuideBookPrice); + builder.Entity().Property(p => p.BuyerId); + builder.Entity().Property(p => p.BuyerName); + builder.Entity().Property(p => p.ChargeAmount); + builder.Entity().Property(p => p.CheckAmount); + builder.Entity().Property(p => p.ClientAge); + builder.Entity().Property(p => p.ClientCancelled); + builder.Entity().Property(p => p.CollateralImagePath); + builder.Entity().Property(p => p.CollisionDamage); + builder.Entity().Property(p => p.ConditionReportLink); + builder.Entity().Property(p => p.DateEnteredAutoIMS); + builder.Entity().Property(p => p.DatePickedUp); + builder.Entity().Property(p => p.DateofLoss); + builder.Entity().Property(p => p.DaysRun); + builder.Entity().Property(p => p.DaysRunHighestBidRecordedbyAuction); + builder.Entity().Property(p => p.DaystoDelivery); + builder.Entity().Property(p => p.Description); + builder.Entity().Property(p => p.FloorPriceAccepted); + builder.Entity().Property(p => p.FundsSent); + builder.Entity().Property(p => p.GrossPercentFloor); + builder.Entity().Property(p => p.HighestBid); + builder.Entity().Property(p => p.InspectedDate); + builder.Entity().Property(p => p.IsDrivable); + builder.Entity().Property(p => p.IsOperable); + builder.Entity().Property(p => p.MMR); + builder.Entity().Property(p => p.MMRNationalAdjustedPrice); + builder.Entity().Property(p => p.MMRRegionalAdjustedPrice); + builder.Entity().Property(p => p.NetPercentFloor); + builder.Entity().Property(p => p.OTHERAdvancedOther); + builder.Entity().Property(p => p.OTHERAdvancedStorage); + builder.Entity().Property(p => p.OTHERAdvancedTow); + builder.Entity().Property(p => p.OTHERMiscellaneous); + builder.Entity().Property(p => p.OTHERTotal); + builder.Entity().Property(p => p.OtherAdvanceFees); + builder.Entity().Property(p => p.ScheduledSaleDate); + builder.Entity().Property(p => p.SoldDate); + builder.Entity().Property(p => p.Status); + builder.Entity().Property(p => p.SalePrice); + builder.Entity().Property(p => p.ShipmentDate); + builder.Entity().Property(p => p.StorageCost); + builder.Entity().Property(p => p.StorageRatePerDay); + builder.Entity().Property(p => p.StatedMileage); + builder.Entity().Property(p => p.TitleNumber); + builder.Entity().Property(p => p.TitleReceived); + builder.Entity().Property(p => p.TitleReturned); + builder.Entity().Property(p => p.TitleState); + builder.Entity().Property(p => p.TitleStatus); + builder.Entity().Property(p => p.TitleStatusfromAuction); + builder.Entity().Property(p => p.TotalCharges); + builder.Entity().Property(p => p.TowCost); + builder.Entity().Property(p => p.VehicleDecimalGradeCode); + builder.Entity().Property(p => p.VehicleGrade); + + builder.Entity().ToTable("RepoCompany"); + builder.Entity().HasKey(p => p.ID); + builder.Entity().Property(p => p.ID).IsRequired().ValueGeneratedOnAdd(); + builder.Entity().Property(p => p.Name); + builder.Entity().Property(p => p.Email); + + builder.Entity().ToTable("RefundStatuses"); + builder.Entity().HasKey(p => p.RepoId); + + builder.Entity().ToTable("AuctionAssignmentsToCollaterals"); + builder.Entity().HasKey(p => new { p.AuctionAssignmentId, p.CollateralId }); + builder.Entity() + .HasOne(aa2c => aa2c.AuctionAssignment) + .WithMany(auctionAssignment => auctionAssignment.AuctionAssignmentToCollaterals) + .HasForeignKey(aa2c => aa2c.AuctionAssignmentId); + builder.Entity() + .HasOne(aa2c => aa2c.Collateral) + .WithMany(Collateral => Collateral.AuctionAssignmentToCollaterals) + .HasForeignKey(aa2c => aa2c.CollateralId); + + builder.Entity().ToTable("RepoCompanySelections"); + builder.Entity().HasKey(p => p.Id); + builder.Entity().Property(p => p.RepoType) + .HasConversion(x => x.ToString(), + x => (RepoType) Enum.Parse(typeof(RepoType), x)); + builder.Entity().Property(p => p.Processed); + + builder.Entity().ToTable("SavedLocations"); + builder.Entity().HasKey(p => p.ID); + + builder.Entity().ToTable("UserCache"); + builder.Entity().HasKey(p => p.Id); + builder.Entity().Property(p => p.Name); + builder.Entity().Property(p => p.Code); + + builder.Entity().ToTable("SixtyPlusCollector"); + builder.Entity().HasKey(p => p.SixtyPlusCollectorId); + + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Persistence/BaseRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Persistence/BaseRepository.cs new file mode 100644 index 0000000..010a9eb --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Persistence/BaseRepository.cs @@ -0,0 +1,12 @@ +namespace LCU.Shared.Collections.RepoApiLib.Persistence +{ + public abstract class BaseRepository + { + protected readonly AppDbContext _context; + + public BaseRepository(AppDbContext context) + { + _context = context; + } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/AuctionAssignmentNoteRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/AuctionAssignmentNoteRepository.cs new file mode 100644 index 0000000..d685106 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/AuctionAssignmentNoteRepository.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.Results; +using LCU.Shared.Collections.RepoApiLib.Persistence; +using Microsoft.EntityFrameworkCore; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories +{ + public class AuctionAssignmentNoteRepository : BaseRepository, IAuctionAssignmentNoteRepository + { + public AuctionAssignmentNoteRepository(AppDbContext context) : base(context) { } + + public async Task> ListAllAsync(int filterPage, int filterLimit) + { + var results = new PagedResult(); + var skip = (filterPage - 1) * filterLimit; + + var temp = Queryable.OrderByDescending(from x in _context.AuctionAssignmentNotes + select x, x => x.Id); + + results.Total = temp.Count(); + results.Items = await temp.Skip(skip).Take(filterLimit).ToListAsync(); + return results; + } + + public async Task FindByIdAsync(int id) + { + return await Queryable.Where(_context.AuctionAssignmentNotes, c => c.Id == id).FirstOrDefaultAsync(); + } + + public async Task> FindConflictingNotes(DateTime written, string text, string writer) + { + return await Queryable.Where(_context.AuctionAssignmentNotes, c => c.DateWritten == written && c.Text == text && c.Writer == writer).ToListAsync(); + } + + public async Task AddAsync(AuctionAssignmentNote auctionAssignmentNote) + { + var result = await _context.AuctionAssignmentNotes.AddAsync(auctionAssignmentNote); + return result.Entity; + } + + public void Update(AuctionAssignmentNote auctionAssignmentNote) + { + _context.AuctionAssignmentNotes.Update(auctionAssignmentNote); + } + + public void Remove(AuctionAssignmentNote auctionAssignmentNote) + { + _context.AuctionAssignmentNotes.Remove(auctionAssignmentNote); + } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/AuctionAssignmentRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/AuctionAssignmentRepository.cs new file mode 100644 index 0000000..83d4da2 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/AuctionAssignmentRepository.cs @@ -0,0 +1,93 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Extensions; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.Results; +using LCU.Shared.Collections.RepoApiLib.Persistence; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Internal; +using Microsoft.EntityFrameworkCore.Query.ExpressionVisitors.Internal; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories +{ + public class AuctionAssignmentRepository : BaseRepository, IAuctionAssignmentRepository + { + public AuctionAssignmentRepository(AppDbContext context) : base(context) + { + } + + public async Task> ListAllAsync(int filterPage, int filterLimit) + { + var results = new PagedResult(); + var skip = (filterPage - 1) * filterLimit; + + var temp = (from x in _context.AuctionAssignments + select x).OrderByDescending(x => x.ID); + + results.Total = temp.Count(); + results.Items = await temp.Skip(skip).Take(filterLimit).IncludeAll().ToListAsync(); + return results; + } + + public async Task> ListReadyForFloorPriceAsync() + { + var results = new PagedResult(); + + var temp = (from x in _context.AuctionAssignments + where (x.FloorPrice ?? 0) == 0 && x.AutoIMS != null && x.AutoIMS.SoldDate == null && + (x.AutoIMS.StatedMileage ?? -1) > 1 && x.AutoIMS.ScheduledSaleDate != null && + x.AutoIMS.ScheduledSaleDate > DateTime.Now.Date && + x.RedeemedDate == null && + ( (x.AutoIMS.ApprovedVehicleGrade ?? 0) > 0 || (x.AutoIMS.VehicleGrade ?? 0) > 0) + select x).OrderByDescending(x => x.ID); + + results.Items = await temp.IncludeAll().ToListAsync(); + results.Total = temp.Count(); + return results; + } + + public async Task FindByIdAsync(int id) + { + return await Queryable.Where(_context.AuctionAssignments, c => c.ID == id).IncludeAll().FirstOrDefaultAsync(); + } + + public async Task> FindListByIdsAsync(IReadOnlyCollection idSet) + { + return await Queryable.Where(_context.AuctionAssignments, c => idSet.Contains(c.ID)).ToListAsync(); + } + + public async Task> FindByRepoIdAsync(int repoId) + { + return await _context.AuctionAssignments.Where(auctionAssignment => auctionAssignment.RepoId == repoId).IncludeAll().ToListAsync(); + } + + public async Task FindByByAuctionCustomerNoAndVin(string auctionCustomerNo, string vin) + { + return await Queryable + .Where(_context.AuctionAssignments, auctionAssignment => + auctionAssignment.AuctionCustomerNo == auctionCustomerNo && + auctionAssignment.CollateralVIN == vin && + auctionAssignment.IsActive == true).IncludeAll().FirstOrDefaultAsync(); + } + + public async Task AddAsync(AuctionAssignment auctionAssignment) + { + var result = await _context.AuctionAssignments.AddAsync(auctionAssignment); + result.Entity.Auction = Queryable.Where(_context.Auctions, a => a.AuctionID == result.Entity.AuctionId) + .FirstOrDefault(); + return result.Entity; + } + + public void Update(AuctionAssignment auctionAssignment) + { + _context.AuctionAssignments.Update(auctionAssignment); + } + + public void Remove(AuctionAssignment auctionAssignment) + { + _context.AuctionAssignments.Remove(auctionAssignment); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/AuctionHouseRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/AuctionHouseRepository.cs new file mode 100644 index 0000000..2c786bd --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/AuctionHouseRepository.cs @@ -0,0 +1,43 @@ +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.Results; +using LCU.Shared.Collections.RepoApiLib.Persistence; +using Microsoft.EntityFrameworkCore; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories +{ + public class AuctionHouseRepository : BaseRepository, IAuctionHouseRepository + { + + public AuctionHouseRepository(AppDbContext context) : base(context) + { + } + + public async Task> ListAllAsync() + { + return await _context.Auctions.ToListAsync(); + } + + public async Task AddAsync(AuctionHouse auction) + { + await _context.Auctions.AddAsync(auction); + } + + public async Task FindByIdAsync(string id) + { + return await Queryable.Where(_context.Auctions, c => c.AuctionID == id).FirstOrDefaultAsync(); + } + + public void Update(AuctionHouse auction) + { + _context.Auctions.Update(auction); + } + + public void Remove(AuctionHouse auction) + { + _context.Auctions.Remove(auction); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/AuditRecordRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/AuditRecordRepository.cs new file mode 100644 index 0000000..047fab1 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/AuditRecordRepository.cs @@ -0,0 +1,51 @@ +using System; +using System.Linq; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.Results; +using LCU.Shared.Collections.RepoApiLib.Persistence; +using Microsoft.EntityFrameworkCore; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories +{ + public class AuditRecordRepository : BaseRepository, IAuditRecordRepository + { + public AuditRecordRepository(AppDbContext context) : base(context) + { + } + + public async Task> ListAllAsync(int filterPage, int filterLimit) + { + var results = new PagedResult(); + var skip = (filterPage - 1) * filterLimit; + + var temp = Queryable.OrderByDescending((from x in _context.AuditRecords + where x.DatePerformed > DateTime.Today.AddDays(-120) + select x), x => x.ID); + + results.Total = temp.Count(); + results.Items = await temp.Skip(skip).Take(filterLimit).ToListAsync(); + return results; + } + + public async Task AddAsync(AuditRecord auditRecord) + { + await _context.AuditRecords.AddAsync(auditRecord); + } + + public async Task FindByIdAsync(int id) + { + return await _context.AuditRecords.FindAsync(id); + } + + public void Update(AuditRecord auditRecord) + { + _context.AuditRecords.Update(auditRecord); + } + + public void Remove(AuditRecord auditRecord) + { + _context.AuditRecords.Remove(auditRecord); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/CollateralRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/CollateralRepository.cs new file mode 100644 index 0000000..b8d1ff2 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/CollateralRepository.cs @@ -0,0 +1,44 @@ +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Persistence; +using LCU.Shared.Collections.RepoApiLib.Extensions; +using Microsoft.EntityFrameworkCore; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories +{ + public class CollateralRepository : BaseRepository, ICollateralRepository + { + + public CollateralRepository(AppDbContext context) : base(context) + { + } + + public async Task> ListAllAsync() + { + return await _context.Collaterals.IncludeAll().ToListAsync(); + } + + public async Task AddAsync(Collateral collateral) + { + var result = await _context.Collaterals.AddAsync(collateral); + return result.Entity; + } + + public async Task FindByIdAsync(int id) + { + return await Queryable.Where(_context.Collaterals, c => c.CollateralId == id).IncludeAll().FirstOrDefaultAsync(); + } + + public void Update(Collateral collateral) + { + _context.Collaterals.Update(collateral); + } + + public void Remove(Collateral collateral) + { + _context.Collaterals.Remove(collateral); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/EventAlertRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/EventAlertRepository.cs new file mode 100644 index 0000000..18a617f --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/EventAlertRepository.cs @@ -0,0 +1,266 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Exceptions; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Persistence; +using Microsoft.EntityFrameworkCore; +using Serilog; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories +{ + public class EventAlertRepository : BaseRepository, IEventAlertRepository + { + private const string RepoStatus = "REPO"; + private const string O4RStatus = "O4R"; + private const int ClosedAccountCutoffDays = 90; + + private static List _nonRepeatingAlerts = new List + { + "Credit Adjustment Received", + "Debit Adjustment Received", + "Notice of Plan to Sell Not Found", + "Notice of Repossession Not Found", + "RTC Letter Not Found" + }; + + public EventAlertRepository(AppDbContext context) : base(context) + { + + } + + public async Task> ListAllAsync() + { + return await _context.EventAlerts.ToListAsync(); + } + + public async Task> ListUnreadAsync() + { + var result = from alert in _context.EventAlerts + join repo in _context.RepoAccounts + on alert.AccountNo equals repo.AccountNo + join activeStatus in _context.RepoManualStatuses + on repo.Status equals activeStatus.Description + where activeStatus.WatchForStatusChanges && alert.DateMarkedRead == null + select alert; + + return await result.Distinct().ToListAsync(); + } + + public async Task> ListWithinDateRangeAsync(DateTime start, DateTime end) + { + return await _context.EventAlerts.Where(e => e.DateAdded >= start && e.DateAdded <= end).ToListAsync(); + } + + public async Task> ListRepoNoAuctionAsync() + { + var closedDateCutoff = DateTime.Today.Subtract(TimeSpan.FromDays(ClosedAccountCutoffDays)); + var accountsInRepo = ( + from repo in _context.RepoAccounts + where repo.Status.Equals(RepoStatus) && (repo.DateClosed == null || repo.DateClosed > closedDateCutoff) + select repo); + + var accountsInRepoWithAuction = ( + from repo in accountsInRepo + join auctionAssignment in _context.AuctionAssignments + on repo.RepoId equals auctionAssignment.RepoId + where auctionAssignment.IsActive == true + select repo); + + var accountsNoAuction = await accountsInRepo.Except(accountsInRepoWithAuction).ToListAsync(); + + return accountsNoAuction.Select(repo => new EventAlert() + { + AccountNo = repo.AccountNo, + RepoId = repo.RepoId, + Message = "Repo No Auction" + }).Distinct(); + } + + public async Task> ListRepoNoCompanyAsync() + { + return await ListStatusNoCompanyAsync(RepoStatus); + } + + public async Task> ListO4rNoCompanyAsync() + { + return await ListStatusNoCompanyAsync(O4RStatus); + } + + public async Task> ListStatusNoCompanyAsync(string status) + { + var closedDateCutoff = DateTime.Today.Subtract(TimeSpan.FromDays(ClosedAccountCutoffDays)); + var result = from repo in _context.RepoAccounts + from collateral in _context.Collaterals.Where(c => c.RepoId == repo.RepoId) + from repoCompanySelection in _context.RepoCompanySelections.Where(x => x.CollateralId == collateral.CollateralId).DefaultIfEmpty() + where (repoCompanySelection == null || repoCompanySelection.RepoCompanyId == null) && repo.Status.Equals(status) && (repo.DateClosed == null || repo.DateClosed > closedDateCutoff) + select new EventAlert + { + AccountNo = repo.AccountNo, + RepoId = repo.RepoId, + Message = status + " No Repo Company" + }; + + var temp = await result.Distinct().ToListAsync(); + return temp; + } + + public async Task> ListReadyForRetitleAsync() + { + var result = from collateral in _context.Collaterals + join repo in _context.RepoAccounts + on collateral.RepoId equals repo.RepoId + join auctionAssignmentToCollateral in _context.AuctionAssignmentToCollaterals + on collateral.CollateralId equals auctionAssignmentToCollateral.CollateralId + join auctionAssignment in _context.AuctionAssignments + on auctionAssignmentToCollateral.AuctionAssignmentId equals auctionAssignment.ID + from data in Queryable.Where(_context.ImsAutoFileData, ims => auctionAssignment.ID == ims.AuctionAssignmentId || + (repo.RepoId == ims.RepoId && auctionAssignment.CollateralVIN == ims.VIN)) + where collateral.RetitledInLandmarkName == null && repo.Status.Equals(RepoStatus) && auctionAssignment.IsActive && repo.RedemptionExpiredDate < DateTime.Today + select new EventAlert + { + AccountNo = repo.AccountNo, + RepoId = repo.RepoId, + Message = "Ready For Retitle" + }; + + return await result.Distinct().ToListAsync(); + } + + public async Task> ListFloorUpdateFailedAsync() + { + var result = from autoFileData in _context.ImsAutoFileData + join repo in _context.RepoAccounts + on autoFileData.RepoId equals repo.RepoId + join collateral in _context.Collaterals + on repo.RepoId equals collateral.RepoId + join auctionAssignmentToCollateral in _context.AuctionAssignmentToCollaterals + on collateral.CollateralId equals auctionAssignmentToCollateral.CollateralId + join auctionAssignment in _context.AuctionAssignments + on auctionAssignmentToCollateral.AuctionAssignmentId equals auctionAssignment.ID + where ((auctionAssignment.HoldStatus ?? 0) == 0 || (auctionAssignment.HoldUntil ?? DateTime.Now) <= DateTime.Now) && + auctionAssignment.RedeemedDate == null && + autoFileData.SoldDate == null && + (auctionAssignment.FloorPriceResponseCode != null && auctionAssignment.FloorPriceResponseCode != 1) + select new EventAlert + { + AccountNo = repo.AccountNo, + RepoId = repo.RepoId, + Message = "Floor Update Failed" + }; + + return await result.Distinct().ToListAsync(); + } + + public async Task> ListFloorNeedsSettingAsync() + { + var result = from data in _context.ImsAutoFileData + join repo in _context.RepoAccounts + on data.RepoId equals repo.RepoId + join collateral in _context.Collaterals + on repo.RepoId equals collateral.RepoId + join auctionAssignmentToCollateral in _context.AuctionAssignmentToCollaterals + on collateral.CollateralId equals auctionAssignmentToCollateral.CollateralId + join auctionAssignment in _context.AuctionAssignments + on auctionAssignmentToCollateral.AuctionAssignmentId equals auctionAssignment.ID + where (auctionAssignment.FloorPrice ?? 0) == 0 && + ((auctionAssignment.HoldStatus ?? 0) == 0 || (auctionAssignment.HoldUntil ?? DateTime.Now) <= DateTime.Now) && + auctionAssignment.RedeemedDate == null && + data.SoldDate == null && + data.ScheduledSaleDate != null && + data.ScheduledSaleDate < DateTime.Now.AddDays(3) && + repo.DateClosed == null + select new EventAlert + { + AccountNo = repo.AccountNo, + RepoId = repo.RepoId, + Message = "Floor Set Required" + }; + + return await result.Distinct().ToListAsync(); + } + + public async Task AddAsync(EventAlert eventAlert) + { + if (eventAlert.SubMessage != null && eventAlert.SubMessage.Length > 499) + { + eventAlert.SubMessage = eventAlert.SubMessage.Substring(0, 499); + } + + if (!IsDuplicateAlert(eventAlert)) + { + await _context.EventAlerts.AddAsync(eventAlert); + } + else + { + throw new DuplicateResourceException("EventAlert"); + } + } + + public async Task> AddRangeAsync(IEnumerable eventAlerts) + { + List filteredEventAlerts = new List(); + + foreach (EventAlert eventAlert in eventAlerts) + { + if (eventAlert.SubMessage != null && eventAlert.SubMessage.Length > 499) + { + eventAlert.SubMessage = eventAlert.SubMessage.Substring(0, 499); + } + + if (!IsDuplicateAlert(eventAlert)) + { + filteredEventAlerts.Add(eventAlert); + } + else + { + Log.Debug($"EventAlertRepository: Valid Alert Already Exists eventAlert: {@eventAlert}." + + $" Will Continue without adding this to Event Alerts Context.", eventAlerts, eventAlert + ); + } + } + + await _context.EventAlerts.AddRangeAsync(filteredEventAlerts); + return filteredEventAlerts; + } + + public bool IsDuplicateAlert(EventAlert eventAlert) + { + var duplicateAlerts = ( + from alert in _context.EventAlerts + where alert.AccountNo == eventAlert.AccountNo && + alert.Message == eventAlert.Message && + ( + alert.DateMarkedRead == null || + alert.DateMarkedRead > DateTime.Now.AddHours(-24) || + _nonRepeatingAlerts.Contains(alert.Message) + ) + select alert + ).ToList(); + + return (duplicateAlerts.Any()); + } + + public async Task FindByIdAsync(int id) + { + return await _context.EventAlerts.FindAsync(id); + } + + public void Update(EventAlert category) + { + _context.EventAlerts.Update(category); + } + + public void Remove(EventAlert category) + { + _context.EventAlerts.Remove(category); + } + + public async Task> ListUnreadByAccountNoAsync(string accountNo) + { + var results = _context.EventAlerts.Where(x => x.AccountNo == accountNo && x.DateMarkedRead == null); + return await results.ToListAsync(); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/ExternalUserRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/ExternalUserRepository.cs new file mode 100644 index 0000000..d1158e3 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/ExternalUserRepository.cs @@ -0,0 +1,43 @@ +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Persistence; +using Microsoft.EntityFrameworkCore; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories +{ + public class ExternalUserRepository : BaseRepository, IExternalUserRepository + { + public ExternalUserRepository(AppDbContext context) : base(context) { } + + public async Task> ListAsync() + { + return await _context.ExternalUsers.AsNoTracking().ToListAsync(); + } + + public async Task FindByReferenceIdAsync(int referenceId) + { + return await _context.ExternalUsers.AsNoTracking().Where(user => user.ReferenceId == referenceId).FirstOrDefaultAsync(); + } + + public async Task SynchronizeSet(IReadOnlyCollection externalUsers) + { + foreach (var user in externalUsers) + { + var existing = await FindByReferenceIdAsync(user.ReferenceId); + if ( existing != null) + { + user.Id = existing.Id; + _context.Entry(user).State = EntityState.Modified; + _context.ExternalUsers.Update(user); + } + else + { + await _context.ExternalUsers.AddAsync(user); + } + } + } + + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/IAuctionAssignmentNoteRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/IAuctionAssignmentNoteRepository.cs new file mode 100644 index 0000000..130af3a --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/IAuctionAssignmentNoteRepository.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.Results; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories +{ + public interface IAuctionAssignmentNoteRepository + { + Task> ListAllAsync(int filterPage, int filterLimit); + Task FindByIdAsync(int id); + Task> FindConflictingNotes(DateTime written, string text, string writer); + Task AddAsync(AuctionAssignmentNote auctionAssignmentNote); + void Update(AuctionAssignmentNote auctionAssignmentNote); + void Remove(AuctionAssignmentNote auctionAssignmentNote); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/IAuctionAssignmentRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/IAuctionAssignmentRepository.cs new file mode 100644 index 0000000..c7d38af --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/IAuctionAssignmentRepository.cs @@ -0,0 +1,20 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.Results; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories +{ + public interface IAuctionAssignmentRepository + { + Task> ListAllAsync(int filterPage, int filterLimit); + Task> ListReadyForFloorPriceAsync(); + Task FindByIdAsync(int id); + Task> FindByRepoIdAsync(int repoId); + Task FindByByAuctionCustomerNoAndVin(string auctionCustomerNo, string vin); + Task AddAsync(AuctionAssignment auctionAssignment); + void Update(AuctionAssignment auctionAssignment); + void Remove(AuctionAssignment auctionAssignment); + Task> FindListByIdsAsync(IReadOnlyCollection idSet); + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/IAuctionHouseRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/IAuctionHouseRepository.cs new file mode 100644 index 0000000..868fb70 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/IAuctionHouseRepository.cs @@ -0,0 +1,15 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories +{ + public interface IAuctionHouseRepository + { + Task> ListAllAsync(); + Task AddAsync(AuctionHouse assignment); + Task FindByIdAsync(string id); + void Update(AuctionHouse assignment); + void Remove(AuctionHouse assignment); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/IAuditRecordRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/IAuditRecordRepository.cs new file mode 100644 index 0000000..0f950af --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/IAuditRecordRepository.cs @@ -0,0 +1,15 @@ +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.Results; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories +{ + public interface IAuditRecordRepository + { + Task> ListAllAsync(int filterPage, int filterLimit); + Task AddAsync(AuditRecord auditRecord); + Task FindByIdAsync(int id); + void Update(AuditRecord auditRecord); + void Remove(AuditRecord auditRecord); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/ICollateralRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/ICollateralRepository.cs new file mode 100644 index 0000000..b5453cf --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/ICollateralRepository.cs @@ -0,0 +1,15 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories +{ + public interface ICollateralRepository + { + Task> ListAllAsync(); + Task AddAsync(Collateral collateral); + Task FindByIdAsync(int id); + void Update(Collateral collateral); + void Remove(Collateral collateral); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/IEventAlertRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/IEventAlertRepository.cs new file mode 100644 index 0000000..906cb82 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/IEventAlertRepository.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories +{ + public interface IEventAlertRepository + { + Task> ListAllAsync(); + Task> ListUnreadAsync(); + Task> ListWithinDateRangeAsync(DateTime start, DateTime end); + Task> ListRepoNoAuctionAsync(); + Task> ListRepoNoCompanyAsync(); + Task> ListO4rNoCompanyAsync(); + Task> ListReadyForRetitleAsync(); + Task> ListFloorUpdateFailedAsync(); + Task> ListFloorNeedsSettingAsync(); + Task> ListUnreadByAccountNoAsync(string accountNo); + Task AddAsync(EventAlert eventAlert); + Task> AddRangeAsync(IEnumerable eventAlerts); + Task FindByIdAsync(int id); + void Update(EventAlert eventAlert); + void Remove(EventAlert eventAlert); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/IExternalUserRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/IExternalUserRepository.cs new file mode 100644 index 0000000..c71a15d --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/IExternalUserRepository.cs @@ -0,0 +1,13 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories +{ + public interface IExternalUserRepository + { + Task> ListAsync(); + Task FindByReferenceIdAsync(int referenceId); + Task SynchronizeSet(IReadOnlyCollection externalUsers); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/IImsAutoFileDataRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/IImsAutoFileDataRepository.cs new file mode 100644 index 0000000..9a7e139 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/IImsAutoFileDataRepository.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories +{ + public interface IImsAutoFileDataRepository + { + Task> ListAllAsync(); + Task AddAsync(ImsAutoFileData assignment); + Task FindByIdAsync(string vin, int repoId); + Task FindByAuctionAssignmentIdAsync(int auctionAssignmentId); + Task GetNonConformingImsFileRecord(string vin, string auctionCustomerNo); + void Update(ImsAutoFileData autoImsAutoFileData); + void Remove(ImsAutoFileData autoImsAutoFileData); + Task> GetImsSoldRecordsForPeriod(DateTime lowDateTime, DateTime highDateTime); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/ILetterRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/ILetterRepository.cs new file mode 100644 index 0000000..bfcb662 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/ILetterRepository.cs @@ -0,0 +1,11 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories +{ + public interface ILetterRepository + { + Task> ListAsync(); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/IProcessingReceiptRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/IProcessingReceiptRepository.cs new file mode 100644 index 0000000..f4019cc --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/IProcessingReceiptRepository.cs @@ -0,0 +1,17 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories +{ + public interface IProcessingReceiptRepository + { + Task> FindReceiptsAsync(string accountNo, + string accountId = "", string caseId = ""); + Task> GetReceiptsByAccountNoAsync(string accountNo); + Task> GetRetryListAsync(); + Task AddOrUpdateAsync(ProcessingReceipt receipt); + Task SaveAllAsync(IReadOnlyCollection receipts); + bool IsDuplicateReceipt(ProcessingReceipt newReceipt); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/IRefundStatusRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/IRefundStatusRepository.cs new file mode 100644 index 0000000..96fef65 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/IRefundStatusRepository.cs @@ -0,0 +1,14 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories +{ + public interface IRefundStatusRepository + { + Task> ListAsync(); + Task FindByRepoIdAsync(int repoId); + Task AddAsync(RefundStatus refundStatus); + void Update(RefundStatus refundStatus); + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/IRepoAccountRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/IRepoAccountRepository.cs new file mode 100644 index 0000000..2ada5d2 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/IRepoAccountRepository.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.Producer; +using LCU.Shared.Collections.RepoApiLib.Models.Results; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories +{ + public interface IRepoAccountRepository + { + Task> ListAsync(List filterRepoIdList, int filterPage, int filterLimit, string status = null, string auctionHouseId = null, int? repoCompanyId = null, bool? onlyOpenAccounts = null); + Task> ListByAuctionVinAsync(string unformattedVin); + Task> FindByCurrentStatus(string currentStatus); + Task> FindByStatusChangeInPeriod(string status, DateTime lowDateTime, DateTime highDateTime, string previousStatus = null); + Task AddAsync(RepoAccount repoAccount); + Task FindByIdAsync(int id); + Task> FindByRepoIdAsync(List filterRepoIdList); + Task> SearchRepoAccounts(string searchPhrase, int maxLimit); + Task> FindByAccountNoAsync(string accountNo); + Task FindByAuctionAssignmentIdAsync(int id); + Task> GetCurrentAccountsOnHoldAtAuction(); + void Update(RepoAccount eventAlert); + void Remove(RepoAccount eventAlert); + Task> GetItemsForProcessing(IReadOnlyCollection watchStatusList); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/IRepoCompanyRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/IRepoCompanyRepository.cs new file mode 100644 index 0000000..09c020e --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/IRepoCompanyRepository.cs @@ -0,0 +1,15 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories +{ + public interface IRepoCompanyRepository + { + Task> ListAsync(); + Task AddAsync(RepoCompany repoCompany); + Task FindByIdAsync(int id); + void Update(RepoCompany repoCompany); + void Remove(RepoCompany repoCompany); + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/IRepoCompanySelectionRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/IRepoCompanySelectionRepository.cs new file mode 100644 index 0000000..893be76 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/IRepoCompanySelectionRepository.cs @@ -0,0 +1,18 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories +{ + public interface IRepoCompanySelectionRepository + { + Task> ListAllAsync(); + Task AddAsync(RepoCompanySelection repoCompanySelection); + Task FindByIdAsync(int id); + Task> FindByCollateralIdAsync(int collateralId); + void Update(RepoCompanySelection repoCompanySelection); + void Remove(RepoCompanySelection repoCompanySelection); + + void SaveRange(IList repoCompanySelections); + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/IRepoManualStatusRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/IRepoManualStatusRepository.cs new file mode 100644 index 0000000..f2cf2a1 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/IRepoManualStatusRepository.cs @@ -0,0 +1,16 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories +{ + public interface IRepoManualStatusRepository + { + Task> ListAllAsync(); + Task> ListWatchStatusesAsync(); + Task AddAsync(RepoManualStatus repoManualStatus); + Task FindByIdAsync(int id); + void Update(RepoManualStatus repoManualStatus); + void Remove(RepoManualStatus repoManualStatus); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/IRepoStatusChangeRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/IRepoStatusChangeRepository.cs new file mode 100644 index 0000000..eaf5dee --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/IRepoStatusChangeRepository.cs @@ -0,0 +1,14 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories +{ + public interface IRepoStatusChangeRepository + { + Task> ListAsync(); + Task> ListForAccountAsync(int repoAccountId); + Task AddAsync(RepoStatusChange statusChange); + Task FindByIdAsync(int id); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/IReportingRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/IReportingRepository.cs new file mode 100644 index 0000000..db9957f --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/IReportingRepository.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.Reporting; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories +{ + public interface IReportingRepository + { + Task> GetAllAccountsInO4R(); + Task> GetActiveAccounts(); + Task> GetClosedAccounts(DateTime lowDateTime, DateTime highDateTime); + Task> GetAccountsByDateSoldInAutoIMS(DateTime lowDateTime, DateTime highDateTime); + Task> GetAccountsByDateRepoed(DateTime lowDateTime, DateTime highDateTime); + Task> GetAccountsByDateAssigned(DateTime lowDateTime, DateTime highDateTime); + Task> GetAccountsByO4RDate(DateTime lowDateTime, DateTime highDateTime); + Task> GetAccountsByStatusChangeInPeriod(string status, DateTime lowDateTime, DateTime highDateTime); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/ISavedLocationRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/ISavedLocationRepository.cs new file mode 100644 index 0000000..4e07309 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/ISavedLocationRepository.cs @@ -0,0 +1,15 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories +{ + public interface ISavedLocationRepository + { + Task> ListAsync(); + Task AddAsync(SavedLocation savedLocation); + Task FindByIdAsync(int id); + void Update(SavedLocation savedLocation); + void Remove(SavedLocation savedLocation); + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/IUnitOfWork.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/IUnitOfWork.cs new file mode 100644 index 0000000..1aaf605 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/IUnitOfWork.cs @@ -0,0 +1,9 @@ +using System.Threading.Tasks; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories +{ + public interface IUnitOfWork + { + Task CompleteAsync(); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/IVehicleFloorPricingParametersRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/IVehicleFloorPricingParametersRepository.cs new file mode 100644 index 0000000..49eb507 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/IVehicleFloorPricingParametersRepository.cs @@ -0,0 +1,15 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories +{ + public interface IVehicleFloorPricingParametersRepository + { + Task> ListAllAsync(); + Task AddAsync(VehicleFloorPricingParameters Collateral); + Task FindByIdAsync(int id); + void Update(VehicleFloorPricingParameters Collateral); + void Remove(VehicleFloorPricingParameters Collateral); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/ImsAutoFileDataRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/ImsAutoFileDataRepository.cs new file mode 100644 index 0000000..a152306 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/ImsAutoFileDataRepository.cs @@ -0,0 +1,69 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Persistence; +using Microsoft.EntityFrameworkCore; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories +{ + public class ImsAutoFileDataRepository : BaseRepository, IImsAutoFileDataRepository + { + public ImsAutoFileDataRepository(AppDbContext context) : base(context) + { + } + + public async Task> ListAllAsync() + { + return await _context.ImsAutoFileData.ToListAsync(); + } + + public async Task AddAsync(ImsAutoFileData assignment) + { + await _context.ImsAutoFileData.AddAsync(assignment); + } + + public async Task FindByIdAsync(string vin, int repoId) + { + return await _context.ImsAutoFileData.Where(x => x.VIN == vin && x.RepoId == repoId).FirstOrDefaultAsync(); + } + + public async Task FindByAuctionAssignmentIdAsync(int auctionAssignmentId) + { + return await _context.ImsAutoFileData.Where(x => x.AuctionAssignmentId == auctionAssignmentId) + .FirstOrDefaultAsync(); + } + + public async Task GetNonConformingImsFileRecord(string vin, string auctionCustomerNo) + { + ImsAutoFileData imsAutoFile = null; + + // Allow for vehicle brought back to auction after sale. it happens! + DateTime withinThirtyDays = DateTime.Now.AddDays(-30); + imsAutoFile = await _context.ImsAutoFileData.Where(x => + (x.VIN.Trim() == vin && x.AuctionCustomerNo == auctionCustomerNo + && (x.SoldDate == null || x.SoldDate >= withinThirtyDays))).FirstOrDefaultAsync(); + + return imsAutoFile; + } + + public void Update(ImsAutoFileData autoImsAutoFileData) + { + _context.ImsAutoFileData.Update(autoImsAutoFileData); + } + + public void Remove(ImsAutoFileData autoImsAutoFileData) + { + _context.ImsAutoFileData.Remove(autoImsAutoFileData); + } + + public async Task> GetImsSoldRecordsForPeriod(DateTime lowDateTime, + DateTime highDateTime) + { + return await _context.ImsAutoFileData + .Where(x => x.SoldDate != null && x.SoldDate >= lowDateTime && x.SoldDate <= highDateTime) + .ToListAsync(); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/LetterRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/LetterRepository.cs new file mode 100644 index 0000000..793445f --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/LetterRepository.cs @@ -0,0 +1,20 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Persistence; +using Microsoft.EntityFrameworkCore; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories +{ + public class LetterRepository : BaseRepository, ILetterRepository + { + public LetterRepository(AppDbContext context) : base(context) + { + } + + public async Task> ListAsync() + { + return await _context.Letters.ToListAsync(); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/ProcessingReceiptRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/ProcessingReceiptRepository.cs new file mode 100644 index 0000000..bbeaee2 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/ProcessingReceiptRepository.cs @@ -0,0 +1,84 @@ +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.Producer; +using LCU.Shared.Collections.RepoApiLib.Persistence; +using Microsoft.EntityFrameworkCore; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories +{ + public class ProcessingReceiptRepository : BaseRepository, IProcessingReceiptRepository + { + private readonly IReadOnlyCollection _retryOutcomes = new List() + { + RepoProcessingResult.Error, RepoProcessingResult.MissingRequirement + }; + + public ProcessingReceiptRepository(AppDbContext context) : base(context) + { + } + + public async Task> FindReceiptsAsync(string accountNo, + string accountId = "", string caseId = "") + { + return await _context.ProcessingReceipts.Where(receipt => receipt.AccountNo == accountNo + && receipt.AccountId == accountId && + receipt.CaseId == caseId).AsNoTracking().ToListAsync(); + } + + public async Task> GetReceiptsByAccountNoAsync(string accountNo) + { + return await _context.ProcessingReceipts.Where(receipt => receipt.AccountNo == accountNo).AsNoTracking().ToListAsync(); + } + + public async Task> GetRetryListAsync() + { + return await _context.ProcessingReceipts.Where(receipt => _retryOutcomes.Contains(receipt.Outcome)) + .AsNoTracking().ToListAsync(); + } + + public async Task AddOrUpdateAsync(ProcessingReceipt receipt) + { + if (receipt.Message != null && receipt.Message.Length > 124) + { + receipt.Message = receipt.Message.Substring(0, 124); + } + + if (receipt.QueuedBy != null && receipt.QueuedBy.Length > 39) + { + receipt.QueuedBy = receipt.QueuedBy.Substring(0, 39); + } + + if (!IsDuplicateReceipt(receipt)) + { + await _context.ProcessingReceipts.AddAsync(receipt); + } + else + { + _context.Entry(receipt).State = EntityState.Modified; + _context.ProcessingReceipts.Update(receipt); + } + } + + public async Task SaveAllAsync(IReadOnlyCollection receipts) + { + var saveAllReceipts = receipts.Select(AddOrUpdateAsync).ToList(); + await Task.WhenAll(saveAllReceipts); + } + + public bool IsDuplicateReceipt(ProcessingReceipt newReceipt) + { + var duplicateReceipts = ( + from existingReceipt in _context.ProcessingReceipts + where existingReceipt.AccountNo == newReceipt.AccountNo + && existingReceipt.AccountId == newReceipt.AccountId + && existingReceipt.CaseId == newReceipt.CaseId + select existingReceipt + ).AsNoTracking().ToList(); + + return (duplicateReceipts.Count() != 0); + } + + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/RefundStatusRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/RefundStatusRepository.cs new file mode 100644 index 0000000..d7126bb --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/RefundStatusRepository.cs @@ -0,0 +1,35 @@ +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Persistence; +using Microsoft.EntityFrameworkCore; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories +{ + public class RefundStatusRepository : BaseRepository, IRefundStatusRepository + { + public RefundStatusRepository(AppDbContext context) : base(context) {} + + public async Task> ListAsync() + { + return await _context.RefundStatuses.ToListAsync(); + } + + public async Task FindByRepoIdAsync(int repoId) + { + return await _context.RefundStatuses.Where(refundStatus => refundStatus.RepoId == repoId).FirstOrDefaultAsync(); + } + + public async Task AddAsync(RefundStatus refundStatus) + { + var result = await _context.RefundStatuses.AddAsync(refundStatus); + return result.Entity; + } + + public void Update(RefundStatus refundStatus) + { + _context.RefundStatuses.Update(refundStatus); + } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/RepoAccountRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/RepoAccountRepository.cs new file mode 100644 index 0000000..2c6ea74 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/RepoAccountRepository.cs @@ -0,0 +1,234 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Exceptions; +using LCU.Shared.Collections.RepoApiLib.Extensions; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.Producer; +using LCU.Shared.Collections.RepoApiLib.Models.Results; +using LCU.Shared.Collections.RepoApiLib.Persistence; +using Microsoft.EntityFrameworkCore; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories +{ + public class RepoAccountRepository : BaseRepository, IRepoAccountRepository + { + public RepoAccountRepository(AppDbContext context) : base(context) + { + } + + public async Task> ListAsync( + List filterAccountNoList, + int filterPage, + int filterLimit, + string status, + string auctionHouseId, + int? repoCompanyId, + bool? onlyOpenAccounts) + { + var results = new PagedResult(); + var skip = (filterPage - 1) * filterLimit; + + + var accounts = _context.RepoAccounts.Select(account => account); + + // Filter By Repo Ids? + if (filterAccountNoList != null && filterAccountNoList.Any()) + { + accounts = accounts.Where(account => filterAccountNoList.Contains(account.RepoId)); + } + + // Filter By Status? + if (!string.IsNullOrEmpty(status)) + { + accounts = accounts.Where(account => account.Status.ToLower() == status.ToLower()); + } + + // Filter By Auction House? + if (!string.IsNullOrEmpty(auctionHouseId)) + { + accounts = accounts.Join(_context.AuctionAssignments.AsEnumerable(), account => account.RepoId, auction => auction.RepoId, + (account, auction) => new { AuctionAssignment = auction, RepoAccount = account }) + .Where(joined => joined.AuctionAssignment.IsActive && joined.AuctionAssignment.AuctionId == auctionHouseId) + .Select(result => result.RepoAccount); + } + + // Filter By Repo Company? + if (repoCompanyId != null) + { + accounts = accounts.Join(_context.Collaterals.AsEnumerable(), account => account.RepoId, collateral => collateral.RepoId, + (account, collateral) => new { RepoAccount = account, Collateral = collateral }) + .Join(_context.RepoCompanySelections.AsEnumerable(), accountCollateral => accountCollateral.Collateral.CollateralId, + repocompany => repocompany.CollateralId, + (accountCollateral, repocompany) => new { accountCollateral.RepoAccount, accountCollateral.Collateral, RepoCompany = repocompany }) + .Where(joined => joined.RepoCompany.RepoCompanyId == repoCompanyId) + .Select(result => result.RepoAccount); + } + + // Filter Out Closed Accounts? + if (onlyOpenAccounts == true) + { + accounts = accounts.Where(account => !account.DateClosed.HasValue); + } + + accounts = accounts.Distinct(); + + results.Total = accounts.Count(); + results.Items = await accounts.Skip(skip).Take(filterLimit).IncludeAll().ToListAsync(); + return results; + } + + public async Task> FindByRepoIdAsync(List filterRepoIdList) + { + var accounts = await Queryable.OrderByDescending((from account in _context.RepoAccounts + where filterRepoIdList.Count == 0 || filterRepoIdList.Contains(account.RepoId.ToString()) + select account), x => x.AccountNo).IncludeAll().ToListAsync(); + + return accounts; + } + + public async Task> ListByAuctionVinAsync(string unformattedVin) + { + string vin = unformattedVin.Trim().ToUpper(); + + List repos = await (from account in _context.RepoAccounts + join collateral in _context.Collaterals on account.RepoId equals collateral.RepoId + where GetFormattedVIN(collateral.Vin) == vin + select account).ToListAsync(); + + return repos; + } + + public async Task> FindByStatusChangeInPeriod( + string status, + DateTime lowDateTime, + DateTime highDateTime, + string previousStatus = null) + { + var repos = await ( + from account in _context.RepoAccounts + join statusChange in _context.RepoStatusChanges on account.RepoId equals statusChange.RepoId + where + string.Equals(account.Status, status, StringComparison.CurrentCultureIgnoreCase) && + ( + previousStatus != null + ? string.Equals(statusChange.StatusFrom, previousStatus, StringComparison.CurrentCultureIgnoreCase) + : true + ) && + string.Equals(statusChange.StatusTo, status, StringComparison.CurrentCultureIgnoreCase) && + statusChange.ChangedDate >= lowDateTime && statusChange.ChangedDate <= highDateTime + select account) + .Distinct() + .IncludeAll() + .ToListAsync(); + + return repos; + } + + public async Task AddAsync(RepoAccount repo) + { + var result = await _context.RepoAccounts.AddAsync(repo); + return result.Entity; + } + + public async Task FindByIdAsync(int id) + { + return await Queryable.Where(_context.RepoAccounts, x => x.RepoId == id) + .IncludeAll() + .FirstOrDefaultAsync(); + } + + public async Task> FindByAccountNoAsync(string accountNo) + { + return await Queryable.Where(_context.RepoAccounts, x => x.AccountNo == accountNo) + .IncludeAll().AsNoTracking().ToListAsync(); + } + + public async Task FindByAuctionAssignmentIdAsync(int id) + { + RepoAccount repo = await ( + from account in _context.RepoAccounts + join collateral in _context.Collaterals on account.RepoId equals collateral.RepoId + join auctionAssignmentToCollateral in _context.AuctionAssignmentToCollaterals on collateral.CollateralId equals auctionAssignmentToCollateral + .CollateralId + where auctionAssignmentToCollateral.AuctionAssignmentId == id + select account).FirstOrDefaultAsync(); + + return repo; + } + + public static string GetFormattedVIN(string vin) + { + return vin.Trim().PadLeft(17, '0').ToUpper(); + } + + public void Update(RepoAccount account) + { + _context.Entry(account).State = EntityState.Modified; + _context.RepoAccounts.Update(account); + } + + public void Remove(RepoAccount account) + { + _context.RepoAccounts.Remove(account); + } + + public async Task> GetItemsForProcessing(IReadOnlyCollection watchStatusList) + { + var accountList = await _context.RepoAccounts.Where(account => + account.DateClosed == null && watchStatusList.Contains(account.Status.ToUpper().Trim())).ToListAsync(); + + var list = accountList.Select(x => new ProcessingItem() + { + AccountId = x.ReferenceId.HasValue ? x.ReferenceId.ToString() : "", + CaseId = x.ReferenceCaseId.HasValue ? x.ReferenceCaseId.ToString() : "", + AccountNo = x.AccountNo + }); + return list.ToList(); + } + + public async Task> SearchRepoAccounts(string searchPhrase, int maxLimit) + { + var updatedSearchPhrase = searchPhrase.Trim().ToLower(); + var entities = ( + from account in _context.RepoAccounts + join collateral in _context.Collaterals on account.RepoId equals collateral.RepoId + join member in _context.Borrowers on account.RepoId equals member.RepoId + where + account.AccountNo.ToLower().Contains(updatedSearchPhrase) || + collateral.Vin.ToLower().Contains(updatedSearchPhrase) || + member.IndividualName.ToLower().Contains(updatedSearchPhrase) + select account + ); + + var itemsFound = entities.Count(); + if (itemsFound > maxLimit) + { + throw new MaxItemException(itemsFound); + } + + return await entities + .IncludeAll().Distinct() /* distinct because repo can have multiple collaterals, borrowers */ + .ToListAsync(); + } + + public async Task> FindByCurrentStatus(string currentStatus) + { + return await _context.RepoAccounts.Where(repoAccount => + repoAccount.Status.ToLower() == currentStatus.ToLower()).IncludeAll().ToListAsync(); + } + + public async Task> GetCurrentAccountsOnHoldAtAuction() + { + var noHoldStatus = 0; + return await ( + from repo in _context.RepoAccounts + join auctionAssignment in _context.AuctionAssignments on repo.RepoId equals auctionAssignment.RepoId + where + auctionAssignment.HoldStatus != noHoldStatus && + DateTime.Now < auctionAssignment.HoldUntil + select repo).Distinct().IncludeAll().ToListAsync(); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/RepoCompanyRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/RepoCompanyRepository.cs new file mode 100644 index 0000000..0c9a7ae --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/RepoCompanyRepository.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Persistence; +using Microsoft.EntityFrameworkCore; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories +{ + public class RepoCompanyRepository : BaseRepository, IRepoCompanyRepository + { + public RepoCompanyRepository(AppDbContext context) : base(context) + { + } + + public async Task> ListAsync() + { + return await _context.RepoCompanies.ToListAsync(); + } + + public async Task AddAsync(RepoCompany repoCompany) + { + var result = await _context.RepoCompanies.AddAsync(repoCompany); + return result.Entity; + } + + public async Task FindByIdAsync(int id) + { + return await Queryable.Where(_context.RepoCompanies, x => x.ID == id).FirstOrDefaultAsync(); + } + + + public void Update(RepoCompany repoCompany) + { + _context.RepoCompanies.Update(repoCompany); + } + + public void Remove(RepoCompany repoCompany) + { + _context.RepoCompanies.Remove(repoCompany); + } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/RepoCompanySelectionRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/RepoCompanySelectionRepository.cs new file mode 100644 index 0000000..47c09e0 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/RepoCompanySelectionRepository.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Persistence; +using Microsoft.EntityFrameworkCore; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories +{ + public class RepoCompanySelectionRepository : BaseRepository, IRepoCompanySelectionRepository + { + public RepoCompanySelectionRepository(AppDbContext context) : base(context) {} + + public async Task AddAsync(RepoCompanySelection repoCompanySelection) + { + repoCompanySelection.Id = null; + repoCompanySelection.DateTimeCreated = DateTime.Now; + await _context.RepoCompanySelections.AddAsync(repoCompanySelection); + } + + public async Task FindByIdAsync(int id) + { + return await _context.RepoCompanySelections.Where(repoCompanySelection => repoCompanySelection.Id == id).FirstOrDefaultAsync(); + } + + public async Task> FindByCollateralIdAsync(int collateralId) + { + return await _context.RepoCompanySelections.Where(repoCompanySelection => repoCompanySelection.CollateralId == collateralId).ToListAsync(); + } + + public async Task> ListAllAsync() + { + return await _context.RepoCompanySelections.ToListAsync(); + } + + public void Remove(RepoCompanySelection repoCompanySelection) + { + _context.RepoCompanySelections.Remove(repoCompanySelection); + } + + public void Update(RepoCompanySelection repoCompanySelection) + { + _context.RepoCompanySelections.Update(repoCompanySelection); + } + + public void SaveRange(IList repoCompanySelections) + { + _context.RepoCompanySelections.UpdateRange(repoCompanySelections); + } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/RepoManualStatusRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/RepoManualStatusRepository.cs new file mode 100644 index 0000000..66c4b59 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/RepoManualStatusRepository.cs @@ -0,0 +1,66 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Exceptions; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Persistence; +using Microsoft.EntityFrameworkCore; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories +{ + public class RepoManualStatusRepository : BaseRepository, IRepoManualStatusRepository + { + public RepoManualStatusRepository(AppDbContext context) : base(context) + { + } + + public async Task> ListAllAsync() + { + return await _context.RepoManualStatuses.ToListAsync(); + } + + public async Task> ListWatchStatusesAsync() + { + var statusSet = await (from status in _context.RepoManualStatuses + where status.WatchForStatusChanges == true + select status).ToListAsync(); + + return statusSet.Select(x => x.Description).ToList() as IReadOnlyCollection; + } + + public async Task AddAsync(RepoManualStatus repoManualStatus) + { + // Only Create the Alert if an identical one doesn't already exist + var duplicateStatus = ( + from status in _context.RepoManualStatuses + where status.Description.ToUpper().Trim() == repoManualStatus.Description.ToUpper().Trim() + select status + ); + + if (!duplicateStatus.Any()) + { + await _context.RepoManualStatuses.AddAsync(repoManualStatus); + } + else + { + throw new DuplicateResourceException("RepoManualStatus"); + } + } + + public async Task FindByIdAsync(int id) + { + return await _context.RepoManualStatuses.FindAsync(id); + } + + public void Update(RepoManualStatus repoManualStatus) + { + _context.RepoManualStatuses.Update(repoManualStatus); + } + + public void Remove(RepoManualStatus repoManualStatus) + { + _context.RepoManualStatuses.Remove(repoManualStatus); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/RepoStatusChangeRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/RepoStatusChangeRepository.cs new file mode 100644 index 0000000..e59a036 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/RepoStatusChangeRepository.cs @@ -0,0 +1,38 @@ +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Persistence; +using Microsoft.EntityFrameworkCore; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories +{ + public class RepoStatusChangeRepository : BaseRepository, IRepoStatusChangeRepository + { + public RepoStatusChangeRepository(AppDbContext context) : base(context) + { + } + + public async Task> ListAsync() + { + return await _context.RepoStatusChanges.ToListAsync(); + } + + public async Task> ListForAccountAsync(int repoAccountId) + { + return await Queryable.Where(_context.RepoStatusChanges, p => p.RepoId == repoAccountId).ToListAsync(); + } + + public async Task AddAsync(RepoStatusChange statusChange) + { + var result = await _context.RepoStatusChanges.AddAsync(statusChange); + return result.Entity; + } + + public async Task FindByIdAsync(int id) + { + return await _context.RepoStatusChanges.FindAsync(id); + } + + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/ReportingRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/ReportingRepository.cs new file mode 100644 index 0000000..97fa771 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/ReportingRepository.cs @@ -0,0 +1,255 @@ +using System; +using System.Collections.Generic; +using System.Data.SqlClient; +using System.Linq; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Extensions; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Models.Reporting; +using LCU.Shared.Collections.RepoApiLib.Persistence; +using Microsoft.EntityFrameworkCore; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories +{ + public class ReportingRepository : BaseRepository, IReportingRepository + { + public ReportingRepository(AppDbContext context) : base(context) + { + } + + // Maybe return a condensed object specifically meant for the frontend? + public async Task> GetAllAccountsInO4R() + { + return await _context.RepoAccounts.Where(repoAccount => repoAccount.Status == "O4R") + .IncludeAll() + .ToListAsync(); + } + + public async Task> GetActiveAccounts() + { + return await _context.ActiveAccountEntries.FromSql( + @"select repos.repoId as RepoId, repos.DaysDelinquent as DaysDelinquent, repos.LastPaymentDate as LastPaymentDate, repos.LstPmtAmt as LastPaymentAmount, + Repos.Balance as Balance, Repos.AccountTypeCode as AccountTypeCode, Repos.Bankruptcy as Bankruptcy, Repos.DateClosed as DateClosed, + Repos.DelinquentAmount as DelinquentAmount, Repos.Collector as Collector, Borrowers.IndividualName, repos.AccountNo as AccountNo, + Collaterals.Year as Year, Collaterals.Make as Make, Collaterals.Model as Model, RepoCompany.Name as RepoCompany, + RepoCompanySelections.DateRepoed as DateRepoed, RepoCompanySelections.RepoType, + RepoCompanySelections.RepoCompanyAssignmentDate as DateAssigned, + Repos.Status as Status, DATEDIFF(day, RepoStatusChanges.ChangedDate, CURRENT_TIMESTAMP) as DaysInStatus, IMSAutoFileData.SoldDate as SoldDate, + IMSAutoFileData.DateEnteredAutoIMS as DateEnteredAutoIMS, IMSAutoFileData.FloorPriceAccepted as FloorPrice, IMSAutoFileData.VehicleGrade as Grade, + IMSAutoFileData.ScheduledSaleDate as ScheduledSaleDate, IMSAutoFileData.TotalCharges as TotalCharges, + IMSAutoFileData.GrossPercentFloor as GrossPercentFloor, IMSAutoFileData.NetPercentFloor as NetPercentFloor, + IMSAutoFileData.SalePrice as GrossSalePrice, + Auctions.Name as AuctionHouse, AuctionAssignments.DateSubmitted as AuctionDate + From repos + left join RepoStatusChanges on RepoStatusChanges.RepoId = Repos.RepoId + and RepoStatusChanges.ChangedDate = (select max(ChangedDate) from RepoStatusChanges where RepoId = repos.RepoId) + join Borrowers on Borrowers.RepoId = Repos.RepoId and Borrowers.OwnershipType = 6 + join Collaterals on Collaterals.RepoId = Repos.RepoId + join RepoCompanySelections on Collaterals.CollateralId = RepoCompanySelections.CollateralId and RepoCompanySelections.DateTimeCreated = (select max(DateTimeCreated) from RepoCompanySelections where CollateralId = Collaterals.CollateralId) + left join RepoCompany on RepoCompanySelections.RepoCompanyId = RepoCompany.ID + left join AuctionAssignmentsToCollaterals on Collaterals.CollateralId = AuctionAssignmentsToCollaterals.CollateralId + left join AuctionAssignments on AuctionAssignmentsToCollaterals.AuctionAssignmentId = AuctionAssignments.ID + left join IMSAutoFileData on Repos.RepoId = IMSAutoFileData.RepoId + left join Auctions on Auctions.AuctionID = AuctionAssignments.AuctionId + where repos.status != 'REDEEMED' and repos.dateclosed is null + order by DateAssigned desc; + ").ToListAsync(); + } + + + public async Task> GetClosedAccounts(DateTime lowDateTime, DateTime highDateTime) + { + var lowDate = new SqlParameter("lowDate", lowDateTime); + var highDate = new SqlParameter("highDate", highDateTime); + return await _context.ActiveAccountEntries.FromSql( + @"select repos.repoId as RepoId, repos.DaysDelinquent as DaysDelinquent, repos.LastPaymentDate as LastPaymentDate, repos.LstPmtAmt as LastPaymentAmount, + Repos.Balance as Balance, Repos.AccountTypeCode as AccountTypeCode, Repos.Bankruptcy as Bankruptcy, Repos.DateClosed as DateClosed, + Repos.DelinquentAmount as DelinquentAmount, Repos.Collector as Collector, Borrowers.IndividualName, repos.AccountNo as AccountNo, + Collaterals.Year as Year, Collaterals.Make as Make, Collaterals.Model as Model, RepoCompany.Name as RepoCompany, + RepoCompanySelections.DateRepoed as DateRepoed, RepoCompanySelections.RepoType, + RepoCompanySelections.RepoCompanyAssignmentDate as DateAssigned, + Repos.Status as Status, DATEDIFF(day, RepoStatusChanges.ChangedDate, CURRENT_TIMESTAMP) as DaysInStatus, IMSAutoFileData.SoldDate as SoldDate, + IMSAutoFileData.DateEnteredAutoIMS as DateEnteredAutoIMS, IMSAutoFileData.FloorPriceAccepted as FloorPrice, IMSAutoFileData.VehicleGrade as Grade, + IMSAutoFileData.ScheduledSaleDate as ScheduledSaleDate, IMSAutoFileData.TotalCharges as TotalCharges, + IMSAutoFileData.GrossPercentFloor as GrossPercentFloor, IMSAutoFileData.NetPercentFloor as NetPercentFloor, + IMSAutoFileData.SalePrice as GrossSalePrice, + Auctions.Name as AuctionHouse, AuctionAssignments.DateSubmitted as AuctionDate + From repos + left join RepoStatusChanges on RepoStatusChanges.RepoId = Repos.RepoId + and RepoStatusChanges.ChangedDate = (select max(ChangedDate) from RepoStatusChanges where RepoId = repos.RepoId) + join Borrowers on Borrowers.RepoId = Repos.RepoId and Borrowers.OwnershipType = 6 + join Collaterals on Collaterals.RepoId = Repos.RepoId + join RepoCompanySelections on Collaterals.CollateralId = RepoCompanySelections.CollateralId and RepoCompanySelections.DateTimeCreated = (select max(DateTimeCreated) from RepoCompanySelections where CollateralId = Collaterals.CollateralId) + left join RepoCompany on RepoCompanySelections.RepoCompanyId = RepoCompany.ID + left join AuctionAssignmentsToCollaterals on Collaterals.CollateralId = AuctionAssignmentsToCollaterals.CollateralId + left join AuctionAssignments on AuctionAssignmentsToCollaterals.AuctionAssignmentId = AuctionAssignments.ID + left join IMSAutoFileData on Repos.RepoId = IMSAutoFileData.RepoId + left join Auctions on Auctions.AuctionID = AuctionAssignments.AuctionId + where repos.status in ('PSKP', 'REDEEMED') or (repos.DateClosed is not null and repos.DateClosed >= @lowDate and repos.DateClosed <= @highDate) + order by DateAssigned desc; + ", lowDate, highDate).ToListAsync(); + } + + public async Task> GetAccountsByDateSoldInAutoIMS(DateTime lowDateTime, DateTime highDateTime) + { + return await GetAccountsWithinDateRange(lowDateTime, highDateTime, "SoldDate"); + } + + public async Task> GetAccountsByDateRepoed(DateTime lowDateTime, DateTime highDateTime) + { + return await GetAccountsWithinDateRange(lowDateTime, highDateTime, "DateRepoed"); + } + + public async Task> GetAccountsByDateAssigned(DateTime lowDateTime, DateTime highDateTime) + { + return await GetAccountsWithinDateRange(lowDateTime, highDateTime, "RepoCompanyAssignmentDate"); + } + + public async Task> GetAccountsByStatusChangeInPeriod(string status, DateTime lowDateTime, DateTime highDateTime) + { + return await GetAccountsWithLatestStatusChangeInPeriod(lowDateTime, highDateTime, status); + } + + public async Task> GetAccountsByO4RDate(DateTime lowDateTime, DateTime highDateTime) + { + return await GetAccountsWithinDateRange(lowDateTime, highDateTime, "O4RDate"); + } + + private async Task> GetAccountsWithinDateRange(DateTime lowDateTime, DateTime highDateTime, string dateFieldToFilter) + { + var lowDate = new SqlParameter("lowDate", lowDateTime); + var highDate = new SqlParameter("highDate", highDateTime); + return await _context.StandardReportEntries.FromSql( + $@" + select + repos.repoId as RepoId, + repos.Balance as Balance, + repos.AccountNo as AccountNo, + repos.AccountTypeCode as AccountTypeCode, + repos.Bankruptcy as Bankruptcy, + repos.Collector as Collector, + repos.O4RDate as O4RDate, + DATEDIFF(day, Repos.DueToPayDate, CURRENT_TIMESTAMP) as DaysCurrentDelq, + Repos.DaysDelinquent as DaysDelqWhenAdded, + Repos.Status as Status, + (select max(ChangedDate) from RepoStatusChanges where RepoId = repos.RepoId) as MostRecentStatusChangeDate, + DATEDIFF(day, RepoStatusChanges.ChangedDate, CURRENT_TIMESTAMP) as DaysInStatus, + RepoStatusChanges.ChangedDate as StatusChangeDate, + Repos.LstPmtAmt as LastPaymentAmount, + Repos.LastPaymentDate as LastPaymentDate, + Repos.DelinquentAmount as DelinquentAmount, + Collaterals.CollateralId as CollateralId, + RepoCompanySelections.RepoCompanyId as RepoCompanyId, + Collaterals.Year as Year, + Collaterals.Make as Make, + Collaterals.Model as Model, + RepoCompany.Name as RepoCompany, + RepoCompanySelections.DateRepoed as DateRepoed, + RepoCompanySelections.RepoCompanyAssignmentDate as RepoCompanyAssignmentDate, + RepoCompanySelections.RepoType as RepoType, + DATEDIFF(day, RepoCompanySelections.RepoCompanyAssignmentDate, RepoCompanySelections.DateRepoed) as RepoDuration, + AuctionAssignments.AuctionId as AuctionId, + Auctions.Name as AuctionName, + IMSAutoFileData.Status as AutoImsStatus, + IMSAutoFileData.SoldDate as SoldDate, + IMSAutoFileData.DateEnteredAutoIMS as DateEnteredAutoIMS, + IMSAutoFileData.ScheduledSaleDate as ScheduledSaleDate, + IMSAutoFileData.VehicleGrade as Grade, IMSAutoFileData.FloorPriceAccepted as FloorPrice, + IMSAutoFileData.SalePrice as GrossSalePrice, + IMSAutoFileData.GrossPercentFloor as GrossPercentFloor, + IMSAutoFileData.NetPercentFloor as NetPercentFloor, + IMSAutoFileData.TotalCharges as TotalCharges, + Borrowers.IndividualName as IndividualName, + null as FilteredStatus, + null as FilteredStatusChangeDate + From repos + left join RepoStatusChanges on RepoStatusChanges.RepoId = Repos.RepoId + and RepoStatusChanges.ChangedDate = (select max(ChangedDate) from RepoStatusChanges where RepoId = repos.RepoId) + left join Collaterals on Collaterals.RepoId = Repos.RepoId + left join RepoCompanySelections on Collaterals.CollateralId = RepoCompanySelections.CollateralId + left join RepoCompany on RepoCompanySelections.RepoCompanyId = RepoCompany.ID + left join AuctionAssignmentsToCollaterals on Collaterals.CollateralId = AuctionAssignmentsToCollaterals.CollateralId + left join AuctionAssignments on AuctionAssignmentsToCollaterals.AuctionAssignmentId = AuctionAssignments.ID + left join Auctions on Auctions.AuctionID = AuctionAssignments.AuctionId + left join IMSAutoFileData on Repos.RepoId = IMSAutoFileData.RepoId + left join Borrowers on Repos.RepoId = Borrowers.RepoId and Borrowers.OwnershipType = 6 + where RepoCompanySelections.DateTimeCreated = ( + select max(RepoCompanySelections.DateTimeCreated) + from RepoCompanySelections + where RepoCompanySelections.CollateralId = Collaterals.CollateralId + ) and {dateFieldToFilter} >= @lowDate and {dateFieldToFilter} <= @highDate + ", lowDate, highDate).Distinct().ToListAsync(); + } + + private async Task> GetAccountsWithLatestStatusChangeInPeriod(DateTime lowDateTime, DateTime highDateTime, string status) + { + var lowDate = new SqlParameter("lowDate", lowDateTime); + var highDate = new SqlParameter("highDate", highDateTime); + var repoStatus = new SqlParameter("repoStatus", status); + return await _context.StandardReportEntries.FromSql( + $@" + select + repos.repoId as RepoId, + repos.Balance as Balance, + repos.AccountNo as AccountNo, + repos.AccountTypeCode as AccountTypeCode, + repos.Bankruptcy as Bankruptcy, + repos.Collector as Collector, + repos.O4RDate as O4RDate, + DATEDIFF(day, Repos.DueToPayDate, CURRENT_TIMESTAMP) as DaysCurrentDelq, + Repos.DaysDelinquent as DaysDelqWhenAdded, + Repos.Status as Status, + (select max(ChangedDate) from RepoStatusChanges where RepoId = repos.RepoId) as MostRecentStatusChangeDate, + DATEDIFF(day, RepoStatusChanges.ChangedDate, CURRENT_TIMESTAMP) as DaysInStatus, + RepoStatusChanges.ChangedDate as StatusChangeDate, + Repos.LstPmtAmt as LastPaymentAmount, + Repos.LastPaymentDate as LastPaymentDate, + Repos.DelinquentAmount as DelinquentAmount, + Collaterals.CollateralId as CollateralId, + RepoCompanySelections.RepoCompanyId as RepoCompanyId, + Collaterals.Year as Year, + Collaterals.Make as Make, + Collaterals.Model as Model, + RepoCompany.Name as RepoCompany, + RepoCompanySelections.DateRepoed as DateRepoed, + RepoCompanySelections.RepoCompanyAssignmentDate as RepoCompanyAssignmentDate, + RepoCompanySelections.RepoType as RepoType, + DATEDIFF(day, RepoCompanySelections.RepoCompanyAssignmentDate, RepoCompanySelections.DateRepoed) as RepoDuration, + AuctionAssignments.AuctionId as AuctionId, + Auctions.Name as AuctionName, + IMSAutoFileData.Status as AutoImsStatus, + IMSAutoFileData.SoldDate as SoldDate, + IMSAutoFileData.DateEnteredAutoIMS as DateEnteredAutoIMS, + IMSAutoFileData.ScheduledSaleDate as ScheduledSaleDate, + IMSAutoFileData.VehicleGrade as Grade, IMSAutoFileData.FloorPriceAccepted as FloorPrice, + IMSAutoFileData.SalePrice as GrossSalePrice, + IMSAutoFileData.GrossPercentFloor as GrossPercentFloor, + IMSAutoFileData.NetPercentFloor as NetPercentFloor, + IMSAutoFileData.TotalCharges as TotalCharges, + Borrowers.IndividualName as IndividualName, + DesiredStatusChange.StatusTo as FilteredStatus, + DesiredStatusChange.ChangedDate as FilteredStatusChangeDate + From repos + left join RepoStatusChanges on RepoStatusChanges.RepoId = Repos.RepoId + and RepoStatusChanges.ChangedDate = (select max(ChangedDate) from RepoStatusChanges where RepoId = repos.RepoId) + left join Collaterals on Collaterals.RepoId = Repos.RepoId + left join RepoCompanySelections on Collaterals.CollateralId = RepoCompanySelections.CollateralId + left join RepoCompany on RepoCompanySelections.RepoCompanyId = RepoCompany.ID + left join AuctionAssignmentsToCollaterals on Collaterals.CollateralId = AuctionAssignmentsToCollaterals.CollateralId + left join AuctionAssignments on AuctionAssignmentsToCollaterals.AuctionAssignmentId = AuctionAssignments.ID + left join Auctions on Auctions.AuctionID = AuctionAssignments.AuctionId + left join IMSAutoFileData on Repos.RepoId = IMSAutoFileData.RepoId + left join Borrowers on Repos.RepoId = Borrowers.RepoId and Borrowers.OwnershipType = 6 + inner join RepoStatusChanges DesiredStatusChange on DesiredStatusChange.RepoId = Repos.RepoId + and DesiredStatusChange.StatusTo = @repoStatus + and DesiredStatusChange.ChangedDate >= @lowDate + and DesiredStatusChange.ChangedDate <= @highDate + where RepoCompanySelections.DateTimeCreated = ( + select max(RepoCompanySelections.DateTimeCreated) + from RepoCompanySelections + where RepoCompanySelections.CollateralId = Collaterals.CollateralId + ) + ", lowDate, highDate, repoStatus).Distinct().ToListAsync(); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/SavedLocationRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/SavedLocationRepository.cs new file mode 100644 index 0000000..dcbbef3 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/SavedLocationRepository.cs @@ -0,0 +1,41 @@ +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Persistence; +using Microsoft.EntityFrameworkCore; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories +{ + public class SavedLocationRepository : BaseRepository, ISavedLocationRepository + { + public SavedLocationRepository(AppDbContext context) : base(context) { } + + public async Task> ListAsync() + { + return await _context.SavedLocations.ToListAsync(); + } + + public async Task FindByIdAsync(int id) + { + return await _context.SavedLocations.Where(savedLocation => savedLocation.ID == id).FirstOrDefaultAsync(); + } + + public async Task AddAsync(SavedLocation savedLocation) + { + var result = await _context.SavedLocations.AddAsync(savedLocation); + return result.Entity; + } + + public void Update(SavedLocation savedLocation) + { + _context.SavedLocations.Update(savedLocation); + } + + public void Remove(SavedLocation savedLocation) + { + _context.Remove(savedLocation); + } + + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/AccountTypeRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/AccountTypeRepository.cs new file mode 100644 index 0000000..4e6cc38 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/AccountTypeRepository.cs @@ -0,0 +1,42 @@ +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models.Settings; +using LCU.Shared.Collections.RepoApiLib.Persistence; +using Microsoft.EntityFrameworkCore; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories.Settings +{ + public class AccountTypeRepository : BaseRepository, IAccountTypeRepository + { + + public AccountTypeRepository(AppDbContext context) : base(context) + { + } + + public async Task> ListAllAsync() + { + return await _context.AccountTypeCodes.ToListAsync(); + } + + public async Task AddAsync(AccountType accountTypeCodes) + { + await _context.AccountTypeCodes.AddAsync(accountTypeCodes); + } + + public async Task FindByIdAsync(int id) + { + return await _context.AccountTypeCodes.Where(c => c.ID == id).FirstOrDefaultAsync(); + } + + public void Update(AccountType category) + { + _context.AccountTypeCodes.Update(category); + } + + public void Remove(AccountType category) + { + _context.AccountTypeCodes.Remove(category); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/AllowedStatusChangeRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/AllowedStatusChangeRepository.cs new file mode 100644 index 0000000..3edc948 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/AllowedStatusChangeRepository.cs @@ -0,0 +1,42 @@ +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models.Settings; +using LCU.Shared.Collections.RepoApiLib.Persistence; +using Microsoft.EntityFrameworkCore; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories.Settings +{ + public class AllowedStatusChangeRepository : BaseRepository, IAllowedStatusChangeRepository + { + + public AllowedStatusChangeRepository(AppDbContext context) : base(context) + { + } + + public async Task> ListAllAsync() + { + return await _context.AllowedStatusChanges.ToListAsync(); + } + + public async Task AddAsync(AllowedStatusChange allowedStatusChanges) + { + await _context.AllowedStatusChanges.AddAsync(allowedStatusChanges); + } + + public async Task FindByIdAsync(int id) + { + return await _context.AllowedStatusChanges.Where(c => c.ID == id).FirstOrDefaultAsync(); + } + + public void Update(AllowedStatusChange category) + { + _context.AllowedStatusChanges.Update(category); + } + + public void Remove(AllowedStatusChange category) + { + _context.AllowedStatusChanges.Remove(category); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/BodyStyleRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/BodyStyleRepository.cs new file mode 100644 index 0000000..41d07c9 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/BodyStyleRepository.cs @@ -0,0 +1,42 @@ +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models.Settings; +using LCU.Shared.Collections.RepoApiLib.Persistence; +using Microsoft.EntityFrameworkCore; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories.Settings +{ + public class BodyStyleRepository : BaseRepository, IBodyStyleRepository + { + + public BodyStyleRepository(AppDbContext context) : base(context) + { + } + + public async Task> ListAllAsync() + { + return await _context.BodyStyleCodes.ToListAsync(); + } + + public async Task AddAsync(BodyStyle bodyStyleCodes) + { + await _context.BodyStyleCodes.AddAsync(bodyStyleCodes); + } + + public async Task FindByIdAsync(string id) + { + return await _context.BodyStyleCodes.Where(c => c.Code.Equals(id)).FirstOrDefaultAsync(); + } + + public void Update(BodyStyle category) + { + _context.BodyStyleCodes.Update(category); + } + + public void Remove(BodyStyle category) + { + _context.BodyStyleCodes.Remove(category); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/CleaningLevelRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/CleaningLevelRepository.cs new file mode 100644 index 0000000..2df65ef --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/CleaningLevelRepository.cs @@ -0,0 +1,42 @@ +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models.Settings; +using LCU.Shared.Collections.RepoApiLib.Persistence; +using Microsoft.EntityFrameworkCore; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories.Settings +{ + public class CleaningLevelRepository : BaseRepository, ICleaningLevelRepository + { + + public CleaningLevelRepository(AppDbContext context) : base(context) + { + } + + public async Task> ListAllAsync() + { + return await _context.CleaningLevelCodes.ToListAsync(); + } + + public async Task AddAsync(CleaningLevel cleaningLevelCodes) + { + await _context.CleaningLevelCodes.AddAsync(cleaningLevelCodes); + } + + public async Task FindByIdAsync(int id) + { + return await _context.CleaningLevelCodes.Where(c => c.Code == id).FirstOrDefaultAsync(); + } + + public void Update(CleaningLevel category) + { + _context.CleaningLevelCodes.Update(category); + } + + public void Remove(CleaningLevel category) + { + _context.CleaningLevelCodes.Remove(category); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/CollateralTypeRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/CollateralTypeRepository.cs new file mode 100644 index 0000000..95ffca2 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/CollateralTypeRepository.cs @@ -0,0 +1,42 @@ +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models.Settings; +using LCU.Shared.Collections.RepoApiLib.Persistence; +using Microsoft.EntityFrameworkCore; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories.Settings +{ + public class CollateralTypeRepository : BaseRepository, ICollateralTypeRepository + { + + public CollateralTypeRepository(AppDbContext context) : base(context) + { + } + + public async Task> ListAllAsync() + { + return await _context.CollateralTypes.ToListAsync(); + } + + public async Task AddAsync(CollateralType collateralTypes) + { + await _context.CollateralTypes.AddAsync(collateralTypes); + } + + public async Task FindByIdAsync(int id) + { + return await _context.CollateralTypes.Where(c => c.ID == id).FirstOrDefaultAsync(); + } + + public void Update(CollateralType category) + { + _context.CollateralTypes.Update(category); + } + + public void Remove(CollateralType category) + { + _context.CollateralTypes.Remove(category); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/CollateralTypeToVehicleTypeRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/CollateralTypeToVehicleTypeRepository.cs new file mode 100644 index 0000000..dcdb557 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/CollateralTypeToVehicleTypeRepository.cs @@ -0,0 +1,42 @@ +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models.Settings; +using LCU.Shared.Collections.RepoApiLib.Persistence; +using Microsoft.EntityFrameworkCore; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories.Settings +{ + public class CollateralTypeToVehicleTypeRepository : BaseRepository, ICollateralTypeToVehicleTypeRepository + { + + public CollateralTypeToVehicleTypeRepository(AppDbContext context) : base(context) + { + } + + public async Task> ListAllAsync() + { + return await _context.CollateralTypesToVehicleTypes.ToListAsync(); + } + + public async Task AddAsync(CollateralTypeToVehicleType collateralTypesToVehicleTypes) + { + await _context.CollateralTypesToVehicleTypes.AddAsync(collateralTypesToVehicleTypes); + } + + public async Task FindByIdAsync(int id) + { + return await _context.CollateralTypesToVehicleTypes.Where(c => c.ID == id).FirstOrDefaultAsync(); + } + + public void Update(CollateralTypeToVehicleType category) + { + _context.CollateralTypesToVehicleTypes.Update(category); + } + + public void Remove(CollateralTypeToVehicleType category) + { + _context.CollateralTypesToVehicleTypes.Remove(category); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/HoldStatusRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/HoldStatusRepository.cs new file mode 100644 index 0000000..1473a01 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/HoldStatusRepository.cs @@ -0,0 +1,42 @@ +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models.Settings; +using LCU.Shared.Collections.RepoApiLib.Persistence; +using Microsoft.EntityFrameworkCore; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories.Settings +{ + public class HoldStatusRepository : BaseRepository, IHoldStatusRepository + { + + public HoldStatusRepository(AppDbContext context) : base(context) + { + } + + public async Task> ListAllAsync() + { + return await _context.HoldStatusCodes.ToListAsync(); + } + + public async Task AddAsync(HoldStatus holdStatusCodes) + { + await _context.HoldStatusCodes.AddAsync(holdStatusCodes); + } + + public async Task FindByIdAsync(int id) + { + return await _context.HoldStatusCodes.Where(c => c.Code == id).FirstOrDefaultAsync(); + } + + public void Update(HoldStatus category) + { + _context.HoldStatusCodes.Update(category); + } + + public void Remove(HoldStatus category) + { + _context.HoldStatusCodes.Remove(category); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/IAccountTypeRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/IAccountTypeRepository.cs new file mode 100644 index 0000000..905eb1d --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/IAccountTypeRepository.cs @@ -0,0 +1,15 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models.Settings; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories.Settings +{ + public interface IAccountTypeRepository + { + Task> ListAllAsync(); + Task AddAsync(AccountType code); + Task FindByIdAsync(int id); + void Update(AccountType code); + void Remove(AccountType code); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/IAllowedStatusChangeRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/IAllowedStatusChangeRepository.cs new file mode 100644 index 0000000..48a6cf8 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/IAllowedStatusChangeRepository.cs @@ -0,0 +1,15 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models.Settings; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories.Settings +{ + public interface IAllowedStatusChangeRepository + { + Task> ListAllAsync(); + Task AddAsync(AllowedStatusChange change); + Task FindByIdAsync(int id); + void Update(AllowedStatusChange change); + void Remove(AllowedStatusChange change); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/IBodyStyleRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/IBodyStyleRepository.cs new file mode 100644 index 0000000..5b6a95e --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/IBodyStyleRepository.cs @@ -0,0 +1,15 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models.Settings; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories.Settings +{ + public interface IBodyStyleRepository + { + Task> ListAllAsync(); + Task AddAsync(BodyStyle code); + Task FindByIdAsync(string id); + void Update(BodyStyle code); + void Remove(BodyStyle code); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/ICleaningLevelRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/ICleaningLevelRepository.cs new file mode 100644 index 0000000..774287a --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/ICleaningLevelRepository.cs @@ -0,0 +1,15 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models.Settings; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories.Settings +{ + public interface ICleaningLevelRepository + { + Task> ListAllAsync(); + Task AddAsync(CleaningLevel code); + Task FindByIdAsync(int id); + void Update(CleaningLevel code); + void Remove(CleaningLevel code); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/ICollateralTypeRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/ICollateralTypeRepository.cs new file mode 100644 index 0000000..4014d7d --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/ICollateralTypeRepository.cs @@ -0,0 +1,15 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models.Settings; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories.Settings +{ + public interface ICollateralTypeRepository + { + Task> ListAllAsync(); + Task AddAsync(CollateralType type); + Task FindByIdAsync(int id); + void Update(CollateralType type); + void Remove(CollateralType type); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/ICollateralTypeToVehicleTypeRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/ICollateralTypeToVehicleTypeRepository.cs new file mode 100644 index 0000000..5c41413 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/ICollateralTypeToVehicleTypeRepository.cs @@ -0,0 +1,15 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models.Settings; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories.Settings +{ + public interface ICollateralTypeToVehicleTypeRepository + { + Task> ListAllAsync(); + Task AddAsync(CollateralTypeToVehicleType type); + Task FindByIdAsync(int id); + void Update(CollateralTypeToVehicleType type); + void Remove(CollateralTypeToVehicleType type); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/IHoldStatusRepostiory.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/IHoldStatusRepostiory.cs new file mode 100644 index 0000000..7a0f27a --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/IHoldStatusRepostiory.cs @@ -0,0 +1,15 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models.Settings; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories.Settings +{ + public interface IHoldStatusRepository + { + Task> ListAllAsync(); + Task AddAsync(HoldStatus code); + Task FindByIdAsync(int id); + void Update(HoldStatus code); + void Remove(HoldStatus code); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/ILoanCategoryRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/ILoanCategoryRepository.cs new file mode 100644 index 0000000..11146ce --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/ILoanCategoryRepository.cs @@ -0,0 +1,15 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models.Settings; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories.Settings +{ + public interface ILoanCategoryRepository + { + Task> ListAllAsync(); + Task AddAsync(LoanCategory category); + Task FindByIdAsync(int id); + void Update(LoanCategory category); + void Remove(LoanCategory category); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/ILocationTypeRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/ILocationTypeRepository.cs new file mode 100644 index 0000000..9f40449 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/ILocationTypeRepository.cs @@ -0,0 +1,15 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models.Settings; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories.Settings +{ + public interface ILocationTypeRepository + { + Task> ListAllAsync(); + Task AddAsync(LocationType code); + Task FindByIdAsync(int id); + void Update(LocationType code); + void Remove(LocationType code); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/IVehicleTypeRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/IVehicleTypeRepository.cs new file mode 100644 index 0000000..eda99ea --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/IVehicleTypeRepository.cs @@ -0,0 +1,15 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models.Settings; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories.Settings +{ + public interface IVehicleTypeRepository + { + Task> ListAllAsync(); + Task AddAsync(VehicleType code); + Task FindByIdAsync(string id); + void Update(VehicleType code); + void Remove(VehicleType code); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/LoanCategoryRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/LoanCategoryRepository.cs new file mode 100644 index 0000000..02d9522 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/LoanCategoryRepository.cs @@ -0,0 +1,42 @@ +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models.Settings; +using LCU.Shared.Collections.RepoApiLib.Persistence; +using Microsoft.EntityFrameworkCore; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories.Settings +{ + public class LoanCategoryRepository : BaseRepository, ILoanCategoryRepository + { + + public LoanCategoryRepository(AppDbContext context) : base(context) + { + } + + public async Task> ListAllAsync() + { + return await _context.LoanCategories.ToListAsync(); + } + + public async Task AddAsync(LoanCategory loanCategories) + { + await _context.LoanCategories.AddAsync(loanCategories); + } + + public async Task FindByIdAsync(int id) + { + return await _context.LoanCategories.Where(c => c.ID == id).FirstOrDefaultAsync(); + } + + public void Update(LoanCategory category) + { + _context.LoanCategories.Update(category); + } + + public void Remove(LoanCategory category) + { + _context.LoanCategories.Remove(category); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/LocationTypeRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/LocationTypeRepository.cs new file mode 100644 index 0000000..f7f3614 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/LocationTypeRepository.cs @@ -0,0 +1,42 @@ +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models.Settings; +using LCU.Shared.Collections.RepoApiLib.Persistence; +using Microsoft.EntityFrameworkCore; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories.Settings +{ + public class LocationTypeRepository : BaseRepository, ILocationTypeRepository + { + + public LocationTypeRepository(AppDbContext context) : base(context) + { + } + + public async Task> ListAllAsync() + { + return await _context.LocationTypeCodes.ToListAsync(); + } + + public async Task AddAsync(LocationType locationTypeCodes) + { + await _context.LocationTypeCodes.AddAsync(locationTypeCodes); + } + + public async Task FindByIdAsync(int id) + { + return await _context.LocationTypeCodes.Where(c => c.Code == id).FirstOrDefaultAsync(); + } + + public void Update(LocationType category) + { + _context.LocationTypeCodes.Update(category); + } + + public void Remove(LocationType category) + { + _context.LocationTypeCodes.Remove(category); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/VehicleTypeRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/VehicleTypeRepository.cs new file mode 100644 index 0000000..c9b1069 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/Settings/VehicleTypeRepository.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models.Settings; +using LCU.Shared.Collections.RepoApiLib.Persistence; +using Microsoft.EntityFrameworkCore; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories.Settings +{ + public class VehicleTypeRepository : BaseRepository, IVehicleTypeRepository + { + + public VehicleTypeRepository(AppDbContext context) : base(context) + { + } + + public async Task> ListAllAsync() + { + return await _context.VehicleTypeCodes.ToListAsync(); + } + + public async Task AddAsync(VehicleType vehicleTypeCodes) + { + await _context.VehicleTypeCodes.AddAsync(vehicleTypeCodes); + } + + public async Task FindByIdAsync(string id) + { + return await _context.VehicleTypeCodes.Where(c => c.Code.Equals(id)).FirstOrDefaultAsync(); + } + + public void Update(VehicleType category) + { + _context.VehicleTypeCodes.Update(category); + } + + public void Remove(VehicleType category) + { + _context.VehicleTypeCodes.Remove(category); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/UnitOfWork.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/UnitOfWork.cs new file mode 100644 index 0000000..c8413b4 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/UnitOfWork.cs @@ -0,0 +1,20 @@ +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Persistence; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories +{ + public class UnitOfWork : IUnitOfWork + { + private readonly AppDbContext _context; + + public UnitOfWork(AppDbContext context) + { + _context = context; + } + + public async Task CompleteAsync() + { + await _context.SaveChangesAsync(); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/VehicleFloorPricingParametersRepository.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/VehicleFloorPricingParametersRepository.cs new file mode 100644 index 0000000..fc9f31e --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Repositories/VehicleFloorPricingParametersRepository.cs @@ -0,0 +1,42 @@ +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using LCU.Shared.Collections.RepoApiLib.Models; +using LCU.Shared.Collections.RepoApiLib.Persistence; +using Microsoft.EntityFrameworkCore; + +namespace LCU.Shared.Collections.RepoApiLib.Repositories +{ + public class VehicleFloorPricingParametersRepository : BaseRepository, IVehicleFloorPricingParametersRepository + { + + public VehicleFloorPricingParametersRepository(AppDbContext context) : base(context) + { + } + + public async Task> ListAllAsync() + { + return await _context.VehicleFloorPricingParameters.ToListAsync(); + } + + public async Task AddAsync(VehicleFloorPricingParameters parameters) + { + await _context.VehicleFloorPricingParameters.AddAsync(parameters); + } + + public async Task FindByIdAsync(int id) + { + return await Queryable.Where(_context.VehicleFloorPricingParameters, c => c.Id == id).FirstOrDefaultAsync(); + } + + public void Update(VehicleFloorPricingParameters parameters) + { + _context.VehicleFloorPricingParameters.Update(parameters); + } + + public void Remove(VehicleFloorPricingParameters parameters) + { + _context.VehicleFloorPricingParameters.Remove(parameters); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Security/AzureActiveDirectoryOptions.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Security/AzureActiveDirectoryOptions.cs new file mode 100644 index 0000000..60c1091 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Security/AzureActiveDirectoryOptions.cs @@ -0,0 +1,13 @@ + +namespace LCU.Shared.Collections.RepoApiLib.Security +{ + public class AzureActiveDirectoryOptions + { + public string ClientId { get; set; } + public string ClientSecret { get; set; } + public string Instance { get; set; } + public string Domain { get; set; } + public string TenantId { get; set; } + public string ValidAudience { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Security/AzureAdServiceCollectionExtensions.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Security/AzureAdServiceCollectionExtensions.cs new file mode 100644 index 0000000..9f0ecda --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Security/AzureAdServiceCollectionExtensions.cs @@ -0,0 +1,49 @@ +using System; +using Microsoft.AspNetCore.Authentication; +using Microsoft.AspNetCore.Authentication.JwtBearer; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; +using Microsoft.IdentityModel.Tokens; + +namespace LCU.Shared.Collections.RepoApiLib.Security +{ + public static class AzureAdServiceCollectionExtensions + { + public static AuthenticationBuilder AddAzureAdBearer(this AuthenticationBuilder builder) + => builder.AddAzureAdBearer(_ => { }); + + public static AuthenticationBuilder AddAzureAdBearer(this AuthenticationBuilder builder, Action configureOptions) + { + builder.Services.Configure(configureOptions); + builder.Services.AddSingleton, ConfigureAzureOptions>(); + builder.AddJwtBearer(); + return builder; + } + + private class ConfigureAzureOptions : IConfigureNamedOptions + { + private readonly AzureActiveDirectoryOptions _azureOptions; + + public ConfigureAzureOptions(IOptions azureOptions) + { + _azureOptions = azureOptions.Value; + } + + public void Configure(string name, JwtBearerOptions options) + { + options.Audience = _azureOptions.ClientId; + options.Authority = $"{_azureOptions.Instance}{_azureOptions.TenantId}"; + + options.TokenValidationParameters = new TokenValidationParameters + { + ValidAudience = _azureOptions.ValidAudience + }; + } + + public void Configure(JwtBearerOptions options) + { + Configure(Options.DefaultName, options); + } + } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Utilities/ClientHelpers.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Utilities/ClientHelpers.cs new file mode 100644 index 0000000..34a8f96 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Utilities/ClientHelpers.cs @@ -0,0 +1,65 @@ +using Newtonsoft.Json; +using Serilog; +using System; +using System.Net; +using System.Net.Http; +using System.Text; + +namespace LCU.Shared.Collections.RepoApiLib.Utilities +{ + public class ClientHelpers : IClientHelpers + { + private readonly IHttpClientFactory _clientFactory; + + public ClientHelpers(IHttpClientFactory clientFactory) + { + _clientFactory = clientFactory; + } + + public Uri CreateRequestUri(string clientUrl) + { + return new Uri(clientUrl); + } + + public HttpContent CreateHttpContent(string strPayload) + { + HttpContent content = new StringContent(strPayload, Encoding.UTF8, "application/json"); + return content; + } + + public HttpRequestMessage CreateGetHttpRequestMessage(string clientUrl, string apiKey) + { + var uri = CreateRequestUri(clientUrl); + return CreateHttpRequestMessage(HttpMethod.Get, uri, apiKey); + } + + public HttpRequestMessage CreateHttpRequestMessage(HttpMethod method, Uri uri, string apiKey) + { + HttpRequestMessage request = new HttpRequestMessage() + { + Method = method, + RequestUri = uri, + }; + + request.Headers.Add("api-key", apiKey); + + return request; + } + + public HttpResponseMessage SendHttpRequestMessage(HttpRequestMessage httpRequestMessage) + { + try + { + var client = _clientFactory.CreateClient(); + var response = client.SendAsync(httpRequestMessage).Result; + + return response; + } + catch (Exception ex) + { + Log.Error(ex, "Failure in sending http request message."); + return new HttpResponseMessage(HttpStatusCode.BadRequest); + } + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Utilities/IClientHelpers.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Utilities/IClientHelpers.cs new file mode 100644 index 0000000..07cbfae --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/Utilities/IClientHelpers.cs @@ -0,0 +1,14 @@ +using System; +using System.Net.Http; + +namespace LCU.Shared.Collections.RepoApiLib.Utilities +{ + internal interface IClientHelpers + { + Uri CreateRequestUri(string clientUrl); + HttpContent CreateHttpContent(string payload); + HttpRequestMessage CreateGetHttpRequestMessage(string clientUrl, string apiKey); + HttpRequestMessage CreateHttpRequestMessage(HttpMethod method, Uri uri, string apiKey); + HttpResponseMessage SendHttpRequestMessage(HttpRequestMessage httpRequestMessage); + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/WebServices/AutoIMS/AuctionAssignment.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/WebServices/AutoIMS/AuctionAssignment.cs new file mode 100644 index 0000000..1f147d9 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/WebServices/AutoIMS/AuctionAssignment.cs @@ -0,0 +1,13 @@ +using System.ComponentModel.DataAnnotations; + +namespace LCU.Shared.Collections.RepoApiLib.WebServices.AutoIMS +{ + public class AuctionAssignment + { + [StringLength(4)] public string AuctionID { get; set; } + public string PickupDate { get; set; } + public string LegalSaleDate { get; set; } + public string PickupOrDropOffNote { get; set; } + public int? CleaningLevelRequested { get; set; } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/WebServices/AutoIMS/AutoIMSWebService.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/WebServices/AutoIMS/AutoIMSWebService.cs new file mode 100644 index 0000000..b457c26 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/WebServices/AutoIMS/AutoIMSWebService.cs @@ -0,0 +1,258 @@ +using System; +using System.IO; +using System.Linq; +using System.Net.Http; +using System.Text; +using System.Threading.Tasks; +using System.Xml; +using System.Xml.Serialization; +using Serilog; + +namespace LCU.Shared.Collections.RepoApiLib.WebServices.AutoIMS +{ + public class AutoImsWebService : IAutoImsWebService + { + private string URL = "https://wstls.autoims.com/ClientWebservice?clientId={0}"; + private readonly AutoImsServiceConfig _config; + + public AutoImsWebService(AutoImsServiceConfig config) + { + _config = config; + URL = string.Format(URL, config.ClientId); + } + + public static string GetFormattedVIN(string vin) + { + return vin.Trim().PadLeft(17, '0').ToUpper(); + } + + public async Task RemoveFromAuction(string vin, string clientStockNumber) + { + WebServiceResponse webServiceResponse = null; + + URL = string.Format(URL + "&vin={0}&clientStockNum={1}", vin, clientStockNumber); + using (var client = new HttpClient()) + { + using (var req = new HttpRequestMessage(HttpMethod.Delete, URL)) + { + string authInfo = String.Format("{0}:{1}", _config.Login, _config.Password); + authInfo = Convert.ToBase64String(Encoding.Default.GetBytes(authInfo)); + req.Headers.Add("Authorization", "Basic " + authInfo); + req.Headers.Remove("Expect"); + req.Headers.Add("Expect", ""); + + using (HttpResponseMessage resp = await client.SendAsync(req)) + { + //resp.EnsureSuccessStatusCode(); + + var cont = await resp.Content.ReadAsStringAsync(); + webServiceResponse = DeserializeResponse(cont); + } + } + } + + return webServiceResponse; + } + + public async Task PostVehicleAsync(T vehicle) + { + var xml = Serialize(vehicle); + WebServiceResponse WebServiceResponse = null; + + + using (var client = new HttpClient()) + { + using (var content = new StringContent(xml)) + { + content.Headers.Remove("Content-Type"); + content.Headers.Add("Content-Type", "application/xml"); + + using (var req = new HttpRequestMessage(HttpMethod.Post, URL)) + { + string authInfo = String.Format("{0}:{1}", _config.Login, _config.Password); + authInfo = Convert.ToBase64String(Encoding.Default.GetBytes(authInfo)); + req.Headers.Add("Authorization", "Basic " + authInfo); + req.Headers.Remove("Expect"); + req.Headers.Add("Expect", ""); + req.Content = content; + + using (HttpResponseMessage resp = await client.SendAsync(req)) + { + var cont = await resp.Content.ReadAsStringAsync(); + WebServiceResponse = DeserializeResponse(cont); + + // 6 is duplicate. + if (WebServiceResponse.Status.Code == 6) + { + Log.Information($"Auto Ims Status Code: { WebServiceResponse.Status.Code}, {WebServiceResponse.Status.Description}"); + WebServiceResponse.Status.Code = 1; + WebServiceResponse.Status.Description = "Notification Already Sent To AutoIMS"; + } + else if (WebServiceResponse.Status.Code != 1) + { + throw new Exception("Auto Ims Status Code: " + WebServiceResponse.Status.Code + " " + string.Join(",", + WebServiceResponse.Status.ValidationError.Select(x => + x.Message))); + } + + //resp.EnsureSuccessStatusCode(); + if (resp.StatusCode != System.Net.HttpStatusCode.OK) + { + throw new Exception("Status Code: " + resp.StatusCode + " " + string.Join(",", + WebServiceResponse.Status.ValidationError.Select(x => + x.Message))); + } + } + } + } + } + + + return WebServiceResponse; + } + + public async Task UpdateAuctionIdentifyingValuesAsync(string customerNum, + string vin, + string auctionAssignmentId) + { + VehicleIdentiferUpdate veh = new VehicleIdentiferUpdate(); + veh.ClientAccountNumber = customerNum; + veh.VIN = vin; + veh.ClientField1 = auctionAssignmentId; + + var response = await PostVehicleAsync(veh); + response.AuctionCollateralVin = vin; + return response; + } + + public async Task AddAuctionNote(string vin, string customerNumber, string note, + string writer) + { + WebServiceResponse response = null; + VehicleNote vehicle = new VehicleNote(); + vehicle.VIN = vin; + + //do not include and AutoIMS will timestamp. + //vehicle.Note.CreationDate = String.Empty;// DateTime.Now.ToString("yyyy-MM-dd"); + vehicle.Note.NoteText = note; + vehicle.Note.Writer = writer; + vehicle.Note.Private = false; + + response = await PostVehicleAsync(vehicle); + response.AuctionCollateralVin = vin; + return response; + } + + public async Task RemoveAuction(string VIN, string customerNumber) + { + WebServiceResponse response = await RemoveFromAuction(VIN, customerNumber); + response.AuctionCollateralVin = VIN; + return response; + } + + public async Task Redeem(string VIN) + { + WebServiceResponse response = null; + RedeemVehicle vehicle = new RedeemVehicle(); + vehicle.VIN = VIN; + vehicle.AuctionAssignment.RedeemVehicle = DateTime.Now.ToString("yyyy-MM-dd"); + + response = await PostVehicleAsync(vehicle); + response.AuctionCollateralVin = VIN; + return response; + } + + public async Task TitleSent(string VIN) + { + WebServiceResponse response = null; + VehicleTitleSent vehicle = new VehicleTitleSent(); + vehicle.VIN = VIN; + vehicle.AuctionAssignment.TitleSent = DateTime.Now.ToString("yyyy-MM-dd"); + + response = await PostVehicleAsync(vehicle); + response.AuctionCollateralVin = VIN; + return response; + } + + public async Task PlaceHold(string VIN, int holdCode, DateTime holdUntil) + { + WebServiceResponse response = null; + VehicleHold vehicle = new VehicleHold(); + vehicle.VIN = VIN; + vehicle.AuctionAssignment.SaleHold.HoldUntil = holdUntil.ToString("yyyy-MM-dd"); + vehicle.AuctionAssignment.SaleHold.HoldStatus = holdCode; + + response = await PostVehicleAsync(vehicle); + response.AuctionCollateralVin = VIN; + return response; + } + + public string GetCollateralImage(string conditionReporUrl) + { + string html = String.Empty; + string imageLink = String.Empty; + + try + { + using (var client = new HttpClient()) + { + var response = client.GetAsync(conditionReporUrl).Result; + + html = response.Content.ReadAsStringAsync().Result; + + var aTag = html.Substring(html.IndexOf("pic_0", StringComparison.OrdinalIgnoreCase)); + + var imgTag = aTag.Substring(aTag.IndexOf("addpic(", StringComparison.OrdinalIgnoreCase) + 7); + + //var src = imgTag.Substring(imgTag.IndexOf("src=\"", StringComparison.InvariantCultureIgnoreCase)); + + imageLink = imgTag.Substring(0, imgTag.IndexOf(",", StringComparison.OrdinalIgnoreCase)) + .Replace("'", "").Replace("\"", ""); + } + } + catch (Exception) + { + imageLink = null; + } + + return imageLink; + } + + private static string Serialize(T vehicle) + { + XmlSerializer xsSubmit = new XmlSerializer(typeof(T)); + + string xml = ""; + + using (var sww = new StringWriter()) + { + using (XmlWriter writer = XmlWriter.Create(sww)) + { + xsSubmit.Serialize(writer, vehicle); + xml = sww.ToString(); + } + } + + return xml; + } + + private T DeserializeResponse(string xml) + { + using (MemoryStream memoryStream = new MemoryStream(StringToByteArrayUtf8(xml))) + { + XmlSerializer xmlSerializer = new XmlSerializer(typeof(T)); + + using (StreamReader xmlStreamReader = new StreamReader(memoryStream, Encoding.UTF8)) + { + return (T) xmlSerializer.Deserialize(xmlStreamReader); + } + } + } + + private static byte[] StringToByteArrayUtf8(string value) + { + UTF8Encoding encoding = new UTF8Encoding(); + return encoding.GetBytes(value); + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/WebServices/AutoIMS/AutoImsServiceConfig.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/WebServices/AutoIMS/AutoImsServiceConfig.cs new file mode 100644 index 0000000..1732af3 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/WebServices/AutoIMS/AutoImsServiceConfig.cs @@ -0,0 +1,11 @@ + +namespace LCU.Shared.Collections.RepoApiLib.WebServices.AutoIMS +{ + public class AutoImsServiceConfig + { + public string URL { get; set; } + public string Login { get; set; } + public string Password { get; set; } + public string ClientId { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/WebServices/AutoIMS/IAutoImsWebService.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/WebServices/AutoIMS/IAutoImsWebService.cs new file mode 100644 index 0000000..7292ffd --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/WebServices/AutoIMS/IAutoImsWebService.cs @@ -0,0 +1,22 @@ +using System; +using System.Threading.Tasks; + +namespace LCU.Shared.Collections.RepoApiLib.WebServices.AutoIMS +{ + public interface IAutoImsWebService + { + Task RemoveFromAuction(string vin, string clientStockNumber); + Task PostVehicleAsync(T vehicle); + + Task UpdateAuctionIdentifyingValuesAsync( string customerNum, + string vin, + string auctionAssignmentId); + + Task AddAuctionNote(string vin, string customerNumber, string note, string writer); + Task RemoveAuction(string VIN, string customerNumber); + Task Redeem(string VIN); + Task TitleSent(string VIN); + Task PlaceHold(string VIN, int holdCode, DateTime holdUntil); + string GetCollateralImage(string conditionReporUrl); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/WebServices/AutoIMS/Note.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/WebServices/AutoIMS/Note.cs new file mode 100644 index 0000000..5aa50c4 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/WebServices/AutoIMS/Note.cs @@ -0,0 +1,27 @@ +using System.Xml.Serialization; + +namespace LCU.Shared.Collections.RepoApiLib.WebServices.AutoIMS +{ + [XmlRoot(ElementName = "Vehicle", Namespace = "http://www.autoims.com/AutoIMSVehicle")] + public class VehicleNote + { + public VehicleNote() + { + Note = new Note(); + } + + public string VIN { get; set; } + public Note Note { get; set; } + } + + public class Note + { + // [MaxLength(25)] + public string Writer { get; set; } + + // public string CreationDate { get; set; } + // [MaxLength(255)] + public string NoteText { get; set; } + public bool Private { get; set; } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/WebServices/AutoIMS/RedeemVehicle.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/WebServices/AutoIMS/RedeemVehicle.cs new file mode 100644 index 0000000..de6001b --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/WebServices/AutoIMS/RedeemVehicle.cs @@ -0,0 +1,26 @@ +using System.Xml.Serialization; + +namespace LCU.Shared.Collections.RepoApiLib.WebServices.AutoIMS +{ + [XmlRoot(ElementName = "Vehicle", Namespace = "http://www.autoims.com/AutoIMSVehicle")] + public class RedeemVehicle + { + public RedeemVehicle() + { + AuctionAssignment = new RedeemAuctionAssignment(); + } + + public string VIN { get; set; } + public RedeemAuctionAssignment AuctionAssignment { get; set; } + } + + [XmlRoot(ElementName = "AuctionAssignment")] + public class RedeemAuctionAssignment + { + /*If set, vehicle is considered 'redeemed' and + will not be sold. Vehicle record will be + archived after designated period of time + (consignor specific)*/ + public string RedeemVehicle { get; set; } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/WebServices/AutoIMS/UpdateFloorPrice.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/WebServices/AutoIMS/UpdateFloorPrice.cs new file mode 100644 index 0000000..4e4bfff --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/WebServices/AutoIMS/UpdateFloorPrice.cs @@ -0,0 +1,23 @@ +using System.Xml.Serialization; + +namespace LCU.Shared.Collections.RepoApiLib.WebServices.AutoIMS +{ + [XmlRoot(ElementName = "Vehicle", Namespace = "http://www.autoims.com/AutoIMSVehicle")] + public class FloorPriceVehicle + { + public FloorPriceVehicle() + { + AuctionAssignment = new FloorPriceAuctionAssignment(); + } + + public string ClientAccountNumber { get; set; } + public string VIN { get; set; } + public FloorPriceAuctionAssignment AuctionAssignment { get; set; } + } + + [XmlRoot(ElementName = "AuctionAssignment")] + public class FloorPriceAuctionAssignment + { + public decimal FloorPrice { get; set; } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/WebServices/AutoIMS/Vehicle.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/WebServices/AutoIMS/Vehicle.cs new file mode 100644 index 0000000..37b537e --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/WebServices/AutoIMS/Vehicle.cs @@ -0,0 +1,31 @@ +using System.ComponentModel.DataAnnotations; +using System.Xml.Serialization; + +namespace LCU.Shared.Collections.RepoApiLib.WebServices.AutoIMS +{ + [XmlRoot(Namespace = "http://www.autoims.com/AutoIMSVehicle")] + public class Vehicle + { + public Vehicle() + { + AuctionAssignment = new AuctionAssignment(); + VehicleLocation = new VehicleLocation(); + } + + [MaxLength(25)] public string ClientAccountNumber { get; set; } + [StringLength(17)] public string VIN { get; set; } + [MaxLength(30)] public string Make { get; set; } + [MaxLength(30)] public string Model { get; set; } + public int ModelYear { get; set; } + [MaxLength(4)] public string BodyStyle { get; set; } + public int Classification { get; set; } + + + public string ClientField1 { get; set; } + + public bool VehicleIsOperable { get; set; } + + public AuctionAssignment AuctionAssignment { get; set; } + public VehicleLocation VehicleLocation { get; set; } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/WebServices/AutoIMS/VehicleHold.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/WebServices/AutoIMS/VehicleHold.cs new file mode 100644 index 0000000..327df6b --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/WebServices/AutoIMS/VehicleHold.cs @@ -0,0 +1,33 @@ +using System.Xml.Serialization; + +namespace LCU.Shared.Collections.RepoApiLib.WebServices.AutoIMS +{ + [XmlRoot(ElementName = "Vehicle", Namespace = "http://www.autoims.com/AutoIMSVehicle")] + public class VehicleHold + { + public VehicleHold() + { + AuctionAssignment = new HoldAuctionAssignment(); + } + + public string VIN { get; set; } + public HoldAuctionAssignment AuctionAssignment { get; set; } + } + + [XmlRoot(ElementName = "AuctionAssignment")] + public class HoldAuctionAssignment + { + public HoldAuctionAssignment() + { + SaleHold = new SaleHold(); + } + + public SaleHold SaleHold { get; set; } + } + + public class SaleHold + { + public int HoldStatus { get; set; } + public string HoldUntil { get; set; } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/WebServices/AutoIMS/VehicleIdentiferUpdate.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/WebServices/AutoIMS/VehicleIdentiferUpdate.cs new file mode 100644 index 0000000..762d0f2 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/WebServices/AutoIMS/VehicleIdentiferUpdate.cs @@ -0,0 +1,13 @@ +using System.ComponentModel.DataAnnotations; +using System.Xml.Serialization; + +namespace LCU.Shared.Collections.RepoApiLib.WebServices.AutoIMS +{ + [XmlRoot(ElementName = "Vehicle", Namespace = "http://www.autoims.com/AutoIMSVehicle")] + public class VehicleIdentiferUpdate + { + [MaxLength(25)] public string ClientAccountNumber { get; set; } + [StringLength(17)] public string VIN { get; set; } + public string ClientField1 { get; set; } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/WebServices/AutoIMS/VehicleLocation.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/WebServices/AutoIMS/VehicleLocation.cs new file mode 100644 index 0000000..244e4f1 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/WebServices/AutoIMS/VehicleLocation.cs @@ -0,0 +1,24 @@ +using System.ComponentModel.DataAnnotations; + +namespace LCU.Shared.Collections.RepoApiLib.WebServices.AutoIMS +{ + public class VehicleLocation + { + public int Type { get; set; } + + [MaxLength(50)] + public string Name { get; set; } + [MaxLength(50)] + public string Address { get; set; } + [MaxLength(50)] + public string City { get; set; } + [MaxLength(20)] + public string State { get; set; } + [MaxLength(20)] + public string Zip { get; set; } + + [MaxLength(30)] + public string Phone { get; set; } + + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/WebServices/AutoIMS/VehicleTitleSent.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/WebServices/AutoIMS/VehicleTitleSent.cs new file mode 100644 index 0000000..a025676 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/WebServices/AutoIMS/VehicleTitleSent.cs @@ -0,0 +1,22 @@ +using System.Xml.Serialization; + +namespace LCU.Shared.Collections.RepoApiLib.WebServices.AutoIMS +{ + [XmlRoot(ElementName = "Vehicle", Namespace = "http://www.autoims.com/AutoIMSVehicle")] + public class VehicleTitleSent + { + public VehicleTitleSent() + { + AuctionAssignment = new TitleSentAuctionAssignment(); + } + + public string VIN { get; set; } + public TitleSentAuctionAssignment AuctionAssignment { get; set; } + } + + [XmlRoot(ElementName = "AuctionAssignment")] + public class TitleSentAuctionAssignment + { + public string TitleSent { get; set; } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/WebServices/AutoIMS/WebServiceResponse.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/WebServices/AutoIMS/WebServiceResponse.cs new file mode 100644 index 0000000..4853868 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/WebServices/AutoIMS/WebServiceResponse.cs @@ -0,0 +1,74 @@ +namespace LCU.Shared.Collections.RepoApiLib.WebServices.AutoIMS +{ + /// + [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)] + [System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)] + public partial class WebServiceResponse + { + public string AuctionCollateralVin { get; set; } + private WebServiceResponseStatus statusField; + + /// + public WebServiceResponseStatus Status + { + get { return this.statusField; } + set { this.statusField = value; } + } + } + + /// + [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)] + public partial class WebServiceResponseStatus + { + private int codeField; + + private string descriptionField; + + private WebServiceResponseStatusValidationError[] validationErrorField; + + /// + public int Code + { + get { return this.codeField; } + set { this.codeField = value; } + } + + /// + public string Description + { + get { return this.descriptionField; } + set { this.descriptionField = value; } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("ValidationError")] + public WebServiceResponseStatusValidationError[] ValidationError + { + get { return this.validationErrorField; } + set { this.validationErrorField = value; } + } + } + + /// + [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)] + public partial class WebServiceResponseStatusValidationError + { + private string codeField; + + private string messageField; + + /// + public string Code + { + get { return this.codeField; } + set { this.codeField = value; } + } + + /// + public string Message + { + get { return this.messageField; } + set { this.messageField = value; } + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/WebServices/NADA/CollateralValuation.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/WebServices/NADA/CollateralValuation.cs new file mode 100644 index 0000000..5ae2a85 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/WebServices/NADA/CollateralValuation.cs @@ -0,0 +1,49 @@ +using System; +using System.ComponentModel.DataAnnotations; + +namespace LCU.Shared.Collections.RepoApiLib.WebServices.NADA +{ + public class CollateralValuation + { + [Required] + public int Id { get; set; } + + public int Year { get; set; } + public string Make { get; set; } + public string Model { get; set; } + public string Uid { get; set; } + public string UcgVehicleId { get; set; } + public DateTime? LookupDate { get; set; } + public string Mileage_Hours { get; set; } + public int? MakeCode { get; set; } + public string MakeDescription { get; set; } + public int? SeriesCode { get; set; } + public string SeriesDescription { get; set; } + public int? BodyCode { get; set; } + public string BodyDescription { get; set; } + public int? Weight { get; set; } + public decimal? Msrp { get; set; } + public int? AveMileage { get; set; } + public decimal? MileageAdjustment { get; set; } + public bool AuctionInfoUnavailable { get; set; } + public int LowAdjustedAuctionValue { get; set; } + public int AverageAdjustedAuctionValue { get; set; } + public int HighAdjustedAuctionValue { get; set; } + public string DateRange { get; set; } + public decimal Loan { get; set; } + public decimal LoanPlusVinAcc { get; set; } + public decimal LoanPlusVinAccMileage { get; set; } + public decimal Retail { get; set; } + public decimal RetailPlusVinAcc { get; set; } + public decimal RetailPlusVinAccMileage { get; set; } + public decimal AvgTradeIn { get; set; } + public decimal AvgTradeInPlusVinAcc { get; set; } + public decimal AvgTradeInPlusVinAccMileage { get; set; } + public decimal RoughTradeIn { get; set; } + public decimal RoughTradeInPlusVinAcc { get; set; } + public decimal RoughTradeInPlusVinAccMileage { get; set; } + public decimal TradeIn { get; set; } + public decimal TradeInPlusVinAcc { get; set; } + public decimal TradeInPlusVinAccMileage { get; set; } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/WebServices/NADA/CollateralValueService.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/WebServices/NADA/CollateralValueService.cs new file mode 100644 index 0000000..302ac35 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/WebServices/NADA/CollateralValueService.cs @@ -0,0 +1,127 @@ +using System; +using JdpVehicle; +using Serilog; +using LCU.Shared.Collections.RepoApiLib.Utilities; +using Newtonsoft.Json; +using LCU.Shared.Collections.RepoApiLib.Models.Results; + +namespace LCU.Shared.Collections.RepoApiLib.WebServices.NADA +{ + public class CollateralValueService : ICollateralValueService + { + private readonly CollateralValueServiceConfig _config; + private readonly IClientHelpers _clientHelpers; + + public CollateralValueService(CollateralValueServiceConfig config, ClientHelpers clientHelpers) + { + _config = config; + _clientHelpers = clientHelpers; + } + + + private readonly VehicleTypes[] _nadaVehicleType = + { + VehicleTypes.UsedCar, + VehicleTypes.CommercialTruck + }; + + public CollateralValuation GetCollateralValue(string vin, + int mileage, + int vehicleTypeKey) + { + var valueResponse = this.GetVehicleData(_config.Region, _config.Period, vin, vehicleTypeKey, mileage); + + if (valueResponse != null) + { + var autoVehicle = new CollateralValuation() + { + Make = valueResponse.Make, + Model = valueResponse.Body + " " + valueResponse.Model, + Year = valueResponse.Modelyear, + UcgVehicleId = valueResponse.Ucgvehicleid.ToString(), //ucgvehicleid is the new ID and not 1:1 to legacy UID + SeriesDescription = valueResponse.Model, + BodyDescription = valueResponse.Body, + Weight = String.IsNullOrWhiteSpace(valueResponse.Curbweight) ? 0 : Int32.Parse(valueResponse.Curbweight), + Msrp = String.IsNullOrWhiteSpace(valueResponse.Basemsrp) ? 0 : Int32.Parse(valueResponse.Basemsrp), + AveMileage = valueResponse.Averagemileage, + MileageAdjustment = valueResponse.Mileageadjustment, + LookupDate = DateTime.Now, + Loan = valueResponse.Baseloan, + LoanPlusVinAccMileage = valueResponse.Adjustedloan, + Retail = valueResponse.Basecleanretail, + RetailPlusVinAccMileage = valueResponse.Adjustedcleanretail, + AvgTradeIn = valueResponse.Baseaveragetrade, + AvgTradeInPlusVinAccMileage = valueResponse.Adjustedaveragetrade, + RoughTradeIn = valueResponse.Baseroughtrade, + RoughTradeInPlusVinAccMileage = valueResponse.Adjustedroughtrade, + TradeIn = valueResponse.Basecleantrade, + TradeInPlusVinAccMileage = valueResponse.Adjustedcleantrade, + AuctionInfoUnavailable = true + }; + + //Try catch to prevent failure if no auction values available + try + { + var auctionResponse = this.GetAuctionValues(_config.Period, valueResponse.Ucgvehicleid, _config.Region, vehicleTypeKey, vin, mileage); + + if (auctionResponse != null) + { + autoVehicle.AuctionInfoUnavailable = false; + autoVehicle.AverageAdjustedAuctionValue = auctionResponse.AvgAuction; + autoVehicle.HighAdjustedAuctionValue = auctionResponse.HighAuction; + autoVehicle.LowAdjustedAuctionValue = auctionResponse.LowAuction; + autoVehicle.DateRange = auctionResponse.DateRange; + } + } + catch (Exception ex) + { + Log.Error(ex, "Failed to Retreive Auction Values in CollateralValueService"); + } + + return autoVehicle; + } + + return null; + } + + private VehicleData GetVehicleData(int region, int period, string vin, int vehicleTypeKey, int mileage) + { + var newURL = string.Format(_config.DefaultVehicleAndValuesByVinEndpoint + "?period={0}&vin={1}®ion={2}&mileage={3}", + period, vin, region, mileage); + + var request = _clientHelpers.CreateGetHttpRequestMessage(newURL, _config.ApiKey); + var response = _clientHelpers.SendHttpRequestMessage(request); + + if (!response.IsSuccessStatusCode) + { + throw new Exception($"Request for vehicle data for vehicle with VIN {vin} was unsuccessful."); + } + + var content = response.Content.ReadAsStringAsync().Result; + + var result = JsonConvert.DeserializeObject(content); + + return result.Result[0]; + } + + private AuctionData GetAuctionValues(int period, int ucgVehicleId, int region, int vehicleTypeKey, string vin, int mileage) + { + var newURL = string.Format(_config.WeeklyAuctionValuesByVehicleIdEndPoint + "?period={0}&vehicletype={1}&vin={2}&ucgvehicleid={3}®ion={4}&mileage={5}", + period, this._nadaVehicleType[vehicleTypeKey], vin, ucgVehicleId, region, mileage); + + var request = _clientHelpers.CreateGetHttpRequestMessage(newURL, _config.ApiKey); + var response = _clientHelpers.SendHttpRequestMessage(request); + + if (!response.IsSuccessStatusCode) + { + throw new Exception($"Request for auction data for vehicle with VIN {vin} was unsuccessful."); + } + + var content = response.Content.ReadAsStringAsync().Result; + + var result = JsonConvert.DeserializeObject(content); + + return result.Result[0]; + } + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/WebServices/NADA/CollateralValueServiceConfig.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/WebServices/NADA/CollateralValueServiceConfig.cs new file mode 100644 index 0000000..850b535 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/WebServices/NADA/CollateralValueServiceConfig.cs @@ -0,0 +1,16 @@ + +namespace LCU.Shared.Collections.RepoApiLib.WebServices.NADA +{ + public class CollateralValueServiceConfig + { + public string Username { get; set; } + public string Password { get; set; } + public string LoginEndpoint { get; set; } + public string VehicleEndpoint { get; set; } + public string DefaultVehicleAndValuesByVinEndpoint { get; set; } + public string WeeklyAuctionValuesByVehicleIdEndPoint { get; set; } + public int Region { get; set; } + public int Period { get; set; } + public string ApiKey { get; set; } + } +} diff --git a/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/WebServices/NADA/ICollateralValueService.cs b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/WebServices/NADA/ICollateralValueService.cs new file mode 100644 index 0000000..bf46d66 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/LCU.Shared.Collections.RepoApiLib/WebServices/NADA/ICollateralValueService.cs @@ -0,0 +1,9 @@ +namespace LCU.Shared.Collections.RepoApiLib.WebServices.NADA +{ + public interface ICollateralValueService + { + CollateralValuation GetCollateralValue(string vin, + int mileage, + int vehicleTypeKey); + } +} \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/README.md b/LCU.API.Collections.RepoApi-old/README.md new file mode 100644 index 0000000..b24e1b4 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/README.md @@ -0,0 +1,325 @@ +# Repo Api + +This readme outlines the developer process, basic coding style guide and provides guidance and details around the technical approach to the Repo Manager API. You should always review and update this document to encompass your changes. + +# Getting Started +Before you can work with the code, build it, or deploy it you must setup your development environment. The required environment is .NET Core 2.2, Git, and something to work with C#. This environment code has been wrapped up into a Powershell script that should run on any Windows 10 machine and produce a viable development environment to carry you through this guide. The script is available in the root of this directory as `setup-env.ps1`. + +You should start by reviewing and possibly running that script if needed. + +## Working With The Code +Code is checked out from the Azure DevOps Repository, which is currently [https://landmarkcu.visualstudio.com/Repo/_git/LCU.API.Collections.RepoApi] with the front end code +located at [https://landmarkcu.visualstudio.com/Repo/_git/LCU.API.Collections.RepoApi]. + +It should be noted that this project has many related repositories: + * Collections API - An API to speak to Temenos + * Core API - An API to speak to the APEX/Core system about customers, accounts, and loans. + * RepoClient - The front end client that is the primary consumer of this API. + +Work should be done in a branch from Develop. + +Start by checking out the repository, and specifically the develop branch. You should be branching off of develop +with your own working branch. When you are complete, you will create a pull request within Azure DevOps here: [https://landmarkcu.visualstudio.com/Repo/_git/LCU.API.Collections.RepoApi/pullrequests] + +Before submitting your pull request, review the following: + * Did you commit with a commitizen style message? (see below) + * Did you add all needed unit testing, and ensure all existing tests are passing? + * Make sure you didn't accidentally commit any secrets or passwords. + * Have you created a change log if needed? + * Have you bumped the library version if you made changes? + +In order to work and submit code, the project will need to be built and run; you will generally do this from Visual Studio. + +### Resources + There is additional documentation available within the Landmark shared folders; you should check the files tab under + the RepoDB team in Microsoft Teams: + + * Architecture Document: Landmark Credit Union - Repo Application - SAD + * This is the software architecture description. + * Site Layout / Reference: Landmark_Site_Reference.XLSX + * This shows urls/locations for source code and deployables and the Azure configuration + +### Suggestion for IDE +* Visual Studio 2017 +* Visual Studio Code +* IDEA Rider + +# Releases + +Releases are handled by anyone on the team with access to Azure DevOps. Generally when a pull request is accepted +to develop, that will be automatically built and deployed to QA. The QA application is here: [https://qa-repoapi.landmarkcu.com]. The +same is true for the front end / Client. + +To get to UAT, develop must be merged into the master branch. This will automatically cause the main +branch to be built and the resulting release to be pushed to UAT. + +All releases to UAT are candidates for production. Go to [https://landmarkcu.visualstudio.com/Repo/_release] and get the production release stage that comes after UAT approved to go to production, or cancel it if the release will not go to production. + +When creating releases, it's important not to forget to make a release and update the change notes as +needed. There is information on creating a release below. + +# Style Concerns + + * For this project, "Code to the codebase"; we use long variable, function, and class names so that the code reads as its own documenation. + * Single character variables are generally accepted for short Linq statements + * For rest services, try to be as RESTful as possible + * POST/PUT should be idempotent: + * POSTing to a url twice with the same data should create two uniquely identified objects. + * PUTing to a url twice should result in the second call having now effect. + * GET should not create anything + * POST should be for creating things, but sometimes large forms just make sense to post, even for queries; be feasible. +* Models and other shareable should go in RepoApiLib, when you do +this be sure to bump the version number and add a comment with what was added. This will trigger a release of the library within Azure DevOps + +# Libraries + + * NewtonSoft.JSON - Used for conversion of objects to/from JSON + * Sqlite - Used for testing, see - https://jimmybogard.com/avoid-in-memory-databases-for-tests/ + * Microsft.FeatureManagement for feature management + +# Security + +Security is handled by a required JWT token that can be retrieved for Azure AD. + +The relevant code is at the end of Startup.cs: +``` + //Set up Authentication + services + .AddAuthentication(JwtBearerDefaults.AuthenticationScheme) + // AzureAD config + .AddAzureAdBearer(options => Configuration.GetSection("AzureActiveDirectory").Bind( options)); + services.AddIdentity() + .AddDefaultTokenProviders(); +``` + +You can then annotate a controller end point like this: +``` +[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme, Roles = "Admin")] +public async Task Post([FromBody] AuctionHouse auction) +``` + +The other steps required are registering the app with Azure Ad (Azure Active Directory Blade, App Registrations) + +There is a separate document in the share that walks through this setup. You have to register both the API and CLIENT, and then create and wire up any roles you want. + +## Security Groups +Security groups are basically AD Groups mapped to an application role. This application has two roles: +* RepoManagerAdmin +* Specialist + +Multiple groups are mapped to these roles to handle both Azure and On-Premise group assignment for individual users. The +relevant groups are: +* Azure: REPO_MANAGER_APP_ADMIN +* Azure: REPO_MANAGER_APP_SPECIALIST +* On-Prem: Repo Manager App Admin +* On-Prem: Repo Manager App Specialist + +To manage roles or groups, you will need access to Azure; to simply give users access the on-prem groups can be used. + +# Hosted Services + +This application uses queues and hosted services, these are the primary systems. They are all within the HostedServices folder. + +* Schedule Service - On a CRON schedule, places a token on the schedule queue. +* Auto Ims - When a schedule token appears, processes Auto IMS imports (Auctions) +* Queue Producer - When a schedule token appears, fills queues with accounts to update, retry, and updates users cache. +* Queue Consumer - When items appear on the queue, they are processed. + +# Feature Management +This application uses Microsoft's FeatureManagement package to enable/disable features in the code. + +This is initialized in startup like so: +`services.AddFeatureManagement();` + +The feature flags are configured at their default location in any of the appsettings: + + "FeatureFlags" : { + "EnableControllers" : true, + "RunHostedServices": false + } +After adding an item to the config it is suggested to add the Flag's string to the **FeatureFlag.cs** static class under the configuration folder of the main project. + +Feature flags can be used in `[FeatureGate(*nameOfFlag*)]` attributes in controllers to enable and disable them dynamically by changing the config: + + namespace LCU.API.Collections.RepoApi.Controllers + { + [Route("api/[controller]")] + [ApiController] + [FeatureGate(FeatureFlags.EnableControllers)] + public class RefundStatusController : RepoControllerBase + { + +After injecting IFeatureManagement they can also be used inline to prevent entire bloks of code from running: + + if (await featureManager.IsEnabledAsync(FeatureFlags.FeatureA)) { // Run the following code } + +Learn more about Microsoft.FeatureManagement : +(https://docs.microsoft.com/en-us/azure/azure-app-configuration/use-feature-flags-dotnet-core?tabs=core5x) + +Learn more about the history and use cases of Feature Management: +(https://martinfowler.com/articles/feature-toggles.html) + +# Business Details + +## Basics +Repo API is responsible primarily for three systems: +* CRUD operations on Repo entities such as Repo, Collateral, Borrower, Alert. +* Automated imports and updates of Repo Accounts sourced from Temenos. +* Automated creation and updates of AutoIms auctions; including price setting. + +## CRUD Operations +Most enties within Repo Manager are read only, or created by the automated process. So the changes that can come in +via RESTful events are small. If you are looking for refactoring work, you could lower the RESTful footprint, as +most controller methods are likely unused. + +The methods used the most will be to update alerts (clear them), create and update auctions, update the receipts for +an account, as well as closing accounts. + +## Automated Imports +One the hour existing accounts in watch status' as well as accounts that failed last hour are automatically re-queued, for +new accounts; these now come over from Temenos as events via Azure->Vendor API->Relay API->Rabbit Queue. + +Each account is updated to make sure it's fields are correct, and primarily to create Alerts for the business to call +users to action on various situations. For example, a vehicle being O4R (out for repo) without a Repo Company assigned to +it will create an alert asking a user to assign the repo company. + +## Automated Auctions +Users on the UX side can create auctions for REPO'd vehicles (vehicles in our possession) once they are beyond their +redemption expired date (last date to pay to catch account up to good standing). At this point the vehicle will be +retitled and an auction created. The application will submit the auction to this API, which will forward it to AutoIMS. + +On schedule, this API will download a spreadsheet from AutoIMS containing a list of auctions and their status - such as +received, on-the-block, sold. It will also include pricing and condition information which will be used to automatically +update the price of the vehicle - which is sent back to AutoIMS. The auction info is saved locally for easy user access. + +## Primary Business Contacts +The known primary business contacts are: + * Dean Berendt + * Bill Johns + * Kyle Sternig + * Diana Vandebogert + * Benard Johnson + +## Temenos Notes and Known Business Rules + + * L-WO does not load into Temenos, this is only in XP. + * Without CORS, it still doesn't matter if it is charged off. + * Written off accounts, should still be processed. + +## Temenos "Go-Live" and Repo Manager 2.0 Notes and Risks +This section outlines the go-live procedure for Repo Manager and outlines a series of risks/notes that developers should keep in mind +if they are handling the roll out or the post go-live hypercare. The business has already been shown the application multiple times and +Bill has demonstrated he is comfortable using the new Admin screen. + +### Checklist +* Database is correctly updated on release to production. +* Shutdown the App Server scheduled task runs, they are all now hosted services. +* Confirm accounts can be looked up in Temenos from the Repo Manager Admin screen. +* Monitor jobs via seq and processing receipts. +* Events are arriving to the Queue from Temenos via the Vendor API. + +### Database +The production database should be backed up before go-live. Since this is automatic, it shouldn't be a problem. The deploy to +production will change/create some tables with the dacpac and after the deploy these tables should be checked: + 1) ProcessingReceipt table should exist. + 2) Repos table should now have these additional fields: + ReferenceStatus, ReferenceId, ReferenceCaseId, AccountLastProcessed, and OrigAccountTypeCode + +### FTP / Auto-IMS +Repo Manager now does the FTP download as a background process known as a HostedService. There is only a production site, so this is +difficult to test. Monitor the logs and make sure this goes through, if it doesn't it is likely a security error resulting from: + 1. Certificate + 1. Landmark Firewall + 1. Auto IMS whitelist + +You should be able to email mgreene@autoims.com or get an updated contact from Dean Berendt. Work with him to make sure we're +whitelisted. Work with IT on the firewall and cert issue. The privatekey.ppk is located in the project; so you should be fine +but if something goes wrong that is a place to look. + +##### Debugging The Auto-IMS FTP Process +1. Ensure the lcu/svc_Repo AD user has Read/Write access to the `localDirectoryPath` found in the appsettings + * The user may change in the future, check the user the application is running as in the IIS pool, ensure that it has proper access +1. Ensure the WinSCP.exe is located at the `ExecutablePath` in the found in the appsettings +1. Ensure the WinSCP.exe version matches the WinSCP nuget package installed in the project + * It is very important that you **do not move an existing WinSCP.exe**. If you need to update it, + create a new folder in the parent directory for the new version and point the `ExecutablePath` to it. + Other applications in the organization may rely on existing executables. + +### Repo Processing +The processing of Repo Accounts from Temenos has been designed specifically for debugging due to quality concerns with the +Temenos product while we were working through the conversion. Specifically there are a few points of concern: + 1. Knowing about events in Temenos is difficult because we don't receive specific events and we can't poll for relevant accounts. + 1. The business can change workflows, tables, etc after the go-live. So the system could break on anything. + +Once the new system is deployed to prod for the go-live; the processing runs will happen as a hosted service. The likely errors have +been mitigated by creating a "Run Receipt". The code for processing accounts was refactored to make less web calls and process +accounts in a saga like pattern. When an account is processed, a receipt is produced for that account. When the "batch" of accounts is +done the run receipt is emailed; which consists of all of the account receipts. + +The new admin screen was designed to help both business and developer alike. The business is empowered to do basic investigations and handle +Temenos errors on their own. You can use the Admin screen in Repo Manager to: + 1. lookup accounts in Temenos. + 1. Force an account onto the queue. + 1. View run receipts for that account. + 1. Determine if there is a Repo Account for that Temenos Account. + +On the main Repo Account screen in Repo Manager, you can also see the new Reference Account and Reference Case ID as well as a last processed +date. These three fields should let you trace a Repo Account back to Temenos since those are the Temenos Account/Case numbers. If an account +results in an Error or MissingRequirement status - it will be marked for Retry. When the processor runs it queries the processing receipt table +for entries marked for retry. It does merge the accounts to those already pending so that an account isn't processed twice. + +Finally, run receipt entries look like below. The pipes separate the known fields: REPOACCOUNT#|TEMENOSACCT#|TEMENOSCASE#| + 1. The Collections team hasn't create a case for the account yet: + - `########-###|||RepoManager-Retry -> MissingRequirement : The item ########-#### is missing Recovery Case : 893546 did not have case 0..` + 1. The account has matching status codes/etc, so for now it is considered unconverted and skipped: + - `########-###|||RepoManager -> Unconverted : Success` + 1. Something went wrong, check SEQ: + - `########-###|||RepoManager -> Error : The item ########-### produced an error. Please investigate.` + 1. Success! + - `########-###|519534|2|RepoManager -> Created : Success` + - `########-###|519534|2|RepoManager -> Updated : Success` + +### Temenos Events +Temenos events are posted to the Vendor API in Azure, which posts them via the HCM to the Relay API on premise. +This puts the items on the Repo Queue for processing. Bill, Kyle S, or Jim can help you confirm this by creating a Case. You should be +able to check the Azure logs (no Seq, it is in Azure, so bring up Kudu, go to the sites folder and open the log). Relay API should receive +the event from Vendor API, and that does log to SEQ. Finally; you should see a run receipt as this will cause an item to queue and process. + +### Other Notes + * When someone forces an account onto the Queue, the receipt will identify them: + * `########-###|519534|2|someone@landmarkcu.com -> Created : Success` + * Failing accounts can retry forever, so the business should do something about them. + + +## Repo Receipt Common Fixes + +### Missing Letter Descriptions +``########-###|||RepoManager-Retry -> MissingRequirement : Letter table requires LetterDescription Column entry."`` + +This error occurs when there was an update to the Letter Descriptions in Temenos that have not been updated in RepoDB. +To fix this: +1. Find the 'LetterUpdate.Sql' Query in the LCU.API.Collections.RepoApiSql project +2. Update the Letter Descriptions for Each Action code using the information available in temenos +3. Update the query +4. Copy and Past the query into a RepoDB script and run the script + +### Missing Repo Company Row +`########-###|||RepoManager-Retry -> MissingRequirement : The item ########-### is missing RepoCompanyAssignment - RepoCompanyID : Update or Create a RepoCompany Row with RepoAgentID:` + +This error occurs when RepoCompany References IDs in Temenos are not properly being mapped to Repo Companies in RepoManager. To fix this: +1. Call this CollectionsAPI route from Postman or the swagger page: https://collectionsapi.lcu-internal.com/api/Configuration +2. Find the "repoAgents" section. Keep this open as you will need to reference this data. +3. Go to the Repo Company admin page in Repo manager: https://repomanage.lcu-internal.com/#/RepoCompanies/ +4. For each RepoCompany set its referenceID to the ID in the matching entry in the CollectionsAPI results + +``` + "repoAgents": [ + { + "id": 20000XX, //This is the referenceID + "description": "Name of Agent", + "code": "AgentCode", + "type": "CUSTOM_REPO_AGENT" +}, +``` + +If there are any new repoAgents in the collections query, be sure to reach out to the RepoAPI business contacts and confirm the addition before adding it to RepoManager yourself. \ No newline at end of file diff --git a/LCU.API.Collections.RepoApi-old/azure-pipelines.yml b/LCU.API.Collections.RepoApi-old/azure-pipelines.yml new file mode 100644 index 0000000..8a5f088 --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/azure-pipelines.yml @@ -0,0 +1,72 @@ +# ASP.NET Core + +name: 'RepoAPI.$(Build.SourceBranchName).$(Date:yyyyMMdd)$(Rev:.r)' +trigger: + branches: + include: + - '*' + +pool: + name: LCUOnPrem + +variables: + buildConfiguration: 'Release' + +steps: +- task: DotNetCoreCLI@2 + inputs: + command: 'restore' + feedsToUse: 'select' + vstsFeed: '58ebbac4-8e98-4281-bb3f-58003852f4a7' + +- task: DotNetCoreCLI@2 + inputs: + command: 'build' + projects: '**/*.csproj' + arguments: '--configuration $(buildConfiguration)' + +- task: DotNetCoreCLI@2 + displayName: Test + inputs: + command: test + projects: '**/*Tests.csproj' + arguments: '--configuration $(BuildConfiguration) --collect "Code coverage"' + +- task: DotNetCoreCLI@2 + displayName: 'dotnet publish $(buildConfiguration)' + inputs: + command: 'publish' + publishWebProjects: false + projects: '**/*.csproj' + arguments: '--configuration $(BuildConfiguration) --output $(Build.ArtifactStagingDirectory)' + +- task: MSBuild@1 + displayName: Build sql project + inputs: + solution: './LCU.API.Collections.RepoApiSql/LCU.API.Collections.RepoApiSql.sqlproj' + configuration: 'Release' + +- task: CopyFiles@2 + displayName: Copy dacpac to artifact staging directory + inputs: + SourceFolder: './LCU.API.Collections.RepoApiSql/bin/$(BuildConfiguration)/' + Contents: 'LCU.API.Collections.RepoApiSql.dacpac' + TargetFolder: '$(build.artifactstagingdirectory)' + OverWrite: true + +- task: NuGetCommand@2 + displayName: 'NuGet push' + inputs: + command: push + packagesToPush: 'LCU.Shared.Collections.RepoApiLib/**/*.nupkg' + publishVstsFeed: '58ebbac4-8e98-4281-bb3f-58003852f4a7' + allowPackageConflicts: true + +- task: PublishBuildArtifacts@1 + condition: and (succeeded(), or( eq(variables['Build.SourceBranchName'], 'develop'), eq(variables['Build.SourceBranchName'], 'master')) ) + displayName: 'Publish Artifact: dist' + inputs: + PathtoPublish: '$(build.artifactstagingdirectory)' + ArtifactName: 'dist' + + diff --git a/LCU.API.Collections.RepoApi-old/setup-env.ps1 b/LCU.API.Collections.RepoApi-old/setup-env.ps1 new file mode 100644 index 0000000..b87732f --- /dev/null +++ b/LCU.API.Collections.RepoApi-old/setup-env.ps1 @@ -0,0 +1,34 @@ +# Landmark Credit Union +# Developer Environment Setup Extended +# +# !!! Run this after running the basic script, or if you install your own basics !!! +# +# Running this script on a Windows 10 machine should install all of the software you need +# to work on the project for both the client and api. +# You can use 'choco upgrade all' to keep software up to date, but be careful updating Node (see Node section) + +Write-Output "Starting extended environment setup, SSIS" + + +# 1. Create an update function. +function Update-Environment-Path +{ + $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") ` + + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") +} + +# 2. Visual Studio 2017 +# 2.2.105 last version available for VS2017 +choco install visualstudio2017community --yes +choco install dotnetcore-sdk --version 2.2.105 --yes +choco install netfx-4.7-devpack --yes + +# 3. SSIS +choco install ssis-vs2017 --yes +Update-Environment-Path + +# 4. Resharper +# if you use resharper, uncomment this. +# choco install resharper -y + +Write-Output "Complete"