Uploaded image for project: 'mod-orders-storage'
  1. mod-orders-storage
  2. MODORDSTOR-298

Define new Storage API for updating Instance Reference for Non-package order line

    XMLWordPrintable

    Details

    • Template:
      Thunderjet/Firebird Back-end Story Template
    • Sprint:
      ACQ Sprint 140
    • Story Points:
      3
    • Development Team:
      Thunderjet
    • Release:
      Morning Glory R2 2022

      Description

      Purpose/Overview:
      Current situation or problem: When a purchase orders is connected to the wrong instance there is no way to correct it. Unopening orders to do this is causing issues with receiving workflow.

      Use cases:
      Use cases

      Requirements/Scope:

      1. Define API through which it should be possible replace instance reference for opened order line.

      Approach:
      1. Define storage PATCH method
      2. Refactoring

      • Move following methods in the org.folio.services.lines.PoLinesService:
        • org.folio.rest.impl.PoLinesAPI#createPoLineWithTitle. And handleResponseWithLocation(asyncResultHandler, tx, "POLine {} {} created") should stay in the controller
        • org.folio.rest.impl.PoLinesAPI#updatePoLineWithTitle
        • Logic from org.folio.rest.impl.PoLinesAPI#deleteOrdersStoragePoLinesById should be moved to org.folio.services.lines.PoLinesService
            vertxContext.runOnContext(v -> {
                  Tx<String> tx = new Tx<>(id, getPgClient());
                  logger.info("Delete POLine");
                  tx.startTx()
                    .compose(this::deletePiecesByPOLineId)
                    .compose(this::deleteTitleById)
                    .compose(this::deletePOLineById)
                    .compose(Tx::endTx)
                    .onComplete(handleNoContentResponse(asyncResultHandler, tx, "POLine {} {} deleted"));
                });
          

          !Important : Basically all business logic should be placed in the business services

      3. Define class abstractions

      • Create the same class structure as in the mod-orders Class diagram
      • All classes should be defined in the Spring context as singletons

      Acceptance criteria:

      • RAML file ramls/po-line.raml updated
      • Stubs implemented
      • Optional : API tests

        TestRail: Results

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                D_Butramyou Dzmitry Butramyou
                Reporter:
                Andrei_Makaranka Andrei Makaranka
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                  Dates

                  Created:
                  Updated:

                    TestRail: Runs

                      TestRail: Cases