"""Workspace lifecycle events."""

from __future__ import annotations

from simorgh.apps.events.bus import register_event


def register_all() -> None:
    register_event(
        "workspaces.workspace_created",
        description="A new UX-shell workspace was created.",
        payload_keys=("workspace_id", "tenant_id", "kind"),
    )
    register_event(
        "workspaces.workspace_updated",
        description="A workspace was updated.",
        payload_keys=("workspace_id", "tenant_id"),
    )
    register_event(
        "workspaces.member_added",
        description="A user gained access to a workspace.",
        payload_keys=("workspace_id", "user_id"),
    )
    register_event(
        "workspaces.member_removed",
        description="A user was removed from a workspace.",
        payload_keys=("workspace_id", "user_id"),
    )
    register_event(
        "workspaces.navigation_changed",
        description="Workspace navigation tree changed.",
        payload_keys=("workspace_id",),
    )
    register_event(
        "workspaces.access_grant_added",
        description="A role→workspace access grant was added.",
        payload_keys=("workspace_id", "role_id"),
    )
    register_event(
        "workspaces.access_grant_removed",
        description="A role→workspace access grant was removed.",
        payload_keys=("workspace_id", "role_id"),
    )
