import 'package:formz/formz.dart';

enum TransactionAccountValidationError {
  empty('Account empty'),
  invalid('Account invalid');

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

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

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