Skip to content
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

[HOLD for payment 2024-03-14] [$500] [P2P Distance] Enable P2P/Splits in App #36984

Closed
neil-marcellini opened this issue Feb 21, 2024 · 33 comments
Assignees
Labels
Engineering External Added to denote the issue can be worked on by a contributor NewFeature Something to build that is a new item. Reviewing Has a PR in review Weekly KSv2

Comments

@neil-marcellini
Copy link
Contributor

neil-marcellini commented Feb 21, 2024

Enable P2P/Splits in App following this plan

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0165a75cb62ec4b3a6
  • Upwork Job ID: 1760135587374198784
  • Last Price Increase: 2024-02-21
  • Automatic offers:
    • alitoshmatov | Reviewer | 0
    • tienifr | Contributor | 0
Issue OwnerCurrent Issue Owner: @alitoshmatov
@neil-marcellini neil-marcellini added Engineering Daily KSv2 External Added to denote the issue can be worked on by a contributor labels Feb 21, 2024
@melvin-bot melvin-bot bot changed the title [P2P Distance] Enable P2P/Splits in App [$500] [P2P Distance] Enable P2P/Splits in App Feb 21, 2024
Copy link

melvin-bot bot commented Feb 21, 2024

Job added to Upwork: https://www.upwork.com/jobs/~0165a75cb62ec4b3a6

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Feb 21, 2024
Copy link

melvin-bot bot commented Feb 21, 2024

Triggered auto assignment to Contributor-plus team member for initial proposal review - @alitoshmatov (External)

@neil-marcellini neil-marcellini added the NewFeature Something to build that is a new item. label Feb 21, 2024
Copy link

melvin-bot bot commented Feb 21, 2024

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Feb 21, 2024
@neil-marcellini neil-marcellini self-assigned this Feb 21, 2024
@tienifr
Copy link
Contributor

tienifr commented Feb 21, 2024

Proposal

Please re-state the problem that we are trying to solve in this issue.

Enable P2P/Splits in App following this plan

What is the root cause of that problem?

This is new feature

What changes do you think we should make in order to solve the problem?

  1. Edit startMoneyRequest_temporaryForRefactor to save comment.customUnit.customUnitRateID in transactionDraft
  • When starting the transaction flow in startMoneyRequest_temporaryForRefactor, set the comment.customUnit.customUnitRateID
  • If isPolicyExpenseChat, use the ID from NVP.LAST_SELECTED_DISTANCE_RATES if present
  • Otherwise, fallback to Default policy rate ID
  • For P2P requests set the constant in src/CONST.ts under CUSTOM_UNITS.FAKE_P2P_ID (FAKE_P2P_ID can be defined to a value like __fake_p2p_id__)
  1. Enable splits by changing below conditions (for now enable for beta ‘p2pDistanceRequests’)
  • Define a canUseP2pDistanceRequests method
return !!betas?.includes(CONST.BETAS.P2P_DISTANCE_REQUESTS) || canUseAllBetas(betas);
  • Change this param and this to canUseP2pDistanceRequests() || iouRequestType !== CONST.IOU.REQUEST_TYPE.DISTANCE to prevent filtering out 1:1 chats
  • Change this to below so it will always be true if p2pDistanceRequests is enabled
const isAllowedToSplit = canUseP2pDistanceRequests() || iouRequestType !== CONST.IOU.REQUEST_TYPE.DISTANCE;
  1. Enable distance field for splits (for now for beta)
disabled={didConfirm || (canUseP2pDistanceRequests() || !isTypeRequest)}
  • Change the iouMerchant we’re displaying now for the converted distance
    the distance is currently a value in meters so it’s necessary to convert it to proper units and display unit string
    create another util function: DistanceRequestUtils.getDistanceForDisplay that returns converted distance with unit string (km/miles)
    the field already navigates to the distance page
  1. After the above changes, the Distance field in the confirmation list will show Route pending... because the rate logic is not built yet, the rate logic is already covered in the scope of New Rate Field part so I think we're ok with that UX here.

  2. The back-end needs to be updated to support the P2P distance request as well, because currently the API is returning "Distance requests can only be sent in a workspace chat" error in this case

Above should be the core changes required, this is a quite large feature so of course there'll be things we need to further polish during the PR.

What alternative solutions did you explore? (Optional)

NA

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Feb 21, 2024
@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Feb 21, 2024
Copy link

melvin-bot bot commented Feb 21, 2024

📣 @alitoshmatov 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

Copy link

melvin-bot bot commented Feb 21, 2024

📣 @tienifr 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@neil-marcellini
Copy link
Contributor Author

Fast tracking this because we don't really need proposals given that I trust @tienifr to implement the plan well.

@koko57
Copy link
Contributor

koko57 commented Feb 22, 2024

Commenting to help with the review.

@neil-marcellini
Copy link
Contributor Author

@tienifr ETA for the PR?

@tienifr
Copy link
Contributor

tienifr commented Feb 22, 2024

This is a new feature so it requires careful testing. Also I need to review the design doc very carefully. I'll open the PR tomorrow.

@tienifr
Copy link
Contributor

tienifr commented Feb 25, 2024

@neil-marcellini Can I take a look at the NVP.LAST_SELECTED_DISTANCE_RATES structure? We need to define the type and new onyx key for it.

@koko57
Copy link
Contributor

koko57 commented Feb 26, 2024

Can I take a look at the NVP.LAST_SELECTED_DISTANCE_RATES structure? We need to define the type and new onyx key for it.

There's one thing blocked. @koko57 Do you have any hint?

Let's store the last selected rate ID here - so the type will be string and the onyx key could be NVP_LAST_SELECTED_DISTANCE_RATE (I believe we want it singular, not plural)

@tienifr
Copy link
Contributor

tienifr commented Feb 26, 2024

so the type will be string

But the rates are different per workspace, aren't they? Should it be Record<policyID, customUnitRateID>?

Let's store the last selected rate ID here

I see that this is part of Phase 3 and out of scope of this issue. For now I think we only need to define the key, type and retrieve it in initMoneyRequest.

Screenshot 2024-02-26 at 19 41 49

@neil-marcellini
Copy link
Contributor Author

❗❗❗ Note to QA/bug reporters ❗❗❗

Please refrain from creating deploy blockers related to this PR/issue. The feature is under a beta that is only available to expensify accounts while we build the feature. It's expected to be incomplete right now.

@neil-marcellini
Copy link
Contributor Author

Pr was merged 🚀

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Mar 7, 2024
@melvin-bot melvin-bot bot changed the title [$500] [P2P Distance] Enable P2P/Splits in App [HOLD for payment 2024-03-14] [$500] [P2P Distance] Enable P2P/Splits in App Mar 7, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Mar 7, 2024
Copy link

melvin-bot bot commented Mar 7, 2024

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

Copy link

melvin-bot bot commented Mar 7, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.48-0 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 2024-03-14. 🎊

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

Copy link

melvin-bot bot commented Mar 7, 2024

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:

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

@neil-marcellini
Copy link
Contributor Author

@adelekennedy we don't need to do any payment right now since I implemented the PR and we did not use a C+ for review. I'm going to keep this open until we enable splits. I have only enabled P2P for distance so far.

@neil-marcellini neil-marcellini removed the Awaiting Payment Auto-added when associated PR is deployed to production label Mar 11, 2024
@tienifr
Copy link
Contributor

tienifr commented Mar 12, 2024

@neil-marcellini Seems like you mistook this with another issue 😅 because I and @alitoshmatov worked on this.

@tienifr
Copy link
Contributor

tienifr commented Mar 14, 2024

Bumping @neil-marcellini and @adelekennedy to check my comment above ^ and process next steps because PR was on production 7 days ago.

@adelekennedy
Copy link

Yep - it looks like payment is due here for @tienifr and @alitoshmatov (checking the PR and the proposal process here)

@neil-marcellini
Copy link
Contributor Author

@neil-marcellini Seems like you mistook this with another issue 😅 because I and @alitoshmatov worked on this.

Oh woops yes sorry!

@tienifr
Copy link
Contributor

tienifr commented Mar 19, 2024

@adelekennedy I think we're good for payment 🙏

@neil-marcellini
Copy link
Contributor Author

Gentle bump @adelekennedy, can we get this closed out please?

@adelekennedy
Copy link

adelekennedy commented Mar 25, 2024

payments have already been made as of the 14th - Last step outstanding is the regression test!

@adelekennedy
Copy link

Screenshot 2024-03-25 at 9 54 47 AM

@alitoshmatov
Copy link
Contributor

I think new regression test from me is not needed since plan for this feature contains manual tests and states this:

All of the tests should be added to TestRail as new cases. Our QA team can decide where they should go within the test sections.

@adelekennedy
Copy link

perfect then we are good to close!

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Weekly KSv2 labels Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Engineering External Added to denote the issue can be worked on by a contributor NewFeature Something to build that is a new item. Reviewing Has a PR in review Weekly KSv2
Projects
No open projects
Development

No branches or pull requests

5 participants