namespace TMSDAL.DTO.CertRenewalAlert { public class TrainingCertificateDTO { // ========================= // PRIMARY KEYS (DB MAPPED) // ========================= public int TrainingCertificateId { get; set; } public int TrainingCompletionId { get; set; } public string? TrainingCompletionCode { get; set; } public string? TrainingCompletionName { get; set; } public int EnrollmentId { get; set; } public string? EnrollmentCode { get; set; } public string? EnrollmentName { get; set; } public int ProgrammeId { get; set; } // ========================= // DISPLAY FIELDS // ========================= public string? ProgrammeCode { get; set; } public string? ProgrammeTitle { get; set; } public int EmployeeId { get; set; } public string? EmployeeCode { get; set; } public string? EmployeeName { get; set; } // ========================= // CERTIFICATE DETAILS // ========================= public string CertificateNumber { get; set; } = string.Empty; public string? CertificateTitle { get; set; } public DateTime IssuedOn { get; set; } public int? IssuedById { get; set; } public string? IssuedByCode { get; set; } public string? IssuedByName { get; set; } public DateTime? ExpiryDate { get; set; } public int? RenewalWindowDays { get; set; } public string? CertificateUrl { get; set; } public string? ExternalCertRef { get; set; } // Opaque, high-entropy — the sole access-control mechanism for the public // VerifyCertificate endpoint; never the raw sequential TrainingCertificateId. public string? VerificationToken { get; set; } public int SignatoryId { get; set; } = -1; public string? SignatoryName { get; set; } // ========================= // REVOKE FIELDS // ========================= public string? RevokedReason { get; set; } public DateTime? RevokedOn { get; set; } public int? RevokedById { get; set; } public string? RevokedByName { get; set; } // ========================= // STATUS // ========================= public byte CertStatus { get; set; } public byte Version { get; set; } public byte Status { get; set; } public short SortOrder { get; set; } // ========================= // TENANT / AUDIT // ========================= public int TenantId { get; set; } public byte SourceType { get; set; } public int CreatedById { get; set; } public DateTime CreatedOn { get; set; } public int ModifiedById { get; set; } public DateTime ModifiedOn { get; set; } } public class RevokeCertificateDTO { public int TrainingCertificateId { get; set; } public string RevokedReason { get; set; } = string.Empty; } public class CertificateBulkDTO { public List Records { get; set; } = new(); } public class RenewCertificateDTO { public int TrainingCertificateId { get; set; } public string CertificateNumber { get; set; } = string.Empty; public string? CertificateTitle { get; set; } public DateTime IssuedOn { get; set; } public int? IssuedById { get; set; } public DateTime? ExpiryDate { get; set; } public int? RenewalWindowDays { get; set; } public string? CertificateUrl { get; set; } public string? ExternalCertRef { get; set; } } public class TrainingCertificateSignatureDTO { public int TrainingCertificateSignatureId { get; set; } public int TrainingCertificateId { get; set; } public int AttachmentId { get; set; } public string PdfSha256Hash { get; set; } = string.Empty; public string SignatureBase64 { get; set; } = string.Empty; public string SignatureAlgorithm { get; set; } = "RSA-SHA256"; public string SigningThumbprint { get; set; } = string.Empty; public DateTime SignedOn { get; set; } public int TenantId { get; set; } } // Storage location for a TATTACHMENT row, as needed by IAttachmentStorageResolver to fetch // the file from wherever it actually lives (S3 or Network) — not a local-disk-only path. public class AttachmentStorageInfoDTO { public string CmsId { get; set; } = string.Empty; public byte AttachmentOption { get; set; } public string? DisplayFileName { get; set; } public string? MimeType { get; set; } } // Deliberately minimal — the public VerifyCertificate response. Never the full // TrainingCertificateDTO: no storage paths, no ClientId/TenantId, no employee code. public class CertificateVerificationDTO { public bool Valid { get; set; } public string? Reason { get; set; } public string? CertificateNumber { get; set; } public string? CertificateTitle { get; set; } public string? RecipientName { get; set; } public DateTime? IssuedOn { get; set; } public DateTime? ExpiryDate { get; set; } public string? Status { get; set; } // Raw TTRAININGCERTIFICATE.CERTSTATUS byte, populated by the DAL read — used only to // derive Valid/Status/Reason in TrainingCertificateBLL.VerifyByToken; excluded from the // public JSON response. [Newtonsoft.Json.JsonIgnore] public byte CertStatus { get; set; } } }