part of 'generated.dart';

class ListShiftsForPerformanceByBusinessVariablesBuilder {
  String businessId;
  Timestamp startDate;
  Timestamp endDate;

  final FirebaseDataConnect _dataConnect;
  ListShiftsForPerformanceByBusinessVariablesBuilder(this._dataConnect, {required  this.businessId,required  this.startDate,required  this.endDate,});
  Deserializer<ListShiftsForPerformanceByBusinessData> dataDeserializer = (dynamic json)  => ListShiftsForPerformanceByBusinessData.fromJson(jsonDecode(json));
  Serializer<ListShiftsForPerformanceByBusinessVariables> varsSerializer = (ListShiftsForPerformanceByBusinessVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<ListShiftsForPerformanceByBusinessData, ListShiftsForPerformanceByBusinessVariables>> execute() {
    return ref().execute();
  }

  QueryRef<ListShiftsForPerformanceByBusinessData, ListShiftsForPerformanceByBusinessVariables> ref() {
    ListShiftsForPerformanceByBusinessVariables vars= ListShiftsForPerformanceByBusinessVariables(businessId: businessId,startDate: startDate,endDate: endDate,);
    return _dataConnect.query("listShiftsForPerformanceByBusiness", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class ListShiftsForPerformanceByBusinessShifts {
  final String id;
  final int? workersNeeded;
  final int? filled;
  final EnumValue<ShiftStatus>? status;
  final Timestamp? createdAt;
  final Timestamp? filledAt;
  ListShiftsForPerformanceByBusinessShifts.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  workersNeeded = json['workersNeeded'] == null ? null : nativeFromJson<int>(json['workersNeeded']),
  filled = json['filled'] == null ? null : nativeFromJson<int>(json['filled']),
  status = json['status'] == null ? null : shiftStatusDeserializer(json['status']),
  createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']),
  filledAt = json['filledAt'] == null ? null : Timestamp.fromJson(json['filledAt']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListShiftsForPerformanceByBusinessShifts otherTyped = other as ListShiftsForPerformanceByBusinessShifts;
    return id == otherTyped.id && 
    workersNeeded == otherTyped.workersNeeded && 
    filled == otherTyped.filled && 
    status == otherTyped.status && 
    createdAt == otherTyped.createdAt && 
    filledAt == otherTyped.filledAt;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, workersNeeded.hashCode, filled.hashCode, status.hashCode, createdAt.hashCode, filledAt.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    if (workersNeeded != null) {
      json['workersNeeded'] = nativeToJson<int?>(workersNeeded);
    }
    if (filled != null) {
      json['filled'] = nativeToJson<int?>(filled);
    }
    if (status != null) {
      json['status'] = 
    shiftStatusSerializer(status!)
    ;
    }
    if (createdAt != null) {
      json['createdAt'] = createdAt!.toJson();
    }
    if (filledAt != null) {
      json['filledAt'] = filledAt!.toJson();
    }
    return json;
  }

  ListShiftsForPerformanceByBusinessShifts({
    required this.id,
    this.workersNeeded,
    this.filled,
    this.status,
    this.createdAt,
    this.filledAt,
  });
}

@immutable
class ListShiftsForPerformanceByBusinessData {
  final List<ListShiftsForPerformanceByBusinessShifts> shifts;
  ListShiftsForPerformanceByBusinessData.fromJson(dynamic json):
  
  shifts = (json['shifts'] as List<dynamic>)
        .map((e) => ListShiftsForPerformanceByBusinessShifts.fromJson(e))
        .toList();
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListShiftsForPerformanceByBusinessData otherTyped = other as ListShiftsForPerformanceByBusinessData;
    return shifts == otherTyped.shifts;
    
  }
  @override
  int get hashCode => shifts.hashCode;
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['shifts'] = shifts.map((e) => e.toJson()).toList();
    return json;
  }

  ListShiftsForPerformanceByBusinessData({
    required this.shifts,
  });
}

@immutable
class ListShiftsForPerformanceByBusinessVariables {
  final String businessId;
  final Timestamp startDate;
  final Timestamp endDate;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  ListShiftsForPerformanceByBusinessVariables.fromJson(Map<String, dynamic> json):
  
  businessId = nativeFromJson<String>(json['businessId']),
  startDate = Timestamp.fromJson(json['startDate']),
  endDate = Timestamp.fromJson(json['endDate']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListShiftsForPerformanceByBusinessVariables otherTyped = other as ListShiftsForPerformanceByBusinessVariables;
    return businessId == otherTyped.businessId && 
    startDate == otherTyped.startDate && 
    endDate == otherTyped.endDate;
    
  }
  @override
  int get hashCode => Object.hashAll([businessId.hashCode, startDate.hashCode, endDate.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['businessId'] = nativeToJson<String>(businessId);
    json['startDate'] = startDate.toJson();
    json['endDate'] = endDate.toJson();
    return json;
  }

  ListShiftsForPerformanceByBusinessVariables({
    required this.businessId,
    required this.startDate,
    required this.endDate,
  });
}

