feat(prototype): wire agent payments prototype to live tax_payments endpoint - #2627
Draft
aaronlee777 wants to merge 1 commit into
Draft
feat(prototype): wire agent payments prototype to live tax_payments endpoint#2627aaronlee777 wants to merge 1 commit into
aaronlee777 wants to merge 1 commit into
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Wires the Agent Payments design prototype (
sdk-app/src/design/prototypes/agent-payments) to the real, betatax_paymentsAPI instead of mock data.useTaxPayments.ts— hand-rolled React Query hooks that fetchGET /v1/companies/:id/tax_payments[/:uuid]through the sdk-app/apiproxy. The endpoint is in beta and not yet exposed by@gusto/embedded-api(its OpenAPI spec is stilldocument: 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-sidederiveTaxPaymentStatus/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 showsline_items); filterComboBoxes swapped toSelect; list fetches full page (per=100) so client-side filter/sort see all rows.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 insdk-app— the list, filters, status badges, and detail/line-items populate from the live endpoint.🤖 Generated with Claude Code