Exclude already-paid players from first-payment blast audience #482
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#482
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
Discovered during Apr 13 re-blast. Querenne Nyamuhebe had already paid her April fee (Order #25, paid). She was accidentally re-emailed because the blast query didn't filter on existing paid orders.
Repo
forgejo_admin/basketball-apiUser Story
As an admin running a first-payment blast
I want the audience to automatically exclude players who already paid for the current monthly period
So that parents who already paid don't get confusing "pay now" emails
Context
POST /admin/email/first-paymentselectsPlayer.contract_status == signed AND Player.contract_token IS NOT NULL. No filter for existing paid orders. When a paid player re-clicks, checkout correctly returns 409 (no double-charge), but the email shouldn't have been sent in the first place.File Targets
src/basketball_api/routes/admin.py—admin_send_first_payment()blast query (~line 990). Add a NOT EXISTS clause excluding players with any paid Order joined to a monthly-category Product.Files to NOT touch:
src/basketball_api/services/email.pysrc/basketball_api/routes/checkout.pyAcceptance Criteria
paidorder inProductCategory.monthlytest_emailfilter still workssent_countreflects filtered audienceTest Expectations
pytest tests/test_first_payment_blast.py -vConstraints
Checklist
Related
westside-basketball— project this affectsbasketball-api#479— related amount-match fix