Skip to content

[Gusto R3] Add Gusto workflow helpers and final-approver fallback logic #87013

@yuwenmemon

Description

@yuwenmemon

Add utility helpers that the Workflows page needs to determine Gusto's approval mode and correctly fall back to the Gusto final approver in Basic/Manager modes.

Parent Issues: Expensify/App#85850, Expensify/Expensify#591910
Design Doc Section: Detailed — Add Gusto workflow helpers and final-approver fallback logic

Files to add/update

  • src/libs/PolicyUtils.ts — Add helpers like getGustoApprovalMode(), isGustoCustomMode(), and isGustoReadOnlyWorkflowMode().
  • src/libs/WorkflowUtils.ts — Make sure workflow generation falls back to Gusto's finalApprover in Basic/Manager modes if the backend does not also mirror that value into policy.approver.

Key implementation details

  • Treat Gusto Basic and Manager as read-only workflow modes.
  • Treat Gusto Custom as "workflow editing still allowed, but approval mode lives on the HR page."
  • If the policy is in a non-custom Gusto mode and policy.connections.gusto.config.finalApprover is set, use that as the default approver for any chain-building logic that currently falls back to policy.approver.
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