"""loyalty 008 - add name_translations to transaction categories

Adds a JSON column for multi-language category names alongside the
existing name field (used as fallback/default).

Revision ID: loyalty_008
Revises: loyalty_007
Create Date: 2026-04-19
"""
import sqlalchemy as sa

from alembic import op

revision = "loyalty_008"
down_revision = "loyalty_007"
branch_labels = None
depends_on = None


def upgrade() -> None:
    op.add_column(
        "store_transaction_categories",
        sa.Column(
            "name_translations",
            sa.JSON(),
            nullable=True,
            comment='Language-keyed name dict, e.g. {"en": "Men", "fr": "Hommes"}',
        ),
    )


def downgrade() -> None:
    op.drop_column("store_transaction_categories", "name_translations")
