Skip to content

F7: Flock management — edit/deplete/archive + Flocks screen #47

Closed

Description

@mforce

Part of Phase 1.1 (epic #14). Flocks today: API create/list/get/deplete, SPA has only inline create on Daily entry — no screen, no edit, no deplete UI, Archived status unreachable.

Scope

Domain

  • Flock.Update(name, breed, placementDate, initialCount) — fix typos/corrections. Guards mirror Create.
  • Flock.Archive() — allowed from Active or Depleted (mistake-created flocks can be archived directly). Deplete() stays Active-only.
  • Version concurrency token on Flock — Update/Deplete/Archive all bump it (AGENTS.md rule; Deplete currently has no token at all). Migration adds the column.

API

  • PUT /flocks/{id} — update.
  • POST /flocks/{id}/archive.
  • GET /flocks gains includeArchived (default false): archived flocks disappear from pickers/dashboard; Depleted stay visible (recent-history value). Management view passes true.

Web

  • New "Flocks" screen: table (name, breed, placed, age in weeks, initial count, status), create form, inline edit, deplete/archive actions with status-appropriate buttons, archived toggle. Scoped idempotency keys per established contract.
  • Daily entry keeps its inline quick-create.

Out of scope

  • Current bird count math (initial − mortality − culls) — that's the mortality/bird-movement slice; this screen shows initial count only.

Acceptance

  • Full loop from SPA: create → edit → deplete → archive; archived flock leaves daily-entry flock picker and dashboard, still listed on Flocks screen with toggle.
  • Double-deplete / archive-of-archived → 409.
  • Parallel-update race test: no torn write, 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