mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 21:30:31 +00:00
feat(server): socket module
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { BullModule } from '@nestjs/bullmq';
|
||||
import { Module } from '@nestjs/common';
|
||||
import { SocketModule } from '../Socket/Socket.module';
|
||||
import { PlaidUpdateTransactionsOnItemCreatedSubscriber } from './subscribers/PlaidUpdateTransactionsOnItemCreatedSubscriber';
|
||||
import { PlaidUpdateTransactions } from './command/PlaidUpdateTransactions';
|
||||
import { PlaidSyncDb } from './command/PlaidSyncDB';
|
||||
@@ -26,6 +27,7 @@ const models = [RegisterTenancyModel(PlaidItem)];
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
SocketModule,
|
||||
PlaidModule,
|
||||
AccountsModule,
|
||||
BankingCategorizeModule,
|
||||
@@ -49,4 +51,4 @@ const models = [RegisterTenancyModel(PlaidItem)];
|
||||
exports: [...models],
|
||||
controllers: [BankingPlaidController, BankingPlaidWebhooksController],
|
||||
})
|
||||
export class BankingPlaidModule {}
|
||||
export class BankingPlaidModule { }
|
||||
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
} from '../types/BankingPlaid.types';
|
||||
import { PlaidUpdateTransactions } from '../command/PlaidUpdateTransactions';
|
||||
import { SetupPlaidItemTenantService } from '../command/SetupPlaidItemTenant.service';
|
||||
import { SocketGateway } from '../../Socket/Socket.gateway';
|
||||
|
||||
@Processor({
|
||||
name: UpdateBankingPlaidTransitionsQueueJob,
|
||||
@@ -19,6 +20,7 @@ export class PlaidFetchTransactionsProcessor extends WorkerHost {
|
||||
constructor(
|
||||
private readonly plaidFetchTransactionsService: PlaidUpdateTransactions,
|
||||
private readonly setupPlaidItemService: SetupPlaidItemTenantService,
|
||||
private readonly socketGateway: SocketGateway,
|
||||
) {
|
||||
super();
|
||||
}
|
||||
@@ -38,7 +40,7 @@ export class PlaidFetchTransactionsProcessor extends WorkerHost {
|
||||
);
|
||||
});
|
||||
// Notify the frontend to reflect the new transactions changes.
|
||||
// io.emit('NEW_TRANSACTIONS_DATA', { plaidItemId });
|
||||
this.socketGateway.emitNewTransactionsData();
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user