This commit is contained in:
Zeeshaun
2026-03-17 10:03:23 -05:00
parent 1a0702a79a
commit bd1a9744ad
139 changed files with 5388 additions and 0 deletions
@@ -0,0 +1,22 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace LCU.Library.Internal.ArchiverApiModel.Entities
{
public class ApplicationMapping
{
public int ApplicationMappingId { get; set; }
[StringLength(200, ErrorMessage = "The Identifier value cannot exceed 200 characters.")]
public string Identifier { get; set; }
[StringLength(200, ErrorMessage = "The DesignatedName value cannot exceed 200 characters.")]
public string DesignatedName { get; set; }
[StringLength(200, ErrorMessage = "The ApplicationOverrideName value cannot exceed 200 characters.")]
public string ApplicationOverrideName { get; set; }
[ForeignKey("ApplicationMappingId")]
public List<ParameterMapping> ParameterMappings { get; set; }
[ForeignKey("ApplicationMappingId")]
public List<RegexMapping> RegexMappings { get; set; }
}
}
@@ -0,0 +1,10 @@
namespace LCU.Library.Internal.ArchiverApiModel.Entities
{
public class ParameterMapping
{
public int ParameterMappingId { get; set; }
public int ApplicationMappingId { get; set; }
public string ParameterCode { get; set; }
public string ParameterValue { get; set; }
}
}
@@ -0,0 +1,15 @@
using System.ComponentModel.DataAnnotations;
namespace LCU.Library.Internal.ArchiverApiModel.Entities
{
public class RegexMapping
{
public int RegexMappingId { get; set; }
[Required]
public int ApplicationMappingId { get; set; }
[Required]
public string Tag { get; set; }
[Required]
public string Regex { get; set; }
}
}
@@ -0,0 +1,37 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Description>
1.0.0 - Initial Creation
1.1.0 - Addition of ApplicationMapping and ParameterMapping.
1.2.0 - ArchiveRequest removed location base and added extensions.
1.3.0 - Added ReturnResponse to ArchiveRequest
1.4.0 - Added DayFromDate to ArchiveRequest
1.5.0 - Added seprate namespaces for Models and Entities. Added ApplicationOverrideName to Report.
1.6.0 - Update to use MassTransit and ApiResponse upgrade.
1.7.0 - Update ApiResponse.Models nuget
1.8.0 - Upgraded FileOperations package version
</Description>
<PackageReleaseNotes>
1.0.0 - Initial Creation
1.1.0 - Addition of ApplicationMapping and ParameterMapping.
1.2.0 - ArchiveRequest removed location base and added extensions.
1.3.0 - Added ReturnResponse to ArchiveRequest
1.4.0 - Added DayFromDate to ArchiveRequest
1.5.0 - Added seprate namespaces for Models and Entities. Added ApplicationOverrideName to Report.
1.6.0 - Update to use MassTransit and ApiResponse upgrade.
1.7.0 - Update ApiResponse.Models nuget
1.8.0 - Upgraded FileOperations package version
</PackageReleaseNotes>
<Version>1.8.0</Version>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="LCU.Library.Internal.ApiResponse.Models" Version="3.3.0" />
<PackageReference Include="LCU.Library.Internal.FileOperationsModels" Version="4.1.0" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
</ItemGroup>
</Project>
@@ -0,0 +1,20 @@
using LCU.Library.Internal.ApiResponse.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace LCU.Library.Internal.ArchiverApiModel.Models
{
public class ArchiveRequest : ReturnResponse
{
[Required]
public List<string> ArchiveIdentifiers { get; set; }
[Required]
public List<string> AllowedExensions { get; set; }
public DateTime? EffectiveDate { get; set; }
public int DaysFromDate { get; set; } = 0;
[Required]
public string ArchiveDestinationBase { get; set; }
public bool SucceedIfEmpty { get; set; } = false;
}
}
@@ -0,0 +1,15 @@
using System.Collections.Generic;
namespace LCU.Library.Internal.ArchiverApiModel.Models
{
public class ArchiveRequestResponse
{
public ArchiveRequestResponse()
{
IsSuccessful = true;
MessageStack = new List<string>();
}
public bool IsSuccessful { get; set; }
public List<string> MessageStack { get; set; }
}
}
@@ -0,0 +1,11 @@
using LCU.Library.Internal.FileOperationsModels.Models;
namespace LCU.Library.Internal.ArchiverApiModel.Models
{
public class ArchiveResponsePayload
{
public ArchiveRequest ArchiveRequest { get; set; }
public BulkOperationRequest<MoveFileRequest> BulkOperationRequest { get; set; }
public ArchiveRequestResponse ArchiveRequestResponse { get; set; }
}
}
@@ -0,0 +1,10 @@
namespace LCU.Library.Internal.ArchiverApiModel.Models
{
public class ErrorDetail
{
public string Filename { get; set; }
public string FileLocation { get; set; }
public string Destination { get; set; }
public string Description { get; set; }
}
}
@@ -0,0 +1,65 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using LCU.Library.Internal.ArchiverApiModel.Entities;
namespace LCU.Library.Internal.ArchiverApiModel.Models
{
public class Report
{
public string ReportName { get; set; }
public string QueueNumber { get; set; }
public DateTime StopDateTime { get; set; }
[NotMapped]
public string DestinationQueueAndTimeStamp
{
get
{
return $"_{QueueNumber}_{ArchiveTimeStampString}";
}
}
[NotMapped]
public string ArchiveTimeStampString
{
get
{
return DateTime.Now.ToString("MMddyyyyHHmmss");
}
}
[NotMapped]
public string DisplayReportName
{
get
{
return ApplicationMapping?.DesignatedName == null ? FinalReportName : ApplicationMapping.DesignatedName;
}
}
[NotMapped]
public string FinalReportName
{
get
{
return ApplicationMapping?.ApplicationOverrideName == null ? ReportName : ApplicationMapping.ApplicationOverrideName;
}
}
[NotMapped]
public ApplicationMapping ApplicationMapping { get; set; }
[NotMapped]
public bool HasRegexMapping { get
{
return ApplicationMapping?.RegexMappings != null && ApplicationMapping.RegexMappings.Any();
}
}
public string BuildDestinationName(string fullFileName, string extension)
{
var extensionIndex = fullFileName.ToUpper().IndexOf($".{extension.ToUpper()}");
var fileName = fullFileName.Substring(0,extensionIndex);
var destinationFileName = FinalReportName == fileName && !HasRegexMapping ? DisplayReportName : fileName;
var destinationName = $"{destinationFileName}{DestinationQueueAndTimeStamp}.{extension}";
return destinationName;
}
}
}