Revise relation annotations between models

Description

As per discussion in FEOLMIS-85 , there is a need to further revise relation annotations.
The task is to look for model relations and add/modify cascade parameters where those could be useful.
For example, persisting order lines along with order could be useful.
Also, keep in mind our recent issue caused by overused CascadeType.PERSIST (https://openlmis.atlassian.net/browse/OLMIS-845)

Acceptance criteria

  • Investigate adding more cascade types to model relations, focus on Persist and Remove.

  • Remove excessive cascade types from model relations.

  • If necessary, adjust tests to work properly with the new changes.

QAlity Plus - Test Management

Checklists

Activity

Show:

Paweł Nawrocki September 20, 2016 at 12:05 PM

Just linking the commit we talked about during the last showcase: https://github.com/OpenLMIS/openlmis-requisition/commit/e8486c387accb00f868cc17f11b8bd696bcffb02

Paulina Borowa September 8, 2016 at 11:16 AM

All works.
Test steps:
1. Create everything what is needed for an Order except OrderLines.
2. Create an Order together with OrderLines.
3. Check if the Order and its OrderLines exist.
4. Remove the Order. Check if the OrderLines were also removed.
5. Create everything what is needed for a ProofOfDelivery except ProofOfDeliveryLines.
6. Create a ProofOfDelivery together with ProofOfDeliveryLines.
7. Check if the ProofOfDelivery and its ProofOfDeliveryLines exist.
8. Remove the ProofOfDelivery. Check if the ProofOfDeliveryLines were also removed.
9. Create everything what is needed for a Requisition except RequisitionLines.
10. Create a Requisition together with RequisitionLines.
11. Check if the Requisition and its RequisitionLines exist.
12. Remove the Requisition. Check if the RequisitionLines were also removed.
More details in test case: https://openlmis.atlassian.net/wiki/x/QYDRB

Paweł Nawrocki September 6, 2016 at 3:59 PM

The ticket should be able to re-test it.

Piotr Szafrański August 12, 2016 at 12:18 PM


Now we should be able to create and delete a parent object along with their children (e.g. Order with OrderLines) in a one POST request for the creation/removal of the parent object.

Test process:
1. Create everything what is needed for an Order except OrderLines. Create an Order together with OrderLines. Check if the Order and its OrderLines exist. Remove the Order. Check if the OrderLines were also removed.
2. Create everything what is needed for a ProofOfDelivery except ProofOfDeliveryLines. Create a ProofOfDelivery together with ProofOfDeliveryLines. Check if the ProofOfDelivery and its ProofOfDeliveryLines exist. Remove the ProofOfDelivery. Check if the ProofOfDeliveryLines were also removed.
3. Create everything what is needed for a Requisition except RequisitionLines. Create a Requisition together with RequisitionLines. Check if the Requisition and its RequisitionLines exist. Remove the Requisition. Check if the RequisitionLines were also removed.

Anna Czyrko August 12, 2016 at 5:48 AM

Please update Acceptance criteria in Description part.

Done
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Story Points

Original estimate

Time tracking

2w 4d 4h logged

Sprint

Fix versions

Affects versions

Priority

Time Assistant

Created July 25, 2016 at 8:44 AM
Updated November 12, 2016 at 11:32 AM
Resolved September 8, 2016 at 11:16 AM