-
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.
[API-44023] add steps to poa model and response (#20398)
* add steps to poa model and response * add errors to get poa response * memoize processes * fork serializer * update schema and docs * update test * remove linebreak
- Loading branch information
Showing
16 changed files
with
407 additions
and
84 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
28 changes: 0 additions & 28 deletions
28
modules/claims_api/app/serializers/claims_api/power_of_attorney_serializer.rb
This file was deleted.
Oops, something went wrong.
30 changes: 30 additions & 0 deletions
30
modules/claims_api/app/serializers/claims_api/v1/power_of_attorney_serializer.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,30 @@ | ||
# frozen_string_literal: true | ||
|
||
module ClaimsApi | ||
module V1 | ||
class PowerOfAttorneySerializer | ||
include JSONAPI::Serializer | ||
|
||
set_type :claims_api_power_of_attorneys | ||
set_id :id | ||
set_key_transform :underscore | ||
|
||
attributes :date_request_accepted, :previous_poa | ||
|
||
attribute :representative do |object| | ||
object.representative.deep_transform_keys!(&:underscore) | ||
end | ||
|
||
# "Uploaded" is an internal-only status indicating that the POA PDF | ||
# was uploaded to VBMS, but we did not make it to updating BGS. | ||
# For external consistency, return as "Updated" | ||
attribute :status do |object| | ||
if object[:status] == ClaimsApi::PowerOfAttorney::UPLOADED | ||
ClaimsApi::PowerOfAttorney::UPDATED | ||
else | ||
object[:status] | ||
end | ||
end | ||
end | ||
end | ||
end |
39 changes: 39 additions & 0 deletions
39
modules/claims_api/app/serializers/claims_api/v2/power_of_attorney_serializer.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,39 @@ | ||
# frozen_string_literal: true | ||
|
||
module ClaimsApi | ||
module V2 | ||
class PowerOfAttorneySerializer | ||
include JSONAPI::Serializer | ||
|
||
set_type :claims_api_power_of_attorneys | ||
set_id :id | ||
set_key_transform :underscore | ||
|
||
attributes :created_at | ||
|
||
attribute :representative do |object| | ||
object.representative.deep_transform_keys!(&:underscore) | ||
end | ||
|
||
# "Uploaded" is an internal-only status indicating that the POA PDF | ||
# was uploaded to VBMS, but we did not make it to updating BGS. | ||
# For external consistency, return as "Updated" | ||
attribute :status do |object| | ||
if object[:status] == ClaimsApi::PowerOfAttorney::UPLOADED | ||
ClaimsApi::PowerOfAttorney::UPDATED | ||
else | ||
object[:status] | ||
end | ||
end | ||
|
||
attribute :errors | ||
attribute :steps | ||
|
||
private | ||
|
||
def created_at | ||
object.date_request_accepted | ||
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.