refactor: wip to nestjs

This commit is contained in:
Ahmed Bouhuolia
2024-12-25 00:43:55 +02:00
parent 336171081e
commit a6932d76f3
249 changed files with 21314 additions and 1616 deletions

View File

@@ -0,0 +1,36 @@
// import { Inject, Service } from 'typedi';
// import events from '@/subscribers/events';
// import { IInventoryCostLotsGLEntriesWriteEvent } from '@/interfaces';
// import { SaleReceiptCostGLEntries } from '../SaleReceiptCostGLEntries';
// @Service()
// export class SaleReceiptCostGLEntriesSubscriber {
// @Inject()
// private saleReceiptCostEntries: SaleReceiptCostGLEntries;
// /**
// * Attaches events.
// */
// public attach(bus) {
// bus.subscribe(
// events.inventory.onCostLotsGLEntriesWrite,
// this.writeJournalEntriesOnceWriteoffCreate
// );
// }
// /**
// * Writes the receipts cost GL entries once the inventory cost lots be written.
// * @param {IInventoryCostLotsGLEntriesWriteEvent}
// */
// private writeJournalEntriesOnceWriteoffCreate = async ({
// trx,
// startingDate,
// tenantId,
// }: IInventoryCostLotsGLEntriesWriteEvent) => {
// await this.saleReceiptCostEntries.writeInventoryCostJournalEntries(
// tenantId,
// startingDate,
// trx
// );
// };
// }

View File

@@ -0,0 +1,41 @@
// import { ISaleReceiptMailPresend } from '@/interfaces';
// import events from '@/subscribers/events';
// import { CloseSaleReceipt } from '../commands/CloseSaleReceipt.service';
// import { Inject, Service } from 'typedi';
// import { ServiceError } from '@/exceptions';
// import { ERRORS } from '../constants';
// @Service()
// export class SaleReceiptMarkClosedOnMailSentSubcriber {
// @Inject()
// private closeReceiptService: CloseSaleReceipt;
// /**
// * Attaches events.
// */
// public attach(bus) {
// bus.subscribe(events.saleReceipt.onPreMailSend, this.markReceiptClosed);
// }
// /**
// * Marks the sale receipt closed on submitting mail.
// * @param {ISaleReceiptMailPresend}
// */
// private markReceiptClosed = async ({
// tenantId,
// saleReceiptId,
// messageOptions,
// }: ISaleReceiptMailPresend) => {
// try {
// await this.closeReceiptService.closeSaleReceipt(tenantId, saleReceiptId);
// } catch (error) {
// if (
// error instanceof ServiceError &&
// error.errorType === ERRORS.SALE_RECEIPT_IS_ALREADY_CLOSED
// ) {
// } else {
// throw error;
// }
// }
// };
// }