part of 'generated.dart';

class ListShiftsForForecastByVendorVariablesBuilder {
  String vendorId;
  Timestamp startDate;
  Timestamp endDate;

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

  QueryRef<ListShiftsForForecastByVendorData, ListShiftsForForecastByVendorVariables> ref() {
    ListShiftsForForecastByVendorVariables vars= ListShiftsForForecastByVendorVariables(vendorId: vendorId,startDate: startDate,endDate: endDate,);
    return _dataConnect.query("listShiftsForForecastByVendor", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class ListShiftsForForecastByVendorShifts {
  final String id;
  final Timestamp? date;
  final int? workersNeeded;
  final double? hours;
  final double? cost;
  final EnumValue<ShiftStatus>? status;
  ListShiftsForForecastByVendorShifts.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 ListShiftsForForecastByVendorShifts otherTyped = other as ListShiftsForForecastByVendorShifts;
    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;
  }

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

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

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

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

@immutable
class ListShiftsForForecastByVendorVariables {
  final String vendorId;
  final Timestamp startDate;
  final Timestamp endDate;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  ListShiftsForForecastByVendorVariables.fromJson(Map<String, dynamic> json):
  
  vendorId = nativeFromJson<String>(json['vendorId']),
  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 ListShiftsForForecastByVendorVariables otherTyped = other as ListShiftsForForecastByVendorVariables;
    return vendorId == otherTyped.vendorId && 
    startDate == otherTyped.startDate && 
    endDate == otherTyped.endDate;
    
  }
  @override
  int get hashCode => Object.hashAll([vendorId.hashCode, startDate.hashCode, endDate.hashCode]);
  

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

  ListShiftsForForecastByVendorVariables({
    required this.vendorId,
    required this.startDate,
    required this.endDate,
  });
}

