Skip to content

Scheduler picker last-served data and leader gap alert - #548

Merged
jzongker-churchapps merged 1 commit into
mainfrom
feat/scheduler-picker-gap-alert
Nov 24, 2026
Merged

jzongker-churchapps merged 1 commit into
mainfrom
feat/scheduler-picker-gap-alert

Conversation

@jzongker-churchapps

@jzongker-churchapps jzongker-churchapps commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor
  • GET /doing/assignments/picker/:positionId: last-served date (before this plan, declines excluded) for each member of the position's team, plus their other assignments that day. Two batched queries, church-scoped, gated by PlanAuth.canEditPosition (the check that saves from the picker). loadLastServed gains optional personIds/before; auto-schedule's call is unchanged.
  • New plan-type reminder recipientMode: "leaderGaps" (existing string column, no schema change), handled in PlanReminderAdapter: sends one push/email listing unfilled positions and unconfirmed people, with a link to the plan in B1Admin. Nothing sends when there are no gaps. It sends once per plan per reminder through the existing occurrence key and sent log.
  • "Ministry leaders" means members marked leader of the plan's ministry group (plan.ministryId, groupMembers.leader = 1), the same people notifyLeadersOfResponse already notifies.
  • The scope save keeps the volunteer reminder and the gap alert as separate definitions. The engine passes recipientMode to renderMessage/buildEmails, and renderMessage may now be async.
  • Tests: new jest suites for picker scoping, the gap helper, the gap alert (no gaps → nothing, gaps → one message to leaders, not sent twice, off by default), and scope separation. The 20 suites that fail locally fail the same way on main (they need a database).

Approved by Jeremy in the 2026-11-23 scheduling triage (106/38/116, 77/82)

Sibling: ChurchApps/B1Admin#963. Merge this Api PR first.

🤖 Generated with Claude Code

- GET /doing/assignments/picker/:positionId returns when each team member last
  served before the plan and what else they serve that day (two batched queries,
  church-scoped, gated by PlanAuth.canEditPosition).
- New reminder recipientMode "leaderGaps" on plan-type reminders: N days before,
  leaders of the plan's ministry group get one message listing unfilled positions
  and unconfirmed people, with a link to the plan; nothing sends without gaps.
@jzongker-churchapps
jzongker-churchapps force-pushed the feat/scheduler-picker-gap-alert branch from 6c4c4fa to 8d47b65 Compare November 24, 2026 00:50
@jzongker-churchapps
jzongker-churchapps merged commit c88757d into main Nov 24, 2026
1 check passed
@jzongker-churchapps
jzongker-churchapps deleted the feat/scheduler-picker-gap-alert branch November 24, 2026 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant