-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'burial-94168-remove-structureddata-processdatajob' of g…
…ithub.com:department-of-veterans-affairs/vets-api into burial-94168-remove-structureddata-processdatajob
- Loading branch information
Showing
33 changed files
with
1,074 additions
and
66 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
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,18 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'mhv/user_account/creator' | ||
|
||
module MHV | ||
class AccountCreatorJob | ||
include Sidekiq::Job | ||
|
||
sidekiq_options retry: false | ||
|
||
def perform(id) | ||
user_verification = UserVerification.find(id) | ||
MHV::UserAccount::Creator.new(user_verification:, break_cache: true).perform | ||
rescue ActiveRecord::RecordNotFound | ||
Rails.logger.error("MHV AccountCreatorJob failed: UserVerification not found for id #{id}") | ||
end | ||
end | ||
end |
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
88 changes: 88 additions & 0 deletions
88
lib/simple_forms_api/form_remediation/configuration/base.rb
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,88 @@ | ||
# frozen_string_literal: true | ||
|
||
module SimpleFormsApi | ||
module FormRemediation | ||
module Configuration | ||
class Base | ||
attr_reader :id_type, :include_manifest, :include_metadata, :parent_dir, :presign_s3_url | ||
|
||
def initialize | ||
@id_type = :benefits_intake_uuid # The field to query the FormSubmission by | ||
@include_manifest = true # Include a CSV file containing manifest data | ||
@include_metadata = false # Include a JSON file containing form submission metadata | ||
@parent_dir = '/' # The base directory in the S3 bucket where the archive will be stored | ||
@presign_s3_url = true # Once archived to S3, the service should generate & return a presigned_url | ||
end | ||
|
||
# Override to inject your team's own submission archive | ||
def submission_archive_class | ||
SimpleFormsApi::FormRemediation::SubmissionArchive | ||
end | ||
|
||
# Override to inject your team's own s3 client | ||
def s3_client | ||
SimpleFormsApi::FormRemediation::S3Client | ||
end | ||
|
||
# Override to inject your team's own submission data builder | ||
def remediation_data_class | ||
SimpleFormsApi::FormRemediation::SubmissionRemediationData | ||
end | ||
|
||
# Override to inject your team's own file uploader | ||
# If overriding this, s3_settings method doesn't have to be set | ||
def uploader_class | ||
SimpleFormsApi::FormRemediation::Uploader | ||
end | ||
|
||
# The FormSubmission model to query against | ||
def submission_type | ||
FormSubmission | ||
end | ||
|
||
# The attachment model to query for form submission attachments | ||
def attachment_type | ||
PersistentAttachment | ||
end | ||
|
||
# The temporary directory where form submissions will be | ||
# hydrated and stored. This directory will automatically | ||
# be deleted once the archive process completes | ||
def temp_directory_path | ||
@temp_directory_path ||= Rails.root.join("tmp/#{SecureRandom.hex}-archive/").to_s | ||
end | ||
|
||
# Used in the SimpleFormsApi::FormRemediation::Uploader S3 uploader | ||
def s3_settings | ||
raise NotImplementedError, 'Class must implement s3_settings method' | ||
end | ||
|
||
# The base S3 resource used for all S3 manipulations | ||
def s3_resource | ||
@s3_resource ||= uploader.new_s3_resource | ||
end | ||
|
||
# The bucket where payloads will be uploaded on S3 | ||
def target_bucket | ||
@target_bucket ||= uploader.s3_bucket | ||
end | ||
|
||
# Utility method, override to add your own team's preferred logging approach | ||
def log_info(message, **details) | ||
Rails.logger.info(message, details) | ||
end | ||
|
||
# Utility method, override to add your own team's preferred logging approach | ||
def log_error(message, error, **details) | ||
Rails.logger.error(message, details.merge(error: error.message, backtrace: error.backtrace.first(5))) | ||
end | ||
|
||
# Utility method, override to add your own team's preferred logging approach | ||
def handle_error(message, error, **details) | ||
log_error(message, error, **details) | ||
raise error | ||
end | ||
end | ||
end | ||
end | ||
end |
15 changes: 15 additions & 0 deletions
15
lib/simple_forms_api/form_remediation/configuration/vff_config.rb
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,15 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'simple_forms_api/form_remediation/configuration/base' | ||
|
||
module SimpleFormsApi | ||
module FormRemediation | ||
module Configuration | ||
class VffConfig < Base | ||
def s3_settings | ||
Settings.vff_simple_forms.aws | ||
end | ||
end | ||
end | ||
end | ||
end |
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
Oops, something went wrong.