"""add incoterm DAF legacy catalog row

Revision ID: e4f5a6b7c8d9
Revises: c3d4e5f6a7b
Create Date: 2026-05-08

Incoterm histórico DAF (Delivered At Frontier) para CSV y referencias legacy.
"""
from typing import Sequence, Union

from alembic import op

revision: str = "e4f5a6b7c8d9"
down_revision: Union[str, None] = "c3d4e5f6a7b"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    op.execute(
        """
        INSERT INTO public.incoterms (code, description_es, description_en) VALUES
        ('DAF', 'ENTREGADO EN FRONTERA', 'DELIVERED AT FRONTIER')
        ON CONFLICT (code) DO NOTHING;
        """
    )


def downgrade() -> None:
    op.execute("DELETE FROM public.incoterms WHERE code = 'DAF';")
