This commit is contained in:
Zeeshaun
2026-04-27 10:50:07 -05:00
parent 8b528fa00b
commit b5edd55420
141 changed files with 9602 additions and 0 deletions
@@ -0,0 +1,66 @@
using LCU.Library.Internal.ApiResponse.Models;
using LCU.Library.Internal.FileOperationsModels.Models.NameSettings;
using LCU.Library.Internal.FileOperationsModels.Shared;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace LCU.Library.Internal.FileOperationsModels.Models
{
public abstract class FileRequest : ReturnResponse
{
[Required(ErrorMessage = "Source path is required")]
public string SourcePath { get; set; }
[Required(ErrorMessage = "Source file is required")]
public string SourceFile { get; set; }
[Required(ErrorMessage = "Destination path is required.")]
public string DestinationPath { get; set; }
public string DestinationName { get; set; }
public bool Overwrite { get; set; }
public bool SucceedOnError { get; set; }
public DynamicNameSetting FileNameSetting { get; set; }
[NotMapped]
public string FinalSourceFile
{
get
{
return DynamicNameBuilder.BuildDynamicName(SourceFile, FileNameSetting);
}
}
[NotMapped]
public string FinalDestinationName
{
get
{
return string.IsNullOrWhiteSpace(DestinationName) ? FinalSourceFile : DestinationName;
}
}
[NotMapped]
public string Source
{
get
{
var finalSourcePath = SourcePath.EndsWith("\\") ? SourcePath : $"{SourcePath}\\";
return finalSourcePath + FinalSourceFile;
}
}
[NotMapped]
public string Destination
{
get
{
var finalDestinationPath = DestinationPath.EndsWith("\\") ? DestinationPath : $"{DestinationPath}\\";
return finalDestinationPath + FinalDestinationName;
}
}
}
}