mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-14 11:50:31 +00:00
refactor(nestjs): transaction locking
This commit is contained in:
@@ -70,7 +70,8 @@ export class TransactionsLockingGuard {
|
||||
) => {
|
||||
const { lockToDate } =
|
||||
await this.transactionsLockingRepo.getTransactionsLocking(lockingGroup);
|
||||
throw new ServiceError(ERRORS.TRANSACTIONS_DATE_LOCKED, null, {
|
||||
|
||||
throw new ServiceError(ERRORS.TRANSACTIONS_DATE_LOCKED, 'Transactions locked', {
|
||||
lockedToDate: lockToDate,
|
||||
formattedLockedToDate: moment(lockToDate).format('YYYY/MM/DD'),
|
||||
});
|
||||
@@ -88,14 +89,12 @@ export class TransactionsLockingGuard {
|
||||
const lockingType =
|
||||
await this.transactionsLockingRepo.getTransactionsLockingType();
|
||||
|
||||
//
|
||||
if (lockingType === TransactionsLockingGroup.All) {
|
||||
return this.validateTransactionsLocking(
|
||||
transactionDate,
|
||||
TransactionsLockingGroup.All,
|
||||
);
|
||||
}
|
||||
//
|
||||
return this.validateTransactionsLocking(transactionDate, moduleType);
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user