[API] Configure valid destinations for ad hoc issues

Description

As an implementer of OpenLMIS I want to be able to configure the list of valid destinations for performing an ad hoc issue for each program and each Facility type, so that I can track where my users are issuing there stock to on an ad hoc basis

Acceptance Criteria:
1.Given I am a admin, when I get a list of all destinations and pick one from the list, assign that existing destination to program & facility type, then I should see it in the valid destinations list.
2.Given I am a admin, when I assign the same destination for a second time, then I should not see it twice in the valid destination list.
3.Given I am a admin, when I create a new destination, then I should see this newly created destination in the all destinations list.(I need not to input facility id if I want to add a non-facility destination)
4.Given I am a admin, when I create a destination that has content identical to an existing destination, then I should not see 2 destinations looks the same in the all destinations list.
5.Given I am a admin, when I update an existing destination, I should see changed content in all destinations list.
6.Given I am a admin, when I update the newly created destination, then I should see changed content in all destinations list.
7.Given I am a admin, when I assign the newly created destination to program & facility type, then I should see it in the valid destinations list.
8.Given I am a admin, when I detach a destination from a valid list of some program & facility type, then I should not see it anymore in the destination list.
9.Given I am a admin, when I doing assignment, if destination id does not exist in DB, then I will get error message from the system.
10.Given I am a admin, when I update a destination that has content identical to an existing destination, then I should not see 2 destinations looks the same in the all destinations list.
11.Given I am a non admin, I should not be able to assign anything.
12.Given I am a non admin, I should not be able to see the whole destination list.
13.Given I am a non admin, I should not be able to create any new destination.
14.Given I am a non admin, I should not be able to delete anything from any valid destination list.

1.For each program and Facility type combination, implementer/admin can select from the following fields:
*Facilities in “catchment area” – i.e. all facilities lower in the hierarchy belonging to the respective facility’s geography
Need to discuss UI for OLMIS-635 if this option is selected. i.e. would user first select “facility in geography” and then we display a list of those facilities to select from? Or will all facilities show up in the dropdown?
Note that this will likely also be how we do issues to dispensing units/wards within the Facility.
*Other Facility in same geography: system will display a list of facilities in the geography
Same comment on UI for OLMIS-635
*Other facility outside the Facility’s geography: system will display a list of all facilities in the country
Need to discuss UI for story OLMIS-635 if this option is selected. i.e. would user first select “other facility” andthen we display a list of all facilities (with geographies/hierarchy) to select from? Or will all facilities show up in the dropdown?
*Community health worker
*Private sector health facility
*Other: by selecting this, implementer/admin would allow user to specify an other (free text) source of ad hoc receipt

-2.Implementer/admin can edit the name of the field (defaults to be as above) for each program and Facility type --combination-

3.Implementer/admin can add more destinations for each program and Facility type combination

4.Initially, this configuration can be made via SQL update. Eventually, this option should be configurable via upload script or UI.
*If via UI, eventually an option to copy sources from one program-Facility type combination to another would begreat
*Eventually, this should not just be a create operation but allow edit/update as well

Note:

  • Ad hoc issue destinations can vary from program to program and Facility type to Facility type – which is included in the story details above. However this is a lower priority – i.e. it can be pushed to a future release with us starting with the same set of destinations configured across programs and Facility types.

  • UI preference for this to be on the same page as

Assignee

Yi Deng

Reporter

Jake Watson

Story Points

1

Epic Link

Sprint

None

Fix versions

Affects versions

Priority

Minor
Configure