-
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.
Merge branch 'master' of https://github.com/department-of-veterans-af…
…fairs/vets-api into restrict-ppiu-traffic
- Loading branch information
Showing
5 changed files
with
82 additions
and
0 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
19 changes: 19 additions & 0 deletions
19
modules/debts_api/lib/debts_api/v0/fsr_rehydration_service.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,19 @@ | ||
# frozen_string_literal: true | ||
|
||
module DebtsApi | ||
class V0::FsrRehydrationService | ||
include SentryLogging | ||
|
||
class UserDoesNotOwnsubmission < StandardError; end | ||
class NoInProgressFormDataStored < StandardError; end | ||
|
||
def self.attempt_rehydration(user_uuid:, submission_id:) | ||
submission = DebtsApi::V0::Form5655Submission.find(submission_id) | ||
|
||
raise NoInProgressFormDataStored unless submission.ipf_data | ||
raise UserDoesNotOwnsubmission unless submission.user_uuid == user_uuid | ||
|
||
submission.upsert_in_progress_form | ||
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