diff --git a/api/app/admin/office.py b/api/app/admin/office.py index 620033a00..be6c01e05 100644 --- a/api/app/admin/office.py +++ b/api/app/admin/office.py @@ -68,13 +68,15 @@ def get_query(self): 'appointments_days_limit', 'appointment_duration', 'soonest_appointment', 'max_person_appointment_per_day',\ 'civic_address', 'telephone', 'online_status', 'check_in_notification', 'check_in_reminder_msg',\ 'automatic_reminder_at', 'currently_waiting', 'digital_signage_message', 'digital_signage_message_1',\ - 'digital_signage_message_2', 'digital_signage_message_3', 'show_currently_waiting_bottom', 'optout_status' ) + 'digital_signage_message_2', 'digital_signage_message_3', 'show_currently_waiting_bottom', 'optout_status',\ + 'core_service_partners', 'service_model') form_edit_rules = ('office_name', 'office_number', 'sb', 'services', 'deleted', 'exams_enabled_ind', 'appointments_enabled_ind', 'timezone', 'latitude', 'longitude', 'office_appointment_message', 'appointments_days_limit', 'appointment_duration', 'soonest_appointment', 'max_person_appointment_per_day',\ 'civic_address', 'telephone', 'online_status', 'check_in_notification', 'check_in_reminder_msg', \ 'automatic_reminder_at', 'currently_waiting', 'digital_signage_message', 'digital_signage_message_1',\ - 'digital_signage_message_2', 'digital_signage_message_3', 'show_currently_waiting_bottom', 'optout_status' ) + 'digital_signage_message_2', 'digital_signage_message_3', 'show_currently_waiting_bottom', 'optout_status',\ + 'core_service_partners', 'service_model' ) form_choices = { 'exams_enabled_ind': [ ("0", 'No - Exams are not enabled for this office'), \ @@ -110,6 +112,10 @@ def get_query(self): ("0", 'Off - Open tickets automatically closed at end of day'), \ ("1", 'On - Tickets must be closed manually') ], + 'service_model':[ + ("Reception",'Reception'),\ + ("Non-Reception","Non-Reception") + ] } # Defining String constants to appease SonarQube timezone_name_const = 'timezone.timezone_name' @@ -145,6 +151,8 @@ def get_query(self): 'digital_signage_message_3', 'show_currently_waiting_bottom', 'optout_status', + 'core_service_partners', + 'service_model', ] column_list_support = ['office_name', @@ -176,6 +184,8 @@ def get_query(self): 'digital_signage_message_3', 'show_currently_waiting_bottom', 'optout_status', + 'core_service_partners', + 'service_model', ] form_excluded_columns = ('citizens', @@ -220,6 +230,8 @@ def get_query(self): 'timeslots', 'deleted', 'optout_status', + 'core_service_partners', + 'service_model', ) form_edit_rules = ('office_name', @@ -257,6 +269,8 @@ def get_query(self): 'timeslots', 'deleted', 'optout_status', + 'core_service_partners', + 'service_model', ) form_args = { @@ -397,7 +411,9 @@ class OfficeConfigGA(OfficeConfig): 'soonest_appointment', 'max_person_appointment_per_day', 'number_of_dlkt', - 'optout_status' , + 'optout_status' , + 'core_service_partners', + 'service_model', ) form_excluded_columns = ( diff --git a/api/app/models/theq/office.py b/api/app/models/theq/office.py index 4ac1218a1..bc09f2524 100644 --- a/api/app/models/theq/office.py +++ b/api/app/models/theq/office.py @@ -88,6 +88,8 @@ class Office(Base): office_email_paragraph = db.Column(db.String(2000), nullable=True) external_map_link = db.Column(db.String(500), nullable=True) soonest_appointment = db.Column(db.Integer, default=0) + core_service_partners = db.Column(db.String(), nullable=True) + service_model = db.Column(db.String(), default="Reception", server_default='Reception', nullable=False) counters = db.relationship("Counter", secondary='office_counter') services = db.relationship("Service", secondary='office_service') diff --git a/api/app/schemas/theq/office_schema.py b/api/app/schemas/theq/office_schema.py index 9dc52d3f9..163ed25f2 100644 --- a/api/app/schemas/theq/office_schema.py +++ b/api/app/schemas/theq/office_schema.py @@ -51,6 +51,8 @@ class Meta(BaseSchema.Meta): online_status = fields.Str() optout_status = fields.Int() external_map_link = fields.Str() + core_service_partners = fields.Str() + service_model = fields.Str() # for walk-in notifications check_in_notification = fields.Int() diff --git a/api/migrations/versions/297f8e37fee4_sbcq_307_add_new_columns_to_office.py b/api/migrations/versions/297f8e37fee4_sbcq_307_add_new_columns_to_office.py new file mode 100644 index 000000000..3411da8ca --- /dev/null +++ b/api/migrations/versions/297f8e37fee4_sbcq_307_add_new_columns_to_office.py @@ -0,0 +1,31 @@ +"""SBCQ-307 Add new columns to Office + +Revision ID: 297f8e37fee4 +Revises: 8b6c67545310 +Create Date: 2024-12-16 19:33:04.875950 + +""" +from alembic import op +import sqlalchemy as sa +import sqlalchemy_utc + + +# revision identifiers, used by Alembic. +revision = '297f8e37fee4' +down_revision = '8b6c67545310' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.add_column('office', sa.Column('core_service_partners', sa.String(), nullable=True)) + op.add_column('office', sa.Column('service_model', sa.String(), server_default='Reception', nullable=False)) + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_column('office', 'service_model') + op.drop_column('office', 'core_service_partners') + # ### end Alembic commands ###