namespace Baya.Domain.Entities.Messaging;

/// <summary>The lifecycle of a <see cref="Ticket"/>, persisted as these stable snake_case codes (never a C#
/// enum member name). A ticket is born <see cref="Open"/> and can be closed/reopened by a participant or admin.</summary>
public static class TicketStatus
{
    public const string Open = "open";
    public const string Closed = "closed";

    public static readonly IReadOnlyList<string> All = [Open, Closed];

    public static bool IsValid(string status) => All.Contains(status);
}

/// <summary>What a ticket is for. <see cref="Coordination"/> is the auto-created, booking-scoped logistics
/// thread; <see cref="Support"/> is a free-standing help request; <see cref="Refund"/> anchors an admin refund
/// (b11); <see cref="Emergency"/> records the aftermath of an on-site emergency call.</summary>
public static class TicketCategory
{
    public const string Coordination = "coordination";
    public const string Support = "support";
    public const string Refund = "refund";
    public const string Emergency = "emergency";

    public static readonly IReadOnlyList<string> All = [Coordination, Support, Refund, Emergency];

    public static bool IsValid(string category) => All.Contains(category);
}

/// <summary>The role a participant plays on a thread — derived from the user's platform role, used only to label
/// the thread in the UI. Not an authorization source (authorization is participation + admin).</summary>
public static class TicketParticipantRole
{
    public const string Customer = "customer";
    public const string Nurse = "nurse";
    public const string Admin = "admin";

    public static readonly IReadOnlyList<string> All = [Customer, Nurse, Admin];
}
