Skip to content

Tasks: no auto Repiquage at perennial establishment#93

Merged
guycorbaz merged 1 commit into
mainfrom
fix/no-transplant-task-for-perennials
Jun 9, 2026
Merged

Tasks: no auto Repiquage at perennial establishment#93
guycorbaz merged 1 commit into
mainfrom
fix/no-transplant-task-for-perennials

Conversation

@guycorbaz

Copy link
Copy Markdown
Owner

Pre-prod feedback: creating a perennial planting (apple, plum…) auto-generated a Repiquage (Transplant) task at its establishment date. Perennials are planted from bought stock — nothing to transplant — so the task is spurious.

Change

phase_dates (task_autogen) yields no trigger for PlantingSchedule::Perennial. Annual cycles are unchanged (Sow / Transplant / Harvest). Users who raise their own stock can still add a task by hand.

Verification

  • Tests updated: perennial_yields_no_trigger, creating_perennial_planting_generates_no_task.
  • cargo test -p pomone-app green (150), clippy + fmt clean.

Note: this only affects newly created perennials. Existing apple/plum plantings keep the already-generated Repiquage task — delete it from the calendar/task form if unwanted.

🤖 Generated with Claude Code

Creating a perennial planting (fruit tree, perennial) auto-generated a
Transplant ("Repiquage") task at its establishment date. But perennials are
typically planted from bought stock — there's nothing to transplant — so the
task is spurious and confusing (reported in pre-prod).

`phase_dates` now yields no trigger for `PlantingSchedule::Perennial`; annual
cycles are unchanged (Sow / Transplant / Harvest as before). The user can
still add a planting task by hand if they raise their own stock.

Tests updated: perennial creation now generates zero tasks.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@guycorbaz guycorbaz merged commit 4975e35 into main Jun 9, 2026
5 checks passed
@guycorbaz guycorbaz deleted the fix/no-transplant-task-for-perennials branch June 9, 2026 16:47
guycorbaz added a commit that referenced this pull request Jun 9, 2026
…nts) (#94)

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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant