namespace BrokerApiCore; using ServerCommon; using ServerCore; public record class MailSendOption { //================== // 기본 속성들 //================== public string ReceiverUserGuid { get; set; } = string.Empty; public string ReceiverNickName { get; set; } = string.Empty; public string SenderNickName { get; set; } = string.Empty; public string SenderGuid { get; set; } = string.Empty; public string Title { get; set; } = string.Empty; public string Text { get; set; } = string.Empty; public List ContentsArguments { get; set; } = new List(); public bool IsTextByMetaData { get; set; } = true; public List ItemList { get; set; } = new List(); public DateTime ExpireDate { get; set; } = DateTimeHelper.MaxTime; public string PackageOrderId { get; set; } = string.Empty; //================== // 추가 옵션들 //================== public bool IsSystemMail { get; set; } = true; public string PlanetId { get; set; } = string.Empty; public string AccountId { get; set; } = string.Empty; //================== // 기본 생성자 //================== public MailSendOption() { } //================== // 필수 항목을 포함한 생성자 //================== public MailSendOption(string receiverUserGuid, string receiverNickName, string title, string text) { ReceiverUserGuid = receiverUserGuid; ReceiverNickName = receiverNickName; Title = title; Text = text; } //================== // 아이템 목록 추가 메서드 //================== public void addItems(List? mailItems) { if (mailItems != null) { ItemList.AddRange(mailItems); } } //================== // 기본값 검증 메서드 //================== public bool validate() { return !string.IsNullOrEmpty(ReceiverUserGuid) && !string.IsNullOrEmpty(Title); } }