Add incomplete_profiles query to email_queries.py #308
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ldraney/basketball-api#308
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type
Feature
Lineage
Standalone — part of westside-email-agent capability buildout (2026-04-04). The blast endpoint and query registry exist. This adds the audience query for profile completion reminders.
Repo
forgejo_admin/basketball-apiUser Story
As an admin, I want to send profile completion reminder emails to parents whose players have missing data, so that player profiles are complete before the season starts.
Context
The
/admin/email/blastendpoint accepts aqueryparameter that selects recipients fromemail_queries.py. Currently onlyunsigned_contractsexists. This addsincomplete_profiles.Database audit shows: 17 missing photos, 13 missing height, 14 missing position, 14 missing DOB. 20 players have 3+ missing fields. Jersey number/size are excluded (admin-assigned, not parent-fillable).
The profile completion URL is
{frontend_url}/register?token={parent.registration_token}— same pattern used bysend_profile_reminder_email()in email.py.File Targets
Files to modify:
src/basketball_api/services/email_queries.py— addquery_incomplete_profilesfunction and register inQUERY_REGISTRYFiles NOT to touch:
src/basketball_api/routes/admin.py— blast endpoint is generic, no changes neededsrc/basketball_api/services/email.py— existingsend_profile_reminder_emailstays, this is a separate pathAcceptance Criteria
incomplete_profilesquery returns per-player rows for players missing photo, height, position, or date_of_birthTest Expectations
pytest tests/test_email_blast.py -vConstraints
query_unsigned_contractspattern exactlyto,parent_idat minimum (blast endpoint requirement)settings.frontend_url+/register?token={parent.registration_token}Checklist
Related
arch-email— email architectureproject-westside-agency— agent capability buildoutScope Review: READY
Review note:
review-758-2026-04-03Scope is solid. Single file target (email_queries.py) verified on origin/main. All upstream dependencies (#293, #294, #295) are done and validated. Traceability complete (story:WS-S7 verified, arch:email label present). 5 AC all agent-verifiable. Fits single agent pass (~3-4 min).
arch-emailarchitecture note does not exist in pal-e-docs — track creation separately (non-blocking).