[API] Configure valid sources for ad hoc receipts

Description

As an implementer, I want to be able to configure the list of valid sources for receiving an ad hoc receipt for each program and Facility type, so that I can track where my users are receiving their stock from on an ad hoc basis.

Scope in:
Validate facility (whether it is an active facility);
Hierarchy check for facilities;

Scope out:
Create new facilities;

Acceptance Criteria
1.Given I am a admin, when I get a list of all sources and pick one from the list, assign that existing source to program & facility type, then I should see it in the valid sources list.
2.Given I am a admin, when I assign the same source for a second time, then I should not see it twice in the valid source list.
3.Given I am a admin, when I create a new source, then I should see this newly created source in the all sources list.(I need not to input facility id if I want to add a non-facility source)
4.Given I am a admin, when I create a source that has content identical to an existing source, then I should not see 2 sources looks the same in the all sources list.
5.Given I am a admin, when I update an existing source, I should see changed content in all sources list.
6.Given I am a admin, when I update the newly created source, then I should see changed content in all sources list.
7.Given I am a admin, when I assign the newly created source to program & facility type, then I should see it in the valid sources list.
8.Given I am a admin, when I detach a source from a valid list of some program & facility type, then I should not see it anymore in the source list.
9.Given I am a admin, when I doing assignment, if source 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 source that has content identical to an existing source, then I should not see 2 sources looks the same in the all sources 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 source list.
13.Given I am a non admin, I should not be able to create any new source.
14.Given I am a non admin, I should not be able to delete anything from any valid source list.

1.For each program and Facility type combination, implementer/admin can select from the following fields:
*Active Facility higher in the hierarchy
*Other Facility in same district/intermediate geography: system will display a list of facilities in the geography
Need to discuss UI for OLMIS-634 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?
*Facilities lower in the hierarchy (to facilitate returns/recalls of products)
*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-634 if this option is selected. i.e. would user first select “other facility” and then we display a list of all facilities (with geographies/hierarchy) to select from? Or will all facilities show up in the dropdown?
*NGO: If selected, provide a free text field for user to enter NGO name
*Donor: If selected, provide a free text field for user to enter Donor name
*Other: by selecting this, implementer/admin would allow user to specify an other (free text) source of ad hocreceipt

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 sources for each program and Facility type combination (e.g. specific NGO or donor names)

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 be great
*Eventually, this should not just be a create operation but allow edit/update as well

Note:

  • Ad hoc receipt sources 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 sources configured across programs and Facility types.

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

Assignee

Hongwei Peng

Reporter

Mary Jo Kochendorfer

Story Points

1

Epic Link

Sprint

None

Fix versions

Affects versions

Priority

Minor
Configure