Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement harvest and terminate logic for crops with no. one or multiple harvests #66

Open
SvenVw opened this issue Jan 30, 2025 · 1 comment · May be fixed by #71
Open

Implement harvest and terminate logic for crops with no. one or multiple harvests #66

SvenVw opened this issue Jan 30, 2025 · 1 comment · May be fixed by #71
Assignees

Comments

@SvenVw
Copy link
Owner

SvenVw commented Jan 30, 2025

Description:

The current distinction between b_terminating_date and b_harvesting_date provides flexibility for crops with diverse harvesting practices. However, this approach deviates from standard data models and can be confusing for users. This issue proposes changes to fdm-data and fdm-core to simplify data entry and ensure data consistency across different crop types.

Proposed Changes:

fdm-data Enhancements:

  • Crop Harvestability: Introduce a new property for each crop in fdm-data indicating whether it's harvestable (e.g., a boolean harvestable property). This allows distinguishing between productive crops and non-productive elements like "Landschapselementen."
  • Harvest Frequency: For harvestable crops, specify the expected harvest frequency:
    • "once": Crops harvested only once (e.g., potatoes).
    • "multiple": Crops harvested multiple times (e.g., grass, fruit trees).
    • This could be implemented as an enum or a string property called harvestFrequency.

fdm-core Logic:

  • Non-Productive Crops: For non-harvestable crops (i.e. harvestable: false):
    • Prevent storing harvest dates (b_harvesting_date should not be allowed).
    • Allow storing termination dates (b_terminating_date).
  • Single Harvest Crops: For crops with harvestFrequency: "once":
    • Enforce that the harvest date (b_harvesting_date) and termination date (b_terminating_date) are identical.
    • When the user sets either the harvest or termination date, automatically update the other.
    • Prevent recording multiple harvests for the same cultivation.
  • Multiple Harvest Crops: For crops with harvestFrequency: "multiple":
    • Validate that all harvest dates (b_harvesting_date) fall between the sowing date and the termination date.
    • Do not automatically synchronize the harvest and termination dates.
@gerardhros
Copy link
Collaborator

correct. both can be merged by adding option "none" or "non applicable"to harvest frequency, isn't?
combination gives more flexibility i agree.

@SvenVw SvenVw self-assigned this Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants