"""Domain enums (PRD §4.2, §4.3).

Channel keeps whatsapp/sms members even though v1 sends email only — the schema stays
channel-shaped so v2 adds providers without a migration (design D9).
"""

import enum


class Locale(enum.StrEnum):
    BN = "bn"
    EN = "en"


class EventType(enum.StrEnum):
    MEHEDI = "mehedi"
    MARRIAGE = "marriage"
    WALIMA = "walima"


class GuestSide(enum.StrEnum):
    BRIDE = "bride"
    GROOM = "groom"
    COMMON = "common"


class PreferredChannel(enum.StrEnum):
    WHATSAPP = "whatsapp"
    SMS = "sms"
    EMAIL = "email"
    AUTO = "auto"


class GuestSource(enum.StrEnum):
    MANUAL = "manual"
    CSV_IMPORT = "csv_import"
    SELF_REGISTERED = "self_registered"


class InvitationStatus(enum.StrEnum):
    PENDING = "pending"
    OPENED = "opened"
    ACCEPTED = "accepted"
    DECLINED = "declined"
    CANCELLED = "cancelled"
    EXPIRED = "expired"


class InvitedVia(enum.StrEnum):
    WHATSAPP = "whatsapp"
    SMS = "sms"
    EMAIL = "email"
    PRINT_QR = "print_qr"
    LINK = "link"


class RsvpResponse(enum.StrEnum):
    ACCEPTED = "accepted"
    DECLINED = "declined"
    CANCELLED = "cancelled"


class HistoryActor(enum.StrEnum):
    GUEST = "guest"
    ADMIN = "admin"
    SYSTEM = "system"


class Channel(enum.StrEnum):
    EMAIL = "email"
    WHATSAPP = "whatsapp"
    SMS = "sms"


class TemplatePurpose(enum.StrEnum):
    INVITE = "invite"
    REMINDER_15 = "reminder_15"
    REMINDER_7 = "reminder_7"
    REMINDER_2 = "reminder_2"
    THANK_YOU = "thank_you"
    CANCEL_CONFIRM = "cancel_confirm"
    CUSTOM = "custom"


class ReminderAudience(enum.StrEnum):
    ACCEPTED = "accepted"
    PENDING = "pending"
    ALL = "all"


class MessageJobStatus(enum.StrEnum):
    QUEUED = "queued"
    SENDING = "sending"
    SENT = "sent"
    DELIVERED = "delivered"
    READ = "read"
    FAILED = "failed"
    SKIPPED = "skipped"


class AdminRole(enum.StrEnum):
    """Two roles (add-admin-access-control design D5).

    `co_host` and `viewer` are gone. A Host does everything an event owner needs, but only
    inside the events they own — the second half of that sentence is `services/scope.py`,
    not this enum. Role says *what kind of thing*; scope says *to which records*.
    """

    SUPER_ADMIN = "super_admin"
    HOST = "host"


class AdminStatus(enum.StrEnum):
    """Three states, because "cannot sign in" has two very different meanings (design D4).

    PENDING is only ever reached by a first Google sign-in: the account exists, nobody has
    approved it, and it appears in the roster's approval queue. WITHDRAWN is a decision
    somebody made. Telling them apart is the whole reason this replaced `is_active` rather
    than sitting beside it — a boolean plus a flag can disagree, and then every reader has to
    pick a winner.
    """

    PENDING = "pending"
    ACTIVE = "active"
    WITHDRAWN = "withdrawn"


class AuthMethod(enum.StrEnum):
    """How one account proves who it is — fixed at creation, never edited (design D16).

    An account reachable by both a password and Google is only ever as strong as its
    password, however well the Google account is protected. Converting between kinds has the
    same problem in one step, and is exactly what an attacker holding a super-admin session
    would reach for. Moving someone between kinds is create-new-and-withdraw-old.
    """

    GOOGLE = "google"
    PASSWORD = "password"


class InvitationType(enum.StrEnum):
    """Which greeting a guest is addressed with (spec invitation-presentation).

    Copy only. `invitation.max_guests` remains the sole party-size ceiling — a family
    invitation with one seat is a contradiction the admin form warns about rather than one
    the system silently resolves, because raising a ceiling changes a headcount (design D6).
    """

    SINGLE = "single"
    FAMILY = "family"


class CardRenderer(enum.StrEnum):
    """How a published card design is drawn (design D1).

    HTML is the one v1 implements: the design team authors a self-contained HTML/CSS file
    and it is rendered inside a shadow root (design D3). IMAGE is implemented as the
    fallback for a design delivered as flat artwork.

    COMPONENT and LAYERED are declared but have no renderer. They are kept so the enum, the
    migration and the stored values never have to change when one arrives — the API rejects
    them on write until then, which is a code change rather than a schema one.
    """

    HTML = "html"
    IMAGE = "image"
    COMPONENT = "component"
    LAYERED = "layered"


class CardDesignStatus(enum.StrEnum):
    DRAFT = "draft"
    PUBLISHED = "published"
