refactor: events tracker to nestjs

This commit is contained in:
Ahmed Bouhuolia
2025-01-08 11:59:55 +02:00
parent fdfb766587
commit 52362a43ab
33 changed files with 1417 additions and 10 deletions

View File

@@ -4,7 +4,6 @@ import * as R from 'ramda';
import { omit } from 'lodash';
import { events } from '@/common/events/events';
import { InventoryAdjustment } from '../models/InventoryAdjustment';
import { InventoryAdjustmentEntry } from '../models/InventoryAdjustmentEntry';
import {
IInventoryAdjustmentCreatingPayload,
IInventoryAdjustmentEventCreatedPayload,

View File

@@ -1,14 +1,13 @@
import { UnitOfWork } from '@/modules/Tenancy/TenancyDB/UnitOfWork.service';
import { Knex } from 'knex';
import { Inject } from '@nestjs/common';
import { EventEmitter2 } from '@nestjs/event-emitter';
import { UnitOfWork } from '@/modules/Tenancy/TenancyDB/UnitOfWork.service';
import { InventoryAdjustment } from '../models/InventoryAdjustment';
import { InventoryAdjustmentEntry } from '../models/InventoryAdjustmentEntry';
import {
IInventoryAdjustmentEventPublishedPayload,
IInventoryAdjustmentPublishingPayload,
} from '../types/InventoryAdjustments.types';
import { events } from '@/common/events/events';
import { Knex } from 'knex';
import { ServiceError } from '@/modules/Items/ServiceError';
export class PublishInventoryAdjustmentService {
@@ -22,8 +21,7 @@ export class PublishInventoryAdjustmentService {
/**
* Publish the inventory adjustment transaction.
* @param {number} tenantId
* @param {number} inventoryAdjustmentId
* @param {number} inventoryAdjustmentId - Inventory adjustment ID.
*/
public async publishInventoryAdjustment(
inventoryAdjustmentId: number,

View File

@@ -13,7 +13,12 @@ export class InventoryAdjustmentsGL {
this.inventoryAdjustment = inventoryAdjustmentModel;
}
setBaseCurrency(baseCurrency: string) {
/**
* Sets the base currency.
* @param {string} baseCurrency - Base currency.
* @returns {InventoryAdjustmentsGL}
*/
public setBaseCurrency(baseCurrency: string) {
this.baseCurrency = baseCurrency;
return this;
}