Events 3.8.0, @crosscode/demo 1.1.0: STOP stops all WhatsApp, demo scenarios

Events 3.8.0 (one migration):
- STOP to the church's WhatsApp number stops all WhatsApp, not only news:
  checked before every sendText/sendPdf against WhatsAppStop (by number) and
  User.whatsappOptedOut (from Accounts' user.updated); 2FA codes go by email
- a STOP received here is passed on to Accounts (whatsapp.optout); START turns
  it back on without Accounts; Accounts turning it back on clears it here
- the eight demo scenarios as set-demo profiles, around each church's own
  people (@crosscode/demo, same accounts as Accounts) and campuses; the
  scenario's people are never removed from Accounts

@crosscode/demo 1.1.0: each person's gender.
crosscode script: scenarios as Events demo profiles; Events builds packages/demo.

Checked on PostgreSQL 18: the migration and every scenario loaded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-30 11:42:17 +02:00
co-authored by Claude Opus 5.5
parent 5b9dc559b6
commit 49153e6f07
26 changed files with 549 additions and 48 deletions
+13 -1
View File
@@ -23,6 +23,8 @@ export interface DemoPerson {
familyName: string;
email: string;
part: DemoPart;
/** 1.1.0: for products that seat or group people (Cross Events' men's breakfast, camp cabins). */
gender: "female" | "male";
/** The campus they belong to (multi-campus scenarios), or null. */
campus: string | null;
}
@@ -50,6 +52,16 @@ const MEMBERS: Record<agent.DemoScenarioKey, number> = {
const GIVEN = ["Aisha", "Andile", "Anele", "Bianca", "Busisiwe", "Carel", "Charlotte", "Craig", "Dineo", "Elias", "Emma", "Fatima", "Francois", "Gugu", "Hlengiwe", "Imran", "Isabel", "Jabu", "Jacques", "Karabo", "Keegan", "Lebo", "Lize", "Lungile", "Marco", "Mpho", "Nadia", "Neo", "Nicole", "Olwethu", "Pumla", "Riaan", "Sanele", "Shaun", "Simone", "Tarryn", "Thandeka", "Unathi", "Vusi", "Zanele"];
const FAMILY = ["Abrahams", "Bester", "Cloete", "Daniels", "Dlamini", "Erasmus", "February", "Gumede", "Hendricks", "Isaacs", "Joubert", "Kekana", "Lategan", "Maseko", "Moloi", "Ndlovu", "Ntuli", "Olivier", "Phiri", "Qwabe", "Roberts", "Snyman", "Tshabalala", "Uys", "Viljoen", "Williams", "Xaba", "Yende", "Zondo", "Van der Merwe"];
/** The given names that are women's; every other given name here is a man's. */
const FEMALE = new Set([
"Margaret", "Gillian", "Rosemary", "Joyce", "Nomvula", "Abigail", "Clara", "Thembeka", "Zinhle", "Ayanda", "Jade", "Precious", "Tumi",
"Megan", "Lerato", "Amahle", "Linda", "Lindiwe", "Grace", "Naledi", "Annatjie", "Magda", "Elize", "Sarah", "Nandi", "Kayla", "Palesa",
"Hannah", "Mia", "Refilwe",
"Aisha", "Anele", "Bianca", "Busisiwe", "Charlotte", "Dineo", "Emma", "Fatima", "Gugu", "Hlengiwe", "Isabel", "Karabo", "Lebo", "Lize",
"Lungile", "Mpho", "Nadia", "Nicole", "Olwethu", "Pumla", "Simone", "Tarryn", "Thandeka", "Unathi", "Zanele",
]);
const genderOf = (given: string): "female" | "male" => (FEMALE.has(given) ? "female" : "male");
const slugOf = (s: string) => s.normalize("NFD").replace(/[̀-ͯ]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "");
/**
@@ -69,7 +81,7 @@ export function demoId(text: string): string {
}
function person(scenario: agent.DemoScenarioKey, part: DemoPart, givenName: string, familyName: string, email: string, campus: string | null): DemoPerson {
return { id: demoId(`${scenario}:${email}`), name: `${givenName} ${familyName}`, givenName, familyName, email, part, campus };
return { id: demoId(`${scenario}:${email}`), name: `${givenName} ${familyName}`, givenName, familyName, email, part, gender: genderOf(givenName), campus };
}
/** Everyone in a scenario: the leads first, then the members (deterministic: the same every time). */