Deleting records

Work in progress - Jan 30 2023

Other relevant reads:

 

What is a delete?

Traditionally, deletes fall into two categories: hard and soft. A hard delete is one where the data is gone completely. A soft delete on the other hand, is one where the data is just marked as deleted and no longer shown or used for calculations for the user (read https://lite-farm.atlassian.net/wiki/spaces/LITEFARM/pages/1194819585 for more information).

With limited exceptions, LiteFarm only uses soft deletes.

 

When might users want to delete something?

Users might want to delete something when it’s clear they aren’t correct or valid for some reason. Examples include:

  • Selecting the wrong location for a task and only noticing after completing the task flow.

  • Things created while “test driving” LiteFarm. This could include farms, locations, people, crops, varietals, crop plans, tasks, etc. Basically anything being demo’ed.*

 

For users “test driving” LiteFarm should we handle this in a different way than just having a user go through and try to delete a bunch of stuff? Maybe it’s a help request or something similar?

 

When shouldn’t records be deleted?

When being able to review or analyze the record has value. Examples include:

  • Activities that were planned in good faith, but didn’t happen for some reason. Examples include a task assigned to a person, where the task doesn’t happen because the person is sick or a crop plan that wasn’t seeded because it was too hot, too cold, or some other issues. These situations should be abandoned instead of deleted. These abandoned activities still have value in reflection.

  • Activities that happened but are now completed (should be past, completed, archived, etc.) because they still have value in reflection.

  • Crops that were grown in the past, but aren’t being grown now (and/or potentially won’t be in the future). These crops still have value in reflection both for the farmer and researchers.

  • People that worked on the farm in the past, but aren’t currently employed. These individuals still have value in reflection both for finances and analyzing past tasks.

 

General patterns:

  • Any multi-views will have accordion sections, some flavour of “Active” and “Past”

    • In some places, things will transition from active to past when they are marked completed or abandoned. In other places (documents) they automatically move from one section to another.

    • Tasks that are completed and assigneed can only be deleted by the assignee.

  • Explicit deletes are available in some cases, but have greater restrictions than abandon.

 

Areas where deleting is important:

 

Tasks:

  • Current: Planned or late; I am doing this now or will be in the near future

  • Past: Completed or abandoned; This is done. I want a record of this so I can reconcile my activities and finances.

  • Deleted (not shown): I don’t want a record of this; can’t be deleted if completed with wage associated with it.

  • Archived: Completed or abandoned will automatically be moved to this section.

 

Crop plans:

  • Current*: Planned or active; I am doing this now or will be in the near future.

  • Past: Completed or abandoned; This is done. I want a record of this so I can learn from it in the future.

  • Deleted (not shown): I don’t want a record of this.

  • Archived: Planned, active, completed or abandoned that the user don’t want to see for now.

 

Varietals:

  • Current*: Planned or active; I am doing this now or will be in the near future.

  • Past: Completed or abandoned; This is done. I want a record of this so I can learn from it in the future.

  • Deleted (not shown): I don’t want a record of this.

  • Archived: Planned, active, completed or abandoned that the user don’t want to see for now.

 

Crop_types:

  • On my farm: Planned or active; I am doing this now or will be in the near future

  • Past: Completed or abandoned; This is done. I want a record of this so I can learn from it in the future.

  • Deleted (not shown): I don’t want a record of this

 

Open questions:

  • Should things that are containers for other things automatically transition from active to “archived” based on certain actions (e.g. all tasks being completed)?

    • It depends on what the thing is. For tasks, yes.

    • Varieties that have all tasks/plans completed or abandon?

  • Should we allow deleting tasks that are completed / abandoned with wages attached to them?

    • Maybe just the assignee?

  • Planting tasks can't be deleted, only abandoned, due to all the dependencies.