Details
-
Bug
-
Status: Closed (View Workflow)
-
P3
-
Resolution: Done
-
None
-
-
ACQ Sprint 59
-
2
-
Thunderjet
Description
Overview:
A cryptic error (see below for details) is returned when adding a POLine to a PO which has status Open or Closed. Here the "genericError" code is used, but should probably be replaced with a code specific to this scenario.
Acceptance Criteria:
- Appropriate error message and code are returned in this scenario
- A test case has been added to the unit tests to exercise this scenario
- Test coverage on new code is 80%+
- A test case has been added to the API tests to exercise this scenario
Reproducer:
- Goto folio-testing and login
- Create a PO
- Scenario 1:
- Transition the PO to Open
- Add a PoLine to the PO
- Scenario 2:
- Transition the PO to Closed
- Add a PoLine to the PO
## Create PO ## curl 'http://folio-testing-backend01.aws.indexdata.com:9130/orders/composite-orders' -H "X-Okapi-Token: $TOKEN" -H 'Content-Type: application/json' -w '\n' --data-binary '{ > "id" : "15d97111-ed48-4369-b8eb-269363aabf43", > "po_number" : "MODORDERS188", > "order_type" : "One-Time", > "vendor" : "4837d297-443c-48f2-b3b2-4eda69da8ef3", > "workflow_status" : "Pending", > "compositePoLines" : [ ], > "metadata" : { > "createdDate" : "2019-03-07T21:30:09.547+0000", > "createdByUserId" : "49e74bca-d8c2-5399-be7c-379fffa1aa6f", > "updatedDate" : "2019-03-07T21:30:09.547+0000", > "updatedByUserId" : "49e74bca-d8c2-5399-be7c-379fffa1aa6f" > } > }' { "id" : "15d97111-ed48-4369-b8eb-269363aabf43", "notes" : [ ], "po_number" : "MODORDERS188", "order_type" : "One-Time", "vendor" : "4837d297-443c-48f2-b3b2-4eda69da8ef3", "workflow_status" : "Pending", "compositePoLines" : [ ], "metadata" : { "createdDate" : "2019-03-07T21:36:12.419+0000", "createdByUserId" : "49e74bca-d8c2-5399-be7c-379fffa1aa6f", "updatedDate" : "2019-03-07T21:36:12.419+0000", "updatedByUserId" : "49e74bca-d8c2-5399-be7c-379fffa1aa6f" } } ## Transition to Open ## curl 'http://folio-testing-backend01.aws.indexdata.com:9130/orders/composite-orders/15d97111-ed48-4369-b8eb-269363aabf43' -H "X-Okapi-Token: $TOKEN" -H 'Content-Type: application/json' -w '\n' -XPUT --data-binary ' > { > "id" : "15d97111-ed48-4369-b8eb-269363aabf43", > "notes" : [ ], > "po_number" : "MODORDERS188", > "order_type" : "One-Time", > "vendor" : "4837d297-443c-48f2-b3b2-4eda69da8ef3", > "workflow_status" : "Open", > "compositePoLines" : [ ] > }' ## Sanity Check ## curl 'http://folio-testing-backend01.aws.indexdata.com:9130/orders/composite-orders/15d97111-ed48-4369-b8eb-269363aabf43' -H "X-Okapi-Token: $TOKEN" -H 'Content-Type: application/json' -w '\n' -XGET { "id" : "15d97111-ed48-4369-b8eb-269363aabf43", "dateOrdered" : "2019-03-07T21:37:40.208+0000", "notes" : [ ], "po_number" : "MODORDERS188", "order_type" : "One-Time", "vendor" : "4837d297-443c-48f2-b3b2-4eda69da8ef3", "workflow_status" : "Open", "compositePoLines" : [ ], "metadata" : { "createdDate" : "2019-03-07T21:36:12.441+0000", "createdByUserId" : "49e74bca-d8c2-5399-be7c-379fffa1aa6f", "updatedDate" : "2019-03-07T21:37:40.221+0000", "updatedByUserId" : "49e74bca-d8c2-5399-be7c-379fffa1aa6f" } } ## Add a POLine ## curl 'http://folio-testing-backend01.aws.indexdata.com:9130/orders/order-lines' -H "X-Okapi-Token: $TOKEN" -H 'Content-Type: application/json' -w'\n' --data-binary '{ > "source":{ > "code":"FOLIO" > }, > "cost":{ > "currency":"USD", > "list_price":"5.99", > "quantity_physical":1 > }, > "vendor_detail":{ > "instructions":"" > }, > "purchase_order_id":"15d97111-ed48-4369-b8eb-269363aabf43", > "acquisition_method":"Gift", > "order_format":"Physical Resource", > "title":"Grass", > "contributors":[ > { > "contributor":"Sheri S. Tepper" > } > ], > "details":{ > "product_ids":[ > { > "product_id":"9788675309", > "product_id_type":"ISBN" > } > ], > "material_types":[ > "1a54b431-2e4f-452d-9cae-9cee66c9a892" > ] > }, > "locations":[ > { > "location_id":"53cf956f-c1df-410b-8bea-27f712cca7c0", > "quantity_physical":1 > } > ] > }' { "errors" : [ { "message" : "ErrorMessage(fields=Map(Position -> 23, Line -> 420, File -> namespace.c, SQLSTATE -> 42P01, Routine -> RangeVarGetRelidExtended, V -> ERROR, Message -> relation \"polNumber_15d97111-ed48-4369-b8eb-269363aabf43\" does not exist, Severity -> ERROR))", "code" : "genericError", "parameters" : [ ] } ] }
See UIOR-144 for additional details
TestRail: Results
Attachments
Issue Links
- relates to
-
UXPROD-1388 Create New Purchase Order Lines
-
- Closed
-
-
UIOR-144 Do not allow a PO Line to be added to an Open PO, and return an appropriate error message to the user
-
- Closed
-