This commit is contained in:
Ahmed Bouhuolia
2025-02-12 10:15:00 +02:00
parent 9eee0b384d
commit 36851d3209
2 changed files with 19 additions and 9 deletions

View File

@@ -5,21 +5,26 @@ import {
ACCOUNT_TYPE, ACCOUNT_TYPE,
} from '@/constants/accounts'; } from '@/constants/accounts';
import { ServiceError } from './ServiceError'; import { ServiceError } from './ServiceError';
import { IItem, IItemDTO } from '@/interfaces/Item'; import { IItemDTO } from '@/interfaces/Item';
import { ERRORS } from './Items.constants'; import { ERRORS } from './Items.constants';
import { Item } from './models/Item'; import { Item } from './models/Item';
import { Account } from '../Accounts/models/Account.model'; 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() @Injectable()
export class ItemsValidators { export class ItemsValidators {
constructor( constructor(
@Inject(Item.name) private itemModel: typeof Item, @Inject(Item.name) private itemModel: typeof Item,
@Inject(Account.name) private accountModel: typeof Account, @Inject(Account.name) private accountModel: typeof Account,
@Inject(Item.name) private taxRateModel: typeof Item, @Inject(TaxRateModel.name) private taxRateModel: typeof TaxRateModel,
@Inject(Item.name) private itemEntryModel: typeof Item, @Inject(ItemEntry.name) private itemEntryModel: typeof ItemEntry,
@Inject(Item.name) private itemCategoryModel: typeof Item, @Inject(ItemCategory.name) private itemCategoryModel: typeof ItemCategory,
@Inject(Item.name) private accountTransactionModel: typeof Item, @Inject(AccountTransaction.name) private accountTransactionModel: typeof AccountTransaction,
@Inject(Item.name) private inventoryAdjustmentEntryModel: typeof Item, @Inject(InventoryAdjustment.name) private inventoryAdjustmentEntryModel: typeof InventoryAdjustment,
) {} ) {}
/** /**

View File

@@ -15,9 +15,14 @@ import { TransformerInjectable } from '../Transformer/TransformerInjectable.serv
import { ItemsEntriesService } from './ItemsEntries.service'; import { ItemsEntriesService } from './ItemsEntries.service';
import { GetItemsService } from './GetItems.service'; import { GetItemsService } from './GetItems.service';
import { DynamicListModule } from '../DynamicListing/DynamicList.module'; import { DynamicListModule } from '../DynamicListing/DynamicList.module';
import { InventoryAdjustmentsModule } from '../InventoryAdjutments/InventoryAdjustments.module';
@Module({ @Module({
imports: [TenancyDatabaseModule, DynamicListModule], imports: [
TenancyDatabaseModule,
DynamicListModule,
InventoryAdjustmentsModule,
],
controllers: [ItemsController], controllers: [ItemsController],
providers: [ providers: [
ItemsValidators, ItemsValidators,
@@ -32,8 +37,8 @@ import { DynamicListModule } from '../DynamicListing/DynamicList.module';
ItemTransactionsService, ItemTransactionsService,
TenancyContext, TenancyContext,
TransformerInjectable, TransformerInjectable,
ItemsEntriesService ItemsEntriesService,
], ],
exports: [ItemsEntriesService] exports: [ItemsEntriesService],
}) })
export class ItemsModule {} export class ItemsModule {}