Skip to content

Commit

Permalink
update appointment date range (#11883)
Browse files Browse the repository at this point in the history
  • Loading branch information
aherzberg authored Feb 23, 2023
1 parent 3cec4f4 commit 1c4f0e1
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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: ''
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -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: ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: ''
Expand Down

0 comments on commit 1c4f0e1

Please sign in to comment.