Updating
This commit is contained in:
+20
@@ -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;
|
||||
}
|
||||
}
|
||||
+15
@@ -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; }
|
||||
}
|
||||
}
|
||||
+11
@@ -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; }
|
||||
}
|
||||
}
|
||||
+10
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user