Skip to content

Commit a12912a

Browse files
authored
Merge pull request Expensify#67055 from Expensify/marco-addCommentDistanceRequests
[NoQA] Update comments to ensure synchronization of distance expense rate logic with Auth
2 parents 6f83d61 + c31a4d7 commit a12912a

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

src/CONST/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5501,6 +5501,8 @@ const CONST = {
55015501
},
55025502
},
55035503
},
5504+
5505+
/* If we update these values, let's ensure this logic is consistent with the logic in the backend (Auth), since we're using the same method to calculate the rate value in distance requests created via Concierge. */
55045506
CURRENCY_TO_DEFAULT_MILEAGE_RATE: JSON.parse(`{
55055507
"AED": {
55065508
"rate": 414,

src/libs/DistanceRequestUtils.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,8 @@ function ensureRateDefined(rate: number | undefined): asserts rate is number {
248248
/**
249249
* Retrieves the rate and unit for a P2P distance expense for a given currency.
250250
*
251+
* Let's ensure this logic is consistent with the logic in the backend (Auth), since we're using the same method to calculate the rate value in distance requests created via Concierge.
252+
*
251253
* @param currency
252254
* @returns The rate and unit in MileageRate object.
253255
*/
@@ -353,6 +355,8 @@ function getDistanceUnit(transaction: OnyxEntry<Transaction>, mileageRate: OnyxE
353355
/**
354356
* Get the selected rate for a transaction, from the policy or P2P default rate.
355357
* Use the distanceUnit stored on the transaction by default to prevent policy changes modifying existing transactions. Otherwise, get the unit from the rate.
358+
*
359+
* Let's ensure this logic is consistent with the logic in the backend (Auth), since we're using the same method to calculate the rate value in distance requests created via Concierge.
356360
*/
357361
function getRate({
358362
transaction,

0 commit comments

Comments
 (0)