mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 12:20:31 +00:00
fix: transaction locking handling
This commit is contained in:
@@ -4,16 +4,18 @@ export class ServiceError extends Error {
|
||||
errorType: string;
|
||||
message: string;
|
||||
payload: any;
|
||||
httpStatus: HttpStatus;
|
||||
|
||||
constructor(errorType: string, message?: string, payload?: any) {
|
||||
constructor(errorType: string, message?: string, payload?: any, httpStatus?: HttpStatus) {
|
||||
super(message);
|
||||
|
||||
this.errorType = errorType;
|
||||
this.message = message || null;
|
||||
this.payload = payload;
|
||||
this.httpStatus = httpStatus || HttpStatus.BAD_REQUEST;
|
||||
}
|
||||
|
||||
getStatus(): HttpStatus {
|
||||
return HttpStatus.INTERNAL_SERVER_ERROR;
|
||||
return this.httpStatus;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import { ServiceError } from '@/modules/Items/ServiceError';
|
||||
export class TransactionsLockingGuard {
|
||||
constructor(
|
||||
private readonly transactionsLockingRepo: TransactionsLockingRepository,
|
||||
) {}
|
||||
) { }
|
||||
|
||||
/**
|
||||
* Detarmines whether the transaction date between the locking date period.
|
||||
@@ -31,7 +31,7 @@ export class TransactionsLockingGuard {
|
||||
const inUnlockDate =
|
||||
unlockFromDate && unlockToDate
|
||||
? moment(transactionDate).isSameOrAfter(unlockFromDate) &&
|
||||
moment(transactionDate).isSameOrBefore(unlockFromDate)
|
||||
moment(transactionDate).isSameOrBefore(unlockFromDate)
|
||||
: false;
|
||||
|
||||
// Retruns true in case the transaction date between locking date
|
||||
@@ -57,7 +57,7 @@ export class TransactionsLockingGuard {
|
||||
);
|
||||
|
||||
if (isLocked) {
|
||||
this.throwTransactionsLockError(lockingGroup);
|
||||
await this.throwTransactionsLockError(lockingGroup);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -90,11 +90,12 @@ export class TransactionsLockingGuard {
|
||||
await this.transactionsLockingRepo.getTransactionsLockingType();
|
||||
|
||||
if (lockingType === TransactionsLockingGroup.All) {
|
||||
return this.validateTransactionsLocking(
|
||||
await this.validateTransactionsLocking(
|
||||
transactionDate,
|
||||
TransactionsLockingGroup.All,
|
||||
);
|
||||
return;
|
||||
}
|
||||
return this.validateTransactionsLocking(transactionDate, moduleType);
|
||||
await this.validateTransactionsLocking(transactionDate, moduleType);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ import { events } from '@/common/events/events';
|
||||
export class FinancialTransactionLockingGuardSubscriber {
|
||||
constructor(
|
||||
public readonly financialTransactionsLocking: FinancialTransactionLocking,
|
||||
) {}
|
||||
) { }
|
||||
|
||||
/**
|
||||
* ---------------------------------------------
|
||||
@@ -33,7 +33,7 @@ export class FinancialTransactionLockingGuardSubscriber {
|
||||
* Transaction locking guard on manual journal creating.
|
||||
* @param {IManualJournalCreatingPayload} payload
|
||||
*/
|
||||
@OnEvent(events.manualJournals.onCreating)
|
||||
@OnEvent(events.manualJournals.onCreating, { suppressErrors: false })
|
||||
public async transactionsLockingGuardOnManualJournalCreating({
|
||||
manualJournalDTO,
|
||||
}: IManualJournalCreatingPayload) {
|
||||
@@ -49,7 +49,7 @@ export class FinancialTransactionLockingGuardSubscriber {
|
||||
* Transactions locking guard on manual journal deleting.
|
||||
* @param {IManualJournalEditingPayload} payload
|
||||
*/
|
||||
@OnEvent(events.manualJournals.onDeleting)
|
||||
@OnEvent(events.manualJournals.onDeleting, { suppressErrors: false })
|
||||
public async transactionsLockingGuardOnManualJournalDeleting({
|
||||
oldManualJournal,
|
||||
}: IManualJournalEditingPayload) {
|
||||
@@ -65,7 +65,7 @@ export class FinancialTransactionLockingGuardSubscriber {
|
||||
* Transactions locking guard on manual journal editing.
|
||||
* @param {IManualJournalDeletingPayload} payload
|
||||
*/
|
||||
@OnEvent(events.manualJournals.onEditing)
|
||||
@OnEvent(events.manualJournals.onEditing, { suppressErrors: false })
|
||||
public async transactionsLockingGuardOnManualJournalEditing({
|
||||
oldManualJournal,
|
||||
manualJournalDTO,
|
||||
@@ -87,7 +87,7 @@ export class FinancialTransactionLockingGuardSubscriber {
|
||||
* Transactions locking guard on manual journal publishing.
|
||||
* @param {IManualJournalPublishingPayload}
|
||||
*/
|
||||
@OnEvent(events.manualJournals.onPublishing)
|
||||
@OnEvent(events.manualJournals.onPublishing, { suppressErrors: false })
|
||||
public async transactionsLockingGuardOnManualJournalPublishing({
|
||||
oldManualJournal,
|
||||
}: IManualJournalPublishingPayload) {
|
||||
@@ -106,7 +106,7 @@ export class FinancialTransactionLockingGuardSubscriber {
|
||||
* Transactions locking guard on expense creating.
|
||||
* @param {IExpenseCreatingPayload} payload
|
||||
*/
|
||||
@OnEvent(events.expenses.onCreating)
|
||||
@OnEvent(events.expenses.onCreating, { suppressErrors: false })
|
||||
public async transactionsLockingGuardOnExpenseCreating({
|
||||
expenseDTO,
|
||||
}: IExpenseCreatingPayload) {
|
||||
@@ -122,7 +122,7 @@ export class FinancialTransactionLockingGuardSubscriber {
|
||||
* Transactions locking guard on expense deleting.
|
||||
* @param {IExpenseDeletingPayload} payload
|
||||
*/
|
||||
@OnEvent(events.expenses.onDeleting)
|
||||
@OnEvent(events.expenses.onDeleting, { suppressErrors: false })
|
||||
public async transactionsLockingGuardOnExpenseDeleting({
|
||||
oldExpense,
|
||||
}: IExpenseDeletingPayload) {
|
||||
@@ -138,7 +138,7 @@ export class FinancialTransactionLockingGuardSubscriber {
|
||||
* Transactions locking guard on expense editing.
|
||||
* @param {IExpenseEventEditingPayload}
|
||||
*/
|
||||
@OnEvent(events.expenses.onEditing)
|
||||
@OnEvent(events.expenses.onEditing, { suppressErrors: false })
|
||||
public async transactionsLockingGuardOnExpenseEditing({
|
||||
oldExpense,
|
||||
expenseDTO,
|
||||
@@ -160,7 +160,7 @@ export class FinancialTransactionLockingGuardSubscriber {
|
||||
* Transactions locking guard on expense publishing.
|
||||
* @param {IExpensePublishingPayload} payload -
|
||||
*/
|
||||
@OnEvent(events.expenses.onPublishing)
|
||||
@OnEvent(events.expenses.onPublishing, { suppressErrors: false })
|
||||
public async transactionsLockingGuardOnExpensePublishing({
|
||||
oldExpense,
|
||||
}: IExpensePublishingPayload) {
|
||||
@@ -179,7 +179,7 @@ export class FinancialTransactionLockingGuardSubscriber {
|
||||
* Transactions locking guard on cashflow transaction creating.
|
||||
* @param {ICommandCashflowCreatingPayload}
|
||||
*/
|
||||
@OnEvent(events.cashflow.onTransactionCreating)
|
||||
@OnEvent(events.cashflow.onTransactionCreating, { suppressErrors: false })
|
||||
public async transactionsLockingGuardOnCashflowTransactionCreating({
|
||||
newTransactionDTO,
|
||||
}: ICommandCashflowCreatingPayload) {
|
||||
@@ -194,7 +194,7 @@ export class FinancialTransactionLockingGuardSubscriber {
|
||||
* Transactions locking guard on cashflow transaction deleting.
|
||||
* @param {ICommandCashflowDeletingPayload}
|
||||
*/
|
||||
@OnEvent(events.cashflow.onTransactionDeleting)
|
||||
@OnEvent(events.cashflow.onTransactionDeleting, { suppressErrors: false })
|
||||
public async transactionsLockingGuardOnCashflowTransactionDeleting({
|
||||
oldCashflowTransaction,
|
||||
}: ICommandCashflowDeletingPayload) {
|
||||
|
||||
@@ -26,7 +26,7 @@ import { OnEvent } from '@nestjs/event-emitter';
|
||||
export class PurchasesTransactionLockingGuardSubscriber {
|
||||
constructor(
|
||||
public readonly purchasesTransactionsLocking: PurchasesTransactionLockingGuard,
|
||||
) {}
|
||||
) { }
|
||||
|
||||
/**
|
||||
* ---------------------------------------------
|
||||
@@ -37,7 +37,7 @@ export class PurchasesTransactionLockingGuardSubscriber {
|
||||
* Transaction locking guard on payment editing.
|
||||
* @param {IBillPaymentEditingPayload}
|
||||
*/
|
||||
@OnEvent(events.billPayment.onEditing)
|
||||
@OnEvent(events.billPayment.onEditing, { suppressErrors: false })
|
||||
public async transactionLockingGuardOnPaymentEditing({
|
||||
oldBillPayment,
|
||||
billPaymentDTO,
|
||||
@@ -56,7 +56,7 @@ export class PurchasesTransactionLockingGuardSubscriber {
|
||||
* Transaction locking guard on payment creating.
|
||||
* @param {IBillPaymentCreatingPayload}
|
||||
*/
|
||||
@OnEvent(events.billPayment.onCreating)
|
||||
@OnEvent(events.billPayment.onCreating, { suppressErrors: false })
|
||||
public async transactionLockingGuardOnPaymentCreating({
|
||||
billPaymentDTO,
|
||||
}: IBillPaymentCreatingPayload) {
|
||||
@@ -69,7 +69,7 @@ export class PurchasesTransactionLockingGuardSubscriber {
|
||||
* Transaction locking guard on payment deleting.
|
||||
* @param {IBillPaymentDeletingPayload} payload -
|
||||
*/
|
||||
@OnEvent(events.billPayment.onDeleting)
|
||||
@OnEvent(events.billPayment.onDeleting, { suppressErrors: false })
|
||||
public async transactionLockingGuardOnPaymentDeleting({
|
||||
oldBillPayment,
|
||||
}: IBillPaymentDeletingPayload) {
|
||||
@@ -88,7 +88,7 @@ export class PurchasesTransactionLockingGuardSubscriber {
|
||||
* Transaction locking guard on bill creating.
|
||||
* @param {IBillCreatingPayload} payload
|
||||
*/
|
||||
@OnEvent(events.bill.onCreating)
|
||||
@OnEvent(events.bill.onCreating, { suppressErrors: false })
|
||||
public async transactionLockingGuardOnBillCreating({
|
||||
billDTO,
|
||||
}: IBillCreatingPayload) {
|
||||
@@ -104,7 +104,7 @@ export class PurchasesTransactionLockingGuardSubscriber {
|
||||
* Transaction locking guard on bill editing.
|
||||
* @param {IBillEditingPayload} payload
|
||||
*/
|
||||
@OnEvent(events.bill.onEditing)
|
||||
@OnEvent(events.bill.onEditing, { suppressErrors: false })
|
||||
public async transactionLockingGuardOnBillEditing({
|
||||
oldBill,
|
||||
billDTO,
|
||||
@@ -126,7 +126,7 @@ export class PurchasesTransactionLockingGuardSubscriber {
|
||||
* Transaction locking guard on bill deleting.
|
||||
* @param {IBillEventDeletingPayload} payload
|
||||
*/
|
||||
@OnEvent(events.bill.onDeleting)
|
||||
@OnEvent(events.bill.onDeleting, { suppressErrors: false })
|
||||
public async transactionLockingGuardOnBillDeleting({
|
||||
oldBill,
|
||||
}: IBillEventDeletingPayload) {
|
||||
@@ -148,7 +148,7 @@ export class PurchasesTransactionLockingGuardSubscriber {
|
||||
* Transaction locking guard on vendor credit creating.
|
||||
* @param {IVendorCreditCreatingPayload} payload
|
||||
*/
|
||||
@OnEvent(events.vendorCredit.onCreating)
|
||||
@OnEvent(events.vendorCredit.onCreating, { suppressErrors: false })
|
||||
public async transactionLockingGuardOnVendorCreditCreating({
|
||||
vendorCreditCreateDTO,
|
||||
}: IVendorCreditCreatingPayload) {
|
||||
@@ -164,7 +164,7 @@ export class PurchasesTransactionLockingGuardSubscriber {
|
||||
* Transaction locking guard on vendor credit deleting.
|
||||
* @param {IVendorCreditDeletingPayload} payload
|
||||
*/
|
||||
@OnEvent(events.vendorCredit.onDeleting)
|
||||
@OnEvent(events.vendorCredit.onDeleting, { suppressErrors: false })
|
||||
public async transactionLockingGuardOnVendorCreditDeleting({
|
||||
oldVendorCredit,
|
||||
}: IVendorCreditDeletingPayload) {
|
||||
@@ -180,7 +180,7 @@ export class PurchasesTransactionLockingGuardSubscriber {
|
||||
* Transaction locking guard on vendor credit editing.
|
||||
* @param {IVendorCreditEditingPayload} payload
|
||||
*/
|
||||
@OnEvent(events.vendorCredit.onEditing)
|
||||
@OnEvent(events.vendorCredit.onEditing, { suppressErrors: false })
|
||||
public async transactionLockingGuardOnVendorCreditEditing({
|
||||
oldVendorCredit,
|
||||
vendorCreditDTO,
|
||||
@@ -202,7 +202,7 @@ export class PurchasesTransactionLockingGuardSubscriber {
|
||||
* Transaction locking guard on refund vendor credit creating.
|
||||
* @param {IRefundVendorCreditCreatingPayload} payload -
|
||||
*/
|
||||
@OnEvent(events.vendorCredit.onRefundCreating)
|
||||
@OnEvent(events.vendorCredit.onRefundCreating, { suppressErrors: false })
|
||||
public async transactionLockingGuardOnRefundVendorCredit({
|
||||
refundVendorCreditDTO,
|
||||
}: IRefundVendorCreditCreatingPayload) {
|
||||
@@ -215,7 +215,7 @@ export class PurchasesTransactionLockingGuardSubscriber {
|
||||
* Transaction locking guard on refund vendor credit deleting.
|
||||
* @param {IRefundVendorCreditDeletingPayload} payload
|
||||
*/
|
||||
@OnEvent(events.vendorCredit.onRefundDeleting)
|
||||
@OnEvent(events.vendorCredit.onRefundDeleting, { suppressErrors: false })
|
||||
public async transactionLockingGuardOnRefundCreditDeleting({
|
||||
oldRefundCredit,
|
||||
}: IRefundVendorCreditDeletingPayload) {
|
||||
|
||||
@@ -37,7 +37,7 @@ import { ISaleReceiptEventClosingPayload } from '@/modules/SaleReceipts/types/Sa
|
||||
export class SalesTransactionLockingGuardSubscriber {
|
||||
constructor(
|
||||
public readonly salesLockingGuard: SalesTransactionLockingGuard,
|
||||
) {}
|
||||
) { }
|
||||
|
||||
/**
|
||||
* ---------------------------------------------
|
||||
@@ -48,7 +48,7 @@ export class SalesTransactionLockingGuardSubscriber {
|
||||
* Transaction locking guard on invoice creating.
|
||||
* @param {ISaleInvoiceCreatingPaylaod} payload
|
||||
*/
|
||||
@OnEvent(events.saleInvoice.onCreating)
|
||||
@OnEvent(events.saleInvoice.onCreating, { suppressErrors: false })
|
||||
public async transactionLockingGuardOnInvoiceCreating({
|
||||
saleInvoiceDTO,
|
||||
}: ISaleInvoiceCreatingPaylaod) {
|
||||
@@ -64,7 +64,7 @@ export class SalesTransactionLockingGuardSubscriber {
|
||||
* Transaction locking guard on invoice editing.
|
||||
* @param {ISaleInvoiceEditingPayload} payload
|
||||
*/
|
||||
@OnEvent(events.saleInvoice.onEditing)
|
||||
@OnEvent(events.saleInvoice.onEditing, { suppressErrors: false })
|
||||
public async transactionLockingGuardOnInvoiceEditing({
|
||||
oldSaleInvoice,
|
||||
saleInvoiceDTO,
|
||||
@@ -86,7 +86,7 @@ export class SalesTransactionLockingGuardSubscriber {
|
||||
* Transaction locking guard on invoice deleting.
|
||||
* @param {ISaleInvoiceDeletePayload} payload
|
||||
*/
|
||||
@OnEvent(events.saleInvoice.onDelete)
|
||||
@OnEvent(events.saleInvoice.onDelete, { suppressErrors: false })
|
||||
public async transactionLockingGuardOnInvoiceDeleting({
|
||||
oldSaleInvoice,
|
||||
}: ISaleInvoiceDeletePayload) {
|
||||
@@ -102,7 +102,7 @@ export class SalesTransactionLockingGuardSubscriber {
|
||||
* Transaction locking guard on invoice writingoff.
|
||||
* @param {ISaleInvoiceWriteoffCreatePayload} payload
|
||||
*/
|
||||
@OnEvent(events.saleInvoice.onWriteoff)
|
||||
@OnEvent(events.saleInvoice.onWriteoff, { suppressErrors: false })
|
||||
public async transactionLockinGuardOnInvoiceWritingoff({
|
||||
saleInvoice,
|
||||
}: ISaleInvoiceWriteoffCreatePayload) {
|
||||
@@ -115,7 +115,7 @@ export class SalesTransactionLockingGuardSubscriber {
|
||||
* Transaciton locking guard on canceling written-off invoice.
|
||||
* @param {ISaleInvoiceWrittenOffCancelPayload} payload
|
||||
*/
|
||||
@OnEvent(events.saleInvoice.onWrittenoffCancel)
|
||||
@OnEvent(events.saleInvoice.onWrittenoffCancel, { suppressErrors: false })
|
||||
public async transactionLockinGuardOnInvoiceWritingoffCanceling({
|
||||
saleInvoice,
|
||||
}: ISaleInvoiceWrittenOffCancelPayload) {
|
||||
@@ -134,7 +134,7 @@ export class SalesTransactionLockingGuardSubscriber {
|
||||
* Transaction locking guard on receipt creating.
|
||||
* @param {ISaleReceiptCreatingPayload}
|
||||
*/
|
||||
@OnEvent(events.saleReceipt.onCreating)
|
||||
@OnEvent(events.saleReceipt.onCreating, { suppressErrors: false })
|
||||
public async transactionLockingGuardOnReceiptCreating({
|
||||
saleReceiptDTO,
|
||||
}: ISaleReceiptCreatingPayload) {
|
||||
@@ -150,7 +150,7 @@ export class SalesTransactionLockingGuardSubscriber {
|
||||
* Transaction locking guard on receipt creating.
|
||||
* @param {ISaleReceiptDeletingPayload}
|
||||
*/
|
||||
@OnEvent(events.saleReceipt.onDeleting)
|
||||
@OnEvent(events.saleReceipt.onDeleting, { suppressErrors: false })
|
||||
public async transactionLockingGuardOnReceiptDeleting({
|
||||
oldSaleReceipt,
|
||||
}: ISaleReceiptDeletingPayload) {
|
||||
@@ -165,7 +165,7 @@ export class SalesTransactionLockingGuardSubscriber {
|
||||
* Transaction locking guard on sale receipt editing.
|
||||
* @param {ISaleReceiptEditingPayload} payload
|
||||
*/
|
||||
@OnEvent(events.saleReceipt.onEditing)
|
||||
@OnEvent(events.saleReceipt.onEditing, { suppressErrors: false })
|
||||
public async transactionLockingGuardOnReceiptEditing({
|
||||
oldSaleReceipt,
|
||||
saleReceiptDTO,
|
||||
@@ -184,7 +184,7 @@ export class SalesTransactionLockingGuardSubscriber {
|
||||
* Transaction locking guard on sale receipt closing.
|
||||
* @param {ISaleReceiptEventClosingPayload} payload
|
||||
*/
|
||||
@OnEvent(events.saleReceipt.onClosing)
|
||||
@OnEvent(events.saleReceipt.onClosing, { suppressErrors: false })
|
||||
public async transactionLockingGuardOnReceiptClosing({
|
||||
oldSaleReceipt,
|
||||
}: ISaleReceiptEventClosingPayload) {
|
||||
@@ -203,7 +203,7 @@ export class SalesTransactionLockingGuardSubscriber {
|
||||
* Transaction locking guard on credit note deleting.
|
||||
* @param {ICreditNoteDeletingPayload} payload -
|
||||
*/
|
||||
@OnEvent(events.creditNote.onDeleting)
|
||||
@OnEvent(events.creditNote.onDeleting, { suppressErrors: false })
|
||||
public async transactionLockingGuardOnCreditDeleting({
|
||||
oldCreditNote,
|
||||
}: ICreditNoteDeletingPayload) {
|
||||
@@ -219,7 +219,7 @@ export class SalesTransactionLockingGuardSubscriber {
|
||||
* Transaction locking guard on credit note creating.
|
||||
* @param {ICreditNoteCreatingPayload} payload
|
||||
*/
|
||||
@OnEvent(events.creditNote.onCreating)
|
||||
@OnEvent(events.creditNote.onCreating, { suppressErrors: false })
|
||||
public async transactionLockingGuardOnCreditCreating({
|
||||
creditNoteDTO,
|
||||
}: ICreditNoteCreatingPayload) {
|
||||
@@ -235,7 +235,7 @@ export class SalesTransactionLockingGuardSubscriber {
|
||||
* Transaction locking guard on credit note editing.
|
||||
* @param {ICreditNoteEditingPayload} payload -
|
||||
*/
|
||||
@OnEvent(events.creditNote.onEditing)
|
||||
@OnEvent(events.creditNote.onEditing, { suppressErrors: false })
|
||||
public async transactionLockingGuardOnCreditEditing({
|
||||
creditNoteEditDTO,
|
||||
oldCreditNote,
|
||||
@@ -257,7 +257,7 @@ export class SalesTransactionLockingGuardSubscriber {
|
||||
* Transaction locking guard on payment deleting.
|
||||
* @param {IRefundCreditNoteDeletingPayload} paylaod -
|
||||
*/
|
||||
@OnEvent(events.creditNote.onRefundDeleting)
|
||||
@OnEvent(events.creditNote.onRefundDeleting, { suppressErrors: false })
|
||||
public async transactionLockingGuardOnCreditRefundDeleteing({
|
||||
oldRefundCredit,
|
||||
}: IRefundCreditNoteDeletingPayload) {
|
||||
@@ -268,7 +268,7 @@ export class SalesTransactionLockingGuardSubscriber {
|
||||
* Transaction locking guard on refund credit note creating.
|
||||
* @param {IRefundCreditNoteCreatingPayload} payload -
|
||||
*/
|
||||
@OnEvent(events.creditNote.onRefundCreating)
|
||||
@OnEvent(events.creditNote.onRefundCreating, { suppressErrors: false })
|
||||
public async transactionLockingGuardOnCreditRefundCreating({
|
||||
newCreditNoteDTO,
|
||||
}: IRefundCreditNoteCreatingPayload) {
|
||||
@@ -284,7 +284,7 @@ export class SalesTransactionLockingGuardSubscriber {
|
||||
* Transaction locking guard on estimate creating.
|
||||
* @param {ISaleEstimateCreatingPayload} payload -
|
||||
*/
|
||||
@OnEvent(events.saleEstimate.onCreating)
|
||||
@OnEvent(events.saleEstimate.onCreating, { suppressErrors: false })
|
||||
public async transactionLockingGuardOnEstimateCreating({
|
||||
estimateDTO,
|
||||
}: ISaleEstimateCreatingPayload) {
|
||||
@@ -300,7 +300,7 @@ export class SalesTransactionLockingGuardSubscriber {
|
||||
* Transaction locking guard on estimate deleting.
|
||||
* @param {ISaleEstimateDeletingPayload} payload
|
||||
*/
|
||||
@OnEvent(events.saleEstimate.onDeleting)
|
||||
@OnEvent(events.saleEstimate.onDeleting, { suppressErrors: false })
|
||||
public async transactionLockingGuardOnEstimateDeleting({
|
||||
oldSaleEstimate,
|
||||
}: ISaleEstimateDeletingPayload) {
|
||||
@@ -316,7 +316,7 @@ export class SalesTransactionLockingGuardSubscriber {
|
||||
* Transaction locking guard on estimate editing.
|
||||
* @param {ISaleEstimateEditingPayload} payload
|
||||
*/
|
||||
@OnEvent(events.saleEstimate.onEditing)
|
||||
@OnEvent(events.saleEstimate.onEditing, { suppressErrors: false })
|
||||
public async transactionLockingGuardOnEstimateEditing({
|
||||
oldSaleEstimate,
|
||||
estimateDTO,
|
||||
@@ -344,7 +344,7 @@ export class SalesTransactionLockingGuardSubscriber {
|
||||
* Transaction locking guard on payment receive editing.
|
||||
* @param {IPaymentReceivedEditingPayload}
|
||||
*/
|
||||
@OnEvent(events.paymentReceive.onEditing)
|
||||
@OnEvent(events.paymentReceive.onEditing, { suppressErrors: false })
|
||||
public async transactionLockingGuardOnPaymentEditing({
|
||||
oldPaymentReceive,
|
||||
paymentReceiveDTO,
|
||||
@@ -363,7 +363,7 @@ export class SalesTransactionLockingGuardSubscriber {
|
||||
* Transaction locking guard on payment creating.
|
||||
* @param {IPaymentReceivedCreatingPayload}
|
||||
*/
|
||||
@OnEvent(events.paymentReceive.onCreating)
|
||||
@OnEvent(events.paymentReceive.onCreating, { suppressErrors: false })
|
||||
public async transactionLockingGuardOnPaymentCreating({
|
||||
paymentReceiveDTO,
|
||||
}: IPaymentReceivedCreatingPayload) {
|
||||
@@ -376,7 +376,7 @@ export class SalesTransactionLockingGuardSubscriber {
|
||||
* Transaction locking guard on payment deleting.
|
||||
* @param {IPaymentReceivedDeletingPayload} payload -
|
||||
*/
|
||||
@OnEvent(events.paymentReceive.onDeleting)
|
||||
@OnEvent(events.paymentReceive.onDeleting, { suppressErrors: false })
|
||||
public async transactionLockingGuardPaymentDeleting({
|
||||
oldPaymentReceive,
|
||||
}: IPaymentReceivedDeletingPayload) {
|
||||
|
||||
Reference in New Issue
Block a user