All files / src/domains/finance finance.module.ts

0% Statements 0/14
100% Branches 0/0
100% Functions 0/0
0% Lines 0/12

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129                                                                                                                                                                                                                                                                 
import { Module } from '@nestjs/common';
import { MongooseModule } from '@nestjs/mongoose';
import { FinanceController } from './controllers/finance.controller';
import { MobileFinanceController } from '../../interfaces/mobile-api/employee/mobile-finance.controller';
import { EventBusModule } from '../../platform/events/event-bus.module';
import { AuditLogModule } from '../../platform/audit/audit-log.module';
import { BullModule } from '@nestjs/bullmq';
import { FinanceEventProcessor } from './integrations/processors/finance-event.processor';
 
import {
  FinanceConfiguration, FinanceConfigurationSchema,
  FinanceLegalEntity, FinanceLegalEntitySchema,
  AccountingBook, AccountingBookSchema,
  LedgerAccount, LedgerAccountSchema,
  AccountingDimensionDefinition, AccountingDimensionDefinitionSchema,
  AccountingDimensionValue, AccountingDimensionValueSchema,
  FinanceFiscalYear, FinanceFiscalYearSchema,
  FinancePeriod, FinancePeriodSchema,
  JournalEntry, JournalEntrySchema,
  JournalLine, JournalLineSchema,
  GeneralLedgerEntry, GeneralLedgerEntrySchema,
  VendorFinancialProfile, VendorFinancialProfileSchema,
  AccountsPayableInvoice, AccountsPayableInvoiceSchema,
  VendorPayment, VendorPaymentSchema,
  CustomerFinancialProfile, CustomerFinancialProfileSchema,
  CustomerInvoice, CustomerInvoiceSchema,
  CustomerReceipt, CustomerReceiptSchema,
  FinanceBankAccount, FinanceBankAccountSchema,
  BankStatement, BankStatementSchema,
  BankTransaction, BankTransactionSchema,
  GatewaySettlement, GatewaySettlementSchema,
  FinanceTaxRegistration, FinanceTaxRegistrationSchema,
  TaxTransaction, TaxTransactionSchema,
  FinanceBudget, FinanceBudgetSchema,
  BudgetLine, BudgetLineSchema,
  AllocationRule, AllocationRuleSchema,
  ClosingChecklistExecution, ClosingChecklistExecutionSchema,
  FinanceEventCheckpoint, FinanceEventCheckpointSchema
} from './schemas';
 
import {
  ChartOfAccountsService,
  PostingEngineService,
  AccountsPayableService,
  AccountsReceivableService,
  BankingService,
  TaxEngineService,
  BudgetService,
  AllocationService,
  FinancialStatementService,
  FinanceSeederService,
  ReconciliationService
} from './services';
 
import { FinanceEventHandler } from './integrations/services/finance-event.handler';
 
@Module({
  imports: [
    MongooseModule.forFeature([
      { name: FinanceConfiguration.name, schema: FinanceConfigurationSchema },
      { name: FinanceLegalEntity.name, schema: FinanceLegalEntitySchema },
      { name: AccountingBook.name, schema: AccountingBookSchema },
      { name: LedgerAccount.name, schema: LedgerAccountSchema },
      { name: AccountingDimensionDefinition.name, schema: AccountingDimensionDefinitionSchema },
      { name: AccountingDimensionValue.name, schema: AccountingDimensionValueSchema },
      { name: FinanceFiscalYear.name, schema: FinanceFiscalYearSchema },
      { name: FinancePeriod.name, schema: FinancePeriodSchema },
      { name: JournalEntry.name, schema: JournalEntrySchema },
      { name: JournalLine.name, schema: JournalLineSchema },
      { name: GeneralLedgerEntry.name, schema: GeneralLedgerEntrySchema },
      { name: VendorFinancialProfile.name, schema: VendorFinancialProfileSchema },
      { name: AccountsPayableInvoice.name, schema: AccountsPayableInvoiceSchema },
      { name: VendorPayment.name, schema: VendorPaymentSchema },
      { name: CustomerFinancialProfile.name, schema: CustomerFinancialProfileSchema },
      { name: CustomerInvoice.name, schema: CustomerInvoiceSchema },
      { name: CustomerReceipt.name, schema: CustomerReceiptSchema },
      { name: FinanceBankAccount.name, schema: FinanceBankAccountSchema },
      { name: BankStatement.name, schema: BankStatementSchema },
      { name: BankTransaction.name, schema: BankTransactionSchema },
      { name: GatewaySettlement.name, schema: GatewaySettlementSchema },
      { name: FinanceTaxRegistration.name, schema: FinanceTaxRegistrationSchema },
      { name: TaxTransaction.name, schema: TaxTransactionSchema },
      { name: FinanceBudget.name, schema: FinanceBudgetSchema },
      { name: BudgetLine.name, schema: BudgetLineSchema },
      { name: AllocationRule.name, schema: AllocationRuleSchema },
      { name: ClosingChecklistExecution.name, schema: ClosingChecklistExecutionSchema },
      { name: FinanceEventCheckpoint.name, schema: FinanceEventCheckpointSchema }
    ]),
    BullModule.registerQueue(
      { name: 'finance.event-posting' },
      { name: 'finance.event-retry' },
      { name: 'finance.event-dead-letter' },
      { name: 'finance.event-replay' }
    ),
    EventBusModule,
    AuditLogModule
  ],
  controllers: [FinanceController, MobileFinanceController],
  providers: [
    ChartOfAccountsService,
    PostingEngineService,
    AccountsPayableService,
    AccountsReceivableService,
    BankingService,
    TaxEngineService,
    BudgetService,
    AllocationService,
    FinancialStatementService,
    FinanceSeederService,
    FinanceEventHandler,
    FinanceEventProcessor,
    ReconciliationService
  ],
  exports: [
    ChartOfAccountsService,
    PostingEngineService,
    AccountsPayableService,
    AccountsReceivableService,
    BankingService,
    TaxEngineService,
    BudgetService,
    AllocationService,
    FinancialStatementService,
    FinanceSeederService,
    ReconciliationService
  ]
})
export class FinanceModule {}