part of 'generated.dart';

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

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

  QueryRef<ListShiftsForForecastByBusinessData, ListShiftsForForecastByBusinessVariables> ref() {
    ListShiftsForForecastByBusinessVariables vars= ListShiftsForForecastByBusinessVariables(businessId: businessId,startDate: startDate,endDate: endDate,);
    return _dataConnect.query("listShiftsForForecastByBusiness", dataDeserializer, varsSerializer, vars);
  }
}

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

    final ListShiftsForForecastByBusinessShifts otherTyped = other as ListShiftsForForecastByBusinessShifts;
    return id == otherTyped.id && 
    date == otherTyped.date && 
    workersNeeded == otherTyped.workersNeeded && 
    hours == otherTyped.hours && 
    cost == otherTyped.cost && 
    status == otherTyped.status;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, date.hashCode, workersNeeded.hashCode, hours.hashCode, cost.hashCode, status.hashCode]);
  

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

  ListShiftsForForecastByBusinessShifts({
    required this.id,
    this.date,
    this.workersNeeded,
    this.hours,
    this.cost,
    this.status,
  });
}

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

    final ListShiftsForForecastByBusinessData otherTyped = other as ListShiftsForForecastByBusinessData;
    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;
  }

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

@immutable
class ListShiftsForForecastByBusinessVariables {
  final String businessId;
  final Timestamp startDate;
  final Timestamp endDate;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  ListShiftsForForecastByBusinessVariables.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 ListShiftsForForecastByBusinessVariables otherTyped = other as ListShiftsForForecastByBusinessVariables;
    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;
  }

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

