feat(server): move updating plaid transactions to background job

This commit is contained in:
Ahmed Bouhuolia
2024-02-03 13:59:46 +02:00
parent b940c6dd17
commit e0ddcb022a
16 changed files with 150 additions and 68 deletions

View File

@@ -47,7 +47,9 @@ export interface ICashflowCommandDTO {
branchId?: number;
}
export interface ICashflowNewCommandDTO extends ICashflowCommandDTO {}
export interface ICashflowNewCommandDTO extends ICashflowCommandDTO {
plaidAccountId?: string;
}
export interface ICashflowTransaction {
id?: number;

View File

@@ -0,0 +1,55 @@
export interface IPlaidItemCreatedEventPayload {
tenantId: number;
plaidAccessToken: string;
plaidItemId: string;
plaidInstitutionId: string;
}
export interface PlaidItemDTO {
publicToken: string;
institutionId: string;
}
export interface PlaidAccount {
account_id: string;
balances: {
available: number;
current: number;
iso_currency_code: string;
limit: null;
unofficial_currency_code: null;
};
mask: string;
name: string;
official_name: string;
persistent_account_id: string;
subtype: string;
type: string;
}
export interface PlaidTransaction {
date: string;
account_id: string;
amount: number;
authorized_date: string;
name: string;
category: string[];
check_number: number | null;
iso_currency_code: string;
transaction_id: string;
transaction_type: string;
}
export interface PlaidFetchedTransactionsUpdates {
added: any[];
modified: any[];
removed: any[];
accessToken: string;
cursor: string;
}
export interface SyncAccountsTransactionsTask {
tenantId: number;
plaidAccountId: number;
plaidTransactions: PlaidTransaction[];
}

View File

@@ -74,6 +74,7 @@ export * from './Tasks';
export * from './Times';
export * from './ProjectProfitabilitySummary';
export * from './TaxRate';
export * from './Plaid';
export interface I18nService {
__: (input: string) => string;