Skip to content

feat(prototype): wire agent payments prototype to live tax_payments endpoint - #2627

Draft
aaronlee777 wants to merge 1 commit into
mainfrom
agent-payments-live-tax-payments
Draft

feat(prototype): wire agent payments prototype to live tax_payments endpoint#2627
aaronlee777 wants to merge 1 commit into
mainfrom
agent-payments-live-tax-payments

Conversation

@aaronlee777

Copy link
Copy Markdown
Contributor

What

Wires the Agent Payments design prototype (sdk-app/src/design/prototypes/agent-payments) to the real, beta tax_payments API instead of mock data.

  • New useTaxPayments.ts — hand-rolled React Query hooks that fetch GET /v1/companies/:id/tax_payments[/:uuid] through the sdk-app /api proxy. The endpoint is in beta and not yet exposed by @gusto/embedded-api (its OpenAPI spec is still document: false; see APL-249), so there's no generated hook to use — this is a deliberate, clearly-commented prototype-only shim to be replaced once the SDK includes it.
  • types.ts — replaced the guessed mock shape with the real wire contract (TaxPayment, TaxPaymentLineItem) and client-side deriveTaxPaymentStatus / deriveTaxPaymentScope (the API has no status field).
  • AgentPaymentsFlowComponents.tsx — live fetch with real loading/error states; no mock fallback.
  • AgentPaymentsList.tsx / AgentPaymentDetail.tsx — bound to real fields (agency, jurisdiction, period, amount/amount_paid, derived status; detail shows line_items); filter ComboBoxes swapped to Select; list fetches full page (per=100) so client-side filter/sort see all rows.
  • Removed agentPaymentsMockData.ts — no longer used.

Why

Lets us design and iterate against real tax-payment data. Filtering/sorting stay client-side by design (the API supports only a subset server-side) — an accepted prototype choice, not an API-contract claim.

Scope

Prototype-only, entirely under sdk-app/ design mode — no changes to the published SDK surface.

Verify

With a demo whose company has tax-payment data and a token carrying tax_payments:read, open the Agent Payments prototype in sdk-app — the list, filters, status badges, and detail/line-items populate from the live endpoint.

🤖 Generated with Claude Code

…ndpoint

Replace the mock-driven agent payments prototype with a hand-rolled client for
the beta tax_payments API (not yet exposed by @gusto/embedded-api; see APL-249),
fetched through the sdk-app /api proxy. Aligns the types to the real wire shape,
derives payment status client-side, swaps the filter ComboBoxes for Selects, and
removes the mock fixture in favor of live loading/error states.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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