feat: add parent_phone to SubscriptionListItem response model #289
No reviewers
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!289
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "286-subscription-parent-phone"
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?
Summary
Add
parent_phonefield to theSubscriptionListItemPydantic model so admins can see parent contact numbers in subscription list and overview endpoints without a separate lookup.Changes
src/basketball_api/routes/subscriptions.py— Addedparent_phone: str | NonetoSubscriptionListItemmodel; populated fromp.parent.phonein bothlist_subscriptionsandsubscription_overviewendpointstests/test_subscriptions.py— Added two tests: one verifyingparent_phoneappears with a value when the parent has a phone on file, one verifying it isnullwhen the parent has no phoneTest Plan
ruff formatandruff checkcleanReview Checklist
parent_phone: str | Noneadded toSubscriptionListItemRelated Notes
None.
Related
Closes #286
QA Review -- PR #289
Scope Check
parent_phone: Optional[str]onSubscriptionListItem, populated from parent relationship, with tests for both present and absent phone. All acceptance criteria met.Code Quality
parent_phone: str | Noneadded toSubscriptionListItem-- correct type, consistent with existingstr | Nonepattern forstripe_customer_idandstripe_subscription_id.list_subscriptionsandsubscription_overviewpopulate the field fromp.parent.phone-- correct, since both endpoints alreadyjoinedload(Player.parent).Test Coverage
test_list_subscriptions_includes_parent_phone: Sets phone on parent, verifies it appears in response. Good.test_list_subscriptions_parent_phone_null_when_missing: Verifies null when parent has no phone. Good.list_subscriptionsendpoint. Thesubscription_overviewendpoint uses the sameSubscriptionListItemconstruction, so coverage is adequate.Nits
None.
VERDICT: APPROVED