diff --git a/packages/server/nest-cli.json b/packages/server/nest-cli.json index 20fb98ab7..4628e92e9 100644 --- a/packages/server/nest-cli.json +++ b/packages/server/nest-cli.json @@ -7,7 +7,7 @@ "deleteOutDir": true, "assets": [ { "include": "i18n/**/*", "watchAssets": true }, - { "include": "database/**/*", "watchAssets": true } + { "include": "database/**/*", "exclude": "**/*.ts", "watchAssets": true } ] }, "projects": { diff --git a/packages/server/src/modules/Auth/processors/SendResetPasswordMail.processor.ts b/packages/server/src/modules/Auth/processors/SendResetPasswordMail.processor.ts index 40db6b82c..e09e0c396 100644 --- a/packages/server/src/modules/Auth/processors/SendResetPasswordMail.processor.ts +++ b/packages/server/src/modules/Auth/processors/SendResetPasswordMail.processor.ts @@ -1,10 +1,6 @@ import { Processor, WorkerHost } from '@nestjs/bullmq'; import { Scope } from '@nestjs/common'; -import { - SendResetPasswordMailJob, - SendResetPasswordMailQueue, -} from '../Auth.constants'; -import { Process } from '@nestjs/bull'; +import { SendResetPasswordMailQueue } from '../Auth.constants'; import { Job } from 'bullmq'; import { AuthenticationMailMesssages } from '../AuthMailMessages.esrvice'; import { MailTransporter } from '@/modules/Mail/MailTransporter.service'; @@ -23,7 +19,6 @@ export class SendResetPasswordMailProcessor extends WorkerHost { super(); } - @Process(SendResetPasswordMailJob) async process(job: Job) { try { await this.authMailMesssages.sendResetPasswordMail( diff --git a/packages/server/src/modules/Auth/processors/SendSignupVerificationMail.processor.ts b/packages/server/src/modules/Auth/processors/SendSignupVerificationMail.processor.ts index 30c05f603..1ce83d4bc 100644 --- a/packages/server/src/modules/Auth/processors/SendSignupVerificationMail.processor.ts +++ b/packages/server/src/modules/Auth/processors/SendSignupVerificationMail.processor.ts @@ -1,11 +1,7 @@ import { Scope } from '@nestjs/common'; import { Job } from 'bullmq'; -import { Process } from '@nestjs/bull'; import { Processor, WorkerHost } from '@nestjs/bullmq'; -import { - SendSignupVerificationMailJob, - SendSignupVerificationMailQueue, -} from '../Auth.constants'; +import { SendSignupVerificationMailQueue } from '../Auth.constants'; import { MailTransporter } from '@/modules/Mail/MailTransporter.service'; import { AuthenticationMailMesssages } from '../AuthMailMessages.esrvice'; @@ -21,7 +17,6 @@ export class SendSignupVerificationMailProcessor extends WorkerHost { super(); } - @Process(SendSignupVerificationMailJob) async process(job: Job) { try { await this.authMailMesssages.sendSignupVerificationMail( diff --git a/packages/server/src/modules/BankingPlaid/jobs/PlaidFetchTransactionsJob.ts b/packages/server/src/modules/BankingPlaid/jobs/PlaidFetchTransactionsJob.ts index 03c2a53ac..c30a78b0c 100644 --- a/packages/server/src/modules/BankingPlaid/jobs/PlaidFetchTransactionsJob.ts +++ b/packages/server/src/modules/BankingPlaid/jobs/PlaidFetchTransactionsJob.ts @@ -1,11 +1,9 @@ -import { Process } from '@nestjs/bull'; import { UseCls } from 'nestjs-cls'; import { Processor, WorkerHost } from '@nestjs/bullmq'; import { Scope } from '@nestjs/common'; import { Job } from 'bullmq'; import { PlaidFetchTransitonsEventPayload, - UpdateBankingPlaidTransitionsJob, UpdateBankingPlaidTransitionsQueueJob, } from '../types/BankingPlaid.types'; import { PlaidUpdateTransactions } from '../command/PlaidUpdateTransactions'; @@ -28,7 +26,6 @@ export class PlaidFetchTransactionsProcessor extends WorkerHost { /** * Triggers the function. */ - @Process(UpdateBankingPlaidTransitionsJob) @UseCls() async process(job: Job) { const { plaidItemId } = job.data; diff --git a/packages/server/src/modules/BankingTranasctionsRegonize/jobs/RecognizeTransactionsJob.ts b/packages/server/src/modules/BankingTranasctionsRegonize/jobs/RecognizeTransactionsJob.ts index cddd30f81..3e4c81a85 100644 --- a/packages/server/src/modules/BankingTranasctionsRegonize/jobs/RecognizeTransactionsJob.ts +++ b/packages/server/src/modules/BankingTranasctionsRegonize/jobs/RecognizeTransactionsJob.ts @@ -7,7 +7,6 @@ import { RecognizeUncategorizedTransactionsJobPayload, RecognizeUncategorizedTransactionsQueue, } from '../_types'; -import { Process } from '@nestjs/bull'; @Processor({ name: RecognizeUncategorizedTransactionsQueue, @@ -28,7 +27,6 @@ export class RegonizeTransactionsPrcessor extends WorkerHost { /** * Triggers sending invoice mail. */ - @Process(RecognizeUncategorizedTransactionsQueue) @UseCls() async process(job: Job) { const { ruleId, transactionsCriteria } = job.data; diff --git a/packages/server/src/modules/CLI/commands/BaseCommand.ts b/packages/server/src/modules/CLI/commands/BaseCommand.ts index b69f37c68..896dd386e 100644 --- a/packages/server/src/modules/CLI/commands/BaseCommand.ts +++ b/packages/server/src/modules/CLI/commands/BaseCommand.ts @@ -22,6 +22,7 @@ export abstract class BaseCommand extends CommandRunner { }, migrations: { directory: this.configService.get('systemDatabase.migrationDir'), + loadExtensions: ['.js'], }, seeds: { directory: this.configService.get('systemDatabase.seedsDir'), @@ -43,6 +44,7 @@ export abstract class BaseCommand extends CommandRunner { }, migrations: { directory: this.configService.get('tenantDatabase.migrationsDir') || './src/database/migrations', + loadExtensions: ['.js'], }, seeds: { directory: this.configService.get('tenantDatabase.seedsDir') || './src/database/seeds/core', diff --git a/packages/server/src/modules/InventoryCost/processors/ComputeItemCost.processor.ts b/packages/server/src/modules/InventoryCost/processors/ComputeItemCost.processor.ts index 1bbd610ae..93cceaef9 100644 --- a/packages/server/src/modules/InventoryCost/processors/ComputeItemCost.processor.ts +++ b/packages/server/src/modules/InventoryCost/processors/ComputeItemCost.processor.ts @@ -7,11 +7,7 @@ import * as moment from 'moment'; import { TenantJobPayload } from '@/interfaces/Tenant'; import { InventoryComputeCostService } from '../commands/InventoryComputeCost.service'; import { events } from '@/common/events/events'; -import { - ComputeItemCostQueue, - ComputeItemCostQueueJob, -} from '../types/InventoryCost.types'; -import { Process } from '@nestjs/bull'; +import { ComputeItemCostQueue } from '../types/InventoryCost.types'; interface ComputeItemCostJobPayload extends TenantJobPayload { itemId: number; @@ -39,7 +35,6 @@ export class ComputeItemCostProcessor extends WorkerHost { * Process the compute item cost job. * @param {Job} job - The job to process */ - @Process(ComputeItemCostQueueJob) @UseCls() async process(job: Job) { const { itemId, startingDate, organizationId, userId } = job.data; diff --git a/packages/server/src/modules/InventoryCost/processors/WriteInventoryTransactionsGLEntries.processor.ts b/packages/server/src/modules/InventoryCost/processors/WriteInventoryTransactionsGLEntries.processor.ts index c17b804ef..77657616c 100644 --- a/packages/server/src/modules/InventoryCost/processors/WriteInventoryTransactionsGLEntries.processor.ts +++ b/packages/server/src/modules/InventoryCost/processors/WriteInventoryTransactionsGLEntries.processor.ts @@ -1,8 +1,4 @@ -import { Process } from '@nestjs/bull'; -import { - WriteInventoryTransactionsGLEntriesQueue, - WriteInventoryTransactionsGLEntriesQueueJob, -} from '../types/InventoryCost.types'; +import { WriteInventoryTransactionsGLEntriesQueue } from '../types/InventoryCost.types'; import { Processor, WorkerHost } from '@nestjs/bullmq'; import { Scope } from '@nestjs/common'; @@ -15,6 +11,5 @@ export class WriteInventoryTransactionsGLEntriesProcessor extends WorkerHost { super(); } - @Process(WriteInventoryTransactionsGLEntriesQueueJob) async process() {} } diff --git a/packages/server/src/modules/Organization/processors/OrganizationBuild.processor.ts b/packages/server/src/modules/Organization/processors/OrganizationBuild.processor.ts index 6eca5d010..78d58a62c 100644 --- a/packages/server/src/modules/Organization/processors/OrganizationBuild.processor.ts +++ b/packages/server/src/modules/Organization/processors/OrganizationBuild.processor.ts @@ -2,10 +2,8 @@ import { Processor, WorkerHost } from '@nestjs/bullmq'; import { Scope } from '@nestjs/common'; import { Job } from 'bullmq'; import { ClsService, UseCls } from 'nestjs-cls'; -import { Process } from '@nestjs/bull'; import { OrganizationBuildQueue, - OrganizationBuildQueueJob, OrganizationBuildQueueJobPayload, } from '../Organization.types'; import { BuildOrganizationService } from '../commands/BuildOrganization.service'; @@ -22,7 +20,6 @@ export class OrganizationBuildProcessor extends WorkerHost { super(); } - @Process(OrganizationBuildQueueJob) @UseCls() async process(job: Job) { console.log('Processing organization build job:', job.id); diff --git a/packages/server/src/modules/System/SystemDB/SystemDB.module.ts b/packages/server/src/modules/System/SystemDB/SystemDB.module.ts index 4abb02588..d1387efa5 100644 --- a/packages/server/src/modules/System/SystemDB/SystemDB.module.ts +++ b/packages/server/src/modules/System/SystemDB/SystemDB.module.ts @@ -22,6 +22,7 @@ const providers = [ }, migrations: { directory: configService.get('systemDatabase.migrationDir'), + loadExtensions: ['.js'], }, seeds: { directory: configService.get('systemDatabase.seedsDir'), diff --git a/packages/server/src/modules/Tenancy/TenancyDB/TenancyDB.module.ts b/packages/server/src/modules/Tenancy/TenancyDB/TenancyDB.module.ts index ad2690e08..8a977fdb9 100644 --- a/packages/server/src/modules/Tenancy/TenancyDB/TenancyDB.module.ts +++ b/packages/server/src/modules/Tenancy/TenancyDB/TenancyDB.module.ts @@ -33,6 +33,7 @@ export const TenancyDatabaseProxyProvider = ClsModule.forFeatureAsync({ }, migrations: { directory: configService.get('tenantDatabase.migrationsDir'), + loadExtensions: ['.js'], }, seeds: { directory: configService.get('tenantDatabase.seedsDir'),