mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 05:10:31 +00:00
feat(nestjs): migrate to NestJS
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
// import { Inject, Service } from 'typedi';
|
||||
// import {
|
||||
// IRefundCreditNoteCreatedPayload,
|
||||
// IRefundCreditNoteDeletedPayload,
|
||||
// } from '@/interfaces';
|
||||
// import events from '@/subscribers/events';
|
||||
// import RefundSyncCreditNoteBalance from '../commands/RefundSyncCreditNoteBalance';
|
||||
|
||||
// @Service()
|
||||
// export default class RefundSyncCreditNoteBalanceSubscriber {
|
||||
// @Inject()
|
||||
// refundSyncCreditBalance: RefundSyncCreditNoteBalance;
|
||||
|
||||
// /**
|
||||
// * Attaches events with handlers.
|
||||
// */
|
||||
// attach(bus) {
|
||||
// bus.subscribe(
|
||||
// events.creditNote.onRefundCreated,
|
||||
// this.incrementRefundedAmountOnceRefundCreated
|
||||
// );
|
||||
// bus.subscribe(
|
||||
// events.creditNote.onRefundDeleted,
|
||||
// this.decrementRefundedAmountOnceRefundDeleted
|
||||
// );
|
||||
// return bus;
|
||||
// }
|
||||
|
||||
// /**
|
||||
// * Increment credit note refunded amount once associated refund transaction created.
|
||||
// * @param {IRefundCreditNoteCreatedPayload} payload -
|
||||
// */
|
||||
// private incrementRefundedAmountOnceRefundCreated = async ({
|
||||
// trx,
|
||||
// refundCreditNote,
|
||||
// tenantId,
|
||||
// }: IRefundCreditNoteCreatedPayload) => {
|
||||
// await this.refundSyncCreditBalance.incrementCreditNoteRefundAmount(
|
||||
// tenantId,
|
||||
// refundCreditNote.creditNoteId,
|
||||
// refundCreditNote.amount,
|
||||
// trx
|
||||
// );
|
||||
// };
|
||||
|
||||
// /**
|
||||
// * Decrement credit note refunded amount once associated refuned transaction deleted.
|
||||
// * @param {IRefundCreditNoteDeletedPayload} payload -
|
||||
// */
|
||||
// private decrementRefundedAmountOnceRefundDeleted = async ({
|
||||
// trx,
|
||||
// oldRefundCredit,
|
||||
// tenantId,
|
||||
// }: IRefundCreditNoteDeletedPayload) => {
|
||||
// await this.refundSyncCreditBalance.decrementCreditNoteRefundAmount(
|
||||
// tenantId,
|
||||
// oldRefundCredit.creditNoteId,
|
||||
// oldRefundCredit.amount,
|
||||
// trx
|
||||
// );
|
||||
// };
|
||||
// }
|
||||
Reference in New Issue
Block a user