Files
hrynco-notification-service/HrynCo.NotificationService.Web/Controllers/Admin/ViewModels/EmailChannelEditViewModel.cs
T
agrynco 1631786ce2 feat(push): add service-owned firebase channels and delivery
Add push contracts, provider delivery and channel diagnostics. Link email channels to services and document migration and validation.

Ref: IT-1074
2026-10-24 12:31:35 +03:00

53 lines
1.8 KiB
C#

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 Guid? ServiceId { get; set; }
public IReadOnlyList<Microsoft.AspNetCore.Mvc.Rendering.SelectListItem> Services { 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; } = "";
public string? Password { get; set; }
public bool UseSsl { get; set; } = true;
[Required, EmailAddress]
public string FromEmail { get; set; } = "";
[Required]
public string FromName { get; set; } = "";
// ── Computed ───────────────────────────────────────────────────────
public bool IsNew => Id == Guid.Empty;
public string PageTitle => IsNew ? "Create Channel" : "Edit Channel";
}