feat: merge first-payment email blast + skip_proration to main #468

Open
forgejo_admin wants to merge 5 commits from 458-merge-first-payment-blast into main

Summary

Merges the 369-first-payment-email-blast branch (including PR #459's skip_proration flag) into main, resolving all merge conflicts. This combines the branch's first-payment email blast feature and skip_proration support with main's recent additions (Order tracking, duplicate prevention, new EmailType values).

Closes #458

Changes

  • src/basketball_api/models.py -- Resolved EmailType enum conflict: kept main's payment_recovery, tournament_fee, payment_request values (branch's first_payment was already present above the conflict)
  • src/basketball_api/routes/checkout.py -- Merged branch's prorate query param, CheckoutResponse return type, _calculate_prorated_fee import, and Tenant/fee_label logic with main's Product lookup, duplicate Order prevention, and Order creation. Removed unused RedirectResponse and ContractStatus imports
  • src/basketball_api/routes/admin.py -- Removed duplicate admin_send_first_payment endpoint (main's version without skip_proration), keeping only the branch's version that passes skip_proration through to send_first_payment_email
  • src/basketball_api/services/email.py -- Merged branch's skip_proration parameter, motivational email tone, and conditional proration display with main's division-aware accent color (_BRAND_QUEENS_PINK for girls, _BRAND_RED for boys)
  • tests/test_first_payment.py -- Updated assertions from 307 redirect to 200 JSON response (CheckoutResponse), updated error messages, and updated test_unsigned_contract to reflect that the email-link flow no longer filters by contract_status
  • tests/test_first_payment_blast.py -- Kept branch's skip_proration blast tests and checkout route tests; added Product/ProductCategory/ProductType imports and monthly_product fixture for checkout tests that now require an active monthly product
  • tests/test_first_payment_email.py -- Kept both main's accent color tests (girls=pink, boys=red) and branch's skip_proration/default_prorates tests; added Division import
  • tests/test_templated_email.py -- Kept main's new EmailType values in the expected set

Test Plan

  • 1012 tests pass (0 new failures introduced)
  • 8 pre-existing failures confirmed on main (jersey_reminder, reconciliation, streamlit_ro_role)
  • ruff format and ruff check clean

Review Checklist

  • Merge conflicts resolved in all 6 files (models.py, checkout.py, email.py, admin.py, test files)
  • Branch features preserved: skip_proration flag, prorate query param, motivational email tone
  • Main features preserved: Order creation, duplicate prevention, new EmailType values, division accent colors
  • Duplicate admin endpoint removed (kept branch version with skip_proration)
  • Tests updated for new CheckoutResponse return type (200 JSON instead of 307 redirect)
  • ruff format and ruff check pass
  • No new test failures introduced
  • Feature branch: 369-first-payment-email-blast
  • PR #459 (skip_proration flag) was already merged into the feature branch before this merge
  • Forgejo issue: #458, #369
## Summary Merges the `369-first-payment-email-blast` branch (including PR #459's skip_proration flag) into main, resolving all merge conflicts. This combines the branch's first-payment email blast feature and skip_proration support with main's recent additions (Order tracking, duplicate prevention, new EmailType values). Closes #458 ## Changes - **src/basketball_api/models.py** -- Resolved EmailType enum conflict: kept main's `payment_recovery`, `tournament_fee`, `payment_request` values (branch's `first_payment` was already present above the conflict) - **src/basketball_api/routes/checkout.py** -- Merged branch's `prorate` query param, `CheckoutResponse` return type, `_calculate_prorated_fee` import, and `Tenant`/`fee_label` logic with main's `Product` lookup, duplicate `Order` prevention, and `Order` creation. Removed unused `RedirectResponse` and `ContractStatus` imports - **src/basketball_api/routes/admin.py** -- Removed duplicate `admin_send_first_payment` endpoint (main's version without `skip_proration`), keeping only the branch's version that passes `skip_proration` through to `send_first_payment_email` - **src/basketball_api/services/email.py** -- Merged branch's `skip_proration` parameter, motivational email tone, and conditional proration display with main's division-aware accent color (`_BRAND_QUEENS_PINK` for girls, `_BRAND_RED` for boys) - **tests/test_first_payment.py** -- Updated assertions from 307 redirect to 200 JSON response (`CheckoutResponse`), updated error messages, and updated `test_unsigned_contract` to reflect that the email-link flow no longer filters by `contract_status` - **tests/test_first_payment_blast.py** -- Kept branch's `skip_proration` blast tests and checkout route tests; added `Product`/`ProductCategory`/`ProductType` imports and `monthly_product` fixture for checkout tests that now require an active monthly product - **tests/test_first_payment_email.py** -- Kept both main's accent color tests (girls=pink, boys=red) and branch's skip_proration/default_prorates tests; added `Division` import - **tests/test_templated_email.py** -- Kept main's new EmailType values in the expected set ## Test Plan - 1012 tests pass (0 new failures introduced) - 8 pre-existing failures confirmed on main (jersey_reminder, reconciliation, streamlit_ro_role) - `ruff format` and `ruff check` clean ## Review Checklist - [x] Merge conflicts resolved in all 6 files (models.py, checkout.py, email.py, admin.py, test files) - [x] Branch features preserved: skip_proration flag, prorate query param, motivational email tone - [x] Main features preserved: Order creation, duplicate prevention, new EmailType values, division accent colors - [x] Duplicate admin endpoint removed (kept branch version with skip_proration) - [x] Tests updated for new CheckoutResponse return type (200 JSON instead of 307 redirect) - [x] ruff format and ruff check pass - [x] No new test failures introduced ## Related Notes - Feature branch: `369-first-payment-email-blast` - PR #459 (skip_proration flag) was already merged into the feature branch before this merge - Forgejo issue: #458, #369
feat: add send_first_payment_email + POST /admin/email/first-payment blast endpoint
Some checks failed
ci/woodpecker/pr/woodpecker Pipeline failed
40eee1cac5
Post-practice first-payment email with prorated fee calculation (same formula
as westside-contracts) and branded HTML. Blast endpoint targets signed players
with contract tokens, supports test_email filtering.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fix: use base_url not frontend_url for checkout redirect link
Some checks failed
ci/woodpecker/pr/woodpecker Pipeline failed
b0423fda6a
The /checkout/first-payment endpoint lives on basketball-api (the API),
not westside-app (the frontend). Using frontend_url would send parents
to a 404.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fix: update email opening to motivational tone
Some checks failed
ci/woodpecker/pr/woodpecker Pipeline failed
5d2017a4a9
"Our job is to create opportunities. Your job is to put in the work."

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
feat: merge first-payment email blast + skip_proration to main
Some checks failed
ci/woodpecker/pr/woodpecker Pipeline failed
b4aa2ecde2
Merge branch 369-first-payment-email-blast into main, resolving conflicts
in models.py, checkout.py, email.py, admin.py, and test files. Combines
the branch's skip_proration feature with main's Order creation, duplicate
prevention, and new EmailType values (payment_recovery, tournament_fee,
payment_request).

Closes #458

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Some checks failed
ci/woodpecker/pr/woodpecker Pipeline failed
This pull request has changes conflicting with the target branch.
  • src/basketball_api/routes/checkout.py
  • src/basketball_api/services/email.py
  • tests/test_first_payment.py
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 458-merge-first-payment-blast:458-merge-first-payment-blast
git switch 458-merge-first-payment-blast

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff 458-merge-first-payment-blast
git switch 458-merge-first-payment-blast
git rebase main
git switch main
git merge --ff-only 458-merge-first-payment-blast
git switch 458-merge-first-payment-blast
git rebase main
git switch main
git merge --no-ff 458-merge-first-payment-blast
git switch main
git merge --squash 458-merge-first-payment-blast
git switch main
git merge --ff-only 458-merge-first-payment-blast
git switch main
git merge 458-merge-first-payment-blast
git push origin main
Sign in to join this conversation.
No description provided.