From 1c4f0e122919c00397cd7f0b4e360c16d1a4390f Mon Sep 17 00:00:00 2001 From: Andrew Herzberg Date: Thu, 23 Feb 2023 15:46:23 -0700 Subject: [PATCH] update appointment date range (#11883) --- .../app/helpers/mobile/appointments_cache_interface.rb | 6 +++--- .../helpers/mobile/appointments_cache_interface_spec.rb | 4 ++-- .../appointments/VAOS_v2/get_all_appointment_200_ruben.yml | 2 +- .../appointments/VAOS_v2/get_appointment_200.yml | 2 +- .../VAOS_v2/get_appointment_200_bad_facility_id.yml | 2 +- .../VAOS_v2/get_appointments_no_requests_200.yml | 2 +- .../VAOS_v2/get_appointments_with_mixed_provider_types.yml | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/mobile/app/helpers/mobile/appointments_cache_interface.rb b/modules/mobile/app/helpers/mobile/appointments_cache_interface.rb index 424094ae239..f8b8b6197d4 100644 --- a/modules/mobile/app/helpers/mobile/appointments_cache_interface.rb +++ b/modules/mobile/app/helpers/mobile/appointments_cache_interface.rb @@ -31,9 +31,9 @@ def latest_allowable_cache_start_date (@now.beginning_of_year - 1.year).to_datetime end - # when requesting future appointments, the mobile client requests (DateTime.local + 1.year).end_of_day + # when requesting future appointments, the mobile client requests (DateTime.local + 390.days).end_of_day def earliest_allowable_cache_end_date - (@now.end_of_day + 1.year).to_datetime + (@now.end_of_day + 390.days).to_datetime end private @@ -48,7 +48,7 @@ def fetch_from_external_service(user, start_date, end_date) # must break the cache if user is requesting dates beyond default range to ensure the integrity of the cache. # at this time, it's not possible for the user to fetch beyond this range because the interface doesn't allow it, - # so the cache will effectively always be from beginning of last year until one year from today + # so the cache will effectively always be from beginning of last year until 390 days from today def fetch_cache?(start_date, end_date, fetch_cache) fetch_cache && dates_within_cache_range?(start_date, end_date) end diff --git a/modules/mobile/spec/helpers/mobile/appointments_cache_interface_spec.rb b/modules/mobile/spec/helpers/mobile/appointments_cache_interface_spec.rb index a8a8dc77486..36190bae980 100644 --- a/modules/mobile/spec/helpers/mobile/appointments_cache_interface_spec.rb +++ b/modules/mobile/spec/helpers/mobile/appointments_cache_interface_spec.rb @@ -128,8 +128,8 @@ def set_cache after { Timecop.return } - it 'is set to one year from today' do - expect(subject.earliest_allowable_cache_end_date).to eq(today.to_datetime.utc.end_of_day + 1.year) + it 'is set to 390 days from today' do + expect(subject.earliest_allowable_cache_end_date).to eq(today.to_datetime.utc.end_of_day + 390.days) end end end diff --git a/modules/mobile/spec/support/vcr_cassettes/appointments/VAOS_v2/get_all_appointment_200_ruben.yml b/modules/mobile/spec/support/vcr_cassettes/appointments/VAOS_v2/get_all_appointment_200_ruben.yml index af57f33caa2..774ef5a0841 100644 --- a/modules/mobile/spec/support/vcr_cassettes/appointments/VAOS_v2/get_all_appointment_200_ruben.yml +++ b/modules/mobile/spec/support/vcr_cassettes/appointments/VAOS_v2/get_all_appointment_200_ruben.yml @@ -2,7 +2,7 @@ http_interactions: - request: method: get - uri: https://veteran.apps.va.gov/vaos/v1/patients/1012846043V576341/appointments?end=2023-01-01T23:59:59Z&pageSize=0&start=1991-01-01T00:00:00Z&statuses=proposed,cancelled,booked,fulfilled,arrived + uri: https://veteran.apps.va.gov/vaos/v1/patients/1012846043V576341/appointments?end=2023-01-26T23:59:59Z&pageSize=0&start=1991-01-01T00:00:00Z&statuses=proposed,cancelled,booked,fulfilled,arrived body: encoding: US-ASCII string: '' diff --git a/modules/mobile/spec/support/vcr_cassettes/appointments/VAOS_v2/get_appointment_200.yml b/modules/mobile/spec/support/vcr_cassettes/appointments/VAOS_v2/get_appointment_200.yml index 044543f11f5..50fae44a86b 100644 --- a/modules/mobile/spec/support/vcr_cassettes/appointments/VAOS_v2/get_appointment_200.yml +++ b/modules/mobile/spec/support/vcr_cassettes/appointments/VAOS_v2/get_appointment_200.yml @@ -2,7 +2,7 @@ http_interactions: - request: method: get - uri: https://veteran.apps.va.gov/vaos/v1/patients/1012846043V576341/appointments?end=2023-01-01T23:59:59Z&pageSize=0&start=2021-01-01T00:00:00Z&statuses=proposed,cancelled,booked,fulfilled,arrived + uri: https://veteran.apps.va.gov/vaos/v1/patients/1012846043V576341/appointments?end=2023-01-26T23:59:59Z&pageSize=0&start=2021-01-01T00:00:00Z&statuses=proposed,cancelled,booked,fulfilled,arrived body: encoding: US-ASCII string: '' diff --git a/modules/mobile/spec/support/vcr_cassettes/appointments/VAOS_v2/get_appointment_200_bad_facility_id.yml b/modules/mobile/spec/support/vcr_cassettes/appointments/VAOS_v2/get_appointment_200_bad_facility_id.yml index 11f8601ca04..6a7a2367905 100644 --- a/modules/mobile/spec/support/vcr_cassettes/appointments/VAOS_v2/get_appointment_200_bad_facility_id.yml +++ b/modules/mobile/spec/support/vcr_cassettes/appointments/VAOS_v2/get_appointment_200_bad_facility_id.yml @@ -2,7 +2,7 @@ http_interactions: - request: method: get - uri: https://veteran.apps.va.gov/vaos/v1/patients/1012846043V576341/appointments?end=2023-01-01T23:59:59Z&pageSize=0&start=2021-01-01T00:00:00Z&statuses=proposed,cancelled,booked,fulfilled,arrived + uri: https://veteran.apps.va.gov/vaos/v1/patients/1012846043V576341/appointments?end=2023-01-26T23:59:59Z&pageSize=0&start=2021-01-01T00:00:00Z&statuses=proposed,cancelled,booked,fulfilled,arrived body: encoding: US-ASCII string: '' diff --git a/modules/mobile/spec/support/vcr_cassettes/appointments/VAOS_v2/get_appointments_no_requests_200.yml b/modules/mobile/spec/support/vcr_cassettes/appointments/VAOS_v2/get_appointments_no_requests_200.yml index 0dc84dce7cb..891184ed64d 100644 --- a/modules/mobile/spec/support/vcr_cassettes/appointments/VAOS_v2/get_appointments_no_requests_200.yml +++ b/modules/mobile/spec/support/vcr_cassettes/appointments/VAOS_v2/get_appointments_no_requests_200.yml @@ -2,7 +2,7 @@ http_interactions: - request: method: get - uri: https://veteran.apps.va.gov/vaos/v1/patients/1012846043V576341/appointments?end=2023-01-01T00:00:00Z&pageSize=0&start=1991-01-01T00:00:00Z&statuses=cancelled,booked,fulfilled,arrived + uri: https://veteran.apps.va.gov/vaos/v1/patients/1012846043V576341/appointments?end=2023-01-26T23:59:59Z&pageSize=0&start=1991-01-01T00:00:00Z&statuses=cancelled,booked,fulfilled,arrived body: encoding: US-ASCII string: '' diff --git a/modules/mobile/spec/support/vcr_cassettes/appointments/VAOS_v2/get_appointments_with_mixed_provider_types.yml b/modules/mobile/spec/support/vcr_cassettes/appointments/VAOS_v2/get_appointments_with_mixed_provider_types.yml index 660cc57605e..f5b078c8fdb 100644 --- a/modules/mobile/spec/support/vcr_cassettes/appointments/VAOS_v2/get_appointments_with_mixed_provider_types.yml +++ b/modules/mobile/spec/support/vcr_cassettes/appointments/VAOS_v2/get_appointments_with_mixed_provider_types.yml @@ -2,7 +2,7 @@ http_interactions: - request: method: get - uri: https://veteran.apps.va.gov/vaos/v1/patients/1012846043V576341/appointments?end=2023-01-01T23:59:59Z&pageSize=0&start=2021-01-01T00:00:00Z&statuses=proposed,cancelled,booked,fulfilled,arrived + uri: https://veteran.apps.va.gov/vaos/v1/patients/1012846043V576341/appointments?end=2023-01-26T23:59:59Z&pageSize=0&start=2021-01-01T00:00:00Z&statuses=proposed,cancelled,booked,fulfilled,arrived body: encoding: US-ASCII string: ''