feat: extend Sponsor model with tier, presentation, and payment fields #357

Open
opened 2026-04-06 16:20:20 +00:00 by forgejo_admin · 0 comments

Type

Feature

Lineage

Child of basketball-api#316 (sponsor system). Extends the Sponsor model from outreach CRM to full relationship management.

Repo

forgejo_admin/basketball-api

User Story

As an admin, I want to manage sponsor relationships — track their tier, what they've paid, their logo, and whether they show on the website — so that I always know what we owe each sponsor and what they've committed (WS-S29)

Context

The Sponsor model (merged in #328) has CRM fields for outreach. This ticket adds the presentation and relationship fields so a committed sponsor is fully described in one row — tier, logo, website, landing page visibility, payment tracking, and season dates.

Architecture: arch-domain-sponsorship. Tier definitions: westside-sponsors note.

File Targets

Files the agent should modify:

  • src/basketball_api/models.py — add SponsorTier enum, add fields to Sponsor model
  • src/basketball_api/services/sponsor_service.py — update CRUD to handle new fields
  • src/basketball_api/routes/sponsors.py — update Pydantic schemas for new fields
  • alembic/versions/xxx_extend_sponsors.py — new migration adding columns + SponsorTier enum
  • tests/test_sponsors.py — update tests for new fields

Acceptance Criteria

  • SponsorTier enum: title, elite, team, social, player_sponsor, community_partner
  • New nullable fields on Sponsor: tier, logo_url, website_url, description, cta_text, amount_committed (Numeric), amount_paid (Numeric), display_on_site (Boolean, default false), start_date (Date), end_date (Date)
  • GET /sponsors accepts display_on_site=true filter
  • PATCH /sponsors/{id} can update all new fields
  • POST /sponsors/seed accepts new fields in seed items
  • Alembic migration adds columns and enum cleanly

Test Expectations

  • Unit: create sponsor with tier and presentation fields
  • Integration: GET /sponsors?display_on_site=true returns only displayable sponsors
  • Integration: PATCH sponsor with tier, logo_url, amount_committed
  • Run command: pytest tests/test_sponsors.py -v

Constraints

  • All new fields are nullable (existing sponsors don't break)
  • amount_committed and amount_paid use Numeric(10,2) for currency
  • display_on_site defaults to false (opt-in, not opt-out)
  • Follow existing migration patterns (see 031_add_sponsors_table.py)

Checklist

  • PR opened
  • Tests pass
  • Migration runs cleanly
  • No unrelated changes
  • basketball-api#316 — parent epic
  • arch-domain-sponsorship — domain model diagram
  • westside-sponsors — tier definitions and active sponsors
### Type Feature ### Lineage Child of basketball-api#316 (sponsor system). Extends the Sponsor model from outreach CRM to full relationship management. ### Repo `forgejo_admin/basketball-api` ### User Story As an admin, I want to manage sponsor relationships — track their tier, what they've paid, their logo, and whether they show on the website — so that I always know what we owe each sponsor and what they've committed (WS-S29) ### Context The Sponsor model (merged in #328) has CRM fields for outreach. This ticket adds the presentation and relationship fields so a committed sponsor is fully described in one row — tier, logo, website, landing page visibility, payment tracking, and season dates. Architecture: `arch-domain-sponsorship`. Tier definitions: `westside-sponsors` note. ### File Targets Files the agent should modify: - `src/basketball_api/models.py` — add SponsorTier enum, add fields to Sponsor model - `src/basketball_api/services/sponsor_service.py` — update CRUD to handle new fields - `src/basketball_api/routes/sponsors.py` — update Pydantic schemas for new fields - `alembic/versions/xxx_extend_sponsors.py` — new migration adding columns + SponsorTier enum - `tests/test_sponsors.py` — update tests for new fields ### Acceptance Criteria - [ ] SponsorTier enum: title, elite, team, social, player_sponsor, community_partner - [ ] New nullable fields on Sponsor: tier, logo_url, website_url, description, cta_text, amount_committed (Numeric), amount_paid (Numeric), display_on_site (Boolean, default false), start_date (Date), end_date (Date) - [ ] GET /sponsors accepts `display_on_site=true` filter - [ ] PATCH /sponsors/{id} can update all new fields - [ ] POST /sponsors/seed accepts new fields in seed items - [ ] Alembic migration adds columns and enum cleanly ### Test Expectations - [ ] Unit: create sponsor with tier and presentation fields - [ ] Integration: GET /sponsors?display_on_site=true returns only displayable sponsors - [ ] Integration: PATCH sponsor with tier, logo_url, amount_committed - Run command: `pytest tests/test_sponsors.py -v` ### Constraints - All new fields are nullable (existing sponsors don't break) - amount_committed and amount_paid use Numeric(10,2) for currency - display_on_site defaults to false (opt-in, not opt-out) - Follow existing migration patterns (see 031_add_sponsors_table.py) ### Checklist - [ ] PR opened - [ ] Tests pass - [ ] Migration runs cleanly - [ ] No unrelated changes ### Related - basketball-api#316 — parent epic - `arch-domain-sponsorship` — domain model diagram - `westside-sponsors` — tier definitions and active sponsors
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
forgejo_admin/basketball-api#357
No description provided.