55 lines
2.1 KiB
C#
55 lines
2.1 KiB
C#
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}\\";
|
|
}
|
|
}
|
|
}
|
|
}
|