mstenta / farm_crop_plan

Crop plan type and related features for farmOS. (ALPHA 3.x IN DEVELOPMENT)
https://drupal.org/project/farm_crop_plan
GNU General Public License v2.0
5 stars 1 forks source link

Crop Plan Successions #4

Open paul121 opened 4 years ago

paul121 commented 4 years ago

Draft of ideas for crop plan successions

In general, a succession would be a way to manage plantings that are all of the same crop and follow a similar "timeline" (same days to transplant, days to harvest, etc.) This would make it easier to create plantings every X days, following the structure of the crop plan. This group of plantings could then be managed as one unit, separate of other plantings in a single crop plan, while still allowing access to manage individual plantings.

Data Structure

  1. Would it make sense to make a succession entity (maybe an asset?) ? Thinking about linking crops, areas, etc... seems like it might be easier to do this by creating an entity, and allow for more options in the future?

OR

  1. Succession (farm_crop_plan_succession table):
    • Plan ID (associated with 1 plan)
    • Succession Name
    • Crop(s)
    • Areas (?)

Rough user flows + form design

mstenta commented 3 years ago

Great ideas @paul121 !

One thought I've had is: "successions can be managed as a unit... until they can't". Meaning: at the beginning of the season you aim to have a really consistent and standardized set of successions, but reality inevitably messes it all up during the season.

So perhaps the ideal solution would be to allow you to "create a succession", which is essentially just a set of linked plantings, but also provide an option to split individual plantings out of the succession to be managed independently moving forward.

Although, to be honest, I have a feeling that will be more the rule than the exception, so maybe it doesn't even make sense to keep them linked after creation. eg: maybe the "succession form" is JUST a tool for creating individual plantings, but doesn't link them together after that. Just thinking: how often will plantings need to be "unlinked" from the succession. I have a feeling pretty often. So are we making it MORE work by forcing users to go through the additional step of "unlinking"? Or does keeping them linked provide enough value to outweigh that? This might be something we want to get more community feedback on before making any big decisions.

Assuming we do keep them linked, I think your second proposed database architecture makes sense (not entities). Summarized/simplified here (only including MVP data, I think):

{farm_crop_plan_succession}

{farm_crop_plan_succession_planting}

The first table defines each succession as a unique record, and the second table serves to link successions to plantings in the plan.

So then, "unlinking" would simply delete the record from {farm_crop_plan_succession_planting}, and the UI would then know to simply display the planting independently.