"""Beauty Business permission definitions — Phase 14.0 foundation + 14.1-14.7."""
from __future__ import annotations

BEAUTY_BUSINESS_VIEW = "beauty_business.view"
BEAUTY_BUSINESS_MANAGE = "beauty_business.manage"

ORGANIZATIONS_VIEW = "beauty_business.organizations.view"
ORGANIZATIONS_CREATE = "beauty_business.organizations.create"
ORGANIZATIONS_UPDATE = "beauty_business.organizations.update"
ORGANIZATIONS_DELETE = "beauty_business.organizations.delete"
ORGANIZATIONS_MANAGE = "beauty_business.organizations.manage"

BRANCHES_VIEW = "beauty_business.branches.view"
BRANCHES_CREATE = "beauty_business.branches.create"
BRANCHES_UPDATE = "beauty_business.branches.update"
BRANCHES_DELETE = "beauty_business.branches.delete"
BRANCHES_MANAGE = "beauty_business.branches.manage"

EXTERNAL_PROVIDERS_VIEW = "beauty_business.external_providers.view"
EXTERNAL_PROVIDERS_CREATE = "beauty_business.external_providers.create"
EXTERNAL_PROVIDERS_UPDATE = "beauty_business.external_providers.update"
EXTERNAL_PROVIDERS_DELETE = "beauty_business.external_providers.delete"
EXTERNAL_PROVIDERS_MANAGE = "beauty_business.external_providers.manage"

BOOKING_ENGINES_VIEW = "beauty_business.booking_engines.view"
BOOKING_ENGINES_CREATE = "beauty_business.booking_engines.create"
BOOKING_ENGINES_UPDATE = "beauty_business.booking_engines.update"
BOOKING_ENGINES_DELETE = "beauty_business.booking_engines.delete"
BOOKING_ENGINES_MANAGE = "beauty_business.booking_engines.manage"

CONFIGURATIONS_VIEW = "beauty_business.configurations.view"
CONFIGURATIONS_CREATE = "beauty_business.configurations.create"
CONFIGURATIONS_UPDATE = "beauty_business.configurations.update"
CONFIGURATIONS_DELETE = "beauty_business.configurations.delete"
CONFIGURATIONS_MANAGE = "beauty_business.configurations.manage"

SETTINGS_VIEW = "beauty_business.settings.view"
SETTINGS_MANAGE = "beauty_business.settings.manage"

AUDIT_VIEW = "beauty_business.audit.view"

# Phase 14.1 — Booking
SCHEDULES_VIEW = "beauty_business.schedules.view"
SCHEDULES_CREATE = "beauty_business.schedules.create"
SCHEDULES_UPDATE = "beauty_business.schedules.update"
SCHEDULES_DELETE = "beauty_business.schedules.delete"
SCHEDULES_MANAGE = "beauty_business.schedules.manage"

APPOINTMENTS_VIEW = "beauty_business.appointments.view"
APPOINTMENTS_CREATE = "beauty_business.appointments.create"
APPOINTMENTS_UPDATE = "beauty_business.appointments.update"
APPOINTMENTS_DELETE = "beauty_business.appointments.delete"
APPOINTMENTS_CONFIRM = "beauty_business.appointments.confirm"
APPOINTMENTS_CHECK_IN = "beauty_business.appointments.check_in"
APPOINTMENTS_COMPLETE = "beauty_business.appointments.complete"
APPOINTMENTS_CANCEL = "beauty_business.appointments.cancel"
APPOINTMENTS_NO_SHOW = "beauty_business.appointments.no_show"
APPOINTMENTS_MANAGE = "beauty_business.appointments.manage"

WAITING_LIST_VIEW = "beauty_business.waiting_list.view"
WAITING_LIST_CREATE = "beauty_business.waiting_list.create"
WAITING_LIST_UPDATE = "beauty_business.waiting_list.update"
WAITING_LIST_DELETE = "beauty_business.waiting_list.delete"
WAITING_LIST_MANAGE = "beauty_business.waiting_list.manage"

# Phase 14.2 — Salon
ROOMS_VIEW = "beauty_business.rooms.view"
ROOMS_CREATE = "beauty_business.rooms.create"
ROOMS_UPDATE = "beauty_business.rooms.update"
ROOMS_DELETE = "beauty_business.rooms.delete"
ROOMS_MANAGE = "beauty_business.rooms.manage"

STATIONS_VIEW = "beauty_business.stations.view"
STATIONS_CREATE = "beauty_business.stations.create"
STATIONS_UPDATE = "beauty_business.stations.update"
STATIONS_DELETE = "beauty_business.stations.delete"
STATIONS_MANAGE = "beauty_business.stations.manage"

BRANCH_POLICIES_VIEW = "beauty_business.branch_policies.view"
BRANCH_POLICIES_CREATE = "beauty_business.branch_policies.create"
BRANCH_POLICIES_UPDATE = "beauty_business.branch_policies.update"
BRANCH_POLICIES_DELETE = "beauty_business.branch_policies.delete"
BRANCH_POLICIES_MANAGE = "beauty_business.branch_policies.manage"

# Phase 14.3 — Catalog
SERVICE_CATEGORIES_VIEW = "beauty_business.service_categories.view"
SERVICE_CATEGORIES_CREATE = "beauty_business.service_categories.create"
SERVICE_CATEGORIES_UPDATE = "beauty_business.service_categories.update"
SERVICE_CATEGORIES_DELETE = "beauty_business.service_categories.delete"
SERVICE_CATEGORIES_MANAGE = "beauty_business.service_categories.manage"

SERVICES_VIEW = "beauty_business.services.view"
SERVICES_CREATE = "beauty_business.services.create"
SERVICES_UPDATE = "beauty_business.services.update"
SERVICES_DELETE = "beauty_business.services.delete"
SERVICES_MANAGE = "beauty_business.services.manage"

# Phase 14.4 — Customers
CUSTOMERS_VIEW = "beauty_business.customers.view"
CUSTOMERS_CREATE = "beauty_business.customers.create"
CUSTOMERS_UPDATE = "beauty_business.customers.update"
CUSTOMERS_DELETE = "beauty_business.customers.delete"
CUSTOMERS_MANAGE = "beauty_business.customers.manage"

# Phase 14.5 — Packages & Memberships
PACKAGES_VIEW = "beauty_business.packages.view"
PACKAGES_CREATE = "beauty_business.packages.create"
PACKAGES_UPDATE = "beauty_business.packages.update"
PACKAGES_DELETE = "beauty_business.packages.delete"
PACKAGES_MANAGE = "beauty_business.packages.manage"

MEMBERSHIPS_VIEW = "beauty_business.memberships.view"
MEMBERSHIPS_CREATE = "beauty_business.memberships.create"
MEMBERSHIPS_UPDATE = "beauty_business.memberships.update"
MEMBERSHIPS_DELETE = "beauty_business.memberships.delete"
MEMBERSHIPS_MANAGE = "beauty_business.memberships.manage"

# Phase 14.6 — Staff & Commissions
STAFF_VIEW = "beauty_business.staff.view"
STAFF_CREATE = "beauty_business.staff.create"
STAFF_UPDATE = "beauty_business.staff.update"
STAFF_DELETE = "beauty_business.staff.delete"
STAFF_MANAGE = "beauty_business.staff.manage"

COMMISSIONS_VIEW = "beauty_business.commissions.view"
COMMISSIONS_CREATE = "beauty_business.commissions.create"
COMMISSIONS_UPDATE = "beauty_business.commissions.update"
COMMISSIONS_DELETE = "beauty_business.commissions.delete"
COMMISSIONS_MANAGE = "beauty_business.commissions.manage"

# Phase 14.7 — Marketing & Integrations
MARKETING_VIEW = "beauty_business.marketing.view"
MARKETING_CREATE = "beauty_business.marketing.create"
MARKETING_UPDATE = "beauty_business.marketing.update"
MARKETING_DELETE = "beauty_business.marketing.delete"
MARKETING_MANAGE = "beauty_business.marketing.manage"

INTEGRATIONS_VIEW = "beauty_business.integrations.view"
INTEGRATIONS_CREATE = "beauty_business.integrations.create"
INTEGRATIONS_UPDATE = "beauty_business.integrations.update"
INTEGRATIONS_DELETE = "beauty_business.integrations.delete"
INTEGRATIONS_MANAGE = "beauty_business.integrations.manage"

ALL_PERMISSIONS: list[str] = [
    BEAUTY_BUSINESS_VIEW,
    BEAUTY_BUSINESS_MANAGE,
    ORGANIZATIONS_VIEW,
    ORGANIZATIONS_CREATE,
    ORGANIZATIONS_UPDATE,
    ORGANIZATIONS_DELETE,
    ORGANIZATIONS_MANAGE,
    BRANCHES_VIEW,
    BRANCHES_CREATE,
    BRANCHES_UPDATE,
    BRANCHES_DELETE,
    BRANCHES_MANAGE,
    EXTERNAL_PROVIDERS_VIEW,
    EXTERNAL_PROVIDERS_CREATE,
    EXTERNAL_PROVIDERS_UPDATE,
    EXTERNAL_PROVIDERS_DELETE,
    EXTERNAL_PROVIDERS_MANAGE,
    BOOKING_ENGINES_VIEW,
    BOOKING_ENGINES_CREATE,
    BOOKING_ENGINES_UPDATE,
    BOOKING_ENGINES_DELETE,
    BOOKING_ENGINES_MANAGE,
    CONFIGURATIONS_VIEW,
    CONFIGURATIONS_CREATE,
    CONFIGURATIONS_UPDATE,
    CONFIGURATIONS_DELETE,
    CONFIGURATIONS_MANAGE,
    SETTINGS_VIEW,
    SETTINGS_MANAGE,
    AUDIT_VIEW,
    SCHEDULES_VIEW,
    SCHEDULES_CREATE,
    SCHEDULES_UPDATE,
    SCHEDULES_DELETE,
    SCHEDULES_MANAGE,
    APPOINTMENTS_VIEW,
    APPOINTMENTS_CREATE,
    APPOINTMENTS_UPDATE,
    APPOINTMENTS_DELETE,
    APPOINTMENTS_CONFIRM,
    APPOINTMENTS_CHECK_IN,
    APPOINTMENTS_COMPLETE,
    APPOINTMENTS_CANCEL,
    APPOINTMENTS_NO_SHOW,
    APPOINTMENTS_MANAGE,
    WAITING_LIST_VIEW,
    WAITING_LIST_CREATE,
    WAITING_LIST_UPDATE,
    WAITING_LIST_DELETE,
    WAITING_LIST_MANAGE,
    ROOMS_VIEW,
    ROOMS_CREATE,
    ROOMS_UPDATE,
    ROOMS_DELETE,
    ROOMS_MANAGE,
    STATIONS_VIEW,
    STATIONS_CREATE,
    STATIONS_UPDATE,
    STATIONS_DELETE,
    STATIONS_MANAGE,
    BRANCH_POLICIES_VIEW,
    BRANCH_POLICIES_CREATE,
    BRANCH_POLICIES_UPDATE,
    BRANCH_POLICIES_DELETE,
    BRANCH_POLICIES_MANAGE,
    SERVICE_CATEGORIES_VIEW,
    SERVICE_CATEGORIES_CREATE,
    SERVICE_CATEGORIES_UPDATE,
    SERVICE_CATEGORIES_DELETE,
    SERVICE_CATEGORIES_MANAGE,
    SERVICES_VIEW,
    SERVICES_CREATE,
    SERVICES_UPDATE,
    SERVICES_DELETE,
    SERVICES_MANAGE,
    CUSTOMERS_VIEW,
    CUSTOMERS_CREATE,
    CUSTOMERS_UPDATE,
    CUSTOMERS_DELETE,
    CUSTOMERS_MANAGE,
    PACKAGES_VIEW,
    PACKAGES_CREATE,
    PACKAGES_UPDATE,
    PACKAGES_DELETE,
    PACKAGES_MANAGE,
    MEMBERSHIPS_VIEW,
    MEMBERSHIPS_CREATE,
    MEMBERSHIPS_UPDATE,
    MEMBERSHIPS_DELETE,
    MEMBERSHIPS_MANAGE,
    STAFF_VIEW,
    STAFF_CREATE,
    STAFF_UPDATE,
    STAFF_DELETE,
    STAFF_MANAGE,
    COMMISSIONS_VIEW,
    COMMISSIONS_CREATE,
    COMMISSIONS_UPDATE,
    COMMISSIONS_DELETE,
    COMMISSIONS_MANAGE,
    MARKETING_VIEW,
    MARKETING_CREATE,
    MARKETING_UPDATE,
    MARKETING_DELETE,
    MARKETING_MANAGE,
    INTEGRATIONS_VIEW,
    INTEGRATIONS_CREATE,
    INTEGRATIONS_UPDATE,
    INTEGRATIONS_DELETE,
    INTEGRATIONS_MANAGE,
]

PERMISSION_PREFIXES: tuple[str, ...] = (
    "beauty_business.",
    "beauty_business.organizations.",
    "beauty_business.branches.",
    "beauty_business.external_providers.",
    "beauty_business.booking_engines.",
    "beauty_business.configurations.",
    "beauty_business.settings.",
    "beauty_business.audit.",
    "beauty_business.schedules.",
    "beauty_business.appointments.",
    "beauty_business.waiting_list.",
    "beauty_business.rooms.",
    "beauty_business.stations.",
    "beauty_business.branch_policies.",
    "beauty_business.service_categories.",
    "beauty_business.services.",
    "beauty_business.customers.",
    "beauty_business.packages.",
    "beauty_business.memberships.",
    "beauty_business.staff.",
    "beauty_business.commissions.",
    "beauty_business.marketing.",
    "beauty_business.integrations.",
)

# Back-compat aliases for foundation routes
HUBS_VIEW = BRANCHES_VIEW
HUBS_CREATE = BRANCHES_CREATE
HUBS_UPDATE = BRANCHES_UPDATE
HUBS_DELETE = BRANCHES_DELETE
HUBS_MANAGE = BRANCHES_MANAGE
ROUTING_ENGINES_VIEW = BOOKING_ENGINES_VIEW
ROUTING_ENGINES_CREATE = BOOKING_ENGINES_CREATE
ROUTING_ENGINES_UPDATE = BOOKING_ENGINES_UPDATE
ROUTING_ENGINES_DELETE = BOOKING_ENGINES_DELETE
ROUTING_ENGINES_MANAGE = BOOKING_ENGINES_MANAGE
