refactor: inventory to nestjs

This commit is contained in:
Ahmed Bouhuolia
2025-01-15 14:14:44 +02:00
parent e7e7a95aa1
commit 936800600b
32 changed files with 455 additions and 227 deletions

View File

@@ -1,5 +1,5 @@
import { Knex } from 'knex';
import { Inject } from '@nestjs/common';
import { Inject, Injectable } from '@nestjs/common';
import * as R from 'ramda';
import * as moment from 'moment';
import { omit } from 'lodash';
@@ -20,6 +20,7 @@ import { WarehouseTransactionDTOTransform } from '@/modules/Warehouses/Integrati
import { TenancyContext } from '@/modules/Tenancy/TenancyContext.service';
import { ERRORS } from '../constants/InventoryAdjustments.constants';
@Injectable()
export class CreateQuickInventoryAdjustmentService {
constructor(
@Inject(InventoryAdjustment.name)

View File

@@ -1,4 +1,4 @@
import { Inject } from '@nestjs/common';
import { Inject, Injectable } from '@nestjs/common';
import { Knex } from 'knex';
import { EventEmitter2 } from '@nestjs/event-emitter';
import { events } from '@/common/events/events';
@@ -10,6 +10,7 @@ import { UnitOfWork } from '@/modules/Tenancy/TenancyDB/UnitOfWork.service';
import { InventoryAdjustmentEntry } from '../models/InventoryAdjustmentEntry';
import { InventoryAdjustment } from '../models/InventoryAdjustment';
@Injectable()
export class DeleteInventoryAdjustmentService {
constructor(
private readonly eventEmitter: EventEmitter2,

View File

@@ -1,5 +1,5 @@
import { Knex } from 'knex';
import { Inject } from '@nestjs/common';
import { Inject, Injectable } from '@nestjs/common';
import { EventEmitter2 } from '@nestjs/event-emitter';
import * as moment from 'moment';
import { UnitOfWork } from '@/modules/Tenancy/TenancyDB/UnitOfWork.service';
@@ -12,6 +12,7 @@ import { events } from '@/common/events/events';
import { ServiceError } from '@/modules/Items/ServiceError';
import { ERRORS } from '../constants/InventoryAdjustments.constants';
@Injectable()
export class PublishInventoryAdjustmentService {
constructor(
private readonly eventEmitter: EventEmitter2,

View File

@@ -1,10 +1,11 @@
import { Knex } from 'knex';
import { Inject } from '@nestjs/common';
import { Inject, Injectable } from '@nestjs/common';
import { LedgerStorageService } from '../../../Ledger/LedgerStorage.service';
import { InventoryAdjustment } from '../../models/InventoryAdjustment';
import { TenancyContext } from '../../../Tenancy/TenancyContext.service';
import { InventoryAdjustmentsGL } from './InventoryAdjustmentGL';
@Injectable()
export class InventoryAdjustmentsGLEntries {
constructor(
private readonly ledgerStorage: LedgerStorageService,