We're updating the issue view to help you get more done. 

Drop reference to orderable version from FTAP

Description

FacilityTypeApprovedProducts should not point to a specific version of an orderable. They should just reference the orderable by its ID.

From the mailing group:

FTAP should not need to reference an orderable by its version. The reason why it does that in this case is because of how our database schema is set up. FTAPs have a foreign key to the orderable, so when we made a new composite primary key of orderables, including the version id, the foreign key also had to reference the version. If we do drop the reference to orderable by its version, we’ll need to do that by removing the foreign key altogether.

https://forum.openlmis.org/t/versioning-in-facilitytypeapprovedproducts-approach/5145

Acceptance criteria:

  • FTAPs do not reference orderables by their version anymore

  • all FTAP endpoints should work as expected

    • response body should always contain the newest orderable

    • it is impossible to create FTAP with non-existing orderable - a user should get a meaningful message

  • Orderable update remains to work correctly

    • orderable id should not be changed after update

    • orderable version should be incremented

    • update does not affect the related FTAP

  • update demo-data

Status

Assignee

Łukasz Lewczyński

Reporter

Sebastian Brudziński

Labels

Story Points

5

Time tracking

40h

Epic Link

Components

Sprint

None

Fix versions

Priority

Major