Skip to content

[Due for payment 2025-05-27] Update OpenPolicyCompanyCardsFeed to include domainAccountID for domain feeds #60978

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 Apr 28, 2025 · 28 comments
Assignees
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 Apr 28, 2025

Part of the Cross Compatible Corporate Cards project

Main issue: https://github.com/Expensify/Expensify/issues/467915

Feature Description

We need to update the OpenPolicyCompanyCardsFeed API command to pass the domainAccountID when attempting to get the cards for a domain feed. That way the API can know that we want the domain feed cards and not the workspace feed cards and return them.

cc @VickyStash @koko57

Issue OwnerCurrent Issue Owner: @RachCHopkins
@puneetlath puneetlath added Daily KSv2 NewFeature Something to build that is a new item. labels Apr 28, 2025
Copy link

melvin-bot bot commented Apr 28, 2025

Triggered auto assignment to @RachCHopkins (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 Apr 28, 2025
@VickyStash
Copy link
Contributor

@puneetlath, have the BE updates been implemented yet?

@puneetlath
Copy link
Contributor Author

Not yet. I'm working on them today.

@puneetlath
Copy link
Contributor Author

@VickyStash looks like we will also need to update OpenAssignFeedCardPage. On the back-end, both OpenAssignFeedCardPage and OpenPolicyCompanyCardsFeed call the same API which returns the same data.

@VickyStash
Copy link
Contributor

I'm going to be OOO 1-5th of May 🌴
So me or @koko57 will work on it after that!

@puneetlath
Copy link
Contributor Author

This is live on staging now.

@DylanDylann would you be interested in implementing it since @VickyStash and @koko57 are OOO?

@DylanDylann
Copy link
Contributor

Sure

@puneetlath puneetlath self-assigned this May 1, 2025
@puneetlath
Copy link
Contributor Author

Ok, great!

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

@DylanDylann @puneetlath I guess something was missed during the updates implementation. I see the card is returned by the API, but it doesn't display the list.

Image

I think it's because the app tries to get the cards using ${ONYXKEYS.COLLECTION.WORKSPACE_CARDS_LIST}${workspaceAccountID}_${selectedFeed} onyx key, but the cards are stored not under workspaceAccountID but under domainAccountID.


Another potential problem I've noticed is that useDefaultFundID hook tries to get domainFundID from Expensify cards settings only. I guess there can be a case when there are no Expensify cards in the domain, but there are some third-party cards.
@puneetlath Is it possible that cards from two different domains will have one policy set as preferred?

@puneetlath
Copy link
Contributor Author

I think it's because the app tries to get the cards using ${ONYXKEYS.COLLECTION.WORKSPACE_CARDS_LIST}${workspaceAccountID}_${selectedFeed} onyx key, but the cards are stored not under workspaceAccountID but under domainAccountID.

Good find. Can we update that?

Another potential problem I've noticed is that useDefaultFundID hook tries to get domainFundID from Expensify cards settings only. I guess there can be a case when there are no Expensify cards in the domain, but there are some third-party cards.
@puneetlath Is it possible that cards from two different domains will have one policy set as preferred?

Yes it is possible. There can be any number of domain feeds from any number of domains that will have this policy set as preferred.

@VickyStash
Copy link
Contributor

Okay, so it sounds like both things need to be updated.
@DylanDylann Let me know if you want to do it as a follow up of your PR, otherwise I can take a look at it on Thursday!

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels May 7, 2025

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

@puneetlath puneetlath changed the title [Due for payment 2025-05-14] Update OpenPolicyCompanyCardsFeed to include domainAccountID for domain feeds Update OpenPolicyCompanyCardsFeed to include domainAccountID for domain feeds May 7, 2025
@puneetlath
Copy link
Contributor Author

This is not ready for payment. There's still more to do here as described here and here.

@VickyStash
Copy link
Contributor

Updates:

  • fixed useDefaultFundID hook (this issue)
  • implemented useCardsList hook to fix the domain cards display
  • created Draft PR with updates

TODOs:

  • I need to look through the app for places where company cards are updated optimistically, to make sure the right onyx key is used (with domainID or workspaceAccountID), depending on the card.
  • Test the updates and prepare the PR for review.

@VickyStash
Copy link
Contributor

Updates:

  • Updated getAllCardsForWorkspace function to return domain cards as well
  • Fixed lint errors

I haven't had enough time today to finalize the PR, but I'll do my best to open it for review on Monday

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Weekly KSv2 labels May 12, 2025
@VickyStash
Copy link
Contributor

The PR is ready for review: #61706

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels May 13, 2025
Copy link

melvin-bot bot commented May 16, 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.

Copy link

melvin-bot bot commented May 20, 2025

@VickyStash Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels May 20, 2025
@melvin-bot melvin-bot bot changed the title Update OpenPolicyCompanyCardsFeed to include domainAccountID for domain feeds [Due for payment 2025-05-27] Update OpenPolicyCompanyCardsFeed to include domainAccountID for domain feeds May 20, 2025
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label May 20, 2025
Copy link

melvin-bot bot commented May 20, 2025

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

Copy link

melvin-bot bot commented May 20, 2025

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.46-12 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-05-27. 🎊

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

Copy link

melvin-bot bot commented May 20, 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:

  • [@DylanDylann] Please propose regression test steps to ensure the new feature will work correctly on production in further releases.
  • [@RachCHopkins] Link the GH issue for creating/updating the regression test once above steps have been agreed upon.

@RachCHopkins
Copy link
Contributor

@puneetlath what is the pricetag here? Is it a standard $250?

@puneetlath
Copy link
Contributor Author

Yes, that's correct.

@DylanDylann
Copy link
Contributor

Regression Test

Part 1:

  1. Open the Company Cards page. Make sure the assigned feeds are displayed.
  2. Open any feed.
  3. Make sure the list of assigned cards is displayed.
  4. Try to open any card. Make sure you see the details.
  5. Try to assign a new card to the feed.
  6. Go to the workspace members. Open any. member page and see that the cards assigned to that member are displayed.

Part 2:

  1. Have a workspace A without Expensify cards.
  2. In the OD, open domain exensify cards and set preferred policy as workspace A.
  3. In the ND open workspace A open Expensify cards section and make sure domain cards are visible.

@RachCHopkins
Copy link
Contributor

Payment Summary:

  • Contributor: @VickyStash no payment required
  • Contributor+: @DylanDylann to be paid $250 via NewDot Manual Request

No upwork job.

@RachCHopkins
Copy link
Contributor

No one to pay via upwork and no jobs to close.

@github-project-automation github-project-automation bot moved this from Second Cohort - HIGH to Done in [#whatsnext] #migrate May 27, 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

4 participants