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

PUT orders - handle empty array of the PO lines

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Closed (View Workflow)
    • Priority: P3
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 3.0.0
    • Labels:
      None
    • Template:
    • Sprint:
      ACQ Sprint 55, ACQ Sprint 56
    • Story Points:
      2
    • Development Team:
      Thunderjet

      Description

      Requirement:
      In case a request that contains an empty po_lines array, all the PO Lines should be removed... e.g. per the "if the po_line exists in the database but not in the request, remove the po_line" rule.

      Current situation:
      The resulting CompositePurchaseOrder.java model generated based on composite_purchase_order.json schema has

          @JsonProperty("po_lines")
          @JsonPropertyDescription("a list of completely de-referenced purchase order lines")
          @Valid
          private List<PoLine> poLines = new ArrayList<PoLine>();
      

      This means that if request does not include po_lines or includes "po_lines": [] the result is the same i.e. empty List.

      Required change:
      The schema change is required to make these 2 cases different:

      ...
          "po_lines": {
            "description": "a list of completely de-referenced purchase order lines",
            "id": "po_lines",
            "type": "array",
            "items": {
              "type": "object",
              "$ref": "composite_po_line.json"
            },
            "default": null
          },
      ...
      

      In this case if the request does not include po_lines or includes "po_lines": null the result will be absolutely the same i.e. "do not touch PO lines". The business logic should start processing the PO lines only if the field is not null.

        TestRail: Results

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                cmcnally Craig McNally
                Reporter:
                piotr_kalashuk Piotr Kalashuk
                Tester Assignee:
                Craig McNally Craig McNally
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:

                    TestRail: Runs

                      TestRail: Cases