This commit is contained in:
Zeeshaun
2026-03-13 09:28:55 -05:00
parent a675c5f5b0
commit 4e6099ff5c
184 changed files with 13756 additions and 0 deletions
@@ -0,0 +1,365 @@
using System.Net;
using LCU.Api.Internal.DataCleanUp.Configuration;
using LCU.Library.Internal.ApiSecurity.Models;
using LCU.Library.Internal.ApiSecurity.Enums;
using LCU.Library.Internal.CoreApiWrapperModel.CoreModels;
using LCU.Library.Internal.CoreApiWrapperModel.CoreModels.AccessChannelPersons;
using LCU.Library.Internal.CoreApiWrapperModel.CoreModels.CoreRequests;
using LCU.Library.Internal.CoreApiWrapperModel.CoreModels.MemberAgreements;
using LCU.Library.Internal.CoreApiWrapperModel.CoreModels.AccessTypes;
using LCU.Library.Internal.CoreApiWrapperModel.CoreModels.CoreSoapRequests;
using LCU.Library.Internal.CoreApiWrapperModel.CoreModels.Transaction;
using LCU.Library.Internal.CoreApiWrapperModel.CoreModels.CoreResponses;
using LCU.Library.Internal.CoreApiWrapperModel.CoreModels.Persons;
using LCU.Library.Internal.CoreApiWrapperModel.CoreModels.Properties;
using LCU.Library.Internal.CoreApiWrapperModel.CoreModels.CoreSoapResponses;
using LCU.Library.Internal.CoreApiWrapperModel.CoreModels.Agreements;
using LCU.Library.Internal.CoreApiWrapperModel.CoreModels.PostalAddresses;
using LCU.Library.Internal.CoreApiWrapperModel.CoreModels.Accounts;
using LCU.Library.Internal.LcuHttpClient.HttpRequest;
using LCU.Library.Internal.LcuHttpClient.Utilities;
namespace LCU.Api.Internal.DataCleanUp.DataAccess;
public class CoreApiWrapperDao : ICoreApiWrapperDao
{
private readonly ApiSecurityConfiguration _apiSecurityConfiguration;
private readonly CoreApiWrapperConfiguration _coreApiWrapperConfiguration;
private readonly IPostRequest _postRequest;
private readonly IPutRequest _putRequest;
private readonly IGetRequest _getRequest;
private const string ClientKeyValue = "DataCleanUp";
private const string UpdateKeyParameterKey = "updateKey";
private const string IncludesParameterKey = "includes";
private const string AccountNoParameterKey = "accountNumber";
private const string PersonNumberParameterKey = "personNumber";
private const string PropertyNumberParameterKey = "propertyNumber";
public CoreApiWrapperDao(
ApiSecurityConfiguration apiSecurityConfiguration,
CoreApiWrapperConfiguration coreApiWrapperConfiguration,
IPostRequest postRequest,
IPutRequest putRequest,
IGetRequest getRequest
)
{
_apiSecurityConfiguration = apiSecurityConfiguration;
_coreApiWrapperConfiguration = coreApiWrapperConfiguration;
_postRequest = postRequest;
_putRequest = putRequest;
_getRequest = getRequest;
}
public async Task<IEnumerable<AgreePerson>> GetAgreePersonsWithHyphenatedUserIds()
{
var path = $"{_coreApiWrapperConfiguration.CoreApiWrapperUrl}{_coreApiWrapperConfiguration.GetAgreePersonsWithHyphenatedUserId}";
var response = await _getRequest.Async<IEnumerable<AgreePerson>>(path, 0);
return response;
}
public async Task<IEnumerable<string>> GetActiveCustodialAgreePersonNumbers()
{
var path = $"{_coreApiWrapperConfiguration.CoreApiWrapperUrl}{_coreApiWrapperConfiguration.GetActiveCustodialAgreePersonNumbers}";
var response = await _getRequest.Async<IEnumerable<string>>(path, 0);
return response;
}
public async Task<IEnumerable<AgreePerson>> GetActiveCustodialVruCardAgreementAgreePersons()
{
var path = $"{_coreApiWrapperConfiguration.CoreApiWrapperUrl}{_coreApiWrapperConfiguration.GetActiveCustodialVruCardAgreementAgreePersons}";
return await _getRequest.Async<IEnumerable<AgreePerson>>(path, 0);
}
public async Task<IEnumerable<string>> GetVipSavingsToFund()
{
var path = $"{_coreApiWrapperConfiguration.CoreApiWrapperUrl}{_coreApiWrapperConfiguration.GetVipSavingsToFund}";
return await _getRequest.Async<IEnumerable<string>>(path, 0);
}
public async Task<CoreApiMessage<IEnumerable<AccessChannelPerson>>> GetCoreApiMessageAccessChannelPersons(
AccessChannelPersonsByPersonRequest request
)
{
var path = $"{_coreApiWrapperConfiguration.CoreApiWrapperUrl}{_coreApiWrapperConfiguration.AccessChannelPersons}";
return await _getRequest.Async<CoreApiMessage<IEnumerable<AccessChannelPerson>>>(HttpUtilities.BuildEndPointWithQueryParams(path, request), 0);
}
public async Task<CoreApiMessage<IEnumerable<AccessChannelPerson>>> GetCoreApiMessageAccessChannelPersons(
AccessChannelPersonsByPersonRequest request,
List<string> includes
)
{
var path = $"{_coreApiWrapperConfiguration.CoreApiWrapperUrl}{_coreApiWrapperConfiguration.AccesschannelPersonWithIncludes}";
var dictionaryOfParameters = HttpUtilities.BuildDictionaryValues(request);
foreach (var includedString in includes)
{
dictionaryOfParameters.Add(IncludesParameterKey, includedString);
}
return await _getRequest.AsyncWithNewton<CoreApiMessage<IEnumerable<AccessChannelPerson>>>(HttpUtilities.BuildEndPointWithQueryParams(path, dictionaryOfParameters),
null, _coreApiWrapperConfiguration.RetryGetAccessChannelPersonIncludes);
}
public async Task<IEnumerable<ExternalDescription>> GetTransactionsExternalDescriptionsWithSsn()
{
var path = $"{_coreApiWrapperConfiguration.CoreApiWrapperUrl}{_coreApiWrapperConfiguration.GetTransactionExternalDescriptionsWithSsn}";
return await _getRequest.Async<IEnumerable<ExternalDescription>>(path, 0);
}
public async Task<IEnumerable<string>> GetBranchCodeChangeAccountNumbers()
{
var path = $"{_coreApiWrapperConfiguration.CoreApiWrapperUrl}{_coreApiWrapperConfiguration.GetAdminBranchCodeChangeAccountNumbers}";
return await _getRequest.Async<IEnumerable<string>>(path, 0);
}
public async Task<Agreement> GetAgreementByUserId(string userId)
{
var path = $"{_coreApiWrapperConfiguration.CoreApiWrapperUrl}{_coreApiWrapperConfiguration.GetAgreementByUserId}";
var finalPath = path.Replace("{userId}", userId);
return await _getRequest.Async<Agreement>(finalPath, 0);
}
public async Task<IReadOnlyCollection<PersonPostalAddress>> GetPersonPostalAddressByPersonNumber(int personNumber)
{
var path = $"{_coreApiWrapperConfiguration.CoreApiWrapperUrl}{_coreApiWrapperConfiguration.GetPersonPostalAddressByPersonNumber}?personNumber={personNumber}";
var coreMessage = await _getRequest.AsyncWithNewton<CoreApiMessage<IReadOnlyCollection<PersonPostalAddress>>>(path);
return coreMessage.MessageBody;
}
public async Task<IEnumerable<string>> GetGroupUpdateForAnalysisAccountNumbers()
{
var path = $"{_coreApiWrapperConfiguration.CoreApiWrapperUrl}{_coreApiWrapperConfiguration.GetAccountsForGroupAnalysis}";
return await _getRequest.Async<IEnumerable<string>>(path, 0);
}
public async Task<IEnumerable<PersonCheckHoldsUserField>> GetAtmCheckHoldsForPersonNumbers(DateTime? resetStartDate, DateTime? resetEndDate, int? fetchSize)
{
var path = $"{_coreApiWrapperConfiguration.CoreApiWrapperUrl}{_coreApiWrapperConfiguration.GetPersonsForAtmCheckHolds}"
+ $"?currentDate={resetStartDate}&checkholdEndDate={resetEndDate}&fetchSize={fetchSize}";
return await _getRequest.Async<IEnumerable<PersonCheckHoldsUserField>>(path, 0, _coreApiWrapperConfiguration.CoreApiTimeout);
}
public async Task<IEnumerable<Property>> GetPropertyNumberByAccountNumber(long accountNumber)
{
var path = $"{_coreApiWrapperConfiguration.CoreApiWrapperUrl}{_coreApiWrapperConfiguration.GetPropertyNumberByAccountNumber}"
+ $"?{AccountNoParameterKey}={accountNumber}";
return await _getRequest.Async<IEnumerable<Property>>(path, 0);
}
public async Task<Account> GetAccountByAccountNumber(long accountNumber)
{
var path = $"{_coreApiWrapperConfiguration.CoreApiWrapperUrl}{_coreApiWrapperConfiguration.GetAccountByAccountNumber}"
+ $"?{AccountNoParameterKey}={accountNumber}";
return await _getRequest.Async<Account>(path, 0);
}
public async Task<IEnumerable<PropertyUserField>> GetPropertyUserField(long propertyNumber)
{
var path = $"{_coreApiWrapperConfiguration.CoreApiWrapperUrl}{_coreApiWrapperConfiguration.PropertyUserField}?{PropertyNumberParameterKey}={propertyNumber}";
var message = await _getRequest.AsyncWithNewton<CoreApiMessage<IEnumerable<PropertyUserField>>>(path);
return message.MessageBody;
}
public async Task<IEnumerable<AccountUserField>> GetAccountUserField(long accountNumber)
{
var path = $"{_coreApiWrapperConfiguration.CoreApiWrapperUrl}{_coreApiWrapperConfiguration.AccountUserField}?{AccountNoParameterKey}={accountNumber}";
var message = await _getRequest.AsyncWithNewton<CoreApiMessage<IEnumerable<AccountUserField>>>(path);
return message.MessageBody;
}
public async Task<IEnumerable<AccountsByMajorMinorBranchAndStatusResponse>> GetAccountsByMajorMinorBranchAndStatus(AccountsByMajorMinorBranchAndStatusRequest request)
{
var httpStatusCodes = new List<HttpStatusCode>() { HttpStatusCode.NoContent };
var path = $"{_coreApiWrapperConfiguration.CoreApiWrapperUrl}{_coreApiWrapperConfiguration.GetAccountsByMajorMinorBranchAndStatus}";
return await _getRequest.Async<IEnumerable<AccountsByMajorMinorBranchAndStatusResponse>> (HttpUtilities.BuildEndPointWithKeyValuePairs(path, request), httpStatusCodes);
}
public async Task<PersonAddrLine> UpdateAddrLineByPersonNumber(PersonAddrLine ncoaRequest)
{
var path = $"{_coreApiWrapperConfiguration.CoreApiWrapperUrl}{_coreApiWrapperConfiguration.PutAddrLineByPersonNumber}";
var uri = new Uri(path);
var response = await _putRequest.Async<PersonAddrLine, PersonAddrLine>(uri, ncoaRequest, HttpUtilities.GetApiKeyHeaders(ClientKeyValue,
_apiSecurityConfiguration.ExtractApiKey(ClientKeyValue, ApiKeySetName.InternalKeySet)), 0);
return response;
}
public async Task<AccessChannelPerson> UpdateAccessChannelPersons(AccessChannelPerson request, long updateKey)
{
var path = $"{_coreApiWrapperConfiguration.CoreApiWrapperUrl}{_coreApiWrapperConfiguration.AccessChannelPersons}?{UpdateKeyParameterKey}={updateKey}";
var uri = new Uri(path);
var response = await _putRequest.Async<AccessChannelPerson, AccessChannelPerson>(uri, request, HttpUtilities.GetApiKeyHeaders(ClientKeyValue,
_apiSecurityConfiguration.ExtractApiKey(ClientKeyValue, ApiKeySetName.InternalKeySet)), 0);
return response;
}
public async Task<AccessType> UpdateAccessType(AccessTypeUpdateRequest request)
{
var path = $"{_coreApiWrapperConfiguration.CoreApiWrapperUrl}{_coreApiWrapperConfiguration.AccessType}";
var uri = new Uri(path);
var response = await _putRequest.Async<AccessTypeUpdateRequest, AccessType>(uri, request, HttpUtilities.GetApiKeyHeaders(ClientKeyValue,
_apiSecurityConfiguration.ExtractApiKey(ClientKeyValue, ApiKeySetName.InternalKeySet)), 0);
return response;
}
public async Task<BasicResponse> UpdatePersonAgreementDetailTypes(PersonAgreementDetailTypeRequest request)
{
var path = $"{_coreApiWrapperConfiguration.CoreApiWrapperUrl}{_coreApiWrapperConfiguration.PutPersonAgreementDetailTypes}";
var uri = new Uri(path);
return await _putRequest.Async<PersonAgreementDetailTypeRequest, BasicResponse>(uri, request, HttpUtilities.GetApiKeyHeaders(ClientKeyValue,
_apiSecurityConfiguration.ExtractApiKey(ClientKeyValue, ApiKeySetName.InternalKeySet)), 0);
}
public async Task<BasicResponse> UpdateTransactionsExternalDescriptions(ExternalDescription request)
{
var path = $"{_coreApiWrapperConfiguration.CoreApiWrapperUrl}{_coreApiWrapperConfiguration.PutTransactionExternalDescription}";
var uri = new Uri(path);
return await _putRequest.Async<ExternalDescription, BasicResponse>(uri, request, HttpUtilities.GetApiKeyHeaders(ClientKeyValue,
_apiSecurityConfiguration.ExtractApiKey(ClientKeyValue, ApiKeySetName.InternalKeySet)), 0);
}
public async Task<List<BasicResponse>> PostFundsToAccount(List<FundsToAccountRequest> requests)
{
var path = $"{_coreApiWrapperConfiguration.CoreApiWrapperUrl}{_coreApiWrapperConfiguration.PostFundsToAccount}";
var uri = new Uri(path);
return await _postRequest.Async<List<FundsToAccountRequest>, List<BasicResponse>>(uri, requests,
HttpUtilities.GetApiKeyHeaders(ClientKeyValue,
_apiSecurityConfiguration.ExtractApiKey(ClientKeyValue, ApiKeySetName.InternalKeySet)), 0);
}
public async Task<BasicResponse> UpdateBranchCodesForAccountNumbers(AccountBranchUpdateRequest request)
{
var path = $"{_coreApiWrapperConfiguration.CoreApiWrapperUrl}{_coreApiWrapperConfiguration.PutAccountBranchCode}";
var uri = new Uri(path);
return await _putRequest.Async<AccountBranchUpdateRequest, BasicResponse>(uri, request,
HttpUtilities.GetApiKeyHeaders(ClientKeyValue,
_apiSecurityConfiguration.ExtractApiKey(ClientKeyValue, ApiKeySetName.InternalKeySet)), 0);
}
public async Task<BasicResponse> UpdateAccountLoanToValue(AccountLtvUpdateRequest request)
{
var path = $"{_coreApiWrapperConfiguration.CoreApiWrapperUrl}{_coreApiWrapperConfiguration.PutAccountLoanToValue}";
var uri = new Uri(path);
var result = await _putRequest.Async<AccountLtvUpdateRequest, BasicResponse>(uri, request,
HttpUtilities.GetApiKeyHeaders(ClientKeyValue,
_apiSecurityConfiguration.ExtractApiKey(ClientKeyValue, ApiKeySetName.InternalKeySet)), 0);
return result;
}
public async Task<BasicResponse> UpdateAccountGroupForAnalysis(AccountAnalysisGroupMaintenanceRequest request)
{
var path = $"{_coreApiWrapperConfiguration.CoreApiWrapperUrl}{_coreApiWrapperConfiguration.PutAccountAnalysisGroup}";
var uri = new Uri(path);
return await _putRequest.Async<AccountAnalysisGroupMaintenanceRequest, BasicResponse>(uri, request,
HttpUtilities.GetApiKeyHeaders(ClientKeyValue,
_apiSecurityConfiguration.ExtractApiKey(ClientKeyValue, ApiKeySetName.InternalKeySet)), 0);
}
public async Task<PersonUserField> UpdateAtmCheckHoldsForPersonNumbers(PersonUserFieldRequest request)
{
var path = $"{_coreApiWrapperConfiguration.CoreApiWrapperUrl}{_coreApiWrapperConfiguration.PutPersonUserFieldForAtmCheckHolds}";
var uri = new Uri(path);
return await _putRequest.Async<PersonUserFieldRequest, PersonUserField>(uri, request,
HttpUtilities.GetApiKeyHeaders(ClientKeyValue,
_apiSecurityConfiguration.ExtractApiKey(ClientKeyValue, ApiKeySetName.InternalKeySet)), 0);
}
public async Task<PersonUserField> AddAtmCheckHoldsForPersonNumbers(PersonUserFieldRequest request)
{
var path = $"{_coreApiWrapperConfiguration.CoreApiWrapperUrl}{_coreApiWrapperConfiguration.PostPersonUserFieldForAtmCheckHolds}";
var uri = new Uri(path);
return await _postRequest.Async<PersonUserFieldRequest, PersonUserField>(uri, request,
HttpUtilities.GetApiKeyHeaders(ClientKeyValue,
_apiSecurityConfiguration.ExtractApiKey(ClientKeyValue, ApiKeySetName.InternalKeySet)), 0);
}
public async Task<CreatedAccountResponse> PostOrganizationAccount(CreateOrganizationAccountRequest request)
{
var path = $"{_coreApiWrapperConfiguration.CoreApiWrapperUrl}{_coreApiWrapperConfiguration.PostOrganizationAccount}";
var uri = new Uri(path);
return await _postRequest.Async<CreateOrganizationAccountRequest, CreatedAccountResponse>(uri, request,
HttpUtilities.GetApiKeyHeaders(ClientKeyValue,
_apiSecurityConfiguration.ExtractApiKey(ClientKeyValue, ApiKeySetName.InternalKeySet)), 0);
}
public async Task<CreatedAccountResponse> PostPersonAccount(CreatePersonAccountRequest request)
{
var path = $"{_coreApiWrapperConfiguration.CoreApiWrapperUrl}{_coreApiWrapperConfiguration.PostPersonAccount}";
var uri = new Uri(path);
return await _postRequest.Async<CreatePersonAccountRequest, CreatedAccountResponse>(uri, request,
HttpUtilities.GetApiKeyHeaders(ClientKeyValue,
_apiSecurityConfiguration.ExtractApiKey(ClientKeyValue, ApiKeySetName.InternalKeySet)), 0);
}
public async Task<BasicResponse> PutOrganizationMaintenanceRequest(OrganizationMaintenanceRequest request)
{
var path = $"{_coreApiWrapperConfiguration.CoreApiWrapperUrl}{_coreApiWrapperConfiguration.PutOrganizationMaintenanceRequest}";
var uri = new Uri(path);
return await _putRequest.Async<OrganizationMaintenanceRequest, BasicResponse>(uri, request,
HttpUtilities.GetApiKeyHeaders(ClientKeyValue,
_apiSecurityConfiguration.ExtractApiKey(ClientKeyValue, ApiKeySetName.InternalKeySet)), 0);
}
public async Task<BasicResponse> PutAccountNicknameUpdateRequest(AccountNickNameUpdateRequest request)
{
var path = $"{_coreApiWrapperConfiguration.CoreApiWrapperUrl}{_coreApiWrapperConfiguration.PutAccountNickNameUpdateRequest}";
var uri = new Uri(path);
return await _putRequest.Async<AccountNickNameUpdateRequest, BasicResponse>(uri, request,
HttpUtilities.GetApiKeyHeaders(ClientKeyValue,
_apiSecurityConfiguration.ExtractApiKey(ClientKeyValue, ApiKeySetName.InternalKeySet)), 0);
}
public async Task<BasicResponse> UpdateAccountCreditReportType(AccountCreditReportTypeUpdateRequest request)
{
var path = $"{_coreApiWrapperConfiguration.CoreApiWrapperUrl}{_coreApiWrapperConfiguration.PutAccountCreditReportType}";
var uri = new Uri(path);
return await _putRequest.Async<AccountCreditReportTypeUpdateRequest, BasicResponse>(uri, request,
HttpUtilities.GetApiKeyHeaders(ClientKeyValue,
_apiSecurityConfiguration.ExtractApiKey(ClientKeyValue, ApiKeySetName.InternalKeySet)), 0);
}
public async Task<BasicResponse> PutPersonUserField(PersonUserField personUserField)
{
var path = $"{_coreApiWrapperConfiguration.CoreApiWrapperUrl}{_coreApiWrapperConfiguration.PutPersonUserField}";
var uri = new Uri(path);
return await _putRequest.Async<PersonUserField, BasicResponse>(uri, personUserField,
HttpUtilities.GetApiKeyHeaders(ClientKeyValue,
_apiSecurityConfiguration.ExtractApiKey(ClientKeyValue, ApiKeySetName.InternalKeySet)), 0);
}
public async Task<BasicResponse> PostPropertyUserField(PropertyUserField propertyUserField)
{
var path = $"{_coreApiWrapperConfiguration.CoreApiWrapperUrl}{_coreApiWrapperConfiguration.PostPropertyUserField}";
var uri = new Uri(path);
return await _postRequest.Async<PropertyUserField, BasicResponse>(uri, propertyUserField,
HttpUtilities.GetApiKeyHeaders(ClientKeyValue,
_apiSecurityConfiguration.ExtractApiKey(ClientKeyValue, ApiKeySetName.InternalKeySet)), 0);
}
public async Task<BasicResponse> PutPropertyUserField(PropertyUserField propertyUserField)
{
var path = $"{_coreApiWrapperConfiguration.CoreApiWrapperUrl}{_coreApiWrapperConfiguration.PutPropertyUserField}";
var uri = new Uri(path);
return await _putRequest.Async<PropertyUserField, BasicResponse>(uri, propertyUserField,
HttpUtilities.GetApiKeyHeaders(ClientKeyValue,
_apiSecurityConfiguration.ExtractApiKey(ClientKeyValue, ApiKeySetName.InternalKeySet)), 0);
}
public async Task<IEnumerable<AccountUserField>> PostAccountUserField(List<AccountUserField> accountUserField)
{
var path = $"{_coreApiWrapperConfiguration.CoreApiWrapperUrl}{_coreApiWrapperConfiguration.AccountUserField}";
var uri = new Uri(path);
return await _postRequest.Async<List<AccountUserField>, IEnumerable<AccountUserField>>(uri, accountUserField,
HttpUtilities.GetApiKeyHeaders(ClientKeyValue,
_apiSecurityConfiguration.ExtractApiKey(ClientKeyValue, ApiKeySetName.InternalKeySet)), 0);
}
public async Task<IEnumerable<AccountUserField>> PutAccountUserField(List<AccountUserField> accountUserField)
{
var path = $"{_coreApiWrapperConfiguration.CoreApiWrapperUrl}{_coreApiWrapperConfiguration.AccountUserField}";
var uri = new Uri(path);
return await _putRequest.Async<List<AccountUserField>, IEnumerable<AccountUserField>>(uri, accountUserField,
HttpUtilities.GetApiKeyHeaders(ClientKeyValue,
_apiSecurityConfiguration.ExtractApiKey(ClientKeyValue, ApiKeySetName.InternalKeySet)), 0);
}
}
@@ -0,0 +1,45 @@
using LCU.Library.Internal.FileOperationsModels.Models;
using LCU.Api.Internal.DataCleanUp.Configuration;
using LCU.Library.Internal.LcuHttpClient.HttpRequest;
namespace LCU.Api.Internal.DataCleanUp.DataAccess;
public class FileOperationsDao : IFileOperationsDao
{
private readonly FileOperationsConfiguration _fileOperationsConfiguration;
private readonly IPostRequest _postRequest;
private readonly IGetRequest _getRequest;
private const string ClientKeyValue = "DataCleanUp";
public FileOperationsDao(
FileOperationsConfiguration fileOperationsConfiguration,
IPostRequest postRequest,
IGetRequest getRequest
)
{
_fileOperationsConfiguration = fileOperationsConfiguration;
_postRequest = postRequest;
_getRequest = getRequest;
}
public async Task<string> GetFileContent(string finalFilePath)
{
var uri = new Uri($"{_fileOperationsConfiguration.FileOperationsUrl}{finalFilePath}");
return await _getRequest.StringResponseAsync(uri, 0);
}
public async Task<List<string>> WriteFile(WriteFileRequest writeFileRequest)
{
var path = $"{_fileOperationsConfiguration.FileOperationsUrl}{_fileOperationsConfiguration.WriteFile}";
var uri = new Uri(path);
return await _postRequest.AsyncWithNewton<WriteFileRequest, List<string>>(uri, writeFileRequest, 0);
}
public async Task<List<string>> BuildDynamicFileList(DynamicFileListRequest fileRequest)
{
var path = $"{_fileOperationsConfiguration.FileOperationsUrl}{_fileOperationsConfiguration.BuildDynamicFileList}";
var uri = new Uri(path);
return await _postRequest.Async<DynamicFileListRequest, List<string>>(uri, fileRequest, 0);
}
}
@@ -0,0 +1,62 @@
using LCU.Library.Internal.CoreApiWrapperModel.CoreModels;
using LCU.Library.Internal.CoreApiWrapperModel.CoreModels.AccessChannelPersons;
using LCU.Library.Internal.CoreApiWrapperModel.CoreModels.AccessTypes;
using LCU.Library.Internal.CoreApiWrapperModel.CoreModels.Agreements;
using LCU.Library.Internal.CoreApiWrapperModel.CoreModels.Accounts;
using LCU.Library.Internal.CoreApiWrapperModel.CoreModels.CoreRequests;
using LCU.Library.Internal.CoreApiWrapperModel.CoreModels.CoreResponses;
using LCU.Library.Internal.CoreApiWrapperModel.CoreModels.CoreSoapRequests;
using LCU.Library.Internal.CoreApiWrapperModel.CoreModels.CoreSoapResponses;
using LCU.Library.Internal.CoreApiWrapperModel.CoreModels.MemberAgreements;
using LCU.Library.Internal.CoreApiWrapperModel.CoreModels.Persons;
using LCU.Library.Internal.CoreApiWrapperModel.CoreModels.PostalAddresses;
using LCU.Library.Internal.CoreApiWrapperModel.CoreModels.Properties;
using LCU.Library.Internal.CoreApiWrapperModel.CoreModels.Transaction;
using LCU.Library.Internal.DataCleanUpModel.Models;
using Microsoft.AspNetCore.Mvc;
namespace LCU.Api.Internal.DataCleanUp.DataAccess;
public interface ICoreApiWrapperDao
{
Task<IEnumerable<AgreePerson>> GetAgreePersonsWithHyphenatedUserIds();
Task<IEnumerable<string>> GetActiveCustodialAgreePersonNumbers();
Task<IEnumerable<AgreePerson>> GetActiveCustodialVruCardAgreementAgreePersons();
Task<IEnumerable<string>> GetVipSavingsToFund();
Task<CoreApiMessage<IEnumerable<AccessChannelPerson>>> GetCoreApiMessageAccessChannelPersons(
AccessChannelPersonsByPersonRequest request);
Task<CoreApiMessage<IEnumerable<AccessChannelPerson>>> GetCoreApiMessageAccessChannelPersons(
AccessChannelPersonsByPersonRequest request, List<string> includes);
Task<IEnumerable<ExternalDescription>> GetTransactionsExternalDescriptionsWithSsn();
Task<IEnumerable<string>> GetBranchCodeChangeAccountNumbers();
Task<IEnumerable<string>> GetGroupUpdateForAnalysisAccountNumbers();
Task<Agreement> GetAgreementByUserId(string userId);
Task<IReadOnlyCollection<PersonPostalAddress>> GetPersonPostalAddressByPersonNumber(int personNumber);
Task<IEnumerable<AccountsByMajorMinorBranchAndStatusResponse>> GetAccountsByMajorMinorBranchAndStatus(AccountsByMajorMinorBranchAndStatusRequest request);
Task<PersonAddrLine> UpdateAddrLineByPersonNumber(PersonAddrLine ncoaRequest);
Task<IEnumerable<PersonCheckHoldsUserField>> GetAtmCheckHoldsForPersonNumbers(DateTime? resetStartDate, DateTime? resetEndDate, int? fetchSize);
Task<AccessChannelPerson> UpdateAccessChannelPersons(AccessChannelPerson request, long updateKey);
Task<AccessType> UpdateAccessType(AccessTypeUpdateRequest request);
Task<BasicResponse> UpdatePersonAgreementDetailTypes(PersonAgreementDetailTypeRequest request);
Task<BasicResponse> UpdateTransactionsExternalDescriptions(ExternalDescription request);
Task<List<BasicResponse>> PostFundsToAccount(List<FundsToAccountRequest> requests);
Task<BasicResponse> UpdateBranchCodesForAccountNumbers(AccountBranchUpdateRequest request);
Task<BasicResponse> UpdateAccountLoanToValue(AccountLtvUpdateRequest request);
Task<BasicResponse> UpdateAccountGroupForAnalysis(AccountAnalysisGroupMaintenanceRequest request);
Task<PersonUserField> UpdateAtmCheckHoldsForPersonNumbers(PersonUserFieldRequest request);
Task<PersonUserField> AddAtmCheckHoldsForPersonNumbers(PersonUserFieldRequest request);
Task<CreatedAccountResponse> PostOrganizationAccount(CreateOrganizationAccountRequest request);
Task<CreatedAccountResponse> PostPersonAccount(CreatePersonAccountRequest request);
Task<BasicResponse> PutOrganizationMaintenanceRequest(OrganizationMaintenanceRequest request);
Task<BasicResponse> PutAccountNicknameUpdateRequest(AccountNickNameUpdateRequest request);
Task<IEnumerable<Property>> GetPropertyNumberByAccountNumber(long accountNumber);
Task<BasicResponse> PutPersonUserField(PersonUserField personUserField);
Task<BasicResponse> PostPropertyUserField(PropertyUserField personUserField);
Task<BasicResponse> PutPropertyUserField(PropertyUserField personUserField);
Task<IEnumerable<PropertyUserField>> GetPropertyUserField(long accountNumber);
Task<Account> GetAccountByAccountNumber(long accountNumber);
Task<BasicResponse> UpdateAccountCreditReportType(AccountCreditReportTypeUpdateRequest request);
Task<IEnumerable<AccountUserField>> PostAccountUserField(List<AccountUserField> accountUserField);
Task<IEnumerable<AccountUserField>> PutAccountUserField(List<AccountUserField> accountUserField);
Task<IEnumerable<AccountUserField>> GetAccountUserField(long accountNumber);
}
@@ -0,0 +1,10 @@
using LCU.Library.Internal.FileOperationsModels.Models;
namespace LCU.Api.Internal.DataCleanUp.DataAccess;
public interface IFileOperationsDao
{
Task<string> GetFileContent(string finalFilePath);
Task<List<string>> WriteFile(WriteFileRequest request);
Task<List<string>> BuildDynamicFileList(DynamicFileListRequest request);
}
@@ -0,0 +1,13 @@
using LCU.Library.Internal.NotificationsModels.Models;
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Text;
namespace LCU.Api.Internal.DataCleanUp.DataAccess
{
public interface INotificationsDao
{
public HttpResponseMessage SendEmail(EmailRequest emailRequest);
}
}
@@ -0,0 +1,35 @@
using LCU.Api.Internal.DataCleanUp.Configuration;
using LCU.Library.Internal.NotificationsModels.Models;
using LCU.Library.Internal.LcuHttpClient;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Text;
using LCU.Library.Internal.LcuHttpClient.HttpRequest;
namespace LCU.Api.Internal.DataCleanUp.DataAccess
{
public class NotificationsDao : INotificationsDao
{
private readonly NotificationsApiConfiguration _notificationsApiConfiguration;
private readonly ILcuHttpClient _lcuHttpClient;
public NotificationsDao(ILcuHttpClient lcuHttpClient, NotificationsApiConfiguration emailConfiguration)
{
_lcuHttpClient = lcuHttpClient;
_notificationsApiConfiguration = emailConfiguration;
}
public HttpResponseMessage SendEmail(EmailRequest emailRequest)
{
var encoded = JsonConvert.SerializeObject(emailRequest);
Uri uri = new Uri(_notificationsApiConfiguration.EmailEndpoint);
var client = _lcuHttpClient.CreateClient(uri);
var c = new StringContent(encoded, Encoding.UTF8, "application/json");
HttpResponseMessage httpResponse = client.PostAsync(_notificationsApiConfiguration.EmailEndpoint, c).Result;
return httpResponse;
}
}
}