"""Loyalty permission definitions — Phase 7.0 foundation."""
from __future__ import annotations

LOYALTY_VIEW = "loyalty.view"
LOYALTY_MANAGE = "loyalty.manage"

LOYALTY_PROGRAMS_VIEW = "loyalty.programs.view"
LOYALTY_PROGRAMS_CREATE = "loyalty.programs.create"
LOYALTY_PROGRAMS_UPDATE = "loyalty.programs.update"
LOYALTY_PROGRAMS_DELETE = "loyalty.programs.delete"
LOYALTY_PROGRAMS_MANAGE = "loyalty.programs.manage"

LOYALTY_TIERS_VIEW = "loyalty.tiers.view"
LOYALTY_TIERS_CREATE = "loyalty.tiers.create"
LOYALTY_TIERS_UPDATE = "loyalty.tiers.update"
LOYALTY_TIERS_DELETE = "loyalty.tiers.delete"
LOYALTY_TIERS_MANAGE = "loyalty.tiers.manage"

LOYALTY_MEMBERS_VIEW = "loyalty.members.view"
LOYALTY_MEMBERS_CREATE = "loyalty.members.create"
LOYALTY_MEMBERS_UPDATE = "loyalty.members.update"
LOYALTY_MEMBERS_DELETE = "loyalty.members.delete"
LOYALTY_MEMBERS_MANAGE = "loyalty.members.manage"
LOYALTY_MEMBERS_ENROLL = "loyalty.members.enroll"
LOYALTY_MEMBERS_ACTIVATE = "loyalty.members.activate"
LOYALTY_MEMBERS_RENEW = "loyalty.members.renew"
LOYALTY_MEMBERS_FREEZE = "loyalty.members.freeze"
LOYALTY_MEMBERS_RESUME = "loyalty.members.resume"
LOYALTY_MEMBERS_CANCEL = "loyalty.members.cancel"
LOYALTY_MEMBERS_EXPIRE = "loyalty.members.expire"
LOYALTY_MEMBERS_TRANSFER = "loyalty.members.transfer"
LOYALTY_MEMBERS_LIFECYCLE_VIEW = "loyalty.members.lifecycle.view"

LOYALTY_POINT_ACCOUNTS_VIEW = "loyalty.point_accounts.view"
LOYALTY_POINT_ACCOUNTS_CREATE = "loyalty.point_accounts.create"
LOYALTY_POINT_ACCOUNTS_UPDATE = "loyalty.point_accounts.update"
LOYALTY_POINT_ACCOUNTS_MANAGE = "loyalty.point_accounts.manage"

LOYALTY_POINTS_VIEW = "loyalty.points.view"
LOYALTY_POINTS_EARN = "loyalty.points.earn"
LOYALTY_POINTS_REDEEM = "loyalty.points.redeem"
LOYALTY_POINTS_ADJUST = "loyalty.points.adjust"
LOYALTY_POINTS_EXPIRE = "loyalty.points.expire"
LOYALTY_POINTS_MANAGE = "loyalty.points.manage"

LOYALTY_REWARDS_VIEW = "loyalty.rewards.view"
LOYALTY_REWARDS_CREATE = "loyalty.rewards.create"
LOYALTY_REWARDS_UPDATE = "loyalty.rewards.update"
LOYALTY_REWARDS_DELETE = "loyalty.rewards.delete"
LOYALTY_REWARDS_MANAGE = "loyalty.rewards.manage"
LOYALTY_REWARDS_REDEEM = "loyalty.rewards.redeem"
LOYALTY_REWARDS_FULFILL = "loyalty.rewards.fulfill"
LOYALTY_REWARDS_CANCEL = "loyalty.rewards.cancel"

LOYALTY_REDEMPTIONS_VIEW = "loyalty.redemptions.view"

LOYALTY_CAMPAIGNS_VIEW = "loyalty.campaigns.view"
LOYALTY_CAMPAIGNS_CREATE = "loyalty.campaigns.create"
LOYALTY_CAMPAIGNS_UPDATE = "loyalty.campaigns.update"
LOYALTY_CAMPAIGNS_DELETE = "loyalty.campaigns.delete"
LOYALTY_CAMPAIGNS_MANAGE = "loyalty.campaigns.manage"
LOYALTY_CAMPAIGNS_SCHEDULE = "loyalty.campaigns.schedule"
LOYALTY_CAMPAIGNS_ACTIVATE = "loyalty.campaigns.activate"
LOYALTY_CAMPAIGNS_PAUSE = "loyalty.campaigns.pause"
LOYALTY_CAMPAIGNS_RESUME = "loyalty.campaigns.resume"
LOYALTY_CAMPAIGNS_EXPIRE = "loyalty.campaigns.expire"
LOYALTY_CAMPAIGNS_APPLY = "loyalty.campaigns.apply"
LOYALTY_CAMPAIGNS_RULES_UPDATE = "loyalty.campaigns.rules.update"
LOYALTY_CAMPAIGNS_APPLICATIONS_VIEW = "loyalty.campaigns.applications.view"

LOYALTY_REFERRAL_PROGRAMS_VIEW = "loyalty.referral_programs.view"
LOYALTY_REFERRAL_PROGRAMS_CREATE = "loyalty.referral_programs.create"
LOYALTY_REFERRAL_PROGRAMS_UPDATE = "loyalty.referral_programs.update"
LOYALTY_REFERRAL_PROGRAMS_DELETE = "loyalty.referral_programs.delete"
LOYALTY_REFERRAL_PROGRAMS_MANAGE = "loyalty.referral_programs.manage"

LOYALTY_REFERRAL_CODES_VIEW = "loyalty.referral_codes.view"
LOYALTY_REFERRAL_CODES_CREATE = "loyalty.referral_codes.create"
LOYALTY_REFERRAL_CODES_REVOKE = "loyalty.referral_codes.revoke"
LOYALTY_REFERRAL_CODES_MANAGE = "loyalty.referral_codes.manage"

LOYALTY_REFERRALS_VIEW = "loyalty.referrals.view"
LOYALTY_REFERRALS_ATTRIBUTE = "loyalty.referrals.attribute"
LOYALTY_REFERRALS_CONVERT = "loyalty.referrals.convert"
LOYALTY_REFERRALS_REWARD = "loyalty.referrals.reward"
LOYALTY_REFERRALS_CANCEL = "loyalty.referrals.cancel"
LOYALTY_REFERRALS_MANAGE = "loyalty.referrals.manage"

LOYALTY_WALLETS_VIEW = "loyalty.wallets.view"
LOYALTY_WALLETS_CREATE = "loyalty.wallets.create"
LOYALTY_WALLETS_CREDIT = "loyalty.wallets.credit"
LOYALTY_WALLETS_DEBIT = "loyalty.wallets.debit"
LOYALTY_WALLETS_ADJUST = "loyalty.wallets.adjust"
LOYALTY_WALLETS_TRANSFER = "loyalty.wallets.transfer"
LOYALTY_WALLETS_DELETE = "loyalty.wallets.delete"
LOYALTY_WALLETS_MANAGE = "loyalty.wallets.manage"

LOYALTY_AUDIT_VIEW = "loyalty.audit.view"

ALL_PERMISSIONS: list[str] = [
    LOYALTY_VIEW,
    LOYALTY_MANAGE,
    LOYALTY_PROGRAMS_VIEW,
    LOYALTY_PROGRAMS_CREATE,
    LOYALTY_PROGRAMS_UPDATE,
    LOYALTY_PROGRAMS_DELETE,
    LOYALTY_PROGRAMS_MANAGE,
    LOYALTY_TIERS_VIEW,
    LOYALTY_TIERS_CREATE,
    LOYALTY_TIERS_UPDATE,
    LOYALTY_TIERS_DELETE,
    LOYALTY_TIERS_MANAGE,
    LOYALTY_MEMBERS_VIEW,
    LOYALTY_MEMBERS_CREATE,
    LOYALTY_MEMBERS_UPDATE,
    LOYALTY_MEMBERS_DELETE,
    LOYALTY_MEMBERS_MANAGE,
    LOYALTY_MEMBERS_ENROLL,
    LOYALTY_MEMBERS_ACTIVATE,
    LOYALTY_MEMBERS_RENEW,
    LOYALTY_MEMBERS_FREEZE,
    LOYALTY_MEMBERS_RESUME,
    LOYALTY_MEMBERS_CANCEL,
    LOYALTY_MEMBERS_EXPIRE,
    LOYALTY_MEMBERS_TRANSFER,
    LOYALTY_MEMBERS_LIFECYCLE_VIEW,
    LOYALTY_POINT_ACCOUNTS_VIEW,
    LOYALTY_POINT_ACCOUNTS_CREATE,
    LOYALTY_POINT_ACCOUNTS_UPDATE,
    LOYALTY_POINT_ACCOUNTS_MANAGE,
    LOYALTY_POINTS_VIEW,
    LOYALTY_POINTS_EARN,
    LOYALTY_POINTS_REDEEM,
    LOYALTY_POINTS_ADJUST,
    LOYALTY_POINTS_EXPIRE,
    LOYALTY_POINTS_MANAGE,
    LOYALTY_REWARDS_VIEW,
    LOYALTY_REWARDS_CREATE,
    LOYALTY_REWARDS_UPDATE,
    LOYALTY_REWARDS_DELETE,
    LOYALTY_REWARDS_MANAGE,
    LOYALTY_REWARDS_REDEEM,
    LOYALTY_REWARDS_FULFILL,
    LOYALTY_REWARDS_CANCEL,
    LOYALTY_REDEMPTIONS_VIEW,
    LOYALTY_CAMPAIGNS_VIEW,
    LOYALTY_CAMPAIGNS_CREATE,
    LOYALTY_CAMPAIGNS_UPDATE,
    LOYALTY_CAMPAIGNS_DELETE,
    LOYALTY_CAMPAIGNS_MANAGE,
    LOYALTY_CAMPAIGNS_SCHEDULE,
    LOYALTY_CAMPAIGNS_ACTIVATE,
    LOYALTY_CAMPAIGNS_PAUSE,
    LOYALTY_CAMPAIGNS_RESUME,
    LOYALTY_CAMPAIGNS_EXPIRE,
    LOYALTY_CAMPAIGNS_APPLY,
    LOYALTY_CAMPAIGNS_RULES_UPDATE,
    LOYALTY_CAMPAIGNS_APPLICATIONS_VIEW,
    LOYALTY_REFERRAL_PROGRAMS_VIEW,
    LOYALTY_REFERRAL_PROGRAMS_CREATE,
    LOYALTY_REFERRAL_PROGRAMS_UPDATE,
    LOYALTY_REFERRAL_PROGRAMS_DELETE,
    LOYALTY_REFERRAL_PROGRAMS_MANAGE,
    LOYALTY_REFERRAL_CODES_VIEW,
    LOYALTY_REFERRAL_CODES_CREATE,
    LOYALTY_REFERRAL_CODES_REVOKE,
    LOYALTY_REFERRAL_CODES_MANAGE,
    LOYALTY_REFERRALS_VIEW,
    LOYALTY_REFERRALS_ATTRIBUTE,
    LOYALTY_REFERRALS_CONVERT,
    LOYALTY_REFERRALS_REWARD,
    LOYALTY_REFERRALS_CANCEL,
    LOYALTY_REFERRALS_MANAGE,
    LOYALTY_WALLETS_VIEW,
    LOYALTY_WALLETS_CREATE,
    LOYALTY_WALLETS_CREDIT,
    LOYALTY_WALLETS_DEBIT,
    LOYALTY_WALLETS_ADJUST,
    LOYALTY_WALLETS_TRANSFER,
    LOYALTY_WALLETS_DELETE,
    LOYALTY_WALLETS_MANAGE,
    LOYALTY_AUDIT_VIEW,
]

PERMISSION_PREFIXES: tuple[str, ...] = (
    "loyalty.",
    "loyalty.programs.",
    "loyalty.tiers.",
    "loyalty.members.",
    "loyalty.point_accounts.",
    "loyalty.points.",
    "loyalty.rewards.",
    "loyalty.redemptions.",
    "loyalty.campaigns.",
    "loyalty.referral_programs.",
    "loyalty.referral_codes.",
    "loyalty.referrals.",
    "loyalty.wallets.",
    "loyalty.audit.",
)
