Adding
This commit is contained in:
+372
@@ -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<IAccountAlertCheckService> _mockAccountAlertCheckService;
|
||||
private readonly Mock<ISettingsService> _mockSettingsService;
|
||||
private readonly Mock<IRepoAccountService> _mockRepoAccountService;
|
||||
private readonly Mock<ICollectionsDao> _mockCollectionsDao;
|
||||
private readonly Mock<ICoreDao> _mockCoreDao;
|
||||
private readonly Mock<IRepoLetterService> _mockRepoLetterService;
|
||||
private readonly Mock<IEmailer> _mockEmailer;
|
||||
private readonly Mock<IAuctionAssignmentService> _mockAuctionAssignmentService;
|
||||
private readonly Mock<IEventAlertService> _mockEventAlertService;
|
||||
private readonly Mock<IRepoCompanySelectionService> _mockRepoCompanySelectionService;
|
||||
|
||||
public RepoAccountProcessorIntegrationTest()
|
||||
{
|
||||
_mockAccountAlertCheckService = new Mock<IAccountAlertCheckService>();
|
||||
_mockSettingsService = new Mock<ISettingsService>();
|
||||
_mockRepoAccountService = new Mock<IRepoAccountService>();
|
||||
_mockCollectionsDao = new Mock<ICollectionsDao>();
|
||||
_mockCoreDao = new Mock<ICoreDao>();
|
||||
_mockEmailer = new Mock<IEmailer>();
|
||||
_mockAuctionAssignmentService = new Mock<IAuctionAssignmentService>();
|
||||
_mockRepoLetterService = new Mock<IRepoLetterService>();
|
||||
_mockEventAlertService = new Mock<IEventAlertService>();
|
||||
_mockRepoCompanySelectionService = new Mock<IRepoCompanySelectionService>();
|
||||
var repoSettings = DbContextFromJson.GetTestObjectFromFile<Settings>("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<RepoAccount>(), It.IsAny<TemenosCase>()));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Basic_Construct_Test()
|
||||
{
|
||||
Assert.NotNull(_repoAccountProcessor);
|
||||
await Assert.ThrowsAsync<IneligibleAccountException>(() => { 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<ProcessorTestInput>("Services/Processor/newAccount.json");
|
||||
Assert.NotNull(testInput);
|
||||
_mockCollectionsDao.Setup(cd => cd.RetrieveAccountAsync(It.IsAny<string>())).ReturnsAsync(testInput.TemenosAccount);
|
||||
_mockRepoAccountService.Setup(ras => ras.GetNewestOpenAccount(It.IsAny<string>()))
|
||||
.ReturnsAsync((RepoAccount) null);
|
||||
_mockCoreDao.Setup(cd => cd.RetrieveLoanAsync(It.IsAny<string>())).ReturnsAsync(testInput.LoanDetail);
|
||||
_mockCoreDao.Setup(cd => cd.RetrieveMemberAsync(It.IsAny<string>())).ReturnsAsync(testInput.MemberDetail);
|
||||
_mockCoreDao.Setup(cd => cd.RetrieveTransactionsAsync(It.IsAny<string>())).ReturnsAsync(testInput.CoreTransactions);
|
||||
_mockCoreDao.Setup(cd => cd.RetrieveCollateralAsync(It.IsAny<string>())).ReturnsAsync(testInput.CollateralDetails);
|
||||
_mockRepoLetterService.Setup(x => x.ListByAccountIdAsync(It.IsAny<int>())).ReturnsAsync(
|
||||
RepoLetterService.ProcessLetters(testInput.TemenosHistory, testInput.RepoLetters));
|
||||
_mockAuctionAssignmentService.Setup(x => x.GetListByIdsAsync(It.IsAny<IReadOnlyCollection<int>>()))
|
||||
.ReturnsAsync(new List<AuctionAssignment>());
|
||||
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<ProcessorTestInput>("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<ProcessorTestInput>("Services/Processor/ineligibleAccount.json");
|
||||
Assert.NotNull(testInput);
|
||||
_mockCollectionsDao.Setup(cd => cd.RetrieveAccountAsync(It.IsAny<string>())).ReturnsAsync(testInput.TemenosAccount);
|
||||
_mockRepoAccountService.Setup(ras => ras.GetNewestOpenAccount(It.IsAny<string>()))
|
||||
.ReturnsAsync((RepoAccount) null);
|
||||
_mockCoreDao.Setup(cd => cd.RetrieveLoanAsync(It.IsAny<string>())).ReturnsAsync(testInput.LoanDetail);
|
||||
_mockCoreDao.Setup(cd => cd.RetrieveMemberAsync(It.IsAny<string>())).ReturnsAsync(testInput.MemberDetail);
|
||||
_mockCoreDao.Setup(cd => cd.RetrieveTransactionsAsync(It.IsAny<string>())).ReturnsAsync(testInput.CoreTransactions);
|
||||
_mockCoreDao.Setup(cd => cd.RetrieveCollateralAsync(It.IsAny<string>())).ReturnsAsync(testInput.CollateralDetails);
|
||||
_mockRepoLetterService.Setup(x => x.ListByAccountIdAsync(It.IsAny<int>())).ReturnsAsync(
|
||||
RepoLetterService.ProcessLetters(testInput.TemenosHistory, testInput.RepoLetters));
|
||||
_mockAuctionAssignmentService.Setup(x => x.GetListByIdsAsync(It.IsAny<IReadOnlyCollection<int>>()))
|
||||
.ReturnsAsync(new List<AuctionAssignment>());
|
||||
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<ProcessorTestInput>("Services/Processor/update-retitle-redemption-exp.json");
|
||||
Assert.NotNull(testInput);
|
||||
_mockCollectionsDao.Setup(cd => cd.RetrieveAccountAsync(It.IsAny<string>())).ReturnsAsync(testInput.TemenosAccount);
|
||||
_mockRepoAccountService.Setup(ras => ras.GetNewestOpenAccount(It.IsAny<string>()))
|
||||
.ReturnsAsync(testInput.RepoAccount);
|
||||
_mockRepoAccountService.Setup(x => x.UpdateAsync(It.IsAny<RepoAccount>(), It.IsAny<AppUser>()))
|
||||
.ReturnsAsync((RepoAccount inAccount, AppUser inUser) => {
|
||||
resultAccount = inAccount;
|
||||
return inAccount;
|
||||
});
|
||||
_mockCoreDao.Setup(cd => cd.RetrieveLoanAsync(It.IsAny<string>())).ReturnsAsync(testInput.LoanDetail);
|
||||
_mockCoreDao.Setup(cd => cd.RetrieveMemberAsync(It.IsAny<string>())).ReturnsAsync(testInput.MemberDetail);
|
||||
_mockCoreDao.Setup(cd => cd.RetrieveTransactionsAsync(It.IsAny<string>())).ReturnsAsync(testInput.CoreTransactions);
|
||||
_mockRepoLetterService.Setup(x => x.ListByAccountIdAsync(It.IsAny<int>())).ReturnsAsync(
|
||||
RepoLetterService.ProcessLetters(testInput.TemenosHistory, testInput.RepoLetters));
|
||||
_mockAuctionAssignmentService.Setup(x => x.GetListByIdsAsync(It.IsAny<IReadOnlyCollection<int>>()))
|
||||
.ReturnsAsync(new List<AuctionAssignment>());
|
||||
|
||||
// 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<ProcessorTestInput>("Services/Processor/written-off-account.json");
|
||||
Assert.NotNull(testInput);
|
||||
_mockCollectionsDao.Setup(cd => cd.RetrieveAccountAsync(It.IsAny<string>())).ReturnsAsync(testInput.TemenosAccount);
|
||||
_mockRepoAccountService.Setup(ras => ras.GetNewestOpenAccount(It.IsAny<string>()))
|
||||
.ReturnsAsync(testInput.RepoAccount);
|
||||
_mockRepoAccountService.Setup(x => x.UpdateAsync(It.IsAny<RepoAccount>(), It.IsAny<AppUser>()))
|
||||
.ReturnsAsync((RepoAccount inAccount, AppUser inUser) => {
|
||||
resultAccount = inAccount;
|
||||
return inAccount;
|
||||
});
|
||||
_mockCoreDao.Setup(cd => cd.RetrieveLoanAsync(It.IsAny<string>())).ReturnsAsync(testInput.LoanDetail);
|
||||
_mockCoreDao.Setup(cd => cd.RetrieveMemberAsync(It.IsAny<string>())).ReturnsAsync(testInput.MemberDetail);
|
||||
_mockCoreDao.Setup(cd => cd.RetrieveTransactionsAsync(It.IsAny<string>())).ReturnsAsync(testInput.CoreTransactions);
|
||||
_mockRepoLetterService.Setup(x => x.ListByAccountIdAsync(It.IsAny<int>())).ReturnsAsync(
|
||||
RepoLetterService.ProcessLetters(testInput.TemenosHistory, testInput.RepoLetters));
|
||||
_mockAuctionAssignmentService.Setup(x => x.GetListByIdsAsync(It.IsAny<IReadOnlyCollection<int>>()))
|
||||
.ReturnsAsync(new List<AuctionAssignment>());
|
||||
|
||||
// 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<ProcessorTestInput>("Services/Processor/written-off-account-2.json");
|
||||
Assert.NotNull(testInput);
|
||||
_mockCollectionsDao.Setup(cd => cd.RetrieveAccountAsync(It.IsAny<string>())).ReturnsAsync(testInput.TemenosAccount);
|
||||
_mockRepoAccountService.Setup(ras => ras.GetNewestOpenAccount(It.IsAny<string>()))
|
||||
.ReturnsAsync(testInput.RepoAccount);
|
||||
_mockRepoAccountService.Setup(x => x.UpdateAsync(It.IsAny<RepoAccount>(), It.IsAny<AppUser>()))
|
||||
.ReturnsAsync((RepoAccount inAccount, AppUser inUser) => {
|
||||
resultAccount = inAccount;
|
||||
return inAccount;
|
||||
});
|
||||
_mockCoreDao.Setup(cd => cd.RetrieveLoanAsync(It.IsAny<string>())).ReturnsAsync(testInput.LoanDetail);
|
||||
_mockCoreDao.Setup(cd => cd.RetrieveMemberAsync(It.IsAny<string>())).ReturnsAsync(testInput.MemberDetail);
|
||||
_mockCoreDao.Setup(cd => cd.RetrieveTransactionsAsync(It.IsAny<string>())).ReturnsAsync(testInput.CoreTransactions);
|
||||
_mockRepoLetterService.Setup(x => x.ListByAccountIdAsync(It.IsAny<int>())).ReturnsAsync(
|
||||
RepoLetterService.ProcessLetters(testInput.TemenosHistory, testInput.RepoLetters));
|
||||
_mockAuctionAssignmentService.Setup(x => x.GetListByIdsAsync(It.IsAny<IReadOnlyCollection<int>>()))
|
||||
.ReturnsAsync(new List<AuctionAssignment>());
|
||||
|
||||
// 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);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
+1654
File diff suppressed because it is too large
Load Diff
+650
@@ -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<IRepoAccountProcessorService> _mockRepoAccountProcessorService;
|
||||
private readonly Mock<IAccountAlertCheckService> _mockAccountAlertCheckService;
|
||||
private readonly Mock<ISettingsService> _mockSettingsService;
|
||||
private readonly Mock<IRepoAccountService> _mockRepoAccountService;
|
||||
private readonly Mock<ICollectionsDao> _mockCollectionsDao;
|
||||
private readonly Mock<ICoreDao> _mockCoreDao;
|
||||
private readonly Mock<IRepoLetterService> _mockRepoLetterService;
|
||||
private readonly Mock<IEmailer> _mockEmailer;
|
||||
private readonly Mock<IAuctionAssignmentService> _mockAuctionAssignmentService;
|
||||
|
||||
public RepoAccountProcessorTest()
|
||||
{
|
||||
_mockRepoAccountProcessorService = new Mock<IRepoAccountProcessorService>();
|
||||
_mockAccountAlertCheckService = new Mock<IAccountAlertCheckService>();
|
||||
_mockSettingsService = new Mock<ISettingsService>();
|
||||
_mockRepoAccountService = new Mock<IRepoAccountService>();
|
||||
_mockCollectionsDao = new Mock<ICollectionsDao>();
|
||||
_mockCoreDao = new Mock<ICoreDao>();
|
||||
_mockEmailer = new Mock<IEmailer>();
|
||||
_mockAuctionAssignmentService = new Mock<IAuctionAssignmentService>();
|
||||
_mockRepoLetterService = new Mock<IRepoLetterService>();
|
||||
var repoSettings = DbContextFromJson.GetTestObjectFromFile<Settings>("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<RepoAccount>(), It.IsAny<TemenosCase>()));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Basic_Construct_Test()
|
||||
{
|
||||
Assert.NotNull(_repoAccountProcessor);
|
||||
await Assert.ThrowsAsync<IneligibleAccountException>(() => { return _repoAccountProcessor.HandleAccount(null); });
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Verify_AccountNo_Test()
|
||||
{
|
||||
Assert.NotNull(_repoAccountProcessor);
|
||||
Assert.Throws<IneligibleAccountException>(() => { _repoAccountProcessor.VerifyAccountNo(null); });
|
||||
Assert.Throws<IneligibleAccountException>(() => { _repoAccountProcessor.VerifyAccountNo(new ProcessingItem()); });
|
||||
// Assert.Throws<IneligibleAccountException>(() => { _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<string, string>()
|
||||
};
|
||||
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<string, string>()
|
||||
};
|
||||
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<string, string>();
|
||||
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<MissingRequirementException>(() => { _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<string>()))
|
||||
.ReturnsAsync(row.CollectionAccount);
|
||||
_mockRepoAccountService.Setup(x => x.GetNewestOpenAccount(row.CollectionAccount.AccountIdentifier))
|
||||
.ReturnsAsync(row.ExistingRepoAccount);
|
||||
_mockRepoAccountProcessorService.Setup(service => service.CreateRepoAccount(It.IsAny<TemenosAccount>(), It.IsAny<TemenosCase>(), It.IsAny<LoanDetail>()))
|
||||
.Returns(row.NewRepoAccount);
|
||||
_mockRepoAccountService.Setup(service => service.SaveAsync(It.IsAny<RepoAccount>()))
|
||||
.ReturnsAsync(row.NewRepoAccount);
|
||||
_mockRepoLetterService.Setup(service => service.ListByAccountIdAsync(It.IsAny<int>()))
|
||||
.ReturnsAsync(new List<RepoLetter>());
|
||||
_mockCoreDao.Setup(service => service.RetrieveTransactionsAsync(It.IsAny<string>())).ReturnsAsync(
|
||||
new List<CoreTransaction>());
|
||||
_mockCoreDao.Setup(service => service.RetrieveMemberAsync(It.IsAny<string>())).ReturnsAsync(
|
||||
new MemberDetail());
|
||||
_mockCoreDao.Setup(service => service.RetrieveLoanAsync(It.IsAny<string>())).ReturnsAsync(
|
||||
new LoanDetail());
|
||||
_mockAuctionAssignmentService
|
||||
.Setup(service => service.GetListByIdsAsync(It.IsAny<IReadOnlyCollection<int>>())).ReturnsAsync(
|
||||
new LinkedList<AuctionAssignment>());
|
||||
_mockAccountAlertCheckService.Setup(service => service.AlertChecksPrimary(It.IsAny<RepoAccountProcessingSlip>()))
|
||||
.Returns(Task.FromResult<object>(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<string>()))
|
||||
.ReturnsAsync(row.CollectionAccount);
|
||||
_mockRepoAccountService.Setup(x => x.GetNewestOpenAccount(row.CollectionAccount.AccountIdentifier))
|
||||
.ReturnsAsync(row.ExistingRepoAccount);
|
||||
_mockRepoAccountProcessorService.Setup(service => service.UpdateRepoAccountFromParts( It.IsAny<RepoAccountProcessingSlip>()))
|
||||
.Returns(row.NewRepoAccount);
|
||||
_mockRepoAccountService.Setup(service => service.UpdateAsync(It.IsAny<RepoAccount>(), It.IsAny<AppUser>()))
|
||||
.ReturnsAsync(row.NewRepoAccount);
|
||||
_mockRepoLetterService.Setup(service => service.ListByAccountIdAsync(It.IsAny<int>()))
|
||||
.ReturnsAsync(new List<RepoLetter>());
|
||||
_mockCoreDao.Setup(service => service.RetrieveTransactionsAsync(It.IsAny<string>())).ReturnsAsync(
|
||||
new List<CoreTransaction>());
|
||||
_mockCoreDao.Setup(service => service.RetrieveMemberAsync(It.IsAny<string>())).ReturnsAsync(
|
||||
new MemberDetail());
|
||||
_mockCoreDao.Setup(service => service.RetrieveLoanAsync(It.IsAny<string>())).ReturnsAsync(
|
||||
new LoanDetail());
|
||||
_mockAuctionAssignmentService
|
||||
.Setup(service => service.GetListByIdsAsync(It.IsAny<IReadOnlyCollection<int>>())).ReturnsAsync(
|
||||
new LinkedList<AuctionAssignment>());
|
||||
_mockAccountAlertCheckService.Setup(service => service.AlertChecksPrimary(It.IsAny<RepoAccountProcessingSlip>()))
|
||||
.Returns(Task.FromResult<object>(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<string>()))
|
||||
.ReturnsAsync(row.CollectionAccount);
|
||||
_mockRepoAccountService.Setup(x => x.GetNewestOpenAccount(row.CollectionAccount.AccountIdentifier))
|
||||
.ReturnsAsync(row.ExistingRepoAccount);
|
||||
_mockRepoAccountProcessorService.Setup(service => service.UpdateRepoAccountFromParts(It.IsAny<RepoAccountProcessingSlip>()))
|
||||
.Returns(row.NewRepoAccount);
|
||||
_mockRepoAccountService.Setup(service => service.UpdateAsync(It.IsAny<RepoAccount>(), It.IsAny<AppUser>()))
|
||||
.ReturnsAsync(row.NewRepoAccount);
|
||||
_mockRepoLetterService.Setup(service => service.ListByAccountIdAsync(It.IsAny<int>()))
|
||||
.ReturnsAsync(new List<RepoLetter>());
|
||||
_mockCoreDao.Setup(service => service.RetrieveTransactionsAsync(It.IsAny<string>())).ReturnsAsync(
|
||||
new List<CoreTransaction>());
|
||||
_mockCoreDao.Setup(service => service.RetrieveMemberAsync(It.IsAny<string>())).ReturnsAsync(
|
||||
new MemberDetail());
|
||||
_mockCoreDao.Setup(service => service.RetrieveLoanAsync(It.IsAny<string>())).ReturnsAsync(
|
||||
new LoanDetail());
|
||||
_mockAuctionAssignmentService
|
||||
.Setup(service => service.GetListByIdsAsync(It.IsAny<IReadOnlyCollection<int>>())).ReturnsAsync(
|
||||
new LinkedList<AuctionAssignment>());
|
||||
|
||||
|
||||
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<TemenosCase>()
|
||||
{
|
||||
new TemenosCase()
|
||||
{
|
||||
CaseId = 999,
|
||||
RepoStatus = RepoStatus.REPO,
|
||||
CaseTypeId = 7
|
||||
}
|
||||
}
|
||||
// UserStatusCode1 = "REPO"
|
||||
};
|
||||
var repoAccount = new RepoAccount()
|
||||
{
|
||||
RepoId = 555,
|
||||
Status = "O4R",
|
||||
Collaterals = new List<Collateral>()
|
||||
{
|
||||
new Collateral()
|
||||
{
|
||||
RepoId = 555
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
_mockCollectionsDao.Setup(x => x.RetrieveAccountAsync(It.IsAny<string>()))
|
||||
.ReturnsAsync(testAccount);
|
||||
|
||||
_mockRepoAccountService.Setup(x => x.GetNewestOpenAccount(It.IsAny<string>()))
|
||||
.ReturnsAsync(repoAccount);
|
||||
|
||||
_mockRepoAccountProcessorService
|
||||
.Setup(service => service.CreateRepoAccount(It.IsAny<TemenosAccount>(), It.IsAny<TemenosCase>(), It.IsAny<LoanDetail>()))
|
||||
.Returns(repoAccount);
|
||||
|
||||
_mockRepoLetterService.Setup(service => service.ListByAccountIdAsync(It.IsAny<int>()))
|
||||
.ReturnsAsync(new List<RepoLetter>());
|
||||
_mockCoreDao.Setup(service => service.RetrieveTransactionsAsync(It.IsAny<string>())).ReturnsAsync(
|
||||
new List<CoreTransaction>());
|
||||
_mockCoreDao.Setup(service => service.RetrieveMemberAsync(It.IsAny<string>())).ReturnsAsync(
|
||||
new MemberDetail());
|
||||
_mockCoreDao.Setup(service => service.RetrieveLoanAsync(It.IsAny<string>())).ReturnsAsync(
|
||||
new LoanDetail());
|
||||
_mockAuctionAssignmentService
|
||||
.Setup(service => service.GetListByIdsAsync(It.IsAny<IReadOnlyCollection<int>>())).ReturnsAsync(
|
||||
new LinkedList<AuctionAssignment>());
|
||||
_mockRepoAccountProcessorService.Setup(service =>
|
||||
service.UpdateRepoAccountFromParts(It.IsAny<RepoAccountProcessingSlip>()))
|
||||
.Returns(repoAccount);
|
||||
|
||||
var result = await _repoAccountProcessor.HandleAccount(new ProcessingItem()
|
||||
{AccountNo = testAccount.AccountIdentifier, CaseId = "999"});
|
||||
_mockRepoAccountProcessorService.Verify(foo => foo.UpdateRepoAccountFromParts(It.IsAny<RepoAccountProcessingSlip>()), Times.Once);
|
||||
_mockRepoAccountProcessorService.Verify(foo => foo.CreateRepoAccount( It.IsAny<TemenosAccount>(), It.IsAny<TemenosCase>(), It.IsAny<LoanDetail>()), Times.Never());
|
||||
_mockRepoAccountProcessorService.Verify(mock => mock.TryUpdateCollateralRetitleDate(It.IsAny<RepoAccount>(), It.IsAny<TemenosCase>()), 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<TemenosCase>()
|
||||
{
|
||||
new TemenosCase()
|
||||
{
|
||||
CaseId = 99,
|
||||
RepoStatus = RepoStatus.O4R,
|
||||
CaseTypeId = 7
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
_mockCollectionsDao.Setup(x => x.RetrieveAccountAsync(It.IsAny<string>()))
|
||||
.ReturnsAsync(testAccount);
|
||||
_mockRepoAccountService.Setup(x => x.GetNewestOpenAccount(It.IsAny<string>()))
|
||||
.ReturnsAsync(new RepoAccount()
|
||||
{
|
||||
Status = "O4R",
|
||||
RepoId = 555 /* no collateral! */
|
||||
});
|
||||
|
||||
_mockRepoAccountProcessorService.Setup(service => service.CreateRepoAccount(It.IsAny<TemenosAccount>(), It.IsAny<TemenosCase>(), It.IsAny<LoanDetail>()))
|
||||
.Verifiable("Called create");
|
||||
_mockRepoAccountProcessorService.Setup(service =>
|
||||
service.UpdateRepoAccountFromParts(It.IsAny<RepoAccountProcessingSlip>()))
|
||||
.Verifiable("merge existing");
|
||||
_mockRepoLetterService.Setup(service => service.ListByAccountIdAsync(It.IsAny<int>()))
|
||||
.ReturnsAsync(new List<RepoLetter>());
|
||||
_mockEmailer.Setup(service => service.MaybeSendO4rNoCollateralEmail(It.IsAny<RepoAccount>()))
|
||||
.ReturnsAsync(new HttpResponseMessage { StatusCode = HttpStatusCode.OK }).Verifiable("Send e-mail");
|
||||
_mockCoreDao.Setup(service => service.RetrieveLoanAsync(It.IsAny<string>())).ReturnsAsync(
|
||||
new LoanDetail());
|
||||
|
||||
await Assert.ThrowsAsync<MissingRequirementException>(() => _repoAccountProcessor.HandleAccount(
|
||||
new ProcessingItem()
|
||||
{
|
||||
AccountNo = testAccount.AccountIdentifier,
|
||||
CaseId = $"{testAccount.Cases.First().CaseId}"
|
||||
}));
|
||||
_mockRepoAccountProcessorService.Verify(foo => foo.CreateRepoAccount(It.IsAny<TemenosAccount>(), It.IsAny<TemenosCase>(), It.IsAny<LoanDetail>()), Times.Never());
|
||||
// _mockRepoAccountProcessorService.VerifyAll();
|
||||
_mockRepoAccountProcessorService.Verify(
|
||||
service => service.UpdateRepoAccountFromParts(It.IsAny<RepoAccountProcessingSlip>()),
|
||||
Times.Never());
|
||||
|
||||
_mockEmailer.Verify(x => x.MaybeSendO4rNoCollateralEmail(It.IsAny<RepoAccount>()), Times.Once);
|
||||
Assert.NotNull(_repoAccountProcessor);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Find_Recovery_Case_OK()
|
||||
{
|
||||
var testAccount = new TemenosAccount()
|
||||
{
|
||||
AccountIdentifier = "123456-134",
|
||||
Cases = new List<TemenosCase>()
|
||||
{
|
||||
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<TemenosCase>()
|
||||
{
|
||||
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<TemenosCase>()
|
||||
{
|
||||
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<Collateral>()
|
||||
{
|
||||
new Collateral()
|
||||
{
|
||||
RepoId = 555
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
_mockRepoAccountProcessorService.Setup(serv => serv.UpdateRepoAccountFromParts(It.IsAny<RepoAccountProcessingSlip>())).Returns(repoAccount);
|
||||
_mockRepoAccountProcessorService.Setup(serv => serv.CheckForRejectedStatusChange(It.IsAny<RepoAccount>(), It.IsAny<RepoAccount>(), It.IsAny<Settings>()));
|
||||
_mockRepoAccountProcessorService.Setup(serv =>
|
||||
serv.TryUpdateOrCreateRepoCompanyAssignment(It.IsAny<RepoAccount>(), It.IsAny<TemenosCase>(),
|
||||
It.IsAny<Settings>()));
|
||||
_mockRepoAccountProcessorService.Setup(serv => serv.TryUpdateCollateralRetitleDate(It.IsAny<RepoAccount>(), It.IsAny<TemenosCase>()));
|
||||
_mockRepoAccountProcessorService.Setup(serv => serv.UpdateRepoAccountDateClosed(It.IsAny<RepoAccount>()));
|
||||
|
||||
_mockAccountAlertCheckService
|
||||
.Setup(serv => serv.AlertChecksPreStatusReject(It.IsAny<RepoAccountProcessingSlip>()))
|
||||
.Returns(Task.FromResult<object>(null));
|
||||
|
||||
_mockRepoAccountService.Setup(serv => serv.UpdateAsync(It.IsAny<RepoAccount>(), It.IsAny<AppUser>())).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<RepoAccount>(), It.IsAny<AppUser>()), Times.Once);
|
||||
_mockRepoAccountProcessorService.Verify(serv =>
|
||||
serv.TryUpdateOrCreateRepoCompanyAssignment(It.IsAny<RepoAccount>(), It.IsAny<TemenosCase>(),
|
||||
It.IsAny<Settings>()));
|
||||
|
||||
Assert.NotNull(res);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task UpdateExistingRepoAccount_HalfUpdate_OK()
|
||||
{
|
||||
var repoAccount = new RepoAccount()
|
||||
{
|
||||
RepoId = 555,
|
||||
AccountNo = "123456-789",
|
||||
Status = "O4R",
|
||||
Collaterals = new List<Collateral>()
|
||||
{
|
||||
new Collateral()
|
||||
{
|
||||
RepoId = 555
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
_mockRepoAccountProcessorService.Setup(serv => serv.UpdateRepoAccountFromParts(It.IsAny<RepoAccountProcessingSlip>())).Returns(repoAccount);
|
||||
_mockRepoAccountProcessorService.Setup(serv => serv.CheckForRejectedStatusChange(It.IsAny<RepoAccount>(), It.IsAny<RepoAccount>(), It.IsAny<Settings>()));
|
||||
_mockRepoAccountProcessorService.Setup(serv =>
|
||||
serv.TryUpdateOrCreateRepoCompanyAssignment(It.IsAny<RepoAccount>(), It.IsAny<TemenosCase>(), It.IsAny<Settings>()));
|
||||
_mockRepoAccountProcessorService.Setup(serv => serv.TryUpdateCollateralRetitleDate(It.IsAny<RepoAccount>(), It.IsAny<TemenosCase>()));
|
||||
_mockRepoAccountProcessorService.Setup(serv => serv.UpdateRepoAccountDateClosed(It.IsAny<RepoAccount>()));
|
||||
|
||||
_mockAccountAlertCheckService.Setup(serv => serv.AlertChecksPreStatusReject(It.IsAny<RepoAccountProcessingSlip>()));
|
||||
|
||||
_mockRepoAccountService.Setup(serv => serv.UpdateAsync(It.IsAny<RepoAccount>(), It.IsAny<AppUser>())).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<RepoAccount>()), Times.Once);
|
||||
_mockRepoAccountProcessorService.Verify(serv => serv.TryUpdateCollateralRetitleDate(It.IsAny<RepoAccount>(), It.IsAny<TemenosCase>()),Times.Once);
|
||||
_mockRepoAccountProcessorService.Verify(serv => serv.UpdateRepoAccountDateClosed(It.IsAny<RepoAccount>()), Times.Once);
|
||||
_mockRepoAccountProcessorService.Verify(serv =>
|
||||
serv.TryUpdateOrCreateRepoCompanyAssignment(It.IsAny<RepoAccount>(), It.IsAny<TemenosCase>(), It.IsAny<Settings>()),Times.Once);
|
||||
|
||||
Assert.NotNull(res);
|
||||
}
|
||||
}
|
||||
}
|
||||
+3492
File diff suppressed because one or more lines are too long
+4909
File diff suppressed because one or more lines are too long
+3228
File diff suppressed because it is too large
Load Diff
+761
@@ -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": []
|
||||
}
|
||||
+2464
File diff suppressed because one or more lines are too long
+3861
File diff suppressed because it is too large
Load Diff
+2033
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user