mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 14:50:32 +00:00
refactor: banking modules to nestjs
This commit is contained in:
@@ -33,7 +33,8 @@ import { GetAccountTransactionsService } from './GetAccountTransactions.service'
|
|||||||
GetAccountTransactionsService,
|
GetAccountTransactionsService,
|
||||||
],
|
],
|
||||||
exports: [
|
exports: [
|
||||||
AccountRepository
|
AccountRepository,
|
||||||
|
CreateAccountService,
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class AccountsModule {}
|
export class AccountsModule {}
|
||||||
|
|||||||
@@ -56,6 +56,9 @@ import { PaymentsReceivedModule } from '../PaymentReceived/PaymentsReceived.modu
|
|||||||
import { LedgerModule } from '../Ledger/Ledger.module';
|
import { LedgerModule } from '../Ledger/Ledger.module';
|
||||||
import { BankRulesModule } from '../BankRules/BankRules.module';
|
import { BankRulesModule } from '../BankRules/BankRules.module';
|
||||||
import { BankAccountsModule } from '../BankingAccounts/BankAccounts.module';
|
import { BankAccountsModule } from '../BankingAccounts/BankAccounts.module';
|
||||||
|
import { BankingTransactionsExcludeModule } from '../BankingTransactionsExclude/BankingTransactionsExclude.module';
|
||||||
|
import { BankingTransactionsRegonizeModule } from '../BankingTranasctionsRegonize/BankingTransactionsRegonize.module';
|
||||||
|
import { BankingMatchingModule } from '../BankingMatching/BankingMatching.module';
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
imports: [
|
imports: [
|
||||||
@@ -134,9 +137,11 @@ import { BankAccountsModule } from '../BankingAccounts/BankAccounts.module';
|
|||||||
BillPaymentsModule,
|
BillPaymentsModule,
|
||||||
PaymentsReceivedModule,
|
PaymentsReceivedModule,
|
||||||
LedgerModule,
|
LedgerModule,
|
||||||
|
|
||||||
BankAccountsModule,
|
BankAccountsModule,
|
||||||
BankRulesModule,
|
BankRulesModule,
|
||||||
|
BankingTransactionsExcludeModule,
|
||||||
|
BankingTransactionsRegonizeModule,
|
||||||
|
// BankingMatchingModule
|
||||||
],
|
],
|
||||||
controllers: [AppController],
|
controllers: [AppController],
|
||||||
providers: [
|
providers: [
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import { BankRuleCondition } from './models/BankRuleCondition';
|
|||||||
import { BankRule } from './models/BankRule';
|
import { BankRule } from './models/BankRule';
|
||||||
import { BankRulesController } from './BankRules.controller';
|
import { BankRulesController } from './BankRules.controller';
|
||||||
import { UnlinkBankRuleOnDeleteBankRuleSubscriber } from './events/UnlinkBankRuleOnDeleteBankRule';
|
import { UnlinkBankRuleOnDeleteBankRuleSubscriber } from './events/UnlinkBankRuleOnDeleteBankRule';
|
||||||
|
import { DeleteBankRulesService } from './commands/DeleteBankRules.service';
|
||||||
|
|
||||||
const models = [
|
const models = [
|
||||||
RegisterTenancyModel(BankRule),
|
RegisterTenancyModel(BankRule),
|
||||||
@@ -24,11 +25,12 @@ const models = [
|
|||||||
CreateBankRuleService,
|
CreateBankRuleService,
|
||||||
EditBankRuleService,
|
EditBankRuleService,
|
||||||
DeleteBankRuleService,
|
DeleteBankRuleService,
|
||||||
|
DeleteBankRulesService,
|
||||||
GetBankRuleService,
|
GetBankRuleService,
|
||||||
GetBankRulesService,
|
GetBankRulesService,
|
||||||
BankRulesApplication,
|
BankRulesApplication,
|
||||||
UnlinkBankRuleOnDeleteBankRuleSubscriber
|
UnlinkBankRuleOnDeleteBankRuleSubscriber
|
||||||
],
|
],
|
||||||
exports: [...models],
|
exports: [...models, DeleteBankRuleService, DeleteBankRulesService],
|
||||||
})
|
})
|
||||||
export class BankRulesModule {}
|
export class BankRulesModule {}
|
||||||
|
|||||||
@@ -7,17 +7,21 @@ import { PauseBankAccountFeeds } from './commands/PauseBankAccountFeeds.service'
|
|||||||
import { DeleteUncategorizedTransactionsOnAccountDeleting } from './subscribers/DeleteUncategorizedTransactionsOnAccountDeleting';
|
import { DeleteUncategorizedTransactionsOnAccountDeleting } from './subscribers/DeleteUncategorizedTransactionsOnAccountDeleting';
|
||||||
import { DisconnectPlaidItemOnAccountDeleted } from './subscribers/DisconnectPlaidItemOnAccountDeleted';
|
import { DisconnectPlaidItemOnAccountDeleted } from './subscribers/DisconnectPlaidItemOnAccountDeleted';
|
||||||
import { BankAccountsController } from './BankAccounts.controller';
|
import { BankAccountsController } from './BankAccounts.controller';
|
||||||
|
import { BankingPlaidModule } from '../BankingPlaid/BankingPlaid.module';
|
||||||
|
import { PlaidModule } from '../Plaid/Plaid.module';
|
||||||
|
import { BankRulesModule } from '../BankRules/BankRules.module';
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
imports: [
|
imports: [BankingPlaidModule, PlaidModule, BankRulesModule],
|
||||||
|
providers: [
|
||||||
DisconnectBankAccountService,
|
DisconnectBankAccountService,
|
||||||
RefreshBankAccountService,
|
RefreshBankAccountService,
|
||||||
ResumeBankAccountFeedsService,
|
ResumeBankAccountFeedsService,
|
||||||
PauseBankAccountFeeds,
|
PauseBankAccountFeeds,
|
||||||
DeleteUncategorizedTransactionsOnAccountDeleting,
|
// DeleteUncategorizedTransactionsOnAccountDeleting,
|
||||||
DisconnectPlaidItemOnAccountDeleted,
|
DisconnectPlaidItemOnAccountDeleted,
|
||||||
|
BankAccountsApplication
|
||||||
],
|
],
|
||||||
providers: [BankAccountsApplication],
|
|
||||||
exports: [BankAccountsApplication],
|
exports: [BankAccountsApplication],
|
||||||
controllers: [BankAccountsController],
|
controllers: [BankAccountsController],
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ import { PlaidItem } from '@/modules/BankingPlaid/models/PlaidItem';
|
|||||||
import { ServiceError } from '@/modules/Items/ServiceError';
|
import { ServiceError } from '@/modules/Items/ServiceError';
|
||||||
import { events } from '@/common/events/events';
|
import { events } from '@/common/events/events';
|
||||||
import { EventEmitter2 } from '@nestjs/event-emitter';
|
import { EventEmitter2 } from '@nestjs/event-emitter';
|
||||||
|
|
||||||
import { PLAID_CLIENT } from '@/modules/Plaid/Plaid.module';
|
import { PLAID_CLIENT } from '@/modules/Plaid/Plaid.module';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
import { Module } from '@nestjs/common';
|
||||||
|
import { CreateUncategorizedTransactionService } from './commands/CreateUncategorizedTransaction.service';
|
||||||
|
import { CategorizeTransactionAsExpense } from './commands/CategorizeTransactionAsExpense';
|
||||||
|
import { BankingTransactionsModule } from '../BankingTransactions/BankingTransactions.module';
|
||||||
|
import { ExpensesModule } from '../Expenses/Expenses.module';
|
||||||
|
|
||||||
|
@Module({
|
||||||
|
imports: [BankingTransactionsModule, ExpensesModule],
|
||||||
|
providers: [
|
||||||
|
CreateUncategorizedTransactionService,
|
||||||
|
CategorizeTransactionAsExpense,
|
||||||
|
],
|
||||||
|
exports: [
|
||||||
|
CreateUncategorizedTransactionService,
|
||||||
|
CategorizeTransactionAsExpense,
|
||||||
|
],
|
||||||
|
})
|
||||||
|
export class BankingCategorizeModule {}
|
||||||
@@ -4,8 +4,6 @@ import {
|
|||||||
} from '@/interfaces';
|
} from '@/interfaces';
|
||||||
import { Knex } from 'knex';
|
import { Knex } from 'knex';
|
||||||
import { EventEmitter2 } from '@nestjs/event-emitter';
|
import { EventEmitter2 } from '@nestjs/event-emitter';
|
||||||
import { UncategorizedBankTransaction } from '@/modules/BankingTransactions/models/UncategorizedBankTransaction';
|
|
||||||
import { Expense } from '@/modules/Expenses/models/Expense.model';
|
|
||||||
import { BankTransaction } from '@/modules/BankingTransactions/models/BankTransaction';
|
import { BankTransaction } from '@/modules/BankingTransactions/models/BankTransaction';
|
||||||
import { CreateExpense } from '@/modules/Expenses/commands/CreateExpense.service';
|
import { CreateExpense } from '@/modules/Expenses/commands/CreateExpense.service';
|
||||||
import { Inject } from '@nestjs/common';
|
import { Inject } from '@nestjs/common';
|
||||||
@@ -21,12 +19,6 @@ export class CategorizeTransactionAsExpense {
|
|||||||
private readonly eventPublisher: EventEmitter2,
|
private readonly eventPublisher: EventEmitter2,
|
||||||
private readonly createExpenseService: CreateExpense,
|
private readonly createExpenseService: CreateExpense,
|
||||||
|
|
||||||
@Inject(UncategorizedBankTransaction.name)
|
|
||||||
private readonly uncategorizedBankTransactionModel: typeof UncategorizedBankTransaction,
|
|
||||||
|
|
||||||
@Inject(Expense.name)
|
|
||||||
private readonly expenseModel: typeof Expense,
|
|
||||||
|
|
||||||
@Inject(BankTransaction.name)
|
@Inject(BankTransaction.name)
|
||||||
private readonly bankTransactionModel: typeof BankTransaction,
|
private readonly bankTransactionModel: typeof BankTransaction,
|
||||||
) {}
|
) {}
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ export interface ICategorizeCashflowTransactioDTO {
|
|||||||
transactionNumber: string;
|
transactionNumber: string;
|
||||||
transactionType: string;
|
transactionType: string;
|
||||||
exchangeRate: number;
|
exchangeRate: number;
|
||||||
|
currencyCode: string;
|
||||||
description: string;
|
description: string;
|
||||||
branchId: number;
|
branchId: number;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,12 +14,24 @@ import { DecrementUncategorizedTransactionOnMatchingSubscriber } from './events/
|
|||||||
import { ValidateMatchingOnPaymentMadeDeleteSubscriber } from './events/ValidateMatchingOnPaymentMadeDelete';
|
import { ValidateMatchingOnPaymentMadeDeleteSubscriber } from './events/ValidateMatchingOnPaymentMadeDelete';
|
||||||
import { ValidateMatchingOnManualJournalDeleteSubscriber } from './events/ValidateMatchingOnManualJournalDelete';
|
import { ValidateMatchingOnManualJournalDeleteSubscriber } from './events/ValidateMatchingOnManualJournalDelete';
|
||||||
import { ValidateMatchingOnCashflowDeleteSubscriber } from './events/ValidateMatchingOnCashflowDelete';
|
import { ValidateMatchingOnCashflowDeleteSubscriber } from './events/ValidateMatchingOnCashflowDelete';
|
||||||
|
import { BillPaymentsModule } from '../BillPayments/BillPayments.module';
|
||||||
|
import { BankingTransactionsModule } from '../BankingTransactions/BankingTransactions.module';
|
||||||
|
import { PaymentsReceivedModule } from '../PaymentReceived/PaymentsReceived.module';
|
||||||
|
import { MatchBankTransactions } from './commands/MatchTransactions';
|
||||||
|
import { MatchTransactionsTypes } from './commands/MatchTransactionsTypes';
|
||||||
|
|
||||||
const models = [RegisterTenancyModel(MatchedBankTransaction)];
|
const models = [RegisterTenancyModel(MatchedBankTransaction)];
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
|
imports: [
|
||||||
|
BillPaymentsModule,
|
||||||
|
BankingTransactionsModule,
|
||||||
|
PaymentsReceivedModule,
|
||||||
|
],
|
||||||
providers: [
|
providers: [
|
||||||
...models,
|
...models,
|
||||||
|
MatchBankTransactions,
|
||||||
|
MatchTransactionsTypes,
|
||||||
GetMatchedTransactionsByBills,
|
GetMatchedTransactionsByBills,
|
||||||
GetMatchedTransactionsByCashflow,
|
GetMatchedTransactionsByCashflow,
|
||||||
GetMatchedTransactionsByExpenses,
|
GetMatchedTransactionsByExpenses,
|
||||||
@@ -32,7 +44,7 @@ const models = [RegisterTenancyModel(MatchedBankTransaction)];
|
|||||||
DecrementUncategorizedTransactionOnMatchingSubscriber,
|
DecrementUncategorizedTransactionOnMatchingSubscriber,
|
||||||
ValidateMatchingOnPaymentMadeDeleteSubscriber,
|
ValidateMatchingOnPaymentMadeDeleteSubscriber,
|
||||||
ValidateMatchingOnManualJournalDeleteSubscriber,
|
ValidateMatchingOnManualJournalDeleteSubscriber,
|
||||||
ValidateMatchingOnCashflowDeleteSubscriber
|
ValidateMatchingOnCashflowDeleteSubscriber,
|
||||||
],
|
],
|
||||||
exports: [...models],
|
exports: [...models],
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -54,8 +54,8 @@ export class MatchTransactionsTypes {
|
|||||||
const instance = MatchTransactionsTypesRegistry.getInstance();
|
const instance = MatchTransactionsTypesRegistry.getInstance();
|
||||||
|
|
||||||
this.registered.forEach((registered) => {
|
this.registered.forEach((registered) => {
|
||||||
const serviceInstanace = Container.get(registered.service);
|
// const serviceInstanace = Container.get(registered.service);
|
||||||
instance.register(registered.type, serviceInstanace);
|
// instance.register(registered.type, serviceInstanace);
|
||||||
});
|
});
|
||||||
MatchTransactionsTypes.registry = instance;
|
MatchTransactionsTypes.registry = instance;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { initialize } from 'objection';
|
|
||||||
import { Inject, Injectable } from '@nestjs/common';
|
import { Inject, Injectable } from '@nestjs/common';
|
||||||
import { Knex } from 'knex';
|
import { Knex } from 'knex';
|
||||||
import { first } from 'lodash';
|
import { first } from 'lodash';
|
||||||
|
|||||||
@@ -1,20 +1,44 @@
|
|||||||
import { Module } from "@nestjs/common";
|
import { Module } from '@nestjs/common';
|
||||||
import { PlaidUpdateTransactionsOnItemCreatedSubscriber } from "./subscribers/PlaidUpdateTransactionsOnItemCreatedSubscriber";
|
import { PlaidUpdateTransactionsOnItemCreatedSubscriber } from './subscribers/PlaidUpdateTransactionsOnItemCreatedSubscriber';
|
||||||
import { PlaidUpdateTransactions } from "./command/PlaidUpdateTransactions";
|
import { PlaidUpdateTransactions } from './command/PlaidUpdateTransactions';
|
||||||
import { PlaidSyncDb } from "./command/PlaidSyncDB";
|
import { PlaidSyncDb } from './command/PlaidSyncDB';
|
||||||
import { PlaidWebooks } from "./command/PlaidWebhooks";
|
import { PlaidWebooks } from './command/PlaidWebhooks';
|
||||||
import { PlaidLinkTokenService } from "./queries/GetPlaidLinkToken.service";
|
import { PlaidLinkTokenService } from './queries/GetPlaidLinkToken.service';
|
||||||
import { PlaidApplication } from "./PlaidApplication";
|
import { PlaidApplication } from './PlaidApplication';
|
||||||
|
import { RegisterTenancyModel } from '../Tenancy/TenancyModels/Tenancy.module';
|
||||||
|
import { PlaidItem } from './models/PlaidItem';
|
||||||
|
import { PlaidModule } from '../Plaid/Plaid.module';
|
||||||
|
import { AccountsModule } from '../Accounts/Accounts.module';
|
||||||
|
import { BankingCategorizeModule } from '../BankingCategorize/BankingCategorize.module';
|
||||||
|
import { BankingTransactionsModule } from '../BankingTransactions/BankingTransactions.module';
|
||||||
|
import { PlaidItemService } from './command/PlaidItem';
|
||||||
|
import { TenancyContext } from '../Tenancy/TenancyContext.service';
|
||||||
|
import { InjectSystemModel } from '../System/SystemModels/SystemModels.module';
|
||||||
|
import { SystemPlaidItem } from './models/SystemPlaidItem';
|
||||||
|
|
||||||
|
const models = [
|
||||||
|
RegisterTenancyModel(PlaidItem),
|
||||||
|
InjectSystemModel(SystemPlaidItem),
|
||||||
|
];
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
|
imports: [
|
||||||
|
PlaidModule,
|
||||||
|
AccountsModule,
|
||||||
|
BankingCategorizeModule,
|
||||||
|
BankingTransactionsModule,
|
||||||
|
],
|
||||||
providers: [
|
providers: [
|
||||||
|
...models,
|
||||||
|
PlaidItemService,
|
||||||
PlaidUpdateTransactions,
|
PlaidUpdateTransactions,
|
||||||
PlaidSyncDb,
|
PlaidSyncDb,
|
||||||
PlaidWebooks,
|
PlaidWebooks,
|
||||||
PlaidLinkTokenService,
|
PlaidLinkTokenService,
|
||||||
PlaidApplication,
|
PlaidApplication,
|
||||||
PlaidUpdateTransactionsOnItemCreatedSubscriber,
|
PlaidUpdateTransactionsOnItemCreatedSubscriber,
|
||||||
|
TenancyContext,
|
||||||
],
|
],
|
||||||
|
exports: [...models],
|
||||||
})
|
})
|
||||||
export class BankingPlaidModule {}
|
export class BankingPlaidModule {}
|
||||||
|
|||||||
@@ -15,10 +15,12 @@ import { PLAID_CLIENT } from '@/modules/Plaid/Plaid.module';
|
|||||||
@Injectable()
|
@Injectable()
|
||||||
export class PlaidUpdateTransactions {
|
export class PlaidUpdateTransactions {
|
||||||
constructor(
|
constructor(
|
||||||
private readonly plaidItemModel: typeof PlaidItem,
|
|
||||||
private readonly plaidSync: PlaidSyncDb,
|
private readonly plaidSync: PlaidSyncDb,
|
||||||
private readonly uow: UnitOfWork,
|
private readonly uow: UnitOfWork,
|
||||||
|
|
||||||
|
@Inject(PlaidItem.name)
|
||||||
|
private readonly plaidItemModel: typeof PlaidItem,
|
||||||
|
|
||||||
@Inject(PLAID_CLIENT)
|
@Inject(PLAID_CLIENT)
|
||||||
private readonly plaidClient: PlaidApi,
|
private readonly plaidClient: PlaidApi,
|
||||||
) {}
|
) {}
|
||||||
|
|||||||
@@ -5,10 +5,13 @@ import { GetAutofillCategorizeTransactionService } from './queries/GetAutofillCa
|
|||||||
import { RevertRecognizedTransactionsService } from './commands/RevertRecognizedTransactions.service';
|
import { RevertRecognizedTransactionsService } from './commands/RevertRecognizedTransactions.service';
|
||||||
import { RecognizeTranasctionsService } from './commands/RecognizeTranasctions.service';
|
import { RecognizeTranasctionsService } from './commands/RecognizeTranasctions.service';
|
||||||
import { TriggerRecognizedTransactionsSubscriber } from './events/TriggerRecognizedTransactions';
|
import { TriggerRecognizedTransactionsSubscriber } from './events/TriggerRecognizedTransactions';
|
||||||
|
import { BankingTransactionsModule } from '../BankingTransactions/BankingTransactions.module';
|
||||||
|
import { BankRulesModule } from '../BankRules/BankRules.module';
|
||||||
|
|
||||||
const models = [RegisterTenancyModel(RecognizedBankTransaction)];
|
const models = [RegisterTenancyModel(RecognizedBankTransaction)];
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
|
imports: [BankingTransactionsModule, BankRulesModule],
|
||||||
providers: [
|
providers: [
|
||||||
...models,
|
...models,
|
||||||
GetAutofillCategorizeTransactionService,
|
GetAutofillCategorizeTransactionService,
|
||||||
|
|||||||
@@ -3,9 +3,7 @@ export interface RevertRecognizedTransactionsCriteria {
|
|||||||
accountId?: number;
|
accountId?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export interface RecognizeTransactionsCriteria {
|
export interface RecognizeTransactionsCriteria {
|
||||||
batch?: string;
|
batch?: string;
|
||||||
accountId?: number;
|
accountId?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,15 @@ import { PreventDeleteTransactionOnDeleteSubscriber } from './subscribers/Preven
|
|||||||
import { ValidateDeleteBankAccountTransactions } from './commands/ValidateDeleteBankAccountTransactions.service';
|
import { ValidateDeleteBankAccountTransactions } from './commands/ValidateDeleteBankAccountTransactions.service';
|
||||||
import { BankTransactionGLEntriesService } from './commands/BankTransactionGLEntries';
|
import { BankTransactionGLEntriesService } from './commands/BankTransactionGLEntries';
|
||||||
import { BankingTransactionsApplication } from './BankingTransactionsApplication.service';
|
import { BankingTransactionsApplication } from './BankingTransactionsApplication.service';
|
||||||
|
import { AutoIncrementOrdersModule } from '../AutoIncrementOrders/AutoIncrementOrders.module';
|
||||||
|
import { LedgerModule } from '../Ledger/Ledger.module';
|
||||||
|
import { DeleteCashflowTransaction } from './commands/DeleteCashflowTransaction.service';
|
||||||
|
import { CreateBankTransactionService } from './commands/CreateBankTransaction.service';
|
||||||
|
import { GetBankTransactionService } from './queries/GetBankTransaction.service';
|
||||||
|
import { CommandBankTransactionValidator } from './commands/CommandCasflowValidator.service';
|
||||||
|
import { BranchTransactionDTOTransformer } from '../Branches/integrations/BranchTransactionDTOTransform';
|
||||||
|
import { BranchesModule } from '../Branches/Branches.module';
|
||||||
|
import { RemovePendingUncategorizedTransaction } from './commands/RemovePendingUncategorizedTransaction.service';
|
||||||
|
|
||||||
const models = [
|
const models = [
|
||||||
RegisterTenancyModel(UncategorizedBankTransaction),
|
RegisterTenancyModel(UncategorizedBankTransaction),
|
||||||
@@ -19,7 +28,8 @@ const models = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
exports: [
|
imports: [AutoIncrementOrdersModule, LedgerModule, BranchesModule],
|
||||||
|
providers: [
|
||||||
BankTransactionAutoIncrement,
|
BankTransactionAutoIncrement,
|
||||||
BankTransactionGLEntriesService,
|
BankTransactionGLEntriesService,
|
||||||
ValidateDeleteBankAccountTransactions,
|
ValidateDeleteBankAccountTransactions,
|
||||||
@@ -28,8 +38,14 @@ const models = [
|
|||||||
DeleteCashflowTransactionOnUncategorizeSubscriber,
|
DeleteCashflowTransactionOnUncategorizeSubscriber,
|
||||||
PreventDeleteTransactionOnDeleteSubscriber,
|
PreventDeleteTransactionOnDeleteSubscriber,
|
||||||
BankingTransactionsApplication,
|
BankingTransactionsApplication,
|
||||||
|
DeleteCashflowTransaction,
|
||||||
|
CreateBankTransactionService,
|
||||||
|
GetBankTransactionService,
|
||||||
|
CommandBankTransactionValidator,
|
||||||
|
BranchTransactionDTOTransformer,
|
||||||
|
RemovePendingUncategorizedTransaction,
|
||||||
...models,
|
...models,
|
||||||
],
|
],
|
||||||
providers: [...models],
|
exports: [...models, RemovePendingUncategorizedTransaction],
|
||||||
})
|
})
|
||||||
export class BankingTransactionsModule {}
|
export class BankingTransactionsModule {}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import {
|
|||||||
} from './constants';
|
} from './constants';
|
||||||
import { ICashflowNewCommandDTO } from './types/BankingTransactions.types';
|
import { ICashflowNewCommandDTO } from './types/BankingTransactions.types';
|
||||||
import { UncategorizedBankTransaction } from './models/UncategorizedBankTransaction';
|
import { UncategorizedBankTransaction } from './models/UncategorizedBankTransaction';
|
||||||
|
import { ICategorizeCashflowTransactioDTO } from '../BankingCategorize/types/BankingCategorize.types';
|
||||||
import { ServiceError } from '../Items/ServiceError';
|
import { ServiceError } from '../Items/ServiceError';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -50,7 +51,7 @@ export const getCashflowAccountTransactionsTypes = () => {
|
|||||||
*/
|
*/
|
||||||
export const transformCategorizeTransToCashflow = (
|
export const transformCategorizeTransToCashflow = (
|
||||||
uncategorizeTransactions: Array<UncategorizedBankTransaction>,
|
uncategorizeTransactions: Array<UncategorizedBankTransaction>,
|
||||||
categorizeDTO: ICategorizeBankTransactionDTO,
|
categorizeDTO: ICategorizeCashflowTransactioDTO,
|
||||||
): ICashflowNewCommandDTO => {
|
): ICashflowNewCommandDTO => {
|
||||||
const uncategorizeTransaction = first(uncategorizeTransactions);
|
const uncategorizeTransaction = first(uncategorizeTransactions);
|
||||||
const amount = sumBy(uncategorizeTransactions, 'amount');
|
const amount = sumBy(uncategorizeTransactions, 'amount');
|
||||||
|
|||||||
@@ -7,8 +7,10 @@ import { ExcludeBankTransactionsService } from './commands/ExcludeBankTransactio
|
|||||||
import { UnexcludeBankTransactionsService } from './commands/UnexcludeBankTransactions.service';
|
import { UnexcludeBankTransactionsService } from './commands/UnexcludeBankTransactions.service';
|
||||||
import { DecrementUncategorizedTransactionOnExclude } from './subscribers/DecrementUncategorizedTransactionOnExclude';
|
import { DecrementUncategorizedTransactionOnExclude } from './subscribers/DecrementUncategorizedTransactionOnExclude';
|
||||||
import { BankingTransactionsExcludeController } from './BankingTransactionsExclude.controller';
|
import { BankingTransactionsExcludeController } from './BankingTransactionsExclude.controller';
|
||||||
|
import { BankingTransactionsModule } from '../BankingTransactions/BankingTransactions.module';
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
|
imports: [BankingTransactionsModule],
|
||||||
providers: [
|
providers: [
|
||||||
ExcludeBankTransactionsApplication,
|
ExcludeBankTransactionsApplication,
|
||||||
ExcludeBankTransactionService,
|
ExcludeBankTransactionService,
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ import { AccountsModule } from '../Accounts/Accounts.module';
|
|||||||
BillPaymentGLEntries,
|
BillPaymentGLEntries,
|
||||||
BillPaymentGLEntriesSubscriber,
|
BillPaymentGLEntriesSubscriber,
|
||||||
],
|
],
|
||||||
exports: [BillPaymentValidators],
|
exports: [BillPaymentValidators, CreateBillPaymentService],
|
||||||
controllers: [BillPaymentsController],
|
controllers: [BillPaymentsController],
|
||||||
})
|
})
|
||||||
export class BillPaymentsModule {}
|
export class BillPaymentsModule {}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export interface IBillPaymentDTO {
|
|||||||
amount: number;
|
amount: number;
|
||||||
paymentAccountId: number;
|
paymentAccountId: number;
|
||||||
paymentNumber?: string;
|
paymentNumber?: string;
|
||||||
paymentDate: Date;
|
paymentDate: Date | string;
|
||||||
exchangeRate?: number;
|
exchangeRate?: number;
|
||||||
statement: string;
|
statement: string;
|
||||||
reference: string;
|
reference: string;
|
||||||
|
|||||||
@@ -19,6 +19,9 @@ import { BranchesModule } from '../Branches/Branches.module';
|
|||||||
@Module({
|
@Module({
|
||||||
imports: [LedgerModule, BranchesModule],
|
imports: [LedgerModule, BranchesModule],
|
||||||
controllers: [ExpensesController],
|
controllers: [ExpensesController],
|
||||||
|
exports: [
|
||||||
|
CreateExpense,
|
||||||
|
],
|
||||||
providers: [
|
providers: [
|
||||||
CreateExpense,
|
CreateExpense,
|
||||||
ExpenseDTOTransformer,
|
ExpenseDTOTransformer,
|
||||||
|
|||||||
@@ -46,10 +46,8 @@ export class PaymentReceivesApplication {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Edit details the given payment receive with associated entries.
|
* Edit details the given payment receive with associated entries.
|
||||||
* @param {number} tenantId
|
* @param {number} paymentReceiveId - Payment receive id.
|
||||||
* @param {number} paymentReceiveId
|
* @param {IPaymentReceivedEditDTO} paymentReceiveDTO - Payment receive data.
|
||||||
* @param {IPaymentReceivedEditDTO} paymentReceiveDTO
|
|
||||||
* @param {ISystemUser} authorizedUser
|
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
public editPaymentReceive(
|
public editPaymentReceive(
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ import { AccountsModule } from '../Accounts/Accounts.module';
|
|||||||
PaymentReceivedGLEntriesSubscriber,
|
PaymentReceivedGLEntriesSubscriber,
|
||||||
PaymentReceivedSyncInvoicesSubscriber,
|
PaymentReceivedSyncInvoicesSubscriber,
|
||||||
],
|
],
|
||||||
exports: [PaymentReceivesApplication],
|
exports: [PaymentReceivesApplication, CreatePaymentReceivedService],
|
||||||
imports: [
|
imports: [
|
||||||
ChromiumlyTenancyModule,
|
ChromiumlyTenancyModule,
|
||||||
TemplateInjectableModule,
|
TemplateInjectableModule,
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ const modelProviders = models.map((model) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
export const InjectSystemModel = (model: typeof Model) => ({
|
export const InjectSystemModel = (model: typeof Model) => ({
|
||||||
value: model,
|
useValue: model,
|
||||||
provide: model.name,
|
provide: model.name,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user