Skip to content

[Due for payment 2026-05-28] [HR Import] PolicyUtils helpers for HR connections [F03] #90596

@francoisl

Description

@francoisl

Task

Add new helpers and generalize the Gusto-specific helpers so they work for any HR provider.

Files: src/libs/PolicyUtils.ts, tests/unit/PolicyUtilsTest.ts.

New helpers:

function isMergeHRConnectionName(name: string): name is MergeHRConnectionName {
    return name.startsWith('merge_hr_');
}

function isMergeHRConnected(policy?: OnyxEntry<Policy>, connectionName?: MergeHRConnectionName): boolean;

function getConnectedHRProviders(policy?: OnyxEntry<Policy>): HRProviderInfo[];
// returns [{ connectionName, displayName, iconUrl }, ...] for Gusto + every connected merge_hr_*

Generalize existing Gusto helpers:

  • isGustoConnectedisAnyHRConnected
  • isGustoReadOnlyWorkflowModeisAnyHRReadOnlyWorkflowMode
  • getGustoApprovalModegetHRApprovalMode(policy, connectionName)

Update every call site of the old Gusto-specific names.

Tests: add unit tests for each new helper and each generalization in PolicyUtilsTest.ts.

Dependencies: F1.

Issue OwnerCurrent Issue Owner: @ZhenjaHorbach

Metadata

Metadata

Labels

InternalRequires API changes or must be handled by Expensify staffWeeklyKSv2

Type

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions