This commit is contained in:
Zeeshaun
2026-03-25 14:50:13 -05:00
parent 883009770f
commit b690921fd7
592 changed files with 46618 additions and 0 deletions
@@ -0,0 +1,20 @@
using System.Collections.Generic;
namespace LCU.Library.Internal.DocumentIngestorModels.Constants
{
public static class DocumentProcessingInfoSortableFields
{
public static readonly List<string> DocumentProcessingInfoFields = new List<string>()
{
CreatedDate,
DocType,
DocBusinessName,
StatusType
};
public const string CreatedDate = "CreatedDate";
public const string DocType = "DocumentType";
public const string DocBusinessName = "DocumentBusinessName";
public const string StatusType = "StatusType";
}
}
@@ -0,0 +1,7 @@
namespace LCU.Library.Internal.DocumentIngestorModels.Constants
{
public static class Users
{
public const string System = "System";
}
}
@@ -0,0 +1,13 @@
namespace LCU.Library.Internal.DocumentIngestorModels.Constants
{
public static class ValidationMessages
{
public const string AccountInvalidMessage = "The record is missing a valid Account Number";
public const string FileNameInvalidMessage = "The record is missing a valid File Name";
public const string FullNameInvalidMessage = "The record is missing a valid Full Name";
public const string PdfInvalidMessage = "The record is missing a valid PDF";
public const string TinInvalidMessage = "The record is missing a valid Primary TIN";
public const string CreationDateInvalidMessage = "The record is missing a valid Creation Date";
public const string DocumentTypeInvalidMessage = "The record is missing a valid Document Type";
}
}
@@ -0,0 +1,7 @@
namespace LCU.Library.Internal.DocumentIngestorModels.Entities;
public class DocumentCodeDetailInfo
{
public string DocumentType { get; set; }
public string DocumentBusinessName { get; set; }
public string DocumentMemberFacingName { get; set; }
}
@@ -0,0 +1,55 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using LCU.Library.Internal.DocumentIngestorModels.Enums;
namespace LCU.Library.Internal.DocumentIngestorModels.Entities
{
public class DocumentProcessingInfo
{
public DocumentProcessingInfo()
{
}
public DocumentProcessingInfo(Guid ingestorRunInfoId,
DateTime createdDate,
string documentValuePayload,
ProcessStatusTypes statusType,
string documentFileName,
string documentType,
string documentBusinessName,
bool entityUnknown = false)
{
IngestorRunInfoId = ingestorRunInfoId;
CreatedDate = createdDate;
DocumentValuePayload = documentValuePayload;
StatusType = statusType;
DocumentFileName = documentFileName;
ProcessCount = 0;
DocumentType = documentType;
DocumentBusinessName = documentBusinessName;
EntityUnknown = entityUnknown;
}
public int DocumentProcessingInfoId { get; set; }
public Guid? DocumentId { get; set; }
public Guid IngestorRunInfoId { get; set; }
public DateTime CreatedDate { get; set; }
public string DocumentValuePayload { get; set; }
public ProcessStatusTypes StatusType { get; set; }
public string DocumentFileName { get; set; }
public int ProcessCount { get; set; }
public string DocumentType { get; set; }
public string DocumentBusinessName { get; set; }
public bool EntityUnknown { get; set; }
[ForeignKey("IngestorRunInfoId")]
public IngestorRunInfo IngestorRunInfo { get; set; }
[ForeignKey("DocumentProcessingInfoId")]
public ICollection<ProcessingLog> ProcessingLogs { get; set; }
[ForeignKey("DocumentProcessingInfoId")]
public ICollection<MemberNotificationInfo>? MemberNotificationInfos { get; set; }
}
}
@@ -0,0 +1,26 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace LCU.Library.Internal.DocumentIngestorModels.Entities;
public class DocumentTypeArchiveDeleteInfo
{
[Required]
public string DocumentTypeName { get; set; }
[Required]
[Range(0, int.MaxValue, ErrorMessage = "Please enter a value larger than {1}")]
public int ArchiveDays { get; set; }
[Required]
[Range(1, int.MaxValue, ErrorMessage = "Please enter a value larger than {1}")]
public int ArchiveMonths { get; set; }
public int? DeleteDays { get; set; }
[NotMapped]
public DateTime ArchiveDate
{
get
{
return DateTime.Now.AddMonths(ArchiveMonths).AddDays(ArchiveDays);
}
}
}
@@ -0,0 +1,41 @@
using LCU.Library.Internal.DocumentIngestorModels.Enums;
using System;
using System.ComponentModel.DataAnnotations.Schema;
namespace LCU.Library.Internal.DocumentIngestorModels.Entities
{
public class IngestorRunInfo
{
public IngestorRunInfo()
{
}
public IngestorRunInfo(Guid ingestorRunInfoId,
DateTime startTimeStamp,
IngestorTypes ingestorType,
string filePath,
string indexFileName,
int indexTotal,
int ingestionRunCount = 0)
{
IngestorRunInfoId = ingestorRunInfoId;
StartTimeStamp = startTimeStamp;
IngestorType = ingestorType;
IndexFileName = indexFileName;
IndexFilePath = filePath;
IndexTotal = indexTotal;
IngestionRunCount = ingestionRunCount;
}
public Guid IngestorRunInfoId { get; set; }
public DateTime StartTimeStamp { get; set; }
public DateTime? EndTimeStamp { get; set; }
public IngestorTypes IngestorType { get; set; }
public string IndexFilePath { get; set; }
public string IndexFileName { get; set; }
public int IndexTotal { get; set; }
public DateTime? ArchiveTimeStamp { get; set; }
public int IngestionRunCount { get; set; } = 0;
}
}
@@ -0,0 +1,18 @@
using System;
using LCU.Library.Internal.DocumentIngestorModels.Enums;
namespace LCU.Library.Internal.DocumentIngestorModels.Entities;
public class MemberNotificationInfo
{
public int MemberNotificationInfoId { get; set; }
public int DocumentProcessingInfoId { get; set; }
public DateTime UploadDate { get; set;}
public DeliveryMethod DeliveryMethod { get; set; }
public DateTime? SentTimeStamp { get; set; }
public DateTime? ResponseTimeStamp { get; set; }
public string AgreeUserId { get; set; }
public string EntityName { get; set; }
public string EmailAddress { get; set; }
public NotificationStatusTypes NotificationStatusType { get; set; }
public int Attempts { get; set; }
}
@@ -0,0 +1,18 @@
using System;
namespace LCU.Library.Internal.DocumentIngestorModels.Entities;
public class OsgPreprocessorInfo
{
public int OsgPreprocessorInfoId { get; set; }
public Guid BatchRunInfoId { get; set; }
public DateTime ZipFileStartTime { get; set; }
public DateTime ZipFileEndTime { get; set; }
public string ZipFileName { get; set; }
public string DocumentType { get; set; }
public string EntityName { get; set; }
public string MemberNumber { get; set; }
public DateTime CreatedDate { get; set;}
public int StartingPage { get; set; }
public int NumberOfPages { get; set; }
public string XmlOutput { get; set; }
}
@@ -0,0 +1,48 @@
using LCU.Library.Internal.DocumentIngestorModels.Enums;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace LCU.Library.Internal.DocumentIngestorModels.Entities;
public class OwnerOverrideInfo : IValidatableObject
{
public OwnerOverrideInfo()
{
}
public OwnerOverrideInfo(string userName, string entityId, EntityTypes entityType, int documentProcessingInfoId)
{
UserName = userName;
EntityId = entityId;
EntityType = entityType;
DocumentProcessingInfoId = documentProcessingInfoId;
}
public int OwnerOverrideInfoId { get; set; }
public string UserName { get; set; }
public string EntityId { get; set; }
public EntityTypes EntityType { get; set; }
public int DocumentProcessingInfoId { get; set; }
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{
if (EntityType == EntityTypes.Unknown && !string.IsNullOrWhiteSpace(EntityId))
{
yield return new ValidationResult("Cannot assign EntityType of 'Unknown' and assign EntityId.");
}
if (EntityType != EntityTypes.Unknown && string.IsNullOrWhiteSpace(EntityId))
{
yield return new ValidationResult("There must be an EntityId if EntityType is not 'Unknown'.");
}
if (string.IsNullOrWhiteSpace(UserName))
{
yield return new ValidationResult("UserName cannot be null.");
}
if (DocumentProcessingInfoId <= 0)
{
yield return new ValidationResult("DocumentProcessingInfoId must be greater than 0.");
}
}
}
@@ -0,0 +1,23 @@
using System;
namespace LCU.Library.Internal.DocumentIngestorModels.Entities
{
public class PdfPartitionerLog
{
public PdfPartitionerLog()
{
}
public PdfPartitionerLog(Guid pdfPartitionerRunInfoId, DateTime logTimeStamp, string logMessage)
{
PdfPartitionerRunInfoId = pdfPartitionerRunInfoId;
LogTimeStamp = logTimeStamp;
LogMessage = logMessage;
}
public int PdfPartitionerLogId { get; set; }
public Guid PdfPartitionerRunInfoId { get; set; }
public DateTime LogTimeStamp { get; set; }
public string LogMessage { get; set; }
}
}
@@ -0,0 +1,57 @@
using System;
using System.ComponentModel.DataAnnotations.Schema;
using LCU.Library.Internal.DocumentIngestorModels.Enums;
namespace LCU.Library.Internal.DocumentIngestorModels.Entities;
public class PdfPartitionerRunInfo
{
public PdfPartitionerRunInfo()
{
}
public PdfPartitionerRunInfo(DateTime startTimeStamp, PdfParserTypes pdfParserType, string path, int indexTotal)
{
PdfPartitionerRunInfoId = Guid.NewGuid();
StartTimeStamp = startTimeStamp;
PdfParserType = pdfParserType;
Path = path;
IndexTotal = indexTotal;
}
public Guid PdfPartitionerRunInfoId { get; set; }
public DateTime StartTimeStamp { get; set; }
public DateTime? EndTimeStamp { get; set; }
public PdfParserTypes PdfParserType { get; set; }
public string Path { get; set; }
public int IndexTotal { get; set; }
public int FailureCount { get; set; }
public int SuccessCount { get; set; }
[NotMapped]
public int FailureAndSuccessCount
{
get
{
return FailureCount + SuccessCount;
}
}
[NotMapped]
public bool PdfPartitionerCompleted
{
get
{
return IndexTotal == FailureAndSuccessCount;
}
}
[NotMapped]
public bool WasSuccessful
{
get
{
return FailureCount == 0;
}
}
}
@@ -0,0 +1,25 @@
using System;
namespace LCU.Library.Internal.DocumentIngestorModels.Entities
{
public class ProcessingLog
{
public ProcessingLog()
{
}
public ProcessingLog(int documentProcessingInfoId, DateTime logTimeStamp, string logMessage, string userName)
{
DocumentProcessingInfoId = documentProcessingInfoId;
LogTimeStamp = logTimeStamp;
LogMessage = logMessage;
UserName = userName;
}
public int ProcessingLogId { get; set; }
public int DocumentProcessingInfoId { get; set; }
public DateTime LogTimeStamp { get; set; }
public string LogMessage { get; set; }
public string UserName { get; set; }
}
}
@@ -0,0 +1,12 @@
using System.ComponentModel.DataAnnotations;
namespace LCU.Library.Internal.DocumentIngestorModels.Enums
{
public enum DeliveryMethod
{
[Display(Name = "Paper")]
Paper,
[Display(Name = "Electronic")]
Electronic
}
}
@@ -0,0 +1,8 @@
namespace LCU.Library.Internal.DocumentIngestorModels.Enums;
public enum DocumentOwnerTypes
{
PrimaryOwner,
AccountOwner,
Generic
}
@@ -0,0 +1,9 @@
namespace LCU.Library.Internal.DocumentIngestorModels.Enums
{
public enum EntityTypes
{
Person,
Organization,
Unknown
}
}
@@ -0,0 +1,18 @@
namespace LCU.Library.Internal.DocumentIngestorModels.Enums
{
public enum IngestorTypes
{
FosTaxStatement,
FosDnaDocument,
XdiDnaNotice,
FosLoanStatement,
OsgDnaNoticesDocument,
XdiActionNotice,
OsgHistoricalDocument,
OsgWeilandStatement,
OsgTaxStatement,
OsgDnaNoticeSplit,
OsgTemenosNotice,
OsgVehicleTaxStatement
}
}
@@ -0,0 +1,11 @@
namespace LCU.Library.Internal.DocumentIngestorModels.Enums;
public enum NotificationStatusTypes
{
Pending,
Failure,
Undeliverable,
CriticalFailure,
Complete,
WaitingResponse
}
@@ -0,0 +1,9 @@
namespace LCU.Library.Internal.DocumentIngestorModels.Enums
{
public enum PdfParserTypes
{
FosLoanStatement,
OsgDnaNoticesDocument,
OsgHistoricalDocument
}
}
@@ -0,0 +1,14 @@
namespace LCU.Library.Internal.DocumentIngestorModels.Enums
{
public enum ProcessStatusTypes
{
Processing,
Completed,
ArchiveFailure,
CriticalFailure,
DataMappingFailure,
Reprocessing,
NotificationDataFailure,
UploadCompletionReprocessing
}
}
@@ -0,0 +1,146 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<GeneratePackageOnBuild Condition="'$(Configuration)'!='Test'">True</GeneratePackageOnBuild>
<Version>1.20.3</Version>
<Description>
1.0.0 - Initial Creation of Models Library.
1.1.0 - Update Models Library to parse based on index not header.
1.2.0 - Addition of XdiDnaNotices model.
1.3.0 - Addition of FosLoanStatement model.
1.3.1 - Update DocumentProcessingInfo to capture documentFileName.
1.4.0 - Add EntityTypes and add OwnerOverrideInfo to ProcessingRequest
1.5.0 - Addition of BatchIngestionRequest. IngestorRequest no longer uses archive dates but an Archived Folder.
1.6.0 - Add DocumentType and DocumentBusinessName to DocumentProcessingInfo
1.7.0 - Add Filter and Pagination to DocumentProcessingInfo
1.8.0 - Add IngestorRunInfo to DocumentProcessingInfo as a possible pulled in property
1.8.1 - Change Filter model datetimes to nullable and sortable field fix
1.9.0 - Add Process Count. Remove Success, Failure, and Archive Failure Counts
1.9.1 - Table OwnerOverrideInfo.EntityId column can now be null, remove Filter Page range, and fix spelling of 'Unknown' EntityType
1.10.0 - Addition of PdfPartitionerLog, PdfPartitionerRunInfo, PdfParserTypes Enum, PdfPartitionerRequest, and PdfPartitionerResult.
1.10.1 - Fix EntityId NullOrWhiteSpace
1.10.2 - ProcessRequest adding RetryCount
1.10.3 - Update DocumentType library
1.10.4 - Capture FosTaxStatementDocument TaxYear
1.10.5 - Addition of MemberNotificationInfo, add DocumentMemberFacingName to DocumentCodeDetailInfo
1.11.0 - Add OsgDnaNotices document and enums to IngestorTypes and PdfParserTypes
1.12.0 - Add XdiActionNotices enums to IngestorTypes and create XdiActionNotices index file model
1.13.0 - Add OsgPreprocessorRequest and OsgPreprocessorResult
1.13.1 - Add OsgPreprocessorInfo
1.14.0 - Add OsgHistoricalDocument index model and enums. Replace XmlOsgHistoricalDocument and OsgPreprocessorInfo AccountNumber with EntityName
1.14.1 - Add custom filters for index file json
1.15.0 - Add EntityUnkown to DocumentProcessingInfo and add EntityUnknownRequest
1.15.1 - Add IsUnknown to StatusFilter
1.15.2 - Add UploadCompletionReprocessing to ProcessStatusTypes
1.15.3 - Add IngestorRunInfoId to Filter
1.15.4 - Add DocumentProcessingInfoStatusRequest
1.15.5 - Make Filter.IngestorRunInfoId nullable
1.16.0 - Attach MemberNotificationInfo to DocumentProcessingInfo if present and add NotificationStatusTypes filter
1.17.0 - Add BulkNotificationStatusRequest
1.17.1 - Add EntityIsUnknown to ErrorCaptureResult
1.17.2 - Set DocumentProcessingInfo.MemberNotificationInfo to list instead of singular
1.18.0 - Add CustomIndexFileFiltersLike to Filter
1.18.1 - Change CustomIndexFileFiltersLikeOr to 'Or'
1.19.0 - Add IngestionFolderCleanUp request and result
1.19.1 - Fix IngestionFolderCleanUp request's archive root path
1.19.2 - Update DocumentType library
1.19.3 - Update DocumentType library
1.19.4 - Update DocumentType library
1.19.5 - Update DocumentType library
1.19.6 - Update DocumentType library
1.19.7 - Update DocumentType library
1.19.8 - Update DocumentType library
1.19.9 - Update DocumentType library
1.19.10 - Update DocumentType library and add Weiland Document
1.19.11 - Update DocumentType library
1.19.12 - Update DocumentType Library and add OSG Tax documents
1.19.13 - Update DocumentTypeLibrary
1.19.14 - Update DocumentTypeLibrary
1.19.15 - Update Osg DNA Notice Split documents
1.19.16 - Upgraded FileOperations package version
1.19.17 - Update DocumentTypeLibrary
1.19.18 - Add DynamicIngestionDate
1.19.19 - Update DocumentTypeLibrary, OsgTemenosNotice IngestorType
1.20.0 - New models added for new processing flow and queues
1.20.1 - New OsgVehicleTaxStatement document and DocumentType Library
1.20.2 - New model added for ProcessStatusTypeEmailRequest
1.20.3 - Added Processing to Not Allowed ProcessStatusTypeEmailRequest
</Description>
<PackageReleaseNotes>
1.0.0 - Initial Creation of Models Library.
1.1.0 - Update Models Library to parse based on index not header.
1.2.0 - Addition of XdiDnaNotices model.
1.3.0 - Addition of FosLoanStatement model.
1.3.1 - Update DocumentProcessingInfo to capture documentFileName.
1.4.0 - Add EntityTypes and add OwnerOverrideInfo to ProcessingRequest
1.5.0 - Addition of BatchIngestionRequest. IngestorRequest no longer uses archive dates but an Archived Folder.
1.6.0 - Add DocumentType and DocumentBusinessName to DocumentProcessingInfo
1.7.0 - Add Filter and Pagination to DocumentProcessingInfo
1.8.0 - Add IngestorRunInfo to DocumentProcessingInfo as a possible pulled in property
1.8.1 - Change Filter model datetimes to nullable and sortable field fix
1.9.0 - Add Process Count. Remove Success, Failure, and Archive Failure Counts
1.9.1 - Table OwnerOverrideInfo.EntityId column can now be null, remove Filter Page range, and fix spelling of 'Unknown' EntityType
1.10.0 - Addition of PdfPartitionerLog, PdfPartitionerRunInfo, PdfParserTypes Enum, PdfPartitionerRequest, and PdfPartitionerResult.
1.10.1 - Fix EntityId NullOrWhiteSpace
1.10.2 - ProcessRequest adding RetryCount
1.10.3 - Update DocumentType library
1.10.4 - Capture FosTaxStatementDocument TaxYear
1.10.5 - Addition of MemberNotificationInfo, add DocumentMemberFacingName to DocumentCodeDetailInfo
1.11.0 - Add OsgDnaNotices document and enums to IngestorTypes and PdfParserTypes
1.12.0 - Add XdiActionNotices enums to IngestorTypes and create XdiActionNotices index file model
1.13.0 - Add OsgPreprocessorRequest and OsgPreprocessorResult
1.13.1 - Add OsgPreprocessorInfo
1.14.0 - Add OsgHistoricalDocument index model and enums. Replace XmlOsgHistoricalDocument and OsgPreprocessorInfo AccountNumber with EntityName
1.14.1 - Add custom filters for index file json
1.15.0 - Add EntityUnkown to DocumentProcessingInfo and add EntityUnknownRequest
1.15.1 - Add IsUnknown to StatusFilter
1.15.2 - Add UploadCompletionReprocessing to ProcessStatusTypes
1.15.3 - Add IngestorRunInfoId to Filter
1.15.4 - Add DocumentProcessingInfoStatusRequest
1.15.5 - Make Filter.IngestorRunInfoId nullable
1.16.0 - Attach MemberNotificationInfo to DocumentProcessingInfo if present and add NotificationStatusTypes filter
1.17.0 - Add BulkNotificationStatusRequest
1.17.1 - Add EntityIsUnknown to ErrorCaptureResult
1.17.2 - Set DocumentProcessingInfo.MemberNotificationInfo to list instead of singular
1.18.0 - Add CustomIndexFileFiltersLike to Filter
1.18.1 - Change CustomIndexFileFiltersLikeOr to 'Or'
1.19.0 - Add IngestionFolderCleanUp request and result
1.19.1 - Fix IngestionFolderCleanUp request's archive root path
1.19.2 - Update DocumentType library
1.19.3 - Update DocumentType library
1.19.4 - Update DocumentType library
1.19.5 - Update DocumentType library
1.19.6 - Update DocumentType library
1.19.7 - Update DocumentType library
1.19.8 - Update DocumentType library
1.19.9 - Update DocumentType library
1.19.10 - Update DocumentType library and add Weiland Document
1.19.11 - Update DocumentType
1.19.12 - Update DocumentType Library and add OSG Tax documents
1.19.13 - Update DocumentTypeLibrary
1.19.14 - Update DocumentTypeLibrary
1.19.15 - Update Osg DNA Notice Split documents
1.19.16 - Upgraded FileOperations package version
1.19.17 - Update DocumentTypeLibrary
1.19.18 - Add DynamicIngestionDate
1.19.19 - Update DocumentTypeLibrary, OsgTemenosNotice IngestorType
1.20.0 - New models added for new processing flow and queues
1.20.1 - New OsgVehicleTaxStatement document and DocumentType Library
1.20.2 - New model added for ProcessStatusTypeEmailRequest
1.20.3 - Added Processing to Not Allowed ProcessStatusTypeEmailRequest
</PackageReleaseNotes>
<LangVersion>latest</LangVersion>
<Configurations>Debug;Release;Test</Configurations>
<Platforms>AnyCPU</Platforms>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="CsvHelper" Version="33.0.1" />
<PackageReference Include="LCU.Library.DocumentType" Version="1.12.5" />
<PackageReference Include="LCU.Library.Internal.ApiResponse.Models" Version="3.3.2" />
<PackageReference Include="LCU.Library.Internal.FileOperationsModels" Version="4.1.0" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
</ItemGroup>
</Project>
@@ -0,0 +1,54 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using LCU.Library.Internal.ApiResponse.Models;
using LCU.Library.Internal.DocumentIngestorModels.Enums;
using LCU.Library.Internal.FileOperationsModels.Models.NameSettings;
namespace LCU.Library.Internal.DocumentIngestorModels.Models
{
public class BatchIngestionRequest : ReturnResponse
{
[Required(ErrorMessage = "Ingestor Type is required")]
public IngestorTypes IngestorType { get; set; }
[Required(ErrorMessage = "Root Base Path is required")]
public string RootBasePath { get; set; }
public int DaysIngestionDate { get; set; }
public DateTime? IngestionDate { get; set; }
public DynamicIngestionDate DynamicIngestionDate { get; set; } = new();
public bool UseDynamicIngestionDate { get; set; } = false;
public string ParentDynamicDirectory { get; set; } = "";
public string SubDirectoryPath { get; set; } = "";
[Required(ErrorMessage = "Dynamic Index File Name is required")]
public string DynamicIndexFileName { get; set; }
public DynamicNameSetting DynamicFileSettings { get; set; }
public DynamicNameSetting ParentDynamicDirectorySettings { get; set; }
[NotMapped]
public DateTime FinalIngestionDate
{
get
{
if (UseDynamicIngestionDate)
{
return new DateTime(DynamicIngestionDate.Year ?? DateTime.Now.Year,
DynamicIngestionDate.Month ?? DateTime.Now.Month,
DynamicIngestionDate.Day ?? DateTime.Now.Day);
}
return (IngestionDate ?? DateTime.Now).AddDays(DaysIngestionDate);
}
}
[NotMapped]
public string FinalRootBasePath
{
get
{
var rootBasePath = RootBasePath.EndsWith("\\") ? RootBasePath : $"{RootBasePath}\\";
return $"{rootBasePath}{FinalIngestionDate:MMddyyyy}\\";
}
}
}
}
@@ -0,0 +1,36 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
namespace LCU.Library.Internal.DocumentIngestorModels.Models
{
public class BatchIngestionResult
{
public List<string> Messages { get; set; } = new List<string>();
public int FailureCount { get; set; } = 0;
[NotMapped]
public bool IsSuccessfull
{
get
{
return FailureCount == 0;
}
}
[NotMapped]
public bool IsFailure
{
get
{
return FailureCount > 0;
}
}
public void AddToFailureCount(string message)
{
Messages.Add(message);
FailureCount++;
}
}
}
@@ -0,0 +1,18 @@
using LCU.Library.Internal.DocumentIngestorModels.Entities;
using System.Collections.Generic;
namespace LCU.Library.Internal.DocumentIngestorModels.Models;
public class BatchUpdateMemberNotificationDataRequest
{
public BatchUpdateMemberNotificationDataRequest() { }
public BatchUpdateMemberNotificationDataRequest(List<MemberNotificationInfo> memberNotificationInfos,
GatherMemberNotificationInfoRequest gatherMemberNotificationInfoRequest)
{
MemberNotificationInfos = memberNotificationInfos;
GatherMemberNotificationInfoRequest = gatherMemberNotificationInfoRequest;
}
public List<MemberNotificationInfo> MemberNotificationInfos { get; set; }
public GatherMemberNotificationInfoRequest GatherMemberNotificationInfoRequest { get; set; }
}
@@ -0,0 +1,11 @@
using LCU.Library.Internal.DocumentIngestorModels.Entities;
using System.Collections.Generic;
namespace LCU.Library.Internal.DocumentIngestorModels.Models;
public class BatchUploadCompletionRequest
{
public List<UploadCompletionRequest> SuccessfulUploadCompletions { get; set; }
public List<UploadCompletionRequest> UnsuccessfulUploadCompletions { get; set; }
public IEnumerable<DocumentProcessingInfo> DocumentProcessingInfos { get; set; }
}
@@ -0,0 +1,38 @@
using LCU.Library.Internal.DocumentIngestorModels.Enums;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using LCU.Library.Internal.DocumentIngestorModels.Models.Pagination;
namespace LCU.Library.Internal.DocumentIngestorModels.Models;
public class BulkNotificationStatusRequest : IValidatableObject
{
public BulkNotificationStatusRequest()
{
}
public BulkNotificationStatusRequest(Filter filter,
NotificationStatusTypes notificationStatus,
string reasonMessage)
{
Filter = filter;
NotificationStatus = notificationStatus;
ReasonMessage = reasonMessage;
}
public Filter Filter { get; set; }
public NotificationStatusTypes NotificationStatus { get; set; }
public string ReasonMessage { get; set; } = string.Empty;
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{
if (Filter == null)
{
yield return new ValidationResult("Filter cannot be null.");
}
if (string.IsNullOrWhiteSpace(ReasonMessage))
{
yield return new ValidationResult("Must provide a ReasonMessage explaining the reason for the update.");
}
}
}
@@ -0,0 +1,9 @@
using LCU.Library.Internal.DocumentIngestorModels.Entities;
namespace LCU.Library.Internal.DocumentIngestorModels.Models;
public class CompletionProcessingData
{
public DocumentProcessingInfo DocumentProcessingInfo { get; set; }
public CompletionRequest CompletionRequest { get; set; }
}
@@ -0,0 +1,9 @@
namespace LCU.Library.Internal.DocumentIngestorModels.Models
{
public class CompletionRequest
{
public ProcessResult ProcessResult { get; set; }
public ProcessingRequest ProcessingRequest { get; set; }
public MemberNotificationInfoRequest MemberNotificationInfoRequest { get; set; }
}
}
@@ -0,0 +1,46 @@
using LCU.Library.Internal.DocumentIngestorModels.Enums;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
namespace LCU.Library.Internal.DocumentIngestorModels.Models;
public class DocumentProcessingInfoStatusRequest : IValidatableObject
{
public DocumentProcessingInfoStatusRequest()
{
}
public DocumentProcessingInfoStatusRequest(int documentProcessingInfoId,
ProcessStatusTypes processStatus,
string reasonMessage,
string username)
{
DocumentProcessingInfoId = documentProcessingInfoId;
ProcessStatus = processStatus;
ReasonMessage = reasonMessage;
Username = username;
}
public int DocumentProcessingInfoId { get; set; }
public ProcessStatusTypes ProcessStatus { get; set; }
public string ReasonMessage { get; set; } = string.Empty;
public string Username { get; set; } = string.Empty;
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{
if (DocumentProcessingInfoId == 0 || DocumentProcessingInfoId == null)
{
yield return new ValidationResult("DocumentProcessingInfoId cannot be 0 or null.");
}
if (string.IsNullOrWhiteSpace(ReasonMessage))
{
yield return new ValidationResult("Must provide a ReasonMessage explaining the reason for the update.");
}
if (string.IsNullOrWhiteSpace(Username))
{
yield return new ValidationResult("Must provide a Username.");
}
}
}
@@ -0,0 +1,10 @@
using System;
namespace LCU.Library.Internal.DocumentIngestorModels.Models;
public class DynamicIngestionDate
{
public int? Month { get; set; }
public int? Day { get; set; }
public int? Year { get; set; }
}
@@ -0,0 +1,34 @@
using LCU.Library.Internal.DocumentIngestorModels.Enums;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
namespace LCU.Library.Internal.DocumentIngestorModels.Models;
public class EntityUnknownRequest : IValidatableObject
{
public EntityUnknownRequest()
{
}
public EntityUnknownRequest(string userName, List<int> documentProcessingInfoIds)
{
UserName = userName;
DocumentProcessingInfoIds = documentProcessingInfoIds;
}
public string UserName { get; set; }
public List<int> DocumentProcessingInfoIds { get; set; }
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{
if (string.IsNullOrWhiteSpace(UserName))
{
yield return new ValidationResult("UserName cannot be null.");
}
if (!DocumentProcessingInfoIds.Any())
{
yield return new ValidationResult("DocumentProcessingInfoIds cannot be empty.");
}
}
}
@@ -0,0 +1,31 @@
#nullable enable
namespace LCU.Library.Internal.DocumentIngestorModels.Models;
public class ErrorCaptureResult<T> where T : class
{
private ErrorCaptureResult(bool success, string? message, T payload, bool? entityIsUnknown = null)
{
Success = success;
Message = message;
Payload = payload;
EntityIsUnknown = entityIsUnknown;
}
public bool Success { get; }
public string? Message { get; }
public T Payload { get; }
public bool? EntityIsUnknown { get; }
public static ErrorCaptureResult<T> CreateErrorPayload(string? message, T payload, bool? entityIsUnknown = null)
{
return new ErrorCaptureResult<T>(false, message, payload, entityIsUnknown);
}
public static ErrorCaptureResult<T> CreateSuccessPayload(T payload)
{
return new ErrorCaptureResult<T>(true, null, payload);
}
}
@@ -0,0 +1,6 @@
namespace LCU.Library.Internal.DocumentIngestorModels.Models;
public class GatherMemberNotificationInfoRequest
{
public CompletionRequest CompletionRequest { get; set; }
}
@@ -0,0 +1,18 @@
using CsvHelper.Configuration.Attributes;
namespace LCU.Library.Internal.DocumentIngestorModels.Models.IndexFileDocuments
{
public class FosDnaDocument
{
[Index(0)]
public string AccountNumber { get; set; }
[Index(1)]
public string EntityName { get; set; }
[Index(2)]
public string CreationDate { get; set; }
[Index(3)]
public string DocType { get; set; }
[Index(4)]
public string DocName { get; set; }
}
}
@@ -0,0 +1,24 @@
using CsvHelper.Configuration.Attributes;
namespace LCU.Library.Internal.DocumentIngestorModels.Models.IndexFileDocuments
{
public class FosLoanStatement
{
[Index(0)]
public string DocType { get; set; }
[Index(4)]
public string AccountNumber { get; set; }
[Index(5)]
public string EntityName { get; set; }
[Index(6)]
public string EmailAddress { get; set; }
[Index(7)]
public string CreationDate { get; set; }
[Index(8)]
public string StartingPage { get; set; }
[Index(9)]
public string NumberOfPages { get; set; }
[Index(10)]
public string DocName { get; set; }
}
}
@@ -0,0 +1,24 @@
using CsvHelper.Configuration.Attributes;
namespace LCU.Library.Internal.DocumentIngestorModels.Models.IndexFileDocuments
{
/// <summary>
/// NOTE: The index annotation denotes the index location of each record in the csv row being processed.
/// The Index record 3 is the tax year identical for each row in a file and not used in the ingestor
/// </summary>
public class FosTaxStatementDocument
{
[Index(0)]
public string FileName { get; set; }
[Index(1)]
public string PrimaryTIN { get; set; }
[Index(2)]
public string FullName { get; set; }
[Index(3)]
public int TaxYear { get; set; }
[Index(4)]
public string AccountNumber { get; set; }
[Index(5)]
public string PDF { get; set; }
}
}
@@ -0,0 +1,40 @@
using CsvHelper.Configuration.Attributes;
namespace LCU.Library.Internal.DocumentIngestorModels.Models.IndexFileDocuments
{
public class OsgDnaNoticeSplit
{
[Index(0)]
public string SequenceNumber { get; set; }
[Index(1)]
public string NoticeId { get; set; }
[Index(2)]
public string AccountNumber { get; set; }
[Index(3)]
public string MemberNumber { get; set; }
[Index(4)]
public string UserId { get; set; }
[Index(5)]
public string RecipientName { get; set; }
[Index(6)]
public string SSN { get; set; }
[Index(7)]
public string NoticeName { get; set; }
[Index(8)]
public string ApplicationNumber { get; set; }
[Index(9)]
public string CreationDate { get; set; }
[Index(10)]
public string PdfName { get; set; }
}
}
@@ -0,0 +1,28 @@
using CsvHelper.Configuration.Attributes;
namespace LCU.Library.Internal.DocumentIngestorModels.Models.IndexFileDocuments
{
/// <summary>
/// Note: Index record 0 is the SequenceNumber. Created by OSG during creation of documents / Index file - means nothing to our process
/// </summary>
public class OsgDnaNoticesDocument
{
[Index(1)]
public string DocType { get; set; }
[Index(2)]
public string AccountNumber { get; set; }
[Index(3)]
public string MemberNumberOrUserId { get; set; }
[Index(4)]
public string CreationDate { get; set; }
[Index(5)]
public string StartingPage { get; set; }
[Index(6)]
public string NumberOfPages { get; set; }
}
}
@@ -0,0 +1,28 @@
using CsvHelper.Configuration.Attributes;
namespace LCU.Library.Internal.DocumentIngestorModels.Models.IndexFileDocuments
{
/// <summary>
/// Note: Index record 0 is the SequenceNumber. Created by OSG during creation of documents / Index file - means nothing to our process
/// </summary>
public class OsgHistoricalDocument
{
[Index(1)]
public string DocType { get; set; }
[Index(2)]
public string EntityName { get; set; }
[Index(3)]
public string MemberNumberOrUserId { get; set; }
[Index(4)]
public string CreationDate { get; set; }
[Index(5)]
public string StartingPage { get; set; }
[Index(6)]
public string NumberOfPages { get; set; }
}
}
@@ -0,0 +1,40 @@
using CsvHelper.Configuration.Attributes;
namespace LCU.Library.Internal.DocumentIngestorModels.Models.IndexFileDocuments
{
public class OsgTaxStatement
{
[Index(0)]
public string SequenceNumber { get; set; }
[Index(1)]
public string NoticeId { get; set; }
[Index(2)]
public string AccountNumber { get; set; }
[Index(3)]
public string MemberNumber { get; set; }
[Index(4)]
public string UserId { get; set; }
[Index(5)]
public string RecipientName { get; set; }
[Index(6)]
public string SSN { get; set; }
[Index(7)]
public string NoticeName { get; set; }
[Index(8)]
public string ApplicationNumber { get; set; }
[Index(9)]
public string CreationDate { get; set; }
[Index(10)]
public string PdfName { get; set; }
}
}
@@ -0,0 +1,31 @@
using CsvHelper.Configuration.Attributes;
namespace LCU.Library.Internal.DocumentIngestorModels.Models.IndexFileDocuments
{
/// <summary>
/// Note: Index record 6 is the same as index record 5 (The DocType is repeated from the vendor index)
/// </summary>
public class OsgTemenosNoticesDocument
{
[Index(0)]
public string Sequence { get; set; }
[Index(2)]
public string AccountNumber { get; set; }
[Index(3)]
public string LoanNumber { get; set; }
[Index(5)]
public string EntityName { get; set; }
[Index(7)]
public string DocumentType { get; set; }
[Index(9)]
public string CreationDate { get; set; }
[Index(10)]
public string PDF { get; set; }
}
}
@@ -0,0 +1,28 @@
using CsvHelper.Configuration.Attributes;
namespace LCU.Library.Internal.DocumentIngestorModels.Models.IndexFileDocuments
{
public class OsgWeilandStatement
{
[Index(0)]
public string Date { get; set; }
[Index(1)]
public string Family { get; set; }
[Index(2)]
public string AccountNumber { get; set; }
[Index(3)]
public string AccountTitle { get; set; }
[Index(4)]
public string PdfDate { get; set; }
[Index(5)]
public string PdfName { get; set; }
[Index(6)]
public string DocCode { get; set; }
}
}
@@ -0,0 +1,28 @@
using CsvHelper.Configuration.Attributes;
namespace LCU.Library.Internal.DocumentIngestorModels.Models.IndexFileDocuments
{
public class XdiActionNoticesDocument
{
[Index(0)]
public string CreationDate { get; set; }
[Index(1)]
public string ApplicationNumber { get; set; }
[Index(2)]
public string LoanNumber { get; set; }
[Index(3)]
public string EntityName { get; set; }
[Index(4)]
public int PageCount { get; set; }
[Index(5)]
public string DocumentType { get; set; }
[Index(7)]
public string DocumentName { get; set; }
}
}
@@ -0,0 +1,31 @@
using CsvHelper.Configuration.Attributes;
namespace LCU.Library.Internal.DocumentIngestorModels.Models.IndexFileDocuments
{
/// <summary>
/// Note: Index record 6 is the same as index record 5 (The DocType is repeated from the vendor index)
/// </summary>
public class XdiDnaNoticesDocument
{
[Index(0)]
public string CreationDate { get; set; }
[Index(1)]
public string AccountNumber { get; set; }
[Index(2)]
public string LoanNumber { get; set; }
[Index(3)]
public string EntityName { get; set; }
[Index(4)]
public int PageCount { get; set; }
[Index(5)]
public string DocumentType { get; set; }
[Index(7)]
public string PDF { get; set; }
}
}
@@ -0,0 +1,35 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using LCU.Library.Internal.ApiResponse.Models;
namespace LCU.Library.Internal.DocumentIngestorModels.Models
{
public class IngestionFolderCleanUpRequest : ReturnResponse
{
public DateTime? IngestionEndedDate { get; set; }
public int DaysFromIngestionEndedDate { get; set; } = 0;
public DateTime? ArchiveDate { get; set; }
public int DaysFromArchiveDate { get; set; } = 0;
[Required] public string ArchiveRootPath { get; set; }
[NotMapped]
public DateTime FinalIngestionEndedDate => IngestionEndedDate ?? DateTime.Today.AddDays(1).AddTicks(-1);
[NotMapped]
public DateTime FinalArchiveDate => ArchiveDate ?? DateTime.Today.AddDays(1).AddTicks(-1);
[NotMapped]
public DateTime CleanUpIngestionFoldersUntilDate => FinalIngestionEndedDate.AddDays(DaysFromIngestionEndedDate).Date.AddDays(1).AddTicks(-1);
[NotMapped]
public string ArchiveFolderName => FinalArchiveDate.AddDays(DaysFromArchiveDate).ToString("yyyy-MM-dd");
[NotMapped]
public string ArchiveRootPathAndFolder => (ArchiveRootPath.EndsWith("\\") ? ArchiveRootPath : $"{ArchiveRootPath}\\") + ArchiveFolderName;
}
}
@@ -0,0 +1,24 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
namespace LCU.Library.Internal.DocumentIngestorModels.Models
{
public class IngestionFolderCleanUpResult
{
public List<string> Messages { get; set; } = new List<string>();
public int FailureCount { get; set; } = 0;
[NotMapped]
public bool IsSuccessful => FailureCount == 0;
[NotMapped]
public bool IsFailure => FailureCount > 0;
public void AddToFailureCount(string message)
{
Messages.Add(message);
FailureCount++;
}
}
}
@@ -0,0 +1,44 @@
using System.ComponentModel.DataAnnotations.Schema;
using LCU.Library.Internal.ApiResponse.Models;
using LCU.Library.Internal.DocumentIngestorModels.Enums;
namespace LCU.Library.Internal.DocumentIngestorModels.Models
{
public class IngestorRequest : ReturnResponse
{
private string rootPath;
private const string ArchiveFolder = "Archived";
public IngestorTypes IngestorType { get; set; }
public string RootPath
{
get
{
return rootPath;
}
set
{
rootPath = value.EndsWith("\\") ? value : $"{value}\\";
}
}
public string IndexFileName { get; set; }
[NotMapped]
public string ArchivePath
{
get
{
return $"{RootPath}{ArchiveFolder}\\";
}
}
[NotMapped]
public string FinalIndexFilePath
{
get
{
return RootPath + IndexFileName;
}
}
}
}
@@ -0,0 +1,23 @@
using System.Collections.Generic;
using LCU.Library.Internal.DocumentIngestorModels.Entities;
namespace LCU.Library.Internal.DocumentIngestorModels.Models
{
public class IngestorResult
{
public IngestorResult()
{
MessageStack = new List<string>();
}
public IngestorResult(bool fatalFailure, string message)
{
FatalFailure = fatalFailure;
MessageStack = new List<string>() { message };
}
public bool FatalFailure { get; set; }
public List<string> MessageStack { get; set; }
public IngestorRunInfo IngestorRunInfo { get; set; }
public List<ProcessingRequest> ProcessingRequests { get; set; }
}
}
@@ -0,0 +1,7 @@
using LCU.Library.Internal.ApiResponse.Models;
namespace LCU.Library.Internal.DocumentIngestorModels.Models;
public class MemberDocumentNotificationRequest : ReturnResponse
{
public bool RunCriticalFailureNotifications { get; set; } = false;
}
@@ -0,0 +1,34 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
namespace LCU.Library.Internal.DocumentIngestorModels.Models;
public class MemberDocumentNotificationResult
{
public List<string> Messages { get; set; } = new List<string>();
public int FailureCount { get; set; } = 0;
[NotMapped]
public bool IsSuccessful
{
get
{
return FailureCount == 0;
}
}
[NotMapped]
public bool IsFailure
{
get
{
return FailureCount > 0;
}
}
public void AddToFailureCount(string message)
{
Messages.Add(message);
FailureCount++;
}
}
@@ -0,0 +1,8 @@
using System.Collections.Generic;
namespace LCU.Library.Internal.DocumentIngestorModels.Models;
public class MemberNotificationCompletionRequest
{
public List<int> MemberNotificationInfoIds { get; set; }
}
@@ -0,0 +1,10 @@
using LCU.Library.Internal.DocumentIngestorModels.Enums;
namespace LCU.Library.Internal.DocumentIngestorModels.Models;
public class MemberNotificationInfoRequest
{
public int DocumentProcessingInfoId { get; set; }
public DocumentOwnerTypes DocumentOwnerType { get; set; }
public string DocumentEntityNumber { get; set; }
public EntityTypes EntityType { get; set; }
}
@@ -0,0 +1,54 @@
using System;
using System.ComponentModel.DataAnnotations;
namespace LCU.Library.Internal.DocumentIngestorModels.Models;
[Obsolete("06/02/2023 - Used to prepare historical documents for ingestion. No longer in use.")]
public class OsgPreprocessorRequest
{
private string workingBasePath;
private string outputBasePath;
private string incompleteOutputBasePath;
[Required(ErrorMessage = "Archive Start Date is required")]
public DateTime ArchiveStartDate { get; set; }
public bool SaveXmlOutput { get; set; } = false;
[Required(ErrorMessage = "Source Base Path is required")]
public string SourceBasePath { get; set; }
[Required(ErrorMessage = "Working Base Path is required")]
public string WorkingBasePath
{
get
{
return workingBasePath;
}
set
{
workingBasePath = value.EndsWith("\\") ? value : $"{value}\\";
}
}
[Required(ErrorMessage = "Output Base Path is required")]
public string OutputBasePath
{
get
{
return outputBasePath;
}
set
{
outputBasePath = value.EndsWith("\\") ? value : $"{value}\\";
}
}
[Required(ErrorMessage = "Incomplete Output Base Path is required")]
public string IncompleteOutputBasePath
{
get
{
return incompleteOutputBasePath;
}
set
{
incompleteOutputBasePath = value.EndsWith("\\") ? value : $"{value}\\";
}
}
}
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
namespace LCU.Library.Internal.DocumentIngestorModels.Models;
[Obsolete("06/02/2023 - Used to prepare historical documents for ingestion. No longer in use.")]
public class OsgPreprocessorResult
{
public string OutputFile { get; set; }
public bool Success { get; set; }
public List<string> MessageStack { get; set; } = new List<string>();
public void AddFailureAndMessage(string message)
{
MessageStack.Add(message);
Success = false;
}
}
@@ -0,0 +1,52 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
namespace LCU.Library.Internal.DocumentIngestorModels.Models;
[Obsolete("06/02/2023 - Used to prepare historical documents for ingestion. No longer in use.")]
public class OsgPreprocessorRunInfo
{
public OsgPreprocessorRunInfo(OsgPreprocessorRequest request)
{
OsgPreprocessorRequest = request;
OsgPreprocessorResults = new List<OsgPreprocessorResult>();
Messages = new List<string>();
}
public OsgPreprocessorRequest OsgPreprocessorRequest { get; set; }
public List<OsgPreprocessorResult> OsgPreprocessorResults { get; set; }
public string UnZippedFolder { get; set; }
public string DirectoryDate { get; set; }
public string IndexFile { get; set; }
public bool Incomplete { get; set; } = false;
public bool HasStatements { get; set; } = true;
public List<string> Messages { get; set; }
[NotMapped]
public string FinalWorkingDirectory
{
get
{
return $"{OsgPreprocessorRequest.WorkingBasePath}{UnZippedFolder}\\";
}
}
[NotMapped]
public string IndexFilePath
{
get
{
return FinalWorkingDirectory + IndexFile;
}
}
[NotMapped]
public string FinalOutputDirectory
{
get
{
return Incomplete ? OsgPreprocessorRequest.IncompleteOutputBasePath : $"{OsgPreprocessorRequest.OutputBasePath}{DirectoryDate}\\";
}
}
}
@@ -0,0 +1,57 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using LCU.Library.Internal.ApiResponse.Models;
using LCU.Library.Internal.DocumentIngestorModels.Enums;
using LCU.Library.Internal.FileOperationsModels.Models.NameSettings;
namespace LCU.Library.Internal.DocumentIngestorModels.Models
{
public class PdfPartitionerRequest : ReturnResponse
{
[Required(ErrorMessage = "Pdf Parser Types is required")]
public PdfParserTypes PdfParserType { get; set; }
[Required(ErrorMessage = "Root Base Path is required")]
public string RootBasePath { get; set; }
public int DaysIngestionDate { get; set; }
public DateTime? IngestionDate { get; set; }
public DynamicIngestionDate DynamicIngestionDate { get; set; } = new();
public bool UseDynamicIngestionDate { get; set; } = false;
public string ParentDynamicDirectory { get; set; } = "";
public string SubDirectoryPath { get; set; } = "";
[Required(ErrorMessage = "Dynamic Index File Name is required")]
public string DynamicIndexFileName { get; set; }
public string DynamicPdfName { get; set; }
public bool SkipParseIfCountsMatch { get; set; }
public DynamicNameSetting ParentDynamicDirectorySettings { get; set; }
public DynamicNameSetting DynamicFileSettings { get; set; }
public DynamicNameSetting DynamicPdfSettings { get; set; }
[NotMapped]
public DateTime FinalIngestionDate
{
get
{
if (UseDynamicIngestionDate)
{
return new DateTime(DynamicIngestionDate.Year ?? DateTime.Now.Year,
DynamicIngestionDate.Month ?? DateTime.Now.Month,
DynamicIngestionDate.Day ?? DateTime.Now.Day);
}
return (IngestionDate ?? DateTime.Now).AddDays(DaysIngestionDate);
}
}
[NotMapped]
public string FinalRootBasePath
{
get
{
var rootBasePath = RootBasePath.EndsWith("\\") ? RootBasePath : $"{RootBasePath}\\";
return $"{rootBasePath}{FinalIngestionDate.ToString("MMddyyyy")}\\";
}
}
}
}
@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
namespace LCU.Library.Internal.DocumentIngestorModels.Models
{
public class PdfPartitionerResult
{
public PdfPartitionerResult(Guid pdfPartitionerRunInfoId, PdfPartitionerRequest pdfPartitionerRequest)
{
PdfPartitionerRunInfoId = pdfPartitionerRunInfoId;
PdfPartitionerRequest = pdfPartitionerRequest;
MessageStack = new List<string>();
FailedToQueueToParse = false;
}
public Guid PdfPartitionerRunInfoId { get; set; }
public PdfPartitionerRequest PdfPartitionerRequest { get; set; }
public List<string> MessageStack { get; set; }
public bool FailedToQueueToParse { get; set; }
public void AddFailureAndMessage(string message)
{
MessageStack.Add(message);
FailedToQueueToParse = true;
}
}
}
@@ -0,0 +1,78 @@
using LCU.Library.Internal.DocumentIngestorModels.Enums;
using System.Collections.Generic;
namespace LCU.Library.Internal.DocumentIngestorModels.Models
{
public class ProcessResult
{
public ProcessResult()
{
Success = true;
MessageStack = new List<string>();
}
public ProcessResult(bool success, string message)
{
Success = success;
MessageStack = new List<string>() { message };
}
public bool Success { get; set; }
public bool AttemptToArchive { get; set; }
public List<string> MessageStack { get; set; }
public ProcessStatusTypes ProcessStatusType { get; set; }
public bool? EntityIsUnknown { get; set; }
public static ProcessResult ProcessCriticalFailure(ProcessResult processResult, string message)
{
return ProcessCriticalFailure(processResult, new List<string> { message });
}
public static ProcessResult ProcessCriticalFailure(ProcessResult processResult, List<string> messages)
{
processResult.ProcessStatusType = ProcessStatusTypes.CriticalFailure;
return ProcessFailure(processResult, messages, false);
}
public static ProcessResult ProcessDataMappingFailure(ProcessResult processResult, string message)
{
processResult.ProcessStatusType = ProcessStatusTypes.DataMappingFailure;
return ProcessFailure(processResult, message, null);
}
public static ProcessResult ProcessNotificationDataFailure(ProcessResult processResult, string message)
{
processResult.ProcessStatusType = ProcessStatusTypes.NotificationDataFailure;
return ProcessFailure(processResult, message, false);
}
public static ProcessResult ProcessCompleted(ProcessResult processResult, string message)
{
processResult.ProcessStatusType = ProcessStatusTypes.Completed;
return ProcessSuccess(processResult, new List<string> { message }, false);;
}
private static ProcessResult ProcessFailure(ProcessResult processResult, string message, bool? entityIsUnknown)
{
return ProcessFailure(processResult, new List<string> { message }, entityIsUnknown);
}
private static ProcessResult ProcessFailure(ProcessResult processResult, List<string> messages, bool? entityIsUnknown)
{
processResult.Success = false;
processResult.MessageStack.AddRange(messages);
processResult.EntityIsUnknown = entityIsUnknown;
return processResult;
}
private static ProcessResult ProcessSuccess(ProcessResult processResult, List<string> messages, bool? entityUnknown)
{
processResult.Success = true;
processResult.MessageStack.AddRange(messages);
processResult.EntityIsUnknown = entityUnknown;
return processResult;
}
}
}
@@ -0,0 +1,35 @@
using LCU.Library.Internal.ApiResponse.Models;
using LCU.Library.Internal.DocumentIngestorModels.Enums;
using System.Collections.Generic;
using System.Linq;
namespace LCU.Library.Internal.DocumentIngestorModels.Requests
{
public class ProcessStatusTypeEmailRequest : ReturnResponse
{
private List<ProcessStatusTypes> NotAllowedStatuses => new() { Enums.ProcessStatusTypes.Completed, Enums.ProcessStatusTypes.Processing };
public ProcessStatusTypeEmailRequest()
{
}
public ProcessStatusTypeEmailRequest(List<string> emailAddresses, List<ProcessStatusTypes> processStatusTypes, string processStatusTypeEmailUrl)
{
this.EmailAddresses = emailAddresses;
this.ProcessStatusTypes = processStatusTypes;
this.ProcessStatusTypeEmailUrl = processStatusTypeEmailUrl;
}
public List<string> EmailAddresses { get; set; }
public List<ProcessStatusTypes> ProcessStatusTypes { get; set; }
public string ProcessStatusTypeEmailUrl { get; set; }
public bool HasInvalidStatuses(out List<ProcessStatusTypes> invalid)
{
invalid = ProcessStatusTypes
.Where(x => NotAllowedStatuses.Contains(x))
.ToList();
return invalid.Any();
}
}
}
@@ -0,0 +1,17 @@
using System;
using LCU.Library.Internal.DocumentIngestorModels.Entities;
namespace LCU.Library.Internal.DocumentIngestorModels.Models
{
public class ProcessingRequest
{
public int DocumentProcessingInfoId { get; set; }
public Guid IngestorRunInfoId { get; set; }
public IngestorRequest IngestorRequest { get; set; }
public string DocumentFileName { get; set; }
public string DocumentTypeDisplayName { get; set; }
public string DocumentValuePayload { get; set; }
public OwnerOverrideInfo OwnerOverrideInfo { get; set; }
public int RetryCount { get; set; } = 0;
}
}
@@ -0,0 +1,7 @@
namespace LCU.Library.Internal.DocumentIngestorModels.Models.QueueResult;
public class QueueCompletionResult
{
public bool Success { get; set; }
public CompletionRequest CompletionRequest { get; set; }
}
@@ -0,0 +1,7 @@
namespace LCU.Library.Internal.DocumentIngestorModels.Models.QueueResult;
public class QueueGatherMemberNotificationInfoResult
{
public bool Success { get; set; }
public UploadCompletionRequest OriginalRequest { get; set; }
}
@@ -0,0 +1,16 @@
using LCU.Library.Internal.ApiResponse.Models;
namespace LCU.Library.Internal.DocumentIngestorModels.Models;
public class UploadCompletionRequest
{
public UploadCompletionRequest() { }
public UploadCompletionRequest(CompletionRequest completionRequest, Response response)
{
CompletionRequest = completionRequest;
Response = response;
}
public CompletionRequest CompletionRequest { get; set; }
public Response Response { get; set; }
}
@@ -0,0 +1,55 @@
using System;
using System.ComponentModel;
using System.Xml.Serialization;
namespace LCU.Library.Internal.DocumentIngestorModels.Models.XmlParser;
[Serializable]
[XmlType(AnonymousType = true)]
[XmlRoot(ElementName = "DOCUMENT", Namespace = "", IsNullable = false)]
public class XmlOsgHistoricalDocument
{
[XmlAttribute("accountNumber")]
public string MemberNumberOrUserId { get; set; }
[XmlAttribute("documentDate")]
public string CreationDate { get; set; }
[XmlAttribute("documentType")]
public string DocumentType { get; set; }
[XmlElement("ArchiveOutput")]
public XmlOsgArchiveOutput ArchiveOutput { get; set; }
[XmlElement("OriginalAddress")]
public XmlOsgOriginalAddress OriginalAddress { get; set; }
public string XmlOutput { get; set; }
}
[Serializable]
[DesignerCategory("code")]
[XmlType(AnonymousType = true)]
[XmlRoot("ArchiveOutput", IsNullable = false)]
public class XmlOsgArchiveOutput
{
[XmlAttribute("startPage")]
public int StartingPage { get; set; }
[XmlAttribute("numberOfPages")]
public int NumberOfPages { get; set; }
[XmlAttribute("fileSeq")]
public int PdfIndex { get; set; }
}
[Serializable]
[DesignerCategory("code")]
[XmlType(AnonymousType = true)]
[XmlRoot("OriginalAddress", IsNullable = false)]
public class XmlOsgOriginalAddress
{
[XmlAttribute("addr1")]
public string EntityName { get; set; }
}
@@ -0,0 +1,50 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using LCU.Library.Internal.DocumentIngestorModels.Enums;
namespace LCU.Library.Internal.DocumentIngestorModels.Models.Pagination
{
public class Filter
{
/// <summary>
/// Filter has default of all statuses to CreatedDate Descending for sorting.
/// </summary>
public Filter()
{
var listStatus = new List<StatusFilter>();
foreach (var item in Enum.GetValues(typeof(ProcessStatusTypes)))
{
var statusFilters = new List<StatusFilter>
{
new() { IsEnabled = true, StatusType = (ProcessStatusTypes)item, IsUnknown = false },
new() { IsEnabled = true, StatusType = (ProcessStatusTypes)item, IsUnknown = true }
};
listStatus.AddRange(statusFilters);
}
var listSortableFields = new List<SortableField>();
SortableField sortField = new SortableField { Field = Constants.DocumentProcessingInfoSortableFields.CreatedDate, IsDescending = true };
listSortableFields.Add(sortField);
this.StatusFilters = listStatus;
this.SortableFields = listSortableFields;
this.Page = 1;
this.Limit = 10;
}
public string DocType { get; set; }
public string DocBusinessName { get; set; }
public Guid? IngestorRunInfoId { get; set; }
public DateTime? CreatedDateStart { get; set; } = null;
public DateTime? CreatedDateEnd { get; set; } = null;
public List<StatusFilter> StatusFilters { get; set; }
public IDictionary<string, string> CustomIndexFileFiltersEquals { get; set; } = null;
public IDictionary<string, string> CustomIndexFileFiltersLikeOr { get; set; } = null;
public List<SortableField> SortableFields { get; set; }
public int Page { get; set; }
[Range(1, 1000)]
public int Limit { get; set; }
public List<NotificationStatusTypes> NotificationStatusFilters { get; set; } = null;
}
}
@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
namespace LCU.Library.Internal.DocumentIngestorModels.Models.Pagination
{
public class PagedResponse<T> where T: class
{
public PagedResponse() { }
public PagedResponse(PagedResult<T> pagedResult, Filter filter)
{
TotalItems = pagedResult.Total;
Items = pagedResult.Items;
TotalPages = pagedResult.Total == 0 ? 1 : (int)Math.Ceiling((decimal)pagedResult.Total / filter.Limit);
CurrentPage = filter.Page > this.TotalPages ? this.TotalPages : filter.Page;
if (pagedResult.Total > (filter.Page * filter.Limit))
{
NextPage = filter.Page + 1;
}
if (filter.Page > 1)
{
PreviousPage = filter.Page - 1;
}
}
public IEnumerable<T> Items { get; set; }
public int NextPage { get; set; }
public int PreviousPage { get; set; }
public int TotalItems { get; set; }
public int CurrentPage { get; set; }
public int TotalPages { get; set; }
}
}
@@ -0,0 +1,10 @@
using System.Collections.Generic;
namespace LCU.Library.Internal.DocumentIngestorModels.Models.Pagination
{
public class PagedResult<T> where T: class
{
public IEnumerable<T> Items { get; set; }
public int Total { get; set; }
}
}
@@ -0,0 +1,9 @@
namespace LCU.Library.Internal.DocumentIngestorModels.Models.Pagination
{
public class SortableField
{
public string Field { get; set; }
public int Position { get; set; }
public bool IsDescending { get; set; }
}
}
@@ -0,0 +1,11 @@
using LCU.Library.Internal.DocumentIngestorModels.Enums;
namespace LCU.Library.Internal.DocumentIngestorModels.Models.Pagination
{
public class StatusFilter
{
public bool IsEnabled { get; set; }
public bool IsUnknown { get; set; }
public ProcessStatusTypes StatusType { get; set; }
}
}
@@ -0,0 +1,84 @@
using System;
using System.Globalization;
using LCU.Library.DocumentType.Extensions;
using LCU.Library.Internal.DocumentIngestorModels.Constants;
using LCU.Library.Internal.DocumentIngestorModels.Models;
namespace LCU.Library.Internal.DocumentIngestorModels.Validations
{
public static class MetaDataValidation
{
public static ProcessResult ValidateAccountNumber(ProcessResult processResult, string accountNumber)
{
if (string.IsNullOrWhiteSpace(accountNumber) || accountNumber == "0")
{
processResult = ProcessResult.ProcessDataMappingFailure(processResult, ValidationMessages.AccountInvalidMessage);
}
return processResult;
}
public static ProcessResult ValidateFileName(ProcessResult processResult, string fileName)
{
if (string.IsNullOrWhiteSpace(fileName))
{
processResult = ProcessResult.ProcessDataMappingFailure(processResult, ValidationMessages.FileNameInvalidMessage);
}
return processResult;
}
public static ProcessResult ValidateFullName(ProcessResult processResult, string fullName)
{
if (string.IsNullOrWhiteSpace(fullName))
{
processResult = ProcessResult.ProcessDataMappingFailure(processResult, ValidationMessages.FullNameInvalidMessage);
}
return processResult;
}
public static ProcessResult ValidateDocumentType<T>(ProcessResult processResult, string documentType) where T: Enum
{
if (string.IsNullOrWhiteSpace(documentType) || !EnumExtensions.IsDocumentTypeOf<T>(documentType))
{
processResult = ProcessResult.ProcessCriticalFailure(processResult, $"{ValidationMessages.DocumentTypeInvalidMessage}. Document Type provided was {documentType}, which was not of type {typeof(T).Name}");
}
return processResult;
}
public static ProcessResult ValidatePdf(ProcessResult processResult, string pdf)
{
if (string.IsNullOrWhiteSpace(pdf))
{
processResult = ProcessResult.ProcessDataMappingFailure(processResult, ValidationMessages.PdfInvalidMessage);
}
return processResult;
}
public static ProcessResult ValidateTin(ProcessResult processResult, string tin)
{
if (string.IsNullOrWhiteSpace(tin) || tin == "0")
{
processResult = ProcessResult.ProcessDataMappingFailure(processResult, ValidationMessages.TinInvalidMessage);
}
return processResult;
}
public static ProcessResult ValidateDate(ProcessResult processResult, string date, string format)
{
try{
if (string.IsNullOrEmpty(date) || !DateTime.TryParseExact(date, format, CultureInfo.InvariantCulture, DateTimeStyles.AssumeLocal, out _)){
return ProcessResult.ProcessDataMappingFailure(processResult, $"{ValidationMessages.CreationDateInvalidMessage}. Date provided {date} could not be parsed from format {format}");
}
}
catch (Exception){
return ProcessResult.ProcessDataMappingFailure(processResult, ValidationMessages.CreationDateInvalidMessage);
}
return processResult;
}
}
}