Due to foreign key constraints, we're currently unable to remove a POLine if piece records exist which link to that POLine without manual intervention.
In order to resolve this we need to remove piece records associated to poLines being removed.
Implemented in a database transaction until DELETE CASCADE functionality has been added to RMB.
- piece records are removed as described above.
- Unit tests are updated
- API tests are updated