Uploaded image for project: 'mod-inventory'
  1. mod-inventory
  2. MODINV-119

Create endpoint to save collection of instances

    XMLWordPrintable

    Details

    • Template:
    • Sprint:
      EPAM BatchLoader Sprint 17, EPAM BatchLoader Sprint 18
    • Story Points:
      5
    • Development Team:
      Folijet

      Description

      Prerequisites
      Considering a latest test results about performance for the mod-source-record-manager, we need to improve an algorithm for sending Instances to the mod-inventory. In current implementation We are doing send Instances in sequential manner (one Instance POST request per each parsed record) which obviously takes a lot of time.

      Approach
      I propose to post only one request with collection of Instances - so called "batch" POST request.
      For this purpose we need to have an endpoint in the mod-inventory that is able to receive Instances and save it in the mod-inventory-storage. This is just as an existing method works, which receives only one Instance.
      Designed endpoint receives collection of Instances (that easily could be mapped to JsonArray)

      Design
      Method: POST
      Resource: /inventory/instances/batch
      Boby: collection of Instances and total number of Instances
      Returns: collection of successfully created Instances, error messages for failure Instances, total number of created Instances:

      • If all received Instances are successfully saved - returns 201 response with saved instances, "errorMessages" array is empty.
      • If save for one or more Instances has failed - returns 500 response with "errorMessages" array, explaining a reason of why Instances were processed with failures (one error message per one Instance). If there are Instances that were successfully saved (among wrong Instances) - response contains successfully saved Instances ("instances" section).

      Request example

      Response example

        TestRail: Results

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                Igor_Gorchakov Igor Gorchakov
                Reporter:
                Igor_Gorchakov Igor Gorchakov
                Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:

                    TestRail: Runs

                      TestRail: Cases