Revalidate the draft pool on save, refuse duplicate swaps, refresh the Quest log after a draft
Feature 14 integration fix (Maestro 857e4c33-e250-46ec-b5ea-7dd4f3b719d9). - F14-01: storeDraft re-reads the draft pool (ListDraftPool, the same eligibility rule draft_week was given) inside the save transaction. A day whose dinner was archived, moved to tried, or planned on another current or later week while draft_week ran fails the job with the new retryable reason pool_changed and stores nothing. - F14-02: Swap refuses a dinner already on another day of the week inside the write transaction; the API answers 409 dinner_already_planned. - F14-03: a finished draft invalidates the Quest log query, as the swap path does, so the tablet strip and desktop panel drop dinners it planned. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -309,6 +309,7 @@ func TestPutPlanDay(t *testing.T) {
|
||||
{"2026-10-12/days/2026-10-32", `{"dinner_id":"` + e.questLog + `"}`, http.StatusBadRequest, "invalid_date"},
|
||||
{"2026-10-12/days/2026-10-14", `{"dinner_id":"no-such-dinner"}`, http.StatusNotFound, "not_found"},
|
||||
{"2026-10-19/days/2026-10-20", `{"dinner_id":"` + e.questLog + `"}`, http.StatusNotFound, "not_found"},
|
||||
{"2026-10-12/days/2026-10-15", `{"dinner_id":"` + e.questLog + `"}`, http.StatusConflict, "dinner_already_planned"},
|
||||
} {
|
||||
rec, body := callDinners(t, e.h, http.MethodPut, plansPath+tc.target, tc.body)
|
||||
if rec.Code != tc.status || errorCode(body) != tc.code {
|
||||
|
||||
Reference in New Issue
Block a user