Skip to content

[No QA] [Merge ATS] Add Recruiting policy types, constants, and actions - #99585

Merged
yuwenmemon merged 13 commits into
Expensify:mainfrom
bernhardoj:feat/99508-ats-const-type-actions
Sep 1, 2026
Merged

yuwenmemon merged 13 commits into
Expensify:mainfrom
bernhardoj:feat/99508-ats-const-type-actions

Conversation

@bernhardoj

@bernhardoj bernhardoj commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

Fixed Issues

$ #99508
PROPOSAL:

Tests

  • Verify that no errors appear in the JS console

Offline tests

QA Steps

// TODO: These must be filled out, or the issue title must include "[No QA]."

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari

@bernhardoj
bernhardoj requested review from a team as code owners August 26, 2026 16:58
@melvin-bot

melvin-bot Bot commented Aug 26, 2026

Copy link
Copy Markdown

Hey, I noticed you changed src/languages/en.ts in a PR from a fork. For security reasons, translations are not generated automatically for PRs from forks.

If you want to automatically generate translations for other locales, an Expensify employee will have to:

  1. Look at the code and make sure there are no malicious changes.
  2. Run the Generate static translations GitHub workflow. If you have write access and the K2 extension, you can simply click: [this button]

Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running:

npx bun ./scripts/generateTranslations.ts --help

Typically, you'd want to translate only what you changed by running npx bun ./scripts/generateTranslations.ts --compare-ref main

@melvin-bot
melvin-bot Bot requested review from flaviadefaria and inimaga and removed request for a team August 26, 2026 16:58
@melvin-bot

melvin-bot Bot commented Aug 26, 2026

Copy link
Copy Markdown

@inimaga Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@bernhardoj

Copy link
Copy Markdown
Contributor Author

Oops, forgot to link the issue. @ishpaul777 and @yuwenmemon will review this.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9d281a214a

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +126 to +130
WRITE_COMMANDS.UPDATE_MERGE_APPROVAL_MODE,
{
policyID,
approvalMode,
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Identify the Merge connection in shared updates

When a workspace has both the newly modeled merge_hris and merge_ats connections, this request contains only policyID and approvalMode, so UpdateMergeApprovalMode cannot determine which connection should be changed. The same ambiguity exists for updateMergeATSFinalApprover, which reuses UpdateMergeFinalApprover with only policyID and finalApprover; meanwhile, the optimistic data updates ATS exclusively. Include the target connection/category or use ATS-specific commands so editing recruiting settings cannot update the HR connection on the server and later overwrite the optimistic ATS state.

Useful? React with 👍 / 👎.

@bernhardoj

bernhardoj commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor Author

@yuwenmemon or @ishpaul777 For ConnectPolicyToMerge, SyncPolicyToMerge, UpdateMergeApprovalMode, and UpdateMergeFinalApprover, is the param name to differentiate between HR and ATS connectionName?

Also, please review the API parameter types for the new ATS APIs.

@@ -0,0 +1,17 @@
import type {ConnectPolicyToMergeParams} from '@libs/API/parameters';

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.

❌ CONSISTENCY-9 (docs)

This new file is named index.ts but it is not a platform-variant barrel — it contains a single real implementation (getMergeSetupLink) as its only (default) export. Per the file-naming philosophy, non-platform files must be named after what they export, never index.ts, so the module is discoverable and searchable by its export name. The sibling files in this same new merge/ folder already follow this (HR.ts, ATS.ts), and the pre-existing connections/index.ts is an established multi-export directory entry point, which does not apply here.

Rename the file to match its export and update the import at src/pages/workspace/hr/utils.ts:

// src/libs/actions/connections/merge/getMergeSetupLink.ts
function getMergeSetupLink(policyID: string, integration: MergeHRProviderSlug | MergeATSProviderSlug) { ... }
export default getMergeSetupLink;
// caller
import getMergeSetupLink from '@libs/actions/connections/merge/getMergeSetupLink';

Reviewed at: 5b9d4e2 | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.

// before mounting the main WebView. No deterministic completion signal is
// available from the incognito session teardown.
cookieTimerRef.current = setTimeout(() => setCookiesCleared(true), CONST.MERGE_HR.COOKIE_CLEAR_DELAY_MS);
cookieTimerRef.current = setTimeout(() => setCookiesCleared(true), CONST.MERGE.COOKIE_CLEAR_DELAY_MS);

This comment was marked as resolved.

@codecov

codecov Bot commented Aug 27, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ Changes either increased or maintained existing code coverage, great job!

Files with missing lines Coverage Δ
src/CONST/MERGE_ATS_PROVIDERS.ts 100.00% <100.00%> (ø)
src/ONYXKEYS.ts 100.00% <ø> (ø)
src/hooks/usePolicyIndicatorChecks.ts 100.00% <ø> (ø)
src/libs/API/types.ts 100.00% <ø> (ø)
src/libs/AccountingUtils.ts 83.87% <ø> (ø)
src/libs/ExportOnyxState/common.ts 80.95% <ø> (ø)
src/libs/PolicyUtils.ts 79.60% <ø> (ø)
src/libs/WorkflowUtils.ts 91.81% <ø> (ø)
src/libs/actions/connections/merge/ATS.ts 100.00% <100.00%> (ø)
src/libs/merge/HRUtils.ts 95.00% <100.00%> (ø)
... and 33 more
... and 14 files with indirect coverage changes

@ishpaul777 ishpaul777 left a comment

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.

This PR bundles scope from four issues. Can you split it along these lines so each is reviewable on its own?

Keep in this PR (#99508 - types, constants, actions):

  • src/types/onyx/Policy.ts, src/ONYXKEYS.ts
  • src/CONST/index.ts, src/CONST/MERGE_ATS_PROVIDERS.ts
  • src/libs/merge/RecruitingUtils.ts, MergeUtils.ts, HRUtils.ts
  • src/libs/actions/connections/merge/ATS.ts, HR.ts, index.ts
  • src/libs/actions/connections/index.ts
  • src/libs/API/parameters/{ConnectPolicyToMergeParams,UpdateMergeApprovalModeParams,UpdateMergeATSApproverFieldParams,UpdateMergeATSFiltersParams,index}.ts
  • src/libs/API/types.ts
  • tests/unit/{RecruitingUtilsTest,MergeUtilsTest,HrUtilsTest}.ts

Split into #99511 (generalize the Merge connection UI):

  • src/pages/workspace/hr/** (all pages/utils touched)
  • src/components/ConnectToHRFlow/index.native.tsx, HRSyncResultsModal.tsx
  • src/hooks/useMergeHRInitialSyncingModal.ts
  • src/libs/PolicyUtils.ts, AccountingUtils.ts, ExportOnyxState/common.ts
  • src/selectors/Policy.ts
  • tests/unit/PolicyUtilsTest.ts

Split into #99514 (Workflows recognize merge_ats):

  • src/pages/workspace/workflows/**
  • src/libs/WorkflowUtils.ts, tests/unit/WorkflowUtilsTest.ts

Split into #99510 (More Features / workspace menu):

  • src/pages/workspace/WorkspaceMoreFeaturesPage/index.tsx, WorkspaceMembersPage.tsx
  • src/pages/workspace/getWorkspaceMenuItems.ts
  • src/hooks/usePolicyIndicatorChecks.ts
  • tests/unit/{getWorkspaceMenuItemsTest,usePolicyIndicatorChecksTest,useWorkspacesTabIndicatorStatusTest}.ts

@ishpaul777

Copy link
Copy Markdown
Contributor

For ConnectPolicyToMerge, SyncPolicyToMerge, UpdateMergeApprovalMode, and UpdateMergeFinalApprover, is the param name to differentiate between HR and ATS connectionName?

yes but ConnectPolicyToMerge, UpdateMergeApprovalMode, UpdateMergeFinalApprover, and RemovePolicyConnection don't accept connectionName on the backend yet - that's tracked in #675419.

@bernhardoj

bernhardoj commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor Author

They are mostly just renaming and moving the files for types, constants, and actions (for example, CONST.MERGE_HR to CONST.MERGE, so all usages need to be renamed; it doesn't make sense if we keep the CONST changes but not the other files, as suggested above). I think it's better to prepare it here so we don't end up with big file changes in the UI implementation PR later.

yes but ConnectPolicyToMerge, UpdateMergeApprovalMode, UpdateMergeFinalApprover, and RemovePolicyConnection don't accept connectionName on the backend yet - that's tracked in #675419.

Can I generalize SyncPolicyToMerge, UpdateMergeApprovalMode, and UpdateMergeFinalApprover (and optionally pass connectionName to them) in this PR?

@bernhardoj

Copy link
Copy Markdown
Contributor Author

I'll comment out the ATS actions and utils to avoid the knip failure and explain that we will use them later; don't remove them. Are we fine with that?

@inimaga
inimaga requested review from yuwenmemon and removed request for inimaga August 27, 2026 11:03
@ishpaul777

Copy link
Copy Markdown
Contributor

Can I generalize SyncPolicyToMerge, UpdateMergeApprovalMode, and UpdateMergeFinalApprover (and optionally pass connectionName to them) in this PR?

yes that works 👍

I'll comment out the ATS actions and utils to avoid the knip failure and explain that we will use them later; don't remove them. Are we fine with that?

makes sense to me

@ishpaul777
ishpaul777 requested a review from DylanDylann August 27, 2026 13:52
@bernhardoj

Copy link
Copy Markdown
Contributor Author

I ended up creating a unit test for the unused export to fix the knip check.

@DylanDylann

Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: de177121bc

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/types/onyx/Policy.ts
[CONST.POLICY.CONNECTIONS.NAME.MERGE_HR]: Connection<MergeHRConnectionData, MergeHRConnectionConfig, MergeConnectionLastSync>;

/** Merge ATS (recruiting) integration connection */
[CONST.POLICY.CONNECTIONS.NAME.MERGE_ATS]: Connection<MergeATSConnectionData, MergeATSConnectionConfig, MergeConnectionLastSync>;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Exclude ATS from accounting-only connection checks

When a workspace has only the new merge_ats connection, it now has a nonempty policy.connections, but several existing accounting checks equate that with having an accounting integration. For example, WorkspaceCategoriesPage.tsx:434-438 and DynamicWorkspaceViewTagsPage.tsx:222-224 then suppress category/tag deletion, and the corresponding single-item settings pages do the same. Filter these checks through ACCOUNTING_CONNECTION_NAMES so connecting a recruiting provider does not disable unrelated workspace controls.

Useful? React with 👍 / 👎.

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.

The review makes sense, but this is already happening with HR, so out of scope

@DylanDylann

Copy link
Copy Markdown
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: HybridApp
Android: mWeb Chrome
iOS: HybridApp
iOS: mWeb Safari
MacOS: Chrome / Safari

@DylanDylann DylanDylann left a comment

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.

Everything looks solid. This PR only implements utils/helpers, so there's no new behavior to test. These functions will be tested in the follow-up PRs that actually use them

@bernhardoj

Copy link
Copy Markdown
Contributor Author

@yuwenmemon this is ready to merge.

@yuwenmemon
yuwenmemon merged commit 896f5d3 into Expensify:main Sep 1, 2026
35 of 36 checks passed
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

🚧 yuwenmemon has triggered a test Expensify/App build. You can view the workflow run here.

@OSBotify

OSBotify commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify OSBotify mentioned this pull request Sep 2, 2026
82 tasks done
@OSBotify

OSBotify commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/yuwenmemon in version: 9.4.66-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@OSBotify

OSBotify commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/yuwenmemon in version: 9.4.68-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 cancelled 🔪

@OSBotify

OSBotify commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/francoisl in version: 9.4.68-1 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants