# alembic/versions/s7a8b9c0d1e2_add_storefront_locale_to_vendors.py
"""Add storefront_locale to vendors for currency formatting.

Revision ID: s7a8b9c0d1e2
Revises: r6f7a8b9c0d1
Create Date: 2026-01-02 20:00:00.000000

This migration adds a nullable storefront_locale field to vendors.
NULL means the vendor inherits from platform defaults.
Examples: 'fr-LU', 'de-DE', 'en-GB'
"""

import sqlalchemy as sa

from alembic import op

# revision identifiers, used by Alembic.
revision = "s7a8b9c0d1e2"
down_revision = "r6f7a8b9c0d1"
branch_labels = None
depends_on = None


def upgrade() -> None:
    """Add storefront_locale column to vendors table."""
    # Nullable - NULL means "inherit from platform default"
    op.add_column(
        "vendors",
        sa.Column(
            "storefront_locale",
            sa.String(10),
            nullable=True,
            comment="Currency/number formatting locale (NULL = inherit from platform)",
        ),
    )


def downgrade() -> None:
    """Remove storefront_locale column from vendors table."""
    op.drop_column("vendors", "storefront_locale")
