endpoint setup

This commit is contained in:
exolonConfidental
2026-02-08 11:18:47 +05:30
parent 8fb3b7cf67
commit a77788fc47
33 changed files with 932 additions and 352 deletions

View File

@@ -0,0 +1,60 @@
"""add insurance details table
Revision ID: 471bdc3c5b51
Revises: b7538fce8343
Create Date: 2026-02-07 23:47:44.253489
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = '471bdc3c5b51'
down_revision: Union[str, Sequence[str], None] = 'b7538fce8343'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
"""Upgrade schema."""
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('insurance_details',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('property_id', sa.Integer(), nullable=False),
sa.Column('insurance_company', sa.String(length=150), nullable=False),
sa.Column('claim_number', sa.String(length=100), nullable=False),
sa.Column('date_of_loss', sa.Date(), nullable=False),
sa.Column('adjuster_name', sa.String(length=150), nullable=True),
sa.Column('adjuster_phone', sa.String(length=30), nullable=True),
sa.Column('adjuster_email', sa.String(length=150), nullable=True),
sa.Column('claim_filed', sa.Boolean(), nullable=False),
sa.Column('claim_approved', sa.Boolean(), nullable=False),
sa.Column('policy_number', sa.String(length=100), nullable=True),
sa.Column('coverage_type', sa.String(length=50), nullable=True),
sa.Column('claim_type', sa.String(length=50), nullable=True),
sa.Column('deductible_amount', sa.Integer(), nullable=True),
sa.Column('claim_amount', sa.Integer(), nullable=True),
sa.Column('approved_amount', sa.Integer(), nullable=True),
sa.Column('payment_status', sa.String(length=50), nullable=True),
sa.Column('date_claim_filed', sa.Date(), nullable=True),
sa.Column('date_claim_closed', sa.Date(), nullable=True),
sa.Column('insurance_agent_name', sa.String(length=150), nullable=True),
sa.Column('insurance_agent_phone', sa.String(length=30), nullable=True),
sa.Column('notes', sa.Text(), nullable=True),
sa.ForeignKeyConstraint(['property_id'], ['properties.id'], ondelete='CASCADE'),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('claim_number')
)
op.create_index(op.f('ix_insurance_details_property_id'), 'insurance_details', ['property_id'], unique=False)
# ### end Alembic commands ###
def downgrade() -> None:
"""Downgrade schema."""
# ### commands auto generated by Alembic - please adjust! ###
op.drop_index(op.f('ix_insurance_details_property_id'), table_name='insurance_details')
op.drop_table('insurance_details')
# ### end Alembic commands ###