import 'package:equatable/equatable.dart';

class DisplayCounterDedicatedModelV2 extends Equatable {
  late List<NotServed> notServed;
  late List<Served> served;
  late List<Call> call;

  DisplayCounterDedicatedModelV2(
      {required this.notServed, required this.served, required this.call});

  DisplayCounterDedicatedModelV2.fromJson(Map<String, dynamic> json) {
    if (json['not_served'] != null) {
      notServed = [];
      json['not_served'].forEach((v) {
        notServed.add(NotServed.fromJson(v));
      });
    }
    if (json['served'] != null) {
      served = [];
      json['served'].forEach((v) {
        served.add(Served.fromJson(v));
      });
    }
    if (json['call'] != null) {
      call = [];
      json['call'].forEach((v) {
        call.add(Call.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = Map<String, dynamic>();
    if (this.notServed != null) {
      data['not_served'] = this.notServed.map((v) => v.toJson()).toList();
    }
    if (this.served != null) {
      data['served'] = this.served.map((v) => v.toJson()).toList();
    }
    return data;
  }

  @override
  List<Object?> get props => [notServed, served];
}

class NotServed extends Equatable {
  late String queueID;
  late String statusID;
  late String queueNumber;
  late String orderStatus;
  late String skipQueue;

  NotServed(
      {required this.queueID,
      required this.statusID,
      required this.queueNumber,
      required this.orderStatus,
      required this.skipQueue});

  NotServed.fromJson(Map<String, dynamic> json) {
    queueID = json['queueID'];
    statusID = json['statusID'];
    queueNumber = json['queueNumber'];
    orderStatus = json['order_status'];
    skipQueue = json['skipQueue'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['queueID'] = this.queueID;
    data['statusID'] = this.statusID;
    data['queueNumber'] = this.queueNumber;
    data['order_status'] = this.orderStatus;
    data['skipQueue'] = this.skipQueue;
    return data;
  }

  @override
  List<Object?> get props => [queueID, statusID, queueNumber, orderStatus];
}

class Served extends Equatable {
  late String queueID;
  late String statusID;
  late String queueNumber;
  late String queueCounterID;
  late String counterCode;
  late String orderStatus;

  Served(
      {required this.queueID,
      required this.statusID,
      required this.queueNumber,
      required this.queueCounterID,
      required this.counterCode,
      required this.orderStatus});

  Served.fromJson(Map<String, dynamic> json) {
    queueID = json['queueID'];
    statusID = json['statusID'];
    queueNumber = json['queueNumber'];
    queueCounterID = json['queueCounterID'];
    counterCode = json['counterCode'];
    orderStatus = json['order_status'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['queueID'] = this.queueID;
    data['statusID'] = this.statusID;
    data['queueNumber'] = this.queueNumber;
    data['queueCounterID'] = this.queueCounterID;
    data['counterCode'] = this.counterCode;
    data['order_status'] = this.orderStatus;
    return data;
  }

  @override
  List<Object?> get props => [queueID, statusID, queueNumber, orderStatus];
}

class Call extends Equatable {
  late String queueID;
  late String statusID;
  late String queueNumber;
  late String queueCounterID;
  late String counterCode;
  late String orderStatus;

  Call(
      {required this.queueID,
      required this.statusID,
      required this.queueNumber,
      required this.queueCounterID,
      required this.counterCode,
      required this.orderStatus});

  Call.fromJson(Map<String, dynamic> json) {
    queueID = json['queueID'];
    statusID = json['statusID'];
    queueNumber = json['queueNumber'];
    queueCounterID = json['queueCounterID'];
    counterCode = json['counterCode'];
    orderStatus = json['order_status'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['queueID'] = this.queueID;
    data['statusID'] = this.statusID;
    data['queueNumber'] = this.queueNumber;
    data['queueCounterID'] = this.queueCounterID;
    data['counterCode'] = this.counterCode;
    data['order_status'] = this.orderStatus;
    return data;
  }

  @override
  List<Object?> get props => [queueID, statusID, queueNumber, orderStatus];
}
