Plantings: establishment method (direct sow / transplant / bought plants)#94
Merged
Conversation
…nts)
Qrop models three ways to start a crop; Pomone only did "from sowing", which
generated wrong tasks (e.g. Repiquage on a bought tree). Add the method as a
per-planting choice that drives the inferred dates and the auto-tasks.
- App: `EstablishmentMethod { DirectSow, RaisedTransplant, BoughtPlants }` +
unified `create_annual_planting(method, date, …)`. The method is encoded by
which Cycle dates are set (no new column): direct = sown only; raised =
sown+transplant (via DTT); bought = transplant date only, no sow. Reuses the
existing `infer_cycle_from_sowing` / `infer_cycle_from_transplant`.
`create_annual_planting_from_sowing` kept as a thin Raised wrapper.
- Task auto-gen: a richer `Trigger` distinguishes Repiquage (raised) from
Plantation (bought / perennial). Perennials now get a "Plantation" task at
establishment (supersedes the no-task behaviour of #93).
- Seed: a "Plantation" task type (Transplant category, no migration — SQLite
CHECK can't gain a value without an unsafe rebuild). Additive backfill in
`seed_defaults` for already-seeded DBs. Auto-gen picks it by name with a
fallback.
- UI: an "Établissement method" selector on the annual planting form; the date
field is a sowing date (direct/raised) or a planting date (bought). i18n
fr/en for the method labels.
Tests: phase_dates (sow/transplant/plant/harvest cases), services (direct →
Sow+Harvest, bought → Plantation+Harvest, perennial → Plantation), seed count.
Workspace green (cargo test/clippy/fmt). Verified on seed-demo: the apple gets
a Plantation task.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pre-prod feedback: Pomone only created annual plantings "from sowing", generating wrong tasks (e.g. a Repiquage on a bought apple tree — partially patched in #93). Model the three Qrop-style establishment methods, chosen per planting.
Approach
Cycledates are set, and the auto-generator reads it back. Reuses the existinginfer_cycle_from_sowing/infer_cycle_from_transplant.EstablishmentMethod+ unifiedcreate_annual_planting(method, date, …);create_annual_planting_from_sowingkept as a Raised wrapper.Triggerdistinguishes Repiquage (raised) vs Plantation (bought/perennial). Perennials now get a Plantation task (supersedes Tasks: no auto Repiquage at perennial establishment #93's no-task).categoryCHECK can't gain a value without an unsafe rebuild of the referencedtask_typetable).seed_defaultsbackfills it on already-seeded DBs; auto-gen picks it by name with a fallback.Verification
cargo test --workspace(158),cargo clippy --workspace --all-targets,cargo fmt --check— green.pomone-cli seed-demo: the apple now gets a Plantation task (no Repiquage).🤖 Generated with Claude Code