mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 12:20:31 +00:00
feat(server): add bull ui board
This commit is contained in:
@@ -12,6 +12,9 @@ import {
|
||||
I18nModule,
|
||||
QueryResolver,
|
||||
} from 'nestjs-i18n';
|
||||
import { BullBoardModule } from '@bull-board/nestjs';
|
||||
import { ExpressAdapter } from '@bull-board/express';
|
||||
import { createBullBoardAuthMiddleware } from '@/middleware/bull-board-auth.middleware';
|
||||
import { BullModule } from '@nestjs/bullmq';
|
||||
import { ScheduleModule } from '@nestjs/schedule';
|
||||
import { PassportModule } from '@nestjs/passport';
|
||||
@@ -143,6 +146,24 @@ import { AppThrottleModule } from './AppThrottle.module';
|
||||
}),
|
||||
inject: [ConfigService],
|
||||
}),
|
||||
BullBoardModule.forRootAsync({
|
||||
imports: [ConfigModule],
|
||||
useFactory: (configService: ConfigService) => {
|
||||
const enabled = configService.get<boolean>('bullBoard.enabled');
|
||||
const username = configService.get<string>('bullBoard.username');
|
||||
const password = configService.get<string>('bullBoard.password');
|
||||
return {
|
||||
route: '/queues',
|
||||
adapter: ExpressAdapter,
|
||||
middleware: createBullBoardAuthMiddleware(
|
||||
enabled,
|
||||
username,
|
||||
password,
|
||||
),
|
||||
};
|
||||
},
|
||||
inject: [ConfigService],
|
||||
}),
|
||||
ClsModule.forRoot({
|
||||
global: true,
|
||||
middleware: {
|
||||
|
||||
@@ -17,6 +17,8 @@ import { PassportModule } from '@nestjs/passport';
|
||||
import { APP_GUARD } from '@nestjs/core';
|
||||
import { JwtAuthGuard } from './guards/jwt.guard';
|
||||
import { AuthMailSubscriber } from './subscribers/AuthMail.subscriber';
|
||||
import { BullBoardModule } from '@bull-board/nestjs';
|
||||
import { BullMQAdapter } from '@bull-board/api/bullMQAdapter';
|
||||
import { BullModule } from '@nestjs/bullmq';
|
||||
import {
|
||||
SendResetPasswordMailQueue,
|
||||
@@ -63,6 +65,14 @@ const models = [
|
||||
TenancyModule,
|
||||
BullModule.registerQueue({ name: SendResetPasswordMailQueue }),
|
||||
BullModule.registerQueue({ name: SendSignupVerificationMailQueue }),
|
||||
BullBoardModule.forFeature({
|
||||
name: SendResetPasswordMailQueue,
|
||||
adapter: BullMQAdapter,
|
||||
}),
|
||||
BullBoardModule.forFeature({
|
||||
name: SendSignupVerificationMailQueue,
|
||||
adapter: BullMQAdapter,
|
||||
}),
|
||||
],
|
||||
exports: [...models],
|
||||
providers: [
|
||||
@@ -98,4 +108,4 @@ const models = [
|
||||
AuthMailSubscriber,
|
||||
],
|
||||
})
|
||||
export class AuthModule { }
|
||||
export class AuthModule {}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { BullBoardModule } from '@bull-board/nestjs';
|
||||
import { BullMQAdapter } from '@bull-board/api/bullMQAdapter';
|
||||
import { BullModule } from '@nestjs/bullmq';
|
||||
import { Module } from '@nestjs/common';
|
||||
import { SocketModule } from '../Socket/Socket.module';
|
||||
@@ -33,6 +35,10 @@ const models = [RegisterTenancyModel(PlaidItem)];
|
||||
BankingCategorizeModule,
|
||||
BankingTransactionsModule,
|
||||
BullModule.registerQueue({ name: UpdateBankingPlaidTransitionsQueueJob }),
|
||||
BullBoardModule.forFeature({
|
||||
name: UpdateBankingPlaidTransitionsQueueJob,
|
||||
adapter: BullMQAdapter,
|
||||
}),
|
||||
...models,
|
||||
],
|
||||
providers: [
|
||||
@@ -51,4 +57,4 @@ const models = [RegisterTenancyModel(PlaidItem)];
|
||||
exports: [...models],
|
||||
controllers: [BankingPlaidController, BankingPlaidWebhooksController],
|
||||
})
|
||||
export class BankingPlaidModule { }
|
||||
export class BankingPlaidModule {}
|
||||
|
||||
@@ -10,6 +10,8 @@ import { BankingRecognizedTransactionsController } from './BankingRecognizedTran
|
||||
import { RecognizedTransactionsApplication } from './RecognizedTransactions.application';
|
||||
import { GetRecognizedTransactionsService } from './GetRecongizedTransactions';
|
||||
import { GetRecognizedTransactionService } from './queries/GetRecognizedTransaction.service';
|
||||
import { BullBoardModule } from '@bull-board/nestjs';
|
||||
import { BullMQAdapter } from '@bull-board/api/bullMQAdapter';
|
||||
import { BullModule } from '@nestjs/bullmq';
|
||||
import { RecognizeUncategorizedTransactionsQueue } from './_types';
|
||||
import { RegonizeTransactionsPrcessor } from './jobs/RecognizeTransactionsJob';
|
||||
@@ -25,6 +27,10 @@ const models = [RegisterTenancyModel(RecognizedBankTransaction)];
|
||||
BullModule.registerQueue({
|
||||
name: RecognizeUncategorizedTransactionsQueue,
|
||||
}),
|
||||
BullBoardModule.forFeature({
|
||||
name: RecognizeUncategorizedTransactionsQueue,
|
||||
adapter: BullMQAdapter,
|
||||
}),
|
||||
...models,
|
||||
],
|
||||
providers: [
|
||||
|
||||
@@ -16,6 +16,8 @@ import {
|
||||
ComputeItemCostQueue,
|
||||
WriteInventoryTransactionsGLEntriesQueue,
|
||||
} from './types/InventoryCost.types';
|
||||
import { BullBoardModule } from '@bull-board/nestjs';
|
||||
import { BullMQAdapter } from '@bull-board/api/bullMQAdapter';
|
||||
import { BullModule } from '@nestjs/bullmq';
|
||||
import { InventoryAverageCostMethodService } from './commands/InventoryAverageCostMethod.service';
|
||||
import { InventoryItemCostService } from './commands/InventoryCosts.service';
|
||||
@@ -39,6 +41,14 @@ const models = [
|
||||
BullModule.registerQueue({
|
||||
name: WriteInventoryTransactionsGLEntriesQueue,
|
||||
}),
|
||||
BullBoardModule.forFeature({
|
||||
name: ComputeItemCostQueue,
|
||||
adapter: BullMQAdapter,
|
||||
}),
|
||||
BullBoardModule.forFeature({
|
||||
name: WriteInventoryTransactionsGLEntriesQueue,
|
||||
adapter: BullMQAdapter,
|
||||
}),
|
||||
forwardRef(() => SaleInvoicesModule),
|
||||
ImportModule,
|
||||
],
|
||||
@@ -56,7 +66,7 @@ const models = [
|
||||
InventoryItemCostService,
|
||||
InventoryItemOpeningAvgCostService,
|
||||
InventoryCostSubscriber,
|
||||
GetItemsInventoryValuationListService
|
||||
GetItemsInventoryValuationListService,
|
||||
],
|
||||
exports: [
|
||||
...models,
|
||||
@@ -64,6 +74,6 @@ const models = [
|
||||
InventoryItemCostService,
|
||||
InventoryComputeCostService,
|
||||
],
|
||||
controllers: [InventoryCostController]
|
||||
controllers: [InventoryCostController],
|
||||
})
|
||||
export class InventoryCostModule {}
|
||||
|
||||
@@ -3,6 +3,8 @@ import { GetCurrentOrganizationService } from './queries/GetCurrentOrganization.
|
||||
import { BuildOrganizationService } from './commands/BuildOrganization.service';
|
||||
import { UpdateOrganizationService } from './commands/UpdateOrganization.service';
|
||||
import { OrganizationController } from './Organization.controller';
|
||||
import { BullBoardModule } from '@bull-board/nestjs';
|
||||
import { BullMQAdapter } from '@bull-board/api/bullMQAdapter';
|
||||
import { BullModule } from '@nestjs/bullmq';
|
||||
import { OrganizationBuildQueue } from './Organization.types';
|
||||
import { OrganizationBuildProcessor } from './processors/OrganizationBuild.processor';
|
||||
@@ -25,10 +27,14 @@ import { GetBuildOrganizationBuildJob } from './commands/GetBuildOrganizationJob
|
||||
OrganizationBaseCurrencyLocking,
|
||||
SyncSystemUserToTenantService,
|
||||
SyncSystemUserToTenantSubscriber,
|
||||
GetBuildOrganizationBuildJob
|
||||
GetBuildOrganizationBuildJob,
|
||||
],
|
||||
imports: [
|
||||
BullModule.registerQueue({ name: OrganizationBuildQueue }),
|
||||
BullBoardModule.forFeature({
|
||||
name: OrganizationBuildQueue,
|
||||
adapter: BullMQAdapter,
|
||||
}),
|
||||
TenantDBManagerModule,
|
||||
],
|
||||
controllers: [OrganizationController],
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { BullBoardModule } from '@bull-board/nestjs';
|
||||
import { BullAdapter } from '@bull-board/api/bullAdapter';
|
||||
import { BullModule } from '@nestjs/bull';
|
||||
import { PaymentReceivesController } from './PaymentsReceived.controller';
|
||||
import { PaymentReceivesApplication } from './PaymentReceived.application';
|
||||
@@ -95,6 +97,10 @@ import { ValidateBulkDeletePaymentReceivedService } from './ValidateBulkDeletePa
|
||||
DynamicListModule,
|
||||
MailModule,
|
||||
BullModule.registerQueue({ name: SEND_PAYMENT_RECEIVED_MAIL_QUEUE }),
|
||||
BullBoardModule.forFeature({
|
||||
name: SEND_PAYMENT_RECEIVED_MAIL_QUEUE,
|
||||
adapter: BullAdapter,
|
||||
}),
|
||||
],
|
||||
})
|
||||
export class PaymentsReceivedModule {}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { BullBoardModule } from '@bull-board/nestjs';
|
||||
import { BullAdapter } from '@bull-board/api/bullAdapter';
|
||||
import { BullModule } from '@nestjs/bull';
|
||||
import { TenancyContext } from '../Tenancy/TenancyContext.service';
|
||||
import { TenancyDatabaseModule } from '../Tenancy/TenancyDB/TenancyDB.module';
|
||||
@@ -54,6 +56,10 @@ import { SendSaleEstimateMailProcess } from './processes/SendSaleEstimateMail.pr
|
||||
TemplateInjectableModule,
|
||||
PdfTemplatesModule,
|
||||
BullModule.registerQueue({ name: SendSaleEstimateMailQueue }),
|
||||
BullBoardModule.forFeature({
|
||||
name: SendSaleEstimateMailQueue,
|
||||
adapter: BullAdapter,
|
||||
}),
|
||||
],
|
||||
controllers: [SaleEstimatesController],
|
||||
providers: [
|
||||
@@ -99,4 +105,4 @@ import { SendSaleEstimateMailProcess } from './processes/SendSaleEstimateMail.pr
|
||||
GetSaleEstimateMailTemplateService,
|
||||
],
|
||||
})
|
||||
export class SaleEstimatesModule { }
|
||||
export class SaleEstimatesModule {}
|
||||
|
||||
@@ -45,6 +45,8 @@ import { SendSaleInvoiceMailCommon } from './commands/SendInvoiceInvoiceMailComm
|
||||
import { DynamicListModule } from '../DynamicListing/DynamicList.module';
|
||||
import { MailNotificationModule } from '../MailNotification/MailNotification.module';
|
||||
import { SendSaleInvoiceMailProcessor } from './processors/SendSaleInvoiceMail.processor';
|
||||
import { BullBoardModule } from '@bull-board/nestjs';
|
||||
import { BullAdapter } from '@bull-board/api/bullAdapter';
|
||||
import { BullModule } from '@nestjs/bull';
|
||||
import { SendSaleInvoiceQueue } from './constants';
|
||||
import { InvoicePaymentIntegrationSubscriber } from './subscribers/InvoicePaymentIntegrationSubscriber';
|
||||
@@ -81,6 +83,10 @@ import { ValidateBulkDeleteSaleInvoicesService } from './ValidateBulkDeleteSaleI
|
||||
forwardRef(() => PaymentLinksModule),
|
||||
DynamicListModule,
|
||||
BullModule.registerQueue({ name: SendSaleInvoiceQueue }),
|
||||
BullBoardModule.forFeature({
|
||||
name: SendSaleInvoiceQueue,
|
||||
adapter: BullAdapter,
|
||||
}),
|
||||
],
|
||||
controllers: [SaleInvoicesController],
|
||||
providers: [
|
||||
@@ -139,4 +145,4 @@ import { ValidateBulkDeleteSaleInvoicesService } from './ValidateBulkDeleteSaleI
|
||||
SaleInvoicesImportable,
|
||||
],
|
||||
})
|
||||
export class SaleInvoicesModule { }
|
||||
export class SaleInvoicesModule {}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { BullBoardModule } from '@bull-board/nestjs';
|
||||
import { BullAdapter } from '@bull-board/api/bullAdapter';
|
||||
import { BullModule } from '@nestjs/bull';
|
||||
import { SaleReceiptApplication } from './SaleReceiptApplication.service';
|
||||
import { CreateSaleReceipt } from './commands/CreateSaleReceipt.service';
|
||||
@@ -62,6 +64,10 @@ import { ValidateBulkDeleteSaleReceiptsService } from './ValidateBulkDeleteSaleR
|
||||
MailModule,
|
||||
MailNotificationModule,
|
||||
BullModule.registerQueue({ name: SendSaleReceiptMailQueue }),
|
||||
BullBoardModule.forFeature({
|
||||
name: SendSaleReceiptMailQueue,
|
||||
adapter: BullAdapter,
|
||||
}),
|
||||
],
|
||||
providers: [
|
||||
TenancyContext,
|
||||
@@ -95,4 +101,4 @@ import { ValidateBulkDeleteSaleReceiptsService } from './ValidateBulkDeleteSaleR
|
||||
ValidateBulkDeleteSaleReceiptsService,
|
||||
],
|
||||
})
|
||||
export class SaleReceiptsModule { }
|
||||
export class SaleReceiptsModule {}
|
||||
|
||||
Reference in New Issue
Block a user