part of 'generated.dart';

class GetCompletedShiftsByBusinessIdVariablesBuilder {
  String businessId;
  Timestamp dateFrom;
  Timestamp dateTo;
  Optional<int> _offset = Optional.optional(nativeFromJson, nativeToJson);
  Optional<int> _limit = Optional.optional(nativeFromJson, nativeToJson);

  final FirebaseDataConnect _dataConnect;  GetCompletedShiftsByBusinessIdVariablesBuilder offset(int? t) {
   _offset.value = t;
   return this;
  }
  GetCompletedShiftsByBusinessIdVariablesBuilder limit(int? t) {
   _limit.value = t;
   return this;
  }

  GetCompletedShiftsByBusinessIdVariablesBuilder(this._dataConnect, {required  this.businessId,required  this.dateFrom,required  this.dateTo,});
  Deserializer<GetCompletedShiftsByBusinessIdData> dataDeserializer = (dynamic json)  => GetCompletedShiftsByBusinessIdData.fromJson(jsonDecode(json));
  Serializer<GetCompletedShiftsByBusinessIdVariables> varsSerializer = (GetCompletedShiftsByBusinessIdVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<GetCompletedShiftsByBusinessIdData, GetCompletedShiftsByBusinessIdVariables>> execute() {
    return ref().execute();
  }

  QueryRef<GetCompletedShiftsByBusinessIdData, GetCompletedShiftsByBusinessIdVariables> ref() {
    GetCompletedShiftsByBusinessIdVariables vars= GetCompletedShiftsByBusinessIdVariables(businessId: businessId,dateFrom: dateFrom,dateTo: dateTo,offset: _offset,limit: _limit,);
    return _dataConnect.query("getCompletedShiftsByBusinessId", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class GetCompletedShiftsByBusinessIdShifts {
  final String id;
  final Timestamp? date;
  final Timestamp? startTime;
  final Timestamp? endTime;
  final double? hours;
  final double? cost;
  final int? workersNeeded;
  final int? filled;
  final Timestamp? createdAt;
  final GetCompletedShiftsByBusinessIdShiftsOrder order;
  GetCompletedShiftsByBusinessIdShifts.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  date = json['date'] == null ? null : Timestamp.fromJson(json['date']),
  startTime = json['startTime'] == null ? null : Timestamp.fromJson(json['startTime']),
  endTime = json['endTime'] == null ? null : Timestamp.fromJson(json['endTime']),
  hours = json['hours'] == null ? null : nativeFromJson<double>(json['hours']),
  cost = json['cost'] == null ? null : nativeFromJson<double>(json['cost']),
  workersNeeded = json['workersNeeded'] == null ? null : nativeFromJson<int>(json['workersNeeded']),
  filled = json['filled'] == null ? null : nativeFromJson<int>(json['filled']),
  createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']),
  order = GetCompletedShiftsByBusinessIdShiftsOrder.fromJson(json['order']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final GetCompletedShiftsByBusinessIdShifts otherTyped = other as GetCompletedShiftsByBusinessIdShifts;
    return id == otherTyped.id && 
    date == otherTyped.date && 
    startTime == otherTyped.startTime && 
    endTime == otherTyped.endTime && 
    hours == otherTyped.hours && 
    cost == otherTyped.cost && 
    workersNeeded == otherTyped.workersNeeded && 
    filled == otherTyped.filled && 
    createdAt == otherTyped.createdAt && 
    order == otherTyped.order;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, date.hashCode, startTime.hashCode, endTime.hashCode, hours.hashCode, cost.hashCode, workersNeeded.hashCode, filled.hashCode, createdAt.hashCode, order.hashCode]);
  

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

  GetCompletedShiftsByBusinessIdShifts({
    required this.id,
    this.date,
    this.startTime,
    this.endTime,
    this.hours,
    this.cost,
    this.workersNeeded,
    this.filled,
    this.createdAt,
    required this.order,
  });
}

@immutable
class GetCompletedShiftsByBusinessIdShiftsOrder {
  final EnumValue<OrderStatus> status;
  GetCompletedShiftsByBusinessIdShiftsOrder.fromJson(dynamic json):
  
  status = orderStatusDeserializer(json['status']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final GetCompletedShiftsByBusinessIdShiftsOrder otherTyped = other as GetCompletedShiftsByBusinessIdShiftsOrder;
    return status == otherTyped.status;
    
  }
  @override
  int get hashCode => status.hashCode;
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['status'] = 
    orderStatusSerializer(status)
    ;
    return json;
  }

  GetCompletedShiftsByBusinessIdShiftsOrder({
    required this.status,
  });
}

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

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

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

@immutable
class GetCompletedShiftsByBusinessIdVariables {
  final String businessId;
  final Timestamp dateFrom;
  final Timestamp dateTo;
  late final Optional<int>offset;
  late final Optional<int>limit;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  GetCompletedShiftsByBusinessIdVariables.fromJson(Map<String, dynamic> json):
  
  businessId = nativeFromJson<String>(json['businessId']),
  dateFrom = Timestamp.fromJson(json['dateFrom']),
  dateTo = Timestamp.fromJson(json['dateTo']) {
  
  
  
  
  
    offset = Optional.optional(nativeFromJson, nativeToJson);
    offset.value = json['offset'] == null ? null : nativeFromJson<int>(json['offset']);
  
  
    limit = Optional.optional(nativeFromJson, nativeToJson);
    limit.value = json['limit'] == null ? null : nativeFromJson<int>(json['limit']);
  
  }
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final GetCompletedShiftsByBusinessIdVariables otherTyped = other as GetCompletedShiftsByBusinessIdVariables;
    return businessId == otherTyped.businessId && 
    dateFrom == otherTyped.dateFrom && 
    dateTo == otherTyped.dateTo && 
    offset == otherTyped.offset && 
    limit == otherTyped.limit;
    
  }
  @override
  int get hashCode => Object.hashAll([businessId.hashCode, dateFrom.hashCode, dateTo.hashCode, offset.hashCode, limit.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['businessId'] = nativeToJson<String>(businessId);
    json['dateFrom'] = dateFrom.toJson();
    json['dateTo'] = dateTo.toJson();
    if(offset.state == OptionalState.set) {
      json['offset'] = offset.toJson();
    }
    if(limit.state == OptionalState.set) {
      json['limit'] = limit.toJson();
    }
    return json;
  }

  GetCompletedShiftsByBusinessIdVariables({
    required this.businessId,
    required this.dateFrom,
    required this.dateTo,
    required this.offset,
    required this.limit,
  });
}

