refactor: dynamic list to nestjs

This commit is contained in:
Ahmed Bouhuolia
2025-01-12 18:22:48 +02:00
parent ddaea20d16
commit 270b421a6c
117 changed files with 4232 additions and 1493 deletions

View File

@@ -0,0 +1,15 @@
import { chain } from 'lodash';
/**
* Grpups by transaction type and id the inventory transactions.
* @param {IInventoryTransaction} invTransactions
* @returns
*/
export function groupInventoryTransactionsByTypeId(
transactions: { transactionType: string; transactionId: number }[]
): { transactionType: string; transactionId: number }[][] {
return chain(transactions)
.groupBy((t) => `${t.transactionType}-${t.transactionId}`)
.values()
.value();
}