Co-authored-by: orchestrator-agent <20+orchestrator-agent@code.cubecraftcreations.com>
This commit was merged in pull request #172.
This commit is contained in:
@@ -77,13 +77,15 @@ func DayOfReminder(date store.LocalDate, dinnerID, name string) notify.Event {
|
||||
}
|
||||
}
|
||||
|
||||
// NewSuggestions is the new_suggestions event of suggestion batch batchID,
|
||||
// made in the week starting on week, naming its Side quests.
|
||||
func NewSuggestions(batchID string, week store.LocalDate, names []string) notify.Event {
|
||||
// NewSuggestions is the new_suggestions event keyed by id, the ISO week
|
||||
// ("2026-W41") of a scheduled suggestion batch or the batch id of a manual
|
||||
// one, of the week starting on week: how many new Side quests there are,
|
||||
// and their names.
|
||||
func NewSuggestions(id string, week store.LocalDate, names []string) notify.Event {
|
||||
return notify.Event{
|
||||
Type: notify.NewSuggestions,
|
||||
Key: string(notify.NewSuggestions) + ":" + batchID,
|
||||
Title: "New Side quests are in",
|
||||
Key: string(notify.NewSuggestions) + ":" + id,
|
||||
Title: count(len(names), "new Side quest is in", "new Side quests are in"),
|
||||
Body: nameList(names),
|
||||
URL: "/discover",
|
||||
Week: week,
|
||||
|
||||
@@ -110,9 +110,19 @@ func TestMessages(t *testing.T) {
|
||||
key: "new_suggestions:01J9BATCH",
|
||||
url: "/discover",
|
||||
week: "2026-10-12",
|
||||
title: "New Side quests are in",
|
||||
title: "5 new Side quests are in",
|
||||
body: "Lemon orzo, Bibimbap, Shakshuka + 2 more",
|
||||
chatT: "New Side quests are in: Lemon orzo, Bibimbap, Shakshuka + 2 more. Open Discover →",
|
||||
chatT: "5 new Side quests are in: Lemon orzo, Bibimbap, Shakshuka + 2 more. Open Discover →",
|
||||
},
|
||||
{
|
||||
name: "new suggestions of a scheduled week",
|
||||
ev: NewSuggestions("2026-W42", week, []string{"Pho"}),
|
||||
key: "new_suggestions:2026-W42",
|
||||
url: "/discover",
|
||||
week: "2026-10-12",
|
||||
title: "1 new Side quest is in",
|
||||
body: "Pho",
|
||||
chatT: "1 new Side quest is in: Pho. Open Discover →",
|
||||
},
|
||||
{
|
||||
name: "rotation review",
|
||||
|
||||
Reference in New Issue
Block a user