As Adam the Admin, I need to check and correct association of an orderable with a facility type and a program so that users can request the correct orderables/products.
This workflow allows for the auditing and editing of the Facility Type Approved Products. Unlike OpenLMIS v1/v2 where there was a large screen to allow overview of an entire list — we are going to build a focused experience to see and edit single FTAP entries.
"Facility Type Associations" tab added to "Orderable Details" state
Facility Type Associations view has a table where:
Rows are facility types
Columns are programs that are "active" for the current orderable
Each table cell has a button that represents the FTAP for the current orderable, facility type, and program configuration
If the FTAP is "active" the button reads "Active"
If the FTAP is non-existant or in-active the button reads "Configure"
When the FTAP button is clicked, it opens the FTAP modal
Has the following form fields
Emergency Order Point (Positive Number--need to clarify if this is in Dispensing Units, maybe with indicator or label text on field)
Max Periods of Stock (Positive Number--this is allowed to be a decimal, EG "2.50")
Min Periods of Stock (Positive Number--this is allowed to be a decimal, EG "0.50")
When "update" is clicked, a HTTP request will be made to the server
If active checkbox is checked, the FTAP will be created or updated
If the active checkbox isn't checked, the FTAP will be deleted
When "update" is clicked and the FTAP is not active, a confirmation modal will be shown that says "Inactive configurations will not be saved (TBD wording)"
Developers, please add and address test cases/edge cases:
When admin adds or removes an orderable from FTAP list, that changes future Requisitions but does not change already-initiated or historical Requisitions.
When admin removes an orderable from FTAP, if there is already a stock card for it in Stock Management, users are still allowed to record stock movements (issues, receipts, etc) for that product. Related to OLMIS-4080. But users cannot create a new stock card for items not on the FTAP list.
If Requisition service tries to send Stock data to Stock Management about a product no longer on the FTAP list, Stock Service would allow it. If there is already a stock card for that orderable, it records data there. If there is NOT already a stock card, Stock Management would allow a new stock card to be created for any product that used to be on any past version of the FTAP list. EG, that helps if a requisition already initiated includes that product and needs to record data about it. If the product was NEVER on the FTAP list, Stock Management gives a meaningful error message EG, "Cannot create a new stock card for Product X that has never been on the Facility Type Approved Product list for Facility Y and Program Z." Stock Management would not allow it if there is no existing stock card; that should generate a meaningful message to users. EG "No stock card exists for Product X, and Stock Management cannot create new stock cards for products that are not on the Facility Type Approved Product list."
For products removed from FTAP list, users can still navigate to old Requisitions and will see that product and its data.
For products removed from FTAP list, users can still navigate to old Stock Cards and will see that product and its data.