"""Hospitality permission definitions — Phase 12.0 foundation."""
from __future__ import annotations

HOSPITALITY_VIEW = "hospitality.view"
HOSPITALITY_MANAGE = "hospitality.manage"

VENUES_VIEW = "hospitality.venues.view"
VENUES_CREATE = "hospitality.venues.create"
VENUES_UPDATE = "hospitality.venues.update"
VENUES_DELETE = "hospitality.venues.delete"
VENUES_MANAGE = "hospitality.venues.manage"

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

DINING_AREAS_VIEW = "hospitality.dining_areas.view"
DINING_AREAS_MANAGE = "hospitality.dining_areas.manage"
TABLES_VIEW = "hospitality.tables.view"
TABLES_MANAGE = "hospitality.tables.manage"

MENUS_VIEW = "hospitality.menus.view"
MENUS_CREATE = "hospitality.menus.create"
MENUS_UPDATE = "hospitality.menus.update"
MENUS_DELETE = "hospitality.menus.delete"
MENUS_MANAGE = "hospitality.menus.manage"
MENU_CATEGORIES_VIEW = "hospitality.menu_categories.view"
MENU_CATEGORIES_MANAGE = "hospitality.menu_categories.manage"
MENU_ITEMS_VIEW = "hospitality.menu_items.view"
MENU_ITEMS_MANAGE = "hospitality.menu_items.manage"

# Phase 12.1 — Digital Menu Catalog
ALLERGENS_VIEW = "hospitality.allergens.view"
ALLERGENS_MANAGE = "hospitality.allergens.manage"
MODIFIER_GROUPS_VIEW = "hospitality.modifier_groups.view"
MODIFIER_GROUPS_MANAGE = "hospitality.modifier_groups.manage"
MODIFIER_OPTIONS_VIEW = "hospitality.modifier_options.view"
MODIFIER_OPTIONS_MANAGE = "hospitality.modifier_options.manage"
AVAILABILITY_WINDOWS_VIEW = "hospitality.availability_windows.view"
AVAILABILITY_WINDOWS_MANAGE = "hospitality.availability_windows.manage"
MENU_MEDIA_VIEW = "hospitality.menu_media.view"
MENU_MEDIA_MANAGE = "hospitality.menu_media.manage"
MENU_LOCALIZATIONS_VIEW = "hospitality.menu_localizations.view"
MENU_LOCALIZATIONS_MANAGE = "hospitality.menu_localizations.manage"

# Phase 12.2 — QR Menu & QR Ordering
QR_CODES_VIEW = "hospitality.qr_codes.view"
QR_CODES_MANAGE = "hospitality.qr_codes.manage"
QR_MENU_SESSIONS_VIEW = "hospitality.qr_menu_sessions.view"
QR_MENU_SESSIONS_MANAGE = "hospitality.qr_menu_sessions.manage"
QR_ORDERING_SESSIONS_VIEW = "hospitality.qr_ordering_sessions.view"
QR_ORDERING_SESSIONS_MANAGE = "hospitality.qr_ordering_sessions.manage"
CARTS_VIEW = "hospitality.carts.view"
CARTS_MANAGE = "hospitality.carts.manage"

# Phase 12.3 — Table Service & Reservations
RESERVATIONS_VIEW = "hospitality.reservations.view"
RESERVATIONS_MANAGE = "hospitality.reservations.manage"
TABLE_ASSIGNMENTS_VIEW = "hospitality.table_assignments.view"
TABLE_ASSIGNMENTS_MANAGE = "hospitality.table_assignments.manage"
SERVICE_REQUESTS_VIEW = "hospitality.service_requests.view"
SERVICE_REQUESTS_MANAGE = "hospitality.service_requests.manage"
WAITLIST_VIEW = "hospitality.waitlist.view"
WAITLIST_MANAGE = "hospitality.waitlist.manage"

# Phase 12.4 — POS Lite
POS_REGISTERS_VIEW = "hospitality.pos_registers.view"
POS_REGISTERS_MANAGE = "hospitality.pos_registers.manage"
POS_SHIFTS_VIEW = "hospitality.pos_shifts.view"
POS_SHIFTS_MANAGE = "hospitality.pos_shifts.manage"
POS_TICKETS_VIEW = "hospitality.pos_tickets.view"
POS_TICKETS_MANAGE = "hospitality.pos_tickets.manage"

# Phase 12.5 — POS Pro
POS_PAYMENTS_VIEW = "hospitality.pos_payments.view"
POS_PAYMENTS_MANAGE = "hospitality.pos_payments.manage"
POS_DISCOUNTS_VIEW = "hospitality.pos_discounts.view"
POS_DISCOUNTS_MANAGE = "hospitality.pos_discounts.manage"
POS_TAX_LINES_VIEW = "hospitality.pos_tax_lines.view"
POS_TAX_LINES_MANAGE = "hospitality.pos_tax_lines.manage"
POS_FLOOR_PLANS_VIEW = "hospitality.pos_floor_plans.view"
POS_FLOOR_PLANS_MANAGE = "hospitality.pos_floor_plans.manage"
POS_STATIONS_VIEW = "hospitality.pos_stations.view"
POS_STATIONS_MANAGE = "hospitality.pos_stations.manage"

# Phase 12.6 — Kitchen
KITCHEN_STATIONS_VIEW = "hospitality.kitchen_stations.view"
KITCHEN_STATIONS_MANAGE = "hospitality.kitchen_stations.manage"
KITCHEN_TICKETS_VIEW = "hospitality.kitchen_tickets.view"
KITCHEN_TICKETS_MANAGE = "hospitality.kitchen_tickets.manage"

# Phase 12.7 — Connectors
CONNECTOR_REGISTRATIONS_VIEW = "hospitality.connector_registrations.view"
CONNECTOR_REGISTRATIONS_MANAGE = "hospitality.connector_registrations.manage"
CONNECTOR_DISPATCHES_VIEW = "hospitality.connector_dispatches.view"
CONNECTOR_DISPATCHES_MANAGE = "hospitality.connector_dispatches.manage"

# Phase 12.8 — Analytics
ANALYTICS_REPORTS_VIEW = "hospitality.analytics_reports.view"
ANALYTICS_REPORTS_MANAGE = "hospitality.analytics_reports.manage"
ANALYTICS_SNAPSHOTS_VIEW = "hospitality.analytics_snapshots.view"
ANALYTICS_SNAPSHOTS_MANAGE = "hospitality.analytics_snapshots.manage"

BUNDLES_VIEW = "hospitality.bundles.view"
BUNDLES_MANAGE = "hospitality.bundles.manage"
TENANT_BUNDLES_VIEW = "hospitality.tenant_bundles.view"
TENANT_BUNDLES_MANAGE = "hospitality.tenant_bundles.manage"
FEATURE_TOGGLES_VIEW = "hospitality.feature_toggles.view"
FEATURE_TOGGLES_MANAGE = "hospitality.feature_toggles.manage"

ROLES_VIEW = "hospitality.roles.view"
ROLES_MANAGE = "hospitality.roles.manage"
PERMISSIONS_VIEW = "hospitality.permissions.view"
PERMISSIONS_MANAGE = "hospitality.permissions.manage"

CONFIGURATIONS_VIEW = "hospitality.configurations.view"
CONFIGURATIONS_MANAGE = "hospitality.configurations.manage"
EVENTS_VIEW = "hospitality.events.view"
EVENTS_MANAGE = "hospitality.events.manage"
SETTINGS_VIEW = "hospitality.settings.view"
SETTINGS_MANAGE = "hospitality.settings.manage"
AUDIT_VIEW = "hospitality.audit.view"

# Bundle-gated permissions (registered; engines later)
DIGITAL_MENU_VIEW = "hospitality.digital_menu.view"
QR_MENU_VIEW = "hospitality.qr_menu.view"
QR_ORDERING_MANAGE = "hospitality.qr_ordering.manage"
POS_LITE_MANAGE = "hospitality.pos_lite.manage"
POS_PRO_MANAGE = "hospitality.pos_pro.manage"
KITCHEN_MANAGE = "hospitality.kitchen.manage"
RESERVATION_MANAGE = "hospitality.reservation.manage"
TABLE_SERVICE_MANAGE = "hospitality.table_service.manage"
DELIVERY_CONNECTOR_MANAGE = "hospitality.delivery_connector.manage"
ACCOUNTING_CONNECTOR_MANAGE = "hospitality.accounting_connector.manage"
CRM_CONNECTOR_MANAGE = "hospitality.crm_connector.manage"
LOYALTY_CONNECTOR_MANAGE = "hospitality.loyalty_connector.manage"
COMMUNICATION_CONNECTOR_MANAGE = "hospitality.communication_connector.manage"
WEBSITE_CONNECTOR_MANAGE = "hospitality.website_connector.manage"
ANALYTICS_VIEW = "hospitality.analytics.view"
AI_ASSISTANT_MANAGE = "hospitality.ai_assistant.manage"

ALL_PERMISSIONS: list[str] = [
    HOSPITALITY_VIEW,
    HOSPITALITY_MANAGE,
    VENUES_VIEW,
    VENUES_CREATE,
    VENUES_UPDATE,
    VENUES_DELETE,
    VENUES_MANAGE,
    BRANCHES_VIEW,
    BRANCHES_CREATE,
    BRANCHES_UPDATE,
    BRANCHES_DELETE,
    BRANCHES_MANAGE,
    DINING_AREAS_VIEW,
    DINING_AREAS_MANAGE,
    TABLES_VIEW,
    TABLES_MANAGE,
    MENUS_VIEW,
    MENUS_CREATE,
    MENUS_UPDATE,
    MENUS_DELETE,
    MENUS_MANAGE,
    MENU_CATEGORIES_VIEW,
    MENU_CATEGORIES_MANAGE,
    MENU_ITEMS_VIEW,
    MENU_ITEMS_MANAGE,
    ALLERGENS_VIEW,
    ALLERGENS_MANAGE,
    MODIFIER_GROUPS_VIEW,
    MODIFIER_GROUPS_MANAGE,
    MODIFIER_OPTIONS_VIEW,
    MODIFIER_OPTIONS_MANAGE,
    AVAILABILITY_WINDOWS_VIEW,
    AVAILABILITY_WINDOWS_MANAGE,
    MENU_MEDIA_VIEW,
    MENU_MEDIA_MANAGE,
    MENU_LOCALIZATIONS_VIEW,
    MENU_LOCALIZATIONS_MANAGE,
    QR_CODES_VIEW,
    QR_CODES_MANAGE,
    QR_MENU_SESSIONS_VIEW,
    QR_MENU_SESSIONS_MANAGE,
    QR_ORDERING_SESSIONS_VIEW,
    QR_ORDERING_SESSIONS_MANAGE,
    CARTS_VIEW,
    CARTS_MANAGE,
    RESERVATIONS_VIEW,
    RESERVATIONS_MANAGE,
    TABLE_ASSIGNMENTS_VIEW,
    TABLE_ASSIGNMENTS_MANAGE,
    SERVICE_REQUESTS_VIEW,
    SERVICE_REQUESTS_MANAGE,
    WAITLIST_VIEW,
    WAITLIST_MANAGE,
    POS_REGISTERS_VIEW,
    POS_REGISTERS_MANAGE,
    POS_SHIFTS_VIEW,
    POS_SHIFTS_MANAGE,
    POS_TICKETS_VIEW,
    POS_TICKETS_MANAGE,
    POS_PAYMENTS_VIEW,
    POS_PAYMENTS_MANAGE,
    POS_DISCOUNTS_VIEW,
    POS_DISCOUNTS_MANAGE,
    POS_TAX_LINES_VIEW,
    POS_TAX_LINES_MANAGE,
    POS_FLOOR_PLANS_VIEW,
    POS_FLOOR_PLANS_MANAGE,
    POS_STATIONS_VIEW,
    POS_STATIONS_MANAGE,
    KITCHEN_STATIONS_VIEW,
    KITCHEN_STATIONS_MANAGE,
    KITCHEN_TICKETS_VIEW,
    KITCHEN_TICKETS_MANAGE,
    CONNECTOR_REGISTRATIONS_VIEW,
    CONNECTOR_REGISTRATIONS_MANAGE,
    CONNECTOR_DISPATCHES_VIEW,
    CONNECTOR_DISPATCHES_MANAGE,
    ANALYTICS_REPORTS_VIEW,
    ANALYTICS_REPORTS_MANAGE,
    ANALYTICS_SNAPSHOTS_VIEW,
    ANALYTICS_SNAPSHOTS_MANAGE,
    BUNDLES_VIEW,
    BUNDLES_MANAGE,
    TENANT_BUNDLES_VIEW,
    TENANT_BUNDLES_MANAGE,
    FEATURE_TOGGLES_VIEW,
    FEATURE_TOGGLES_MANAGE,
    ROLES_VIEW,
    ROLES_MANAGE,
    PERMISSIONS_VIEW,
    PERMISSIONS_MANAGE,
    CONFIGURATIONS_VIEW,
    CONFIGURATIONS_MANAGE,
    EVENTS_VIEW,
    EVENTS_MANAGE,
    SETTINGS_VIEW,
    SETTINGS_MANAGE,
    AUDIT_VIEW,
    DIGITAL_MENU_VIEW,
    QR_MENU_VIEW,
    QR_ORDERING_MANAGE,
    POS_LITE_MANAGE,
    POS_PRO_MANAGE,
    KITCHEN_MANAGE,
    RESERVATION_MANAGE,
    TABLE_SERVICE_MANAGE,
    DELIVERY_CONNECTOR_MANAGE,
    ACCOUNTING_CONNECTOR_MANAGE,
    CRM_CONNECTOR_MANAGE,
    LOYALTY_CONNECTOR_MANAGE,
    COMMUNICATION_CONNECTOR_MANAGE,
    WEBSITE_CONNECTOR_MANAGE,
    ANALYTICS_VIEW,
    AI_ASSISTANT_MANAGE,
]

PERMISSION_PREFIXES: tuple[str, ...] = (
    "hospitality.",
    "hospitality.venues.",
    "hospitality.branches.",
    "hospitality.menus.",
    "hospitality.allergens.",
    "hospitality.modifier_groups.",
    "hospitality.qr_codes.",
    "hospitality.qr_menu_sessions.",
    "hospitality.qr_ordering_sessions.",
    "hospitality.carts.",
    "hospitality.reservations.",
    "hospitality.table_assignments.",
    "hospitality.service_requests.",
    "hospitality.waitlist.",
    "hospitality.pos_registers.",
    "hospitality.pos_shifts.",
    "hospitality.pos_tickets.",
    "hospitality.pos_payments.",
    "hospitality.pos_discounts.",
    "hospitality.pos_tax_lines.",
    "hospitality.pos_floor_plans.",
    "hospitality.pos_stations.",
    "hospitality.kitchen_stations.",
    "hospitality.kitchen_tickets.",
    "hospitality.connector_registrations.",
    "hospitality.connector_dispatches.",
    "hospitality.analytics_reports.",
    "hospitality.analytics_snapshots.",
    "hospitality.bundles.",
    "hospitality.tenant_bundles.",
    "hospitality.feature_toggles.",
)
