Uploaded image for project: 'mod-orders'
  1. mod-orders
  2. MODORDERS-177

Order format is not verified on locations

    XMLWordPrintable

Details

    • Thunderjet

    Description

      If an order is created in order format electronic resource with create_inventory = true and the location has quantity_physical =1, the order is being created successfully. However, there are no inventory records created as the quantity of electronic is not given.

      curl -X POST \
         http://folio-testing-backend01.aws.indexdata.com:9130/orders/composite-orders \
         -H 'Content-Type: application/json' \
         -H 'X-Okapi-Tenant: diku' \
         -H 'x-okapi-token: $OKAPITOKEN' \
         -d '{
          "adjustment": {
            "credit": 0.0,
            "discount": 0.0,
            "insurance": 0.0,
            "overhead": 0.0,
            "shipment": 0.0,
            "tax_1": 0.0,
            "tax_2": 0.0,
            "use_pro_rate": false
          },
          "approved": true,
          "assigned_to": "ab18897b-0e40-4f31-896b-9c9adc979a88",
          "notes": [
            "Kruthi Testing eresource"
          ],
          "order_type": "One-Time",
          "re_encumber": false,
          "total_estimated_price": 1,
          "total_items": 1,
          "vendor": "168f8a86-d26c-406e-813f-c7527f241ac3",
          "workflow_status": "Open",
          "metadata": {
            "createdDate": "2010-10-08T03:53:00.000",
            "createdByUserId": "ab18897b-0e40-4f31-896b-9c9adc979a88"
          },
          "compositePoLines": [
            {
              "acquisition_method": "Purchase At Vendor System",
              "adjustment": {
                "credit": 0.0,
                "discount": 0.0,
                "insurance": 0.0,
                "invoice_id": "2d6d495c-c237-476f-aa48-57f7cbf74ca4",
                "overhead": 0.0,
                "shipment": 0.0,
                "tax_1": 0.0,
                "tax_2": 0.0,
                "use_pro_rate": false
              },
              "alerts": [
                {
                  "alert": "Receipt overdue"
                }
              ],
              "cancellation_restriction": false,
              "cancellation_restriction_note": "ABCDEFGHIJKLMNOPQRSTUVW",
              "claims": [
                {
                  "claimed": false,
                  "sent": "2018-10-09T00:00:00.000Z",
                  "grace": 30
                }
              ],
              "collection": false,
              "contributors": [
                {
                  "contributor": "Ed Mashburn",
                  "contributor_type": "fbdd42a8-e47d-4694-b448-cc571d1b44c3"
                }
              ],
              "cost": {
                "list_price": 1,
                "currency": "USD",
                "quantity_physical": 0,
                "quantity_electronic": 1,
                "po_line_estimated_price": 1
              },
              "description": "ABCDEFGH",
              "details": {
                "receiving_note": "ABCDEFGHIJKL",
                "product_ids": [
                  {
                    "product_id": "111111",
                    "product_id_type": "ISBN"
                  }
                ],
                "material_types": [
                  "1a54b431-2e4f-452d-9cae-9cee66c9a892"
                ],
                "subscription_from": "2018-10-09T00:00:00.000Z",
                "subscription_interval": 824,
                "subscription_to": "2020-10-09T00:00:00.000Z"
              },
              "donor": "ABCDEFGHIJKLM",
              "eresource": {
                "create_inventory": true
              },
              "fund_distribution": [
                {
                  "code": "HIST",
                  "percentage": 100.0,
                  "encumbrance": "eb506834-6c70-4239-8d1a-6414a5b08ac3"
                }
              ],
              "locations": [
                {
                  "location_id": "fcd64ce1-6995-48f0-840e-89ffa2288371",
                  "quantity": 1,
                  "quantity_electronic": 0,
                  "quantity_physical": 1
                }
              ],
              "order_format": "Electronic Resource",
              "owner": "ABCDEFGHIJKLMNOPQRSTUVWXYZABC",
              "payment_status": "Awaiting Payment",
              "physical": {
                "volumes": [
                  "vol.1"
                ],
                "material_supplier": "73d14bc5-d131-48c6-b380-f8e62f63c8b6",
                "receipt_due": "2018-10-10T00:00:00.000Z"
              },
              "po_line_description": "ABCDEFGHIJKLMNOPQRSTUVWXY",
              "po_line_number": "268758-03",
              "publication_date": "2017",
              "publisher": "Schiffer Publishing",
              "receipt_date": "2018-10-09T00:00:00.000Z",
              "receipt_status": "Pending",
              "reporting_codes": [
              ],
              "requester": "Leo Bulero",
              "rush": true,
              "selector": "ABCD",
              "source": {
                "code": "ABCDEFGHIJKLMNOPQRSTUVWXYZABC",
                "description": "ABCDEFGHIJKLMNO"
              },
              "tags": [
              ],
              "title": "Testing Modorders159",
              "vendor_detail": {
                "instructions": "ABCDEFG",
                "note_from_vendor": "ABCDEFGHIKJKLMNOP",
                "ref_number": "123456-78",
                "ref_number_type": "Supplier's unique order line reference number",
                "vendor_account": "8910-10"
              }
            }
          ]
        }'
      

      RESPONSE:

      {
        "id" : "5c80fad1-19f3-41da-aa84-16eb975419f6",
        "adjustment" : {
          "id" : "81f3289a-0a90-400a-866a-5ea053efd9a2",
          "credit" : 0.0,
          "discount" : 0.0,
          "insurance" : 0.0,
          "invoice_id" : "2d6d495c-c237-476f-aa48-57f7cbf74ca4",
          "overhead" : 0.0,
          "shipment" : 0.0,
          "tax_1" : 0.0,
          "tax_2" : 0.0,
          "use_pro_rate" : false,
          "po_line_id" : "9541b183-d757-41d2-b749-0d994fe9e935"
        },
        "approved" : true,
        "assigned_to" : "ab18897b-0e40-4f31-896b-9c9adc979a88",
        "dateOrdered" : "2019-03-04T17:03:13.333+0000",
        "notes" : [ "Kruthi Testing eresource" ],
        "po_number" : "10117",
        "order_type" : "One-Time",
        "re_encumber" : false,
        "total_estimated_price" : 1.0,
        "total_items" : 1,
        "vendor" : "168f8a86-d26c-406e-813f-c7527f241ac3",
        "workflow_status" : "Open",
        "compositePoLines" : [ {
          "id" : "9541b183-d757-41d2-b749-0d994fe9e935",
          "acquisition_method" : "Purchase At Vendor System",
          "adjustment" : {
            "id" : "81f3289a-0a90-400a-866a-5ea053efd9a2",
            "credit" : 0.0,
            "discount" : 0.0,
            "insurance" : 0.0,
            "invoice_id" : "2d6d495c-c237-476f-aa48-57f7cbf74ca4",
            "overhead" : 0.0,
            "shipment" : 0.0,
            "tax_1" : 0.0,
            "tax_2" : 0.0,
            "use_pro_rate" : false,
            "po_line_id" : "9541b183-d757-41d2-b749-0d994fe9e935"
          },
          "alerts" : [ {
            "id" : "8f95d3a7-668d-4e0e-a594-3e2d54071f07",
            "alert" : "Receipt overdue",
            "po_line_id" : "9541b183-d757-41d2-b749-0d994fe9e935"
          } ],
          "cancellation_restriction" : false,
          "cancellation_restriction_note" : "ABCDEFGHIJKLMNOPQRSTUVW",
          "claims" : [ {
            "id" : "b219d239-1bcc-40d2-9c95-880e235e21ff",
            "claimed" : false,
            "sent" : "2018-10-09T00:00:00.000+0000",
            "grace" : 30,
            "po_line_id" : "9541b183-d757-41d2-b749-0d994fe9e935"
          } ],
          "collection" : false,
          "contributors" : [ {
            "contributor" : "Ed Mashburn",
            "contributor_type" : "fbdd42a8-e47d-4694-b448-cc571d1b44c3"
          } ],
          "cost" : {
            "id" : "57e86664-d804-4fb6-ba71-0e02d7eab4e0",
            "list_price" : 1.0,
            "currency" : "USD",
            "quantity_physical" : 0,
            "quantity_electronic" : 1,
            "po_line_estimated_price" : 1.0,
            "po_line_id" : "9541b183-d757-41d2-b749-0d994fe9e935"
          },
          "description" : "ABCDEFGH",
          "details" : {
            "id" : "b64b5af8-5c6c-4c78-a520-bb8ef4196a11",
            "receiving_note" : "ABCDEFGHIJKL",
            "product_ids" : [ {
              "product_id" : "111111",
              "product_id_type" : "ISBN"
            } ],
            "material_types" : [ "1a54b431-2e4f-452d-9cae-9cee66c9a892" ],
            "subscription_from" : "2018-10-09T00:00:00.000+0000",
            "subscription_interval" : 824,
            "subscription_to" : "2020-10-09T00:00:00.000+0000",
            "po_line_id" : "9541b183-d757-41d2-b749-0d994fe9e935"
          },
          "donor" : "ABCDEFGHIJKLM",
          "eresource" : {
            "id" : "6e5af470-c5b3-4484-a5c5-481264c5a7ac",
            "create_inventory" : true,
            "po_line_id" : "9541b183-d757-41d2-b749-0d994fe9e935"
          },
          "fund_distribution" : [ {
            "id" : "35860607-2f25-4bb8-b4c4-d11ec6560058",
            "code" : "HIST",
            "encumbrance" : "eb506834-6c70-4239-8d1a-6414a5b08ac3",
            "percentage" : 100.0,
            "po_line_id" : "9541b183-d757-41d2-b749-0d994fe9e935"
          } ],
          "locations" : [ {
            "id" : "d1615446-f3aa-4b8b-9a22-f3d79c8fb10d",
            "location_id" : "fcd64ce1-6995-48f0-840e-89ffa2288371",
            "po_line_id" : "9541b183-d757-41d2-b749-0d994fe9e935",
            "quantity" : 1,
            "quantity_electronic" : 0,
            "quantity_physical" : 1
          } ],
          "order_format" : "Electronic Resource",
          "owner" : "ABCDEFGHIJKLMNOPQRSTUVWXYZABC",
          "payment_status" : "Awaiting Payment",
          "physical" : {
            "id" : "27022f1c-4a04-4583-a236-c96be33aef4a",
            "material_supplier" : "73d14bc5-d131-48c6-b380-f8e62f63c8b6",
            "receipt_due" : "2018-10-10T00:00:00.000+0000",
            "volumes" : [ "vol.1" ],
            "po_line_id" : "9541b183-d757-41d2-b749-0d994fe9e935"
          },
          "po_line_description" : "ABCDEFGHIJKLMNOPQRSTUVWXY",
          "po_line_number" : "10117-1",
          "publication_date" : "2017",
          "publisher" : "Schiffer Publishing",
          "purchase_order_id" : "5c80fad1-19f3-41da-aa84-16eb975419f6",
          "receipt_date" : "2018-10-09T00:00:00.000+0000",
          "receipt_status" : "Awaiting Receipt",
          "reporting_codes" : [ ],
          "requester" : "Leo Bulero",
          "rush" : true,
          "selector" : "ABCD",
          "source" : {
            "id" : "ebc016c6-483a-460e-99b8-b7879e265507",
            "code" : "ABCDEFGHIJKLMNOPQRSTUVWXYZABC",
            "description" : "ABCDEFGHIJKLMNO"
          },
          "tags" : [ ],
          "title" : "Testing Modorders159",
          "vendor_detail" : {
            "id" : "078f1f1f-01a7-4391-87d2-ec317daa4dc2",
            "instructions" : "ABCDEFG",
            "note_from_vendor" : "ABCDEFGHIKJKLMNOP",
            "ref_number" : "123456-78",
            "ref_number_type" : "Supplier's unique order line reference number",
            "vendor_account" : "8910-10",
            "po_line_id" : "9541b183-d757-41d2-b749-0d994fe9e935"
          }
        } ],
        "metadata" : {
          "createdDate" : "2019-03-04T17:03:13.196+0000",
          "createdByUserId" : "a8e3ae3a-f560-572e-9406-fdfaa363811b",
          "updatedDate" : "2019-03-04T17:03:13.196+0000",
          "updatedByUserId" : "a8e3ae3a-f560-572e-9406-fdfaa363811b"
        }
      }
      

      Also, pieces and items are not being created

      curl -X GET \
      >   'http://folio-testing-backend01.aws.indexdata.com:9130/orders/receiving-history?query=poLineId=9541b183-d757-41d2-b749-0d994fe9e935' \
      >   -H 'Content-Type: application/json' \
      >   -H 'X-Okapi-Tenant: diku' \
      >   -H 'x-okapi-token: $OKAPITOKEN'
      {
        "receiving_history" : [ ],
        "total_records" : 0
      }
      

      Acceptance Criteria:
      If location details do not match order_format, corresponding error is thrown
      API tests updated if applicable

      TestRail: Results

        Attachments

          Issue Links

            Activity

              People

                Unassigned Unassigned
                KVupp Kruthi Vuppala
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  TestRail: Runs

                    TestRail: Cases