"""Catalog Engine — IAM permission registration."""

from __future__ import annotations

from simorgh.apps.iam.registry import register_permission

PERMISSIONS = [
    ("catalog.category.view",   "مشاهده دسته‌بندی‌های کاتالوگ",     "View catalog categories"),
    ("catalog.category.manage", "مدیریت دسته‌بندی‌های کاتالوگ",     "Create, update, delete catalog categories"),
    ("catalog.item.view",       "مشاهده آیتم‌های کاتالوگ",         "View catalog items"),
    ("catalog.item.create",     "ایجاد آیتم کاتالوگ",              "Create catalog items (drafts)"),
    ("catalog.item.update",     "ویرایش آیتم کاتالوگ",             "Update catalog items"),
    ("catalog.item.publish",    "انتشار آیتم کاتالوگ",             "Publish, retire, and manage catalog workflow"),
    ("catalog.item.delete",     "حذف آیتم کاتالوگ",               "Soft-delete catalog items"),
]


def register_all() -> None:
    for codename, label, description in PERMISSIONS:
        register_permission(codename, label=label, description=description)
