Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,9 @@
"lintrk",
"Fbclid",
"Gclid",
"autocorrection"
"autocorrection",
"BambooHr",
"HiBob"
],
"ignorePaths": [
".gitignore",
Expand Down
27 changes: 27 additions & 0 deletions src/CONST/MERGE_HR_PROVIDERS.ts
Original file line number Diff line number Diff line change
@@ -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',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these be saved and served locally?

NAB, we can deal with this when we start serving them in app

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we settled on using the merge's url in the design doc to not increase the bundle

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

},
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<string, MergeHRProviderEntry>;

type MergeHRProviderSlug = keyof typeof MERGE_HR_PROVIDERS;

export type {MergeHRProviderSlug};
export default MERGE_HR_PROVIDERS;
13 changes: 12 additions & 1 deletion src/CONST/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -3822,6 +3830,7 @@ const CONST = {
CERTINIA: 'financialforce',
GUSTO: 'gusto',
ZENEFITS: 'zenefits',
MERGE_HR: 'merge_hris',
},
SUPPORTED_ONLY_ON_OLDDOT: {
FINANCIALFORCE: 'financialforce',
Expand All @@ -3838,6 +3847,7 @@ const CONST = {
CERTINIA: 'certinia',
GUSTO: 'gusto',
ZENEFITS: 'zenefits',
MERGE_HR: 'merge-hr',
},
NAME_USER_FRIENDLY: {
netsuite: 'NetSuite',
Expand All @@ -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]);
Expand Down
2 changes: 2 additions & 0 deletions src/libs/AccountingUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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 = {
Expand Down
50 changes: 30 additions & 20 deletions src/types/onyx/Policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -1517,12 +1518,9 @@ type FinancialForceConnectionConfig = OnyxCommon.OnyxValueWithOfflineFeedback<
/** Gusto connection data */
type GustoConnectionData = Record<string, never>;

/** Gusto connection config */
type GustoConnectionConfig = OnyxCommon.OnyxValueWithOfflineFeedback<
/** Shared config for HR integrations (Gusto, Merge HR) */
type HRConnectionConfigBase = OnyxCommon.OnyxValueWithOfflineFeedback<
{
/** Gusto approval mode */
approvalMode: ValueOf<typeof CONST.GUSTO.APPROVAL_MODE> | null;

/** Workspace member who acts as the final approver */
finalApprover: string | null;

Expand All @@ -1532,26 +1530,35 @@ type GustoConnectionConfig = OnyxCommon.OnyxValueWithOfflineFeedback<
'approvalMode' | 'finalApprover'
>;

/** Gusto connection config */
type GustoConnectionConfig = HRConnectionConfigBase & {
/** Approval mode */
approvalMode: ValueOf<typeof CONST.GUSTO.APPROVAL_MODE> | null;
};

/** Merge HR connection data */
type MergeHRConnectionData = Record<string, never>;

/** Merge HR connection config */
type MergeHRConnectionConfig = HRConnectionConfigBase & {
/** Integration provider slug */
integration: MergeHRProviderSlug;

/** Approval mode */
approvalMode: ValueOf<typeof CONST.MERGE_HR.APPROVAL_MODE> | null;
};

/** TriNet (Zenefits) connection data */
type ZenefitsConnectionData = Record<string, never>;

/** TriNet (Zenefits) connection config */
type ZenefitsConnectionConfig = OnyxCommon.OnyxValueWithOfflineFeedback<
{
/** Zenefits approval mode */
approvalMode: ValueOf<typeof CONST.ZENEFITS.APPROVAL_MODE> | 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<typeof CONST.ZENEFITS.APPROVAL_MODE> | null;

/** Collections of form field errors */
errorFields?: OnyxCommon.ErrorFields;
},
'approvalMode' | 'finalApprover'
>;
/** Whether the connection has been configured */
isConfigured: boolean;
};

/**
* Data imported from QuickBooks Desktop.
Expand Down Expand Up @@ -1689,6 +1696,9 @@ type Connections = {

/** TriNet (Zenefits) integration connection */
[CONST.POLICY.CONNECTIONS.NAME.ZENEFITS]: Connection<ZenefitsConnectionData, ZenefitsConnectionConfig>;

/** Merge HR integration connection */
[CONST.POLICY.CONNECTIONS.NAME.MERGE_HR]: Connection<MergeHRConnectionData, MergeHRConnectionConfig>;
};

/** All integration connections, including unsupported ones */
Expand Down
Loading