diff --git a/packages/server-nest/src/modules/Items/ItemValidator.service.ts b/packages/server-nest/src/modules/Items/ItemValidator.service.ts index bfc585c15..455f2bbb3 100644 --- a/packages/server-nest/src/modules/Items/ItemValidator.service.ts +++ b/packages/server-nest/src/modules/Items/ItemValidator.service.ts @@ -5,21 +5,26 @@ import { ACCOUNT_TYPE, } from '@/constants/accounts'; import { ServiceError } from './ServiceError'; -import { IItem, IItemDTO } from '@/interfaces/Item'; +import { IItemDTO } from '@/interfaces/Item'; import { ERRORS } from './Items.constants'; import { Item } from './models/Item'; import { Account } from '../Accounts/models/Account.model'; +import { TaxRateModel } from '../TaxRates/models/TaxRate.model'; +import { ItemEntry } from '../TransactionItemEntry/models/ItemEntry'; +import { ItemCategory } from '../ItemCategories/models/ItemCategory.model'; +import { AccountTransaction } from '../Accounts/models/AccountTransaction.model'; +import { InventoryAdjustment } from '../InventoryAdjutments/models/InventoryAdjustment'; @Injectable() export class ItemsValidators { constructor( @Inject(Item.name) private itemModel: typeof Item, @Inject(Account.name) private accountModel: typeof Account, - @Inject(Item.name) private taxRateModel: typeof Item, - @Inject(Item.name) private itemEntryModel: typeof Item, - @Inject(Item.name) private itemCategoryModel: typeof Item, - @Inject(Item.name) private accountTransactionModel: typeof Item, - @Inject(Item.name) private inventoryAdjustmentEntryModel: typeof Item, + @Inject(TaxRateModel.name) private taxRateModel: typeof TaxRateModel, + @Inject(ItemEntry.name) private itemEntryModel: typeof ItemEntry, + @Inject(ItemCategory.name) private itemCategoryModel: typeof ItemCategory, + @Inject(AccountTransaction.name) private accountTransactionModel: typeof AccountTransaction, + @Inject(InventoryAdjustment.name) private inventoryAdjustmentEntryModel: typeof InventoryAdjustment, ) {} /** diff --git a/packages/server-nest/src/modules/Items/Items.module.ts b/packages/server-nest/src/modules/Items/Items.module.ts index e0856c08c..73be6e1d1 100644 --- a/packages/server-nest/src/modules/Items/Items.module.ts +++ b/packages/server-nest/src/modules/Items/Items.module.ts @@ -15,9 +15,14 @@ import { TransformerInjectable } from '../Transformer/TransformerInjectable.serv import { ItemsEntriesService } from './ItemsEntries.service'; import { GetItemsService } from './GetItems.service'; import { DynamicListModule } from '../DynamicListing/DynamicList.module'; +import { InventoryAdjustmentsModule } from '../InventoryAdjutments/InventoryAdjustments.module'; @Module({ - imports: [TenancyDatabaseModule, DynamicListModule], + imports: [ + TenancyDatabaseModule, + DynamicListModule, + InventoryAdjustmentsModule, + ], controllers: [ItemsController], providers: [ ItemsValidators, @@ -32,8 +37,8 @@ import { DynamicListModule } from '../DynamicListing/DynamicList.module'; ItemTransactionsService, TenancyContext, TransformerInjectable, - ItemsEntriesService + ItemsEntriesService, ], - exports: [ItemsEntriesService] + exports: [ItemsEntriesService], }) export class ItemsModule {}