Skip to content

Commit 91e1ca3

Browse files
committed
Update JSDoc for selectTargetAndSourceTransactionsForMerge
1 parent 1f6d81b commit 91e1ca3

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

src/libs/MergeTransactionUtils.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -356,17 +356,18 @@ function buildMergedTransactionData(targetTransaction: OnyxEntry<Transaction>, m
356356
}
357357

358358
/**
359-
* Determines the correct target and source transaction IDs for merging based on transaction types.
359+
* Determines the correct target and source transactions for merging based on transaction types.
360360
*
361361
* Rules:
362-
* - If one transaction is a card transaction, it becomes the target (card transactions take priority)
363-
* - If both are cash transactions, the first parameter becomes the target
364-
* - Users can only merge two cash expenses or one cash/one card expense
362+
* - The target transaction (transaction to keep) is selected based on the following priority: card transaction > split expense > cash transaction
365363
* - Users cannot merge two card expenses
364+
* - Users cannot merge two split expenses
365+
* - Users can merge any other combinations
366366
*
367-
* @param targetTransaction - The first transaction in the merge operation
368-
* @param sourceTransaction - The second transaction in the merge operation
369-
* @returns An object containing the determined targetTransactionID and sourceTransactionID
367+
* @param originalTargetTransaction - The transaction where the merge action is started from
368+
* @param originalSourceTransaction - The selected transaction to be merged with the target transaction
369+
* @param originalTransactionForSourceTransaction - The original transaction of the source transaction
370+
* @returns An object containing the determined targetTransaction and sourceTransaction
370371
*/
371372
function selectTargetAndSourceTransactionsForMerge(
372373
originalTargetTransaction: OnyxEntry<Transaction>,

0 commit comments

Comments
 (0)