mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 20:30:33 +00:00
fix(webapp): unexclude bank transactions
This commit is contained in:
@@ -4,8 +4,8 @@ import {
|
||||
validateTransactionShouldBeExcluded,
|
||||
} from './utils';
|
||||
import {
|
||||
IBankTransactionExcludedEventPayload,
|
||||
IBankTransactionExcludingEventPayload,
|
||||
IBankTransactionUnexcludedEventPayload,
|
||||
IBankTransactionUnexcludingEventPayload,
|
||||
} from '../types/BankTransactionsExclude.types';
|
||||
import { EventEmitter2 } from '@nestjs/event-emitter';
|
||||
import { Inject, Injectable } from '@nestjs/common';
|
||||
@@ -24,7 +24,7 @@ export class UnexcludeBankTransactionService {
|
||||
private readonly uncategorizedBankTransactionModel: TenantModelProxy<
|
||||
typeof UncategorizedBankTransaction
|
||||
>,
|
||||
) {}
|
||||
) { }
|
||||
|
||||
/**
|
||||
* Marks the given bank transaction as excluded.
|
||||
@@ -50,7 +50,8 @@ export class UnexcludeBankTransactionService {
|
||||
return this.uow.withTransaction(async (trx: Knex.Transaction) => {
|
||||
await this.eventEmitter.emitAsync(events.bankTransactions.onUnexcluding, {
|
||||
uncategorizedTransactionId,
|
||||
} as IBankTransactionExcludingEventPayload);
|
||||
trx,
|
||||
} as IBankTransactionUnexcludingEventPayload);
|
||||
|
||||
await this.uncategorizedBankTransactionModel()
|
||||
.query(trx)
|
||||
@@ -61,7 +62,8 @@ export class UnexcludeBankTransactionService {
|
||||
|
||||
await this.eventEmitter.emitAsync(events.bankTransactions.onUnexcluded, {
|
||||
uncategorizedTransactionId,
|
||||
} as IBankTransactionExcludedEventPayload);
|
||||
trx,
|
||||
} as IBankTransactionUnexcludedEventPayload);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ export class DecrementUncategorizedTransactionOnExclude {
|
||||
private readonly uncategorizedBankTransaction: TenantModelProxy<
|
||||
typeof UncategorizedBankTransaction
|
||||
>,
|
||||
) {}
|
||||
) { }
|
||||
|
||||
/**
|
||||
* Validates the cashflow transaction whether matched with bank transaction on deleting.
|
||||
@@ -50,7 +50,7 @@ export class DecrementUncategorizedTransactionOnExclude {
|
||||
trx,
|
||||
}: IBankTransactionUnexcludedEventPayload) {
|
||||
const transaction = await this.uncategorizedBankTransaction()
|
||||
.query()
|
||||
.query(trx)
|
||||
.findById(uncategorizedTransactionId);
|
||||
//
|
||||
await this.account()
|
||||
|
||||
Reference in New Issue
Block a user