Migration: add monthly ProductCategory, first_payment EmailType, seed prorated product #367
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#367
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
Decomposed from
forgejo_admin/basketball-api#366. Ticket A of 3 — prerequisite for B (checkout endpoint) and C (email + blast).Repo
forgejo_admin/basketball-apiUser Story
As a developer implementing the first-payment feature
I want the database schema to support monthly product category and first_payment email tracking
So that the checkout and email endpoints have the enums and product row they need
Context
The first-payment feature requires two new enum values (
ProductCategory.monthly,EmailType.first_payment) and a seeded Product row ("Monthly Fee — Prorated April") for the Orders table FK. This migration is the prerequisite for the checkout endpoint (ticket B) and email blast (ticket C). Both depend on these enum values and the product row existing.File Targets
Files to create:
alembic/versions/031_add_monthly_category_and_first_payment_email.py— migration with enum additions and product seedFiles to modify:
src/basketball_api/models.py:63-70— addfirst_paymenttoEmailTypeenum (afterinterest_notification)src/basketball_api/models.py:123-128— addmonthlytoProductCategoryenum (afterequipment)Files NOT to touch:
Acceptance Criteria
ProductCategory.monthlyexists in Python enum and PostgresEmailType.first_paymentexists in Python enum and Postgresproduct_type=one_time,category=monthly,price_cents=0,tenant_id=1alembic upgrade headapplies cleanlyalembic downgraderemoves the product row (enum values remain — Postgres limitation)Test Expectations
ProductCategory.monthlyandEmailType.first_paymentare valid enum memberscd ~/basketball-api && alembic upgrade head && alembic downgrade -1 && alembic upgrade headConstraints
030_add_registration_type_to_registrations.py— new revision is031ALTER TYPE ... ADD VALUE IF NOT EXISTSfor Postgres enum safetyON CONFLICT DO NOTHINGfor product seed idempotencytenant_id=1is westside-kings-queens (seeded in 001_initial)Checklist
Related
westside-basketball— projectforgejo_admin/basketball-api#366~/pal-e-platform/docs/superpowers/specs/2026-04-06-first-payment-email-design.md~/pal-e-platform/docs/superpowers/plans/2026-04-06-first-payment-email.md(Task 1)Scope Review: READY
Review note:
review-873-2026-04-06Scope is solid — all file targets verified against codebase, template complete, traceability triangle intact (story:WS-S7 confirmed on project page). Single-repo, single-agent pass under 5 minutes.
[SCOPE]Missing arch notearch-basketball-apiin pal-e-docs (platform-wide gap, does not block this ticket)