-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
APPEALS-57508: Correspondence Details Serializers Contain Unnecessary…
… Information (#22937) * filtered related correspondece values * added new correspondence_details serializer * created new appeal serializer and updated frontend to handle new values * added correspondence type to serializer * fixed bug where appeal id was not matching with previously linked appeals * fixed failing test * fixed failing tests
- Loading branch information
Showing
8 changed files
with
83 additions
and
34 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
46 changes: 46 additions & 0 deletions
46
app/models/serializers/work_queue/correspondence_details_appeal_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,46 @@ | ||
# frozen_string_literal: true | ||
|
||
class WorkQueue::CorrespondenceDetailsAppealSerializer | ||
include FastJsonapi::ObjectSerializer | ||
|
||
set_key_transform :camel_lower | ||
|
||
attribute :id | ||
attribute :external_id, &:uuid | ||
attribute :docket_name | ||
attribute :docket_number | ||
attribute :decision_date | ||
attribute :overtime, &:overtime? | ||
attribute :withdrawn, &:withdrawn? | ||
attribute :status | ||
attribute :case_type, &:type | ||
attribute :aod, &:advanced_on_docket? | ||
attribute :appellant_full_name do |object| | ||
object.claimant&.name | ||
end | ||
|
||
attribute :veteran_full_name do |object| | ||
object.veteran ? object.veteran.name.formatted(:readable_full) : "Cannot locate" | ||
end | ||
|
||
# count values pulled from WorkQueue::AppealSerializer issue attribute | ||
attribute :issue_count do |object| | ||
object.request_issues.active_or_decided_or_withdrawn.includes(:remand_reasons).count | ||
end | ||
|
||
attribute :assigned_to_location do |object, params| | ||
if object&.status&.status == :distributed_to_judge | ||
if params[:user]&.judge? || params[:user]&.attorney? || User.list_hearing_coordinators.include?(params[:user]) | ||
object.assigned_to_location | ||
end | ||
else | ||
object.assigned_to_location | ||
end | ||
end | ||
|
||
# badges attributes | ||
attribute :veteran_appellant_deceased, &:veteran_appellant_deceased? | ||
attribute :contested_claim, &:contested_claim? | ||
attribute :mst, &:mst? | ||
attribute :pact, &:pact? | ||
end |
19 changes: 19 additions & 0 deletions
19
app/models/serializers/work_queue/correspondence_details_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,19 @@ | ||
# frozen_string_literal: true | ||
|
||
class WorkQueue::CorrespondenceDetailsSerializer | ||
include FastJsonapi::ObjectSerializer | ||
|
||
set_key_transform :camel_lower | ||
|
||
attribute :uuid | ||
attribute :id | ||
attribute :notes | ||
attribute :va_date_of_receipt | ||
attribute :nod | ||
attribute :status | ||
attribute :type | ||
attribute :veteran_id | ||
attribute :correspondence_type do |object| | ||
object.correspondence_type&.name | ||
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