mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 05:40:31 +00:00
15 lines
441 B
TypeScript
15 lines
441 B
TypeScript
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);
|
|
}
|
|
};
|