Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.26k stars 2.7k forks source link

[P2P Distance] Create UpdateMoneyRequestDistanceRate #36969

Closed neil-marcellini closed 1 month ago

neil-marcellini commented 6 months ago

Create UpdateMoneyRequestDistanceRate API command in Web-E and Auth following this plan

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0116944cbb002d044c
  • Upwork Job ID: 1760074735350415360
  • Last Price Increase: 2024-02-20
Beamanator commented 2 months ago

Had to prioritize some API optimizations today, hoping to get back to this wednesday

Beamanator commented 2 months ago

tryiingggg to get this done by EOW

Beamanator commented 2 months ago

Boom, PR is out for review!

melvin-bot[bot] commented 2 months ago

@Beamanator Whoops! This issue is 2 days overdue. Let's get this updated quick!

Beamanator commented 2 months ago

@MonilBhavsar is planning to help with the tax changes early this week, since tax stuff is confusing a.f.

Beamanator commented 2 months ago

Commenting again to hopefully remove the Overdue label

melvin-bot[bot] commented 2 months ago

@Beamanator Whoops! This issue is 2 days overdue. Let's get this updated quick!

melvin-bot[bot] commented 2 months ago

@Beamanator 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

neil-marcellini commented 2 months ago

Waiting for updates from @MonilBhavsar on the PR

melvin-bot[bot] commented 1 month ago

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

Beamanator commented 1 month ago

Auth PR was merged!! 🚀 I'm OOO this week but will get to the web-e changes to make sure it works well once I'm back!

Beamanator commented 1 month ago

ermagerd all PRs are finally merged! And web-e is on staging, so we're almost done with this!

Beamanator commented 1 month ago

Web-E Went to prod 4 days ago! @neil-marcellini want me to close this out? ORr should we keep it open while the App PR is being tested w/ all the latest code?

paultsimura commented 1 month ago

Hey @Beamanator – I'm not sure if it's intentional, but shouldn't the UpdateMoneyRequestDistanceRate API call update the transaction's amount along with the rate?

I see that when the response comes, the amount does not change, and the merchant gets changed to "{distance} @ zł0.00 / mi" instead of my selected zł1.00 rate

neil-marcellini commented 1 month ago

@Beamanator nah we can close this, there's a separate App issue to implement the front end part. You're work here is done! Unless of course Pavlo has found a legitimate bug 😬 😆

[$500][P2P Distance] Create UpdateMoneyRequestDistanceRate in App

paultsimura commented 1 month ago

Yeah, could you please address this comment @Beamanator?

Beamanator commented 1 month ago

Yo @paultsimura I'd be happy to help look into this, could you give me more specific test steps so I can try to reproduce & figure out exactly what you're seeing? :D

paultsimura commented 1 month ago

Sure thing!

You can try to edit the rate from this PR: https://github.com/Expensify/App/pull/40021 Or send the API request manually.

I'd expect the Onyx data in response to hold the updated amount along with the properly modified merchant, but here's what I'm getting:

https://github.com/Expensify/App/assets/12595293/5a4fc9f3-8e6e-456c-8518-dadd879bdf60

Beamanator commented 1 month ago

Nice, ok so there's definitely a bug, it LOOKS like the problem is that some C++ code isn't accurately converting an integer value into a float 😅

Beamanator commented 1 month ago

Ok ya so the problem is that here, newAmount evaluates to 0 because policyCustomUnitRate.getFloatMemberWithDefault("rate") gets 0.0 when the value is actually an integer (ex: 100) 😅

I'm working on figuring out exactly why & if it's easy to correctly convert 100 to the float value 100.0

Beamanator commented 1 month ago

PR is up!

paultsimura commented 1 month ago

Hey @Beamanator, what is the approximate date of the PR being on Staging?

Beamanator commented 1 month ago

@paultsimura Most likely tomorrow, as long as it gets reviewed and merged today

Beamanator commented 1 month ago

Seems a lot of people were off at the end of last week for the 4th of July, so the changes have not been merged yet 🙏

Beamanator commented 1 month ago

Fix got to Prod end of last week! 🚀