Task management system incorporating tasks, completed tasks, and notifications

The idea of tasks and completed tasks will subsume the idea of logs and shifts in the Q3 2021 release. Logs will become tasks and shifts will become completed Tasks. Notifications will tie together the assignment of tasks and the transition from tasks to completed tasks to create a holistic “task management system”.

What is a task?

Tasks are a generic piece of work that needs to be completed. This “container” allows the creator to document attributes common to all tasks (such as the individual doing the task and whether it’s completed) as well as attributes required for the specific task type (such as harvest use for a harvest task). This is the core functionality farmers are looking for in their farm management system.

What type of tasks are there?

Please see https://lite-farm.atlassian.net/wiki/spaces/LITEFARM/pages/1098383404 for a complete and current list of tasks.

What actions can be taken with tasks?

Users can perform 4 actions with tasks:

  1. Create a task

  2. (may be completed in creation) Assign a task

  3. Edit a task

  4. Mark a task as completed

  5. Abandon a task

 

By starting from a generic flow and asking only the specific information needed for the type of task (see image below) and whether the user is seeking certification (see https://lite-farm.atlassian.net/wiki/spaces/LITEFARM/pages/744521729), we can re-create all of the functionality currently captured in logs and shifts in a single object.

How does a user create a task?

Choosing your task type is the first step in creating a task. The flow goes something like this:

  1. What type of task needs to be done (e.g. seeding, scouting, etc.)?

  2. When does the task need to happen?

  3. Where will the task take place?

  4. Does the task impact a crop?

  5. What task-type specific instructions would you like to provide (e.g. which fertilizer to use for a fertilizing task, or seed spacing and depth for a planting task, etc.)?

  6. (Optional) Who is going to do the task?

 

With the exception of step 5, this flow will be the same for all types of tasks. For a visual explanation of this you can view this flow.

 

Additionally, in some cases the system will automatically create a task. Below is an example of the “manual” and “automatic” routes to task creation.

Task

User or system created

How was the task initiated?

Additional notes

Task

User or system created

How was the task initiated?

Additional notes

“Maintenance” task

User

Farm Owner, upon seeing a section of damaged fence, creates a task describing the maintenance task and manually assigns it to a farm worker.

 

“Planting” task

System

Farm manager creates a crop management plan for a varietal and indicates it needs to be planted from seed.

The system generates a “planting” task based on the planting date supplied by the user. The system automatically populates the task with necessary crop specific information such as planting method, seed spacing, seeding depth, and others.

How does a user edit a task?

Tasks use the same edit pattern as other objects such as varietals and crop management plans.

How does a user assign a task?

Tasks can be assigned as part of the task creation flow. For tasks where the user chooses not to assign during creation or for tasks that are automatically generated there is a short-hand modal that the creator or a farm owner, farm manager, or extension officers can use to assign a user at the farm (see LF-1665 for details).

How does a user mark a task as completed or abandoned?

As the assignee or creator (or a farm owner, farm manager, or extension officer), users can “Mark completed” or “Abandon” a task. In marking a task complete, they’ll be prompted to provide the following attributes:

  • Duration of task

  • Satisfaction with the task

  • Completion notes

  • Potentially other task specific inputs

When abandoning a task, the user will be prompted to provide the following:

  • Reason for abandoning the task

  • Details

 

What is a completed task?

Completed tasks are tasks that have been marked as “Completed” or “Abandoned” (more on abandoned below). Completed tasks are roughly equivalent to present day “Shifts” in that they capture a task that took place and details about how it happened (e.g. who did it, how long it took, etc.). Completed tasks come into existence in two ways:

  1. Under none or basic labour tracking (see for https://lite-farm.atlassian.net/wiki/spaces/LITEFARM/pages/166264833 details), the assignee of a task marks it as done. Under advanced labour tracking, a Farm Owner or Manager marks a task as done after a Farm Worker has marked it as “For review”

  2. After completing some work that wasn’t documented in advanced. For example, a user can create a completed task in order to document work they weren’t assigned in advance (e.g. “Fixed fence because I saw a hole - took 20 minutes”)

Completed tasks tie together activities that have happened, who did them, what they used to do them, and what the outcome was. This concept is essential many of the core concepts and value-adds that LiteFarm presents to farmers. These include:

  • Being able to understand all the revenues and expenses at your farm to understand profit overall

  • Being able to understand profit on a per crop basis

  • “Seed-to-sale” traceability of would-be organic produce

 

Abandoned Tasks

New in Q3 2021 is the ability to mark a task as abandoned. There was no equivalent to this in prior releases. An abandoned task is one that was either cancelled before it was going to begin, or couldn’t be carried out as expected. When abandoning a task, the creator, assignee, or a farm owner, farm manager, or extension officer at the farm must supply a reason and may optionally add details to support that reason.

For most purposes, “Abandoned” and “Completed” tasks are treated the same.

 

Task attributes

This table is starter list of generic attributes every task will have. It is NOT a complete list. In fact, each will likely have their own type-specific attributes.

Attribute

Data type

Entered / modified at…

Required?

Example data

Notes

Attribute

Data type

Entered / modified at…

Required?

Example data

Notes

Type

Enum

Creation

Yes

Planting

See above. Also needs to support custom task types

Status

Enum

Creation, daemon, completion, abandonment

Yes

Planned, Late, For review, Completed, Abandoned

Assigned via actions rather than being editable via the UI

Owner

Ref: User_id

Creation

Yes

Jane Smith

Assigned at creation time

Assignee

Ref: User_id

Creation, edit

No

Joe Smith

 

Due date

Date

Creation, edit

Yes

January 5 2022

 

Location

List<Locations>

Creation, edit

Yes*

Field 4

Either location or coordinates are required

Coordinates

Ref: Coord_id

 

Yes*

-13.473321, 18.573862

Either location or coordinates are required

Crops

List<crop_management_plans>

Creation, edit

No

Peas, Carrots, and Strawberries

 

Task notes

Text

Creation, edit

No

“Don’t forget to bring the broccoli harvesting knife from the greenhouse.”

 

Duration

 

Completion

Yes

1 hour 15 minutes

Displayed in 15 minute intervals

Happiness rating

Integer

Completion

Yes

3

Likert scale: 1 - 5; also needs to have a value for “Prefer not to say”. A response is required, but “Prefer not to say” is acceptable.

Completion notes

Text

Completion

No

“Based on last years harvest, I’d expect about 55kg”

Entered by the creator when creating the task

Reason for abandonment

List<String>

Abandonment

Yes

 

 

Task abandonment notes

Text

Abandonment

No

“Lots of half-eaten strawberries due to what I’d guess are rabbits. Harvest is probably closer to 40kg rather than the expected 55.”

Entered by the assignee when marking a task as complete or abandoned

Notifications

Notifications will not be part of the Q3 2021 release.

Notifications serve as the communication layer for ensuring things get done on a farm. Notifications are system generated messages that are sent to users to bring something to a users' attention and to request updates that can be shared with the rest of the farm staff. Regarding Tasks and completed tasks, notifications serve a few important functions:

Use case

Example

Who is Notified?

Notes

Use case

Example

Who is Notified?

Notes

Upcoming unassigned task (under Basic or Advanced ))

A system generated seeding task should take place this week (based on the date of the task)

The user that initially assigned the crop to that field (the task creator)

A notification asking the original creator of the task to assign the unassigned task to a user or modify when it should take place.

Upcoming unassigned task (under None )

A system generated seeding task should take place this week (based on the date of the task)

The user that initially assigned the crop to that field (the task owner)

A notification reminding the original creator of the task to do the task or modify when it should take place.

Upcoming assigned task

A user created “Repair” task should take place today.

The user whom the task is assigned to (the assignee)

The notification serves as a reminder to perform the task and also a quick way to mark the task as “Finished”.

Task marked as complete under Basic

A farm manager has assigned a repair task to a farm worker. Once the farm worker marks the task as Done, the farm manager receives a notification informing them the task has been completed.

The owner of the task.

The notification serves as an opportunity for the owner of the task to verify the task has been completed by the assignee to the correct standard of work.

Task marked as complete under Advanced

A farm manager has assigned a repair task to a farm worker. Once the farm worker marks the task as Done, the task enters “For review” status and the farm manager receives a notification asking them to review the work and accept it or not.

The owner of the task.

The notification serves as an opportunity for the owner of the task to verify the task has been completed by the assignee to the correct standard of work.

You can read more about notifications in general here:

 

Migration process. From logs and shifts to tasks

The migration needs to encompass both the shift tasks and the logs that were created by farmers pre release (AUG 2021 Release).

 

For logs:

Since the logs table hierarchy meets most of what’s needed both for the individual tasks (fertilizer, irrigation, etc) and for the relationship between locations and management plans it makes a lot of sense to just build on top of what’s there for logs already. renaming the activityLogs table to “task” and all of the child tables of activityLog to it’s “_task” counterparts. After doing that and creating relationships for the missing tasks (transport, wash and pack, maintenance, sale, social) we end up with this diagram for the task table and all of it’s childs


 

There are some leftover properties that might be dropped after this which were significant for logs only, as :

  • action_needed

  • photo

  • activity_kind

Also, the shift and shiftTask relationships become irrelevant after this and should be dropped. Their relationships to finances and insights need to be moved to tasks now.

 

For shifts:

Shifts are a collection of tasks that were (or are going to be) performed in a given day by a given person (assignee). The shifts have a 1→n relationship with the shiftTask table, for every shiftTask row associated with a shift, there is a task with an associated location or management plan. The attributes which are to be migrated from shift and shiftTasks are :


shift attribute

transformation

task attribute to map to

shift attribute

transformation

task attribute to map to

mood

from string to integer in Likert scale in which 1 represents very sad and 5 represents very happy. 0 would be a null answer.
”very happy” → 5

….

“very sad” → 1

“no answer” → 0

happiness

created_by_user_id

 

owner

user_id

 

assignee

task_id

if task_id = 1 (bed preparation before migration)
change to 9 (Field work)

type

shift_date

 

due_date

 

duration

 

duration

wage_at_moment

 

wage_at_moment

farm_id

 

NO MAP

a farm_id reference is not needed, since a task will always have a relationship either with at least 1 location

 

 

 

For each shiftTask we will also create a row in the task child table that matches the task type, as well as a row for the location OR management plans. Example :

If I had a bed preparation shiftTask in location X (not management plan) the migration will create :

  • 1 row in the task table, with the migrated attributes

  • 1 row in the task_location table with the location X id as well as the recently created task id

  • 1 row in the field_work_task table (as bed preparation is a field work task)

 

It’s important to note, that shiftTasks where being created on a per location or management plan basis, this means if I had a shift that was doing a 60 minutes bed preparation on 3 separate locations, that created 3 separate shiftTasks of 20 minutes each for each location.