Skip to content

F17 follow-up: voided daily entry permanently blocks re-entering that day #82

Description

@mforce

Problem

Voiding a daily entry (#69) leaves the row occupying the natural key (account, farm, house, flock, date). RecordDailyEntryHandler finds it by natural key with no status filter and tries RecordProduction on it, which the Draft-only guard rejects with 422 DailyEntry.Immutable — "Only draft entries can be edited."

Net effect: once an entry is voided, that house/flock/day can never be recorded again, and the error message doesn't explain why. But void means "this entry should never have existed" — the day's real production still needs a way in. Adjust covers wrong numbers; nothing covers voided-then-re-enter.

Fix

Treat Voided as vacating the natural key:

  • FindByNaturalKeyAsync excludes Voided entries.
  • Replace IX_DailyEntries_NaturalKey with a partial unique index (WHERE "Status" <> 'Voided'): one live entry per key, any number of voided ones preserved in history.
  • Regression tests: void → record same day succeeds as a fresh entry; History lists both rows; parallel record-vs-record on a vacated key stays deterministic.
  • GLOSSARY + Help: note that voiding frees the day for a fresh entry.

Part of #14 (F17 follow-up).

Activity

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

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions