Skip to content

company show: drop payment_configs GET entirely - #148

Merged
DamoneMX merged 3 commits into
mainfrom
aint-786-skip-payment-configs-for-non-partner-managed
Jul 23, 2026
Merged

company show: drop payment_configs GET entirely#148
DamoneMX merged 3 commits into
mainfrom
aint-786-skip-payment-configs-for-non-partner-managed

Conversation

@DamoneMX

@DamoneMX DamoneMX commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • gusto company show was firing GET /v1/companies/{uuid}/payment_configs
    in parallel with the primary company GET. The endpoint gates on an active
    PartnerCompanyMapping, which gusto auth login doesn't create, so the
    call always 404s with CanCan::AccessDenied for the companies this CLI
    currently serves. The CLI suppressed the 404 client-side, so the failure
    was invisible to users but still hit Embedded Pay's error dashboards. Over
    the last 8d, 27 invocations, 100% errors.
  • Remove the call unconditionally rather than gate it on
    is_partner_managed. Alongside the GET:
    • drop payment_config from the --agent JSON envelope and
      payment_speed from summary
    • drop the Payment speed line from human-readable output
    • drop the PaymentConfig type and is_partner_managed from the
      internal CompanyRecord type
    • move company_payment_configs:read from REQUIRED_SCOPES to
      DROPPED_SCOPES (no in-surface command needs it now)
  • Reduce parallel GETs from three to two (/v1/companies/{uuid} and
    /v1/companies/{uuid}/pay_schedules). Breaking change to the --agent
    JSON envelope shape.

Test plan

  • bun run typecheck, bun run lint, bun run format:check pass
  • bun test src/commands/company src/lib/oauth → 76 pass / 0 fail. The
    network test asserts the /payment_configs endpoint is never called
    using an anchored regex (/companies/[^/]+/payment_configs(?:$|\?)/).
  • Full bun test → 1134/1135. The one failure
    (--check exits 0 when NOTICES is current) is pre-existing on
    origin/main, unrelated to this change (drift from other PRs merged
    today, verified by running the script from a clean origin/main
    checkout).
  • bun run build compiles clean.
  • Live sandbox run against a non-partner-managed company: 2 GETs on the
    wire (/v1/companies/{uuid}, /v1/companies/{uuid}/pay_schedules);
    envelope shape validated by unit tests (no payment_config, no
    summary.payment_speed).

@DamoneMX
DamoneMX requested review from a team and ashieh as code owners July 21, 2026 19:46
@DamoneMX
DamoneMX force-pushed the aint-786-skip-payment-configs-for-non-partner-managed branch from d90cbc8 to 58fab6d Compare July 21, 2026 19:53
@ashieh

ashieh commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

I am thinking we should remove the ability to GET payment configs. I don't think we will have partner-managed companies going through this flow but should get confirmation from Cathy Slack

DamoneMX and others added 2 commits July 22, 2026 12:16
…partner-managed

The endpoint gates on an active PartnerCompanyMapping, so firing it for a
company whose response has is_partner_managed: false always 404s and
generates a CanCan::AccessDenied on Embedded Pay's error dashboards.
Gating the call on the company response makes the invariant explicit at
the call site and retires the client-side 404 suppression as the single
source of truth. Envelope shape is unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Arie Radilla <arie.radillalaureano@gusto.com>
Remove the API call to avoid 404s from non-partner-managed companies.

- Remove the payment_configs GET from `company show` unconditionally
- Drop payment_config from the response envelope and payment_speed
  from the summary (breaking change to the --agent JSON shape)
- Drop the is_partner_managed gate and the PaymentConfig type
- Move company_payment_configs:read from REQUIRED_SCOPES to
  DROPPED_SCOPES (no longer used by any command)
- Reduce parallel GETs from three to two
- Update company + oauth tests; the network test now asserts the
  /payment_configs endpoint is never called (anchored regex)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Arie Radilla <arie.radillalaureano@gusto.com>
@DamoneMX
DamoneMX force-pushed the aint-786-skip-payment-configs-for-non-partner-managed branch from 58fab6d to 8ee1aa2 Compare July 22, 2026 20:04
@DamoneMX DamoneMX changed the title company show: skip payment_configs GET when company isn't partner-managed [AINT-786] company show: drop payment_configs GET entirely Jul 22, 2026
@ashieh

ashieh commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Code looks good. I think we should drop the reference to AINT-786 in the PR title.

@DamoneMX DamoneMX changed the title [AINT-786] company show: drop payment_configs GET entirely company show: drop payment_configs GET entirely Jul 23, 2026
@DamoneMX
DamoneMX merged commit edcf9dd into main Jul 23, 2026
17 checks passed
@DamoneMX
DamoneMX deleted the aint-786-skip-payment-configs-for-non-partner-managed branch July 23, 2026 22:31
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.

2 participants