diff --git a/backend/alembic/versions/g1b2c3d4e5f6_invoice_header_user_field_length.py b/backend/alembic/versions/g1b2c3d4e5f6_invoice_header_user_field_length.py new file mode 100644 index 00000000..e37c00b9 --- /dev/null +++ b/backend/alembic/versions/g1b2c3d4e5f6_invoice_header_user_field_length.py @@ -0,0 +1,53 @@ +"""increase invoice_header who_processed and capture_user to 100 chars + +Revision ID: g1b2c3d4e5f6 +Revises: f7a8b9c0d1e2 +Create Date: 2026-04-30 00:00:00.000000 + +""" +from alembic import op +import sqlalchemy as sa + +# revision identifiers, used by Alembic. +revision = 'g1b2c3d4e5f6' +down_revision = 'f7a8b9c0d1e2' +branch_labels = None +depends_on = None + + +def upgrade() -> None: + op.alter_column( + 'invoice_header', + 'who_processed', + existing_type=sa.String(length=20), + type_=sa.String(length=100), + existing_nullable=True, + schema='a76', + ) + op.alter_column( + 'invoice_header', + 'capture_user', + existing_type=sa.String(length=20), + type_=sa.String(length=100), + existing_nullable=True, + schema='a76', + ) + + +def downgrade() -> None: + op.alter_column( + 'invoice_header', + 'capture_user', + existing_type=sa.String(length=100), + type_=sa.String(length=20), + existing_nullable=True, + schema='a76', + ) + op.alter_column( + 'invoice_header', + 'who_processed', + existing_type=sa.String(length=100), + type_=sa.String(length=20), + existing_nullable=True, + schema='a76', + ) diff --git a/backend/api/v1/modules/a76/invoices/models.py b/backend/api/v1/modules/a76/invoices/models.py index e4e7c086..8cf823e6 100644 --- a/backend/api/v1/modules/a76/invoices/models.py +++ b/backend/api/v1/modules/a76/invoices/models.py @@ -124,10 +124,10 @@ class InvoiceHeader(Base, TenantScopedMixin, TimestampMixin): TIMESTAMP(timezone=False) ) # FECHAACTUALIZACION / FECHAACTUAL who_processed: Mapped[Optional[str]] = mapped_column( - String(20) + String(100) ) # USUARIOACT / Quien actualizó capture_user: Mapped[Optional[str]] = mapped_column( - String(20) + String(100) ) # USUARIOCAP / Usuario que capturó traffic_light_status: Mapped[Optional[str]] = mapped_column( diff --git a/backend/api/v1/modules/a76/invoices/schemas.py b/backend/api/v1/modules/a76/invoices/schemas.py index e8df1724..70f3382e 100644 --- a/backend/api/v1/modules/a76/invoices/schemas.py +++ b/backend/api/v1/modules/a76/invoices/schemas.py @@ -73,8 +73,8 @@ class InvoiceHeaderBase(BaseModel): return InvoiceStatus.PROCESSED.value return v processed_date: Optional[datetime] = Field(None, description="Update date") - who_processed: Optional[str] = Field(None, max_length=20, description="Who processed") - capture_user: Optional[str] = Field(None, max_length=20, description="Capture user") + who_processed: Optional[str] = Field(None, max_length=100, description="Who processed") + capture_user: Optional[str] = Field(None, max_length=100, description="Capture user") traffic_light_status: Optional[str] = Field( None, max_length=50, description="Traffic light status" )