There is a need to support Orderable versioning in Requisition Line Item (RLI) class. We need to remove and add several fields to stop using snapshotted (copied) values and retrieve the values by fetching the referenced (versioned) entity.
Adding Orderable version to RLI - to reference an Orderable in RLI to handle multiple version. Orderable id has been already added.
Removing packsToShip, pricePerPack, totalCost and nonFullSupply (Reference Data based values) from RLI entity - the fields are currently snapshotted (fetched from Orderable and calculated). The values should be retrieved via Orderable reference.
Orderable Id and version should be encapsulated in one class eg. EntityReference.
There should be a migration committed for the existing RequisitionLineItems. The simplest approach is to drop the mentioned fields and obtain the values by referencing the latest available Orderable version.
Replace fields in report generation (RequisitionLines.jrxml) to use proper methods instead of deleted fields - eg. replace pricePerPack with calculatePricePerPack()
Fix v1 endpoint handling to use calculated fields
This issue has been created basing on design discussion
Before commiting the changes, should we assume that current orderable always represents snapshotted values
How should we migrate already snapshotted value when orderable has been changed?
always use the latest orderable
Is there a possibility that different orderables may have different fields? (eg. later someone will decide to delete one field)? If so, how should we deal with this situation?