Jersey email: add division filter + persist template #243

Closed
opened 2026-03-29 18:37:19 +00:00 by forgejo_admin · 3 comments
Contributor

Type

Feature

Lineage

Decomposed from original #243. Code-only scope. Ops/validation split to westside-landing#182.

Repo

forgejo_admin/basketball-api

User Story

As Marcus (admin)
I want to filter jersey reminder emails by division
So that I can target boys or girls separately

Context

38 of 39 boys have never interacted with the jersey page. The jersey-reminder endpoint currently sends to ALL parents with tokens — no division filter, no way to exclude those who already ordered. Template was hotfixed via ConfigMap but needs to be persisted in the repo for CI/CD.

File Targets

Files the agent should modify or create:

  • src/basketball_api/routes/admin.py — add division and exclude_ordered query params to POST /admin/email/jersey-reminder
  • src/basketball_api/services/email.py — update plain-text fallback copy with deadline messaging, update subject line
  • email-templates/jersey-reminder.html — commit current ConfigMap template to repo
  • tests/test_jersey_reminder.py — add tests for division filter and exclude_ordered logic

Files the agent should NOT touch:

  • src/basketball_api/routes/checkout.py
  • src/basketball_api/services/jersey_sync.py
  • src/basketball_api/routes/webhooks.py

Acceptance Criteria

  • POST /admin/email/jersey-reminder?division=boys sends only to parents with boys-division players
  • POST /admin/email/jersey-reminder?exclude_ordered=true skips parents whose players have jersey_option IS NOT NULL
  • Both params combine correctly (division=boys&exclude_ordered=true)
  • No params = send to all (backwards compatible)
  • Plain-text fallback matches deadline copy (rush March 30, final April 10)
  • Subject line: Jersey Orders Open — Westside Kings & Queens
  • email-templates/jersey-reminder.html committed to repo

Test Expectations

  • Unit test: division param filters parents to matching division only
  • Unit test: exclude_ordered param skips parents with ordered players
  • Unit test: both params combine correctly
  • Unit test: no params sends to all (backwards compat)
  • Run command: pytest tests/test_jersey_reminder.py -v

Constraints

  • Match existing endpoint patterns in admin.py (query params, response models)
  • Keep backwards-compatible: no params = send to all
  • Template file path: email-templates/jersey-reminder.html at repo root

Checklist

  • PR opened
  • Tests pass
  • No unrelated changes
  • project-westside-basketball
  • westside-landing#180 — deadline bug (blocker, must deploy first)
  • westside-landing#182 — ops/validation ticket (depends on this)
### Type Feature ### Lineage Decomposed from original #243. Code-only scope. Ops/validation split to westside-landing#182. ### Repo `forgejo_admin/basketball-api` ### User Story As Marcus (admin) I want to filter jersey reminder emails by division So that I can target boys or girls separately ### Context 38 of 39 boys have never interacted with the jersey page. The jersey-reminder endpoint currently sends to ALL parents with tokens — no division filter, no way to exclude those who already ordered. Template was hotfixed via ConfigMap but needs to be persisted in the repo for CI/CD. ### File Targets Files the agent should modify or create: - `src/basketball_api/routes/admin.py` — add `division` and `exclude_ordered` query params to `POST /admin/email/jersey-reminder` - `src/basketball_api/services/email.py` — update plain-text fallback copy with deadline messaging, update subject line - `email-templates/jersey-reminder.html` — commit current ConfigMap template to repo - `tests/test_jersey_reminder.py` — add tests for division filter and exclude_ordered logic Files the agent should NOT touch: - `src/basketball_api/routes/checkout.py` - `src/basketball_api/services/jersey_sync.py` - `src/basketball_api/routes/webhooks.py` ### Acceptance Criteria - [ ] `POST /admin/email/jersey-reminder?division=boys` sends only to parents with boys-division players - [ ] `POST /admin/email/jersey-reminder?exclude_ordered=true` skips parents whose players have `jersey_option IS NOT NULL` - [ ] Both params combine correctly (division=boys&exclude_ordered=true) - [ ] No params = send to all (backwards compatible) - [ ] Plain-text fallback matches deadline copy (rush March 30, final April 10) - [ ] Subject line: `Jersey Orders Open — Westside Kings & Queens` - [ ] `email-templates/jersey-reminder.html` committed to repo ### Test Expectations - [ ] Unit test: `division` param filters parents to matching division only - [ ] Unit test: `exclude_ordered` param skips parents with ordered players - [ ] Unit test: both params combine correctly - [ ] Unit test: no params sends to all (backwards compat) - Run command: `pytest tests/test_jersey_reminder.py -v` ### Constraints - Match existing endpoint patterns in `admin.py` (query params, response models) - Keep backwards-compatible: no params = send to all - Template file path: `email-templates/jersey-reminder.html` at repo root ### Checklist - [ ] PR opened - [ ] Tests pass - [ ] No unrelated changes ### Related - `project-westside-basketball` - `westside-landing#180` — deadline bug (blocker, must deploy first) - `westside-landing#182` — ops/validation ticket (depends on this)
Author
Contributor

Scope Review: NEEDS_REFINEMENT

Review note: review-660-2026-03-29

12 acceptance criteria across mixed code + operational concerns exceeds single-agent scope.

  • [DECOMPOSE] Split into two tickets: (1) code — add division/exclude_ordered params, persist template, unit tests (7 automatable AC); (2) ops — E2E validation, test send to Marcus, production send to boys (5 manual AC)
  • [BODY] email-templates/ directory does not exist in repo — agent must create directory + file
  • [BODY] No existing email endpoint has division/exclude params — net-new filtering logic, not a copy of existing pattern
## Scope Review: NEEDS_REFINEMENT Review note: `review-660-2026-03-29` 12 acceptance criteria across mixed code + operational concerns exceeds single-agent scope. - **[DECOMPOSE]** Split into two tickets: (1) code — add `division`/`exclude_ordered` params, persist template, unit tests (7 automatable AC); (2) ops — E2E validation, test send to Marcus, production send to boys (5 manual AC) - **[BODY]** `email-templates/` directory does not exist in repo — agent must create directory + file - **[BODY]** No existing email endpoint has division/exclude params — net-new filtering logic, not a copy of existing pattern
forgejo_admin changed title from Jersey deadline email: validate full flow + send to boys to Jersey email: add division filter + persist template 2026-03-29 18:56:56 +00:00
Author
Contributor

Scope review: NEEDS_REFINEMENT → DECOMPOSED

Review review-660-2026-03-29 flagged 12 AC mixing code + ops concerns. Split into:

  • #243 (this ticket): Code-only — division filter, exclude_ordered, persist template, tests (7 AC)
  • westside-landing#181: Ops — E2E validation, test send, production send (5 AC, manual/operational)

Issue body updated with refined code-only scope per consolidated spec convention.

**Scope review: NEEDS_REFINEMENT → DECOMPOSED** Review `review-660-2026-03-29` flagged 12 AC mixing code + ops concerns. Split into: - **#243 (this ticket):** Code-only — division filter, exclude_ordered, persist template, tests (7 AC) - **westside-landing#181:** Ops — E2E validation, test send, production send (5 AC, manual/operational) Issue body updated with refined code-only scope per consolidated spec convention.
Author
Contributor

Scope Review: READY (re-review)

Review note: review-660-2026-03-29

Decomposition addressed: code-only scope retained here (7 AC), ops/validation split to westside-landing#182. All file targets verified, traceability complete, data model confirmed.

One minor fix before dispatch:

  • [BODY] Related section references westside-landing#181 (closed unrelated PR) — should be westside-landing#182 (the ops ticket).
## Scope Review: READY (re-review) Review note: `review-660-2026-03-29` Decomposition addressed: code-only scope retained here (7 AC), ops/validation split to westside-landing#182. All file targets verified, traceability complete, data model confirmed. One minor fix before dispatch: - `[BODY]` Related section references `westside-landing#181` (closed unrelated PR) — should be `westside-landing#182` (the ops ticket).
forgejo_admin 2026-03-29 19:14:28 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ldraney/basketball-api#243
No description provided.