import 'package:equatable/equatable.dart';

class LayananDokter extends Equatable {
  int id;
  String name;
  String code;
  bool value;
  int priority;
  String isConsultDoctor;
  String doctorName;
  String? img;

  LayananDokter(
      {required this.name,
      required this.id,
      required this.priority,
      required this.isConsultDoctor,
      this.doctorName = '',
      this.value = false,
      this.img,
      required this.code});
  LayananDokter.fromJson(Map<String, dynamic> json)
      : name = (json['serviceName'] as String).replaceAll("</br>", "\n"),
        code = json['serviceCode'].toString(),
        priority = int.parse(json['servicePriority']),
        value = false,
        isConsultDoctor = json['serviceIsConsultDoctor'].toString(),
        doctorName = json['serviceDoctorName'].toString(),
        id = int.parse(json['serviceID']);

  Map<String, dynamic> toJson() => {
        'serviceName': name,
        'serviceID': id,
        'serviceCode': code,
        'servicePriority': priority,
        'value': value
      };
  @override
  List<Object?> get props => [id];
}
