mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 06:40:31 +00:00
refactor: migrate ledger writer to nestjs
This commit is contained in:
@@ -6,7 +6,7 @@ import * as composeAsync from 'async/compose';
|
||||
import { formatDateFields } from '@/utils/format-date-fields';
|
||||
import { BranchTransactionDTOTransformer } from '@/modules/Branches/integrations/BranchTransactionDTOTransform';
|
||||
import { WarehouseTransactionDTOTransform } from '@/modules/Warehouses/Integrations/WarehouseTransactionDTOTransform';
|
||||
import { ItemEntry } from '@/modules/Items/models/ItemEntry';
|
||||
import { ItemEntry } from '@/modules/TransactionItemEntry/models/ItemEntry';
|
||||
import { Item } from '@/modules/Items/models/Item';
|
||||
import { Vendor } from '@/modules/Vendors/models/Vendor';
|
||||
import { ItemEntriesTaxTransactions } from '@/modules/TaxRates/ItemEntriesTaxTransactions.service';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { sumBy } from 'lodash';
|
||||
import { ILedgerEntry } from '@/modules/Ledger/types/Ledger.types';
|
||||
import { ItemEntry } from '@/modules/Items/models/ItemEntry';
|
||||
import { ItemEntry } from '@/modules/TransactionItemEntry/models/ItemEntry';
|
||||
import { Bill } from '../models/Bill';
|
||||
import { AccountNormal } from '@/modules/Accounts/Accounts.types';
|
||||
import { Ledger } from '@/modules/Ledger/Ledger';
|
||||
@@ -85,7 +85,6 @@ export class BillGL {
|
||||
index: index + 1,
|
||||
indexGroup: 10,
|
||||
itemId: entry.itemId,
|
||||
itemQuantity: entry.quantity,
|
||||
accountNormal: AccountNormal.DEBIT,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Knex } from 'knex';
|
||||
import { LedgerStorageService } from '@/modules/Ledger/LedgerStorage.service';
|
||||
import { AccountRepository } from '@/modules/Accounts/repositories/Account.repository';
|
||||
import { Bill } from '../models/Bill';
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Inject, Injectable } from '@nestjs/common';
|
||||
import { BillGL } from './BillsGL';
|
||||
|
||||
@Injectable()
|
||||
@@ -15,6 +15,8 @@ export class BillGLEntries {
|
||||
constructor(
|
||||
private readonly ledgerStorage: LedgerStorageService,
|
||||
private readonly accountRepository: AccountRepository,
|
||||
|
||||
@Inject(Bill.name)
|
||||
private readonly billModel: typeof Bill,
|
||||
) {}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
import { BillsValidators } from './BillsValidators.service';
|
||||
import { UnitOfWork } from '@/modules/Tenancy/TenancyDB/UnitOfWork.service';
|
||||
import { EventEmitter2 } from '@nestjs/event-emitter';
|
||||
import { ItemEntry } from '@/modules/Items/models/ItemEntry';
|
||||
import { ItemEntry } from '@/modules/TransactionItemEntry/models/ItemEntry';
|
||||
import { Bill } from '../models/Bill';
|
||||
|
||||
@Injectable()
|
||||
|
||||
@@ -24,6 +24,7 @@ export class EditBillService {
|
||||
private eventPublisher: EventEmitter2,
|
||||
private transactionLandedCostEntries: TransactionLandedCostEntriesService,
|
||||
private transformerDTO: BillDTOTransformer,
|
||||
|
||||
@Inject(Bill.name) private billModel: typeof Bill,
|
||||
@Inject(Vendor.name) private contactModel: typeof Vendor,
|
||||
) {}
|
||||
|
||||
Reference in New Issue
Block a user