Skip to content

Coach Connect types carry every field the billing reads return - #20

Merged
DrAlexHarrison merged 1 commit into
mainfrom
billfields
Oct 5, 2026
Merged

DrAlexHarrison merged 1 commit into
mainfrom
billfields

Conversation

@DrAlexHarrison

Copy link
Copy Markdown
Member

The Coach API's Connect billing reads return fields this SDK's types did not declare, so a typed caller could not read a partial refund, who paid Stripe's fee, or the dispute and fee totals.

  • CoachConnectCharge: stripe_fee_paid_by (coach or saturday) and platform_fee_returned_cents, both optional (the API leaves them out while empty).
  • CoachChargeBreakdown: stripe_fee_paid_by (optional), refunded_cents, platform_fee_returned_cents, disputes_cents, dispute_costs_recovered_cents.
  • CoachEarningsSummary: total_refunded_cents, total_platform_fee_returned_cents, total_disputes_cents, total_dispute_costs_recovered_cents.
  • CoachConnectSummary: platform_fee_minimum_cents, coach_pays_stripe_fees_from, stripe_fee_domestic_bps, stripe_fee_international_bps, stripe_fee_fixed_cents.

Diffed against the Go JSON tags at fuel-backend main 26ee95de; the contract fixtures are regenerated from those structs (saturday-python tests/fixtures/generate.go, now with a partly refunded charge) and are identical in both SDKs. CHANGELOG under Unreleased. Docs: SaturdayInc/docs#62.

Tests: pytest tests/test_contracts.py (95 passed), mypy saturday tests/typecheck --check-untyped-defs --warn-unused-ignores (clean). The contract test fails on the old types and passes with these.

🤖 Generated with Claude Code

CoachConnectCharge gains stripe_fee_paid_by and platform_fee_returned_cents;
CoachChargeBreakdown gains stripe_fee_paid_by, refunded_cents, platform_fee_returned_cents,
disputes_cents and dispute_costs_recovered_cents, and CoachEarningsSummary their totals;
CoachConnectSummary gains the fee terms. The fixture generator adds a partly refunded charge,
and the fixtures are regenerated at fuel-backend 26ee95de.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@DrAlexHarrison
DrAlexHarrison merged commit a6c1b14 into main Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant