part of 'generated.dart';

class GetStaffAvailabilityByKeyVariablesBuilder {
  String staffId;
  DayOfWeek day;
  AvailabilitySlot slot;

  final FirebaseDataConnect _dataConnect;
  GetStaffAvailabilityByKeyVariablesBuilder(this._dataConnect, {required  this.staffId,required  this.day,required  this.slot,});
  Deserializer<GetStaffAvailabilityByKeyData> dataDeserializer = (dynamic json)  => GetStaffAvailabilityByKeyData.fromJson(jsonDecode(json));
  Serializer<GetStaffAvailabilityByKeyVariables> varsSerializer = (GetStaffAvailabilityByKeyVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<GetStaffAvailabilityByKeyData, GetStaffAvailabilityByKeyVariables>> execute() {
    return ref().execute();
  }

  QueryRef<GetStaffAvailabilityByKeyData, GetStaffAvailabilityByKeyVariables> ref() {
    GetStaffAvailabilityByKeyVariables vars= GetStaffAvailabilityByKeyVariables(staffId: staffId,day: day,slot: slot,);
    return _dataConnect.query("getStaffAvailabilityByKey", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class GetStaffAvailabilityByKeyStaffAvailability {
  final String id;
  final String staffId;
  final EnumValue<DayOfWeek> day;
  final EnumValue<AvailabilitySlot> slot;
  final EnumValue<AvailabilityStatus> status;
  final String? notes;
  final Timestamp? createdAt;
  final Timestamp? updatedAt;
  final String? createdBy;
  final GetStaffAvailabilityByKeyStaffAvailabilityStaff staff;
  GetStaffAvailabilityByKeyStaffAvailability.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  staffId = nativeFromJson<String>(json['staffId']),
  day = dayOfWeekDeserializer(json['day']),
  slot = availabilitySlotDeserializer(json['slot']),
  status = availabilityStatusDeserializer(json['status']),
  notes = json['notes'] == null ? null : nativeFromJson<String>(json['notes']),
  createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']),
  updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']),
  createdBy = json['createdBy'] == null ? null : nativeFromJson<String>(json['createdBy']),
  staff = GetStaffAvailabilityByKeyStaffAvailabilityStaff.fromJson(json['staff']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final GetStaffAvailabilityByKeyStaffAvailability otherTyped = other as GetStaffAvailabilityByKeyStaffAvailability;
    return id == otherTyped.id && 
    staffId == otherTyped.staffId && 
    day == otherTyped.day && 
    slot == otherTyped.slot && 
    status == otherTyped.status && 
    notes == otherTyped.notes && 
    createdAt == otherTyped.createdAt && 
    updatedAt == otherTyped.updatedAt && 
    createdBy == otherTyped.createdBy && 
    staff == otherTyped.staff;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, staffId.hashCode, day.hashCode, slot.hashCode, status.hashCode, notes.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, staff.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    json['staffId'] = nativeToJson<String>(staffId);
    json['day'] = 
    dayOfWeekSerializer(day)
    ;
    json['slot'] = 
    availabilitySlotSerializer(slot)
    ;
    json['status'] = 
    availabilityStatusSerializer(status)
    ;
    if (notes != null) {
      json['notes'] = nativeToJson<String?>(notes);
    }
    if (createdAt != null) {
      json['createdAt'] = createdAt!.toJson();
    }
    if (updatedAt != null) {
      json['updatedAt'] = updatedAt!.toJson();
    }
    if (createdBy != null) {
      json['createdBy'] = nativeToJson<String?>(createdBy);
    }
    json['staff'] = staff.toJson();
    return json;
  }

  GetStaffAvailabilityByKeyStaffAvailability({
    required this.id,
    required this.staffId,
    required this.day,
    required this.slot,
    required this.status,
    this.notes,
    this.createdAt,
    this.updatedAt,
    this.createdBy,
    required this.staff,
  });
}

@immutable
class GetStaffAvailabilityByKeyStaffAvailabilityStaff {
  final String id;
  final String fullName;
  GetStaffAvailabilityByKeyStaffAvailabilityStaff.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  fullName = nativeFromJson<String>(json['fullName']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final GetStaffAvailabilityByKeyStaffAvailabilityStaff otherTyped = other as GetStaffAvailabilityByKeyStaffAvailabilityStaff;
    return id == otherTyped.id && 
    fullName == otherTyped.fullName;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, fullName.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    json['fullName'] = nativeToJson<String>(fullName);
    return json;
  }

  GetStaffAvailabilityByKeyStaffAvailabilityStaff({
    required this.id,
    required this.fullName,
  });
}

@immutable
class GetStaffAvailabilityByKeyData {
  final GetStaffAvailabilityByKeyStaffAvailability? staffAvailability;
  GetStaffAvailabilityByKeyData.fromJson(dynamic json):
  
  staffAvailability = json['staffAvailability'] == null ? null : GetStaffAvailabilityByKeyStaffAvailability.fromJson(json['staffAvailability']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final GetStaffAvailabilityByKeyData otherTyped = other as GetStaffAvailabilityByKeyData;
    return staffAvailability == otherTyped.staffAvailability;
    
  }
  @override
  int get hashCode => staffAvailability.hashCode;
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    if (staffAvailability != null) {
      json['staffAvailability'] = staffAvailability!.toJson();
    }
    return json;
  }

  GetStaffAvailabilityByKeyData({
    this.staffAvailability,
  });
}

@immutable
class GetStaffAvailabilityByKeyVariables {
  final String staffId;
  final DayOfWeek day;
  final AvailabilitySlot slot;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  GetStaffAvailabilityByKeyVariables.fromJson(Map<String, dynamic> json):
  
  staffId = nativeFromJson<String>(json['staffId']),
  day = DayOfWeek.values.byName(json['day']),
  slot = AvailabilitySlot.values.byName(json['slot']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final GetStaffAvailabilityByKeyVariables otherTyped = other as GetStaffAvailabilityByKeyVariables;
    return staffId == otherTyped.staffId && 
    day == otherTyped.day && 
    slot == otherTyped.slot;
    
  }
  @override
  int get hashCode => Object.hashAll([staffId.hashCode, day.hashCode, slot.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['staffId'] = nativeToJson<String>(staffId);
    json['day'] = 
    day.name
    ;
    json['slot'] = 
    slot.name
    ;
    return json;
  }

  GetStaffAvailabilityByKeyVariables({
    required this.staffId,
    required this.day,
    required this.slot,
  });
}

