refactor(nestjs): bank transactions matching

This commit is contained in:
Ahmed Bouhuolia
2025-06-05 14:41:26 +02:00
parent f87bd341e9
commit 51988dba3b
43 changed files with 484 additions and 105 deletions

View File

@@ -1,4 +1,4 @@
import async from 'async';
import * as async from 'async';
import { Knex } from 'knex';
import {
ILedger,

View File

@@ -1,5 +1,5 @@
import { Knex } from 'knex';
import async from 'async';
import * as async from 'async';
import { Inject, Injectable } from '@nestjs/common';
import { transformLedgerEntryToTransaction } from './utils';
import {
@@ -33,7 +33,7 @@ export class LedgerEntriesStorageService {
* @returns {Promise<void>}
*/
public saveEntries = async (ledger: ILedger, trx?: Knex.Transaction) => {
const saveEntryQueue = async.queue(this.saveEntryTask, 10);
const saveEntryQueue = async.queue(this.saveEntryTask.bind(this), 10);
const entries = ledger.filter(filterBlankEntry).getEntries();
entries.forEach((entry) => {

View File

@@ -1,4 +1,4 @@
import async from 'async';
import * as async from 'async';
import { Knex } from 'knex';
import { uniq } from 'lodash';
import {

View File

@@ -1,3 +1,4 @@
import * as moment from 'moment';
import { AccountTransaction } from "../Accounts/models/AccountTransaction.model";
import { ILedgerEntry } from "./types/Ledger.types";