mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 21:30:31 +00:00
fix: e2e test cases
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { forwardRef, Module } from '@nestjs/common';
|
||||
import { CreateBankRuleService } from './commands/CreateBankRule.service';
|
||||
import { EditBankRuleService } from './commands/EditBankRule.service';
|
||||
import { DeleteBankRuleService } from './commands/DeleteBankRule.service';
|
||||
@@ -11,6 +11,7 @@ import { BankRule } from './models/BankRule';
|
||||
import { BankRulesController } from './BankRules.controller';
|
||||
import { UnlinkBankRuleOnDeleteBankRuleSubscriber } from './events/UnlinkBankRuleOnDeleteBankRule';
|
||||
import { DeleteBankRulesService } from './commands/DeleteBankRules.service';
|
||||
import { BankingTransactionsRegonizeModule } from '../BankingTranasctionsRegonize/BankingTransactionsRegonize.module';
|
||||
|
||||
const models = [
|
||||
RegisterTenancyModel(BankRule),
|
||||
@@ -19,7 +20,7 @@ const models = [
|
||||
|
||||
@Module({
|
||||
controllers: [BankRulesController],
|
||||
imports: [],
|
||||
imports: [forwardRef(() => BankingTransactionsRegonizeModule)],
|
||||
providers: [
|
||||
...models,
|
||||
CreateBankRuleService,
|
||||
|
||||
@@ -6,7 +6,9 @@ import { OnEvent } from '@nestjs/event-emitter';
|
||||
|
||||
@Injectable()
|
||||
export class UnlinkBankRuleOnDeleteBankRuleSubscriber {
|
||||
private revertRecognizedTransactionsService: RevertRecognizedTransactionsService;
|
||||
constructor(
|
||||
private readonly revertRecognizedTransactionsService: RevertRecognizedTransactionsService,
|
||||
) {}
|
||||
|
||||
/**
|
||||
* Unlinks the bank rule out of recognized transactions.
|
||||
@@ -17,7 +19,7 @@ export class UnlinkBankRuleOnDeleteBankRuleSubscriber {
|
||||
oldBankRule,
|
||||
}: IBankRuleEventDeletingPayload) {
|
||||
await this.revertRecognizedTransactionsService.revertRecognizedTransactions(
|
||||
oldBankRule.id
|
||||
oldBankRule.id,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { forwardRef, Module } from '@nestjs/common';
|
||||
import { RegisterTenancyModel } from '../Tenancy/TenancyModels/Tenancy.module';
|
||||
import { RecognizedBankTransaction } from './models/RecognizedBankTransaction';
|
||||
import { GetAutofillCategorizeTransactionService } from './queries/GetAutofillCategorizeTransaction.service';
|
||||
@@ -11,7 +11,7 @@ import { BankRulesModule } from '../BankRules/BankRules.module';
|
||||
const models = [RegisterTenancyModel(RecognizedBankTransaction)];
|
||||
|
||||
@Module({
|
||||
imports: [BankingTransactionsModule, BankRulesModule],
|
||||
imports: [BankingTransactionsModule, forwardRef(() => BankRulesModule)],
|
||||
providers: [
|
||||
...models,
|
||||
GetAutofillCategorizeTransactionService,
|
||||
|
||||
@@ -162,9 +162,9 @@ export class CreditNoteGL {
|
||||
public getCreditNoteGLEntries(): ILedgerEntry[] {
|
||||
const AREntry = this.creditNoteAREntry;
|
||||
|
||||
const getItemEntry = this.getCreditNoteItemEntry;
|
||||
const itemsEntries = this.creditNoteModel.entries.map(getItemEntry);
|
||||
|
||||
const itemsEntries = this.creditNoteModel.entries.map((entry, index) =>
|
||||
this.getCreditNoteItemEntry(entry, index),
|
||||
);
|
||||
const discountEntry = this.discountEntry;
|
||||
const adjustmentEntry = this.adjustmentEntry;
|
||||
|
||||
|
||||
@@ -5,8 +5,10 @@ import { ITransactionsLockingAllDTO } from './types/TransactionsLocking.types';
|
||||
import { ICancelTransactionsLockingDTO } from './types/TransactionsLocking.types';
|
||||
import { ITransactionLockingPartiallyDTO } from './types/TransactionsLocking.types';
|
||||
import { QueryTransactionsLocking } from './queries/QueryTransactionsLocking';
|
||||
import { PublicRoute } from '../Auth/Jwt.guard';
|
||||
|
||||
@Controller('transactions-locking')
|
||||
@PublicRoute()
|
||||
export class TransactionsLockingController {
|
||||
constructor(
|
||||
private readonly transactionsLockingService: TransactionsLockingService,
|
||||
@@ -74,13 +76,15 @@ export class TransactionsLockingController {
|
||||
};
|
||||
}
|
||||
|
||||
// @Get(':module')
|
||||
// async getTransactionLockingMeta(@Param('module') module: string) {
|
||||
// return await this.queryTransactionsLocking.getTransactionsLocking(module);
|
||||
// }
|
||||
|
||||
@Get()
|
||||
@Get('/')
|
||||
async getTransactionLockingMetaList() {
|
||||
return await this.queryTransactionsLocking.getTransactionsLockingAll();
|
||||
}
|
||||
|
||||
@Get(':module')
|
||||
async getTransactionLockingMeta(@Param('module') module: string) {
|
||||
return await this.queryTransactionsLocking.getTransactionsLockingModuleMeta(
|
||||
module as TransactionsLockingGroup,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import * as moment from 'moment';
|
||||
import { isUndefined } from 'lodash';
|
||||
import {
|
||||
ITransactionMeta,
|
||||
|
||||
@@ -147,9 +147,9 @@ export class VendorCreditGL {
|
||||
*/
|
||||
public getVendorCreditGLEntries(): ILedgerEntry[] {
|
||||
const payableEntry = this.vendorCreditPayableGLEntry;
|
||||
const getItemEntry = this.getVendorCreditGLItemEntry;
|
||||
const itemsEntries = this.vendorCredit.entries.map(getItemEntry);
|
||||
|
||||
const itemsEntries = this.vendorCredit.entries.map((entry, index) =>
|
||||
this.getVendorCreditGLItemEntry(entry, index),
|
||||
);
|
||||
const discountEntry = this.discountEntry;
|
||||
const adjustmentEntry = this.adjustmentEntry;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user