Skip to content

[Due for payment 2025-04-25] Update Expensify Card page to potentially show domain feeds #59364

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
puneetlath opened this issue Mar 31, 2025 · 43 comments
Labels
Awaiting Payment Auto-added when associated PR is deployed to production NewFeature Something to build that is a new item. Weekly KSv2

Comments

@puneetlath
Copy link
Contributor

puneetlath commented Mar 31, 2025

Part of the Cross compatible Corporate Cards project

Main issue: https://github.com/Expensify/Expensify/issues/467915
Doc section: https://docs.google.com/document/d/1KHrQgvdZWvCwUkptjjW_oqnl0umyVNiPe7KIHCD1pBA/edit?tab=t.0#heading=h.hkqdtrxioijc

Feature Description

Let's update the Expensify Cards page of the workspace editor to display domain feeds as described in the doc here.

To do this we will need to:

  1. Support showing domain Expensify Card feeds when the current workspace is set as the primary policy for the feed. We will know this is the case if the Expensify Card settings in Onyx have the current workspace set as the preferredPolicy like below.
  2. We should show only the domain feed if there is no workspace Expensify Card feed set up
  3. We should show a feed selector, just like we do on the third party cards page, if there is a workspace feed and some amount of domain feeds. Or if there are multiple domain feeds
  4. Everything else should work just like it currently does

Onyx shape:

{
            "key": "private_expensifyCardSettings_270",
            "onyxMethod": "merge",
            "value": {
                "currentBalance": 0,
                "earnedCashback": 0,
                "isMonthlySettlementAllowed": false,
                "limit": 3000000,
                "marqetaBusinessToken": 270,
                "ownerEmail": "[email protected]",
                "paymentBankAccountID": 1179246,
                "remainingLimit": 3000000,
                "preferredPolicy": "8548D13C46AEFD4B",
}

Manual Test Steps

  1. Create an account that is an admin on domainA and policyB
  2. Add an Expensify Card domain feed to domainA and set policyB as the preferred policy
  3. Open policyB in NewDot and go to the Expensify Cards page
  4. Make sure the feed shows up and you can assign cards, edit the settings, etc
  5. Create a new domainC same account as admin on the domain
  6. Add an Expensify Card domain feed to domainC and set policyB as the preferred policy
  7. Open policyB in NewDot and go to the Expensify Cards page
  8. Make sure both feeds shows up and you can assign cards, edit the settings, etc
  9. Add a workspace Expensify Card feed to policyB
  10. Open policyB in NewDot and go to the Expensify Cards page
  11. Make sure all three feeds shows up and you can assign cards, edit the settings, etc

Automated Tests

tbd

Issue OwnerCurrent Issue Owner: @mallenexpensify / @flaviadefaria
@puneetlath puneetlath added Daily KSv2 NewFeature Something to build that is a new item. labels Mar 31, 2025
Copy link

melvin-bot bot commented Mar 31, 2025

Triggered auto assignment to @flaviadefaria (NewFeature), see https://stackoverflowteams.com/c/expensify/questions/14418#:~:text=BugZero%20process%20steps%20for%20feature%20requests for more details. Please add this Feature request to a GH project, as outlined in the SO.

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Mar 31, 2025
Copy link

melvin-bot bot commented Mar 31, 2025

⚠️ It looks like this issue is labelled as a New Feature but not tied to any GitHub Project. Keep in mind that all new features should be tied to GitHub Projects in order to properly track external CAP software time ⚠️

Copy link

melvin-bot bot commented Mar 31, 2025

Triggered auto assignment to Design team member for new feature review - @shawnborton (NewFeature)

@flaviadefaria flaviadefaria moved this to Second Cohort - HIGH in [#whatsnext] #migrate Mar 31, 2025
@koko57
Copy link
Contributor

koko57 commented Apr 1, 2025

I can start today

@koko57
Copy link
Contributor

koko57 commented Apr 1, 2025

Image

So far I was able to display the cardList when the workspace has domain card with the correct data. The code still needs cleanup, so I won't open any PR today 😅

I have a few questions:

  • should "Issue new card" button be displayed - are we able to issue new domain card from ND?
  • just to make sure - settlement and frequency settings should be available, it should work like for the Expensify Card?
  • should I open one PR for displaying the cards and the card selector (whole feature) or it's better to split into two (or more if necessary)?

@puneetlath
Copy link
Contributor Author

should "Issue new card" button be displayed - are we able to issue new domain card from ND?

Yes! This should work. Let me know if you think there's anything special we need to do to support it.

just to make sure - settlement and frequency settings should be available, it should work like for the Expensify Card?

Yes, all this should be available and work the same.

should I open one PR for displaying the cards and the card selector (whole feature) or it's better to split into two (or more if necessary)?

I think splitting it into multiple smaller PRs sounds good.

@koko57
Copy link
Contributor

koko57 commented Apr 2, 2025

@puneetlath will the policy object have reference to the cards and privateSettings objects like workspaceAccountID?
Now I see it's a bit trickier that we have to rely only on the preferredPolicy from privateSettings.

For both company and Expensify cards we use workspaceAccountID which is a part of the key name and also saved as a fundID in cards. We can easily get it from the policy object and we do in most of the places, like here:
Image

Now I would need to get all the privateSettings and check if the preferredPolicy and policyID match and get this settings when we want to display the settings for the domain card. So for every other place would be the same - I would need to iterate through the private settings object for the domains, while for the workspace cards I can only take workspaceAccountID from the policy object. For domain cards I would need to get the id from the privateSettings key or from marqetaBusinessToken

@koko57
Copy link
Contributor

koko57 commented Apr 2, 2025

ok, I've found a pretty easy solution - instead of creating getExpensifyCardFeeds it would be much easier to get the ID for the cards and settings and use it the same way we use workspaceAccountID - I created a new hook to do that -> https://github.com/Expensify/App/pull/59538/files#diff-afe23066c2035597e25e58c6838b4776281521c5535870d05115cb8b37eb05ce

when we get the ID we can pass it as a part of the key to read the data from Onyx and we get the exact feed we want. The only consideration is - can I use marquetaBusinessToken? Is it always the same as the ID in the 'private_expensifyCardSettings_' and 'cards_'?

@puneetlath
Copy link
Contributor Author

@koko57
Copy link
Contributor

koko57 commented Apr 3, 2025

I've made changes to use the key instead of marquetaBusinessToken. Can we proceed with this solution? If so, I'll open the PR today.
I'm starting working on the selector page.

@puneetlath
Copy link
Contributor Author

Yes sounds good let’s do it. The back-end should also be live soon so that you can test with real data.

@koko57
Copy link
Contributor

koko57 commented Apr 3, 2025

Nice! So I'm opening the frist PR today and I'm continuing working on the Selector.

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Weekly KSv2 labels Apr 3, 2025
@koko57
Copy link
Contributor

koko57 commented Apr 3, 2025

PR ready for the review #59538

@koko57
Copy link
Contributor

koko57 commented Apr 8, 2025

Image

@puneetlath what should be displayed as the text under the Feen name in the selector? How different feeds should be named to diferentiate them in the selector page?

@puneetlath
Copy link
Contributor Author

Let's use the domain name. It should be a key in the card settings.

@DylanDylann
Copy link
Contributor

Yeah, I can help to review #59887

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Apr 15, 2025
@mallenexpensify mallenexpensify self-assigned this Apr 16, 2025
@akinwale
Copy link
Contributor

akinwale commented Apr 16, 2025

Proposed payment breakdown at 2025-04-16
Contributor+: @akinwale $250 via NewDot

cc @mallenexpensify @puneet

@mallenexpensify
Copy link
Contributor

mallenexpensify commented Apr 16, 2025

^ is for PR #59538

Contributor+: @akinwale due $250 via NewDot.

Copy link

melvin-bot bot commented Apr 16, 2025

Payment Summary

Upwork Job

  • Contributor: @VickyStash is from an agency-contributor and not due payment
  • Contributor: @koko57 is from an agency-contributor and not due payment
  • Reviewer: @DylanDylann owed $250 via NewDot

BugZero Checklist (@mallenexpensify)

  • I have verified the correct assignees and roles are listed above and updated the necessary manual offers
  • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants//hired)
  • I have paid out the Upwork contracts or cancelled the ones that are incorrect
  • I have verified the payment summary above is correct

@mallenexpensify mallenexpensify changed the title [Due for payment 2025-04-16] Update Expensify Card page to potentially show domain feeds Update Expensify Card page to potentially show domain feeds Apr 16, 2025
@mallenexpensify
Copy link
Contributor

Waiting on #59887 for next payment/s

Copy link

melvin-bot bot commented Apr 17, 2025

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Apr 18, 2025
@melvin-bot melvin-bot bot changed the title Update Expensify Card page to potentially show domain feeds [Due for payment 2025-04-25] Update Expensify Card page to potentially show domain feeds Apr 18, 2025
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Apr 18, 2025
Copy link

melvin-bot bot commented Apr 18, 2025

Reviewing label has been removed, please complete the "BugZero Checklist".

Copy link

melvin-bot bot commented Apr 18, 2025

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.29-10 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2025-04-25. 🎊

For reference, here are some details about the assignees on this issue:

  • @VickyStash does not require payment (Contractor)
  • @koko57 does not require payment (Contractor)
  • @DylanDylann requires payment through NewDot Manual Requests

Copy link

melvin-bot bot commented Apr 18, 2025

BugZero Checklist: The PR adding this new feature has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

@puneetlath
Copy link
Contributor Author

I think we're about done here. These three issues are the only problems I was able to find when testing.

@JmillsExpensify
Copy link

$250 approved for @akinwale

@flaviadefaria
Copy link
Contributor

[@DylanDylann] Please propose regression test steps to ensure the new feature will work correctly on production in further releases.

@DylanDylann are you going to write a regression test for this issue?

@DylanDylann
Copy link
Contributor

Regression Test - This is a new feature

PREREQUISITES: an account with a domain card set up in the OD, ideally with 2 workspaces in the ND - one with Expensify Card set up, one with no Expensify Card setup

Has an Expensify Card set up

  1. In the OD set this workspace as preferred policy in the domain cards settings
  2. Go to the ND to the workspace that was set as a preferred policy
  3. Verify that the workspace cards are displayed
  4. Verify that you see the feed selector
  5. Verify that after clicking the feed selector the selection page is opened
  6. Verify that you see both workspace and domain options - the workspace cards would have workspace name
  7. After clicking the domain feed, the selector page should close and the domain feed cards should be displayed.
  8. Verify that the settings button is displayed and changing the settings work like for the workspace Expensify Card

@mallenexpensify
Copy link
Contributor

Test case created

Leaving this open for now til we get confirmation we're all done

@puneetlath
Copy link
Contributor Author

puneetlath commented Apr 29, 2025

This is done. We have separate issues for the remaining work.

@mallenexpensify
Copy link
Contributor

@DylanDylann you still need payment for PR review/s, right? I see this one , are there others?

@DylanDylann
Copy link
Contributor

Yes. PLease help handle paymen to me for reviewing #59887

@puneetlath
Copy link
Contributor Author

@mallenexpensify can we close this out now? Or do we need an updated payment summary?

@mallenexpensify
Copy link
Contributor

Contributor+: @DylanDylann due $250 via NewDot for #59887

Now we should be good to close!
Thanks y'all.

@github-project-automation github-project-automation bot moved this from Second Cohort - HIGH to Done in [#whatsnext] #migrate May 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production NewFeature Something to build that is a new item. Weekly KSv2
Projects
Development

No branches or pull requests

10 participants