Handle poline transition from package to non package and vice versa

CSP Request Details

None

CSP Rejection Details

None

CSP Approved

None

Description

Overview

Based on the bug https://folio-org.atlassian.net/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 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://folio-org.atlassian.net/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

Environment

None

Potential Workaround

None

Checklist

hide

TestRail: Results

Activity

Show:

Dennis Bridges April 28, 2020 at 8:05 PM

I would like to discuss this solution in more detail. Title records appearing in receiving before an Order is in 'Open' status is also problematic. Currently titles appear as soon as POL is created, but we may need a story for hiding them from the receiving UI until the order is Open.

Details

Assignee

Reporter

Tester Assignee

Priority

Story Points

Development Team

Thunderjet

Affects versions

TestRail: Cases

Open TestRail: Cases

TestRail: Runs

Open TestRail: Runs

Created March 31, 2020 at 9:19 AM
Updated December 9, 2021 at 8:57 PM
TestRail: Cases
TestRail: Runs