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

Handle poline transition from package to non package and vice versa

    XMLWordPrintable

    Details

    • Template:
    • Story Points:
      3
    • Development Team:
      Thunderjet

      Description

      Overview

      Based on the bug https://issues.folio.org/browse/MODORDERS-368. After fixing it there are two unhandled cases were discovered that need to be clarified.

      1. Transition from package poline to nonpackage with specifying instanceId. Steps:

      • create poline with values isPackage=true and instanceId=null (no titles were created)
      • update poline with values isPackage=false and instanceId specified (title not exists, so nothing to update. Ignored for now)
        • PUT to orders-storage/po-lines will create the title record but we need to make additional calls to get the title UUID of the title record, and then to update the title record with the instanceId.
      Open questions:
      • Is it planed to add restriction or additional logic for such transitions?
        [CAM] I don't think so, but maybe Dennis Bridges disagrees
      • Will it be enough to implement "create or update" in this case?
        [CAM] Yes, in general, if a title exists update it. If it doesn't exist but should, create one. Remember, one role of the title record is to hold a reference to the instance(s) associated with a poLine. Since we're no longer storing the instanceId as part of poLine directly, We must create a title record if an instance is provided and a title does not already exist, otherwise we lose that information. The instanceId in a title record should be updated if the poLine's instance(s) are updated.

      2. Transition from nonpackage poline with instanceId to package. Steps:

      • create poline with values isPackage=false and instanceId=not null (title created with instanceId)
      • update poline with values isPackage=true and instanceId=null (title still exists for package poline)
      Open questions:
      • it makes sense to delete title which points to package poline. Leaving it as is will affect search results at least.
        [CAM] Yes, it should be deleted

      Take into account that titles are also creating/updating transactionally with associated polines on storage level. https://issues.folio.org/browse/MODORDSTOR-127

      Acceptance Criteria

      • Title records are created/updated/deleted in reaction to updates in PoLine as described above
      • API tests are updated
      • Unit tests are updated

        TestRail: Results

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                Unassigned Unassigned
                Reporter:
                siarhei_hrabko Siarhei Hrabko
                Tester Assignee:
                Dennis Bridges Dennis Bridges
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                  Dates

                  Created:
                  Updated:

                    TestRail: Runs

                      TestRail: Cases