using System.ComponentModel.DataAnnotations.Schema; using System.Text.Json.Serialization; using vendorApproverBackend.Enums; using vendorApproverBackend.Dtos; namespace vendorApproverBackend.Entities { [Table("request_renew_clarifications")] public class RequestRenewClarification { [Column("id")] public long Id { get; set; } [Column("request_renew_id")] public long? RequestRenewId { get; set; } [Column("prequalification_request_id")] public long? PrequalificationRequestId { get; set; } [Column("vendor_request_letter_id")] public long? VendorRequestLetterId { get; set; } [Column("sender_id")] public long SenderId { get; set; } [JsonIgnore] [ForeignKey("SenderId")] public virtual User Sender { get; set; } [Column("message", TypeName = "TEXT")] public string Message { get; set; } = string.Empty; [Column("timestmp")] public DateTime Timestamp { get; set; } = DateTime.UtcNow; // Transient Attributes [NotMapped] public RoleEnum? SenderRole => Sender?.Role; [NotMapped] public string SenderName => Sender?.Name ?? string.Empty; } }