Admin email — profile completion reminders + roster export #101
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
forgejo_admin/basketball-api#101
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
plan-wkq→ Phase 11 → Girls Tryout prep (admin email operations)Repo
forgejo_admin/basketball-apiUser Story
As an admin
I want to email parents of players with incomplete profiles and email myself the full roster
So that I can ensure all profiles are complete before team placement
Context
The Gmail OAuth email service exists in
services/email.pyusingGmailClientwith branded HTML templates.EmailLogtracks sent emails.EmailTypeenum already hasreminderdefined but not implemented. Theget_gmail_client()helper handles tenant-scoped OAuth. Registration confirmation emails already send successfully.Admin needs two capabilities before team placement:
/players/{id}to complete the profileFile Targets
Files the agent should modify:
src/basketball_api/routes/admin.py— add three new endpoints:GET /admin/players/incomplete— query players missingphoto_url,current_school,height, orpositionPOST /admin/email/profile-reminder— send reminder emails to parents of incomplete-profile playersPOST /admin/email/roster-export— email authenticated admin the full player list as HTML tablesrc/basketball_api/services/email.py— addsend_profile_reminder_email()andsend_roster_export_email()functions using existingget_gmail_client()and_build_confirmation_html()pattern for branded HTMLsrc/basketball_api/models.py— addroster_exporttoEmailTypeenum if neededFiles the agent should NOT touch:
src/basketball_api/routes/register.py— registration flow is separatesrc/basketball_api/routes/upload.py— photo upload endpoint already worksAcceptance Criteria
GET /admin/players/incomplete, returns list of players with missing fields identifiedPOST /admin/email/profile-reminder, reminder emails are sent to each parent with a link to their player's profile pagePOST /admin/email/roster-export, admin receives an email with all players in an HTML table (name, division, team, photo status, parent contact)EmailLogTest Expectations
test_incomplete_players_query— verify correct filtering logictest_reminder_email_content— verify email HTML contains profile linktest_roster_export_content— verify email HTML contains player tabletest_admin_only_access— verify 403 for non-admin rolespytest tests/ -k "incomplete or reminder or roster_export"Constraints
routes/admin.pyget_gmail_client()helper — do not create new Gmail authEmailLogmodel for tracking#d42026, black#0a0a0a) matching existing confirmation email stylehttps://westside.tail5b443a.ts.net/players/{player_id}Checklist
Related
phase-wkq-11-girls-tryout— pre-team-placement operations