Skip to content

Commit

Permalink
Update scripts.md
Browse files Browse the repository at this point in the history
  • Loading branch information
dfong-adh authored Oct 27, 2024
1 parent 1390f34 commit 38c170a
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions products/decision-reviews/engineering/scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,24 +159,18 @@ end
def remediation_info(lighthouse_upload_id)
upload = AppealSubmissionUpload.find_by(lighthouse_upload_id:)
appeal_submission = upload.appeal_submission
user_uuid = appeal_submission.user_uuid

# Same as get_mpi_profile_with_user_uuid method
mpi_service = MPI::Service.new
idme_profile = mpi_service.find_profile_by_identifier(identifier: user_uuid, identifier_type: 'idme')&.profile
logingov_profile = mpi_service.find_profile_by_identifier(identifier: user_uuid, identifier_type: 'logingov')&.profile
mpi_profile = idme_profile || logingov_profile

attachment = upload.decision_review_evidence_attachment
raw_filename = JSON.parse(upload.decision_review_evidence_attachment.file_data)['filename']

unmasked_filename = JSON.parse(upload.decision_review_evidence_attachment.file_data)['filename']
s3_link = "https://us-gov-west-1.console.amazonaws-us-gov.com/s3/object/dsva-vagov-prod-notice-of-disagreement?region=us-gov-west-1&prefix=decision_review/#{attachment.guid}/#{unmasked_filename}"

{
icn: mpi_profile.icn,
form_type: appeal_submission.type_of_appeal,
upload_timestamp: attachment.created_at,
filename: raw_filename.gsub(/(?<=.{3})[^_-](?=.{6})/, '*'),
icn: appeal_submission.get_mpi_profile.icn,
decision_review_evidence_attachment_uuid: attachment.guid,
raw_filename:
filename: unmasked_filename.gsub(/(?<=.{3})[^_-](?=.{6})/, '*'),
upload_timestamp: attachment.created_at.in_time_zone("Pacific Time (US & Canada)").strftime('%B %-d, %Y, %H:%M:%S (UTC%z)'),
s3_link:
}
end
```

0 comments on commit 38c170a

Please sign in to comment.