part of 'printer_form_bloc.dart';

@freezed
class PrinterFormState with _$PrinterFormState {
  factory PrinterFormState({
    required String code,
    required String name,
    required String address,
    required String paper,
    required String type,
    required Option<Either<PrinterFailure, Unit>> failureOrCreateSuccess,
    required Option<Either<PrinterFailure, Unit>> failureOrUpdateSuccess,
    required Option<Either<PrinterFailure, Unit>> failureOrDeleteSuccess,
    required Option<Either<PrinterFailure, bool>> failureOrPrintTest,
    @Default(false) isCreating,
    @Default(false) isUpdate,
    @Default(false) isDeleting,
    @Default(false) isPrinting,
  }) = _PrinterFormState;

  factory PrinterFormState.initial() => PrinterFormState(
    code: '',
    name: '',
    address: '',
    paper: '58',
    type: 'Bluetooth',
    failureOrCreateSuccess: none(),
    failureOrUpdateSuccess: none(),
    failureOrDeleteSuccess: none(),
    failureOrPrintTest: none(),
  );
}
