Skip to content

F11: Reactivate flock — undo deplete/archive #57

Description

@mforce

Part of Phase 1.1 (epic #14). Found the hard way (2026-07-16): deplete/archive are one-way — a mis-click is unrecoverable from the UI, and the only "undo" is database surgery. That's a data-loss-inducing UX trap.

Scope

  • Flock.Reactivate() — Depleted → Active and Archived → Active; clears DepletedOn/ArchivedOn; 409 when already Active; bumps Version (AGENTS.md rule) + parallel-race test.
  • POST /flocks/{id}/reactivate.
  • Flocks screen: "reactivate" action on Depleted/Archived rows (where deplete/archive show today).
  • Reactivation restores normal capture: daily entries/movements accepted for any date again (the lifecycle stamps are cleared, so the CanRecordProductionOn backfill window disappears with them).

Notes

  • Consider a lightweight confirm on deplete/archive in the SPA while here (one mis-click caused a DB wipe) — cheap confirm() is fine at MVP polish level.

Acceptance

  • Deplete → reactivate → flock back in daily-entry picker and dashboard, entries recordable for today.
  • Archive → reactivate → same.
  • Reactivate on Active flock → 409.
  • Race test: parallel reactivates, Version advances per success.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions