Cannot update RequisitionGroups

Description

While attempting to update RequisitionGroup that contains any RequisitionGroupProgramSchedules associated with it, the endpoint returns:

and prevents the RequisitionGroup from updating.

  • Add integration test that catches this

Environment

None

QAlity Plus - Test Management

Checklists

Activity

Lucyna Laska 
June 20, 2017 at 1:01 PM

Now it looks okay. Proper error message is thrown: "Requisition group program schedules within a requisition group must have unique programs".

Sebastian Brudziński 
June 13, 2017 at 9:55 AM

It is thrown when updating any RequisitionGroup even without modifications and I believe you are correct that it tries to re-create schedules and runs into some issues believing it already exists.

When adding the validation, remember that there MAY be requisition group program schedules with the same programs - they just cannot be assigned to requisition group in a way that would violate the facility-program-schedule uniqueness. eg. I can have monthly and quarterly schedule for the essential meds program and I can have separate requisitions groups - one following the monthly schedule and another the quarterly schedule which is OK, but one facility cannot belong to the two of them at the same time.

Paweł Gesek 
June 13, 2017 at 9:42 AM

I believe so, is that what you are doing?

Paweł Nawrocki 
June 12, 2017 at 10:10 PM
(edited)

So, the error is being thrown when we want to have two requisition group type schedules with the same program (which has a unique constraint), or when trying to remove and insert a program schedule with the same program at a time. The second one is probably some transaction-scope problem. For the first issue, we should only add validation for that, right?

Sebastian Brudziński 
May 29, 2017 at 4:02 PM

most likely.

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

Details

Assignee

Reporter

Story Points

Original estimate

Time tracking

1d 3h logged

Components

Sprint

Fix versions

Priority

Time Assistant

Created May 29, 2017 at 3:44 PM
Updated June 21, 2017 at 8:37 AM
Resolved June 20, 2017 at 1:01 PM