feat: Single-use and Expire-by virtual cards#80210
Conversation
|
Hey, I noticed you changed If you want to automatically generate translations for other locales, an Expensify employee will have to:
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 ts-node ./scripts/generateTranslations.ts --helpTypically, you'd want to translate only what you changed by running |
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
@dukenv0307 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] |
| @@ -73,9 +76,12 @@ function CardNameStep({policyID, stepNames, startStepIndex}: CardNameStepProps) | |||
| setIssueNewCardStepAndData({step: CONST.EXPENSIFY_CARD.STEP.CONFIRMATION, isEditing: false, policyID}); | |||
There was a problem hiding this comment.
❌ PERF-8 (docs)
The KeyboardUtils.dismiss() promise handling should be done directly in the event handler without useCallback wrapping just for Promise handling. The async keyboard dismissal creates an unnecessary effect-like pattern when this could be handled synchronously or with a simpler approach.
Suggested fix:
Consider refactoring to handle the keyboard dismissal and navigation more directly, or ensure the pattern is necessary for the UX flow.
Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 193939d27d
ℹ️ 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".
There was a problem hiding this comment.
Clear expiry dates when toggle is off
If a user turns on “Set expiry date”, selects dates, then turns the toggle off before saving, this submit path passes data: undefined, which means previously stored validFrom/validThru stay in Onyx (setIssueNewCardStepAndData merges rather than clearing). The confirmation step will still show an expiration, and issueExpensifyCard will send the stale dates. This makes it impossible to remove expiration once set. Consider explicitly clearing validFrom/validThru when expirationToggle is false.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
It's correct, I updated.
|
@nkdengineer I'm requesting to view the design docs. In the meantime, can you please remove WIP in the PR title and check the bot's comments above? Thanks |
c589a7a to
193939d
Compare
|
Screen.Recording.2026-01-27.at.00.34.39.mov |
|
Use account without singleUseAndExpireByCards beta, the 4th step is checked automatically eventhough we don't complete it Screen.Recording.2026-01-27.at.00.51.10.mov |
trjExpensify
left a comment
There was a problem hiding this comment.
Core PR for a whatsnext project 👍
|
Thanks @shawnborton and @nkdengineer for handling these design iterations and being reactive! |
|
Sweet - all good on my end 👍 |
|
@nkdengineer can you please merge main? |
|
@dukenv0307 Done. |
|
@lakchote We're good to merge the first PR now. |
src/libs/actions/Card.ts
Outdated
There was a problem hiding this comment.
@nkdengineer there's a timezone mismatch.
Per the design doc, validity dates should be interpreted in the assignee’s timezone (valid through 11:59 PM assignee local time on the expiration date) cc @zanyrenney @JmillsExpensify:

In code, validFrom/validThru are currently normalized using issuer's local timezone
Can we switch this conversion to use the assignee's timezone before converting to UTC?
There was a problem hiding this comment.
@nkdengineer thank you. I've requested some other changes.
There was a problem hiding this comment.
minDate={new Date()} is device-local, so the assignee timezone boundary can still be off by one day. We should derive minDate from the assignee’s current date in their timezone.
| process.env.TZ = originalTZ; | ||
| }); | ||
|
|
||
| it('should return midnight local time as UTC in DB format when timeZone is UTC', () => { |
There was a problem hiding this comment.
Could you please add tests for non-UTC timezone?
|
It's looking good. @dukenv0307 can you review the last batch of changes please? Then if everything looks good to you too, I'll approve. |
|
@lakchote looks good and works well. We're good to merge |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 @lakchote has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/lakchote in version: 9.3.16-0 🚀
|
|
🚀 Deployed to production by https://github.com/lakchote in version: 9.3.16-9 🚀
|
Explanation of Change
Fixed Issues
#77672
PROPOSAL:
Tests
Precondition:
singleUseAndExpireByCardsbeta is enabled, and the workspace is connected to a bank accountSet expiry datestepSet expiry datetogglevalidFromandvalidThruparams are sent to the backendOffline tests
None
QA Steps
Same as test
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2026-01-27.at.13.58.30.mov