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

Dash/oren/api 34439 poa requests index response spec #16273

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# frozen_string_literal: true

module ClaimsApi
module V2
class PowerOfAttorneyRequestsController < ClaimsApi::V2::ApplicationController
# rubocop:disable Metrics/MethodLength
def index
render json: {
data: [
{
type: 'powerOfAttorneyRequest',
id: 12_345,
attributes: {
status: 'DECLINED',
submittedAt: Time.zone.at(1_712_724_672).iso8601,
acceptedOrDeclinedAt: Time.zone.at(1_712_724_672).iso8601,
declinedReason: 'Because I felt like it',
isAddressChangingAuthorized: true,
isTreatmentDisclosureAuthorized: false,
powerOfAttorneyCode: '012',
veteran: {
firstName: 'Firstus',
middleName: nil,
lastName: 'Lastus'
},
claimant: {
participantId: 23_456,
mailingAddress: {
city: 'Baltimore',
state: 'MD',
zip: '21218',
country: 'US',
militaryPostOffice: nil,
militaryPostalCode: nil
},
nonVeteranIndividual: {
firstName: 'Alpha',
middleName: nil,
lastName: 'Omega',
relationshipToVeteran: 'Cousin'
}
},
representative: {
firstName: 'Primero',
lastName: 'Ultimo',
email: '[email protected]'
}
}
}
]
}
end
# rubocop:enable Metrics/MethodLength
end
end
end
293 changes: 293 additions & 0 deletions modules/claims_api/app/swagger/claims_api/v2/dev/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,299 @@
}
},
"paths": {
"/power-of-attorney-requests": {
"get": {
"summary": "Search for Power of Attorney requests.",
"tags": [
"Power of Attorney"
],
"operationId": "searchPowerOfAttorneyRequests",
"security": [
{
"productionOauth": [
"system/claim.read",
"system/system/claim.write"
]
},
{
"sandboxOauth": [
"system/claim.read",
"system/system/claim.write"
]
},
{
"bearer_token": [

]
}
],
"description": "Faceted, paginated, and sorted search of Power of Attorney requests",
"responses": {
"200": {
"description": "Search results",
"content": {
"application/json": {
"example": {
"data": [
{
"type": "powerOfAttorneyRequest",
"id": 12345,
"attributes": {
"status": "DECLINED",
"submittedAt": "2024-04-10T04:51:12+00:00",
"acceptedOrDeclinedAt": "2024-04-10T04:51:12+00:00",
"declinedReason": "Because I felt like it",
"isAddressChangingAuthorized": true,
"isTreatmentDisclosureAuthorized": false,
"powerOfAttorneyCode": "012",
"veteran": {
"firstName": "Firstus",
"middleName": null,
"lastName": "Lastus"
},
"claimant": {
"participantId": 23456,
"mailingAddress": {
"city": "Baltimore",
"state": "MD",
"zip": "21218",
"country": "US",
"militaryPostOffice": null,
"militaryPostalCode": null
},
"nonVeteranIndividual": {
"firstName": "Alpha",
"middleName": null,
"lastName": "Omega",
"relationshipToVeteran": "Cousin"
}
},
"representative": {
"firstName": "Primero",
"lastName": "Ultimo",
"email": "[email protected]"
}
}
}
]
},
"schema": {
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"type": "array",
"description": "List of Power of Attorney requests satisfying the given search",
"items": {
"additionalProperties": false,
"required": [
"type",
"id",
"attributes"
],
"properties": {
"type": {
"type": "string",
"enum": [
"powerOfAttorneyRequest"
]
},
"id": {
"type": "integer",
"description": "The ID of the form application process that uniquely identifies this Power of Attorney request",
"format": "int64"
},
"attributes": {
"type": "object",
"additionalProperties": false,
"required": [
"status",
"submittedAt",
"acceptedOrDeclinedAt",
"declinedReason",
"isAddressChangingAuthorized",
"isTreatmentDisclosureAuthorized",
"powerOfAttorneyCode",
"veteran",
"claimant",
"representative"
],
"properties": {
"status": {
"type": "string",
"description": "The Power of Attorney request's current status",
"enum": [
"NEW",
"PENDING",
"ACCEPTED",
"DECLINED"
]
},
"submittedAt": {
"type": "string",
"description": "UTC datetime at which the Power of Attorney request was submitted",
"format": "date-time"
},
"acceptedOrDeclinedAt": {
"type": "string",
"description": "UTC datetime at which the Power of Attorney request was accepted or declined",
"nullable": true,
"format": "date-time"
},
"declinedReason": {
"type": "string",
"description": "The reason given by the representative for declining the Power of Attorney request",
"nullable": true
},
"isAddressChangingAuthorized": {
"type": "boolean",
"description": "Whether the representative is authorized to change the claimant's address"
},
"isTreatmentDisclosureAuthorized": {
"type": "boolean",
"description": "Whether the representative is authorized to receive disclosures of the Veteran's treatment records"
},
"powerOfAttorneyCode": {
"type": "string",
"description": "The code that indicates an individual or organization's ability to be granted Power of Attorney for a Veteran"
},
"veteran": {
"type": "object",
"description": "The Veteran for whom Power of Attorney is being requested",
"additionalProperties": false,
"required": [
"firstName",
"middleName",
"lastName"
],
"properties": {
"firstName": {
"type": "string"
},
"middleName": {
"type": "string",
"nullable": true
},
"lastName": {
"type": "string"
}
}
},
"claimant": {
"type": "object",
"description": "The individual, often but not always the Veteran, that executed this form application process",
"additionalProperties": false,
"required": [
"participantId",
"mailingAddress",
"nonVeteranIndividual"
],
"properties": {
"participantId": {
"type": "integer",
"description": "The identifier of the individual that executed this form application process",
"format": "int64"
},
"mailingAddress": {
"type": "object",
"description": "The mailing address of the individual that executed this form application process",
"additionalProperties": false,
"required": [
"city",
"state",
"zip",
"country",
"militaryPostOffice",
"militaryPostalCode"
],
"properties": {
"city": {
"type": "string"
},
"state": {
"type": "string"
},
"zip": {
"type": "string"
},
"country": {
"type": "string"
},
"militaryPostOffice": {
"type": "string",
"nullable": true
},
"militaryPostalCode": {
"type": "string",
"nullable": true
}
}
},
"nonVeteranIndividual": {
"type": "object",
"description": "When present, the non-Veteran individual that executed this form application process for the Veteran",
"nullable": true,
"additionalProperties": false,
"required": [
"firstName",
"middleName",
"lastName",
"relationshipToVeteran"
],
"properties": {
"firstName": {
"type": "string"
},
"middleName": {
"type": "string",
"nullable": true
},
"lastName": {
"type": "string"
},
"relationshipToVeteran": {
"type": "string"
}
}
}
}
},
"representative": {
"type": "object",
"description": "The representative to whom this Power of Attorney request is being submitted",
"additionalProperties": false,
"required": [
"firstName",
"lastName",
"email"
],
"properties": {
"firstName": {
"type": "string"
},
"lastName": {
"type": "string"
},
"email": {
"type": "string"
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
},
"/veteran-id:find": {
"post": {
"summary": "Retrieve Veteran ID.",
Expand Down
Loading
Loading