Open jimduff-usds opened 1 year ago
Bug 17. On a whim, I grabbed a submission reportId and sent it to the api/waters/report/????/delivery endpoint. This should give an error. It does not.
For this submission to RS Staging:
{
"submissionId" : 3154138,
"timestamp" : "2022-07-26T16:12:15.138Z",
"id" : "c01d9fd4-ccf8-4249-9b97-a94012278242",
"topic" : "monkeypox",
"reportItemCount" : null,
"sender" : "sonic",
"httpStatus" : 201
} ]
If I then use that report to query the delivery endpoint:
curl -H "authentication-type: okta" -H "Authorization: Bearer $TOK" "https://staging.prime.cdc.gov/api/waters/report/c01d9fd4-ccf8-4249-9b97-a94012278242/delivery"
This should return an error, but instead I get this back, but erroneously labelled as if its a delivery!
{
"deliveryId" : 3154138,
"sent" : "2022-04-12T17:06:10.534Z",
"expires" : "2022-05-12T17:06:10.534Z",
"receivingOrg" : "sonic",
"receivingOrgSvc" : "elr-secondary",
"reportId" : "c3c8e304-8eff-4882-9000-3645054a30b7",
"topic" : "covid-19",
"reportItemCount" : 1,
"fileName" : "covid-19-c3c8e304-8eff-4882-9000-3645054a30b7-20220412170610.hl7",
"fileType" : "HL7_BATCH",
"externalName" : null
}
Gonna split this ticket into multiple smaller ones, one per issue
Made related tickets for the issues I was able to replicate on my branch with #6178 changes.
Here's an example showing the same Facility over and over. This is from Staging.
Bug: Here's an example where the "Total tests" does not add up to the "Total Tests Reported":
@jimduff-usds is this ticket still valid?
@arnejduranovic Please review.
Describe the bug
Issues fixed in the #6632 PR:
api/waters/report/<reportId>/delivery
does not work for valid delivered reportId.Other issues found
api/waters/org/<orgname>/deliveries
does not work for valid orgnames. (It does work for orgname.recievername)api/waters/org/ORG.RECEIVER/deliveries
API call. (this was true of the old call as well)Other notes
Impact
Delivery API endpoints are not usable.
Here's an example of what the API was returning prior to fixing anything:
Steps to Reproduce one of the above issues:
Do a list query against api/waters/org/md-phd.elr/deliveries. Then grab that reportId from above, and put it into this call:
curl -H "authentication-type: okta" -H "Authorization: Bearer $TOK" "https://staging.prime.cdc.gov/api/waters/report/f3320b16-ff31-4057-a7e1-2d6892f40d29/delivery"
That should work, but instead I get this error:{"error": "f3320b16-ff31-4057-a7e1-2d6892f40d29 is not a submitted report"}
This is doubly wrong. I'm not making a submission query so why is the error saying anything at all about submissions?Furthermore, it is a valid delivery report, and I should get back a detailed response.