namespace MarketingDAL.DTO.Communication; /// /// MarketMind AI execution layer — a Communication (MCOMMUNICATION): outbound campaign messaging /// with a Draft -> Scheduled -> Sent status lifecycle. /// /// RESOLVED (2026-09-02): Email/SMS dispatch is wired for real in /// CommunicationBLL.SendCommunicationAsync, via GB5Shared.ActionProcessor (the same real, /// working Action/Outbox mechanism ECP's Correspondence uses) — not the /// FrameworkBLL.MessageHubGenerator path this class doc previously pointed at, which would have /// required an unverifiable cross-module ProjectReference. WhatsApp/Social remain genuinely /// unimplemented (no IActionHandler exists for those ActionTypes anywhere in this codebase) and /// throw NotImplementedException rather than silently no-op'ing. /// /// / are genuinely nullable (not the -1 FK-sentinel /// convention, which only applies to optional int FK columns) — a Draft communication has neither. /// public class CommunicationDTO { #region Communication public int CommunicationId { get; set; } public string CommunicationCode { get; set; } = string.Empty; public string CommunicationName { get; set; } = string.Empty; /// 1=Email, 2=SMS, 3=WhatsApp, 4=Social — see CK_MCOMMUNICATION_CHANNEL. public byte Channel { get; set; } /// Optional FK to MMKTCAMPAIGN — -1 sentinel = not applicable. public int CampaignId { get; set; } = -1; public string? CampaignCode { get; set; } public string? CampaignName { get; set; } /// Optional FK to MSEGMENT — -1 sentinel = not applicable. public int SegmentId { get; set; } = -1; public string? SegmentCode { get; set; } public string? SegmentName { get; set; } /// Optional FK to MPERSONA — -1 sentinel = not applicable. public int PersonaId { get; set; } = -1; public string? PersonaCode { get; set; } public string? PersonaName { get; set; } /// Only meaningful for Channel=1 (Email). public string? Subject { get; set; } /// Plain user-authored text — no AI-drafting hook in this pass (EAI does not exist yet). public string BodyText { get; set; } = string.Empty; /// 1=Draft, 2=Scheduled, 3=Sent — see CK_MCOMMUNICATION_COMMUNICATIONSTATUS. public byte CommunicationStatus { get; set; } = 1; /// Genuinely nullable — set only once scheduled. public DateTime? ScheduledOn { get; set; } /// Genuinely nullable — set only once actually sent. public DateTime? SentOn { get; set; } public string? Remarks { get; set; } #endregion #region Base public int CreatedById { get; set; } public DateTime CreatedOn { get; set; } public string? CreatedByName { get; set; } public int ModifiedById { get; set; } public DateTime ModifiedOn { get; set; } public string? ModifiedByName { get; set; } #endregion #region Standard public short SortOrder { get; set; } public byte Status { get; set; } public short Version { get; set; } public int TenantId { get; set; } #endregion }