medic / cht-core

The CHT Core Framework makes it faster to build responsive, offline-first digital health apps that equip health workers to provide better care in their communities. It is a central resource of the Community Health Toolkit.
https://communityhealthtoolkit.org
GNU Affero General Public License v3.0
438 stars 208 forks source link

Allow deep delete of places that are used for training or testing purpose. #7743

Open 1yuv opened 2 years ago

1yuv commented 2 years ago

Is your feature request related to a problem? Please describe. Some of our instances have test places that are created for training purpose and while we exclude these from sql queries in analytics, we also like to delete this from webapp. In some of our cases, we have many contacts and reports under these training places. If we need to delete all these things, we need to find each and every records from Fauxton with multiple queries and delete them.

Describe the solution you'd like Allow a bulk delete or deep delete option in CHT such that these training palces can be deleted in one go and we don't need to worry about orphan records or places.

Describe alternatives you've considered Preparing mango query and deleting records.

garethbowen commented 2 years ago

There are other downsides with creation and deletion of temporary places, for example, this has an unnecessary performance hit for other users, and there is a risk of deleting too much or the wrong thing and destroying production data.

The best practice is to have a second instance for training purposes. This can also be useful for training users on the next version of the app before it gets rolled out to everyone. Some downsides for this approach are having to install two apps, and having to remember to remove the training app.

Can you think of a way that the "best practice" option above could be improved to make it preferable to training on production?

binokaryg commented 2 years ago

One reason for using the production instance for trainings is the gateway phone number (for SMS deployments). It is easier for the users to remember/save a single gateway number. The gateway number is printed in the training materials.

We can do training of trainers (ToT) on a test instance to reduce the training data, but for the end-user training, it can be difficult. The end-user trainings are usually run by the external trainers. The training can take place in one place while live reporting has already started in another place.

garethbowen commented 6 months ago

More discussion on slack (private)