Nominations Framework

The mission of LiteFarm is to meet farmers where they are and equip them with the tools they need to make informed and responsible decisions about the health of their farm, their livelihood, their community, and the planet. Part of meeting them where they are is to acknowledge that farmers bring a lot of knowledge to the table that we, as the LiteFarm community and LiteFarm affiliated researchers, can learn from. As such, we need to have a general framework that allows for our incredibly diverse user base to suggest new information and patterns that should be incorporated into the application.

The nominations framework is a first step towards building a generalized framework that allows users to not only create or suggest custom structures within LiteFarm (past examples include custom tasks and varietals) for use on their own farm, but to suggest or create those structures for use across the ecosystem. This framework is primarily meant to support the back-end storage of data and workflows around handling that data. User interfaces are likely to be implemented on a case-by-cases basis and review of nominations to happen outside LiteFarm by an expert in that topic (at least in the short term).

The nominations framework provides an extensible structure for users to suggest data points for inclusion into LiteFarm's core database. Nominations could be many things including crop varieties, task types, expense types, tool types etc., though this write-up will focus on crop_types.

These documents will attempt to explain how to implement the nominations framework and provide other relevant information on the concept.

Crop Nominations - EXAMPLE

Nominations need to go through an evaluation workflow in order to be added to our seed database to be offered as templates for other users.

We, the administrators of the LiteFarm ecosystem, go into the production or beta database and add the name of our nomination type (CROP_NOMINATION) and the name of the workflow group (CROP_NOMINATION) into the ‘nomination_type’ table along with Base object attributes :

 

nomination_type

nomination_type

…Base object

nomination_type

…Base object

CROP_NOMINATION

 

Now that we have named the workflow group to CROP_NOMINATION we can enumerate the steps in the ‘nomination_workflow’ table under that group. The following statuses assume that the review happens outside of LiteFarm, but they could easily be expanded or modified in the future to allow that process to happen within LiteFarm or an integrated product such as a BI tool.

 

nomination_workflow

workflow_id

status

type_group

…Base object

workflow_id

status

type_group

…Base object

1

LF_REVIEW

CROP_NOMINATION

2

NOMINATED

CROP_NOMINATION

3

EXPERT_REVIEW

CROP_NOMINATION

4

REJECTED

CROP_NOMINATION

5

APPROVED

CROP_NOMINATION

At this point we would like to create our nomination system to create a new nomination object when a user selects

Nominate this crop for inclusion Litefarm’s catalogue

in the “Add New Crop” flow (see https://lite-farm.atlassian.net/browse/LF-2889). On creation of the new crop a new nomination object will be created in the ‘nomination’ table:

 

nomination

nomination_id

farm_id

nomination_type

…Base object

nomination_id

farm_id

nomination_type

…Base object

1

MyFarm-xyz-saty

CROP_NOMINATION

This will also result in a status update in the ‘nomination_status’ table. With references to the other tables.

 

nomination_status

status_id

nomination_id

workflow_id

notes

…Base object

status_id

nomination_id

workflow_id

notes

…Base object

1

1

2

-

 

Once created the nomination row will be returned for insertion on the nomination_id into the crop table.

 

crop

nomination_id

…other Crop table columns

nomination_id

…other Crop table columns

1

 

 

At some point in the future the assignee column (from Base object attributes) could be used to create a task for a reviewer inside LiteFarm to review and either reject or approve the nomination to the general LiteFarm dataset. An example of what this might look like is shown below:

 

task

task_id

assignee

task_type

..other Task table columns

task_id

assignee

task_type

..other Task table columns

45776

EXPERT-2345-ty

CROP_NOMINATION_EXPERT_REVIEW

 

 

Deleting a nomination

Currently we do not have a read-only view of crops. So there is no way for the user to delete a nomination.

Should we implement the read-only view the expected behaviour would be:

  • changing the ‘deleted’ in nomination to true

  • changing the ‘nomination_id’ to NULL in the crop table.

  • these two things combined would mean that there is no way to see what object was nominated even though it is soft deleted (see Not yet implemented - immutable nominations)

  • if the object was re-nominated it would be assigned a new id

Question to ask yourself:

Do you want to save the nomination object as it is now? Should the nomination object be immutable (from the perspective of the creator) once submitted or should they be able to amend it mid-review?

 

What is the workflow that a nomination should go through for your nomination type?

 

Not yet implemented

Immutable nominations

  • If we want the record a copy of the state this could be added as a json column in the nominations table. That way if the nomination is deleted it is recoverable.

 

Administrative Views

  • Litefarm - Being able to move the status of the nomination from admin account

  • Agronomist - Nominations In Your Area, Being able to move the status of the nomination

 

User View

  • My Nominations and their status'