diff --git a/.env b/.env index cd90c54b90..f7570ca600 100644 --- a/.env +++ b/.env @@ -5,8 +5,8 @@ DOMAIN=localhost # Environment: local, staging, production ENVIRONMENT=local -PROJECT_NAME="Full Stack FastAPI Project" -STACK_NAME=full-stack-fastapi-project +PROJECT_NAME="WyseHub" +STACK_NAME=WyseHub # Backend BACKEND_CORS_ORIGINS="http://localhost,http://localhost:5173,https://localhost,https://localhost:5173,http://localhost.tiangolo.com" @@ -31,6 +31,7 @@ POSTGRES_DB=app POSTGRES_USER=postgres POSTGRES_PASSWORD=changethis + SENTRY_DSN= # Configure these with your own Docker registry images diff --git a/backend/app/alembic/versions/0e3f5b4ac311_add_fields_to_referral.py b/backend/app/alembic/versions/0e3f5b4ac311_add_fields_to_referral.py new file mode 100644 index 0000000000..38022d7d21 --- /dev/null +++ b/backend/app/alembic/versions/0e3f5b4ac311_add_fields_to_referral.py @@ -0,0 +1,31 @@ +"""Add fields to referral + +Revision ID: 0e3f5b4ac311 +Revises: 823daaece31a +Create Date: 2024-06-20 21:48:33.480486 + +""" +from alembic import op +import sqlalchemy as sa +import sqlmodel.sql.sqltypes + + +# revision identifiers, used by Alembic. +revision = '0e3f5b4ac311' +down_revision = '823daaece31a' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.add_column('referral', sa.Column('daystohire', sa.Integer(), nullable=True)) + op.add_column('referral', sa.Column('creditrepair', sqlmodel.sql.sqltypes.AutoString(), nullable=True)) + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_column('referral', 'creditrepair') + op.drop_column('referral', 'daystohire') + # ### end Alembic commands ### diff --git a/backend/app/alembic/versions/19a30555c420_added_rate_override.py b/backend/app/alembic/versions/19a30555c420_added_rate_override.py new file mode 100644 index 0000000000..e66e0a4b8f --- /dev/null +++ b/backend/app/alembic/versions/19a30555c420_added_rate_override.py @@ -0,0 +1,29 @@ +"""added rate override + +Revision ID: 19a30555c420 +Revises: 55e3e7adc035 +Create Date: 2024-06-27 13:34:52.105505 + +""" +from alembic import op +import sqlalchemy as sa +import sqlmodel.sql.sqltypes + + +# revision identifiers, used by Alembic. +revision = '19a30555c420' +down_revision = '55e3e7adc035' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.add_column('supplier_rate', sa.Column('rate_override', sqlmodel.sql.sqltypes.AutoString(), server_default='No', nullable=True)) + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_column('supplier_rate', 'rate_override') + # ### end Alembic commands ### diff --git a/backend/app/alembic/versions/1a064a7a9ffd_add_constraint_to_supplier_stat.py b/backend/app/alembic/versions/1a064a7a9ffd_add_constraint_to_supplier_stat.py new file mode 100644 index 0000000000..053528f5dc --- /dev/null +++ b/backend/app/alembic/versions/1a064a7a9ffd_add_constraint_to_supplier_stat.py @@ -0,0 +1,33 @@ +"""Add constraint to supplier_stat + +Revision ID: 1a064a7a9ffd +Revises: a1563c57883e +Create Date: 2024-06-26 10:09:33.596156 + +""" +from alembic import op +import sqlalchemy as sa +import sqlmodel.sql.sqltypes + + +# revision identifiers, used by Alembic. +revision = '1a064a7a9ffd' +down_revision = 'a1563c57883e' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_constraint('supplier_stat_uniquecol_key', 'supplier_stat', type_='unique') + op.create_unique_constraint('supplier_stat_constraint', 'supplier_stat', ['authority_id', 'veh_group_id', 'circs_group_id', 'supplier_id']) + op.drop_column('supplier_stat', 'uniquecol') + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.add_column('supplier_stat', sa.Column('uniquecol', sa.VARCHAR(), autoincrement=False, nullable=True)) + op.drop_constraint('supplier_stat_constraint', 'supplier_stat', type_='unique') + op.create_unique_constraint('supplier_stat_uniquecol_key', 'supplier_stat', ['uniquecol']) + # ### end Alembic commands ### diff --git a/backend/app/alembic/versions/399c60ab29a9_add_source_link_to_user.py b/backend/app/alembic/versions/399c60ab29a9_add_source_link_to_user.py new file mode 100644 index 0000000000..8053304f7a --- /dev/null +++ b/backend/app/alembic/versions/399c60ab29a9_add_source_link_to_user.py @@ -0,0 +1,31 @@ +"""Add source link to user + +Revision ID: 399c60ab29a9 +Revises: 25220aaf861f +Create Date: 2024-06-20 11:45:49.758014 + +""" +from alembic import op +import sqlalchemy as sa +import sqlmodel.sql.sqltypes + + +# revision identifiers, used by Alembic. +revision = '399c60ab29a9' +down_revision = '25220aaf861f' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.add_column('user', sa.Column('assigned_source_id', sa.Integer(), nullable=True)) + op.create_foreign_key(None, 'user', 'source', ['assigned_source_id'], ['id']) + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_constraint(None, 'user', type_='foreignkey') + op.drop_column('user', 'assigned_source_id') + # ### end Alembic commands ### diff --git a/backend/app/alembic/versions/42a2dea4a6ed_add_columns_to_suplier_stats.py b/backend/app/alembic/versions/42a2dea4a6ed_add_columns_to_suplier_stats.py new file mode 100644 index 0000000000..3383f07f84 --- /dev/null +++ b/backend/app/alembic/versions/42a2dea4a6ed_add_columns_to_suplier_stats.py @@ -0,0 +1,37 @@ +"""Add columns to suplier stats + +Revision ID: 42a2dea4a6ed +Revises: f327615111b1 +Create Date: 2024-06-24 20:50:06.908063 + +""" +from alembic import op +import sqlalchemy as sa +import sqlmodel.sql.sqltypes + + +# revision identifiers, used by Alembic. +revision = '42a2dea4a6ed' +down_revision = 'f327615111b1' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.add_column('supplier_stat', sa.Column('rate_rank', sa.Integer(), nullable=True)) + op.add_column('supplier_stat', sa.Column('daystohire', sa.Integer(), nullable=True)) + op.add_column('supplier_stat', sa.Column('daystohire_rank', sa.Integer(), nullable=True)) + op.add_column('supplier_stat', sa.Column('conversion', sa.Integer(), nullable=True)) + op.add_column('supplier_stat', sa.Column('conversion_rank', sa.Integer(), nullable=True)) + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_column('supplier_stat', 'conversion_rank') + op.drop_column('supplier_stat', 'conversion') + op.drop_column('supplier_stat', 'daystohire_rank') + op.drop_column('supplier_stat', 'daystohire') + op.drop_column('supplier_stat', 'rate_rank') + # ### end Alembic commands ### diff --git a/backend/app/alembic/versions/55e3e7adc035_added_rate_override.py b/backend/app/alembic/versions/55e3e7adc035_added_rate_override.py new file mode 100644 index 0000000000..97d04c2e1a --- /dev/null +++ b/backend/app/alembic/versions/55e3e7adc035_added_rate_override.py @@ -0,0 +1,29 @@ +"""added rate override + +Revision ID: 55e3e7adc035 +Revises: d38c7fb805e3 +Create Date: 2024-06-27 13:24:18.205019 + +""" +from alembic import op +import sqlalchemy as sa +import sqlmodel.sql.sqltypes + + +# revision identifiers, used by Alembic. +revision = '55e3e7adc035' +down_revision = 'd38c7fb805e3' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### diff --git a/backend/app/alembic/versions/62dc04418112_added_rate_override.py b/backend/app/alembic/versions/62dc04418112_added_rate_override.py new file mode 100644 index 0000000000..d21f20b48b --- /dev/null +++ b/backend/app/alembic/versions/62dc04418112_added_rate_override.py @@ -0,0 +1,29 @@ +"""added rate override + +Revision ID: 62dc04418112 +Revises: b1e076cbef1e +Create Date: 2024-06-27 13:16:18.197731 + +""" +from alembic import op +import sqlalchemy as sa +import sqlmodel.sql.sqltypes + + +# revision identifiers, used by Alembic. +revision = '62dc04418112' +down_revision = 'b1e076cbef1e' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### diff --git a/backend/app/alembic/versions/823daaece31a_add_source_to_referral_public.py b/backend/app/alembic/versions/823daaece31a_add_source_to_referral_public.py new file mode 100644 index 0000000000..4fca6b76b9 --- /dev/null +++ b/backend/app/alembic/versions/823daaece31a_add_source_to_referral_public.py @@ -0,0 +1,29 @@ +"""Add source to referral public + +Revision ID: 823daaece31a +Revises: e616a4c1ee36 +Create Date: 2024-06-20 12:50:33.922379 + +""" +from alembic import op +import sqlalchemy as sa +import sqlmodel.sql.sqltypes + + +# revision identifiers, used by Alembic. +revision = '823daaece31a' +down_revision = 'e616a4c1ee36' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### diff --git a/backend/app/alembic/versions/8fe419a7050f_cleaning_some_class.py b/backend/app/alembic/versions/8fe419a7050f_cleaning_some_class.py new file mode 100644 index 0000000000..97279ae4bd --- /dev/null +++ b/backend/app/alembic/versions/8fe419a7050f_cleaning_some_class.py @@ -0,0 +1,53 @@ +"""Cleaning some class + +Revision ID: 8fe419a7050f +Revises: aa346315f015 +Create Date: 2024-06-26 15:30:36.822955 + +""" +from alembic import op +import sqlalchemy as sa +import sqlmodel.sql.sqltypes + + +# revision identifiers, used by Alembic. +revision = '8fe419a7050f' +down_revision = 'aa346315f015' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.alter_column('circs_group', 'group', + existing_type=sa.VARCHAR(), + nullable=False) + op.alter_column('circs_group', 'desc', + existing_type=sa.VARCHAR(), + nullable=False) + op.alter_column('claim', 'client_firstname', + existing_type=sa.VARCHAR(), + nullable=False) + op.alter_column('claim', 'client_lastname', + existing_type=sa.VARCHAR(), + nullable=False) + op.drop_column('referral_allocation', 'Source') + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.add_column('referral_allocation', sa.Column('Source', sa.VARCHAR(), autoincrement=False, nullable=False)) + op.alter_column('claim', 'client_lastname', + existing_type=sa.VARCHAR(), + nullable=True) + op.alter_column('claim', 'client_firstname', + existing_type=sa.VARCHAR(), + nullable=True) + op.alter_column('circs_group', 'desc', + existing_type=sa.VARCHAR(), + nullable=True) + op.alter_column('circs_group', 'group', + existing_type=sa.VARCHAR(), + nullable=True) + # ### end Alembic commands ### diff --git a/backend/app/alembic/versions/9edf47558091_add_constraint_to_supplier_rate.py b/backend/app/alembic/versions/9edf47558091_add_constraint_to_supplier_rate.py new file mode 100644 index 0000000000..c964cb407f --- /dev/null +++ b/backend/app/alembic/versions/9edf47558091_add_constraint_to_supplier_rate.py @@ -0,0 +1,31 @@ +"""Add constraint to supplier_rate + +Revision ID: 9edf47558091 +Revises: f9729800dad4 +Create Date: 2024-06-25 21:12:45.431082 + +""" +from alembic import op +import sqlalchemy as sa +import sqlmodel.sql.sqltypes + + +# revision identifiers, used by Alembic. +revision = '9edf47558091' +down_revision = 'f9729800dad4' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_constraint('Supplier_Rate_Constraint', 'supplier_rate', type_='unique') + op.create_unique_constraint('supplier_rate_constraint', 'supplier_rate', ['authority_id', 'veh_group_id', 'circs_group_id', 'supplier_id']) + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_constraint('supplier_rate_constraint', 'supplier_rate', type_='unique') + op.create_unique_constraint('Supplier_Rate_Constraint', 'supplier_rate', ['authority_id', 'veh_group_id', 'circs_group_id', 'supplier_id']) + # ### end Alembic commands ### diff --git a/backend/app/alembic/versions/a1563c57883e_set_req_for_base_rate.py b/backend/app/alembic/versions/a1563c57883e_set_req_for_base_rate.py new file mode 100644 index 0000000000..6d2655b83e --- /dev/null +++ b/backend/app/alembic/versions/a1563c57883e_set_req_for_base_rate.py @@ -0,0 +1,29 @@ +"""set req for base_rate + +Revision ID: a1563c57883e +Revises: f3759d1ee4b6 +Create Date: 2024-06-26 09:04:39.712329 + +""" +from alembic import op +import sqlalchemy as sa +import sqlmodel.sql.sqltypes + + +# revision identifiers, used by Alembic. +revision = 'a1563c57883e' +down_revision = 'f3759d1ee4b6' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### diff --git a/backend/app/alembic/versions/a603d214d406_add_column_to_referral.py b/backend/app/alembic/versions/a603d214d406_add_column_to_referral.py new file mode 100644 index 0000000000..61df119087 --- /dev/null +++ b/backend/app/alembic/versions/a603d214d406_add_column_to_referral.py @@ -0,0 +1,31 @@ +"""Add column to referral + +Revision ID: a603d214d406 +Revises: cb8e1a8be864 +Create Date: 2024-06-24 21:27:07.533077 + +""" +from alembic import op +import sqlalchemy as sa +import sqlmodel.sql.sqltypes + + +# revision identifiers, used by Alembic. +revision = 'a603d214d406' +down_revision = 'cb8e1a8be864' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.add_column('referral', sa.Column('authority_id', sa.Integer(), nullable=True)) + op.create_foreign_key(None, 'referral', 'authority', ['authority_id'], ['id']) + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_constraint(None, 'referral', type_='foreignkey') + op.drop_column('referral', 'authority_id') + # ### end Alembic commands ### diff --git a/backend/app/alembic/versions/a646d1eab4ab_add_total_column_to_supplier_stats.py b/backend/app/alembic/versions/a646d1eab4ab_add_total_column_to_supplier_stats.py new file mode 100644 index 0000000000..9d0f799f9b --- /dev/null +++ b/backend/app/alembic/versions/a646d1eab4ab_add_total_column_to_supplier_stats.py @@ -0,0 +1,29 @@ +"""Add total column to supplier_stats + +Revision ID: a646d1eab4ab +Revises: a603d214d406 +Create Date: 2024-06-25 11:40:29.655376 + +""" +from alembic import op +import sqlalchemy as sa +import sqlmodel.sql.sqltypes + + +# revision identifiers, used by Alembic. +revision = 'a646d1eab4ab' +down_revision = 'a603d214d406' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.add_column('supplier_stat', sa.Column('total_rank', sa.Integer(), nullable=True)) + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_column('supplier_stat', 'total_rank') + # ### end Alembic commands ### diff --git a/backend/app/alembic/versions/aa346315f015_add_constraint_to_supplier_stat.py b/backend/app/alembic/versions/aa346315f015_add_constraint_to_supplier_stat.py new file mode 100644 index 0000000000..98fdcb4554 --- /dev/null +++ b/backend/app/alembic/versions/aa346315f015_add_constraint_to_supplier_stat.py @@ -0,0 +1,33 @@ +"""Add constraint to supplier_stat + +Revision ID: aa346315f015 +Revises: 1a064a7a9ffd +Create Date: 2024-06-26 14:39:20.338293 + +""" +from alembic import op +import sqlalchemy as sa +import sqlmodel.sql.sqltypes + + +# revision identifiers, used by Alembic. +revision = 'aa346315f015' +down_revision = '1a064a7a9ffd' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.alter_column('supplier', 'name', + existing_type=sa.VARCHAR(), + nullable=False) + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.alter_column('supplier', 'name', + existing_type=sa.VARCHAR(), + nullable=True) + # ### end Alembic commands ### diff --git a/backend/app/alembic/versions/b1e076cbef1e_added_fields_to_referral_table.py b/backend/app/alembic/versions/b1e076cbef1e_added_fields_to_referral_table.py new file mode 100644 index 0000000000..72f25385a3 --- /dev/null +++ b/backend/app/alembic/versions/b1e076cbef1e_added_fields_to_referral_table.py @@ -0,0 +1,35 @@ +"""added fields to referral table + +Revision ID: b1e076cbef1e +Revises: f8b89cc1b8b2 +Create Date: 2024-06-27 12:19:03.791433 + +""" +from alembic import op +import sqlalchemy as sa +import sqlmodel.sql.sqltypes + + +# revision identifiers, used by Alembic. +revision = 'b1e076cbef1e' +down_revision = 'f8b89cc1b8b2' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.add_column('referral', sa.Column('circs_group_id', sa.Integer(), nullable=True)) + op.add_column('referral', sa.Column('veh_group_id', sa.Integer(), nullable=True)) + op.create_foreign_key(None, 'referral', 'veh_group', ['veh_group_id'], ['id']) + op.create_foreign_key(None, 'referral', 'circs_group', ['circs_group_id'], ['id']) + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_constraint(None, 'referral', type_='foreignkey') + op.drop_constraint(None, 'referral', type_='foreignkey') + op.drop_column('referral', 'veh_group_id') + op.drop_column('referral', 'circs_group_id') + # ### end Alembic commands ### diff --git a/backend/app/alembic/versions/bb189524fc88_add_supplier_stats.py b/backend/app/alembic/versions/bb189524fc88_add_supplier_stats.py new file mode 100644 index 0000000000..51efc818a3 --- /dev/null +++ b/backend/app/alembic/versions/bb189524fc88_add_supplier_stats.py @@ -0,0 +1,47 @@ +"""Add supplier_stats + +Revision ID: bb189524fc88 +Revises: 0e3f5b4ac311 +Create Date: 2024-06-24 14:03:57.394676 + +""" +from alembic import op +import sqlalchemy as sa +import sqlmodel.sql.sqltypes + + +# revision identifiers, used by Alembic. +revision = 'bb189524fc88' +down_revision = '0e3f5b4ac311' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.create_table('supplier_stat', + sa.Column('id', sa.Integer(), nullable=False), + sa.Column('authority_id', sa.Integer(), nullable=False), + sa.Column('plate_type', sqlmodel.sql.sqltypes.AutoString(), nullable=True), + sa.Column('veh_group_id', sa.Integer(), nullable=False), + sa.Column('circs_group_id', sa.Integer(), nullable=False), + sa.Column('rate', sa.Float(), nullable=True), + sa.Column('hire_length', sa.Integer(), nullable=True), + sa.Column('supplier_id', sa.Integer(), nullable=False), + sa.Column('owner_id', sa.Integer(), nullable=False), + sa.Column('created_datetime', sa.DateTime(timezone=True), server_default=sa.text('now()'), nullable=False), + sa.Column('updated_datetime', sa.DateTime(timezone=True), server_default=sa.text('now()'), nullable=True), + sa.ForeignKeyConstraint(['authority_id'], ['authority.id'], ), + sa.ForeignKeyConstraint(['circs_group_id'], ['circs_group.id'], ), + sa.ForeignKeyConstraint(['owner_id'], ['user.id'], ), + sa.ForeignKeyConstraint(['supplier_id'], ['supplier.id'], ), + sa.ForeignKeyConstraint(['veh_group_id'], ['veh_group.id'], ), + sa.PrimaryKeyConstraint('id') + ) + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_table('supplier_stat') + # ### end Alembic commands ### diff --git a/backend/app/alembic/versions/cb8e1a8be864_add_columns_to_suplier_stats.py b/backend/app/alembic/versions/cb8e1a8be864_add_columns_to_suplier_stats.py new file mode 100644 index 0000000000..ed908035a9 --- /dev/null +++ b/backend/app/alembic/versions/cb8e1a8be864_add_columns_to_suplier_stats.py @@ -0,0 +1,31 @@ +"""Add columns to suplier stats + +Revision ID: cb8e1a8be864 +Revises: 42a2dea4a6ed +Create Date: 2024-06-24 21:11:46.543196 + +""" +from alembic import op +import sqlalchemy as sa +import sqlmodel.sql.sqltypes + + +# revision identifiers, used by Alembic. +revision = 'cb8e1a8be864' +down_revision = '42a2dea4a6ed' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.add_column('supplier_stat', sa.Column('uniquecol', sqlmodel.sql.sqltypes.AutoString(), nullable=True)) + op.create_unique_constraint(None, 'supplier_stat', ['uniquecol']) + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_constraint(None, 'supplier_stat', type_='unique') + op.drop_column('supplier_stat', 'uniquecol') + # ### end Alembic commands ### diff --git a/backend/app/alembic/versions/d38c7fb805e3_added_rate_override.py b/backend/app/alembic/versions/d38c7fb805e3_added_rate_override.py new file mode 100644 index 0000000000..267168f887 --- /dev/null +++ b/backend/app/alembic/versions/d38c7fb805e3_added_rate_override.py @@ -0,0 +1,33 @@ +"""added rate override + +Revision ID: d38c7fb805e3 +Revises: 62dc04418112 +Create Date: 2024-06-27 13:21:31.934219 + +""" +from alembic import op +import sqlalchemy as sa +import sqlmodel.sql.sqltypes + + +# revision identifiers, used by Alembic. +revision = 'd38c7fb805e3' +down_revision = '62dc04418112' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.alter_column('supplier_rate', 'rate_override', + existing_type=sa.VARCHAR(), + nullable=False) + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.alter_column('supplier_rate', 'rate_override', + existing_type=sa.VARCHAR(), + nullable=True) + # ### end Alembic commands ### diff --git a/backend/app/alembic/versions/d9a45d01d476_cleaning_some_class.py b/backend/app/alembic/versions/d9a45d01d476_cleaning_some_class.py new file mode 100644 index 0000000000..a81850f418 --- /dev/null +++ b/backend/app/alembic/versions/d9a45d01d476_cleaning_some_class.py @@ -0,0 +1,29 @@ +"""Cleaning some class + +Revision ID: d9a45d01d476 +Revises: 8fe419a7050f +Create Date: 2024-06-26 15:37:37.038724 + +""" +from alembic import op +import sqlalchemy as sa +import sqlmodel.sql.sqltypes + + +# revision identifiers, used by Alembic. +revision = 'd9a45d01d476' +down_revision = '8fe419a7050f' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### diff --git a/backend/app/alembic/versions/e616a4c1ee36_add_source_to_referral_public.py b/backend/app/alembic/versions/e616a4c1ee36_add_source_to_referral_public.py new file mode 100644 index 0000000000..3946b6dfc0 --- /dev/null +++ b/backend/app/alembic/versions/e616a4c1ee36_add_source_to_referral_public.py @@ -0,0 +1,29 @@ +"""Add source to referral public + +Revision ID: e616a4c1ee36 +Revises: 399c60ab29a9 +Create Date: 2024-06-20 11:58:22.227750 + +""" +from alembic import op +import sqlalchemy as sa +import sqlmodel.sql.sqltypes + + +# revision identifiers, used by Alembic. +revision = 'e616a4c1ee36' +down_revision = '399c60ab29a9' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### diff --git a/backend/app/alembic/versions/f327615111b1_add_supplier_stats.py b/backend/app/alembic/versions/f327615111b1_add_supplier_stats.py new file mode 100644 index 0000000000..38b4c58063 --- /dev/null +++ b/backend/app/alembic/versions/f327615111b1_add_supplier_stats.py @@ -0,0 +1,57 @@ +"""Add supplier_stats + +Revision ID: f327615111b1 +Revises: bb189524fc88 +Create Date: 2024-06-24 15:25:43.111509 + +""" +from alembic import op +import sqlalchemy as sa +import sqlmodel.sql.sqltypes + + +# revision identifiers, used by Alembic. +revision = 'f327615111b1' +down_revision = 'bb189524fc88' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.alter_column('supplier_stat', 'authority_id', + existing_type=sa.INTEGER(), + nullable=True) + op.alter_column('supplier_stat', 'veh_group_id', + existing_type=sa.INTEGER(), + nullable=True) + op.alter_column('supplier_stat', 'circs_group_id', + existing_type=sa.INTEGER(), + nullable=True) + op.alter_column('supplier_stat', 'supplier_id', + existing_type=sa.INTEGER(), + nullable=True) + op.alter_column('supplier_stat', 'owner_id', + existing_type=sa.INTEGER(), + nullable=True) + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.alter_column('supplier_stat', 'owner_id', + existing_type=sa.INTEGER(), + nullable=False) + op.alter_column('supplier_stat', 'supplier_id', + existing_type=sa.INTEGER(), + nullable=False) + op.alter_column('supplier_stat', 'circs_group_id', + existing_type=sa.INTEGER(), + nullable=False) + op.alter_column('supplier_stat', 'veh_group_id', + existing_type=sa.INTEGER(), + nullable=False) + op.alter_column('supplier_stat', 'authority_id', + existing_type=sa.INTEGER(), + nullable=False) + # ### end Alembic commands ### diff --git a/backend/app/alembic/versions/f3759d1ee4b6_add_base_rate_to_supplier.py b/backend/app/alembic/versions/f3759d1ee4b6_add_base_rate_to_supplier.py new file mode 100644 index 0000000000..c5968c30c1 --- /dev/null +++ b/backend/app/alembic/versions/f3759d1ee4b6_add_base_rate_to_supplier.py @@ -0,0 +1,29 @@ +"""Add base rate to supplier + +Revision ID: f3759d1ee4b6 +Revises: 9edf47558091 +Create Date: 2024-06-25 21:55:44.547783 + +""" +from alembic import op +import sqlalchemy as sa +import sqlmodel.sql.sqltypes + + +# revision identifiers, used by Alembic. +revision = 'f3759d1ee4b6' +down_revision = '9edf47558091' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.add_column('supplier', sa.Column('base_rate', sa.Float(), nullable=False)) + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_column('supplier', 'base_rate') + # ### end Alembic commands ### diff --git a/backend/app/alembic/versions/f8b89cc1b8b2_added_field_for_override.py b/backend/app/alembic/versions/f8b89cc1b8b2_added_field_for_override.py new file mode 100644 index 0000000000..0d415991e3 --- /dev/null +++ b/backend/app/alembic/versions/f8b89cc1b8b2_added_field_for_override.py @@ -0,0 +1,35 @@ +"""added field for override + +Revision ID: f8b89cc1b8b2 +Revises: d9a45d01d476 +Create Date: 2024-06-27 11:29:58.929192 + +""" +from alembic import op +import sqlalchemy as sa +import sqlmodel.sql.sqltypes +from sqlalchemy.dialects import postgresql + +# revision identifiers, used by Alembic. +revision = 'f8b89cc1b8b2' +down_revision = 'd9a45d01d476' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.alter_column('authority', 'created_datetime', + existing_type=postgresql.TIMESTAMP(timezone=True), + nullable=False) + op.add_column('supplier_rate', sa.Column('rate_override', sqlmodel.sql.sqltypes.AutoString(), nullable=True)) + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_column('supplier_rate', 'rate_override') + op.alter_column('authority', 'created_datetime', + existing_type=postgresql.TIMESTAMP(timezone=True), + nullable=True) + # ### end Alembic commands ### diff --git a/backend/app/alembic/versions/f9729800dad4_add_constraint_to_supplier_rate.py b/backend/app/alembic/versions/f9729800dad4_add_constraint_to_supplier_rate.py new file mode 100644 index 0000000000..90b1963718 --- /dev/null +++ b/backend/app/alembic/versions/f9729800dad4_add_constraint_to_supplier_rate.py @@ -0,0 +1,29 @@ +"""Add constraint to supplier_rate + +Revision ID: f9729800dad4 +Revises: a646d1eab4ab +Create Date: 2024-06-25 20:40:48.882094 + +""" +from alembic import op +import sqlalchemy as sa +import sqlmodel.sql.sqltypes + + +# revision identifiers, used by Alembic. +revision = 'f9729800dad4' +down_revision = 'a646d1eab4ab' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.create_unique_constraint('Supplier_Rate_Constraint', 'supplier_rate', ['authority_id', 'veh_group_id', 'circs_group_id', 'supplier_id']) + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_constraint('Supplier_Rate_Constraint', 'supplier_rate', type_='unique') + # ### end Alembic commands ### diff --git a/backend/app/api/routes/authorities.py b/backend/app/api/routes/authorities.py index a6efd05f5d..ad3d4fba04 100644 --- a/backend/app/api/routes/authorities.py +++ b/backend/app/api/routes/authorities.py @@ -64,6 +64,7 @@ def create_authority( session.add(authority) session.commit() session.refresh(authority) + return authority diff --git a/backend/app/api/routes/request.py b/backend/app/api/routes/request.py index 4048f32c30..7c6e4f0427 100644 --- a/backend/app/api/routes/request.py +++ b/backend/app/api/routes/request.py @@ -1,34 +1,66 @@ from typing import Any +import random from fastapi import APIRouter, HTTPException -from sqlmodel import func, select +from sqlmodel import func, select, desc, asc from app.api.deps import CurrentUser, SessionDep -from app.models import Referral, RequestCreate +from app.models import Referral, RequestCreate, Claim,Supplier_Stat router = APIRouter() @router.post("/") -def create_referral( +def create_request( *, session: SessionDep, current_user: CurrentUser, request_in: RequestCreate ) -> Any: """ + Create new request. """ - claim = Claim(client_firstname = request_in.client_firstname, client_lastname = request_in.client_lastname,authority_id = request_in.authority_id, owner_id = current_user.id ) + #### ADD CLAIM #### + claim = Claim.model_validate(request_in, + update={"owner_id": current_user.id, + "circs_grade_id" : random.randint(1,3), + "veh_group_id" : random.randint(1,2)} ) session.add(claim) session.commit() session.refresh(claim) - referral = Referral(claim_id = claim.id, type = request_in.type, source_id = request_in.source_id, owner_id = current_user.id ) + #### ADD Referral #### + referral = Referral.model_validate(request_in, + update={"owner_id": current_user.id, + "circs_group_id" : random.randint(1,3), + "veh_group_id" : random.randint(1,2), + "claim_id": claim.id}) session.add(referral) session.commit() session.refresh(referral) - return {"claim": claim.id, "referral": referral.id} + # Create the initial select statement + statement = select(Supplier_Stat).limit(1).order_by(desc(Supplier_Stat.total_rank)) + + # Conditionally add the WHERE clause + if referral.authority_id is not None: + statement = statement.where(Supplier_Stat.authority_id == referral.authority_id) + # Conditionally add the WHERE clause + if referral.circs_group_id is not None: + statement = statement.where(Supplier_Stat.circs_group_id == referral.circs_group_id) + # Conditionally add the WHERE clause + if referral.veh_group_id is None: + statement = statement.where(Supplier_Stat.veh_group_id == referral.veh_group_id) + final_query_text = str(statement) + + supplier = session.exec(statement).one() + + + + return {"Referral ID": referral.id, + "Supplier": supplier, + "query": print(final_query_text), + "Circs_grade":referral.circs_group_id} diff --git a/backend/app/api/routes/suppliers.py b/backend/app/api/routes/suppliers.py index 3399f3abf0..e16fd94083 100644 --- a/backend/app/api/routes/suppliers.py +++ b/backend/app/api/routes/suppliers.py @@ -1,10 +1,11 @@ from typing import Any from fastapi import APIRouter, HTTPException -from sqlmodel import func, select +from sqlmodel import func, select, insert +from sqlalchemy import text from app.api.deps import CurrentUser, SessionDep -from app.models import Supplier, SupplierCreate, SupplierPublic, SuppliersPublic, SupplierUpdate, Message +from app.models import Supplier, SupplierCreate, SupplierPublic, SuppliersPublic, SupplierUpdate, Supplier_Rate, Circs_Group, Authority,Message router = APIRouter() @@ -55,7 +56,7 @@ def read_supplier(session: SessionDep, current_user: CurrentUser, id: int) -> An @router.post("/", response_model=SupplierPublic) def create_supplier( - *, session: SessionDep, current_user: CurrentUser, supplier_in: SupplierCreate + *, session: SessionDep, current_user: CurrentUser,supplier_in: SupplierCreate ) -> Any: """ Create new supplier. @@ -64,6 +65,20 @@ def create_supplier( session.add(supplier) session.commit() session.refresh(supplier) + + insert_select_sql = text(""" + INSERT INTO supplier_rate (authority_id,circs_group_id,supplier_id, owner_id, veh_group_id, rate) + SELECT authority.id as authority_id, circs_group.id as circs_group_id, + :supplerid as supplier_id, :current_userid as owner_id, veh_group.id as veh_group_id, :rate as rate + FROM authority, circs_group, veh_group + ON CONFLICT ON CONSTRAINT supplier_rate_constraint + DO UPDATE SET + rate = EXCLUDED.rate;""") + + # Execute the raw SQL + session.execute(insert_select_sql, {'supplerid':supplier.id, 'current_userid':current_user.id, 'rate':supplier.base_rate}) + session.commit() + return supplier @@ -84,6 +99,20 @@ def update_supplier( session.add(supplier) session.commit() session.refresh(supplier) + + insert_select_sql = text(""" + INSERT INTO supplier_rate (authority_id,circs_group_id,supplier_id, owner_id, veh_group_id, rate) + SELECT authority.id as authority_id, circs_group.id as circs_group_id, + :supplerid as supplier_id, :current_userid as owner_id, veh_group.id as veh_group_id, :rate as rate + FROM authority, circs_group, veh_group + ON CONFLICT ON CONSTRAINT supplier_rate_constraint + DO UPDATE SET + rate = EXCLUDED.rate;""") + + # Execute the raw SQL + session.execute(insert_select_sql, {'supplerid':supplier.id, 'current_userid':current_user.id, 'rate':supplier.base_rate}) + session.commit() + return supplier diff --git a/backend/app/crud.py b/backend/app/crud.py index d8b96b8e3a..420324c785 100644 --- a/backend/app/crud.py +++ b/backend/app/crud.py @@ -115,9 +115,3 @@ def create_supplier_rate(*, session: Session, supplier_rate_in: SupplierCreate, session.refresh(db_supplier_rate) return db_supplier_rate -def create_claim(*, session: Session, claim_in: SupplierCreate, owner_id: int) -> Supplier: - db_claim = Supplier.model_validate(claim_in, update={"owner_id": owner_id}) - session.add(db_claim) - session.commit() - session.refresh(db_claim) - return db_claim \ No newline at end of file diff --git a/backend/app/models.py b/backend/app/models.py index bae101cf24..4c39f42d52 100644 --- a/backend/app/models.py +++ b/backend/app/models.py @@ -1,237 +1,204 @@ -from sqlmodel import Field, Relationship, SQLModel +from sqlmodel import Field, Relationship, SQLModel, UniqueConstraint from datetime import datetime, date, time import sqlalchemy as sa - +from typing import Optional + +class CreatedModifiedBase(): + created_datetime: datetime | None = Field( + default=None, + sa_type= sa.DateTime(timezone=True), + sa_column_kwargs={"server_default": sa.func.now()}, + nullable=False, + ) + updated_datetime: datetime | None = Field( + default=None, + sa_type= sa.DateTime(timezone=True), + sa_column_kwargs={"onupdate": sa.func.now(), "server_default": sa.func.now()} + ) + ##### users -# Shared properties -# TODO replace email str with EmailStr when sqlmodel supports it + # Shared properties + # TODO replace email str with EmailStr when sqlmodel supports it class UserBase(SQLModel): - email: str = Field(unique=True, index=True) - is_active: bool = True - is_superuser: bool = False - full_name: str | None = None + email: str = Field(unique=True, index=True) + is_active: bool = True + is_superuser: bool = False + full_name: str | None = None # Properties to receive via API on creation class UserCreate(UserBase): - password: str + password: str # TODO replace email str with EmailStr when sqlmodel supports it class UserRegister(SQLModel): - email: str - password: str - full_name: str | None = None + email: str + password: str + full_name: str | None = None # Properties to receive via API on update, all are optional # TODO replace email str with EmailStr when sqlmodel supports it class UserUpdate(UserBase): - email: str | None = None # type: ignore - password: str | None = None + email: str | None = None # type: ignore + password: str | None = None # TODO replace email str with EmailStr when sqlmodel supports it class UserUpdateMe(SQLModel): - full_name: str | None = None - email: str | None = None + full_name: str | None = None + email: str | None = None class UpdatePassword(SQLModel): - current_password: str - new_password: str + current_password: str + new_password: str # Database model, database table inferred from class name -class User(UserBase, table=True): - id: int | None = Field(default=None, primary_key=True) - hashed_password: str - source_id: int | None = Field(default=None, foreign_key="source.id", nullable=True) - created_datetime: datetime | None = Field( - default=None, - sa_type= sa.DateTime(timezone=True), - sa_column_kwargs={"server_default": sa.func.now()}, - nullable=False, - ) - updated_datetime: datetime | None = Field( - default=None, - sa_type= sa.DateTime(timezone=True), - sa_column_kwargs={"onupdate": sa.func.now(), "server_default": sa.func.now()}, - ) - items: list["Item"] = Relationship(back_populates="owner") - sources: list["Source"] = Relationship(back_populates="owner") - suppliers: list["Supplier"] = Relationship(back_populates="owner") - claims: list["Claim"] = Relationship(back_populates="owner") - authorities: list["Authority"] = Relationship(back_populates="owner") - circs_groups: list["Circs_Group"] = Relationship(back_populates="owner") - veh_groups: list["Veh_Group"] = Relationship(back_populates="owner") - supplier_rates: list["Supplier_Rate"] = Relationship(back_populates="owner") - source_rates: list["Source_Rate"] = Relationship(back_populates="owner") - referrals: list["Referral"] = Relationship(back_populates="owner") - referral_allocations: list["Referral_Allocation"] = Relationship(back_populates="owner") +class User(UserBase, CreatedModifiedBase,table=True): + id: int | None = Field(default=None, primary_key=True) + hashed_password: str + assigned_source_id: int | None = Field(default=None, foreign_key="source.id", nullable=True) + items: list["Item"] = Relationship(back_populates="owner") + ##sources: list["Source"] = Relationship(back_populates="owner") + suppliers: list["Supplier"] = Relationship(back_populates="owner") + claims: list["Claim"] = Relationship(back_populates="owner") + authorities: list["Authority"] = Relationship(back_populates="owner") + circs_groups: list["Circs_Group"] = Relationship(back_populates="owner") + veh_groups: list["Veh_Group"] = Relationship(back_populates="owner") + supplier_rates: list["Supplier_Rate"] = Relationship(back_populates="owner") + source_rates: list["Source_Rate"] = Relationship(back_populates="owner") + referrals: list["Referral"] = Relationship(back_populates="owner") + referral_allocations: list["Referral_Allocation"] = Relationship(back_populates="owner") + supplier_stats: list["Supplier_Stat"] = Relationship(back_populates="owner") + source: Optional["Source"] = Relationship(sa_relationship_kwargs={"foreign_keys": "User.assigned_source_id"}) + # Properties to return via API, id is always required class UserPublic(UserBase): - id: int + id: int class UsersPublic(SQLModel): - data: list[UserPublic] - count: int + data: list[UserPublic] + count: int -######## items +########################################## items ##################################################### # Shared properties class ItemBase(SQLModel): - title: str - description: str | None = None + title: str + description: str | None = None # Properties to receive on item creation class ItemCreate(ItemBase): - title: str + title: str # Properties to receive on item update class ItemUpdate(ItemBase): - title: str | None = None # type: ignore + title: str | None = None # type: ignore # Database model, database table inferred from class name -class Item(ItemBase, table=True): - id: int | None = Field(default=None, primary_key=True) - title: str - owner_id: int | None = Field(default=None, foreign_key="user.id", nullable=False) - owner: User | None = Relationship(back_populates="items") - created_datetime: datetime | None = Field( - default=None, - sa_type= sa.DateTime(timezone=True), - sa_column_kwargs={"server_default": sa.func.now()}, - nullable=False, - ) - updated_datetime: datetime | None = Field( - default=None, - sa_type= sa.DateTime(timezone=True), - sa_column_kwargs={"onupdate": sa.func.now(), "server_default": sa.func.now()}, - ) +class Item(ItemBase, CreatedModifiedBase,table=True): + id: int | None = Field(default=None, primary_key=True) + title: str + owner_id: int | None = Field(default=None, foreign_key="user.id", nullable=False) + owner: User | None = Relationship(back_populates="items") # Properties to return via API, id is always required class ItemPublic(ItemBase): - id: int - owner_id: int + id: int + owner_id: int class ItemsPublic(SQLModel): - data: list[ItemPublic] - count: int + data: list[ItemPublic] + count: int - ####### sources ####### + ########################################## sources ####### # Shared properties class SourceBase(SQLModel): - source_name: str + source_name: str # Properties to receive on source creation class SourceCreate(SourceBase): - source_name: str + pass # Properties to receive on source update class SourceUpdate(SourceBase): - source_name: str | None = None # type: ignore + source_name: str | None = None # type: ignore # Database model, database table inferred from class name -class Source(SourceBase, table=True): - id: int | None = Field(default=None, primary_key=True) - source_name: str - owner_id: int | None = Field(default=None, foreign_key="user.id", nullable=False) - owner: User | None = Relationship(back_populates="sources") - ## referrals: list["Referral"] = Relationship(back_populates="source") - ## source_rates: list["Source_Rate"] = Relationship(back_populates="source") - created_datetime: datetime | None = Field( - default=None, - sa_type= sa.DateTime(timezone=True), - sa_column_kwargs={"server_default": sa.func.now()}, - nullable=False, - ) - updated_datetime: datetime | None = Field( - default=None, - sa_type= sa.DateTime(timezone=True), - sa_column_kwargs={"onupdate": sa.func.now(), "server_default": sa.func.now()}, - ) +class Source(SourceBase, CreatedModifiedBase,table=True): + id: int | None = Field(default=None, primary_key=True) + owner_id: int | None = Field(default=None, foreign_key="user.id", nullable=False) + referrals: list["Referral"] = Relationship(back_populates="source") # Properties to return via API, id is always required class SourcePublic(SourceBase): - id: int - owner_id: int + id: int + source_name: str class SourcesPublic(SQLModel): - data: list[SourcePublic] - count: int + data: list[SourcePublic] + count: int ####### Suppliers ####### # Shared properties class SupplierBase(SQLModel): - name: str + name: str + address_1: str | None = None + address_town: str | None = None + address_postcode: str | None = None + base_rate: float + Email: str | None = None + Tel: int | None = None # Properties to receive on source creation class SupplierCreate(SupplierBase): - name: str + pass # Properties to receive on source update class SupplierUpdate(SupplierBase): - name: str | None = None # type: ignore + name: str | None = None + base_rate: float | None = None # Database model, database table inferred from class name -class Supplier(SupplierBase, table=True): - id: int | None = Field(default=None, primary_key=True) - owner_id: int | None = Field(default=None, foreign_key="user.id", nullable=False) - owner: User | None = Relationship(back_populates="suppliers") - ## referrals: list["Referral"] = Relationship(back_populates="supplier") - ## referral_allocations: list["Referral_Allocation"] = Relationship(back_populates="supplier") - name: str | None = None - address_1: str | None = None - address_town: str | None = None - address_postcode: str | None = None - created_datetime: datetime | None = Field( - default=None, - sa_type= sa.DateTime(timezone=True), - sa_column_kwargs={"server_default": sa.func.now()}, - nullable=False, - ) - updated_datetime: datetime | None = Field( - default=None, - sa_type= sa.DateTime(timezone=True), - sa_column_kwargs={"onupdate": sa.func.now(), "server_default": sa.func.now()}, - ) - - Email: str | None = None - Tel: int | None = None - +class Supplier(SupplierBase, CreatedModifiedBase,table=True): + id: int | None = Field(default=None, primary_key=True) + owner_id: int | None = Field(default=None, foreign_key="user.id", nullable=False) + owner: User | None = Relationship(back_populates="suppliers") + supplier_stats: list["Supplier_Stat"] = Relationship(back_populates="supplier") # Properties to return via API, id is always required class SupplierPublic(SupplierBase): - id: int - owner_id: int + id: int class SuppliersPublic(SQLModel): - data: list[SupplierPublic] - count: int + data: list[SupplierPublic] + count: int ######## Claim @@ -239,80 +206,89 @@ class SuppliersPublic(SQLModel): # Shared properties class ClaimBase(SQLModel): - client_firstname: str - client_lastname: str - authority_id: int - + client_firstname: str + client_lastname: str + client_address_1: str | None = None + client_address_town: str | None = None + client_address_postcode: str | None = None + client_vehicle_reg: str | None = None + client_insurer: str | None = None + client_insurer_policyno: str | None = None + client_phone: str | None = None + client_mobile: str | None = None + client_email: str | None = None + authority_id: int | None = Field(default=None, foreign_key="authority.id", nullable=False) + plate_type: str | None = None + accident_date: date | None = None + accident_time: time | None = None + accident_location: str | None = None + accident_circs: str | None = None + tp_firstname: str | None = None + tp_lastname: str | None = None + tp_address_1: str | None = None + tp_address_town: str | None = None + tp_address_postcode: str | None = None + tp_vehicle_reg: str | None = None + tp_insurer: str | None = None + tp_insurer_polcyno: str | None = None + tp_phone: str | None = None + tp_mobile: str | None = None + # Properties to receive on claim creation class ClaimCreate(ClaimBase): - client_firstname: str - client_lastname: str + pass # Properties to receive on claim update class ClaimUpdate(ClaimBase): - client_firstname: str | None = None # type: ignore - client_lastname: str | None = None # type: ignore + client_firstname: str | None = None + client_lastname: str | None = None + client_address_1: str | None = None + client_address_town: str | None = None + client_address_postcode: str | None = None + client_vehicle_reg: str | None = None + client_insurer: str | None = None + client_insurer_policyno: str | None = None + client_phone: str | None = None + client_mobile: str | None = None + client_email: str | None = None + authority_id: int | None = None + plate_type: str | None = None + accident_date: date | None = None + accident_time: time | None = None + accident_location: str | None = None + accident_circs: str | None = None + tp_firstname: str | None = None + tp_lastname: str | None = None + tp_address_1: str | None = None + tp_address_town: str | None = None + tp_address_postcode: str | None = None + tp_vehicle_reg: str | None = None + tp_insurer: str | None = None + tp_insurer_polcyno: str | None = None + tp_phone: str | None = None + tp_mobile: str | None = None # Database model, database table inferred from class name -class Claim(ClaimBase, table=True): - id: int | None = Field(default=None, primary_key=True) - owner_id: int | None = Field(default=None, foreign_key="user.id", nullable=False) - owner: User | None = Relationship(back_populates="claims") - ##referrals: list["Referral"] = Relationship(back_populates="claim") - client_firstname: str | None = None - client_lastname: str | None = None - client_address_1: str | None = None - client_address_town: str | None = None - client_address_postcode: str | None = None - client_vehicle_reg: str | None = None - client_insurer: str | None = None - client_insurer_policyno: str | None = None - client_phone: str | None = None - client_mobile: str | None = None - client_email: str | None = None - created_datetime: datetime | None = Field( - default=None, - sa_type= sa.DateTime(timezone=True), - sa_column_kwargs={"server_default": sa.func.now()}, - nullable=False, - ) - updated_datetime: datetime | None = Field( - default=None, - sa_type= sa.DateTime(timezone=True), - sa_column_kwargs={"onupdate": sa.func.now(), "server_default": sa.func.now()}, - ) - authority_id: int | None = Field(default=None, foreign_key="authority.id", nullable=False) - plate_type: str | None = None - accident_date: date | None = None - accident_time: time | None = None - accident_location: str | None = None - accident_circs: str | None = None - tp_firstname: str | None = None - tp_lastname: str | None = None - tp_address_1: str | None = None - tp_address_town: str | None = None - tp_address_postcode: str | None = None - tp_vehicle_reg: str | None = None - tp_insurer: str | None = None - tp_insurer_polcyno: str | None = None - tp_phone: str | None = None - tp_mobile: str | None = None +class Claim(ClaimBase, CreatedModifiedBase,table=True): + id: int | None = Field(default=None, primary_key=True) + owner_id: int | None = Field(default=None, foreign_key="user.id", nullable=False) + owner: User | None = Relationship(back_populates="claims") # Properties to return via API, id is always required class ClaimPublic(ClaimBase): - id: int + id: int class ClaimsPublic(SQLModel): - data: list[ClaimPublic] - count: int + data: list[ClaimPublic] + count: int ######## Authority @@ -320,102 +296,76 @@ class ClaimsPublic(SQLModel): # Shared properties class AuthorityBase(SQLModel): - name: str + name: str | None = None # Properties to receive on authority creation class AuthorityCreate(AuthorityBase): - name: str + pass # Properties to receive on authority update class AuthorityUpdate(AuthorityBase): - name: str | None = None # type: ignore + name: str | None = None # type: ignore # Database model, database table inferred from class name -class Authority(AuthorityBase, table=True): - id: int | None = Field(default=None, primary_key=True) - owner_id: int | None = Field(default=None, foreign_key="user.id", nullable=False) - owner: User | None = Relationship(back_populates="authorities") - created_datetime: datetime | None = Field( - default=None, - sa_type= sa.DateTime(timezone=True), - sa_column_kwargs={"server_default": sa.func.now()}, - ) - updated_datetime: datetime | None = Field( - default=None, - sa_type= sa.DateTime(timezone=True), - sa_column_kwargs={"onupdate": sa.func.now(), "server_default": sa.func.now()}, - ) - name: str | None = None - - - +class Authority(AuthorityBase, CreatedModifiedBase,table=True): + id: int | None = Field(default=None, primary_key=True) + owner_id: int | None = Field(default=None, foreign_key="user.id", nullable=False) + owner: User | None = Relationship(back_populates="authorities") + # Properties to return via API, id is always required class AuthorityPublic(AuthorityBase): - id: int - owner_id: int + id: int + owner_id: int class AuthoritiesPublic(SQLModel): - data: list[AuthorityPublic] - count: int + data: list[AuthorityPublic] + count: int - ######## Circs_Group +######## Circs_Group # Shared properties class Circs_GroupBase(SQLModel): - group: str - desc: str + group: str + desc: str # Properties to receive on circs_group creation class Circs_GroupCreate(Circs_GroupBase): - group: str - desc: str + group: str + desc: str # Properties to receive on circs_group update class Circs_GroupUpdate(Circs_GroupBase): - group: str | None = None # type: ignore - desc: str | None = None # type: ignore + group: str | None = None # type: ignore + desc: str | None = None # type: ignore # Database model, database table inferred from class name -class Circs_Group(Circs_GroupBase, table=True): - id: int | None = Field(default=None, primary_key=True) - owner_id: int | None = Field(default=None, foreign_key="user.id", nullable=False) - owner: User | None = Relationship(back_populates="circs_groups") - created_datetime: datetime | None = Field( - default=None, - sa_type= sa.DateTime(timezone=True), - sa_column_kwargs={"server_default": sa.func.now()}, - nullable=False, - ) - updated_datetime: datetime | None = Field( - default=None, - sa_type= sa.DateTime(timezone=True), - sa_column_kwargs={"onupdate": sa.func.now(), "server_default": sa.func.now()}, - ) - group: str | None = None - desc: str | None = None +class Circs_Group(Circs_GroupBase, CreatedModifiedBase,table=True): + id: int | None = Field(default=None, primary_key=True) + owner_id: int | None = Field(default=None, foreign_key="user.id", nullable=False) + owner: User | None = Relationship(back_populates="circs_groups") # Properties to return via API, id is always required class Circs_GroupPublic(Circs_GroupBase): - id: int - owner_id: int + id: int + owner_id: int class Circs_GroupsPublic(SQLModel): - data: list[Circs_GroupPublic] - count: int + data: list[Circs_GroupPublic] + count: int ######## Veh_Group @@ -423,224 +373,195 @@ class Circs_GroupsPublic(SQLModel): # Shared properties class Veh_GroupBase(SQLModel): - group: str - desc: str + group: str | None = None + desc: str | None = None # Properties to receive on veh_group creation class Veh_GroupCreate(Veh_GroupBase): - group: str - desc: str + pass # Properties to receive on veh_group update class Veh_GroupUpdate(Veh_GroupBase): - group: str | None = None # type: ignore - desc: str | None = None # type: ignore + group: str | None = None # type: ignore + desc: str | None = None # type: ignore # Database model, database table inferred from class name -class Veh_Group(Veh_GroupBase, table=True): - id: int | None = Field(default=None, primary_key=True) - owner_id: int | None = Field(default=None, foreign_key="user.id", nullable=False) - owner: User | None = Relationship(back_populates="veh_groups") - created_datetime: datetime | None = Field( - default=None, - sa_type= sa.DateTime(timezone=True), - sa_column_kwargs={"server_default": sa.func.now()}, - nullable=False, - ) - updated_datetime: datetime | None = Field( - default=None, - sa_type= sa.DateTime(timezone=True), - sa_column_kwargs={"onupdate": sa.func.now(), "server_default": sa.func.now()}, - ) - group: str | None = None - desc: str | None = None +class Veh_Group(Veh_GroupBase, CreatedModifiedBase,table=True): + id: int | None = Field(default=None, primary_key=True) + owner_id: int | None = Field(default=None, foreign_key="user.id", nullable=False) + owner: User | None = Relationship(back_populates="veh_groups") + # Properties to return via API, id is always required class Veh_GroupPublic(Veh_GroupBase): - id: int - owner_id: int + id: int + owner_id: int class Veh_GroupsPublic(SQLModel): - data: list[Veh_GroupPublic] - count: int + data: list[Veh_GroupPublic] + count: int ######## Supplier_Rate # Shared properties class Supplier_RateBase(SQLModel): - rate: float + authority_id: int | None = Field(default=None, foreign_key="authority.id", nullable=False) + plate_type: str | None = None + veh_group_id: int | None = Field(default=None, foreign_key="veh_group.id", nullable=False) + circs_group_id: int | None = Field(default=None, foreign_key="circs_group.id", nullable=False) + type: str | None = None + rate: float | None = None + hire_length: int | None = None + supplier_id: int | None = Field(default=None, foreign_key="supplier.id", nullable=False) + # Properties to receive on supplier_rate creation class Supplier_RateCreate(Supplier_RateBase): - rate: float + pass # Properties to receive on supplier_rate update class Supplier_RateUpdate(Supplier_RateBase): - rate: float | None = None # type: ignore + authority_id: int | None = None + plate_type: str | None = None + veh_group_id: int | None = None + circs_group_id: int | None = None + type: str | None = None + rate: float | None = None + hire_length: int | None = None + supplier_id: int | None = None # Database model, database table inferred from class name -class Supplier_Rate(Supplier_RateBase, table=True): - id: int | None = Field(default=None, primary_key=True) - owner_id: int | None = Field(default=None, foreign_key="user.id", nullable=False) - owner: User | None = Relationship(back_populates="supplier_rates") - created_datetime: datetime | None = Field( - default=None, - sa_type= sa.DateTime(timezone=True), - sa_column_kwargs={"server_default": sa.func.now()}, - nullable=False, - ) - updated_datetime: datetime | None = Field( - default=None, - sa_type= sa.DateTime(timezone=True), - sa_column_kwargs={"onupdate": sa.func.now(), "server_default": sa.func.now()}, - ) - authority_id: int | None = Field(default=None, foreign_key="authority.id", nullable=False) - plate_type: str | None = None - veh_group_id: int | None = Field(default=None, foreign_key="veh_group.id", nullable=False) - circs_group_id: int | None = Field(default=None, foreign_key="circs_group.id", nullable=False) - type: str | None = None - rate: float | None = None - hire_length: int | None = None - supplier_id: int | None = Field(default=None, foreign_key="supplier.id", nullable=False) +class Supplier_Rate(Supplier_RateBase, CreatedModifiedBase,table=True): + __table_args__ = ( + UniqueConstraint("authority_id", "veh_group_id", "circs_group_id","supplier_id", name="supplier_rate_constraint"), + ) + id: int | None = Field(default=None, primary_key=True) + owner_id: int | None = Field(default=None, foreign_key="user.id", nullable=False) + owner: User | None = Relationship(back_populates="supplier_rates") + rate_override: str | None = Field(default = 'No', sa_column_kwargs={"server_default": "No"}) # Properties to return via API, id is always required class Supplier_RatePublic(Supplier_RateBase): - id: int - owner_id: int + id: int + owner_id: int class Supplier_RatesPublic(SQLModel): - data: list[Supplier_RatePublic] - count: int + data: list[Supplier_RatePublic] + count: int - ######## Referral +#################################### Referral ############################################ # Shared properties class ReferralBase(SQLModel): - source_id: int - claim_id: int + source_id: int | None = Field(default=None, foreign_key="source.id", nullable=False) + claim_id: int | None = Field(default=None, foreign_key="claim.id", nullable=False) + supplier_id: int | None = Field(default=None, foreign_key="supplier.id", nullable=True) + type: str | None = None + authority_id: int | None = Field(default=None, foreign_key="authority.id", nullable=True) # Properties to receive on referral creation class ReferralCreate(ReferralBase): - source_id: int - claim_id: int + pass # Properties to receive on referral update class ReferralUpdate(ReferralBase): - source_id: int | None = None # type: ignore + source_id: int | None = None + claim_id: int | None = None + supplier_id: int | None = None + type: str | None = None + daystohire: int | None = None + creditrepair: str | None = None + authority_id: int | None = None # Database model, database table inferred from class name -class Referral(ReferralBase, table=True): - id: int | None = Field(default=None, primary_key=True) - owner_id: int | None = Field(default=None, foreign_key="user.id", nullable=False) - owner: User | None = Relationship(back_populates="referrals") - created_datetime: datetime | None = Field( - default=None, - sa_type= sa.DateTime(timezone=True), - sa_column_kwargs={"server_default": sa.func.now()}, - nullable=False, - ) - updated_datetime: datetime | None = Field( - default=None, - sa_type= sa.DateTime(timezone=True), - sa_column_kwargs={"onupdate": sa.func.now(), "server_default": sa.func.now()}, - ) - source_id: int | None = Field(default=None, foreign_key="source.id", nullable=False) - source: Source | None = Relationship(back_populates="referrals") - claim_id: int | None = Field(default=None, foreign_key="claim.id", nullable=False) - ##claim: Claim | None = Relationship(back_populates="referrals") - supplier_id: int | None = Field(default=None, foreign_key="supplier.id", nullable=True) - ##supplier: Supplier | None = Relationship(back_populates="referrals") - type: str | None = None - ##referral_allocations: list["Referral_Allocation"] = Relationship(back_populates="referral") +class Referral(ReferralBase, CreatedModifiedBase,table=True): + id: int | None = Field(default=None, primary_key=True) + owner_id: int | None = Field(default=None, foreign_key="user.id", nullable=False) + owner: User | None = Relationship(back_populates="referrals") + source: Source | None = Relationship(back_populates="referrals") + daystohire: int | None = None + creditrepair: str | None = None + circs_group_id: int | None = Field(default=None, foreign_key="circs_group.id", nullable=True) + veh_group_id: int | None = Field(default=None, foreign_key="veh_group.id", nullable=True) # Properties to return via API, id is always required class ReferralPublic(ReferralBase): - id: int - owner_id: int - source_id: int + id: int + source: Source class ReferralsPublic(SQLModel): - data: list[ReferralPublic] - count: int + data: list[ReferralPublic] + count: int - ######## Referral_Allocation +##################################### Referral_Allocation ################################ # Shared properties class Referral_AllocationBase(SQLModel): - Source: str + supplier_id: int | None = Field(default=None, foreign_key="supplier.id", nullable=False) + referral_id: int | None = Field(default=None, foreign_key="referral.id", nullable=False) + sentdate: datetime | None = None + status: str | None = None + responsedate: datetime | None = None # Properties to receive on referral_allocation creation class Referral_AllocationCreate(Referral_AllocationBase): - Source: str + supplier_id: int + referral_id: int + sentdate: datetime + status: str + responsedate: datetime | None = None # Properties to receive on referral_allocation update class Referral_AllocationUpdate(Referral_AllocationBase): - Source: str | None = None # type: ignore + supplier_id: int | None = None + referral_id: int | None = None + sentdate: datetime | None = None + status: str | None = None # Database model, database table inferred from class name -class Referral_Allocation(Referral_AllocationBase, table=True): - id: int | None = Field(default=None, primary_key=True) - owner_id: int | None = Field(default=None, foreign_key="user.id", nullable=False) - owner: User | None = Relationship(back_populates="referral_allocations") - created_datetime: datetime | None = Field( - default=None, - sa_type= sa.DateTime(timezone=True), - sa_column_kwargs={"server_default": sa.func.now()}, - nullable=False, - ) - updated_datetime: datetime | None = Field( - default=None, - sa_type= sa.DateTime(timezone=True), - sa_column_kwargs={"onupdate": sa.func.now(), "server_default": sa.func.now()}, - ) - supplier_id: int | None = Field(default=None, foreign_key="supplier.id", nullable=False) - ##supplier: Supplier | None = Relationship(back_populates="referral_allocations") - referral_id: int | None = Field(default=None, foreign_key="referral.id", nullable=False) - ##referral: Referral | None = Relationship(back_populates="referral_allocations") - sentdate: datetime | None = None - status: str | None = None - responsedate: datetime | None = None - - +class Referral_Allocation(Referral_AllocationBase, CreatedModifiedBase,table=True): + id: int | None = Field(default=None, primary_key=True) + owner_id: int | None = Field(default=None, foreign_key="user.id", nullable=False) + owner: User | None = Relationship(back_populates="referral_allocations") # Properties to return via API, id is always required class Referral_AllocationPublic(Referral_AllocationBase): - id: int - owner_id: int + id: int + owner_id: int class Referral_AllocationsPublic(SQLModel): - data: list[Referral_AllocationPublic] - count: int + data: list[Referral_AllocationPublic] + count: int ######## Source_Rates @@ -648,91 +569,175 @@ class Referral_AllocationsPublic(SQLModel): # Shared properties class Source_RateBase(SQLModel): - rate: float + authority_id: int | None = Field(default=None, foreign_key="authority.id", nullable=False) + plate_type: str | None = None + veh_group_id: int | None = Field(default=None, foreign_key="veh_group.id", nullable=False) + circs_group_id: int | None = Field(default=None, foreign_key="circs_group.id", nullable=False) + type: str | None = None + rate: float | None = None + hire_length: int | None = None + source_id: int | None = Field(default=None, foreign_key="source.id", nullable=False) # Properties to receive on source_rate creation class Source_RateCreate(Source_RateBase): - rate: float + pass # Properties to receive on source_rate update class Source_RateUpdate(Source_RateBase): - rate: float | None = None # type: ignore + authority_id: int | None = None + plate_type: str | None = None + veh_group_id: int | None = None + circs_group_id: int | None = None + type: str | None = None + rate: float | None = None + hire_length: int | None = None + source_id: int | None = None # Database model, database table inferred from class name -class Source_Rate(Source_RateBase, table=True): - id: int | None = Field(default=None, primary_key=True) - owner_id: int | None = Field(default=None, foreign_key="user.id", nullable=False) - owner: User | None = Relationship(back_populates="source_rates") - created_datetime: datetime | None = Field( - default=None, - sa_type= sa.DateTime(timezone=True), - sa_column_kwargs={"server_default": sa.func.now()}, - nullable=False, - ) - updated_datetime: datetime | None = Field( - default=None, - sa_type= sa.DateTime(timezone=True), - sa_column_kwargs={"onupdate": sa.func.now(), "server_default": sa.func.now()}, - ) - authority_id: int | None = Field(default=None, foreign_key="authority.id", nullable=False) - plate_type: str | None = None - veh_group_id: int | None = Field(default=None, foreign_key="veh_group.id", nullable=False) - circs_group_id: int | None = Field(default=None, foreign_key="circs_group.id", nullable=False) - type: str | None = None - rate: float | None = None - hire_length: int | None = None - source_id: int | None = Field(default=None, foreign_key="source.id", nullable=False) - ##source: Source | None = Relationship(back_populates="source_rates") - +class Source_Rate(Source_RateBase, CreatedModifiedBase,table=True): + id: int | None = Field(default=None, primary_key=True) + owner_id: int | None = Field(default=None, foreign_key="user.id", nullable=False) + owner: User | None = Relationship(back_populates="source_rates") # Properties to return via API, id is always required class Source_RatePublic(Source_RateBase): - id: int - owner_id: int + pass + class Source_RatesPublic(SQLModel): - data: list[Source_RatePublic] - count: int + data: list[Source_RatePublic] + count: int +####### Supplier_stats + + +# Shared properties +class Supplier_StatBase(SQLModel): + authority_id: int | None = Field(default=None, foreign_key="authority.id", nullable=True) + plate_type: str | None = None + veh_group_id: int | None = Field(default=None, foreign_key="veh_group.id", nullable=True) + circs_group_id: int | None = Field(default=None, foreign_key="circs_group.id", nullable=True) + rate: float | None = None + rate_rank: int | None = None + hire_length: int | None = None + supplier_id: int | None = Field(default=None, foreign_key="supplier.id", nullable=True) + daystohire: int | None = None + daystohire_rank: int | None = None + conversion: int | None = None + conversion_rank: int | None = None + total_rank: int | None = None + + +# Properties to receive on supplier_stat creation +class Supplier_StatCreate(Supplier_StatBase): + pass + + +# Properties to receive on supplier_stat update +class Supplier_StatUpdate(Supplier_StatBase): + authority_id: int | None = None # type: ignore + plate_type: str | None = None # type: ignore + veh_group_id: int | None = None # type: ignore + circs_group_id: int | None = None # type: ignore + rate: float | None = None # type: ignore + rate_rank: int | None = None + hire_length: int | None = None # type: ignore + supplier_id: int | None = None # type: ignore + daystohire: int | None = None + daystohire_rank: int | None = None + conversion: int | None = None + conversion_rank: int | None = None + total_rank: int | None = None + + + +# Database model, database table inferred from class name +class Supplier_Stat(Supplier_StatBase, CreatedModifiedBase,table=True): + __table_args__ = ( + UniqueConstraint("authority_id", "veh_group_id", "circs_group_id","supplier_id", name="supplier_stat_constraint"), + ) + id: int | None = Field(default=None, primary_key=True) + owner_id: int | None = Field(default=None, foreign_key="user.id", nullable=True) + owner: User | None = Relationship(back_populates="supplier_stats") + supplier: Supplier | None = Relationship(back_populates="supplier_stats") -class RequestBase(SQLModel): - type : str - source_id: int - client_firstname : str - client_lastname : str - authority_id : int -class RequestCreate(SQLModel): - type : str - source_id: int - client_firstname : str - client_lastname : str - authority_id : int +# Properties to return via API, id is always required +class Supplier_StatPublic(Supplier_StatBase): + id: int + owner_id: int + + +class Supplier_StatsPublic(SQLModel): + data: list[Supplier_StatPublic] + count: int + + + +class RequestBase(SQLModel): + source_id: int + type: str | None = None + daystohire: int | None = None + creditrepair: str | None = None + authority_id: int | None = None + client_firstname: str + client_lastname: str + client_address_1: str | None = None + client_address_town: str | None = None + client_address_postcode: str | None = None + client_vehicle_reg: str | None = None + client_insurer: str | None = None + client_insurer_policyno: str | None = None + client_phone: str | None = None + client_mobile: str | None = None + client_email: str | None = None + authority_id: int | None = None + plate_type: str | None = None + accident_date: date | None = None + accident_time: time | None = None + accident_location: str | None = None + accident_circs: str | None = None + tp_firstname: str | None = None + tp_lastname: str | None = None + tp_address_1: str | None = None + tp_address_town: str | None = None + tp_address_postcode: str | None = None + tp_vehicle_reg: str | None = None + tp_insurer: str | None = None + tp_insurer_polcyno: str | None = None + tp_phone: str | None = None + tp_mobile: str | None = None + circs_grade_id: int | None = None + veh_group_id: int | None = None + circs_group_id: int | None = None + +class RequestCreate(RequestBase): + pass # Generic message class Message(SQLModel): - message: str + message: str # JSON payload containing access token class Token(SQLModel): - access_token: str - token_type: str = "bearer" + access_token: str + token_type: str = "bearer" # Contents of JWT token class TokenPayload(SQLModel): - sub: int | None = None + sub: int | None = None class NewPassword(SQLModel): - token: str - new_password: str + token: str + new_password: str diff --git a/backend/importstuff/import_referralallocations.py b/backend/importstuff/import_referralallocations.py new file mode 100644 index 0000000000..bbd70ef9ee --- /dev/null +++ b/backend/importstuff/import_referralallocations.py @@ -0,0 +1,42 @@ +import requests +import json +import random +from datetime import datetime, timedelta + +# Constants +num_records = 100 +referral_id_range = range(22, 48) # 22 to 47 inclusive +supplier_id_choices = [26, 27] + list(range(53, 58)) # 26, 27, 53, 54, 55, 56, 57 +statuses = ["pending", "accepted", "rejected"] +yesterday = datetime.now() - timedelta(days=1) + +# Function to generate a single record +def generate_record(): + referral_id = random.choice(referral_id_range) + supplier_id = random.choice(supplier_id_choices) + sentdate = yesterday.isoformat() + status = random.choice(statuses) + responsedate = (yesterday + timedelta(days=random.randint(2, 3))).isoformat() + + return { + "supplier_id": supplier_id, + "referral_id": referral_id, + "sentdate": sentdate, + "status": status, + "responsedate": responsedate + } + +# Generate the records +records = [generate_record() for _ in range(num_records)] + +# The API endpoint and authorization token +url = "http://localhost/api/v1/referrals_allocations/" +headers = { + "Authorization": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MjAxMDg3ODAsInN1YiI6IjEifQ.KOXSFwOpyxeavuFn8pqym6WbrmxVfEUOxBhmpZ60L-E", + "Content-Type": "application/json" +} + +# Loop through each dictionary in the list and send it as a POST request +for entry in records: + response = requests.post(url, json=entry, headers=headers) + print(f"Status Code: {response.status_code}, Response: {response.json()}") \ No newline at end of file diff --git a/backend/importstuff/importrequests.py b/backend/importstuff/importrequests.py new file mode 100644 index 0000000000..1833f8d6e3 --- /dev/null +++ b/backend/importstuff/importrequests.py @@ -0,0 +1,809 @@ +import requests + +# The provided JSON data +data = [ + { + "source_id": 7, + "type": "Taxi", + "daystohire": 7, + "creditrepair": "Yes", + "authority_id": 8, + "client_firstname": "John", + "client_lastname": "Doe", + "client_address_1": "123 Elm Street", + "client_address_town": "Springfield", + "client_address_postcode": "SP1 2AB", + "client_vehicle_reg": "AB12CDE", + "client_insurer": "Acme Insurance", + "client_insurer_policyno": "POL1234567", + "client_phone": "0123456789", + "client_mobile": "07123456789", + "client_email": "john.doe@example.com", + "plate_type": "Private", + "accident_date": "2024-06-27", + "accident_time": "09:33:34.413Z", + "accident_location": "456 Oak Avenue", + "accident_circs": "Rear-end collision", + "tp_firstname": "Jane", + "tp_lastname": "Smith", + "tp_address_1": "789 Pine Road", + "tp_address_town": "Shelbyville", + "tp_address_postcode": "SH1 3CD", + "tp_vehicle_reg": "XY34ZRT", + "tp_insurer": "Umbrella Corp Insurance", + "tp_insurer_polcyno": "POL7654321", + "tp_phone": "0987654321", + "tp_mobile": "07876543210" + }, + { + "source_id": 14, + "type": "Taxi", + "daystohire": 8, + "creditrepair": "No", + "authority_id": 7, + "client_firstname": "Alice", + "client_lastname": "Brown", + "client_address_1": "456 Maple Street", + "client_address_town": "Greenfield", + "client_address_postcode": "GF2 3HJ", + "client_vehicle_reg": "CD34EFG", + "client_insurer": "Beta Insurance", + "client_insurer_policyno": "POL2345678", + "client_phone": "0234567890", + "client_mobile": "07234567890", + "client_email": "alice.brown@example.com", + "plate_type": "Commercial", + "accident_date": "2024-06-26", + "accident_time": "10:22:41.527Z", + "accident_location": "789 Cedar Avenue", + "accident_circs": "Side collision", + "tp_firstname": "Bob", + "tp_lastname": "Jones", + "tp_address_1": "123 Oak Lane", + "tp_address_town": "Clearwater", + "tp_address_postcode": "CW4 5KL", + "tp_vehicle_reg": "GH56IJK", + "tp_insurer": "Gamma Insurance", + "tp_insurer_polcyno": "POL8765432", + "tp_phone": "0456789012", + "tp_mobile": "07987654321" + }, + { + "source_id": 21, + "type": "Taxi", + "daystohire": 5, + "creditrepair": "Yes", + "authority_id": 8, + "client_firstname": "Charlie", + "client_lastname": "Davis", + "client_address_1": "789 Pine Street", + "client_address_town": "Hilltop", + "client_address_postcode": "HT3 6MN", + "client_vehicle_reg": "EF78HIJ", + "client_insurer": "Delta Insurance", + "client_insurer_policyno": "POL3456789", + "client_phone": "0345678901", + "client_mobile": "07345678901", + "client_email": "charlie.davis@example.com", + "plate_type": "Private", + "accident_date": "2024-06-25", + "accident_time": "11:11:11.111Z", + "accident_location": "321 Birch Boulevard", + "accident_circs": "Hit and run", + "tp_firstname": "David", + "tp_lastname": "Williams", + "tp_address_1": "456 Elm Lane", + "tp_address_town": "Riverside", + "tp_address_postcode": "RS5 7OP", + "tp_vehicle_reg": "IJ90KLM", + "tp_insurer": "Epsilon Insurance", + "tp_insurer_polcyno": "POL9876543", + "tp_phone": "0567890123", + "tp_mobile": "07123456789" + }, + { + "source_id": 11, + "type": "Taxi", + "daystohire": 10, + "creditrepair": "No", + "authority_id": 7, + "client_firstname": "Diana", + "client_lastname": "Evans", + "client_address_1": "321 Birch Street", + "client_address_town": "Riverwood", + "client_address_postcode": "RW8 9QR", + "client_vehicle_reg": "GH12JKL", + "client_insurer": "Epsilon Insurance", + "client_insurer_policyno": "POL4567890", + "client_phone": "0456789012", + "client_mobile": "07456789012", + "client_email": "diana.evans@example.com", + "plate_type": "Commercial", + "accident_date": "2024-06-24", + "accident_time": "12:22:33.444Z", + "accident_location": "654 Maple Avenue", + "accident_circs": "Rear-end collision", + "tp_firstname": "Emily", + "tp_lastname": "Johnson", + "tp_address_1": "789 Oak Road", + "tp_address_town": "Hillview", + "tp_address_postcode": "HV6 8QR", + "tp_vehicle_reg": "KL12MNO", + "tp_insurer": "Zeta Insurance", + "tp_insurer_polcyno": "POL7654321", + "tp_phone": "0678901234", + "tp_mobile": "07234567890" + }, + { + "source_id": 8, + "type": "Taxi", + "daystohire": 3, + "creditrepair": "Yes", + "authority_id": 8, + "client_firstname": "Edward", + "client_lastname": "Brown", + "client_address_1": "654 Maple Street", + "client_address_town": "Clearwater", + "client_address_postcode": "CW2 4TU", + "client_vehicle_reg": "MN12OPQ", + "client_insurer": "Gamma Insurance", + "client_insurer_policyno": "POL5678901", + "client_phone": "0678901234", + "client_mobile": "07345678901", + "client_email": "edward.brown@example.com", + "plate_type": "Private", + "accident_date": "2024-06-23", + "accident_time": "13:33:44.555Z", + "accident_location": "987 Pine Lane", + "accident_circs": "Side collision", + "tp_firstname": "Frank", + "tp_lastname": "Thompson", + "tp_address_1": "123 Elm Avenue", + "tp_address_town": "Greenwood", + "tp_address_postcode": "GW4 5TU", + "tp_vehicle_reg": "OP34QRS", + "tp_insurer": "Theta Insurance", + "tp_insurer_polcyno": "POL6543210", + "tp_phone": "0789012345", + "tp_mobile": "07456789012" + }, + { + "source_id": 17, + "type": "Taxi", + "daystohire": 9, + "creditrepair": "No", + "authority_id": 7, + "client_firstname": "Fiona", + "client_lastname": "Green", + "client_address_1": "789 Oak Street", + "client_address_town": "Shelbyville", + "client_address_postcode": "SH5 6WX", + "client_vehicle_reg": "QR56STU", + "client_insurer": "Theta Insurance", + "client_insurer_policyno": "POL6789012", + "client_phone": "0789012345", + "client_mobile": "07567890123", + "client_email": "fiona.green@example.com", + "plate_type": "Commercial", + "accident_date": "2024-06-22", + "accident_time": "14:44:55.666Z", + "accident_location": "321 Birch Lane", + "accident_circs": "Hit and run", + "tp_firstname": "George", + "tp_lastname": "White", + "tp_address_1": "654 Maple Road", + "tp_address_town": "Riverwood", + "tp_address_postcode": "RW7 8YZ", + "tp_vehicle_reg": "ST78UVW", + "tp_insurer": "Lambda Insurance", + "tp_insurer_polcyno": "POL5432109", + "tp_phone": "0890123456", + "tp_mobile": "07678901234" + }, + { + "source_id": 3, + "type": "Taxi", + "daystohire": 6, + "creditrepair": "Yes", + "authority_id": 8, + "client_firstname": "George", + "client_lastname": "Harris", + "client_address_1": "321 Birch Street", + "client_address_town": "Hilltop", + "client_address_postcode": "HT8 9QR", + "client_vehicle_reg": "VW90XYZ", + "client_insurer": "Zeta Insurance", + "client_insurer_policyno": "POL7890123", + "client_phone": "0890123456", + "client_mobile": "07789012345", + "client_email": "george.harris@example.com", + "plate_type": "Private", + "accident_date": "2024-06-21", + "accident_time": "15:55:11.777Z", + "accident_location": "987 Pine Boulevard", + "accident_circs": "Rear-end collision", + "tp_firstname": "Hannah", + "tp_lastname": "Martinez", + "tp_address_1": "123 Elm Lane", + "tp_address_town": "Springfield", + "tp_address_postcode": "SP4 5WX", + "tp_vehicle_reg": "XY12ABC", + "tp_insurer": "Alpha Insurance", + "tp_insurer_polcyno": "POL4321098", + "tp_phone": "0901234567", + "tp_mobile": "07890123456" + }, + { + "source_id": 12, + "type": "Taxi", + "daystohire": 4, + "creditrepair": "No", + "authority_id": 7, + "client_firstname": "Hannah", + "client_lastname": "Martinez", + "client_address_1": "654 Maple Street", + "client_address_town": "Riverside", + "client_address_postcode": "RS2 3HJ", + "client_vehicle_reg": "ABC34DEF", + "client_insurer": "Beta Insurance", + "client_insurer_policyno": "POL8901234", + "client_phone": "0901234567", + "client_mobile": "07901234567", + "client_email": "hannah.martinez@example.com", + "plate_type": "Commercial", + "accident_date": "2024-06-20", + "accident_time": "16:11:22.888Z", + "accident_location": "321 Birch Avenue", + "accident_circs": "Side collision", + "tp_firstname": "Ian", + "tp_lastname": "Lewis", + "tp_address_1": "789 Pine Lane", + "tp_address_town": "Hillview", + "tp_address_postcode": "HV5 6WX", + "tp_vehicle_reg": "DEF56GHI", + "tp_insurer": "Gamma Insurance", + "tp_insurer_polcyno": "POL3210987", + "tp_phone": "0123456789", + "tp_mobile": "07012345678" + }, + { + "source_id": 26, + "type": "Taxi", + "daystohire": 7, + "creditrepair": "Yes", + "authority_id": 8, + "client_firstname": "Ivy", + "client_lastname": "Nelson", + "client_address_1": "987 Pine Street", + "client_address_town": "Clearwater", + "client_address_postcode": "CW1 2AB", + "client_vehicle_reg": "GHI78JKL", + "client_insurer": "Delta Insurance", + "client_insurer_policyno": "POL9012345", + "client_phone": "0123456789", + "client_mobile": "07123456789", + "client_email": "ivy.nelson@example.com", + "plate_type": "Private", + "accident_date": "2024-06-19", + "accident_time": "17:22:33.999Z", + "accident_location": "654 Maple Boulevard", + "accident_circs": "Hit and run", + "tp_firstname": "Jack", + "tp_lastname": "Robinson", + "tp_address_1": "321 Birch Lane", + "tp_address_town": "Greenfield", + "tp_address_postcode": "GF4 5WX", + "tp_vehicle_reg": "GHI90JKL", + "tp_insurer": "Zeta Insurance", + "tp_insurer_polcyno": "POL2109876", + "tp_phone": "0345678901", + "tp_mobile": "07234567890" + }, + { + "source_id": 9, + "type": "Taxi", + "daystohire": 10, + "creditrepair": "No", + "authority_id": 7, + "client_firstname": "Jack", + "client_lastname": "Robinson", + "client_address_1": "654 Maple Street", + "client_address_town": "Hilltop", + "client_address_postcode": "HT1 2CD", + "client_vehicle_reg": "JKL12MNO", + "client_insurer": "Epsilon Insurance", + "client_insurer_policyno": "POL0123456", + "client_phone": "0234567890", + "client_mobile": "07345678901", + "client_email": "jack.robinson@example.com", + "plate_type": "Commercial", + "accident_date": "2024-06-18", + "accident_time": "18:33:44.000Z", + "accident_location": "987 Pine Avenue", + "accident_circs": "Rear-end collision", + "tp_firstname": "Karen", + "tp_lastname": "Lopez", + "tp_address_1": "123 Elm Road", + "tp_address_town": "Riverwood", + "tp_address_postcode": "RW3 4ST", + "tp_vehicle_reg": "MNO34PQR", + "tp_insurer": "Alpha Insurance", + "tp_insurer_polcyno": "POL1098765", + "tp_phone": "0456789012", + "tp_mobile": "07456789012" + }, + { + "source_id": 5, + "type": "Taxi", + "daystohire": 6, + "creditrepair": "Yes", + "authority_id": 8, + "client_firstname": "Liam", + "client_lastname": "Wright", + "client_address_1": "321 Birch Street", + "client_address_town": "Clearwater", + "client_address_postcode": "CW3 4ST", + "client_vehicle_reg": "PQR56STU", + "client_insurer": "Beta Insurance", + "client_insurer_policyno": "POL1234567", + "client_phone": "0567890123", + "client_mobile": "07567890123", + "client_email": "liam.wright@example.com", + "plate_type": "Private", + "accident_date": "2024-06-17", + "accident_time": "19:44:55.111Z", + "accident_location": "654 Maple Lane", + "accident_circs": "Side collision", + "tp_firstname": "Linda", + "tp_lastname": "Clark", + "tp_address_1": "789 Oak Avenue", + "tp_address_town": "Shelbyville", + "tp_address_postcode": "SH2 3HJ", + "tp_vehicle_reg": "ST78UVW", + "tp_insurer": "Gamma Insurance", + "tp_insurer_polcyno": "POL3210987", + "tp_phone": "0678901234", + "tp_mobile": "07678901234" + }, + { + "source_id": 16, + "type": "Taxi", + "daystohire": 8, + "creditrepair": "No", + "authority_id": 7, + "client_firstname": "Mia", + "client_lastname": "Walker", + "client_address_1": "654 Maple Street", + "client_address_town": "Riverside", + "client_address_postcode": "RS4 5WX", + "client_vehicle_reg": "UVW90XYZ", + "client_insurer": "Delta Insurance", + "client_insurer_policyno": "POL2345678", + "client_phone": "0789012345", + "client_mobile": "07789012345", + "client_email": "mia.walker@example.com", + "plate_type": "Commercial", + "accident_date": "2024-06-16", + "accident_time": "20:55:11.222Z", + "accident_location": "987 Pine Road", + "accident_circs": "Hit and run", + "tp_firstname": "Nancy", + "tp_lastname": "Hill", + "tp_address_1": "321 Birch Boulevard", + "tp_address_town": "Greenfield", + "tp_address_postcode": "GF2 3HJ", + "tp_vehicle_reg": "XYZ12ABC", + "tp_insurer": "Zeta Insurance", + "tp_insurer_polcyno": "POL0987654", + "tp_phone": "0890123456", + "tp_mobile": "07890123456" + }, + { + "source_id": 13, + "type": "Taxi", + "daystohire": 7, + "creditrepair": "Yes", + "authority_id": 8, + "client_firstname": "Olivia", + "client_lastname": "Young", + "client_address_1": "987 Pine Street", + "client_address_town": "Hilltop", + "client_address_postcode": "HT5 6WX", + "client_vehicle_reg": "ABC12DEF", + "client_insurer": "Epsilon Insurance", + "client_insurer_policyno": "POL3456789", + "client_phone": "0123456789", + "client_mobile": "07123456789", + "client_email": "olivia.young@example.com", + "plate_type": "Private", + "accident_date": "2024-06-15", + "accident_time": "21:11:22.333Z", + "accident_location": "654 Maple Avenue", + "accident_circs": "Rear-end collision", + "tp_firstname": "Paul", + "tp_lastname": "Martin", + "tp_address_1": "123 Elm Road", + "tp_address_town": "Springfield", + "tp_address_postcode": "SP4 5WX", + "tp_vehicle_reg": "DEF34GHI", + "tp_insurer": "Alpha Insurance", + "tp_insurer_polcyno": "POL4321098", + "tp_phone": "0345678901", + "tp_mobile": "07234567890" + }, + { + "source_id": 22, + "type": "Taxi", + "daystohire": 5, + "creditrepair": "No", + "authority_id": 7, + "client_firstname": "Paul", + "client_lastname": "Martin", + "client_address_1": "654 Maple Street", + "client_address_town": "Clearwater", + "client_address_postcode": "CW1 2CD", + "client_vehicle_reg": "GHI56JKL", + "client_insurer": "Gamma Insurance", + "client_insurer_policyno": "POL5678901", + "client_phone": "0456789012", + "client_mobile": "07345678901", + "client_email": "paul.martin@example.com", + "plate_type": "Commercial", + "accident_date": "2024-06-14", + "accident_time": "22:22:33.444Z", + "accident_location": "321 Birch Lane", + "accident_circs": "Side collision", + "tp_firstname": "Quinn", + "tp_lastname": "King", + "tp_address_1": "987 Pine Road", + "tp_address_town": "Hillview", + "tp_address_postcode": "HV3 4ST", + "tp_vehicle_reg": "JKL78MNO", + "tp_insurer": "Lambda Insurance", + "tp_insurer_polcyno": "POL0987654", + "tp_phone": "0567890123", + "tp_mobile": "07567890123" + }, + { + "source_id": 24, + "type": "Taxi", + "daystohire": 10, + "creditrepair": "Yes", + "authority_id": 8, + "client_firstname": "Quinn", + "client_lastname": "King", + "client_address_1": "321 Birch Street", + "client_address_town": "Riverwood", + "client_address_postcode": "RW5 6WX", + "client_vehicle_reg": "MNO90PQR", + "client_insurer": "Beta Insurance", + "client_insurer_policyno": "POL6789012", + "client_phone": "0678901234", + "client_mobile": "07678901234", + "client_email": "quinn.king@example.com", + "plate_type": "Private", + "accident_date": "2024-06-13", + "accident_time": "23:33:44.555Z", + "accident_location": "654 Maple Boulevard", + "accident_circs": "Hit and run", + "tp_firstname": "Rebecca", + "tp_lastname": "Scott", + "tp_address_1": "123 Elm Avenue", + "tp_address_town": "Shelbyville", + "tp_address_postcode": "SH1 2AB", + "tp_vehicle_reg": "PQR12STU", + "tp_insurer": "Theta Insurance", + "tp_insurer_polcyno": "POL5432109", + "tp_phone": "0789012345", + "tp_mobile": "07789012345" + }, + { + "source_id": 27, + "type": "Taxi", + "daystohire": 7, + "creditrepair": "No", + "authority_id": 7, + "client_firstname": "Rebecca", + "client_lastname": "Scott", + "client_address_1": "654 Maple Street", + "client_address_town": "Greenfield", + "client_address_postcode": "GF1 2AB", + "client_vehicle_reg": "ST34UVW", + "client_insurer": "Alpha Insurance", + "client_insurer_policyno": "POL7890123", + "client_phone": "0123456789", + "client_mobile": "07123456789", + "client_email": "rebecca.scott@example.com", + "plate_type": "Commercial", + "accident_date": "2024-06-12", + "accident_time": "09:11:22.666Z", + "accident_location": "987 Pine Lane", + "accident_circs": "Rear-end collision", + "tp_firstname": "Samuel", + "tp_lastname": "Turner", + "tp_address_1": "321 Birch Avenue", + "tp_address_town": "Clearwater", + "tp_address_postcode": "CW3 4ST", + "tp_vehicle_reg": "UVW56XYZ", + "tp_insurer": "Gamma Insurance", + "tp_insurer_polcyno": "POL2109876", + "tp_phone": "0234567890", + "tp_mobile": "07234567890" + }, + { + "source_id": 1, + "type": "Taxi", + "daystohire": 9, + "creditrepair": "Yes", + "authority_id": 8, + "client_firstname": "Samuel", + "client_lastname": "Turner", + "client_address_1": "321 Birch Street", + "client_address_town": "Riverwood", + "client_address_postcode": "RW2 3HJ", + "client_vehicle_reg": "XYZ90ABC", + "client_insurer": "Delta Insurance", + "client_insurer_policyno": "POL8901234", + "client_phone": "0345678901", + "client_mobile": "07345678901", + "client_email": "samuel.turner@example.com", + "plate_type": "Private", + "accident_date": "2024-06-11", + "accident_time": "10:22:33.777Z", + "accident_location": "654 Maple Road", + "accident_circs": "Side collision", + "tp_firstname": "Thomas", + "tp_lastname": "Young", + "tp_address_1": "123 Elm Boulevard", + "tp_address_town": "Hilltop", + "tp_address_postcode": "HT4 5WX", + "tp_vehicle_reg": "ABC12DEF", + "tp_insurer": "Zeta Insurance", + "tp_insurer_polcyno": "POL1098765", + "tp_phone": "0456789012", + "tp_mobile": "07456789012" + }, + { + "source_id": 6, + "type": "Taxi", + "daystohire": 8, + "creditrepair": "No", + "authority_id": 7, + "client_firstname": "Thomas", + "client_lastname": "Young", + "client_address_1": "654 Maple Street", + "client_address_town": "Greenfield", + "client_address_postcode": "GF5 6WX", + "client_vehicle_reg": "DEF34GHI", + "client_insurer": "Epsilon Insurance", + "client_insurer_policyno": "POL5678901", + "client_phone": "0567890123", + "client_mobile": "07567890123", + "client_email": "thomas.young@example.com", + "plate_type": "Commercial", + "accident_date": "2024-06-10", + "accident_time": "11:33:44.888Z", + "accident_location": "321 Birch Road", + "accident_circs": "Hit and run", + "tp_firstname": "Ursula", + "tp_lastname": "Vance", + "tp_address_1": "987 Pine Avenue", + "tp_address_town": "Shelbyville", + "tp_address_postcode": "SH2 3HJ", + "tp_vehicle_reg": "GHI56JKL", + "tp_insurer": "Alpha Insurance", + "tp_insurer_polcyno": "POL2109876", + "tp_phone": "0789012345", + "tp_mobile": "07789012345" + }, + { + "source_id": 25, + "type": "Taxi", + "daystohire": 7, + "creditrepair": "Yes", + "authority_id": 8, + "client_firstname": "Ursula", + "client_lastname": "Vance", + "client_address_1": "321 Birch Street", + "client_address_town": "Hilltop", + "client_address_postcode": "HT1 2CD", + "client_vehicle_reg": "JKL78MNO", + "client_insurer": "Gamma Insurance", + "client_insurer_policyno": "POL7890123", + "client_phone": "0123456789", + "client_mobile": "07123456789", + "client_email": "ursula.vance@example.com", + "plate_type": "Private", + "accident_date": "2024-06-09", + "accident_time": "12:44:55.111Z", + "accident_location": "654 Maple Lane", + "accident_circs": "Rear-end collision", + "tp_firstname": "Victor", + "tp_lastname": "White", + "tp_address_1": "123 Elm Road", + "tp_address_town": "Clearwater", + "tp_address_postcode": "CW4 5WX", + "tp_vehicle_reg": "MNO90PQR", + "tp_insurer": "Beta Insurance", + "tp_insurer_polcyno": "POL4321098", + "tp_phone": "0345678901", + "tp_mobile": "07234567890" + }, + { + "source_id": 17, + "type": "Taxi", + "daystohire": 6, + "creditrepair": "No", + "authority_id": 7, + "client_firstname": "Victor", + "client_lastname": "White", + "client_address_1": "987 Pine Street", + "client_address_town": "Riverwood", + "client_address_postcode": "RW2 3HJ", + "client_vehicle_reg": "PQR12STU", + "client_insurer": "Delta Insurance", + "client_insurer_policyno": "POL5678901", + "client_phone": "0456789012", + "client_mobile": "07345678901", + "client_email": "victor.white@example.com", + "plate_type": "Commercial", + "accident_date": "2024-06-08", + "accident_time": "13:55:11.777Z", + "accident_location": "321 Birch Boulevard", + "accident_circs": "Side collision", + "tp_firstname": "Wendy", + "tp_lastname": "Brown", + "tp_address_1": "654 Maple Avenue", + "tp_address_town": "Hilltop", + "tp_address_postcode": "HT2 3HJ", + "tp_vehicle_reg": "ST78UVW", + "tp_insurer": "Gamma Insurance", + "tp_insurer_polcyno": "POL3210987", + "tp_phone": "0567890123", + "tp_mobile": "07567890123" + }, + { + "source_id": 10, + "type": "Taxi", + "daystohire": 5, + "creditrepair": "Yes", + "authority_id": 8, + "client_firstname": "Wendy", + "client_lastname": "Brown", + "client_address_1": "321 Birch Street", + "client_address_town": "Riverside", + "client_address_postcode": "RS3 4ST", + "client_vehicle_reg": "UVW12XYZ", + "client_insurer": "Alpha Insurance", + "client_insurer_policyno": "POL7890123", + "client_phone": "0678901234", + "client_mobile": "07678901234", + "client_email": "wendy.brown@example.com", + "plate_type": "Private", + "accident_date": "2024-06-07", + "accident_time": "14:11:22.888Z", + "accident_location": "654 Maple Road", + "accident_circs": "Hit and run", + "tp_firstname": "Xander", + "tp_lastname": "Smith", + "tp_address_1": "987 Pine Lane", + "tp_address_town": "Clearwater", + "tp_address_postcode": "CW1 2AB", + "tp_vehicle_reg": "XYZ56ABC", + "tp_insurer": "Beta Insurance", + "tp_insurer_polcyno": "POL4321098", + "tp_phone": "0789012345", + "tp_mobile": "07789012345" + }, + { + "source_id": 20, + "type": "Taxi", + "daystohire": 8, + "creditrepair": "No", + "authority_id": 7, + "client_firstname": "Xander", + "client_lastname": "Smith", + "client_address_1": "321 Birch Street", + "client_address_town": "Hilltop", + "client_address_postcode": "HT4 5WX", + "client_vehicle_reg": "ABC34DEF", + "client_insurer": "Gamma Insurance", + "client_insurer_policyno": "POL5432109", + "client_phone": "0345678901", + "client_mobile": "07234567890", + "client_email": "xander.smith@example.com", + "plate_type": "Commercial", + "accident_date": "2024-06-06", + "accident_time": "15:22:33.999Z", + "accident_location": "654 Maple Avenue", + "accident_circs": "Rear-end collision", + "tp_firstname": "Yara", + "tp_lastname": "Thomas", + "tp_address_1": "123 Elm Lane", + "tp_address_town": "Greenfield", + "tp_address_postcode": "GF2 3HJ", + "tp_vehicle_reg": "DEF56GHI", + "tp_insurer": "Delta Insurance", + "tp_insurer_polcyno": "POL1098765", + "tp_phone": "0456789012", + "tp_mobile": "07456789012" + }, + { + "source_id": 15, + "type": "Taxi", + "daystohire": 9, + "creditrepair": "Yes", + "authority_id": 8, + "client_firstname": "Yara", + "client_lastname": "Thomas", + "client_address_1": "987 Pine Street", + "client_address_town": "Riverside", + "client_address_postcode": "RS3 4ST", + "client_vehicle_reg": "GHI78JKL", + "client_insurer": "Alpha Insurance", + "client_insurer_policyno": "POL6789012", + "client_phone": "0567890123", + "client_mobile": "07567890123", + "client_email": "yara.thomas@example.com", + "plate_type": "Private", + "accident_date": "2024-06-05", + "accident_time": "16:33:44.444Z", + "accident_location": "321 Birch Lane", + "accident_circs": "Side collision", + "tp_firstname": "Zachary", + "tp_lastname": "Wright", + "tp_address_1": "654 Maple Road", + "tp_address_town": "Hilltop", + "tp_address_postcode": "HT6 7WX", + "tp_vehicle_reg": "JKL12MNO", + "tp_insurer": "Gamma Insurance", + "tp_insurer_polcyno": "POL3456789", + "tp_phone": "0678901234", + "tp_mobile": "07678901234" + }, + { + "source_id": 14, + "type": "Taxi", + "daystohire": 10, + "creditrepair": "No", + "authority_id": 7, + "client_firstname": "Zachary", + "client_lastname": "Wright", + "client_address_1": "321 Birch Street", + "client_address_town": "Riverwood", + "client_address_postcode": "RW4 5WX", + "client_vehicle_reg": "MNO34PQR", + "client_insurer": "Beta Insurance", + "client_insurer_policyno": "POL7890123", + "client_phone": "0789012345", + "client_mobile": "07789012345", + "client_email": "zachary.wright@example.com", + "plate_type": "Commercial", + "accident_date": "2024-06-04", + "accident_time": "17:44:55.555Z", + "accident_location": "654 Maple Boulevard", + "accident_circs": "Hit and run", + "tp_firstname": "Alice", + "tp_lastname": "Johnson", + "tp_address_1": "123 Elm Road", + "tp_address_town": "Greenfield", + "tp_address_postcode": "GF1 2AB", + "tp_vehicle_reg": "PQR56STU", + "tp_insurer": "Delta Insurance", + "tp_insurer_polcyno": "POL3210987", + "tp_phone": "0123456789", + "tp_mobile": "07123456789" + } +] + +# The API endpoint and authorization token +url = "http://localhost/api/v1/requests" +headers = { + "Authorization": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MjAxMDg3ODAsInN1YiI6IjEifQ.KOXSFwOpyxeavuFn8pqym6WbrmxVfEUOxBhmpZ60L-E", + "Content-Type": "application/json" +} + +# Loop through each dictionary in the list and send it as a POST request +for entry in data: + response = requests.post(url, json=entry, headers=headers) + print(f"Status Code: {response.status_code}, Response: {response.json()}") \ No newline at end of file diff --git a/backend/importstuff/sqlimport.txt b/backend/importstuff/sqlimport.txt new file mode 100644 index 0000000000..6dc3e497d3 --- /dev/null +++ b/backend/importstuff/sqlimport.txt @@ -0,0 +1,96 @@ +###### sources #### + +INSERT INTO source (owner_id, source_name) VALUES +(1, 'Alpha'), +(1, 'Beta'), +(1, 'Gamma'), +(1, 'Delta'), +(1, 'Epsilon'), +(1, 'Zeta'), +(1, 'Eta'), +(1, 'Theta'), +(1, 'Iota'), +(1, 'Kappa'), +(1, 'Lambda'), +(1, 'Mu'), +(1, 'Nu'), +(1, 'Xi'), +(1, 'Omicron'), +(1, 'Pi'), +(1, 'Rho'), +(1, 'Sigma'), +(1, 'Tau'), +(1, 'Upsilon'), +(1, 'Phi'), +(1, 'Chi'), +(1, 'Psi'), +(1, 'Omega'), +(1, 'Epsilon'); + +### supplier ## + +INSERT INTO supplier (name, owner_id, base_rate) VALUES +('supplier_1', 1, 245), +('supplier_2', 1, 387), +('supplier_3', 1, 512), +('supplier_4', 1, 678), +('supplier_5', 1, 843), +('supplier_6', 1, 954), +('supplier_7', 1, 179), +('supplier_8', 1, 223), +('supplier_9', 1, 333), +('supplier_10', 1, 490), +('supplier_11', 1, 506), +('supplier_12', 1, 714), +('supplier_13', 1, 825), +('supplier_14', 1, 940), +('supplier_15', 1, 199), +('supplier_16', 1, 245), +('supplier_17', 1, 375), +('supplier_18', 1, 486), +('supplier_19', 1, 658), +('supplier_20', 1, 779), +('supplier_21', 1, 890), +('supplier_22', 1, 995), +('supplier_23', 1, 110), +('supplier_24', 1, 237), +('supplier_25', 1, 359); + + + + +{ + "source_id": 0, + "claim_id": 0, + "supplier_id": 0, + "type": "string", + "daystohire": 0, + "creditrepair": "string", + "authority_id": 0, + "client_firstname": "string", + "client_lastname": "string", + "client_address_1": "string", + "client_address_town": "string", + "client_address_postcode": "string", + "client_vehicle_reg": "string", + "client_insurer": "string", + "client_insurer_policyno": "string", + "client_phone": "string", + "client_mobile": "string", + "client_email": "string", + "plate_type": "string", + "accident_date": "2024-06-27", + "accident_time": "09:32:23.265Z", + "accident_location": "string", + "accident_circs": "string", + "tp_firstname": "string", + "tp_lastname": "string", + "tp_address_1": "string", + "tp_address_town": "string", + "tp_address_postcode": "string", + "tp_vehicle_reg": "string", + "tp_insurer": "string", + "tp_insurer_polcyno": "string", + "tp_phone": "string", + "tp_mobile": "string" +} \ No newline at end of file diff --git a/backend/importstuff/sqlstatments.txt b/backend/importstuff/sqlstatments.txt new file mode 100644 index 0000000000..0c222f66c5 --- /dev/null +++ b/backend/importstuff/sqlstatments.txt @@ -0,0 +1,375 @@ +---check supplier rate has a row for each criteria & set base rate if not on override -- + +INSERT INTO supplier_rate (owner_id, authority_id, supplier_id, circs_group_id, veh_group_id, rate) +SELECT + 1 AS owner_id, + authority.id AS authority_id, + supplier.id AS supplier_id, + circs_group.id AS circs_group_id, + veh_group.id AS veh_group_id, + supplier.base_rate AS rate +FROM + authority + CROSS JOIN supplier + CROSS JOIN circs_group + CROSS JOIN veh_group +ON CONFLICT ON CONSTRAINT supplier_rate_constraint +DO UPDATE + SET rate = CASE + WHEN EXCLUDED.rate_override = 'No' + THEN EXCLUDED.rate + ELSE supplier_rate.rate + END; + + +---check supplier stats has a row for each criteria -- + +INSERT INTO supplier_stat (authority_id, supplier_id, circs_group_id, veh_group_id) +SELECT + authority.id AS authority_id, + supplier.id AS supplier_id, + circs_group.id AS circs_group_id, + veh_group.id AS veh_group_id +FROM + authority, supplier, circs_group, veh_group +ON CONFLICT ON CONSTRAINT supplier_stat_constraint +DO NOTHING; + + +--- Update supplier_stat rows with rate & rank ---- + +INSERT INTO supplier_stat (authority_id, supplier_id, circs_group_id, veh_group_id, rate_rank, rate) +SELECT + authority_id, + supplier_id, + circs_group_id, + veh_group_id, + RANK() OVER ( + PARTITION BY authority_id, circs_group_id, veh_group_id + ORDER BY rate ASC + ) AS rate_rank, + rate +FROM + supplier_rate +ON CONFLICT ON CONSTRAINT supplier_stat_constraint +DO UPDATE SET + rate_rank = EXCLUDED.rate_rank, + rate = EXCLUDED.rate; + +--- Update supplier_stat rows with Days To Hire & rank ---- + +INSERT INTO supplier_stat ( + authority_id, + supplier_id, + circs_group_id, + veh_group_id, + daystohire_rank, + daystohire +) +SELECT + authority_id, + supplier_id, + circs_group_id, + veh_group_id, + RANK() OVER ( + PARTITION BY authority_id, circs_group_id, veh_group_id + ORDER BY ROUND(AVG(daystohire), 2) ASC + ) AS daystohire_rank, + ROUND(AVG(daystohire), 2) AS daystohire +FROM + referral +WHERE + authority_id IS NOT NULL AND + supplier_id IS NOT NULL AND + circs_group_id IS NOT NULL AND + veh_group_id IS NOT NULL +GROUP BY + authority_id, + supplier_id, + circs_group_id, + veh_group_id +ON CONFLICT ON CONSTRAINT supplier_stat_constraint +DO UPDATE SET + daystohire_rank = EXCLUDED.daystohire_rank, + daystohire = EXCLUDED.daystohire; + +-------- update blank rows with Ave values for DTH ------ + +UPDATE supplier_stat +SET daystohire = subquery.avedaystohire +FROM ( + SELECT + authority_id, + ROUND(AVG(daystohire), 2) AS avedaystohire + FROM + supplier_stat + GROUP BY + authority_id +) AS subquery +WHERE + supplier_stat.authority_id = subquery.authority_id + AND daystohire IS NULL; + +-------- update rank after inserted ave values ------------------------ + +WITH ranked_suppliers AS ( + SELECT + authority_id, + supplier_id, + circs_group_id, + veh_group_id, + daystohire, + RANK() OVER ( + PARTITION BY authority_id, circs_group_id, veh_group_id + ORDER BY daystohire asc) AS daystohire_rank + FROM + supplier_stat +) +UPDATE supplier_stat +SET daystohire_rank = ranked_suppliers.daystohire_rank +FROM ranked_suppliers +WHERE supplier_stat.authority_id = ranked_suppliers.authority_id + AND supplier_stat.supplier_id = ranked_suppliers.supplier_id + AND supplier_stat.circs_group_id = ranked_suppliers.circs_group_id + AND supplier_stat.veh_group_id = ranked_suppliers.veh_group_id; + + +--- Update supplier_stat rows with conversion ---- + +INSERT INTO supplier_stat (authority_id, supplier_id, circs_group_id, veh_group_id, conversion) +SELECT + r.authority_id, + r.supplier_id, + r.circs_group_id, + r.veh_group_id, + CASE + WHEN COUNT(CASE WHEN ra.status = 'accepted' THEN 1 END) = 0 THEN 0 + ELSE round((COUNT(CASE WHEN ra.status = 'accepted' THEN 1 END) * 1.0 / COUNT(*))*100,2) + END AS conversion +FROM + referral_allocation ra +JOIN + referral r ON r.id = ra.referral_id +WHERE + r.authority_id IS NOT NULL AND + r.supplier_id IS NOT NULL AND + r.circs_group_id IS NOT NULL AND + r.veh_group_id IS NOT NULL +GROUP BY + r.authority_id, + r.supplier_id, + r.circs_group_id, + r.veh_group_id +ON CONFLICT ON CONSTRAINT supplier_stat_constraint +DO UPDATE SET + conversion = EXCLUDED.conversion; + +-------- update blank conversion rows with Ave values ------ + +UPDATE supplier_stat +SET conversion = subquery.aveconversion +FROM ( + SELECT + authority_id, + ROUND(AVG(conversion), 2) AS aveconversion + FROM + supplier_stat + GROUP BY + authority_id +) AS subquery +WHERE + supplier_stat.authority_id = subquery.authority_id + AND conversion IS NULL; + + +-------- update rank after inserted ave values ------------------------ + +WITH ranked_suppliers AS ( + SELECT + authority_id, + supplier_id, + circs_group_id, + veh_group_id, + RANK() OVER ( + PARTITION BY authority_id, circs_group_id, veh_group_id + ORDER BY conversion desc) AS conversion_rank + FROM + supplier_stat +) +UPDATE supplier_stat +SET conversion_rank = ranked_suppliers.conversion_rank +FROM ranked_suppliers +WHERE supplier_stat.authority_id = ranked_suppliers.authority_id + AND supplier_stat.supplier_id = ranked_suppliers.supplier_id + AND supplier_stat.circs_group_id = ranked_suppliers.circs_group_id + AND supplier_stat.veh_group_id = ranked_suppliers.veh_group_id; + + +------ update Total rank ------- +UPDATE supplier_stat +SET Total_Rank = daystohire_rank + rate_rank + conversion_rank; + + +----------------------------------------------------------------------------------------------------------- + + + + +DROP TABLE IF EXISTS rate_rank; +DROP TABLE IF EXISTS dth_rank; + +CREATE TEMP TABLE rate_rank as +SELECT +supplier_id, +rate, +RANK() OVER (ORDER BY rate DESC) AS raterank +FROM +supplier_rate; + +CREATE TEMP TABLE dth_rank as +SELECT + Avetable.supplier_id, + ave_daystohire, + RANK() OVER (ORDER BY ave_daystohire DESC) AS dthrank +FROM ( + SELECT + supplier_id, + AVG(daystohire) AS ave_daystohire + FROM + referral + GROUP BY + supplier_id +) AS Avetable; + + + +select supplier.name, raterank, dthrank +from +supplier +left join rate_rank on supplier.id = rate_rank.supplier_id +left join dth_rank on supplier.id = dth_rank.supplier_id; + +DROP TABLE IF EXISTS rate_rank; +DROP TABLE IF EXISTS dth_rank; + +########################################### + +INSERT INTO supplier_stat (supplier_id,authority_id,rate_rank,rate,uniquecol) +SELECT supplier_id, authority_id, RANK() OVER (ORDER BY rate DESC) AS raterank,rate,CONCAT(supplier_id,'-',authority_id) + FROM + supplier_rate +ON CONFLICT (uniquecol) +DO UPDATE SET +rate_rank = EXCLUDED.rate_rank, +rate = EXCLUDED.rate; + +INSERT INTO supplier_stat (supplier_id,authority_id,daystohire_rank,daystohire,uniquecol) +SELECT + Avetable.supplier_id, + Avetable.authority_id, + RANK() OVER (ORDER BY ave_daystohire DESC) AS dthrank, + ave_daystohire, + CONCAT(Avetable.supplier_id,'-',Avetable.authority_id) + FROM ( + SELECT + supplier_id, + authority_id, + AVG(daystohire) AS ave_daystohire + FROM + referral + GROUP BY + supplier_id, + authority_id + ) AS Avetable +ON CONFLICT (uniquecol) +DO UPDATE SET +daystohire_rank = EXCLUDED.daystohire_rank, +daystohire = EXCLUDED.daystohire; + +update supplier_stat +SET Total_Rank = daystohire_rank + rate_rank + + + +################### + +INSERT INTO supplier_stat (supplier_id,authority_id,rate_rank,rate,uniquecol) +SELECT supplier_id, authority_id, RANK() OVER (ORDER BY rate DESC) AS raterank,rate,CONCAT(supplier_id,'-',authority_id) + FROM + supplier_rate +ON CONFLICT ON CONSTRAINT supplier_stat_constraint +DO UPDATE SET +rate_rank = EXCLUDED.rate_rank, +rate = EXCLUDED.rate; + +INSERT INTO supplier_stat (supplier_id,authority_id,daystohire_rank,daystohire,uniquecol) +SELECT + Avetable.supplier_id, + Avetable.authority_id, + RANK() OVER (ORDER BY ave_daystohire DESC) AS dthrank, + ave_daystohire, + CONCAT(Avetable.supplier_id,'-',Avetable.authority_id) + FROM ( + SELECT + supplier_id, + authority_id, + AVG(daystohire) AS ave_daystohire + FROM + referral + GROUP BY + supplier_id, + authority_id + ) AS Avetable +ON CONFLICT ON CONSTRAINT supplier_stat_constraint +DO UPDATE SET +daystohire_rank = EXCLUDED.daystohire_rank, +daystohire = EXCLUDED.daystohire; + +update supplier_stat +SET Total_Rank = daystohire_rank + rate_rank + +############################ + +INSERT INTO supplier_rate (authority_id,circs_group_id,supplier_id, owner_id, veh_group_id, rate) +SELECT authority.id as authority_id, circs_group.id as circs_group_id, + 7 as supplier_id, 1 as owner_id, 1 as veh_group_id, 750 as rate +FROM authority, circs_group +ON CONFLICT ON CONSTRAINT supplier_rate_constraint +DO UPDATE SET +rate = EXCLUDED.rate; + +####### + +INSERT INTO supplier_stat (supplier_id,authority_id,rate_rank,rate) +SELECT supplier_id, authority_id, RANK() OVER (ORDER BY rate DESC) AS raterank,rate + FROM + supplier_rate +ON CONFLICT ON CONSTRAINT supplier_stat_constraint +DO UPDATE SET +rate_rank = EXCLUDED.rate_rank, +rate = EXCLUDED.rate; + +INSERT INTO supplier_stat (supplier_id,authority_id,daystohire_rank,daystohire) +SELECT + Avetable.supplier_id, + Avetable.authority_id, + RANK() OVER (ORDER BY ave_daystohire DESC) AS dthrank, + ave_daystohire + FROM ( + SELECT + supplier_id, + authority_id, + AVG(daystohire) AS ave_daystohire + FROM + referral + GROUP BY + supplier_id, + authority_id + ) AS Avetable +ON CONFLICT ON CONSTRAINT supplier_stat_constraint +DO UPDATE SET +daystohire_rank = EXCLUDED.daystohire_rank, +daystohire = EXCLUDED.daystohire; + +update supplier_stat +SET Total_Rank = daystohire_rank + rate_rank \ No newline at end of file diff --git a/backend/importstuff/statsreset.py b/backend/importstuff/statsreset.py new file mode 100644 index 0000000000..b1dba60d8b --- /dev/null +++ b/backend/importstuff/statsreset.py @@ -0,0 +1,121 @@ +from typing import Any + +from sqlmodel import Session, select +from sqlalchemy import text + +session: Session + +insert_select_sql = text(""" + +---check supplier rate has a row for each criteria & set base rate if not on override -- + +INSERT INTO supplier_rate (owner_id,authority_id, supplier_id, circs_group_id, veh_group_id, rate) +SELECT + 1 as owner_id, + authority.id as authority_id, + supplier.id as supplier_id, + circs_group.id as circs_group_id, + veh_group.id as veh_group_id, + supplier.base_rate as rate +FROM + authority + CROSS JOIN supplier + CROSS JOIN circs_group + CROSS JOIN veh_group +ON CONFLICT ON CONSTRAINT supplier_rate_constraint DO UPDATE + SET rate = CASE WHEN EXCLUDED.rate_override = 'No' THEN EXCLUDED.rate ELSE supplier_rate.rate END; + + +---check supplier stats has a row for each criteria -- + +INSERT INTO supplier_stat (authority_id,supplier_id,circs_group_id,veh_group_id) +SELECT authority.id as authority_id, + supplier.id as supplier_id, + circs_group.id as circs_group_id, + veh_group.id as veh_group_id +FROM authority, supplier, circs_group, veh_group +ON CONFLICT ON CONSTRAINT supplier_stat_constraint +DO NOTHING; + +--- Update supplier_stat rows with rate & rank ---- + +INSERT INTO supplier_stat (authority_id,supplier_id,circs_group_id,veh_group_id,rate_rank,rate) +SELECT authority_id, + supplier_id, + circs_group_id, + veh_group_id, + RANK() OVER ( + PARTITION BY authority_id,circs_group_id, veh_group_id + ORDER BY rate DESC) raterank, + rate + FROM + supplier_rate +ON CONFLICT ON CONSTRAINT supplier_stat_constraint +DO UPDATE SET +rate_rank = EXCLUDED.rate_rank, +rate = EXCLUDED.rate; + +--- Update supplier_stat rows with Days To Hire & rank ---- + +INSERT INTO supplier_stat ( + authority_id, + supplier_id, + circs_group_id, + veh_group_id, + daystohire_rank, + daystohire +) +SELECT + Avetable.authorityid, + Avetable.supplierid, + Avetable.circs_groupid, + Avetable.veh_groupid, + RANK() OVER (ORDER BY Avetable.avg_daystohire DESC) AS daystohire_rank, + Avetable.avg_daystohire +FROM ( + SELECT + basetable.authorityid, + basetable.supplierid, + basetable.circs_groupid, + basetable.veh_groupid, + ROUND(AVG(referral.daystohire), 2) AS avg_daystohire + FROM ( + SELECT + authority.id AS authorityid, + supplier.id AS supplierid, + circs_group.id AS circs_groupid, + veh_group.id AS veh_groupid + FROM + authority + CROSS JOIN + supplier + CROSS JOIN + circs_group + CROSS JOIN + veh_group + ) AS basetable + LEFT JOIN referral + ON referral.authority_id = basetable.authorityid + AND referral.supplier_id = basetable.supplierid + AND referral.circs_group_id = basetable.circs_groupid + AND referral.veh_group_id = basetable.veh_groupid + GROUP BY + basetable.authorityid, + basetable.supplierid, + basetable.circs_groupid, + basetable.veh_groupid +) AS Avetable +ON CONFLICT ON CONSTRAINT supplier_stat_constraint +DO UPDATE SET + daystohire_rank = EXCLUDED.daystohire_rank, + daystohire = EXCLUDED.daystohire; + +update supplier_stat +SET Total_Rank = daystohire_rank + rate_rank;""") + + + + # Execute the raw SQL +session.execute(insert_select_sql) +session.commit() + diff --git a/backend/poetry.lock b/backend/poetry.lock index b4a170b863..ca10947490 100644 --- a/backend/poetry.lock +++ b/backend/poetry.lock @@ -256,63 +256,63 @@ files = [ [[package]] name = "coverage" -version = "7.5.3" +version = "7.5.4" description = "Code coverage measurement for Python" optional = false python-versions = ">=3.8" files = [ - {file = "coverage-7.5.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:a6519d917abb15e12380406d721e37613e2a67d166f9fb7e5a8ce0375744cd45"}, - {file = "coverage-7.5.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:aea7da970f1feccf48be7335f8b2ca64baf9b589d79e05b9397a06696ce1a1ec"}, - {file = "coverage-7.5.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:923b7b1c717bd0f0f92d862d1ff51d9b2b55dbbd133e05680204465f454bb286"}, - {file = "coverage-7.5.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:62bda40da1e68898186f274f832ef3e759ce929da9a9fd9fcf265956de269dbc"}, - {file = "coverage-7.5.3-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d8b7339180d00de83e930358223c617cc343dd08e1aa5ec7b06c3a121aec4e1d"}, - {file = "coverage-7.5.3-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:25a5caf742c6195e08002d3b6c2dd6947e50efc5fc2c2205f61ecb47592d2d83"}, - {file = "coverage-7.5.3-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:05ac5f60faa0c704c0f7e6a5cbfd6f02101ed05e0aee4d2822637a9e672c998d"}, - {file = "coverage-7.5.3-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:239a4e75e09c2b12ea478d28815acf83334d32e722e7433471fbf641c606344c"}, - {file = "coverage-7.5.3-cp310-cp310-win32.whl", hash = "sha256:a5812840d1d00eafae6585aba38021f90a705a25b8216ec7f66aebe5b619fb84"}, - {file = "coverage-7.5.3-cp310-cp310-win_amd64.whl", hash = "sha256:33ca90a0eb29225f195e30684ba4a6db05dbef03c2ccd50b9077714c48153cac"}, - {file = "coverage-7.5.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:f81bc26d609bf0fbc622c7122ba6307993c83c795d2d6f6f6fd8c000a770d974"}, - {file = "coverage-7.5.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:7cec2af81f9e7569280822be68bd57e51b86d42e59ea30d10ebdbb22d2cb7232"}, - {file = "coverage-7.5.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:55f689f846661e3f26efa535071775d0483388a1ccfab899df72924805e9e7cd"}, - {file = "coverage-7.5.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:50084d3516aa263791198913a17354bd1dc627d3c1639209640b9cac3fef5807"}, - {file = "coverage-7.5.3-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:341dd8f61c26337c37988345ca5c8ccabeff33093a26953a1ac72e7d0103c4fb"}, - {file = "coverage-7.5.3-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:ab0b028165eea880af12f66086694768f2c3139b2c31ad5e032c8edbafca6ffc"}, - {file = "coverage-7.5.3-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:5bc5a8c87714b0c67cfeb4c7caa82b2d71e8864d1a46aa990b5588fa953673b8"}, - {file = "coverage-7.5.3-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:38a3b98dae8a7c9057bd91fbf3415c05e700a5114c5f1b5b0ea5f8f429ba6614"}, - {file = "coverage-7.5.3-cp311-cp311-win32.whl", hash = "sha256:fcf7d1d6f5da887ca04302db8e0e0cf56ce9a5e05f202720e49b3e8157ddb9a9"}, - {file = "coverage-7.5.3-cp311-cp311-win_amd64.whl", hash = "sha256:8c836309931839cca658a78a888dab9676b5c988d0dd34ca247f5f3e679f4e7a"}, - {file = "coverage-7.5.3-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:296a7d9bbc598e8744c00f7a6cecf1da9b30ae9ad51c566291ff1314e6cbbed8"}, - {file = "coverage-7.5.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:34d6d21d8795a97b14d503dcaf74226ae51eb1f2bd41015d3ef332a24d0a17b3"}, - {file = "coverage-7.5.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8e317953bb4c074c06c798a11dbdd2cf9979dbcaa8ccc0fa4701d80042d4ebf1"}, - {file = "coverage-7.5.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:705f3d7c2b098c40f5b81790a5fedb274113373d4d1a69e65f8b68b0cc26f6db"}, - {file = "coverage-7.5.3-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b1196e13c45e327d6cd0b6e471530a1882f1017eb83c6229fc613cd1a11b53cd"}, - {file = "coverage-7.5.3-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:015eddc5ccd5364dcb902eaecf9515636806fa1e0d5bef5769d06d0f31b54523"}, - {file = "coverage-7.5.3-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:fd27d8b49e574e50caa65196d908f80e4dff64d7e592d0c59788b45aad7e8b35"}, - {file = "coverage-7.5.3-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:33fc65740267222fc02975c061eb7167185fef4cc8f2770267ee8bf7d6a42f84"}, - {file = "coverage-7.5.3-cp312-cp312-win32.whl", hash = "sha256:7b2a19e13dfb5c8e145c7a6ea959485ee8e2204699903c88c7d25283584bfc08"}, - {file = "coverage-7.5.3-cp312-cp312-win_amd64.whl", hash = "sha256:0bbddc54bbacfc09b3edaec644d4ac90c08ee8ed4844b0f86227dcda2d428fcb"}, - {file = "coverage-7.5.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:f78300789a708ac1f17e134593f577407d52d0417305435b134805c4fb135adb"}, - {file = "coverage-7.5.3-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:b368e1aee1b9b75757942d44d7598dcd22a9dbb126affcbba82d15917f0cc155"}, - {file = "coverage-7.5.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f836c174c3a7f639bded48ec913f348c4761cbf49de4a20a956d3431a7c9cb24"}, - {file = "coverage-7.5.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:244f509f126dc71369393ce5fea17c0592c40ee44e607b6d855e9c4ac57aac98"}, - {file = "coverage-7.5.3-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c4c2872b3c91f9baa836147ca33650dc5c172e9273c808c3c3199c75490e709d"}, - {file = "coverage-7.5.3-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:dd4b3355b01273a56b20c219e74e7549e14370b31a4ffe42706a8cda91f19f6d"}, - {file = "coverage-7.5.3-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:f542287b1489c7a860d43a7d8883e27ca62ab84ca53c965d11dac1d3a1fab7ce"}, - {file = "coverage-7.5.3-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:75e3f4e86804023e991096b29e147e635f5e2568f77883a1e6eed74512659ab0"}, - {file = "coverage-7.5.3-cp38-cp38-win32.whl", hash = "sha256:c59d2ad092dc0551d9f79d9d44d005c945ba95832a6798f98f9216ede3d5f485"}, - {file = "coverage-7.5.3-cp38-cp38-win_amd64.whl", hash = "sha256:fa21a04112c59ad54f69d80e376f7f9d0f5f9123ab87ecd18fbb9ec3a2beed56"}, - {file = "coverage-7.5.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:f5102a92855d518b0996eb197772f5ac2a527c0ec617124ad5242a3af5e25f85"}, - {file = "coverage-7.5.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:d1da0a2e3b37b745a2b2a678a4c796462cf753aebf94edcc87dcc6b8641eae31"}, - {file = "coverage-7.5.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8383a6c8cefba1b7cecc0149415046b6fc38836295bc4c84e820872eb5478b3d"}, - {file = "coverage-7.5.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9aad68c3f2566dfae84bf46295a79e79d904e1c21ccfc66de88cd446f8686341"}, - {file = "coverage-7.5.3-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2e079c9ec772fedbade9d7ebc36202a1d9ef7291bc9b3a024ca395c4d52853d7"}, - {file = "coverage-7.5.3-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:bde997cac85fcac227b27d4fb2c7608a2c5f6558469b0eb704c5726ae49e1c52"}, - {file = "coverage-7.5.3-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:990fb20b32990b2ce2c5f974c3e738c9358b2735bc05075d50a6f36721b8f303"}, - {file = "coverage-7.5.3-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:3d5a67f0da401e105753d474369ab034c7bae51a4c31c77d94030d59e41df5bd"}, - {file = "coverage-7.5.3-cp39-cp39-win32.whl", hash = "sha256:e08c470c2eb01977d221fd87495b44867a56d4d594f43739a8028f8646a51e0d"}, - {file = "coverage-7.5.3-cp39-cp39-win_amd64.whl", hash = "sha256:1d2a830ade66d3563bb61d1e3c77c8def97b30ed91e166c67d0632c018f380f0"}, - {file = "coverage-7.5.3-pp38.pp39.pp310-none-any.whl", hash = "sha256:3538d8fb1ee9bdd2e2692b3b18c22bb1c19ffbefd06880f5ac496e42d7bb3884"}, - {file = "coverage-7.5.3.tar.gz", hash = "sha256:04aefca5190d1dc7a53a4c1a5a7f8568811306d7a8ee231c42fb69215571944f"}, + {file = "coverage-7.5.4-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6cfb5a4f556bb51aba274588200a46e4dd6b505fb1a5f8c5ae408222eb416f99"}, + {file = "coverage-7.5.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:2174e7c23e0a454ffe12267a10732c273243b4f2d50d07544a91198f05c48f47"}, + {file = "coverage-7.5.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2214ee920787d85db1b6a0bd9da5f8503ccc8fcd5814d90796c2f2493a2f4d2e"}, + {file = "coverage-7.5.4-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1137f46adb28e3813dec8c01fefadcb8c614f33576f672962e323b5128d9a68d"}, + {file = "coverage-7.5.4-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b385d49609f8e9efc885790a5a0e89f2e3ae042cdf12958b6034cc442de428d3"}, + {file = "coverage-7.5.4-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:b4a474f799456e0eb46d78ab07303286a84a3140e9700b9e154cfebc8f527016"}, + {file = "coverage-7.5.4-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:5cd64adedf3be66f8ccee418473c2916492d53cbafbfcff851cbec5a8454b136"}, + {file = "coverage-7.5.4-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:e564c2cf45d2f44a9da56f4e3a26b2236504a496eb4cb0ca7221cd4cc7a9aca9"}, + {file = "coverage-7.5.4-cp310-cp310-win32.whl", hash = "sha256:7076b4b3a5f6d2b5d7f1185fde25b1e54eb66e647a1dfef0e2c2bfaf9b4c88c8"}, + {file = "coverage-7.5.4-cp310-cp310-win_amd64.whl", hash = "sha256:018a12985185038a5b2bcafab04ab833a9a0f2c59995b3cec07e10074c78635f"}, + {file = "coverage-7.5.4-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:db14f552ac38f10758ad14dd7b983dbab424e731588d300c7db25b6f89e335b5"}, + {file = "coverage-7.5.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:3257fdd8e574805f27bb5342b77bc65578e98cbc004a92232106344053f319ba"}, + {file = "coverage-7.5.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3a6612c99081d8d6134005b1354191e103ec9705d7ba2754e848211ac8cacc6b"}, + {file = "coverage-7.5.4-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d45d3cbd94159c468b9b8c5a556e3f6b81a8d1af2a92b77320e887c3e7a5d080"}, + {file = "coverage-7.5.4-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ed550e7442f278af76d9d65af48069f1fb84c9f745ae249c1a183c1e9d1b025c"}, + {file = "coverage-7.5.4-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:7a892be37ca35eb5019ec85402c3371b0f7cda5ab5056023a7f13da0961e60da"}, + {file = "coverage-7.5.4-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:8192794d120167e2a64721d88dbd688584675e86e15d0569599257566dec9bf0"}, + {file = "coverage-7.5.4-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:820bc841faa502e727a48311948e0461132a9c8baa42f6b2b84a29ced24cc078"}, + {file = "coverage-7.5.4-cp311-cp311-win32.whl", hash = "sha256:6aae5cce399a0f065da65c7bb1e8abd5c7a3043da9dceb429ebe1b289bc07806"}, + {file = "coverage-7.5.4-cp311-cp311-win_amd64.whl", hash = "sha256:d2e344d6adc8ef81c5a233d3a57b3c7d5181f40e79e05e1c143da143ccb6377d"}, + {file = "coverage-7.5.4-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:54317c2b806354cbb2dc7ac27e2b93f97096912cc16b18289c5d4e44fc663233"}, + {file = "coverage-7.5.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:042183de01f8b6d531e10c197f7f0315a61e8d805ab29c5f7b51a01d62782747"}, + {file = "coverage-7.5.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a6bb74ed465d5fb204b2ec41d79bcd28afccf817de721e8a807d5141c3426638"}, + {file = "coverage-7.5.4-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b3d45ff86efb129c599a3b287ae2e44c1e281ae0f9a9bad0edc202179bcc3a2e"}, + {file = "coverage-7.5.4-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5013ed890dc917cef2c9f765c4c6a8ae9df983cd60dbb635df8ed9f4ebc9f555"}, + {file = "coverage-7.5.4-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:1014fbf665fef86cdfd6cb5b7371496ce35e4d2a00cda501cf9f5b9e6fced69f"}, + {file = "coverage-7.5.4-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:3684bc2ff328f935981847082ba4fdc950d58906a40eafa93510d1b54c08a66c"}, + {file = "coverage-7.5.4-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:581ea96f92bf71a5ec0974001f900db495488434a6928a2ca7f01eee20c23805"}, + {file = "coverage-7.5.4-cp312-cp312-win32.whl", hash = "sha256:73ca8fbc5bc622e54627314c1a6f1dfdd8db69788f3443e752c215f29fa87a0b"}, + {file = "coverage-7.5.4-cp312-cp312-win_amd64.whl", hash = "sha256:cef4649ec906ea7ea5e9e796e68b987f83fa9a718514fe147f538cfeda76d7a7"}, + {file = "coverage-7.5.4-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:cdd31315fc20868c194130de9ee6bfd99755cc9565edff98ecc12585b90be882"}, + {file = "coverage-7.5.4-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:02ff6e898197cc1e9fa375581382b72498eb2e6d5fc0b53f03e496cfee3fac6d"}, + {file = "coverage-7.5.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d05c16cf4b4c2fc880cb12ba4c9b526e9e5d5bb1d81313d4d732a5b9fe2b9d53"}, + {file = "coverage-7.5.4-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c5986ee7ea0795a4095ac4d113cbb3448601efca7f158ec7f7087a6c705304e4"}, + {file = "coverage-7.5.4-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5df54843b88901fdc2f598ac06737f03d71168fd1175728054c8f5a2739ac3e4"}, + {file = "coverage-7.5.4-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:ab73b35e8d109bffbda9a3e91c64e29fe26e03e49addf5b43d85fc426dde11f9"}, + {file = "coverage-7.5.4-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:aea072a941b033813f5e4814541fc265a5c12ed9720daef11ca516aeacd3bd7f"}, + {file = "coverage-7.5.4-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:16852febd96acd953b0d55fc842ce2dac1710f26729b31c80b940b9afcd9896f"}, + {file = "coverage-7.5.4-cp38-cp38-win32.whl", hash = "sha256:8f894208794b164e6bd4bba61fc98bf6b06be4d390cf2daacfa6eca0a6d2bb4f"}, + {file = "coverage-7.5.4-cp38-cp38-win_amd64.whl", hash = "sha256:e2afe743289273209c992075a5a4913e8d007d569a406ffed0bd080ea02b0633"}, + {file = "coverage-7.5.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:b95c3a8cb0463ba9f77383d0fa8c9194cf91f64445a63fc26fb2327e1e1eb088"}, + {file = "coverage-7.5.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:3d7564cc09dd91b5a6001754a5b3c6ecc4aba6323baf33a12bd751036c998be4"}, + {file = "coverage-7.5.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:44da56a2589b684813f86d07597fdf8a9c6ce77f58976727329272f5a01f99f7"}, + {file = "coverage-7.5.4-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e16f3d6b491c48c5ae726308e6ab1e18ee830b4cdd6913f2d7f77354b33f91c8"}, + {file = "coverage-7.5.4-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dbc5958cb471e5a5af41b0ddaea96a37e74ed289535e8deca404811f6cb0bc3d"}, + {file = "coverage-7.5.4-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:a04e990a2a41740b02d6182b498ee9796cf60eefe40cf859b016650147908029"}, + {file = "coverage-7.5.4-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:ddbd2f9713a79e8e7242d7c51f1929611e991d855f414ca9996c20e44a895f7c"}, + {file = "coverage-7.5.4-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:b1ccf5e728ccf83acd313c89f07c22d70d6c375a9c6f339233dcf792094bcbf7"}, + {file = "coverage-7.5.4-cp39-cp39-win32.whl", hash = "sha256:56b4eafa21c6c175b3ede004ca12c653a88b6f922494b023aeb1e836df953ace"}, + {file = "coverage-7.5.4-cp39-cp39-win_amd64.whl", hash = "sha256:65e528e2e921ba8fd67d9055e6b9f9e34b21ebd6768ae1c1723f4ea6ace1234d"}, + {file = "coverage-7.5.4-pp38.pp39.pp310-none-any.whl", hash = "sha256:79b356f3dd5b26f3ad23b35c75dbdaf1f9e2450b6bcefc6d0825ea0aa3f86ca5"}, + {file = "coverage-7.5.4.tar.gz", hash = "sha256:a44963520b069e12789d0faea4e9fdb1e410cdc4aab89d94f7f55cbb7fef0353"}, ] [package.extras] @@ -380,13 +380,13 @@ wmi = ["wmi (>=1.5.1)"] [[package]] name = "email-validator" -version = "2.1.1" +version = "2.2.0" description = "A robust email address syntax and deliverability validation library." optional = false python-versions = ">=3.8" files = [ - {file = "email_validator-2.1.1-py3-none-any.whl", hash = "sha256:97d882d174e2a65732fb43bfce81a3a834cbc1bde8bf419e30ef5ea976370a05"}, - {file = "email_validator-2.1.1.tar.gz", hash = "sha256:200a70680ba08904be6d1eef729205cc0d687634399a5924d842533efb824b84"}, + {file = "email_validator-2.2.0-py3-none-any.whl", hash = "sha256:561977c2d73ce3611850a06fa56b414621e0c8faa9d66f2611407d87465da631"}, + {file = "email_validator-2.2.0.tar.gz", hash = "sha256:cb690f344c617a714f22e66ae771445a1ceb46821152df8e165c5f9a364582b7"}, ] [package.dependencies] @@ -447,18 +447,18 @@ all = ["email-validator (>=2.0.0)", "httpx (>=0.23.0)", "itsdangerous (>=1.1.0)" [[package]] name = "filelock" -version = "3.14.0" +version = "3.15.4" description = "A platform independent file lock." optional = false python-versions = ">=3.8" files = [ - {file = "filelock-3.14.0-py3-none-any.whl", hash = "sha256:43339835842f110ca7ae60f1e1c160714c5a6afd15a2873419ab185334975c0f"}, - {file = "filelock-3.14.0.tar.gz", hash = "sha256:6ea72da3be9b8c82afd3edcf99f2fffbb5076335a5ae4d03248bb5b6c3eae78a"}, + {file = "filelock-3.15.4-py3-none-any.whl", hash = "sha256:6ca1fffae96225dab4c6eaf1c4f4f28cd2568d3ec2a44e15a08520504de468e7"}, + {file = "filelock-3.15.4.tar.gz", hash = "sha256:2207938cbc1844345cb01a5a95524dae30f0ce089eba5b00378295a17e3e90cb"}, ] [package.extras] docs = ["furo (>=2023.9.10)", "sphinx (>=7.2.6)", "sphinx-autodoc-typehints (>=1.25.2)"] -testing = ["covdefaults (>=2.3)", "coverage (>=7.3.2)", "diff-cover (>=8.0.1)", "pytest (>=7.4.3)", "pytest-cov (>=4.1)", "pytest-mock (>=3.12)", "pytest-timeout (>=2.2)"] +testing = ["covdefaults (>=2.3)", "coverage (>=7.3.2)", "diff-cover (>=8.0.1)", "pytest (>=7.4.3)", "pytest-asyncio (>=0.21)", "pytest-cov (>=4.1)", "pytest-mock (>=3.12)", "pytest-timeout (>=2.2)", "virtualenv (>=20.26.2)"] typing = ["typing-extensions (>=4.8)"] [[package]] @@ -1236,13 +1236,13 @@ files = [ [[package]] name = "pydantic" -version = "2.7.3" +version = "2.7.4" description = "Data validation using Python type hints" optional = false python-versions = ">=3.8" files = [ - {file = "pydantic-2.7.3-py3-none-any.whl", hash = "sha256:ea91b002777bf643bb20dd717c028ec43216b24a6001a280f83877fd2655d0b4"}, - {file = "pydantic-2.7.3.tar.gz", hash = "sha256:c46c76a40bb1296728d7a8b99aa73dd70a48c3510111ff290034f860c99c419e"}, + {file = "pydantic-2.7.4-py3-none-any.whl", hash = "sha256:ee8538d41ccb9c0a9ad3e0e5f07bf15ed8015b481ced539a1759d8cc89ae90d0"}, + {file = "pydantic-2.7.4.tar.gz", hash = "sha256:0c84efd9548d545f63ac0060c1e4d39bb9b14db8b3c0652338aecc07b5adec52"}, ] [package.dependencies] @@ -1346,13 +1346,13 @@ typing-extensions = ">=4.6.0,<4.7.0 || >4.7.0" [[package]] name = "pydantic-settings" -version = "2.3.2" +version = "2.3.4" description = "Settings management using Pydantic" optional = false python-versions = ">=3.8" files = [ - {file = "pydantic_settings-2.3.2-py3-none-any.whl", hash = "sha256:ae06e44349e4c7bff8d57aff415dfd397ae75c217a098d54e9e6990ad7594ac7"}, - {file = "pydantic_settings-2.3.2.tar.gz", hash = "sha256:05d33003c74c2cd585de97b59eb17b6ed67181bc8a3ce594d74b5d24e4df7323"}, + {file = "pydantic_settings-2.3.4-py3-none-any.whl", hash = "sha256:11ad8bacb68a045f00e4f862c7a718c8a9ec766aa8fd4c32e39a0594b207b53a"}, + {file = "pydantic_settings-2.3.4.tar.gz", hash = "sha256:c5802e3d62b78e82522319bbc9b8f8ffb28ad1c988a99311d04f2a6051fca0a7"}, ] [package.dependencies] @@ -1527,28 +1527,28 @@ use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] [[package]] name = "ruff" -version = "0.4.9" +version = "0.4.10" description = "An extremely fast Python linter and code formatter, written in Rust." optional = false python-versions = ">=3.7" files = [ - {file = "ruff-0.4.9-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:b262ed08d036ebe162123170b35703aaf9daffecb698cd367a8d585157732991"}, - {file = "ruff-0.4.9-py3-none-macosx_11_0_arm64.whl", hash = "sha256:98ec2775fd2d856dc405635e5ee4ff177920f2141b8e2d9eb5bd6efd50e80317"}, - {file = "ruff-0.4.9-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4555056049d46d8a381f746680db1c46e67ac3b00d714606304077682832998e"}, - {file = "ruff-0.4.9-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e91175fbe48f8a2174c9aad70438fe9cb0a5732c4159b2a10a3565fea2d94cde"}, - {file = "ruff-0.4.9-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0e8e7b95673f22e0efd3571fb5b0cf71a5eaaa3cc8a776584f3b2cc878e46bff"}, - {file = "ruff-0.4.9-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:2d45ddc6d82e1190ea737341326ecbc9a61447ba331b0a8962869fcada758505"}, - {file = "ruff-0.4.9-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:78de3fdb95c4af084087628132336772b1c5044f6e710739d440fc0bccf4d321"}, - {file = "ruff-0.4.9-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:06b60f91bfa5514bb689b500a25ba48e897d18fea14dce14b48a0c40d1635893"}, - {file = "ruff-0.4.9-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:88bffe9c6a454bf8529f9ab9091c99490578a593cc9f9822b7fc065ee0712a06"}, - {file = "ruff-0.4.9-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:673bddb893f21ab47a8334c8e0ea7fd6598ecc8e698da75bcd12a7b9d0a3206e"}, - {file = "ruff-0.4.9-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:8c1aff58c31948cc66d0b22951aa19edb5af0a3af40c936340cd32a8b1ab7438"}, - {file = "ruff-0.4.9-py3-none-musllinux_1_2_i686.whl", hash = "sha256:784d3ec9bd6493c3b720a0b76f741e6c2d7d44f6b2be87f5eef1ae8cc1d54c84"}, - {file = "ruff-0.4.9-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:732dd550bfa5d85af8c3c6cbc47ba5b67c6aed8a89e2f011b908fc88f87649db"}, - {file = "ruff-0.4.9-py3-none-win32.whl", hash = "sha256:8064590fd1a50dcf4909c268b0e7c2498253273309ad3d97e4a752bb9df4f521"}, - {file = "ruff-0.4.9-py3-none-win_amd64.whl", hash = "sha256:e0a22c4157e53d006530c902107c7f550b9233e9706313ab57b892d7197d8e52"}, - {file = "ruff-0.4.9-py3-none-win_arm64.whl", hash = "sha256:5d5460f789ccf4efd43f265a58538a2c24dbce15dbf560676e430375f20a8198"}, - {file = "ruff-0.4.9.tar.gz", hash = "sha256:f1cb0828ac9533ba0135d148d214e284711ede33640465e706772645483427e3"}, + {file = "ruff-0.4.10-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:5c2c4d0859305ac5a16310eec40e4e9a9dec5dcdfbe92697acd99624e8638dac"}, + {file = "ruff-0.4.10-py3-none-macosx_11_0_arm64.whl", hash = "sha256:a79489607d1495685cdd911a323a35871abfb7a95d4f98fc6f85e799227ac46e"}, + {file = "ruff-0.4.10-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b1dd1681dfa90a41b8376a61af05cc4dc5ff32c8f14f5fe20dba9ff5deb80cd6"}, + {file = "ruff-0.4.10-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:c75c53bb79d71310dc79fb69eb4902fba804a81f374bc86a9b117a8d077a1784"}, + {file = "ruff-0.4.10-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:18238c80ee3d9100d3535d8eb15a59c4a0753b45cc55f8bf38f38d6a597b9739"}, + {file = "ruff-0.4.10-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:d8f71885bce242da344989cae08e263de29752f094233f932d4f5cfb4ef36a81"}, + {file = "ruff-0.4.10-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:330421543bd3222cdfec481e8ff3460e8702ed1e58b494cf9d9e4bf90db52b9d"}, + {file = "ruff-0.4.10-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9e9b6fb3a37b772628415b00c4fc892f97954275394ed611056a4b8a2631365e"}, + {file = "ruff-0.4.10-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0f54c481b39a762d48f64d97351048e842861c6662d63ec599f67d515cb417f6"}, + {file = "ruff-0.4.10-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:67fe086b433b965c22de0b4259ddfe6fa541c95bf418499bedb9ad5fb8d1c631"}, + {file = "ruff-0.4.10-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:acfaaab59543382085f9eb51f8e87bac26bf96b164839955f244d07125a982ef"}, + {file = "ruff-0.4.10-py3-none-musllinux_1_2_i686.whl", hash = "sha256:3cea07079962b2941244191569cf3a05541477286f5cafea638cd3aa94b56815"}, + {file = "ruff-0.4.10-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:338a64ef0748f8c3a80d7f05785930f7965d71ca260904a9321d13be24b79695"}, + {file = "ruff-0.4.10-py3-none-win32.whl", hash = "sha256:ffe3cd2f89cb54561c62e5fa20e8f182c0a444934bf430515a4b422f1ab7b7ca"}, + {file = "ruff-0.4.10-py3-none-win_amd64.whl", hash = "sha256:67f67cef43c55ffc8cc59e8e0b97e9e60b4837c8f21e8ab5ffd5d66e196e25f7"}, + {file = "ruff-0.4.10-py3-none-win_arm64.whl", hash = "sha256:dd1fcee327c20addac7916ca4e2653fbbf2e8388d8a6477ce5b4e986b68ae6c0"}, + {file = "ruff-0.4.10.tar.gz", hash = "sha256:3aa4f2bc388a30d346c56524f7cacca85945ba124945fe489952aadb6b5cd804"}, ] [[package]] @@ -1623,64 +1623,64 @@ files = [ [[package]] name = "sqlalchemy" -version = "2.0.30" +version = "2.0.31" description = "Database Abstraction Library" optional = false python-versions = ">=3.7" files = [ - {file = "SQLAlchemy-2.0.30-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:3b48154678e76445c7ded1896715ce05319f74b1e73cf82d4f8b59b46e9c0ddc"}, - {file = "SQLAlchemy-2.0.30-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:2753743c2afd061bb95a61a51bbb6a1a11ac1c44292fad898f10c9839a7f75b2"}, - {file = "SQLAlchemy-2.0.30-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a7bfc726d167f425d4c16269a9a10fe8630ff6d14b683d588044dcef2d0f6be7"}, - {file = "SQLAlchemy-2.0.30-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c4f61ada6979223013d9ab83a3ed003ded6959eae37d0d685db2c147e9143797"}, - {file = "SQLAlchemy-2.0.30-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:3a365eda439b7a00732638f11072907c1bc8e351c7665e7e5da91b169af794af"}, - {file = "SQLAlchemy-2.0.30-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:bba002a9447b291548e8d66fd8c96a6a7ed4f2def0bb155f4f0a1309fd2735d5"}, - {file = "SQLAlchemy-2.0.30-cp310-cp310-win32.whl", hash = "sha256:0138c5c16be3600923fa2169532205d18891b28afa817cb49b50e08f62198bb8"}, - {file = "SQLAlchemy-2.0.30-cp310-cp310-win_amd64.whl", hash = "sha256:99650e9f4cf3ad0d409fed3eec4f071fadd032e9a5edc7270cd646a26446feeb"}, - {file = "SQLAlchemy-2.0.30-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:955991a09f0992c68a499791a753523f50f71a6885531568404fa0f231832aa0"}, - {file = "SQLAlchemy-2.0.30-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f69e4c756ee2686767eb80f94c0125c8b0a0b87ede03eacc5c8ae3b54b99dc46"}, - {file = "SQLAlchemy-2.0.30-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:69c9db1ce00e59e8dd09d7bae852a9add716efdc070a3e2068377e6ff0d6fdaa"}, - {file = "SQLAlchemy-2.0.30-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a1429a4b0f709f19ff3b0cf13675b2b9bfa8a7e79990003207a011c0db880a13"}, - {file = "SQLAlchemy-2.0.30-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:efedba7e13aa9a6c8407c48facfdfa108a5a4128e35f4c68f20c3407e4376aa9"}, - {file = "SQLAlchemy-2.0.30-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:16863e2b132b761891d6c49f0a0f70030e0bcac4fd208117f6b7e053e68668d0"}, - {file = "SQLAlchemy-2.0.30-cp311-cp311-win32.whl", hash = "sha256:2ecabd9ccaa6e914e3dbb2aa46b76dede7eadc8cbf1b8083c94d936bcd5ffb49"}, - {file = "SQLAlchemy-2.0.30-cp311-cp311-win_amd64.whl", hash = "sha256:0b3f4c438e37d22b83e640f825ef0f37b95db9aa2d68203f2c9549375d0b2260"}, - {file = "SQLAlchemy-2.0.30-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:5a79d65395ac5e6b0c2890935bad892eabb911c4aa8e8015067ddb37eea3d56c"}, - {file = "SQLAlchemy-2.0.30-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:9a5baf9267b752390252889f0c802ea13b52dfee5e369527da229189b8bd592e"}, - {file = "SQLAlchemy-2.0.30-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3cb5a646930c5123f8461f6468901573f334c2c63c795b9af350063a736d0134"}, - {file = "SQLAlchemy-2.0.30-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:296230899df0b77dec4eb799bcea6fbe39a43707ce7bb166519c97b583cfcab3"}, - {file = "SQLAlchemy-2.0.30-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:c62d401223f468eb4da32627bffc0c78ed516b03bb8a34a58be54d618b74d472"}, - {file = "SQLAlchemy-2.0.30-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:3b69e934f0f2b677ec111b4d83f92dc1a3210a779f69bf905273192cf4ed433e"}, - {file = "SQLAlchemy-2.0.30-cp312-cp312-win32.whl", hash = "sha256:77d2edb1f54aff37e3318f611637171e8ec71472f1fdc7348b41dcb226f93d90"}, - {file = "SQLAlchemy-2.0.30-cp312-cp312-win_amd64.whl", hash = "sha256:b6c7ec2b1f4969fc19b65b7059ed00497e25f54069407a8701091beb69e591a5"}, - {file = "SQLAlchemy-2.0.30-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:5a8e3b0a7e09e94be7510d1661339d6b52daf202ed2f5b1f9f48ea34ee6f2d57"}, - {file = "SQLAlchemy-2.0.30-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b60203c63e8f984df92035610c5fb76d941254cf5d19751faab7d33b21e5ddc0"}, - {file = "SQLAlchemy-2.0.30-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f1dc3eabd8c0232ee8387fbe03e0a62220a6f089e278b1f0aaf5e2d6210741ad"}, - {file = "SQLAlchemy-2.0.30-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:40ad017c672c00b9b663fcfcd5f0864a0a97828e2ee7ab0c140dc84058d194cf"}, - {file = "SQLAlchemy-2.0.30-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:e42203d8d20dc704604862977b1470a122e4892791fe3ed165f041e4bf447a1b"}, - {file = "SQLAlchemy-2.0.30-cp37-cp37m-win32.whl", hash = "sha256:2a4f4da89c74435f2bc61878cd08f3646b699e7d2eba97144030d1be44e27584"}, - {file = "SQLAlchemy-2.0.30-cp37-cp37m-win_amd64.whl", hash = "sha256:b6bf767d14b77f6a18b6982cbbf29d71bede087edae495d11ab358280f304d8e"}, - {file = "SQLAlchemy-2.0.30-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:bc0c53579650a891f9b83fa3cecd4e00218e071d0ba00c4890f5be0c34887ed3"}, - {file = "SQLAlchemy-2.0.30-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:311710f9a2ee235f1403537b10c7687214bb1f2b9ebb52702c5aa4a77f0b3af7"}, - {file = "SQLAlchemy-2.0.30-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:408f8b0e2c04677e9c93f40eef3ab22f550fecb3011b187f66a096395ff3d9fd"}, - {file = "SQLAlchemy-2.0.30-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:37a4b4fb0dd4d2669070fb05b8b8824afd0af57587393015baee1cf9890242d9"}, - {file = "SQLAlchemy-2.0.30-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:a943d297126c9230719c27fcbbeab57ecd5d15b0bd6bfd26e91bfcfe64220621"}, - {file = "SQLAlchemy-2.0.30-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:0a089e218654e740a41388893e090d2e2c22c29028c9d1353feb38638820bbeb"}, - {file = "SQLAlchemy-2.0.30-cp38-cp38-win32.whl", hash = "sha256:fa561138a64f949f3e889eb9ab8c58e1504ab351d6cf55259dc4c248eaa19da6"}, - {file = "SQLAlchemy-2.0.30-cp38-cp38-win_amd64.whl", hash = "sha256:7d74336c65705b986d12a7e337ba27ab2b9d819993851b140efdf029248e818e"}, - {file = "SQLAlchemy-2.0.30-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:ae8c62fe2480dd61c532ccafdbce9b29dacc126fe8be0d9a927ca3e699b9491a"}, - {file = "SQLAlchemy-2.0.30-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:2383146973a15435e4717f94c7509982770e3e54974c71f76500a0136f22810b"}, - {file = "SQLAlchemy-2.0.30-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8409de825f2c3b62ab15788635ccaec0c881c3f12a8af2b12ae4910a0a9aeef6"}, - {file = "SQLAlchemy-2.0.30-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0094c5dc698a5f78d3d1539853e8ecec02516b62b8223c970c86d44e7a80f6c7"}, - {file = "SQLAlchemy-2.0.30-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:edc16a50f5e1b7a06a2dcc1f2205b0b961074c123ed17ebda726f376a5ab0953"}, - {file = "SQLAlchemy-2.0.30-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:f7703c2010355dd28f53deb644a05fc30f796bd8598b43f0ba678878780b6e4c"}, - {file = "SQLAlchemy-2.0.30-cp39-cp39-win32.whl", hash = "sha256:1f9a727312ff6ad5248a4367358e2cf7e625e98b1028b1d7ab7b806b7d757513"}, - {file = "SQLAlchemy-2.0.30-cp39-cp39-win_amd64.whl", hash = "sha256:a0ef36b28534f2a5771191be6edb44cc2673c7b2edf6deac6562400288664221"}, - {file = "SQLAlchemy-2.0.30-py3-none-any.whl", hash = "sha256:7108d569d3990c71e26a42f60474b4c02c8586c4681af5fd67e51a044fdea86a"}, - {file = "SQLAlchemy-2.0.30.tar.gz", hash = "sha256:2b1708916730f4830bc69d6f49d37f7698b5bd7530aca7f04f785f8849e95255"}, + {file = "SQLAlchemy-2.0.31-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:f2a213c1b699d3f5768a7272de720387ae0122f1becf0901ed6eaa1abd1baf6c"}, + {file = "SQLAlchemy-2.0.31-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9fea3d0884e82d1e33226935dac990b967bef21315cbcc894605db3441347443"}, + {file = "SQLAlchemy-2.0.31-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f3ad7f221d8a69d32d197e5968d798217a4feebe30144986af71ada8c548e9fa"}, + {file = "SQLAlchemy-2.0.31-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9f2bee229715b6366f86a95d497c347c22ddffa2c7c96143b59a2aa5cc9eebbc"}, + {file = "SQLAlchemy-2.0.31-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:cd5b94d4819c0c89280b7c6109c7b788a576084bf0a480ae17c227b0bc41e109"}, + {file = "SQLAlchemy-2.0.31-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:750900a471d39a7eeba57580b11983030517a1f512c2cb287d5ad0fcf3aebd58"}, + {file = "SQLAlchemy-2.0.31-cp310-cp310-win32.whl", hash = "sha256:7bd112be780928c7f493c1a192cd8c5fc2a2a7b52b790bc5a84203fb4381c6be"}, + {file = "SQLAlchemy-2.0.31-cp310-cp310-win_amd64.whl", hash = "sha256:5a48ac4d359f058474fadc2115f78a5cdac9988d4f99eae44917f36aa1476327"}, + {file = "SQLAlchemy-2.0.31-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:f68470edd70c3ac3b6cd5c2a22a8daf18415203ca1b036aaeb9b0fb6f54e8298"}, + {file = "SQLAlchemy-2.0.31-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:2e2c38c2a4c5c634fe6c3c58a789712719fa1bf9b9d6ff5ebfce9a9e5b89c1ca"}, + {file = "SQLAlchemy-2.0.31-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bd15026f77420eb2b324dcb93551ad9c5f22fab2c150c286ef1dc1160f110203"}, + {file = "SQLAlchemy-2.0.31-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2196208432deebdfe3b22185d46b08f00ac9d7b01284e168c212919891289396"}, + {file = "SQLAlchemy-2.0.31-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:352b2770097f41bff6029b280c0e03b217c2dcaddc40726f8f53ed58d8a85da4"}, + {file = "SQLAlchemy-2.0.31-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:56d51ae825d20d604583f82c9527d285e9e6d14f9a5516463d9705dab20c3740"}, + {file = "SQLAlchemy-2.0.31-cp311-cp311-win32.whl", hash = "sha256:6e2622844551945db81c26a02f27d94145b561f9d4b0c39ce7bfd2fda5776dac"}, + {file = "SQLAlchemy-2.0.31-cp311-cp311-win_amd64.whl", hash = "sha256:ccaf1b0c90435b6e430f5dd30a5aede4764942a695552eb3a4ab74ed63c5b8d3"}, + {file = "SQLAlchemy-2.0.31-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:3b74570d99126992d4b0f91fb87c586a574a5872651185de8297c6f90055ae42"}, + {file = "SQLAlchemy-2.0.31-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:6f77c4f042ad493cb8595e2f503c7a4fe44cd7bd59c7582fd6d78d7e7b8ec52c"}, + {file = "SQLAlchemy-2.0.31-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cd1591329333daf94467e699e11015d9c944f44c94d2091f4ac493ced0119449"}, + {file = "SQLAlchemy-2.0.31-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:74afabeeff415e35525bf7a4ecdab015f00e06456166a2eba7590e49f8db940e"}, + {file = "SQLAlchemy-2.0.31-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:b9c01990d9015df2c6f818aa8f4297d42ee71c9502026bb074e713d496e26b67"}, + {file = "SQLAlchemy-2.0.31-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:66f63278db425838b3c2b1c596654b31939427016ba030e951b292e32b99553e"}, + {file = "SQLAlchemy-2.0.31-cp312-cp312-win32.whl", hash = "sha256:0b0f658414ee4e4b8cbcd4a9bb0fd743c5eeb81fc858ca517217a8013d282c96"}, + {file = "SQLAlchemy-2.0.31-cp312-cp312-win_amd64.whl", hash = "sha256:fa4b1af3e619b5b0b435e333f3967612db06351217c58bfb50cee5f003db2a5a"}, + {file = "SQLAlchemy-2.0.31-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:f43e93057cf52a227eda401251c72b6fbe4756f35fa6bfebb5d73b86881e59b0"}, + {file = "SQLAlchemy-2.0.31-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d337bf94052856d1b330d5fcad44582a30c532a2463776e1651bd3294ee7e58b"}, + {file = "SQLAlchemy-2.0.31-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c06fb43a51ccdff3b4006aafee9fcf15f63f23c580675f7734245ceb6b6a9e05"}, + {file = "SQLAlchemy-2.0.31-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:b6e22630e89f0e8c12332b2b4c282cb01cf4da0d26795b7eae16702a608e7ca1"}, + {file = "SQLAlchemy-2.0.31-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:79a40771363c5e9f3a77f0e28b3302801db08040928146e6808b5b7a40749c88"}, + {file = "SQLAlchemy-2.0.31-cp37-cp37m-win32.whl", hash = "sha256:501ff052229cb79dd4c49c402f6cb03b5a40ae4771efc8bb2bfac9f6c3d3508f"}, + {file = "SQLAlchemy-2.0.31-cp37-cp37m-win_amd64.whl", hash = "sha256:597fec37c382a5442ffd471f66ce12d07d91b281fd474289356b1a0041bdf31d"}, + {file = "SQLAlchemy-2.0.31-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:dc6d69f8829712a4fd799d2ac8d79bdeff651c2301b081fd5d3fe697bd5b4ab9"}, + {file = "SQLAlchemy-2.0.31-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:23b9fbb2f5dd9e630db70fbe47d963c7779e9c81830869bd7d137c2dc1ad05fb"}, + {file = "SQLAlchemy-2.0.31-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2a21c97efcbb9f255d5c12a96ae14da873233597dfd00a3a0c4ce5b3e5e79704"}, + {file = "SQLAlchemy-2.0.31-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:26a6a9837589c42b16693cf7bf836f5d42218f44d198f9343dd71d3164ceeeac"}, + {file = "SQLAlchemy-2.0.31-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:dc251477eae03c20fae8db9c1c23ea2ebc47331bcd73927cdcaecd02af98d3c3"}, + {file = "SQLAlchemy-2.0.31-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:2fd17e3bb8058359fa61248c52c7b09a97cf3c820e54207a50af529876451808"}, + {file = "SQLAlchemy-2.0.31-cp38-cp38-win32.whl", hash = "sha256:c76c81c52e1e08f12f4b6a07af2b96b9b15ea67ccdd40ae17019f1c373faa227"}, + {file = "SQLAlchemy-2.0.31-cp38-cp38-win_amd64.whl", hash = "sha256:4b600e9a212ed59355813becbcf282cfda5c93678e15c25a0ef896b354423238"}, + {file = "SQLAlchemy-2.0.31-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:5b6cf796d9fcc9b37011d3f9936189b3c8074a02a4ed0c0fbbc126772c31a6d4"}, + {file = "SQLAlchemy-2.0.31-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:78fe11dbe37d92667c2c6e74379f75746dc947ee505555a0197cfba9a6d4f1a4"}, + {file = "SQLAlchemy-2.0.31-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2fc47dc6185a83c8100b37acda27658fe4dbd33b7d5e7324111f6521008ab4fe"}, + {file = "SQLAlchemy-2.0.31-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8a41514c1a779e2aa9a19f67aaadeb5cbddf0b2b508843fcd7bafdf4c6864005"}, + {file = "SQLAlchemy-2.0.31-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:afb6dde6c11ea4525318e279cd93c8734b795ac8bb5dda0eedd9ebaca7fa23f1"}, + {file = "SQLAlchemy-2.0.31-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:3f9faef422cfbb8fd53716cd14ba95e2ef655400235c3dfad1b5f467ba179c8c"}, + {file = "SQLAlchemy-2.0.31-cp39-cp39-win32.whl", hash = "sha256:fc6b14e8602f59c6ba893980bea96571dd0ed83d8ebb9c4479d9ed5425d562e9"}, + {file = "SQLAlchemy-2.0.31-cp39-cp39-win_amd64.whl", hash = "sha256:3cb8a66b167b033ec72c3812ffc8441d4e9f5f78f5e31e54dcd4c90a4ca5bebc"}, + {file = "SQLAlchemy-2.0.31-py3-none-any.whl", hash = "sha256:69f3e3c08867a8e4856e92d7afb618b95cdee18e0bc1647b77599722c9a28911"}, + {file = "SQLAlchemy-2.0.31.tar.gz", hash = "sha256:b607489dd4a54de56984a0c7656247504bd5523d9d0ba799aef59d4add009484"}, ] [package.dependencies] -greenlet = {version = "!=0.4.17", markers = "platform_machine == \"aarch64\" or platform_machine == \"ppc64le\" or platform_machine == \"x86_64\" or platform_machine == \"amd64\" or platform_machine == \"AMD64\" or platform_machine == \"win32\" or platform_machine == \"WIN32\""} +greenlet = {version = "!=0.4.17", markers = "python_version < \"3.13\" and (platform_machine == \"aarch64\" or platform_machine == \"ppc64le\" or platform_machine == \"x86_64\" or platform_machine == \"amd64\" or platform_machine == \"AMD64\" or platform_machine == \"win32\" or platform_machine == \"WIN32\")"} typing-extensions = ">=4.6.0" [package.extras] @@ -1742,13 +1742,13 @@ full = ["httpx (>=0.22.0)", "itsdangerous", "jinja2", "python-multipart (>=0.0.7 [[package]] name = "tenacity" -version = "8.3.0" +version = "8.4.2" description = "Retry code until it succeeds" optional = false python-versions = ">=3.8" files = [ - {file = "tenacity-8.3.0-py3-none-any.whl", hash = "sha256:3649f6443dbc0d9b01b9d8020a9c4ec7a1ff5f6f3c6c8a036ef371f573fe9185"}, - {file = "tenacity-8.3.0.tar.gz", hash = "sha256:953d4e6ad24357bceffbc9707bc74349aca9d245f68eb65419cf0c249a1949a2"}, + {file = "tenacity-8.4.2-py3-none-any.whl", hash = "sha256:9e6f7cf7da729125c7437222f8a522279751cdfbe6b67bfe64f75d3a348661b2"}, + {file = "tenacity-8.4.2.tar.gz", hash = "sha256:cd80a53a79336edba8489e767f729e4f391c896956b57140b5d7511a64bbd3ef"}, ] [package.extras] @@ -1801,13 +1801,13 @@ files = [ [[package]] name = "urllib3" -version = "2.2.1" +version = "2.2.2" description = "HTTP library with thread-safe connection pooling, file post, and more." optional = false python-versions = ">=3.8" files = [ - {file = "urllib3-2.2.1-py3-none-any.whl", hash = "sha256:450b20ec296a467077128bff42b73080516e71b56ff59a60a02bef2232c4fa9d"}, - {file = "urllib3-2.2.1.tar.gz", hash = "sha256:d0570876c61ab9e520d776c38acbbb5b05a776d3f9ff98a5c8fd5162a444cf19"}, + {file = "urllib3-2.2.2-py3-none-any.whl", hash = "sha256:a448b2f64d686155468037e1ace9f2d2199776e17f0a46610480d311f73e3472"}, + {file = "urllib3-2.2.2.tar.gz", hash = "sha256:dd505485549a7a552833da5e6063639d0d177c04f23bc3864e41e5dc5f612168"}, ] [package.extras] @@ -1888,13 +1888,13 @@ test = ["Cython (>=0.29.36,<0.30.0)", "aiohttp (==3.9.0b0)", "aiohttp (>=3.8.1)" [[package]] name = "virtualenv" -version = "20.26.2" +version = "20.26.3" description = "Virtual Python Environment builder" optional = false python-versions = ">=3.7" files = [ - {file = "virtualenv-20.26.2-py3-none-any.whl", hash = "sha256:a624db5e94f01ad993d476b9ee5346fdf7b9de43ccaee0e0197012dc838a0e9b"}, - {file = "virtualenv-20.26.2.tar.gz", hash = "sha256:82bf0f4eebbb78d36ddaee0283d43fe5736b53880b8a8cdcd37390a07ac3741c"}, + {file = "virtualenv-20.26.3-py3-none-any.whl", hash = "sha256:8cc4a31139e796e9a7de2cd5cf2489de1217193116a8fd42328f1bd65f434589"}, + {file = "virtualenv-20.26.3.tar.gz", hash = "sha256:4c43a2a236279d9ea36a0d76f98d84bd6ca94ac4e0f4a3b9d46d05e10fea542a"}, ] [package.dependencies] @@ -2077,4 +2077,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "9cbeb468417c39b9d7d2d4d1eb9d24b359d982e181bc28776ab3c32a4f6c60f5" +content-hash = "6eb90f6cd92e9ff2c1f7551624377d8c5d7a2c754bc1793e0db0ac9a4df07636" diff --git a/backend/pyproject.toml b/backend/pyproject.toml index 78e220c9ef..efef4855d8 100644 --- a/backend/pyproject.toml +++ b/backend/pyproject.toml @@ -19,7 +19,7 @@ gunicorn = "^22.0.0" jinja2 = "^3.1.4" alembic = "^1.12.1" httpx = "^0.25.1" -psycopg = {extras = ["binary"], version = "^3.1.13"} +psycopg = {extras = ["binary"], version = "^3.1.19"} sqlmodel = "^0.0.16" # Pin bcrypt until passlib supports the latest bcrypt = "4.0.1" diff --git a/custom_postgresql.conf b/custom_postgresql.conf new file mode 100644 index 0000000000..4606957a09 --- /dev/null +++ b/custom_postgresql.conf @@ -0,0 +1,5 @@ +# custom_postgresql.conf + +logging_collector = on +log_directory = 'log' +log_filename = 'postgresql.log' \ No newline at end of file diff --git a/docker-compose.override.yml b/docker-compose.override.yml index 9fdf8f369d..9357d6e787 100644 --- a/docker-compose.override.yml +++ b/docker-compose.override.yml @@ -44,6 +44,8 @@ services: restart: "no" ports: - "5432:5432" + + adminer: restart: "no" diff --git a/docker-compose.yml b/docker-compose.yml index 3f8c3cc903..2215951d8c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,6 +4,8 @@ services: restart: always volumes: - app-db-data:/var/lib/postgresql/data/pgdata + - ./custom_postgresql.conf:/etc/postgresql/postgresql.conf + - ./logs:/var/lib/postgresql/data/pgdata/log env_file: - .env environment: @@ -11,6 +13,8 @@ services: - POSTGRES_PASSWORD=${POSTGRES_PASSWORD?Variable not set} - POSTGRES_USER=${POSTGRES_USER?Variable not set} - POSTGRES_DB=${POSTGRES_DB?Variable not set} + + adminer: image: adminer diff --git a/frontend/src/client/models.ts b/frontend/src/client/models.ts index 8e35850493..da9abaa026 100644 --- a/frontend/src/client/models.ts +++ b/frontend/src/client/models.ts @@ -6,13 +6,13 @@ export type AuthoritiesPublic = { export type AuthorityCreate = { - name: string; + name?: string | null; }; export type AuthorityPublic = { - name: string; + name?: string | null; id: number; owner_id: number; }; @@ -69,7 +69,31 @@ export type Circs_GroupsPublic = { export type ClaimCreate = { client_firstname: string; client_lastname: string; - authority_id: number; + client_address_1?: string | null; + client_address_town?: string | null; + client_address_postcode?: string | null; + client_vehicle_reg?: string | null; + client_insurer?: string | null; + client_insurer_policyno?: string | null; + client_phone?: string | null; + client_mobile?: string | null; + client_email?: string | null; + authority_id?: number | null; + plate_type?: string | null; + accident_date?: string | null; + accident_time?: string | null; + accident_location?: string | null; + accident_circs?: string | null; + tp_firstname?: string | null; + tp_lastname?: string | null; + tp_address_1?: string | null; + tp_address_town?: string | null; + tp_address_postcode?: string | null; + tp_vehicle_reg?: string | null; + tp_insurer?: string | null; + tp_insurer_polcyno?: string | null; + tp_phone?: string | null; + tp_mobile?: string | null; }; @@ -77,7 +101,31 @@ export type ClaimCreate = { export type ClaimPublic = { client_firstname: string; client_lastname: string; - authority_id: number; + client_address_1?: string | null; + client_address_town?: string | null; + client_address_postcode?: string | null; + client_vehicle_reg?: string | null; + client_insurer?: string | null; + client_insurer_policyno?: string | null; + client_phone?: string | null; + client_mobile?: string | null; + client_email?: string | null; + authority_id?: number | null; + plate_type?: string | null; + accident_date?: string | null; + accident_time?: string | null; + accident_location?: string | null; + accident_circs?: string | null; + tp_firstname?: string | null; + tp_lastname?: string | null; + tp_address_1?: string | null; + tp_address_town?: string | null; + tp_address_postcode?: string | null; + tp_vehicle_reg?: string | null; + tp_insurer?: string | null; + tp_insurer_polcyno?: string | null; + tp_phone?: string | null; + tp_mobile?: string | null; id: number; }; @@ -86,7 +134,31 @@ export type ClaimPublic = { export type ClaimUpdate = { client_firstname?: string | null; client_lastname?: string | null; - authority_id: number; + client_address_1?: string | null; + client_address_town?: string | null; + client_address_postcode?: string | null; + client_vehicle_reg?: string | null; + client_insurer?: string | null; + client_insurer_policyno?: string | null; + client_phone?: string | null; + client_mobile?: string | null; + client_email?: string | null; + authority_id?: number | null; + plate_type?: string | null; + accident_date?: string | null; + accident_time?: string | null; + accident_location?: string | null; + accident_circs?: string | null; + tp_firstname?: string | null; + tp_lastname?: string | null; + tp_address_1?: string | null; + tp_address_town?: string | null; + tp_address_postcode?: string | null; + tp_vehicle_reg?: string | null; + tp_insurer?: string | null; + tp_insurer_polcyno?: string | null; + tp_phone?: string | null; + tp_mobile?: string | null; }; @@ -148,36 +220,55 @@ export type NewPassword = { export type ReferralCreate = { - source_id: number; - claim_id: number; + source_id?: number | null; + claim_id?: number | null; + supplier_id?: number | null; + type?: string | null; + authority_id?: number | null; }; export type ReferralPublic = { - source_id: number; - claim_id: number; + source_id?: number | null; + claim_id?: number | null; + supplier_id?: number | null; + type?: string | null; + authority_id?: number | null; id: number; - owner_id: number; + source: Source; }; export type ReferralUpdate = { source_id?: number | null; - claim_id: number; + claim_id?: number | null; + supplier_id?: number | null; + type?: string | null; + authority_id?: number | null; + daystohire?: number | null; + creditrepair?: string | null; }; export type Referral_AllocationCreate = { - Source: string; + supplier_id: number; + referral_id: number; + sentdate: string; + status: string; + responsedate?: string | null; }; export type Referral_AllocationPublic = { - Source: string; + supplier_id?: number | null; + referral_id?: number | null; + sentdate?: string | null; + status?: string | null; + responsedate?: string | null; id: number; owner_id: number; }; @@ -185,7 +276,11 @@ export type Referral_AllocationPublic = { export type Referral_AllocationUpdate = { - Source?: string | null; + supplier_id?: number | null; + referral_id?: number | null; + sentdate?: string | null; + status?: string | null; + responsedate?: string | null; }; @@ -205,11 +300,50 @@ export type ReferralsPublic = { export type RequestCreate = { - type: string; source_id: number; + type?: string | null; + daystohire?: number | null; + creditrepair?: string | null; + authority_id?: number | null; client_firstname: string; client_lastname: string; - authority_id: number; + client_address_1?: string | null; + client_address_town?: string | null; + client_address_postcode?: string | null; + client_vehicle_reg?: string | null; + client_insurer?: string | null; + client_insurer_policyno?: string | null; + client_phone?: string | null; + client_mobile?: string | null; + client_email?: string | null; + plate_type?: string | null; + accident_date?: string | null; + accident_time?: string | null; + accident_location?: string | null; + accident_circs?: string | null; + tp_firstname?: string | null; + tp_lastname?: string | null; + tp_address_1?: string | null; + tp_address_town?: string | null; + tp_address_postcode?: string | null; + tp_vehicle_reg?: string | null; + tp_insurer?: string | null; + tp_insurer_polcyno?: string | null; + tp_phone?: string | null; + tp_mobile?: string | null; + circs_grade_id?: number | null; + veh_group_id?: number | null; + circs_group_id?: number | null; +}; + + + +export type Source = { + created_datetime?: string | null; + updated_datetime?: string | null; + source_name: string; + id?: number | null; + owner_id?: number | null; }; @@ -223,7 +357,6 @@ export type SourceCreate = { export type SourcePublic = { source_name: string; id: number; - owner_id: number; }; @@ -235,21 +368,40 @@ export type SourceUpdate = { export type Source_RateCreate = { - rate: number; + authority_id?: number | null; + plate_type?: string | null; + veh_group_id?: number | null; + circs_group_id?: number | null; + type?: string | null; + rate?: number | null; + hire_length?: number | null; + source_id?: number | null; }; export type Source_RatePublic = { - rate: number; - id: number; - owner_id: number; + authority_id?: number | null; + plate_type?: string | null; + veh_group_id?: number | null; + circs_group_id?: number | null; + type?: string | null; + rate?: number | null; + hire_length?: number | null; + source_id?: number | null; }; export type Source_RateUpdate = { + authority_id?: number | null; + plate_type?: string | null; + veh_group_id?: number | null; + circs_group_id?: number | null; + type?: string | null; rate?: number | null; + hire_length?: number | null; + source_id?: number | null; }; @@ -270,32 +422,63 @@ export type SourcesPublic = { export type SupplierCreate = { name: string; + address_1?: string | null; + address_town?: string | null; + address_postcode?: string | null; + base_rate: number; + Email?: string | null; + Tel?: number | null; }; export type SupplierPublic = { name: string; + address_1?: string | null; + address_town?: string | null; + address_postcode?: string | null; + base_rate: number; + Email?: string | null; + Tel?: number | null; id: number; - owner_id: number; }; export type SupplierUpdate = { name?: string | null; + address_1?: string | null; + address_town?: string | null; + address_postcode?: string | null; + base_rate?: number | null; + Email?: string | null; + Tel?: number | null; }; export type Supplier_RateCreate = { - rate: number; + authority_id?: number | null; + plate_type?: string | null; + veh_group_id?: number | null; + circs_group_id?: number | null; + type?: string | null; + rate?: number | null; + hire_length?: number | null; + supplier_id?: number | null; }; export type Supplier_RatePublic = { - rate: number; + authority_id?: number | null; + plate_type?: string | null; + veh_group_id?: number | null; + circs_group_id?: number | null; + type?: string | null; + rate?: number | null; + hire_length?: number | null; + supplier_id?: number | null; id: number; owner_id: number; }; @@ -303,7 +486,14 @@ export type Supplier_RatePublic = { export type Supplier_RateUpdate = { + authority_id?: number | null; + plate_type?: string | null; + veh_group_id?: number | null; + circs_group_id?: number | null; + type?: string | null; rate?: number | null; + hire_length?: number | null; + supplier_id?: number | null; }; @@ -397,15 +587,15 @@ export type ValidationError = { export type Veh_GroupCreate = { - group: string; - desc: string; + group?: string | null; + desc?: string | null; }; export type Veh_GroupPublic = { - group: string; - desc: string; + group?: string | null; + desc?: string | null; id: number; owner_id: number; }; diff --git a/frontend/src/client/schemas.ts b/frontend/src/client/schemas.ts index 158080585c..41e52e0569 100644 --- a/frontend/src/client/schemas.ts +++ b/frontend/src/client/schemas.ts @@ -17,8 +17,12 @@ export const $AuthoritiesPublic = { export const $AuthorityCreate = { properties: { name: { + type: 'any-of', + contains: [{ type: 'string', - isRequired: true, +}, { + type: 'null', +}], }, }, } as const; @@ -26,8 +30,12 @@ export const $AuthorityCreate = { export const $AuthorityPublic = { properties: { name: { + type: 'any-of', + contains: [{ type: 'string', - isRequired: true, +}, { + type: 'null', +}], }, id: { type: 'number', @@ -176,37 +184,47 @@ export const $ClaimCreate = { type: 'string', isRequired: true, }, - authority_id: { - type: 'number', - isRequired: true, + client_address_1: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], }, - }, -} as const; - -export const $ClaimPublic = { - properties: { - client_firstname: { + client_address_town: { + type: 'any-of', + contains: [{ type: 'string', - isRequired: true, +}, { + type: 'null', +}], }, - client_lastname: { + client_address_postcode: { + type: 'any-of', + contains: [{ type: 'string', - isRequired: true, +}, { + type: 'null', +}], }, - authority_id: { - type: 'number', - isRequired: true, + client_vehicle_reg: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], }, - id: { - type: 'number', - isRequired: true, + client_insurer: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], }, - }, -} as const; - -export const $ClaimUpdate = { - properties: { - client_firstname: { + client_insurer_policyno: { type: 'any-of', contains: [{ type: 'string', @@ -214,7 +232,7 @@ export const $ClaimUpdate = { type: 'null', }], }, - client_lastname: { + client_phone: { type: 'any-of', contains: [{ type: 'string', @@ -222,64 +240,57 @@ export const $ClaimUpdate = { type: 'null', }], }, - authority_id: { - type: 'number', - isRequired: true, + client_mobile: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], }, - }, -} as const; - -export const $ClaimsPublic = { - properties: { - data: { - type: 'array', - contains: { - type: 'ClaimPublic', - }, - isRequired: true, + client_email: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], }, - count: { + authority_id: { + type: 'any-of', + contains: [{ type: 'number', - isRequired: true, -}, - }, -} as const; - -export const $HTTPValidationError = { - properties: { - detail: { - type: 'array', - contains: { - type: 'ValidationError', - }, +}, { + type: 'null', +}], }, - }, -} as const; - -export const $ItemCreate = { - properties: { - title: { + plate_type: { + type: 'any-of', + contains: [{ type: 'string', - isRequired: true, +}, { + type: 'null', +}], }, - description: { + accident_date: { type: 'any-of', contains: [{ type: 'string', + format: 'date', }, { type: 'null', }], }, - }, -} as const; - -export const $ItemPublic = { - properties: { - title: { + accident_time: { + type: 'any-of', + contains: [{ type: 'string', - isRequired: true, + format: 'time', +}, { + type: 'null', +}], }, - description: { + accident_location: { type: 'any-of', contains: [{ type: 'string', @@ -287,20 +298,23 @@ export const $ItemPublic = { type: 'null', }], }, - id: { - type: 'number', - isRequired: true, + accident_circs: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], }, - owner_id: { - type: 'number', - isRequired: true, + tp_firstname: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], }, - }, -} as const; - -export const $ItemUpdate = { - properties: { - title: { + tp_lastname: { type: 'any-of', contains: [{ type: 'string', @@ -308,7 +322,7 @@ export const $ItemUpdate = { type: 'null', }], }, - description: { + tp_address_1: { type: 'any-of', contains: [{ type: 'string', @@ -316,84 +330,1392 @@ export const $ItemUpdate = { type: 'null', }], }, - }, -} as const; - -export const $ItemsPublic = { - properties: { - data: { - type: 'array', - contains: { - type: 'ItemPublic', - }, - isRequired: true, + tp_address_town: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], }, - count: { - type: 'number', - isRequired: true, + tp_address_postcode: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], }, - }, -} as const; - -export const $Message = { - properties: { - message: { + tp_vehicle_reg: { + type: 'any-of', + contains: [{ type: 'string', - isRequired: true, +}, { + type: 'null', +}], }, - }, -} as const; - -export const $NewPassword = { - properties: { - token: { + tp_insurer: { + type: 'any-of', + contains: [{ type: 'string', - isRequired: true, +}, { + type: 'null', +}], }, - new_password: { + tp_insurer_polcyno: { + type: 'any-of', + contains: [{ type: 'string', - isRequired: true, +}, { + type: 'null', +}], }, - }, -} as const; - -export const $ReferralCreate = { - properties: { - source_id: { - type: 'number', - isRequired: true, + tp_phone: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], }, - claim_id: { - type: 'number', - isRequired: true, + tp_mobile: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], }, }, } as const; -export const $ReferralPublic = { +export const $ClaimPublic = { properties: { - source_id: { - type: 'number', - isRequired: true, -}, - claim_id: { - type: 'number', + client_firstname: { + type: 'string', isRequired: true, }, - id: { - type: 'number', + client_lastname: { + type: 'string', isRequired: true, }, - owner_id: { + client_address_1: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + client_address_town: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + client_address_postcode: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + client_vehicle_reg: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + client_insurer: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + client_insurer_policyno: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + client_phone: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + client_mobile: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + client_email: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + authority_id: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + plate_type: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + accident_date: { + type: 'any-of', + contains: [{ + type: 'string', + format: 'date', +}, { + type: 'null', +}], +}, + accident_time: { + type: 'any-of', + contains: [{ + type: 'string', + format: 'time', +}, { + type: 'null', +}], +}, + accident_location: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + accident_circs: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + tp_firstname: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + tp_lastname: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + tp_address_1: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + tp_address_town: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + tp_address_postcode: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + tp_vehicle_reg: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + tp_insurer: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + tp_insurer_polcyno: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + tp_phone: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + tp_mobile: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + id: { + type: 'number', + isRequired: true, +}, + }, +} as const; + +export const $ClaimUpdate = { + properties: { + client_firstname: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + client_lastname: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + client_address_1: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + client_address_town: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + client_address_postcode: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + client_vehicle_reg: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + client_insurer: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + client_insurer_policyno: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + client_phone: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + client_mobile: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + client_email: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + authority_id: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + plate_type: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + accident_date: { + type: 'any-of', + contains: [{ + type: 'string', + format: 'date', +}, { + type: 'null', +}], +}, + accident_time: { + type: 'any-of', + contains: [{ + type: 'string', + format: 'time', +}, { + type: 'null', +}], +}, + accident_location: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + accident_circs: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + tp_firstname: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + tp_lastname: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + tp_address_1: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + tp_address_town: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + tp_address_postcode: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + tp_vehicle_reg: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + tp_insurer: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + tp_insurer_polcyno: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + tp_phone: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + tp_mobile: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + }, +} as const; + +export const $ClaimsPublic = { + properties: { + data: { + type: 'array', + contains: { + type: 'ClaimPublic', + }, + isRequired: true, +}, + count: { + type: 'number', + isRequired: true, +}, + }, +} as const; + +export const $HTTPValidationError = { + properties: { + detail: { + type: 'array', + contains: { + type: 'ValidationError', + }, +}, + }, +} as const; + +export const $ItemCreate = { + properties: { + title: { + type: 'string', + isRequired: true, +}, + description: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + }, +} as const; + +export const $ItemPublic = { + properties: { + title: { + type: 'string', + isRequired: true, +}, + description: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + id: { + type: 'number', + isRequired: true, +}, + owner_id: { + type: 'number', + isRequired: true, +}, + }, +} as const; + +export const $ItemUpdate = { + properties: { + title: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + description: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + }, +} as const; + +export const $ItemsPublic = { + properties: { + data: { + type: 'array', + contains: { + type: 'ItemPublic', + }, + isRequired: true, +}, + count: { + type: 'number', + isRequired: true, +}, + }, +} as const; + +export const $Message = { + properties: { + message: { + type: 'string', + isRequired: true, +}, + }, +} as const; + +export const $NewPassword = { + properties: { + token: { + type: 'string', + isRequired: true, +}, + new_password: { + type: 'string', + isRequired: true, +}, + }, +} as const; + +export const $ReferralCreate = { + properties: { + source_id: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + claim_id: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + supplier_id: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + type: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + authority_id: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + }, +} as const; + +export const $ReferralPublic = { + properties: { + source_id: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + claim_id: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + supplier_id: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + type: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + authority_id: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + id: { + type: 'number', + isRequired: true, +}, + source: { + type: 'Source', + isRequired: true, +}, + }, +} as const; + +export const $ReferralUpdate = { + properties: { + source_id: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + claim_id: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + supplier_id: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + type: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + authority_id: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + daystohire: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + creditrepair: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + }, +} as const; + +export const $Referral_AllocationCreate = { + properties: { + supplier_id: { + type: 'number', + isRequired: true, +}, + referral_id: { + type: 'number', + isRequired: true, +}, + sentdate: { + type: 'string', + isRequired: true, + format: 'date-time', +}, + status: { + type: 'string', + isRequired: true, +}, + responsedate: { + type: 'any-of', + contains: [{ + type: 'string', + format: 'date-time', +}, { + type: 'null', +}], +}, + }, +} as const; + +export const $Referral_AllocationPublic = { + properties: { + supplier_id: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + referral_id: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + sentdate: { + type: 'any-of', + contains: [{ + type: 'string', + format: 'date-time', +}, { + type: 'null', +}], +}, + status: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + responsedate: { + type: 'any-of', + contains: [{ + type: 'string', + format: 'date-time', +}, { + type: 'null', +}], +}, + id: { + type: 'number', + isRequired: true, +}, + owner_id: { + type: 'number', + isRequired: true, +}, + }, +} as const; + +export const $Referral_AllocationUpdate = { + properties: { + supplier_id: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + referral_id: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + sentdate: { + type: 'any-of', + contains: [{ + type: 'string', + format: 'date-time', +}, { + type: 'null', +}], +}, + status: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + responsedate: { + type: 'any-of', + contains: [{ + type: 'string', + format: 'date-time', +}, { + type: 'null', +}], +}, + }, +} as const; + +export const $Referral_AllocationsPublic = { + properties: { + data: { + type: 'array', + contains: { + type: 'Referral_AllocationPublic', + }, + isRequired: true, +}, + count: { + type: 'number', + isRequired: true, +}, + }, +} as const; + +export const $ReferralsPublic = { + properties: { + data: { + type: 'array', + contains: { + type: 'ReferralPublic', + }, + isRequired: true, +}, + count: { + type: 'number', + isRequired: true, +}, + }, +} as const; + +export const $RequestCreate = { + properties: { + source_id: { + type: 'number', + isRequired: true, +}, + type: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + daystohire: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + creditrepair: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + authority_id: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + client_firstname: { + type: 'string', + isRequired: true, +}, + client_lastname: { + type: 'string', + isRequired: true, +}, + client_address_1: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + client_address_town: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + client_address_postcode: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + client_vehicle_reg: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + client_insurer: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + client_insurer_policyno: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + client_phone: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + client_mobile: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + client_email: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + plate_type: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + accident_date: { + type: 'any-of', + contains: [{ + type: 'string', + format: 'date', +}, { + type: 'null', +}], +}, + accident_time: { + type: 'any-of', + contains: [{ + type: 'string', + format: 'time', +}, { + type: 'null', +}], +}, + accident_location: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + accident_circs: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + tp_firstname: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + tp_lastname: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + tp_address_1: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + tp_address_town: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + tp_address_postcode: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + tp_vehicle_reg: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + tp_insurer: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + tp_insurer_polcyno: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + tp_phone: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + tp_mobile: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + circs_grade_id: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + veh_group_id: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + circs_group_id: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + }, +} as const; + +export const $Source = { + properties: { + created_datetime: { + type: 'any-of', + contains: [{ + type: 'string', + format: 'date-time', +}, { + type: 'null', +}], +}, + updated_datetime: { + type: 'any-of', + contains: [{ + type: 'string', + format: 'date-time', +}, { + type: 'null', +}], +}, + source_name: { + type: 'string', + isRequired: true, +}, + id: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + owner_id: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + }, +} as const; + +export const $SourceCreate = { + properties: { + source_name: { + type: 'string', + isRequired: true, +}, + }, +} as const; + +export const $SourcePublic = { + properties: { + source_name: { + type: 'string', + isRequired: true, +}, + id: { type: 'number', isRequired: true, }, - }, -} as const; - -export const $ReferralUpdate = { - properties: { - source_id: { + }, +} as const; + +export const $SourceUpdate = { + properties: { + source_name: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + }, +} as const; + +export const $Source_RateCreate = { + properties: { + authority_id: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + plate_type: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + veh_group_id: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + circs_group_id: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + type: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + rate: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + hire_length: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + source_id: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + }, +} as const; + +export const $Source_RatePublic = { + properties: { + authority_id: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + plate_type: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + veh_group_id: { type: 'any-of', contains: [{ type: 'number', @@ -401,58 +1723,124 @@ export const $ReferralUpdate = { type: 'null', }], }, - claim_id: { + circs_group_id: { + type: 'any-of', + contains: [{ type: 'number', - isRequired: true, +}, { + type: 'null', +}], }, - }, -} as const; - -export const $Referral_AllocationCreate = { - properties: { - Source: { + type: { + type: 'any-of', + contains: [{ type: 'string', - isRequired: true, +}, { + type: 'null', +}], +}, + rate: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + hire_length: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + source_id: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], }, }, } as const; -export const $Referral_AllocationPublic = { +export const $Source_RateUpdate = { properties: { - Source: { + authority_id: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + plate_type: { + type: 'any-of', + contains: [{ type: 'string', - isRequired: true, +}, { + type: 'null', +}], }, - id: { + veh_group_id: { + type: 'any-of', + contains: [{ type: 'number', - isRequired: true, +}, { + type: 'null', +}], }, - owner_id: { + circs_group_id: { + type: 'any-of', + contains: [{ type: 'number', - isRequired: true, +}, { + type: 'null', +}], }, - }, -} as const; - -export const $Referral_AllocationUpdate = { - properties: { - Source: { + type: { type: 'any-of', contains: [{ type: 'string', }, { type: 'null', }], +}, + rate: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + hire_length: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + source_id: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], }, }, } as const; -export const $Referral_AllocationsPublic = { +export const $Source_RatesPublic = { properties: { data: { type: 'array', contains: { - type: 'Referral_AllocationPublic', + type: 'Source_RatePublic', }, isRequired: true, }, @@ -463,12 +1851,12 @@ export const $Referral_AllocationsPublic = { }, } as const; -export const $ReferralsPublic = { +export const $SourcesPublic = { properties: { data: { type: 'array', contains: { - type: 'ReferralPublic', + type: 'SourcePublic', }, isRequired: true, }, @@ -479,60 +1867,212 @@ export const $ReferralsPublic = { }, } as const; -export const $RequestCreate = { +export const $SupplierCreate = { properties: { - type: { + name: { type: 'string', isRequired: true, }, - source_id: { + address_1: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + address_town: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + address_postcode: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + base_rate: { type: 'number', isRequired: true, }, - client_firstname: { + Email: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + Tel: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + }, +} as const; + +export const $SupplierPublic = { + properties: { + name: { type: 'string', isRequired: true, }, - client_lastname: { + address_1: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + address_town: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + address_postcode: { + type: 'any-of', + contains: [{ type: 'string', +}, { + type: 'null', +}], +}, + base_rate: { + type: 'number', isRequired: true, }, - authority_id: { + Email: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + Tel: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + id: { type: 'number', isRequired: true, }, }, } as const; -export const $SourceCreate = { +export const $SupplierUpdate = { + properties: { + name: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + address_1: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + address_town: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + address_postcode: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + base_rate: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + Email: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + Tel: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + }, +} as const; + +export const $Supplier_RateCreate = { properties: { - source_name: { - type: 'string', - isRequired: true, + authority_id: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], }, - }, -} as const; - -export const $SourcePublic = { - properties: { - source_name: { + plate_type: { + type: 'any-of', + contains: [{ type: 'string', - isRequired: true, +}, { + type: 'null', +}], }, - id: { + veh_group_id: { + type: 'any-of', + contains: [{ type: 'number', - isRequired: true, +}, { + type: 'null', +}], }, - owner_id: { + circs_group_id: { + type: 'any-of', + contains: [{ type: 'number', - isRequired: true, +}, { + type: 'null', +}], }, - }, -} as const; - -export const $SourceUpdate = { - properties: { - source_name: { + type: { type: 'any-of', contains: [{ type: 'string', @@ -540,38 +2080,36 @@ export const $SourceUpdate = { type: 'null', }], }, - }, -} as const; - -export const $Source_RateCreate = { - properties: { - rate: { - type: 'number', - isRequired: true, -}, - }, -} as const; - -export const $Source_RatePublic = { - properties: { rate: { + type: 'any-of', + contains: [{ type: 'number', - isRequired: true, +}, { + type: 'null', +}], }, - id: { + hire_length: { + type: 'any-of', + contains: [{ type: 'number', - isRequired: true, +}, { + type: 'null', +}], }, - owner_id: { + supplier_id: { + type: 'any-of', + contains: [{ type: 'number', - isRequired: true, +}, { + type: 'null', +}], }, }, } as const; -export const $Source_RateUpdate = { +export const $Supplier_RatePublic = { properties: { - rate: { + authority_id: { type: 'any-of', contains: [{ type: 'number', @@ -579,55 +2117,61 @@ export const $Source_RateUpdate = { type: 'null', }], }, - }, -} as const; - -export const $Source_RatesPublic = { - properties: { - data: { - type: 'array', - contains: { - type: 'Source_RatePublic', - }, - isRequired: true, + plate_type: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], }, - count: { + veh_group_id: { + type: 'any-of', + contains: [{ type: 'number', - isRequired: true, -}, - }, -} as const; - -export const $SourcesPublic = { - properties: { - data: { - type: 'array', - contains: { - type: 'SourcePublic', - }, - isRequired: true, +}, { + type: 'null', +}], }, - count: { + circs_group_id: { + type: 'any-of', + contains: [{ type: 'number', - isRequired: true, +}, { + type: 'null', +}], }, - }, -} as const; - -export const $SupplierCreate = { - properties: { - name: { + type: { + type: 'any-of', + contains: [{ type: 'string', - isRequired: true, +}, { + type: 'null', +}], }, - }, -} as const; - -export const $SupplierPublic = { - properties: { - name: { - type: 'string', - isRequired: true, + rate: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + hire_length: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + supplier_id: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], }, id: { type: 'number', @@ -640,9 +2184,17 @@ export const $SupplierPublic = { }, } as const; -export const $SupplierUpdate = { +export const $Supplier_RateUpdate = { properties: { - name: { + authority_id: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + plate_type: { type: 'any-of', contains: [{ type: 'string', @@ -650,38 +2202,47 @@ export const $SupplierUpdate = { type: 'null', }], }, - }, -} as const; - -export const $Supplier_RateCreate = { - properties: { - rate: { + veh_group_id: { + type: 'any-of', + contains: [{ type: 'number', - isRequired: true, +}, { + type: 'null', +}], }, - }, -} as const; - -export const $Supplier_RatePublic = { - properties: { - rate: { + circs_group_id: { + type: 'any-of', + contains: [{ type: 'number', - isRequired: true, +}, { + type: 'null', +}], }, - id: { + type: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + rate: { + type: 'any-of', + contains: [{ type: 'number', - isRequired: true, +}, { + type: 'null', +}], }, - owner_id: { + hire_length: { + type: 'any-of', + contains: [{ type: 'number', - isRequired: true, +}, { + type: 'null', +}], }, - }, -} as const; - -export const $Supplier_RateUpdate = { - properties: { - rate: { + supplier_id: { type: 'any-of', contains: [{ type: 'number', @@ -931,12 +2492,20 @@ export const $ValidationError = { export const $Veh_GroupCreate = { properties: { group: { + type: 'any-of', + contains: [{ type: 'string', - isRequired: true, +}, { + type: 'null', +}], }, desc: { + type: 'any-of', + contains: [{ type: 'string', - isRequired: true, +}, { + type: 'null', +}], }, }, } as const; @@ -944,12 +2513,20 @@ export const $Veh_GroupCreate = { export const $Veh_GroupPublic = { properties: { group: { + type: 'any-of', + contains: [{ type: 'string', - isRequired: true, +}, { + type: 'null', +}], }, desc: { + type: 'any-of', + contains: [{ type: 'string', - isRequired: true, +}, { + type: 'null', +}], }, id: { type: 'number', diff --git a/frontend/src/client/services.ts b/frontend/src/client/services.ts index 38a1f487b9..68ebbcf783 100644 --- a/frontend/src/client/services.ts +++ b/frontend/src/client/services.ts @@ -2,7 +2,7 @@ import type { CancelablePromise } from './core/CancelablePromise'; import { OpenAPI } from './core/OpenAPI'; import { request as __request } from './core/request'; -import type { Body_login_login_access_token,Message,NewPassword,Token,UserPublic,UpdatePassword,UserCreate,UserRegister,UsersPublic,UserUpdate,UserUpdateMe,ItemCreate,ItemPublic,ItemsPublic,ItemUpdate,SourceCreate,SourcePublic,SourcesPublic,SourceUpdate,SupplierCreate,SupplierPublic,SuppliersPublic,SupplierUpdate,Circs_GroupCreate,Circs_GroupPublic,Circs_GroupsPublic,Circs_GroupUpdate,ClaimCreate,ClaimPublic,ClaimsPublic,ClaimUpdate,Referral_AllocationCreate,Referral_AllocationPublic,Referral_AllocationsPublic,Referral_AllocationUpdate,ReferralCreate,ReferralPublic,ReferralsPublic,ReferralUpdate,Source_RateCreate,Source_RatePublic,Source_RatesPublic,Source_RateUpdate,Supplier_RateCreate,Supplier_RatePublic,Supplier_RatesPublic,Supplier_RateUpdate,Veh_GroupCreate,Veh_GroupPublic,Veh_GroupsPublic,Veh_GroupUpdate,AuthoritiesPublic,AuthorityCreate,AuthorityPublic,AuthorityUpdate } from './models'; +import type { Body_login_login_access_token,Message,NewPassword,Token,UserPublic,UpdatePassword,UserCreate,UserRegister,UsersPublic,UserUpdate,UserUpdateMe,ItemCreate,ItemPublic,ItemsPublic,ItemUpdate,SourceCreate,SourcePublic,SourcesPublic,SourceUpdate,SupplierCreate,SupplierPublic,SuppliersPublic,SupplierUpdate,Circs_GroupCreate,Circs_GroupPublic,Circs_GroupsPublic,Circs_GroupUpdate,ClaimCreate,ClaimPublic,ClaimsPublic,ClaimUpdate,Referral_AllocationCreate,Referral_AllocationPublic,Referral_AllocationsPublic,Referral_AllocationUpdate,ReferralCreate,ReferralPublic,ReferralsPublic,ReferralUpdate,Source_RateCreate,Source_RatePublic,Source_RatesPublic,Source_RateUpdate,Supplier_RateCreate,Supplier_RatePublic,Supplier_RatesPublic,Supplier_RateUpdate,Veh_GroupCreate,Veh_GroupPublic,Veh_GroupsPublic,Veh_GroupUpdate,AuthoritiesPublic,AuthorityCreate,AuthorityPublic,AuthorityUpdate,RequestCreate } from './models'; export type TDataLoginAccessToken = { formData: Body_login_login_access_token @@ -1936,16 +1936,20 @@ id, } +export type TDataCreateRequest = { + requestBody: RequestCreate + + } export class RequestsService { /** - * Create Referral + * Create Request * Create new request. * @returns unknown Successful Response * @throws ApiError */ - public static createReferral(data: TDataCreateReferral): CancelablePromise { + public static createRequest(data: TDataCreateRequest): CancelablePromise { const { requestBody, } = data; diff --git a/frontend/src/routes/_layout/referrals.tsx b/frontend/src/routes/_layout/referrals.tsx index 3cf643ecc0..222c8e5973 100644 --- a/frontend/src/routes/_layout/referrals.tsx +++ b/frontend/src/routes/_layout/referrals.tsx @@ -36,10 +36,11 @@ function ReferralsTableBody() { {referral.id} {referral.source_id} + {referral.source.source_name} {referral.source_id || "N/A"} - + @@ -56,6 +57,7 @@ function ReferralsTable() { ID Source ID + Source Last Name Actions diff --git a/logs/postgresql.log b/logs/postgresql.log new file mode 100644 index 0000000000..49b33dbbea --- /dev/null +++ b/logs/postgresql.log @@ -0,0 +1,28 @@ +2024-06-28 20:46:56.027 GMT [29] LOG: database system was shut down at 2024-06-28 20:46:49 GMT +2024-06-28 20:46:56.085 GMT [1] LOG: database system is ready to accept connections +2024-06-28 20:49:43.276 GMT [1] LOG: received fast shutdown request +2024-06-28 20:49:43.280 GMT [1] LOG: aborting any active transactions +2024-06-28 20:49:43.285 GMT [1] LOG: background worker "logical replication launcher" (PID 35) exited with exit code 1 +2024-06-28 20:49:43.293 GMT [30] LOG: shutting down +2024-06-28 20:49:43.316 GMT [1] LOG: database system is shut down +2024-06-28 20:55:43.481 GMT [28] LOG: database system was shut down at 2024-06-28 20:49:43 GMT +2024-06-28 20:55:43.542 GMT [1] LOG: database system is ready to accept connections +2024-06-28 20:56:02.781 GMT [1] LOG: received fast shutdown request +2024-06-28 20:56:02.785 GMT [1] LOG: aborting any active transactions +2024-06-28 20:56:02.790 GMT [1] LOG: background worker "logical replication launcher" (PID 34) exited with exit code 1 +2024-06-28 20:56:02.798 GMT [29] LOG: shutting down +2024-06-28 20:56:02.847 GMT [1] LOG: database system is shut down +2024-06-28 21:14:24.748 GMT [28] LOG: database system was shut down at 2024-06-28 21:14:21 GMT +2024-06-28 21:14:24.757 GMT [1] LOG: database system is ready to accept connections +2024-06-28 21:16:06.570 GMT [1] LOG: received fast shutdown request +2024-06-28 21:16:06.583 GMT [1] LOG: aborting any active transactions +2024-06-28 21:16:06.596 GMT [1] LOG: background worker "logical replication launcher" (PID 34) exited with exit code 1 +2024-06-28 21:16:06.600 GMT [29] LOG: shutting down +2024-06-28 21:16:06.632 GMT [1] LOG: database system is shut down +2024-06-28 21:16:21.840 GMT [28] LOG: database system was shut down at 2024-06-28 21:16:06 GMT +2024-06-28 21:16:21.853 GMT [1] LOG: database system is ready to accept connections +2024-06-28 21:16:57.161 GMT [1] LOG: received fast shutdown request +2024-06-28 21:16:57.172 GMT [1] LOG: aborting any active transactions +2024-06-28 21:16:57.177 GMT [1] LOG: background worker "logical replication launcher" (PID 34) exited with exit code 1 +2024-06-28 21:16:57.179 GMT [29] LOG: shutting down +2024-06-28 21:16:57.211 GMT [1] LOG: database system is shut down