Wire plan_ready, list_ready, new_suggestions and Send to Google Chat (Feature 19) (#167)
CI / ci (push) Successful in 7m2s

Co-authored-by: orchestrator-agent <20+orchestrator-agent@code.cubecraftcreations.com>
This commit was merged in pull request #167.
This commit is contained in:
2026-10-09 16:42:56 -04:00
committed by approver_agent
parent bbe031ec8d
commit 51e0213e92
45 changed files with 1911 additions and 275 deletions
@@ -0,0 +1,10 @@
-- 0017_shopping_list_chat_send_unconfirmed: a send of a Supply run to
-- Google Chat is recorded as begun, in chat_send_unconfirmed_at, before it
-- is posted, and cleared when Google Chat's answer is known: with
-- sent_to_chat_at when it accepted the post, alone when it refused it. A
-- value left behind (Google Chat did not answer, the process stopped, or
-- recording the answer failed) means the post may or may not have been
-- made, so it is never posted again without resend. Existing rows have no
-- send under way.
ALTER TABLE shopping_lists ADD COLUMN chat_send_unconfirmed_at TEXT;
+21
View File
@@ -89,6 +89,27 @@ UPDATE shopping_lists
SET title = ?, updated_at = ?
WHERE id = ? AND title IS NULL AND status = 'current' AND frozen_at IS NULL;
-- name: BeginShoppingListChatSend :execrows
-- Records a send of list id to Google Chat begun at
-- chat_send_unconfirmed_at, before it is posted, unless the list is frozen
-- into the Supply archive.
UPDATE shopping_lists
SET chat_send_unconfirmed_at = ?, updated_at = ?
WHERE id = ? AND status = 'current' AND frozen_at IS NULL;
-- name: MarkShoppingListSentToChat :execrows
-- Records list id sent to Google Chat at sent_to_chat_at, its send
-- confirmed, unless it is frozen into the Supply archive.
UPDATE shopping_lists
SET sent_to_chat_at = ?, chat_send_unconfirmed_at = NULL, updated_at = ?
WHERE id = ? AND status = 'current' AND frozen_at IS NULL;
-- name: ClearShoppingListChatSend :execrows
-- Clears the send of list id begun, once Google Chat refused it.
UPDATE shopping_lists
SET chat_send_unconfirmed_at = NULL, updated_at = ?
WHERE id = ?;
-- name: FreezeShoppingList :execrows
-- Freezes list id into the Supply archive at frozen_at, unless it is
-- frozen already.
+5
View File
@@ -26,6 +26,11 @@ WHERE kind = sqlc.arg(kind)
ORDER BY id
LIMIT 1;
-- name: GetSuggestionBatch :one
-- Batch id. Returns sql.ErrNoRows when there is none.
SELECT * FROM suggestion_batches
WHERE id = ?;
-- name: StartSuggestionBatch :execrows
-- Marks a pending batch running; a batch in any other status is left as
-- it is (0 rows).