Mark unfrozen Supply archive posts and open them in the Supply run
CI / ci (push) Successful in 8m9s
CI / ci (pull_request) Successful in 8m7s

The Supply archive presented every post as a frozen, read-only list, even a
past week's Supply run that week_rollover had not frozen and that the
Supply run route could still change. Each archive post now carries frozen;
a post not yet frozen is marked (Current, or Still open for a past week)
and links to the Supply run, where it can still change. Only frozen posts
open read-only in the archive.

Maestro task 29b629aa-1ad9-48a3-be75-0380b645d4fe

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-11 09:35:55 -04:00
co-authored by Claude Opus 5.5
parent 791b321b71
commit c2a63192a6
8 changed files with 159 additions and 39 deletions
+5 -2
View File
@@ -222,8 +222,9 @@ type archivePeriod struct {
}
// archivePost is one week's Supply run in the Supply archive. label is
// the week label, which stands in for title while it is null, and
// onHandCount counts the items marked "have it".
// the week label, which stands in for title while it is null,
// onHandCount counts the items marked "have it", and frozen is false
// while the list can still be changed from the Supply run.
type archivePost struct {
WeekStart string `json:"weekStart"`
Label string `json:"label"`
@@ -233,6 +234,7 @@ type archivePost struct {
OnHandCount int `json:"onHandCount"`
Dinners []string `json:"dinners"`
Current bool `json:"current"`
Frozen bool `json:"frozen"`
}
// getSupplyArchive answers GET /shopping/archive?by=week|month|year with
@@ -262,6 +264,7 @@ func getSupplyArchive(logger *slog.Logger, svc *shopping.Service) http.HandlerFu
OnHandCount: post.OnHand,
Dinners: post.Dinners,
Current: post.Current,
Frozen: post.Frozen,
}
}
out.Periods[i] = archivePeriod{Key: p.Key, Heading: p.Heading, Posts: posts}