mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 20:30:33 +00:00
feat(server): sync Plaid transactions to uncategorized transactions
This commit is contained in:
@@ -4,10 +4,13 @@ import { UncategorizeCashflowTransaction } from './UncategorizeCashflowTransacti
|
||||
import { CategorizeCashflowTransaction } from './CategorizeCashflowTransaction';
|
||||
import {
|
||||
CategorizeTransactionAsExpenseDTO,
|
||||
CreateUncategorizedTransactionDTO,
|
||||
ICategorizeCashflowTransactioDTO,
|
||||
IUncategorizedCashflowTransaction,
|
||||
} from '@/interfaces';
|
||||
import { CategorizeTransactionAsExpense } from './CategorizeTransactionAsExpense';
|
||||
import { GetUncategorizedTransactions } from './GetUncategorizedTransactions';
|
||||
import { CreateUncategorizedTransaction } from './CreateUncategorizedTransaction';
|
||||
|
||||
@Service()
|
||||
export class CashflowApplication {
|
||||
@@ -26,6 +29,9 @@ export class CashflowApplication {
|
||||
@Inject()
|
||||
private getUncategorizedTransactionsService: GetUncategorizedTransactions;
|
||||
|
||||
@Inject()
|
||||
private createUncategorizedTransactionService: CreateUncategorizedTransaction;
|
||||
|
||||
/**
|
||||
* Deletes the given cashflow transaction.
|
||||
* @param {number} tenantId
|
||||
@@ -39,6 +45,22 @@ export class CashflowApplication {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new uncategorized cash transaction.
|
||||
* @param {number} tenantId
|
||||
* @param {CreateUncategorizedTransactionDTO} createUncategorizedTransactionDTO
|
||||
* @returns {IUncategorizedCashflowTransaction}
|
||||
*/
|
||||
public createUncategorizedTransaction(
|
||||
tenantId: number,
|
||||
createUncategorizedTransactionDTO: CreateUncategorizedTransactionDTO
|
||||
) {
|
||||
return this.createUncategorizedTransactionService.create(
|
||||
tenantId,
|
||||
createUncategorizedTransactionDTO
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Uncategorize the given cashflow transaction.
|
||||
* @param {number} tenantId
|
||||
@@ -98,7 +120,10 @@ export class CashflowApplication {
|
||||
* @param {number} tenantId
|
||||
* @returns {}
|
||||
*/
|
||||
public getUncategorizedTransactions(tenantId: number) {
|
||||
return this.getUncategorizedTransactionsService.getTransactions(tenantId);
|
||||
public getUncategorizedTransactions(tenantId: number, accountId: number) {
|
||||
return this.getUncategorizedTransactionsService.getTransactions(
|
||||
tenantId,
|
||||
accountId
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user