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,63 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace LCU.Library.Internal.FileOperationsModels.Models.HtmlToPdfModels;
public class HtmlToPdfRequest
{
[Required(AllowEmptyStrings = false)]
public string HtmlTemplateFilePath { get; set; }
[Required]
[RegularExpression(@"^[^\.]+$", ErrorMessage = "File extensions are not allowed.")]
public string PdfName { get; set; }
public bool KeepHtmlFile { get; set; } = false;
public bool KeepPdfFile { get; set; } = false;
[Required(AllowEmptyStrings = false)]
public string HtmlSaveFilePath { get; set; }
[Required(AllowEmptyStrings = false)]
public string PdfSaveFilePath { get; set; }
public List<TagValue> BodyTagValues { get; set; }
public List<ValueCollection> BodyValueCollections { get; set; }
[NotMapped]
public string FinalHtmlSaveFilePath
{
get
{
var finalHtmlSavePath = HtmlSaveFilePath.EndsWith("\\") ?
HtmlSaveFilePath :
$"{HtmlSaveFilePath}\\";
return finalHtmlSavePath;
}
}
[NotMapped]
public string FinalPdfSaveFilePath
{
get
{
var finalPdfSaveFilePath = PdfSaveFilePath.EndsWith("\\") ?
PdfSaveFilePath :
$"{PdfSaveFilePath}\\";
return finalPdfSaveFilePath;
}
}
[NotMapped]
public string FinalHtmlSaveFilePathWithFile
{
get
{
return $"{FinalHtmlSaveFilePath}{PdfName}.html";
}
}
[NotMapped]
public string FinalPdfSaveFilePathWithFile
{
get
{
return $"{FinalPdfSaveFilePath}{PdfName}.pdf";
}
}
}
@@ -0,0 +1,10 @@
using System.ComponentModel.DataAnnotations;
namespace LCU.Library.Internal.FileOperationsModels.Models.HtmlToPdfModels;
public class TagValue
{
[Required(AllowEmptyStrings = false)]
public string Tag { get; set; }
[Required(AllowEmptyStrings = false)]
public string Value { get; set; }
}
@@ -0,0 +1,12 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace LCU.Library.Internal.FileOperationsModels.Models.HtmlToPdfModels;
public class ValueCollection
{
[Required(AllowEmptyStrings = false)]
public string CollectionTag { get; set; }
[Required(AllowEmptyStrings = false)]
public string CollectionHtmlTemplateFilePath { get; set; }
public List<ValueCollectionItem> ValueCollectionItems { get; set; }
}
@@ -0,0 +1,8 @@
using System.Collections.Generic;
namespace LCU.Library.Internal.FileOperationsModels.Models.HtmlToPdfModels;
public class ValueCollectionItem
{
public List<TagValue> TagValues { get; set; }
public List<ValueCollection> ValueCollections { get; set; }
}