diff --git a/cspell.json b/cspell.json index 98a0d89cf024..10da22848929 100644 --- a/cspell.json +++ b/cspell.json @@ -931,7 +931,9 @@ "lintrk", "Fbclid", "Gclid", - "autocorrection" + "autocorrection", + "BambooHr", + "HiBob" ], "ignorePaths": [ ".gitignore", diff --git a/src/CONST/MERGE_HR_PROVIDERS.ts b/src/CONST/MERGE_HR_PROVIDERS.ts new file mode 100644 index 000000000000..ed9bc6376d57 --- /dev/null +++ b/src/CONST/MERGE_HR_PROVIDERS.ts @@ -0,0 +1,27 @@ +type MergeHRProviderEntry = { + /** Human-readable label used in the UI */ + displayName: string; + + /** Provider logo served from the Merge CDN */ + iconUrl: string; +}; + +const MERGE_HR_PROVIDERS = { + workday: { + displayName: 'Workday', + iconUrl: 'https://merge-api-public.s3.amazonaws.com/media/PlatformWorkday.png', + }, + bamboohr: { + displayName: 'BambooHR', + iconUrl: 'https://merge-api-public.s3.amazonaws.com/media/BambooHR_Square_Logo.jpg', + }, + hibob: { + displayName: 'HiBob', + iconUrl: 'https://merge-api-public.s3.amazonaws.com/media/PlatformHibob.png', + }, +} as const satisfies Record; + +type MergeHRProviderSlug = keyof typeof MERGE_HR_PROVIDERS; + +export type {MergeHRProviderSlug}; +export default MERGE_HR_PROVIDERS; diff --git a/src/CONST/index.ts b/src/CONST/index.ts index 7c18d7f37175..4180862c1b31 100644 --- a/src/CONST/index.ts +++ b/src/CONST/index.ts @@ -2885,6 +2885,14 @@ const CONST = { }, }, + MERGE_HR: { + APPROVAL_MODE: { + BASIC: 'basic', + MANAGER: 'manager', + CUSTOM: 'custom', + }, + }, + QUICKBOOKS_REIMBURSABLE_ACCOUNT_TYPE: { VENDOR_BILL: 'bill', CHECK: 'check', @@ -3822,6 +3830,7 @@ const CONST = { CERTINIA: 'financialforce', GUSTO: 'gusto', ZENEFITS: 'zenefits', + MERGE_HR: 'merge_hris', }, SUPPORTED_ONLY_ON_OLDDOT: { FINANCIALFORCE: 'financialforce', @@ -3838,6 +3847,7 @@ const CONST = { CERTINIA: 'certinia', GUSTO: 'gusto', ZENEFITS: 'zenefits', + MERGE_HR: 'merge-hr', }, NAME_USER_FRIENDLY: { netsuite: 'NetSuite', @@ -3853,12 +3863,13 @@ const CONST = { oracle: 'Oracle', microsoftDynamics: 'Microsoft Dynamics', other: 'Other', + merge_hris: 'Merge HR', }, get ACCOUNTING_CONNECTION_NAMES() { return [this.NAME.QBO, this.NAME.QBD, this.NAME.XERO, this.NAME.NETSUITE, this.NAME.SAGE_INTACCT, this.NAME.CERTINIA] as const; }, get HR_CONNECTION_NAMES() { - return [this.NAME.GUSTO, this.NAME.ZENEFITS] as const; + return [this.NAME.GUSTO, this.NAME.ZENEFITS, this.NAME.MERGE_HR] as const; }, get EXPORTED_TO_INTEGRATION_DISPLAY_NAMES(): string[] { return this.ACCOUNTING_CONNECTION_NAMES.map((name) => this.NAME_USER_FRIENDLY[name as keyof typeof this.NAME_USER_FRIENDLY]); diff --git a/src/libs/AccountingUtils.ts b/src/libs/AccountingUtils.ts index 2068ee4337c0..ab9fb9063fc1 100644 --- a/src/libs/AccountingUtils.ts +++ b/src/libs/AccountingUtils.ts @@ -11,6 +11,7 @@ const ROUTE_NAME_MAPPING = { [CONST.POLICY.CONNECTIONS.ROUTE.CERTINIA]: CONST.POLICY.CONNECTIONS.NAME.CERTINIA, [CONST.POLICY.CONNECTIONS.ROUTE.GUSTO]: CONST.POLICY.CONNECTIONS.NAME.GUSTO, [CONST.POLICY.CONNECTIONS.ROUTE.ZENEFITS]: CONST.POLICY.CONNECTIONS.NAME.ZENEFITS, + [CONST.POLICY.CONNECTIONS.ROUTE.MERGE_HR]: CONST.POLICY.CONNECTIONS.NAME.MERGE_HR, }; const NAME_ROUTE_MAPPING = { @@ -22,6 +23,7 @@ const NAME_ROUTE_MAPPING = { [CONST.POLICY.CONNECTIONS.NAME.CERTINIA]: CONST.POLICY.CONNECTIONS.ROUTE.CERTINIA, [CONST.POLICY.CONNECTIONS.NAME.GUSTO]: CONST.POLICY.CONNECTIONS.ROUTE.GUSTO, [CONST.POLICY.CONNECTIONS.NAME.ZENEFITS]: CONST.POLICY.CONNECTIONS.ROUTE.ZENEFITS, + [CONST.POLICY.CONNECTIONS.NAME.MERGE_HR]: CONST.POLICY.CONNECTIONS.ROUTE.MERGE_HR, }; const STANDARD_EXPORT_TEMPLATE_NAME_MAPPING = { diff --git a/src/types/onyx/Policy.ts b/src/types/onyx/Policy.ts index 808d698b9e2e..166dda48a04a 100644 --- a/src/types/onyx/Policy.ts +++ b/src/types/onyx/Policy.ts @@ -3,6 +3,7 @@ import type {ValueOf} from 'type-fest'; import type {GustoSyncResult} from '@libs/API/GustoSyncResult'; import type CONST from '@src/CONST'; import type {Country} from '@src/CONST'; +import type {MergeHRProviderSlug} from '@src/CONST/MERGE_HR_PROVIDERS'; import type * as OnyxTypes from '.'; import type * as OnyxCommon from './OnyxCommon'; import type {WorkspaceTravelSettings} from './TravelSettings'; @@ -1517,12 +1518,9 @@ type FinancialForceConnectionConfig = OnyxCommon.OnyxValueWithOfflineFeedback< /** Gusto connection data */ type GustoConnectionData = Record; -/** Gusto connection config */ -type GustoConnectionConfig = OnyxCommon.OnyxValueWithOfflineFeedback< +/** Shared config for HR integrations (Gusto, Merge HR) */ +type HRConnectionConfigBase = OnyxCommon.OnyxValueWithOfflineFeedback< { - /** Gusto approval mode */ - approvalMode: ValueOf | null; - /** Workspace member who acts as the final approver */ finalApprover: string | null; @@ -1532,26 +1530,35 @@ type GustoConnectionConfig = OnyxCommon.OnyxValueWithOfflineFeedback< 'approvalMode' | 'finalApprover' >; +/** Gusto connection config */ +type GustoConnectionConfig = HRConnectionConfigBase & { + /** Approval mode */ + approvalMode: ValueOf | null; +}; + +/** Merge HR connection data */ +type MergeHRConnectionData = Record; + +/** Merge HR connection config */ +type MergeHRConnectionConfig = HRConnectionConfigBase & { + /** Integration provider slug */ + integration: MergeHRProviderSlug; + + /** Approval mode */ + approvalMode: ValueOf | null; +}; + /** TriNet (Zenefits) connection data */ type ZenefitsConnectionData = Record; /** TriNet (Zenefits) connection config */ -type ZenefitsConnectionConfig = OnyxCommon.OnyxValueWithOfflineFeedback< - { - /** Zenefits approval mode */ - approvalMode: ValueOf | null; - - /** Workspace member who acts as the final approver */ - finalApprover: string | null; - - /** Whether the connection has been configured */ - isConfigured: boolean; +type ZenefitsConnectionConfig = HRConnectionConfigBase & { + /** Zenefits approval mode */ + approvalMode: ValueOf | null; - /** Collections of form field errors */ - errorFields?: OnyxCommon.ErrorFields; - }, - 'approvalMode' | 'finalApprover' ->; + /** Whether the connection has been configured */ + isConfigured: boolean; +}; /** * Data imported from QuickBooks Desktop. @@ -1689,6 +1696,9 @@ type Connections = { /** TriNet (Zenefits) integration connection */ [CONST.POLICY.CONNECTIONS.NAME.ZENEFITS]: Connection; + + /** Merge HR integration connection */ + [CONST.POLICY.CONNECTIONS.NAME.MERGE_HR]: Connection; }; /** All integration connections, including unsupported ones */