import 'package:equatable/equatable.dart';

class Counter extends Equatable {
  // int id;
  // String name;
  // String code;
  // bool value;
  // int priority;
  // String isConsultDoctor;
  // String doctorName;
  // String? img;
  int counterID;
  String? counterCode;
  String? counterIP;
  String? counterIsDedicated;
  String? counterLocationID;
  String? counterMaxQueue;
  String? counterIsActive;
  String? locationID;
  String? locationName;
  String? serviceID;
  bool value;

  Counter({
    // required this.name,
    // required this.id,
    // required this.priority,
    // required this.isConsultDoctor,
    // this.doctorName = '',
    // this.value = false,
    // this.img,
    // required this.code
    required this.counterCode,
    required this.counterID,
    required this.counterIP,
    required this.counterIsDedicated,
    required this.counterMaxQueue,
    required this.counterIsActive,
    required this.locationID,
    required this.locationName,
    required this.serviceID,
    this.value = false,
  });
  Counter.fromJson(Map<String, dynamic> json)
      : counterID = int.parse(json['counterID']),
        counterCode = json['counterCode'].toString(),
        counterIP = json['counterIP'].toString(),
        value = false,
        counterIsDedicated = json['counterIsDedicated'].toString(),
        counterMaxQueue = json['counterMaxQueue'].toString(),
        locationID = json['locationID'].toString(),
        locationName = json['locationName'].toString(),
        serviceID = json['serviceID'].toString(),
        counterIsActive = json['counterIsActive'].toString();

  Map<String, dynamic> toJson() => {
        'counterID': counterID,
        'counterCode': counterCode,
        'counterIP': counterIP,
        'counterIsDedicated': counterIsDedicated,
        'counterMaxQueue': counterMaxQueue,
        'counterIsActive': counterIsActive,
        'locationID': locationID,
        'locationName': locationName,
        'serviceID': serviceID,
        'value': value
      };
  @override
  List<Object?> get props => [counterID];
}
