namespace MemberCenter.Web.Models.TenantNewsletters;

public sealed class TenantNewsletterManagementViewModel
{
    public Guid? SelectedTenantId { get; set; }

    public IReadOnlyList<TenantNewsletterTenantOptionViewModel> Tenants { get; set; } =
        Array.Empty<TenantNewsletterTenantOptionViewModel>();

    public IReadOnlyList<TenantNewsletterGroupViewModel> Groups { get; set; } =
        Array.Empty<TenantNewsletterGroupViewModel>();
}

public sealed class TenantNewsletterTenantOptionViewModel
{
    public Guid Id { get; set; }

    public string Name { get; set; } = string.Empty;
}

public sealed class TenantNewsletterGroupViewModel
{
    public Guid TenantId { get; set; }

    public string TenantName { get; set; } = string.Empty;

    public IReadOnlyList<TenantNewsletterCardViewModel> Newsletters { get; set; } =
        Array.Empty<TenantNewsletterCardViewModel>();
}

public sealed class TenantNewsletterCardViewModel
{
    public Guid Id { get; set; }

    public string Name { get; set; } = string.Empty;

    public string TenantName { get; set; } = string.Empty;

    public int ActiveSubscriptionCount { get; set; }

    public int UnsubscribedCount { get; set; }
}

public sealed class TenantNewsletterDetailViewModel
{
    public Guid Id { get; set; }

    public Guid TenantId { get; set; }

    public string TenantName { get; set; } = string.Empty;

    public string Name { get; set; } = string.Empty;

    public string Tab { get; set; } = "subscribers";

    public string? Search { get; set; }

    public int ActiveSubscriptionCount { get; set; }

    public int UnsubscribedCount { get; set; }

    public IReadOnlyList<TenantNewsletterSubscriptionRowViewModel> Rows { get; set; } =
        Array.Empty<TenantNewsletterSubscriptionRowViewModel>();
}

public sealed class TenantNewsletterSubscriptionRowViewModel
{
    public Guid Id { get; set; }

    public string Email { get; set; } = string.Empty;

    public string ListId { get; set; } = string.Empty;

    public DateTimeOffset CreatedAt { get; set; }

    public string? Reason { get; set; }
}
