Description
Summary
Provide the ability to deactivate (and restore) vendors
Why?
Some of our banks have been using the system for over 5 years. Over time, vendors go out of business, and it would be nice to be able to hide the defunct ones. Reduce new bank staff error.
Details
We already provide deactivation/reactivation for many of our models. See Item as a model.
Provide the ability, for bank admin access only, to deactivate vendors.
This will be on the Community | Vendors page
If the vendor has no purchases associated with it (for discussion: edge case - someone enters a purchase with the vendor, then deletes it. Would that be a problem) and never has, allow to have the vendor deleted instead.
When a user selects deactivation or deletion, they must confirm their choice.
When vendor is deactivated, it doesn't appear in the vendor drop-down in new/edit purchase.
Add a "include inactive" filter for vendors. There is currently no filter on the vendors page, so you'll need to build that in, following the pattern on Items.
if a vendor is inactive, provide a "restore" button beside it in the vendor index. Pushing this invokes a confirmation window, then on user assent, sets the status of the vendor back to active.
You'll need a migration too, the default setting for the active flag will be true.
Priority
Per stakeholders, not high priority, but would be nice for keeping things tidy
Criteria for completion
- Behaviour as described above
- tests to support above behavioiur