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:
isGustoConnected → isAnyHRConnected
isGustoReadOnlyWorkflowMode → isAnyHRReadOnlyWorkflowMode
getGustoApprovalMode → getHRApprovalMode(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 Owner
Current Issue Owner: @ZhenjaHorbach
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:
Generalize existing Gusto helpers:
isGustoConnected→isAnyHRConnectedisGustoReadOnlyWorkflowMode→isAnyHRReadOnlyWorkflowModegetGustoApprovalMode→getHRApprovalMode(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 Owner
Current Issue Owner: @ZhenjaHorbach