using System.ComponentModel.DataAnnotations; using HrynCo.NotificationService.DAL.Abstract.Providers; namespace HrynCo.NotificationService.Web.Controllers.Admin.ViewModels; public class EmailChannelEditViewModel { public Guid Id { get; set; } // ── Channel fields ───────────────────────────────────────────────── [Required] public string ServiceName { get; set; } = ""; public int Priority { get; set; } = 1; public EmailChannelType EmailChannelType { get; set; } = EmailChannelType.Smtp; public int? DailyLimit { get; set; } public int? MonthlyLimit { get; set; } [Range(1, 100)] public int WarnThresholdPercent { get; set; } = 90; public bool IsActive { get; set; } = true; // ── SMTP Settings ────────────────────────────────────────────────── [Required] public string Host { get; set; } = ""; [Range(1, 65535)] public int Port { get; set; } = 587; [Required] public string Username { get; set; } = ""; [Required] public string Password { get; set; } = ""; public bool UseSsl { get; set; } = true; [Required, EmailAddress] public string FromEmail { get; set; } = ""; [Required] public string FromName { get; set; } = ""; [Required] public string AppDisplayName { get; set; } = ""; [Required] public string AppBaseUrl { get; set; } = ""; // ── Computed ─────────────────────────────────────────────────────── public bool IsNew => Id == Guid.Empty; public string PageTitle => IsNew ? "Create Channel" : "Edit Channel"; }