"""Add new bus requirements to QuoteHeader

Revision ID: 2792ce0fb842
Revises: e2547fbd5d77
Create Date: 2026-07-11 13:30:07.292377

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = '2792ce0fb842'
down_revision: Union[str, None] = 'e2547fbd5d77'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('quote_header', sa.Column('quote_number', sa.String(length=50), nullable=True))
    op.add_column('quote_header', sa.Column('quote_type', sa.String(length=50), nullable=True))
    op.add_column('quote_header', sa.Column('quote_date', sa.Date(), nullable=True))
    op.add_column('quote_header', sa.Column('chassis_model', sa.String(length=50), nullable=True))
    op.add_column('quote_header', sa.Column('body_type', sa.String(length=50), nullable=True))
    op.add_column('quote_header', sa.Column('bus_use', sa.String(length=20), nullable=True))
    op.add_column('quote_header', sa.Column('bom_class', sa.String(length=20), nullable=True))
    op.add_column('quote_header', sa.Column('ac_communication', sa.Text(), nullable=True))
    op.add_column('quote_header', sa.Column('driver_request_notes', sa.Text(), nullable=True))
    op.add_column('quote_header', sa.Column('remarks', sa.Text(), nullable=True))
    op.add_column('quote_header', sa.Column('seat_fitting_notes', sa.Text(), nullable=True))
    op.add_column('quote_header', sa.Column('receiving_transport_id', sa.String(length=50), nullable=True))
    op.add_column('quote_header', sa.Column('dispatch_transport_id', sa.String(length=50), nullable=True))
    op.add_column('quote_header', sa.Column('base_price', sa.Float(), nullable=True))
    op.add_column('quote_header', sa.Column('feature_price', sa.Float(), nullable=True))
    op.add_column('quote_header', sa.Column('subtotal', sa.Float(), nullable=True))
    op.add_column('quote_header', sa.Column('discount_pct', sa.Float(), nullable=True))
    op.add_column('quote_header', sa.Column('discount_amount', sa.Float(), nullable=True))
    op.add_column('quote_header', sa.Column('discount_reason', sa.String(length=200), nullable=True))
    op.add_column('quote_header', sa.Column('gst_pct', sa.Float(), nullable=True))
    op.add_column('quote_header', sa.Column('gst_amount', sa.Float(), nullable=True))
    op.add_column('quote_header', sa.Column('total_amount', sa.Float(), nullable=True))
    op.add_column('quote_header', sa.Column('is_goodwill', sa.Boolean(), nullable=True))
    op.add_column('quote_header', sa.Column('notes', sa.Text(), nullable=True))
    op.create_foreign_key(None, 'quote_header', 'transport_master', ['receiving_transport_id'], ['transport_id'])
    op.create_foreign_key(None, 'quote_header', 'transport_master', ['dispatch_transport_id'], ['transport_id'])
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'quote_header', type_='foreignkey')
    op.drop_constraint(None, 'quote_header', type_='foreignkey')
    op.drop_column('quote_header', 'notes')
    op.drop_column('quote_header', 'is_goodwill')
    op.drop_column('quote_header', 'total_amount')
    op.drop_column('quote_header', 'gst_amount')
    op.drop_column('quote_header', 'gst_pct')
    op.drop_column('quote_header', 'discount_reason')
    op.drop_column('quote_header', 'discount_amount')
    op.drop_column('quote_header', 'discount_pct')
    op.drop_column('quote_header', 'subtotal')
    op.drop_column('quote_header', 'feature_price')
    op.drop_column('quote_header', 'base_price')
    op.drop_column('quote_header', 'dispatch_transport_id')
    op.drop_column('quote_header', 'receiving_transport_id')
    op.drop_column('quote_header', 'seat_fitting_notes')
    op.drop_column('quote_header', 'remarks')
    op.drop_column('quote_header', 'driver_request_notes')
    op.drop_column('quote_header', 'ac_communication')
    op.drop_column('quote_header', 'bom_class')
    op.drop_column('quote_header', 'bus_use')
    op.drop_column('quote_header', 'body_type')
    op.drop_column('quote_header', 'chassis_model')
    op.drop_column('quote_header', 'quote_date')
    op.drop_column('quote_header', 'quote_type')
    op.drop_column('quote_header', 'quote_number')
    # ### end Alembic commands ###
