Improve the frontend and fix TODOs

This commit is contained in:
Urtzi Alfaro
2025-10-24 13:05:04 +02:00
parent 07c33fa578
commit 61376b7a9f
100 changed files with 8284 additions and 3419 deletions

View File

@@ -0,0 +1,51 @@
"""Add waste_defect_type and is_ai_assisted to production_batches
Revision ID: 7f8e9d2a1b3c
Revises: 42a9c1fd8fec
Create Date: 2025-10-23 09:00:00.000000
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '7f8e9d2a1b3c'
down_revision = '42a9c1fd8fec'
branch_labels = None
depends_on = None
def upgrade() -> None:
"""Add waste_defect_type and is_ai_assisted columns to production_batches table"""
# Add waste_defect_type column
op.add_column(
'production_batches',
sa.Column('waste_defect_type', sa.String(length=100), nullable=True)
)
# Add is_ai_assisted column with default False
op.add_column(
'production_batches',
sa.Column('is_ai_assisted', sa.Boolean(), nullable=False, server_default='false')
)
# Add index on is_ai_assisted for faster queries on AI-assisted batch filtering
op.create_index(
'ix_production_batches_is_ai_assisted',
'production_batches',
['is_ai_assisted'],
unique=False
)
def downgrade() -> None:
"""Remove waste_defect_type and is_ai_assisted columns from production_batches table"""
# Drop index first
op.drop_index('ix_production_batches_is_ai_assisted', table_name='production_batches')
# Drop columns
op.drop_column('production_batches', 'is_ai_assisted')
op.drop_column('production_batches', 'waste_defect_type')