question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Chat] [IOU] Create IOUConfirm step

See original GitHub issue

If you haven’t already, check out our contributing guidelines for onboarding!


Upwork Posting: https://www.upwork.com/jobs/~01744b3390e36e5f36

This issue builds on top of the existing IOU Modal, which was implemented in this PR. The IOU Confirm step page has already been created and is a controlled component (IOUModal manages its state).

The Confirm step allows users to confirm the ‘request money’ (1:1) or ‘bill split’(multiple participants) amount and the participants they are requesting payment from. To open the Modal, you can navigate to localhost:8080/iou/request AND localhost:8080/iou/split.

You can also launch the IOUModal by temporarily modifying the routes in CreateMenu. Launch the request money flow with Navigation.navigate(ROUTES.IOU_REQUEST) and the bill split flow with Navigation.navigate(ROUTES.IOU_BILL)

Mobile & mobile web Confirm Confirm Split

Web & Desktop FAB Open

Deliverables:

  1. The title should match the title from the Participants step (step 2). This will be ‘Split’ or ‘Request’, followed by the amount. (for example: ‘Split $42.00’ || Request $42.00)
  2. If the IOU flow is for a bill split, then we should display the current user under the ‘WHO PAID?’ title (this is not shown for the request money flow)
  3. We then need to display all participants other than the current user. With the amount that they will need to pay (total amount, split equally between amount of participants)
    1. If ‘Bill split’ flow, then we should reuse the list from the IOUParticipantsSplit page
    2. If ‘Request money’ flow, then we simply display a single user under the ‘To’ heading
  4. An input field should allow the user to input an optional comment for the IOU request
  5. The button label should read ‘Request $[currency][amount]’ or ‘Split bill’ if there are multiple participants
  6. A new API function should be created within API.js: createIOUTransaction, which will be called from IOUModal to create the IOU (details for this request can be found below).
  7. When the user hits this button, we should pass the comment input string up to IOUModal via the existing onStepComplete callback (or something similar), and we should then call the new createIOUTransaction API function from within a new IOUAction function.
    1. We should show a loading indicator in the button (using ButtonWithLoader), by setting the Onyx IOU key to IOU: {loading:true}. We should display a loading indicator in the Button while this is true.
    2. Within this new IOUAction function we should await a successful response to createIOUTransaction, and then pass the returned reportID value to GetIOUReport, to retrieve the full IOUReport details
    3. Then, we should persist the simplified version of these details to Onyx, just like we are doing here
  8. Finally, back in IOUModal we should subscribe to the reportIOU_ Onyx key. Once we notice that the new IOU data has been persisted to Onyx (when we persist the data in step 7, we should receive this in our Onyx subscription). Once this value is not null, we know that the report has successfully been created and persisted to Onyx, so we can close the IOU Modal.

CreateIOUTransaction API Example of the API which is used to create the IOU request / split.

curl --request POST \
  --url 'https://expensify-jules.ngrok.io/api?command=CreateIOUTransaction' \
  --header 'Content-Type: multipart/form-data; boundary=---011000010111000001101001' \
  --cookie 'email=jules%252B3%2540expensify.com; accountID=12; authToken=66ADF90...22AE918' \
  --form debtorEmail=admin2@verified.com \
  --form currency=USD \
  --form 'comment=Pizza 🍕' \
  --form amount=550

Expensify/Expensify Issue URL: https://github.com/Expensify/Expensify/issues/157782

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:21 (21 by maintainers)

github_iconTop GitHub Comments

1reaction
barun1997commented, Apr 20, 2021

I will take a look, thank you!

1reaction
Jag96commented, Apr 19, 2021

Reopening this, it seems that there is still a regression related to the original fix. cc @barun1997

Read more comments on GitHub >

github_iconTop Results From Across the Web

Step Chat
Attend online 12-step meetings on your mobile devices at StepChat.com. ... After you click "LOGIN" choose the chat room that you wish to...
Read more >
22 “Could You Please Confirm…” Statements For Chat And ...
In this guide, we'll cover common situations where you will need to use a “could you please confirm” phrase and how to compose...
Read more >
Turn on chat features in Messages - Google Support
On your device, open Messages . Tap Get Started and then Next. To keep Messages connected, tap Yes. If you can't turn on...
Read more >
Use Messages on your iPhone or iPad - Apple Support
Open Messages. Tap the Compose button to start a new message. Or go to an existing conversation. Type your message, then tap the...
Read more >
Getting started with Zoom Team Chat
Follow these steps for basic settings to get you started: ... Click Yes to confirm inviting all members of the chat group or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found