Supply archive fidelity: frozen posts keep dinner names as frozen (Maestro 22f80eb6) (#201)
CI / ci (push) Successful in 10m7s

Co-authored-by: orchestrator-agent <20+orchestrator-agent@code.cubecraftcreations.com>
This commit was merged in pull request #201.
This commit is contained in:
2026-10-11 15:57:29 -04:00
committed by approver_agent
parent 9d91686c35
commit f7ebc85862
16 changed files with 234 additions and 38 deletions
+9 -1
View File
@@ -60,7 +60,8 @@ DELETE FROM shopping_items
WHERE id = ?;
-- name: ListShoppingGroupDinners :many
-- The groups of list list_id with their dinner's name, in list order.
-- The groups of list list_id with their dinner's name now, in list order.
-- A group of a frozen list shows its frozen_dinner_name instead.
SELECT sqlc.embed(shopping_groups), dinners.name AS dinner_name
FROM shopping_groups
JOIN dinners ON dinners.id = shopping_groups.dinner_id
@@ -117,6 +118,13 @@ UPDATE shopping_lists
SET status = 'archived', frozen_at = ?, updated_at = ?
WHERE id = ? AND frozen_at IS NULL;
-- name: FreezeShoppingGroupNames :exec
-- Keeps the name each dinner of list list_id has now as its group's
-- frozen_dinner_name, as the list is frozen into the Supply archive.
UPDATE shopping_groups
SET frozen_dinner_name = (SELECT dinners.name FROM dinners WHERE dinners.id = shopping_groups.dinner_id)
WHERE list_id = ?;
-- name: ListShoppingListsThrough :many
-- The Supply runs of the weeks starting on or before week_start, newest
-- week first.