mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 12:50:38 +00:00
feat: exclude/unexclude the uncategorized transactions
This commit is contained in:
14
packages/server/src/services/Banking/Exclude/utils.ts
Normal file
14
packages/server/src/services/Banking/Exclude/utils.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { ServiceError } from '@/exceptions';
|
||||
import UncategorizedCashflowTransaction from '@/models/UncategorizedCashflowTransaction';
|
||||
|
||||
const ERRORS = {
|
||||
TRANSACTION_ALREADY_CATEGORIZED: 'TRANSACTION_ALREADY_CATEGORIZED',
|
||||
};
|
||||
|
||||
export const validateTransactionNotCategorized = (
|
||||
transaction: UncategorizedCashflowTransaction
|
||||
) => {
|
||||
if (transaction.categorized) {
|
||||
throw new ServiceError(ERRORS.TRANSACTION_ALREADY_CATEGORIZED);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user