import 'package:formz/formz.dart';

enum TransactionCategoryValidationError {
  empty('Category empty'),
  invalid('Category invalid');

  final String message;
  const TransactionCategoryValidationError(this.message);
}

class TransactionCategory extends FormzInput<String, TransactionCategoryValidationError> {
  const TransactionCategory.pure() : super.pure('');
  const TransactionCategory.dirty([super.value = '']) : super.dirty();

  @override
  TransactionCategoryValidationError? validator(String value) {
    return value.isEmpty ? TransactionCategoryValidationError.empty : null;
  }
}