-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BE | Ask va api Fix Inquiry bug and create FacilitiesDataJob (#19976)
* Created get_facilities_mock_data.json and update static_data.json - get_facilties_mock_data.json is a list of PATSR approved health facilities - static_data.json is now up to data with the most recent addition from CRM API * Fix bug in InquiryDetails and update spec - inquiry_details now handles `it's a general question` correctly * Created FacilitiesDataJob - Job will run every 24hours to cache the data * Update HealthFacilities#search - search now will filter and allow only patsr approved facilities
- Loading branch information
1 parent
064a5bb
commit 69d29cc
Showing
12 changed files
with
1,993 additions
and
2,482 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'sidekiq' | ||
|
||
module Crm | ||
class FacilitiesDataJob | ||
include Sidekiq::Job | ||
|
||
# Schedule to run every 24 hours. Adjust as needed. | ||
sidekiq_options retry: false, unique_for: 24.hours | ||
|
||
def perform | ||
Crm::CacheData.new.fetch_and_cache_data(endpoint: 'Facilities', cache_key: 'Facilities', payload: {}) | ||
rescue => e | ||
log_error('optionset', e) | ||
end | ||
|
||
private | ||
|
||
def log_error(action, exception) | ||
LogService.new.call(action) do |span| | ||
span.set_tag('error', true) | ||
span.set_tag('error.msg', exception.message) | ||
end | ||
Rails.logger.error("Error during #{action}: #{exception.message}") | ||
end | ||
end | ||
end |
177 changes: 177 additions & 0 deletions
177
modules/ask_va_api/config/locales/get_facilities_mock_data.json
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.