mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 12:50:38 +00:00
feat: pause/resume bank account feeds syncing
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { Inject, Service } from 'typedi';
|
||||
import { DisconnectBankAccount } from './DisconnectBankAccount';
|
||||
import { RefreshBankAccountService } from './RefreshBankAccount';
|
||||
import { ResumeBankAccountFeeds } from './PauseBankAccountFeeds';
|
||||
|
||||
@Service()
|
||||
export class BankAccountsApplication {
|
||||
@@ -10,6 +11,12 @@ export class BankAccountsApplication {
|
||||
@Inject()
|
||||
private refreshBankAccountService: RefreshBankAccountService;
|
||||
|
||||
@Inject()
|
||||
private resumeBankAccountFeedsService: ResumeBankAccountFeeds;
|
||||
|
||||
@Inject()
|
||||
private pauseBankAccountFeedsService: ResumeBankAccountFeeds;
|
||||
|
||||
/**
|
||||
* Disconnects the given bank account.
|
||||
* @param {number} tenantId
|
||||
@@ -27,7 +34,7 @@ export class BankAccountsApplication {
|
||||
* Refresh the bank transactions of the given bank account.
|
||||
* @param {number} tenantId
|
||||
* @param {number} bankAccountId
|
||||
* @returns {Promise<void>}
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
async refreshBankAccount(tenantId: number, bankAccountId: number) {
|
||||
return this.refreshBankAccountService.refreshBankAccount(
|
||||
@@ -35,4 +42,30 @@ export class BankAccountsApplication {
|
||||
bankAccountId
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Pauses the feeds sync of the given bank account.
|
||||
* @param {number} tenantId
|
||||
* @param {number} bankAccountId
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
async pauseBankAccount(tenantId: number, bankAccountId: number) {
|
||||
return this.pauseBankAccountFeedsService.resumeBankAccountFeeds(
|
||||
tenantId,
|
||||
bankAccountId
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Resumes the feeds sync of the given bank account.
|
||||
* @param {number} tenantId
|
||||
* @param {number} bankAccountId
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
async resumeBankAccount(tenantId: number, bankAccountId: number) {
|
||||
return this.resumeBankAccountFeedsService.resumeBankAccountFeeds(
|
||||
tenantId,
|
||||
bankAccountId
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import { Service } from 'typedi';
|
||||
|
||||
@Service()
|
||||
export class ResumeBankAccountFeeds {
|
||||
public resumeBankAccountFeeds(tenantId: number, bankAccountId: number) {
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
import { Service } from "typedi";
|
||||
|
||||
@Service()
|
||||
export class ResumeBankAccountFeeds {
|
||||
/**
|
||||
*
|
||||
* @param {number} tenantId
|
||||
* @param {number} bankAccountId
|
||||
*/
|
||||
public resumeBankAccountFeeds(tenantId: number, bankAccountId: number) {}
|
||||
}
|
||||
Reference in New Issue
Block a user