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 Owner
Current Issue Owner: @shubham1206agra
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 likegetGustoApprovalMode(),isGustoCustomMode(), andisGustoReadOnlyWorkflowMode().src/libs/WorkflowUtils.ts— Make sure workflow generation falls back to Gusto'sfinalApproverin Basic/Manager modes if the backend does not also mirror that value intopolicy.approver.Key implementation details
policy.connections.gusto.config.finalApproveris set, use that as the default approver for any chain-building logic that currently falls back topolicy.approver.Issue Owner
Current Issue Owner: @shubham1206agra