mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 22:30:31 +00:00
refactor: wip to nestjs
This commit is contained in:
@@ -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
|
||||
// );
|
||||
// };
|
||||
// }
|
||||
@@ -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;
|
||||
// }
|
||||
// }
|
||||
// };
|
||||
// }
|
||||
Reference in New Issue
Block a user