Skip to content

Commit

Permalink
Api 26160 remove uploaded attribute (#12500)
Browse files Browse the repository at this point in the history
* Remove uploaded attribute

* Rubocop fixes

* Update schema, add generated swagger
  • Loading branch information
mchristiansonVA authored May 2, 2023
1 parent 0d166ff commit b9950f8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -379,16 +379,12 @@ def map_bgs_tracked_items(bgs_claim)
end
end

def map_upload_and_status(item_id, unique_status)
def map_status(item_id, unique_status)
if supporting_document?(item_id)
status = 'SUBMITTED_AWAITING_REVIEW'
uploaded = true
'SUBMITTED_AWAITING_REVIEW'
else
status = unique_status
uploaded = false
unique_status
end

[status, uploaded]
end

def build_wwsnfy_items
Expand All @@ -397,9 +393,9 @@ def build_wwsnfy_items
return [] if wwsnfy.empty?

wwsnfy.map do |item|
status, uploaded = map_upload_and_status(item[:dvlpmt_item_id], 'NEEDED_FROM_YOU')
status = map_status(item[:dvlpmt_item_id], 'NEEDED_FROM_YOU')

build_tracked_item(find_tracked_item(item[:dvlpmt_item_id]), status, item, uploaded)
build_tracked_item(find_tracked_item(item[:dvlpmt_item_id]), status, item)
end
end

Expand All @@ -409,9 +405,9 @@ def build_wwd_items
return [] if wwd.empty?

wwd.map do |item|
status, uploaded = map_upload_and_status(item[:dvlpmt_item_id], 'NEEDED_FROM_OTHERS')
status = map_status(item[:dvlpmt_item_id], 'NEEDED_FROM_OTHERS')

build_tracked_item(find_tracked_item(item[:dvlpmt_item_id]), status, item, uploaded)
build_tracked_item(find_tracked_item(item[:dvlpmt_item_id]), status, item)
end
end

Expand All @@ -424,9 +420,8 @@ def build_wwr_items

wwr.map do |item|
status = accepted?(claim_status_type) ? 'ACCEPTED' : 'INITIAL_REVIEW_COMPLETE'
uploaded = true

build_tracked_item(find_tracked_item(item[:dvlpmt_item_id]), status, item, uploaded)
build_tracked_item(find_tracked_item(item[:dvlpmt_item_id]), status, item)
end
end

Expand All @@ -438,9 +433,8 @@ def build_no_longer_needed_items

no_longer_needed.map do |tracked_item|
status = 'NO_LONGER_REQUIRED'
uploaded = supporting_document?(tracked_item[:dvlpmt_item_id])

build_tracked_item(tracked_item, status, {}, uploaded)
build_tracked_item(tracked_item, status, {})
end
end

Expand All @@ -461,7 +455,7 @@ def overdue_date_present?(tracked_item)
tracked_item[:suspns_dt].present? && tracked_item[:accept_dt].nil?
end

def build_tracked_item(tracked_item, status, item, uploaded)
def build_tracked_item(tracked_item, status, item)
uploads_allowed = uploads_allowed?(status)
{
closed_date: date_present(tracked_item[:accept_dt]),
Expand All @@ -473,7 +467,6 @@ def build_tracked_item(tracked_item, status, item, uploaded)
status:,
suspense_date: date_present(tracked_item[:suspns_dt]),
id: tracked_item[:dvlpmt_item_id].to_i,
uploaded:,
uploads_allowed:
}
end
Expand Down
12 changes: 2 additions & 10 deletions modules/claims_api/app/swagger/claims_api/v2/dev/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,6 @@
"status": "NO_LONGER_REQUIRED",
"suspenseDate": "2021-06-04",
"id": 293440,
"uploaded": false,
"uploadsAllowed": false
},
{
Expand All @@ -813,7 +812,6 @@
"status": "NO_LONGER_REQUIRED",
"suspenseDate": "2021-06-04",
"id": 293443,
"uploaded": false,
"uploadsAllowed": false
},
{
Expand All @@ -826,7 +824,6 @@
"status": "NO_LONGER_REQUIRED",
"suspenseDate": "2021-06-04",
"id": 293444,
"uploaded": false,
"uploadsAllowed": false
},
{
Expand All @@ -839,7 +836,6 @@
"status": "NO_LONGER_REQUIRED",
"suspenseDate": "2021-06-04",
"id": 293446,
"uploaded": false,
"uploadsAllowed": false
}
]
Expand Down Expand Up @@ -1218,10 +1214,6 @@
"nullable": true,
"example": "2017-10-18"
},
"uploaded": {
"type": "boolean",
"example": true
},
"uploadsAllowed": {
"type": "boolean",
"example": true
Expand Down Expand Up @@ -4559,8 +4551,8 @@
"id": "1",
"type": "intent_to_file",
"attributes": {
"creationDate": "2023-04-24",
"expirationDate": "2024-04-24",
"creationDate": "2023-04-27",
"expirationDate": "2024-04-27",
"type": "compensation",
"status": "active"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,6 @@
"status": "NO_LONGER_REQUIRED",
"suspenseDate": "2021-06-04",
"id": 293440,
"uploaded": false,
"uploadsAllowed": false
},
{
Expand All @@ -813,7 +812,6 @@
"status": "NO_LONGER_REQUIRED",
"suspenseDate": "2021-06-04",
"id": 293443,
"uploaded": false,
"uploadsAllowed": false
},
{
Expand All @@ -826,7 +824,6 @@
"status": "NO_LONGER_REQUIRED",
"suspenseDate": "2021-06-04",
"id": 293444,
"uploaded": false,
"uploadsAllowed": false
},
{
Expand All @@ -839,7 +836,6 @@
"status": "NO_LONGER_REQUIRED",
"suspenseDate": "2021-06-04",
"id": 293446,
"uploaded": false,
"uploadsAllowed": false
}
]
Expand Down Expand Up @@ -1218,10 +1214,6 @@
"nullable": true,
"example": "2017-10-18"
},
"uploaded": {
"type": "boolean",
"example": true
},
"uploadsAllowed": {
"type": "boolean",
"example": true
Expand Down Expand Up @@ -1912,8 +1904,8 @@
"id": "1",
"type": "intent_to_file",
"attributes": {
"creationDate": "2023-04-24",
"expirationDate": "2024-04-24",
"creationDate": "2023-04-27",
"expirationDate": "2024-04-27",
"type": "compensation",
"status": "active"
}
Expand Down
4 changes: 0 additions & 4 deletions spec/support/schemas/claims_api/v2/veterans/claims/claim.json
Original file line number Diff line number Diff line change
Expand Up @@ -338,10 +338,6 @@
"nullable": true,
"example": "2017-10-18"
},
"uploaded": {
"type": "boolean",
"example": true
},
"uploadsAllowed": {
"type": "boolean",
"example": true
Expand Down

0 comments on commit b9950f8

Please sign in to comment.