App icon indicating copy to clipboard operation
App copied to clipboard

[DISTANCE] MEDIUM: Enable P2P distance requests

Open JmillsExpensify opened this issue 1 year ago • 114 comments

DESIGN DOC ➡️

Proposal

Proposal: Add support for P2P distance requests

Problem: Expensify makes it easy to request money from a friend, split a dinner receipt with a group, or request reimbursement for a company expense. We are also building a seamless bottom up flow in wave 6 to upgrade P2P requests into a workspace requests. No matter the request type, everything is possible; except for distance requests, which can only be sent to workspaces. Not only does this create an inconsistent and confusing UX for requesting money, but the bottom up flow will also be limited to manual and scan requests. We will miss out on converting distance request users from free to paid plans, losing out on valuable revenue.

Solution: Add support for P2P distance requests whether you’re requesting from a friend, splitting expenses for a road trip, or introducing your boss to the power of Expensify for distance tracking.

Posted in #whatsnext here on 10/24/23


Long version

Hey everyone! I'm excited to move forward with this project after the #whatsnext post. Here is the expanded proposal.

Proposal: Enable P2P distance requests so that the bottom up flow works for all expense types.

Strategy: If someone hears about Expensify (from chalk on a sidewalk or seeing the logo as a prestigious racing sponsor), our viral growth model can convert that curious onlooker into a paying customer. No matter the type of expense they want to create: a simple request, scanning a receipt, or tracking distance; the user can jump into the app and get started. Select the start and finish points, choose who you want to send it to, and be done. When the new user's boss gets the request they click the big green "Pay" button and can select "Business bank account". As described in the wave 6 basic bottom up flow, that kicks off an elegant process of creating a workspace, starting a free trial, setting up the bank account, and moving the request over to the workspace chat. Of course, the receiver may also be your carpool buddy that is a bit too comfortable with getting a ride to work everyday; or you might split the cost of your road trip with friends. The possibilities are endless with a super app, after all.

Problem: Expensify makes it easy to request money from a friend, split a dinner receipt with a group, or request reimbursement for a company expense. We are also building a seamless bottom up flow in wave 6 to upgrade P2P requests into workspace requests. No matter the request type, everything is possible; except for distance requests, which can only be sent to workspaces. Not only does this create an inconsistent and confusing UX for requesting money, but the bottom up flow will also be limited to manual and scan requests. We will miss out on converting distance request users from free to paid plans, losing out on valuable revenue.

If a user hears about Expensify's distance tracking feature and wants to try it out they will jump into the app, click the green plus, request money, select distance, enter their waypoints and click next. So far they are dazzled by the ease of use and our fancy Mapbox animations. However, on the next page, they enter the email address of the person who owes reimbursement for their trip, and they see a little error message saying that distance requests can only be sent to a workspace. "Huh, that's weird. What am I supposed to do now?", they think. Confused, they close the app and never come back.

Solution: Enable P2P distance requests whether you’re requesting from a friend, splitting expenses for a road trip, or introducing your boss to the power of Expensify for distance tracking. First, allow individuals to be selected, as well as split with. The existing distance field can be separated into distance and rate fields on the confirmation screen; which is the last step before creating the request. The user can click “Rate” to input the rate amount and unit. It will be saved to the user's personal workspace, making it sticky for subsequent requests. An added benefit is that the user doesn't have to configure the rate separately in settings. For workspace requests the rate will also be displayed, but it will not be editable because it comes from the workspace settings and can only be changed by admins.

On the backend the basic operations and format stay the same. We will extend the existing P2P and split functionality to work with distance transactions. Distance requests already use the same underlying function as the rest of the expense types, so it's mostly a matter of setting up additional parameters. Along the way there will be close collaboration with the wave 6 bottom up flow team, to ensure that our designs mesh well out of the box. The test steps will focus on the upgrade flow for distance requests since that's the most important part of the solution.

Please keep an eye out in #wave5-free-submitters for a pre-design coming soon!

Best, Neil

Emailed to [email protected] on 11/6/23 with the subject Proposal: Enable P2P distance requests so that the bottom up flow works for all expense types.

Tasks

  • [x] Post Proposal (full Problem/Solution statement) in #whatsnext
  • [x] Wait at least one full business day, and until the post has a majority (2/3) of positive reactions (👍) 16 up / 22 total = 72% approval
  • [x] Paste Proposal in the space above with a link to the Slack thread
  • [x] Email [email protected] and paste in the Proposal
  • [x] Fill out the High-level overview of the problem, Timeline, and Terminology sections of the Design Doc
  • [x] Email [email protected] (continue the same email chain as before) with the link to your Design Doc
  • [x] Host a pre-design meeting (example) in an appropriate slack channel to discuss any necessary details in public before filling out the High-level of proposed solution section. Posted here on 11/8/23
  • [x] Fill out the High-level of proposed solution section
  • [x] Email [email protected] again with links to the doc and pre-design conversation in Slack
  • [x] Add the DesignDocReview label to get the High-level of proposed solution section reviewed
  • [x] Respond to any questions or concerns and bring up blockers in Slack to get a consensus if necessary
  • [x] Confirm that the doc has the minimum necessary number of reviews before proceeding
  • [x] Host another pre-design meeting in the appropriate slack channel to ask for engineering feedback on the technical solution. Posted in Slack here on 12/27/23.
  • [x] Additional high level re-design conversation
  • [ ] Fill out the Detailed implementation of the solution and related sections.
  • [ ] Re-add the DesignDocReview label to this issue
  • [ ] Respond to any questions or concerns and bring up blockers in Slack to get consensus if necessary
  • [ ] Confirm that the doc has the minimum necessary number of reviews before proceeding
  • [ ] Email [email protected] one last time to let them know the Design Doc is moving into the implementation phase
  • [ ] Implement the changes
  • [ ] Add regression tests so that QA can test your feature with every deploy (instructions)
  • [ ] Send out a follow up email to [email protected] once everything has been implemented and do a Project Wrap-Up retrospective that provides:
    • Summary of what we accomplished with this project
    • What went well?
    • What could we have done better?
    • What did we learn?
Issue OwnerCurrent Issue Owner: @neil-marcellini

JmillsExpensify avatar Jul 20 '23 17:07 JmillsExpensify

Triggered auto assignment to @lschurr (NewFeature), see https://stackoverflowteams.com/c/expensify/questions/14418#:~:text=BugZero%20process%20steps%20for%20feature%20requests for more details.

melvin-bot[bot] avatar Jul 20 '23 17:07 melvin-bot[bot]

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

melvin-bot[bot] avatar Jul 20 '23 17:07 melvin-bot[bot]

Still not a priority.

JmillsExpensify avatar Aug 02 '23 04:08 JmillsExpensify

I don't think this is critical, I would say it's more polish right? If it's critical for smallbizexpo, why?

neil-marcellini avatar Aug 03 '23 18:08 neil-marcellini

Definitely not critical.

JmillsExpensify avatar Aug 16 '23 13:08 JmillsExpensify

Still not a priority.

JmillsExpensify avatar Aug 30 '23 05:08 JmillsExpensify

I need to prioritize this one this week.

JmillsExpensify avatar Sep 13 '23 08:09 JmillsExpensify

Do we have an idea of what exactly needs to happen to the product to enable this? Is it:

  • Allowing you to select an individual when requesting a distance expense? (I think you can already do this)
  • Adding the option to the composers "+" menu (ie. NOT the global "+" menu) when in a DM?
  • Do we need to do anything for the payment side of things?

tgolen avatar Sep 15 '23 23:09 tgolen

The main change required is adding a Rate row, such that the distance rate can be updated at any time during creation.

JmillsExpensify avatar Sep 25 '23 05:09 JmillsExpensify

OK, can you please update the title and the OP to reflect that?

tgolen avatar Sep 25 '23 06:09 tgolen

Updated the OP with further details.

JmillsExpensify avatar Oct 06 '23 23:10 JmillsExpensify

I believe that the next step is that Neil will update this issue with more detailed considerations before implementing.

JmillsExpensify avatar Oct 16 '23 15:10 JmillsExpensify

Yep, I plan to work on that for a bit today

neil-marcellini avatar Oct 19 '23 16:10 neil-marcellini

Ok, here are some of the changes that I think we will need to make. I will get started on a backend PR when I finish planning. I will keep updating this comment. I played around with some of the frontend changes but the current routing makes it quite a pain. @tgolen is there a PR that I or a contributor can branch off of with updated routing? Maybe we should get someone from an agency to implement the front end changes, because they're fairly involved.

Backend changes:

  • Continue saving the distance and rate into the merchant field on the backend to maintain compatibility with OldDot
  • Remove validation that distance requests must be on a workspace chat, in the api
  • If the chat report is not a workspace chat, then get the personal policy of the requesting user when getting the custom unit rate on the backend here
  • If the default distance rate can't be found for some reason (such as the user renaming it), create and save it on the policy like we do during creation
  • To be continued...
  • TODO support splits. Splits create a 1:1 request between the payee and each participant in Auth.

Partial frontend changes:

  • Enable distance requests for IOUs by always displaying the distance option here
  • For the participants selector, also include P2P options for distance requests by setting includeP2P: true here
  • Remove limitation on isAllowedToSplit here.
  • Separate menu items for distance and rate. The distance field will continue to navigate to the distance request page
  • On the MoneyRequestConfirmation page connect withOnyx to the policy that has type: personal and the current user's ownerAccountID. We already return the user's personal policy when opening the app or reconnecting.
  • To get the personal policy rate we can use the same API OpenDraftWorkspaceRequest and call it for IOU distance requests
  • When the rate and unit are edited, call the UpdateWorkspaceCustomUnitAndRate api like we do here, but for the personal policy.

neil-marcellini avatar Oct 19 '23 23:10 neil-marcellini

That's just for a proof of concept / testing ^. I've gotten Jason on board with writing a doc for this, so I think we will start soon and it will be a better medium for planning.

neil-marcellini avatar Oct 20 '23 04:10 neil-marcellini

Yeah, you should probably base any changes off of this branch: https://github.com/Expensify/App/pull/28618

It's fully done, but not 100% updated with main at this point. I think this branch will make all of these changes a lot easier.

tgolen avatar Oct 20 '23 18:10 tgolen

What's Next post is live.

JmillsExpensify avatar Oct 24 '23 18:10 JmillsExpensify

I updated this issue with the project template and I started drafting an expanded proposal to send out to strategy@.

neil-marcellini avatar Nov 01 '23 01:11 neil-marcellini

I finished a draft of the expanded proposal and I sent it to Jason for review. After his feedback I will send it out, hopefully tomorrow morning.

neil-marcellini avatar Nov 02 '23 00:11 neil-marcellini

@JmillsExpensify, @neil-marcellini Whoops! This issue is 2 days overdue. Let's get this updated quick!

melvin-bot[bot] avatar Nov 06 '23 13:11 melvin-bot[bot]

I'm planning to send out the proposal today and write up the high level pre-design.

neil-marcellini avatar Nov 06 '23 19:11 neil-marcellini

I just sent the pre-design out to the room!

neil-marcellini avatar Nov 08 '23 22:11 neil-marcellini

The pre-design went well and I'm going to start writing the high level design.

neil-marcellini avatar Nov 09 '23 21:11 neil-marcellini

Ok cool, the high level is about 50% done. I got the proposed solution and ui additions and changes sections filled out. We're still discussing how the rates will move from a user's personal workspace to the workspace owing reimbursement. I also want to walk through the flows a bit more on staging and make sure we have considered the entire UX. Finally, I should read the complete high level of the bottom up design doc if I'm going to ask readers of this doc to do the same.

neil-marcellini avatar Nov 10 '23 00:11 neil-marcellini

Triggered auto assignment to @shawnborton (Design), see these Stack Overflow questions for more details.

melvin-bot[bot] avatar Nov 10 '23 01:11 melvin-bot[bot]

Hey there Shawn, would you please help us out with some mocks and design review on the high level? I'll make some notes in the doc about where I need help so far.

neil-marcellini avatar Nov 10 '23 01:11 neil-marcellini

@JmillsExpensify, @shawnborton, @neil-marcellini Whoops! This issue is 2 days overdue. Let's get this updated quick!

melvin-bot[bot] avatar Nov 13 '23 14:11 melvin-bot[bot]

@JmillsExpensify, @shawnborton, @neil-marcellini Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

melvin-bot[bot] avatar Nov 13 '23 14:11 melvin-bot[bot]

@JmillsExpensify, @shawnborton, @neil-marcellini Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

melvin-bot[bot] avatar Nov 13 '23 15:11 melvin-bot[bot]

I was OOO Friday but I'm back now and this is my top focus.

neil-marcellini avatar Nov 13 '23 18:11 neil-marcellini