Skip to content

Add Reimbursable setting to company card feeds - #104160

Merged
Beamanator merged 28 commits into
Expensify:mainfrom
youssef-lr:app-103342-add-reimbursable-setting-company
Nov 2, 2026
Merged

Beamanator merged 28 commits into
Expensify:mainfrom
youssef-lr:app-103342-add-reimbursable-setting-company

Conversation

@youssef-lr

@youssef-lr youssef-lr commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

Let admins choose the Reimbursable rule from company card feed settings. Add the four choices used for cash expenses and show setting changes in the workspace admins room.

Fixed Issues

$ #103342
PROPOSAL:

Tests

  1. Sign in as a workspace admin. Go to Workspaces > select the workspace > Company cards, select a company card feed, and open Settings. Verify Reimbursable appears below Statement close date and above the liability toggle.
  2. Open Reimbursable. Verify the intro reads “Choose how card transactions should be created. New transactions will follow these rules.” Verify these choices appear in order with their descriptions:
    • Always reimbursable: “Always paid back to employees”.
    • Always non-reimbursable: “Never paid back to employees”.
    • Reimbursable: “Most often paid back to employees”.
    • Non-reimbursable: “Occasionally paid back to employees”.
  3. Select a different choice and save. Verify the settings row displays the new choice. Reopen Reimbursable, then reload the app and reopen it again. Verify the saved choice remains selected. Repeat for all four choices.
  4. Change the selection, then leave without saving. Reopen Reimbursable and verify the saved choice is unchanged.
  5. Open the workspace admins room. Verify the change log includes the feed name and the previous and new settings. Recent workspace changes may be grouped in an existing change-log thread.
  6. Repeat the save and reload checks on a direct (OAuth) feed and a feed without OAuth. Verify neither returns to the previous choice after saving.
  7. For a feed shared by two workspaces, open its settings as an admin in each workspace. Change Reimbursable from either workspace and verify the other workspace displays the same saved choice after reloading.
  8. On a feed with no stored Reimbursable value, verify Always non-reimbursable is selected. If a feed with the legacy none value is available, verify Non-reimbursable is selected.
  9. Open Expensify Card settings and verify this Reimbursable row is not shown. For a domain feed, verify saving does not add a workspace change log.
  • Verify that no errors appear in the JS console

Offline tests

  1. Open a company card feed’s Reimbursable page and disconnect from the network.
  2. Choose a different option and save. Verify the settings row immediately displays the new choice with a pending state.
  3. Reconnect. Verify the pending state clears, then reload and reopen Reimbursable. Verify the saved choice remains selected.
  4. To check a failed save, use browser developer tools to block the setting’s save request, then choose a different option and save. Verify the previous choice is restored and an error is shown. Remove the request block, dismiss the error if necessary, and save again. Verify the new choice persists after reloading.

QA Steps

Same as Tests and Offline tests. Use the staging app and accounts with the required company card feeds and workspace admin access.

  • 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 verified any copy / text that was added to the app 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 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 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.
  • If the PR adds or modifies the UI:
    • I asked an AI agent to review the changes for accessibility issues and addressed its findings.
    • I tested with a screen reader (VoiceOver on macOS) and verified all new/changed elements are reachable with a logical focus order.
    • I verified all new/changed elements have meaningful accessible names and roles.
    • I verified state changes are announced (e.g. checked/unchecked, expanded/collapsed, selected).
  • 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

Screen.Recording.2026-10-19.at.16.33.27.mov

@melvin-bot

melvin-bot Bot commented Oct 15, 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

@codecov

codecov Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codecov Report

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

Files with missing lines Coverage Δ
src/CONST/index.ts 95.90% <ø> (ø)
src/SCREENS.ts 100.00% <ø> (ø)
src/libs/API/types.ts 100.00% <ø> (ø)
src/libs/CardFeedUtils.ts 81.60% <100.00%> (+0.37%) ⬆️
src/libs/CardUtils.ts 89.91% <100.00%> (+0.07%) ⬆️
...gation/linkingConfig/RELATIONS/WORKSPACE_TO_RHP.ts 100.00% <ø> (ø)
src/libs/Navigation/linkingConfig/config.ts 62.50% <ø> (ø)
src/libs/ReportAlternateTextUtils.ts 92.27% <100.00%> (+0.03%) ⬆️
src/libs/TransactionUtils/duplicates.ts 90.10% <100.00%> (ø)
src/libs/actions/CompanyCards.ts 54.51% <100.00%> (+1.13%) ⬆️
... and 8 more
... and 58 files with indirect coverage changes

@youssef-lr

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-11-02T09:36:40.958646Z
We couldn’t complete this review. Comment @codex review to try again.
31b167e Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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: 904d55d196

ℹ️ 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/CONST/index.ts Resolved
Comment thread src/libs/actions/CompanyCards.ts Resolved
…ates

- Prefer pending/errored local direct-feed forceReimbursable over stale OAuth values in getCombinedCardFeedsFromAllFeeds
- Preserve the kept managed card's imported reimbursable value in compareDuplicateTransactionFields instead of forcing false
- Add regression tests for both
…setting-company' into app-103342-add-reimbursable-setting-company
@youssef-lr
youssef-lr marked this pull request as ready for review October 19, 2026 16:37
@youssef-lr
youssef-lr requested a review from a team as a code owner October 19, 2026 16:37
@trjExpensify

Copy link
Copy Markdown
Contributor

@getusha what's your ETA on the review? This isn't held.

@getusha

getusha commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Will complete by end of week

@getusha

getusha commented Nov 2, 2026 •

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 any copy / text that was added to the app 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 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
    • 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
    • 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 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.
  • If the PR adds or modifies the UI:
    • I asked an AI agent to review the changes for accessibility issues and addressed its findings.
    • I tested with a screen reader (VoiceOver on macOS) and verified all new/changed elements are reachable with a logical focus order.
    • I verified all new/changed elements have meaningful accessible names and roles.
    • I verified state changes are announced (e.g. checked/unchecked, expanded/collapsed, selected).
  • 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-n.webm
Android: mWeb Chrome
android.webm
iOS: HybridApp
Screen.Recording.iPhone.16.Pro.02-11-2026.at.11.34.07.AM.mp4
Screen.Recording.iPhone.16.Pro.02-11-2026.at.11.34.07.AM.mp4
iOS: mWeb Safari
Screen.Recording.iPhone.16.Pro.02-11-2026.at.10.21.45.AM.mp4
MacOS: Chrome / Safari
Screen.Recording.2026-11-02.at.9.37.23.AM.mov
Screenshot 2026-11-02 at 9 40 03 AM

@getusha

getusha commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Open the workspace admins room. Verify the change log shows the feed name and the previous and new settings.

Screenshot 2026-11-02 at 9 40 03 AM

Is this expected? It shows the change log in the thread

@getusha

getusha commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

@codex @MelvinBot review

@getusha

getusha commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Apologies for the delay. This looks good to me!
@youssef-lr could you please complete the testing steps?

@MelvinBot

Copy link
Copy Markdown
Contributor

Code review

The code looks good overall. I found one issue to check before merge: on direct (OAuth) feeds, the new setting may flip back to the old value after the save succeeds.

Direct feeds may show the old value after a successful save

src/libs/CardFeedUtils.ts:590-604 uses the local companyCards value only while pendingFields.forceReimbursable or errorFields.forceReimbursable is set. successData in src/libs/actions/CompanyCards.ts:1364-1379 clears pendingFields. After that, oAuthAccountDetails.forceReimbursable wins the merge again. No action in the App updates oAuthAccountDetails.

Example: An admin changes a Chase direct feed from "Always non-reimbursable" to "Always reimbursable". The row shows the new value while the save is pending. When the save succeeds, the row goes back to "Always non-reimbursable". It stays that way until the backend sends an updated oAuthAccountDetails.

This only works if SetFeedReimbursable also updates oAuthAccountDetails, and the Auth change is still in progress. Pick one fix:

  • Confirm the backend response updates oAuthAccountDetails.
  • Prefer feedSettings.forceReimbursable whenever it is defined.

The current tests cover only the pending and error states.

Other checks
  • Earlier Codex findings are resolved. The duplicate review now keeps the kept card transaction's reimbursable value. Editing default_yes and default_no on card expenses is tracked in [CFI] [$175] Show the Reimbursable toggle on company card expenses when the card feed is set to Do Not Force.
  • Undefined or empty values become force_no, and legacy none becomes default_no. The save is skipped when the effective value doesn't change, so legacy values aren't overwritten.
  • The change log message uses the server text when the values can't be localized. It shows the new value even when the previous value is missing.
  • The author's test steps still need to be completed, as you noted.

view run

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

Failed to set up container
ℹ️ 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".

@youssef-lr

Copy link
Copy Markdown
Contributor Author

Open the workspace admins room. Verify the change log shows the feed name and the previous and new settings.

Screenshot 2026-11-02 at 9 40 03 AM

Is this expected? It shows the change log in the thread

Yeah this is expected.

@melvin-bot
melvin-bot Bot requested a review from Beamanator November 2, 2026 17:22

@Beamanator Beamanator 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.

LGTM

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

@jponikarchuk

Copy link
Copy Markdown

Deploy Blocker #105804 was identified to be related to this PR.

@OSBotify

OSBotify commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/Beamanator in version: 9.5.31-0 🚀

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

@MelvinBot

MelvinBot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Help site update needed: this PR adds an ungated Reimbursable setting for company card feeds. Add it to the existing Configure Company Card Settings steps.

I couldn’t create the docs PR because the required live UI label verification was blocked by an Update available screen.

Update available screen blocking live label verification


view run · view recording

@OSBotify

OSBotify commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/Beamanator in version: 9.5.31-0 🚀

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

@OSBotify

OSBotify commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/blimpich in version: 9.5.31-4 🚀

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

Bundle Size Analysis (Sentry):

@getusha

getusha commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Looks like automation failed for payment
cc @youssef-lr

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.

8 participants