mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 05:10:31 +00:00
feat: wip uncategorize bank transaction
This commit is contained in:
@@ -50,12 +50,15 @@ export class DecrementUncategorizedTransactionOnCategorize {
|
||||
*/
|
||||
public async incrementUnCategorizedTransactionsOnUncategorized({
|
||||
tenantId,
|
||||
uncategorizedTransaction,
|
||||
uncategorizedTransactions,
|
||||
}: ICashflowTransactionUncategorizedPayload) {
|
||||
const { Account } = this.tenancy.models(tenantId);
|
||||
|
||||
const uncategorizedTransactionIds = uncategorizedTransactions?.map(
|
||||
(t) => t.id
|
||||
);
|
||||
await Account.query()
|
||||
.findById(uncategorizedTransaction.accountId)
|
||||
.whereIn('id', uncategorizedTransactionIds)
|
||||
.increment('uncategorizedTransactions', 1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user