Details
Assignee
UnassignedUnassignedReporter
Siarhei HrabkoSiarhei HrabkoTester Assignee
Dennis BridgesDennis BridgesLabels
Priority
P3Story Points
3Development Team
ThunderjetAffects versions
TestRail: Cases
Open TestRail: CasesTestRail: Runs
Open TestRail: Runs
Details
Details
Assignee
Unassigned
UnassignedReporter
Siarhei Hrabko
Siarhei HrabkoTester Assignee
Dennis Bridges
Dennis BridgesLabels
Priority
Story Points
3
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
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