"""CRM permission definitions — Phase 6.0 + 6.1 + 6.2."""
from __future__ import annotations

CRM_VIEW = "crm.view"
CRM_MANAGE = "crm.manage"

CRM_LEADS_VIEW = "crm.leads.view"
CRM_LEADS_CREATE = "crm.leads.create"
CRM_LEADS_UPDATE = "crm.leads.update"
CRM_LEADS_DELETE = "crm.leads.delete"
CRM_LEADS_MANAGE = "crm.leads.manage"
CRM_LEADS_ASSIGN = "crm.leads.assign"

CRM_CONTACTS_VIEW = "crm.contacts.view"
CRM_CONTACTS_CREATE = "crm.contacts.create"
CRM_CONTACTS_UPDATE = "crm.contacts.update"
CRM_CONTACTS_DELETE = "crm.contacts.delete"
CRM_CONTACTS_MANAGE = "crm.contacts.manage"

CRM_ORGANIZATIONS_VIEW = "crm.organizations.view"
CRM_ORGANIZATIONS_CREATE = "crm.organizations.create"
CRM_ORGANIZATIONS_UPDATE = "crm.organizations.update"
CRM_ORGANIZATIONS_DELETE = "crm.organizations.delete"
CRM_ORGANIZATIONS_MANAGE = "crm.organizations.manage"

CRM_OPPORTUNITIES_VIEW = "crm.opportunities.view"
CRM_OPPORTUNITIES_CREATE = "crm.opportunities.create"
CRM_OPPORTUNITIES_UPDATE = "crm.opportunities.update"
CRM_OPPORTUNITIES_DELETE = "crm.opportunities.delete"
CRM_OPPORTUNITIES_MANAGE = "crm.opportunities.manage"
CRM_OPPORTUNITIES_WIN = "crm.opportunities.win"

CRM_PIPELINES_VIEW = "crm.pipelines.view"
CRM_PIPELINES_CREATE = "crm.pipelines.create"
CRM_PIPELINES_UPDATE = "crm.pipelines.update"
CRM_PIPELINES_DELETE = "crm.pipelines.delete"
CRM_PIPELINES_MANAGE = "crm.pipelines.manage"

CRM_PLAYBOOKS_VIEW = "crm.playbooks.view"
CRM_PLAYBOOKS_CREATE = "crm.playbooks.create"
CRM_PLAYBOOKS_UPDATE = "crm.playbooks.update"
CRM_PLAYBOOKS_DELETE = "crm.playbooks.delete"
CRM_PLAYBOOKS_MANAGE = "crm.playbooks.manage"
CRM_PLAYBOOKS_ASSIGN = "crm.playbooks.assign"

CRM_FORECASTS_VIEW = "crm.forecasts.view"
CRM_FORECASTS_CREATE = "crm.forecasts.create"
CRM_FORECASTS_UPDATE = "crm.forecasts.update"
CRM_FORECASTS_MANAGE = "crm.forecasts.manage"

CRM_GOALS_VIEW = "crm.goals.view"
CRM_GOALS_CREATE = "crm.goals.create"
CRM_GOALS_UPDATE = "crm.goals.update"
CRM_GOALS_DELETE = "crm.goals.delete"
CRM_GOALS_MANAGE = "crm.goals.manage"

CRM_TARGETS_VIEW = "crm.targets.view"
CRM_TARGETS_CREATE = "crm.targets.create"
CRM_TARGETS_UPDATE = "crm.targets.update"
CRM_TARGETS_DELETE = "crm.targets.delete"
CRM_TARGETS_MANAGE = "crm.targets.manage"

CRM_ACTIVITIES_VIEW = "crm.activities.view"
CRM_ACTIVITIES_CREATE = "crm.activities.create"
CRM_ACTIVITIES_UPDATE = "crm.activities.update"
CRM_ACTIVITIES_DELETE = "crm.activities.delete"
CRM_ACTIVITIES_MANAGE = "crm.activities.manage"
CRM_ACTIVITIES_COMPLETE = "crm.activities.complete"

CRM_TASKS_VIEW = "crm.tasks.view"
CRM_TASKS_CREATE = "crm.tasks.create"
CRM_TASKS_UPDATE = "crm.tasks.update"
CRM_TASKS_DELETE = "crm.tasks.delete"
CRM_TASKS_MANAGE = "crm.tasks.manage"
CRM_TASKS_COMPLETE = "crm.tasks.complete"

CRM_MEETINGS_VIEW = "crm.meetings.view"
CRM_MEETINGS_CREATE = "crm.meetings.create"
CRM_MEETINGS_UPDATE = "crm.meetings.update"
CRM_MEETINGS_DELETE = "crm.meetings.delete"
CRM_MEETINGS_MANAGE = "crm.meetings.manage"

CRM_CALLS_VIEW = "crm.calls.view"
CRM_CALLS_CREATE = "crm.calls.create"
CRM_CALLS_UPDATE = "crm.calls.update"
CRM_CALLS_MANAGE = "crm.calls.manage"

CRM_TIMELINE_VIEW = "crm.timeline.view"
CRM_TIMELINE_MANAGE = "crm.timeline.manage"

CRM_COMMENTS_VIEW = "crm.comments.view"
CRM_COMMENTS_CREATE = "crm.comments.create"
CRM_COMMENTS_UPDATE = "crm.comments.update"
CRM_COMMENTS_DELETE = "crm.comments.delete"
CRM_COMMENTS_MANAGE = "crm.comments.manage"

CRM_MENTIONS_VIEW = "crm.mentions.view"
CRM_MENTIONS_CREATE = "crm.mentions.create"
CRM_MENTIONS_MANAGE = "crm.mentions.manage"

CRM_TEAM_VIEW = "crm.team.view"
CRM_TEAM_CREATE = "crm.team.create"
CRM_TEAM_UPDATE = "crm.team.update"
CRM_TEAM_MANAGE = "crm.team.manage"

CRM_QUOTES_VIEW = "crm.quotes.view"
CRM_QUOTES_CREATE = "crm.quotes.create"
CRM_QUOTES_UPDATE = "crm.quotes.update"
CRM_QUOTES_DELETE = "crm.quotes.delete"
CRM_QUOTES_MANAGE = "crm.quotes.manage"

CRM_NOTES_VIEW = "crm.notes.view"
CRM_NOTES_CREATE = "crm.notes.create"
CRM_NOTES_UPDATE = "crm.notes.update"
CRM_NOTES_DELETE = "crm.notes.delete"
CRM_NOTES_MANAGE = "crm.notes.manage"

CRM_ATTACHMENTS_VIEW = "crm.attachments.view"
CRM_ATTACHMENTS_CREATE = "crm.attachments.create"
CRM_ATTACHMENTS_DELETE = "crm.attachments.delete"
CRM_ATTACHMENTS_MANAGE = "crm.attachments.manage"

CRM_CUSTOMFIELDS_VIEW = "crm.customfields.view"
CRM_CUSTOMFIELDS_CREATE = "crm.customfields.create"
CRM_CUSTOMFIELDS_UPDATE = "crm.customfields.update"
CRM_CUSTOMFIELDS_MANAGE = "crm.customfields.manage"

ALL_PERMISSIONS = [
    CRM_VIEW,
    CRM_MANAGE,
    CRM_LEADS_VIEW,
    CRM_LEADS_CREATE,
    CRM_LEADS_UPDATE,
    CRM_LEADS_DELETE,
    CRM_LEADS_MANAGE,
    CRM_LEADS_ASSIGN,
    CRM_CONTACTS_VIEW,
    CRM_CONTACTS_CREATE,
    CRM_CONTACTS_UPDATE,
    CRM_CONTACTS_DELETE,
    CRM_CONTACTS_MANAGE,
    CRM_ORGANIZATIONS_VIEW,
    CRM_ORGANIZATIONS_CREATE,
    CRM_ORGANIZATIONS_UPDATE,
    CRM_ORGANIZATIONS_DELETE,
    CRM_ORGANIZATIONS_MANAGE,
    CRM_OPPORTUNITIES_VIEW,
    CRM_OPPORTUNITIES_CREATE,
    CRM_OPPORTUNITIES_UPDATE,
    CRM_OPPORTUNITIES_DELETE,
    CRM_OPPORTUNITIES_MANAGE,
    CRM_OPPORTUNITIES_WIN,
    CRM_PIPELINES_VIEW,
    CRM_PIPELINES_CREATE,
    CRM_PIPELINES_UPDATE,
    CRM_PIPELINES_DELETE,
    CRM_PIPELINES_MANAGE,
    CRM_PLAYBOOKS_VIEW,
    CRM_PLAYBOOKS_CREATE,
    CRM_PLAYBOOKS_UPDATE,
    CRM_PLAYBOOKS_DELETE,
    CRM_PLAYBOOKS_MANAGE,
    CRM_PLAYBOOKS_ASSIGN,
    CRM_FORECASTS_VIEW,
    CRM_FORECASTS_CREATE,
    CRM_FORECASTS_UPDATE,
    CRM_FORECASTS_MANAGE,
    CRM_GOALS_VIEW,
    CRM_GOALS_CREATE,
    CRM_GOALS_UPDATE,
    CRM_GOALS_DELETE,
    CRM_GOALS_MANAGE,
    CRM_TARGETS_VIEW,
    CRM_TARGETS_CREATE,
    CRM_TARGETS_UPDATE,
    CRM_TARGETS_DELETE,
    CRM_TARGETS_MANAGE,
    CRM_ACTIVITIES_VIEW,
    CRM_ACTIVITIES_CREATE,
    CRM_ACTIVITIES_UPDATE,
    CRM_ACTIVITIES_DELETE,
    CRM_ACTIVITIES_MANAGE,
    CRM_ACTIVITIES_COMPLETE,
    CRM_TASKS_VIEW,
    CRM_TASKS_CREATE,
    CRM_TASKS_UPDATE,
    CRM_TASKS_DELETE,
    CRM_TASKS_MANAGE,
    CRM_TASKS_COMPLETE,
    CRM_MEETINGS_VIEW,
    CRM_MEETINGS_CREATE,
    CRM_MEETINGS_UPDATE,
    CRM_MEETINGS_DELETE,
    CRM_MEETINGS_MANAGE,
    CRM_CALLS_VIEW,
    CRM_CALLS_CREATE,
    CRM_CALLS_UPDATE,
    CRM_CALLS_MANAGE,
    CRM_TIMELINE_VIEW,
    CRM_TIMELINE_MANAGE,
    CRM_COMMENTS_VIEW,
    CRM_COMMENTS_CREATE,
    CRM_COMMENTS_UPDATE,
    CRM_COMMENTS_DELETE,
    CRM_COMMENTS_MANAGE,
    CRM_MENTIONS_VIEW,
    CRM_MENTIONS_CREATE,
    CRM_MENTIONS_MANAGE,
    CRM_TEAM_VIEW,
    CRM_TEAM_CREATE,
    CRM_TEAM_UPDATE,
    CRM_TEAM_MANAGE,
    CRM_QUOTES_VIEW,
    CRM_QUOTES_CREATE,
    CRM_QUOTES_UPDATE,
    CRM_QUOTES_DELETE,
    CRM_QUOTES_MANAGE,
    CRM_NOTES_VIEW,
    CRM_NOTES_CREATE,
    CRM_NOTES_UPDATE,
    CRM_NOTES_DELETE,
    CRM_NOTES_MANAGE,
    CRM_ATTACHMENTS_VIEW,
    CRM_ATTACHMENTS_CREATE,
    CRM_ATTACHMENTS_DELETE,
    CRM_ATTACHMENTS_MANAGE,
    CRM_CUSTOMFIELDS_VIEW,
    CRM_CUSTOMFIELDS_CREATE,
    CRM_CUSTOMFIELDS_UPDATE,
    CRM_CUSTOMFIELDS_MANAGE,
]

PERMISSION_PREFIXES = (
    "crm.",
    "crm.leads.",
    "crm.contacts.",
    "crm.organizations.",
    "crm.opportunities.",
    "crm.pipelines.",
    "crm.playbooks.",
    "crm.forecasts.",
    "crm.goals.",
    "crm.targets.",
    "crm.activities.",
    "crm.tasks.",
    "crm.meetings.",
    "crm.calls.",
    "crm.timeline.",
    "crm.comments.",
    "crm.mentions.",
    "crm.team.",
    "crm.quotes.",
    "crm.notes.",
    "crm.attachments.",
    "crm.customfields.",
)
