part of '../printer.dart';

@freezed
class Printer with _$Printer {
  const factory Printer({
    required int id,
    required String code,
    required String name,
    required String address,
    required String paper,
    required String type,
    required DateTime createdAt,
    required DateTime updatedAt,
  }) = _Printer;

  factory Printer.empty() => Printer(
    id: 0,
    code: '',
    name: '',
    address: '',
    paper: '',
    type: '',
    createdAt: DateTime.now(),
    updatedAt: DateTime.now(),
  );

  factory Printer.fromTest({
    required String code,
    required String name,
    required String address,
    required String paper,
    required String type,
  }) => Printer(
    id: generateRandomNumber(),
    code: code,
    name: name,
    address: address,
    paper: paper,
    type: type,
    createdAt: DateTime.now(),
    updatedAt: DateTime.now(),
  );
}
