Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[API-42091] Retrieve POA Requests - Schema Update #19949

Merged
merged 7 commits into from
Jan 8, 2025

Conversation

tycol7
Copy link
Contributor

@tycol7 tycol7 commented Dec 18, 2024

Summary

  • Map BGS procID to database Lighthouse ID.
    • Extract index logic from controller to service.
  • Format response with Blueprinter.
  • Update docs (v2 staging only).

Related issue(s)

API-42091

Testing done

  • New code is covered by unit tests
  • Observed correct response:
{
    "data": [
        {
            "id": "4ced145b-c706-4df3-944e-829e31077185",
            "type": "power-of-attorney-request",
            "attributes": {
                "veteran": {
                    "firstName": "[Vet First Name]",
                    "lastName": "[Vet Last Name]",
                    "middleName": null
                },
                "claimant": {
                    "city": "Richmond",
                    "country": "USA",
                    "militaryPo": null,
                    "militaryPostalCode": null,
                    "state": null,
                    "zip": "00123"
                },
                "representative": {
                    "poaCode": "003",
                    "vsoUserEmail": null,
                    "vsoUserFirstName": "VDC USER",
                    "vsoUserLastName": null
                },
                "receivedDate": "2013-01-17T10:54:11-06:00",
                "actionedDate": "2013-01-17T10:54:11-06:00",
                "status": "New",
                "declinedReason": null,
                "changeAddressAuthorization": "Y",
                "healthInfoAuthorization": "Y"
            }
        },
        {
            "id": "7abf74a7-0952-4caa-98c5-f3aa8b34c8cd",
            "type": "power-of-attorney-request",
            "attributes": {
                "veteran": {
                    "firstName": "[Vet First Name]",
                    "lastName": "[Vet Last Name]",
                    "middleName": null
                },
                "claimant": {
                    "city": "Richmond",
                    "country": "USA",
                    "militaryPo": null,
                    "militaryPostalCode": null,
                    "state": null,
                    "zip": "00123"
                },
                "representative": {
                    "poaCode": "003",
                    "vsoUserEmail": null,
                    "vsoUserFirstName": "VDC USER",
                    "vsoUserLastName": null
                },
                "receivedDate": "2013-01-17T11:04:22-06:00",
                "actionedDate": "2013-01-17T11:04:22-06:00",
                "status": "New",
                "declinedReason": null,
                "changeAddressAuthorization": "Y",
                "healthInfoAuthorization": "Y"
            }
        },
        …

Note: id will be null unless you create a corresponding PowerOfAttorneyRequest record in your local database (must include procID from the BGS response).

Screenshots

schema example

What areas of the site does it impact?

PowerOfAttorneyRequests index (search)
v2 staging docs

Acceptance criteria

  • I updated unit tests and integration tests for each feature (if applicable).
  • No error nor warning in the console.
  • Events are being sent to the appropriate logging solution
  • Documentation has been updated (link to documentation)
  • No sensitive information (i.e. PII/credentials/internal URLs/etc.) is captured in logging, hardcoded, or specs
  • Feature/bug has a monitor built into Datadog (if applicable)
  • If app impacted requires authentication, did you login to a local build and verify all authenticated routes work as expected
  • I added a screenshot of the developed feature

Requested Feedback

See below.

@tycol7 tycol7 added the claimsApi modules/claims_api label Dec 18, 2024
def get_poa_list
proc_ids = poa_list.pluck('procID')

poa_requests = ClaimsApi::PowerOfAttorneyRequest.where(proc_id: proc_ids).select(:id, :proc_id)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding index in #19945 to optimize this query.

@va-vfs-bot va-vfs-bot temporarily deployed to tdc/poa-requests-index-update/main/main December 18, 2024 20:01 Inactive
@va-vfs-bot va-vfs-bot temporarily deployed to tdc/poa-requests-index-update/main/main December 18, 2024 22:54 Inactive
@@ -3,7 +3,7 @@
require 'rails_helper'
require Rails.root / 'modules/claims_api/spec/rails_helper'

RSpec.describe 'ClaimsApi::V2::PowerOfAttorneyRequests#index', :bgs, type: :request do
RSpec.describe 'ClaimsApi::V2::PowerOfAttorneyRequests#index', :bgs, skip: 'unused', type: :request do
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copied from #19932.

@tycol7 tycol7 marked this pull request as ready for review December 18, 2024 23:43
@tycol7 tycol7 requested a review from a team as a code owner December 18, 2024 23:43
Comment on lines 16 to 43
field :attributes do |request|
{
veteran: {
first_name: request['vetFirstName'],
last_name: request['vetLastName'],
middle_name: request['vetMiddleName']
},
claimant: {
city: request['claimantCity'],
country: request['claimantCountry'],
military_po: request['claimantMilitaryPO'],
military_postal_code: request['claimantMilitaryPostalCode'],
state: request['claimantState'],
zip: request['claimantZip']
},
representative: {
poa_code: request['poaCode'],
vso_user_email: request['VSOUserEmail'],
vso_user_first_name: request['VSOUserFirstName'],
vso_user_last_name: request['VSOUserLastName']
},
received_date: request['dateRequestReceived'],
decision_date: request['dateRequestActioned'],
status: request['secondaryStatus'],
declined_reason: request['declinedReason'],
change_address_authorization: request['changeAddressAuth'],
health_info_authorization: request['healthInfoAuth']
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cf. BGS response:

"example": [
{
"VSOUserEmail": null,
"VSOUserFirstName": "Joe",
"VSOUserLastName": "BestRep",
"changeAddressAuth": "Y",
"claimantCity": "Charlottesville",
"claimantCountry": "USA",
"claimantMilitaryPO": null,
"claimantMilitaryPostalCode": null,
"claimantState": null,
"claimantZip": "00123",
"dateRequestActioned": "2024-05-25T13:45:00-05:00",
"dateRequestReceived": "2012-11-23T16:49:16-06:00",
"declinedReason": null,
"healthInfoAuth": "Y",
"poaCode": "083",
"procID": "11027",
"secondaryStatus": "New",
"vetFirstName": "[Vet First Name]",
"vetLastName": "[Vet Last Name]",
"vetMiddleName": null,
"vetPtcpntID": "111"
},

@tycol7 tycol7 marked this pull request as draft January 7, 2025 21:54
@va-vfs-bot va-vfs-bot temporarily deployed to tdc/poa-requests-index-update/main/main January 7, 2025 22:07 Inactive
@tycol7 tycol7 marked this pull request as ready for review January 7, 2025 22:13
@va-vfs-bot va-vfs-bot temporarily deployed to tdc/poa-requests-index-update/main/main January 7, 2025 22:26 Inactive
Copy link
Contributor

@rockwellwindsor-va rockwellwindsor-va left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tycol7 Looks like some unrelated tests are failing, but everything related to this work looked good to me!

@tycol7 tycol7 merged commit 3b07289 into master Jan 8, 2025
21 checks passed
@tycol7 tycol7 deleted the tdc/poa-requests-index-update branch January 8, 2025 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
claimsApi modules/claims_api test-passing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants