Supply archive: mark an unfrozen past run as still open (Maestro 29b629aa) (#200)
CI / ci (push) Successful in 8m36s

Co-authored-by: orchestrator-agent <20+orchestrator-agent@code.cubecraftcreations.com>
This commit was merged in pull request #200.
This commit is contained in:
2026-10-11 17:29:09 -04:00
committed by approver_agent
parent 01cd9a8741
commit cfc229049f
8 changed files with 186 additions and 63 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}