Skip to content

[Gusto R1] Add Gusto OAuth flow, sync flow, and sync results #87010

@yuwenmemon

Description

@yuwenmemon

Add the OAuth connection flow, manual sync action, sync stage progress, and sync results RHP for Gusto. This reuses the existing accounting connection pattern.

Parent Issues: Expensify/App#85850, Expensify/Expensify#591910
Design Doc Section: Detailed — Add the Gusto OAuth flow, sync flow, and sync results modal

Files to add/update

  • src/libs/actions/connections/Gusto.ts — New action file with connectPolicyToGusto(), syncGusto(), updateGustoApprovalMode(), and updateGustoFinalApprover().
  • src/libs/actions/connections/index.ts — Extend the shared connection helpers so syncConnection() knows how to trigger Gusto and map its sync stages.
  • src/libs/actions/PolicyConnections.ts — Add openPolicyHRPage() so the HR page can fetch its initial payload the same way Accounting does today.
  • src/components/ConnectToGustoFlow/index.tsx — New flow component that opens the Gusto OAuth URL and then returns the admin to NewDot.
  • src/components/ConnectToGustoFlow/types.ts — Local types for the connection flow.
  • src/components/GustoSyncResultsModal.tsx — New reusable component for the sync summary shown after the initial connect and manual syncs.
  • src/types/onyx/Policy.ts — Extend PolicyConnectionSyncProgress with the result object for Gusto sync summaries.
  • src/libs/API/types.ts — Add the added, removed, and skipped result types.
  • src/languages/en.ts — Add sync-stage names, sync results headers, skipped reasons, and menu labels.

Key implementation details

  • Use the same general connection pattern as QBO/Xero: open an external auth/setup URL, listen for the connection sync progress, and update the page once the job finishes.
  • Reuse ONYXKEYS.POLICY_CONNECTION_SYNC_PROGRESS instead of creating a new Onyx key. The only new requirement is an optional result payload on JOB_DONE for Gusto.
  • The syncing state uses the existing inline spinner on the Gusto connection card — no separate loading state in the RHP.
  • When the sync reaches JOB_DONE and includes a result, open the sync results RHP — but only if the user is still on the HR page (isFocused check). If the user has navigated away, do not open the RHP.
  • Reuse RemovePolicyConnection for disconnect.
Issue OwnerCurrent Issue Owner: @shubham1206agra

Metadata

Metadata

Labels

NewFeatureSomething to build that is a new item.WeeklyKSv2

Type

No type
No fields configured for issues without a type.

Projects

Status

CRITICAL

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions