part of 'generated.dart';

class GetShiftsByBusinessIdVariablesBuilder {
  String businessId;
  Optional<Timestamp> _dateFrom = Optional.optional((json) => json['dateFrom'] = Timestamp.fromJson(json['dateFrom']), defaultSerializer);
  Optional<Timestamp> _dateTo = Optional.optional((json) => json['dateTo'] = Timestamp.fromJson(json['dateTo']), defaultSerializer);
  Optional<int> _offset = Optional.optional(nativeFromJson, nativeToJson);
  Optional<int> _limit = Optional.optional(nativeFromJson, nativeToJson);

  final FirebaseDataConnect _dataConnect;  GetShiftsByBusinessIdVariablesBuilder dateFrom(Timestamp? t) {
   _dateFrom.value = t;
   return this;
  }
  GetShiftsByBusinessIdVariablesBuilder dateTo(Timestamp? t) {
   _dateTo.value = t;
   return this;
  }
  GetShiftsByBusinessIdVariablesBuilder offset(int? t) {
   _offset.value = t;
   return this;
  }
  GetShiftsByBusinessIdVariablesBuilder limit(int? t) {
   _limit.value = t;
   return this;
  }

  GetShiftsByBusinessIdVariablesBuilder(this._dataConnect, {required  this.businessId,});
  Deserializer<GetShiftsByBusinessIdData> dataDeserializer = (dynamic json)  => GetShiftsByBusinessIdData.fromJson(jsonDecode(json));
  Serializer<GetShiftsByBusinessIdVariables> varsSerializer = (GetShiftsByBusinessIdVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<GetShiftsByBusinessIdData, GetShiftsByBusinessIdVariables>> execute() {
    return ref().execute();
  }

  QueryRef<GetShiftsByBusinessIdData, GetShiftsByBusinessIdVariables> ref() {
    GetShiftsByBusinessIdVariables vars= GetShiftsByBusinessIdVariables(businessId: businessId,dateFrom: _dateFrom,dateTo: _dateTo,offset: _offset,limit: _limit,);
    return _dataConnect.query("getShiftsByBusinessId", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class GetShiftsByBusinessIdShifts {
  final String id;
  final String title;
  final String orderId;
  final Timestamp? date;
  final Timestamp? startTime;
  final Timestamp? endTime;
  final double? hours;
  final double? cost;
  final String? location;
  final String? locationAddress;
  final double? latitude;
  final double? longitude;
  final String? description;
  final EnumValue<ShiftStatus>? status;
  final int? workersNeeded;
  final int? filled;
  final Timestamp? filledAt;
  final List<AnyValue>? managers;
  final int? durationDays;
  final Timestamp? createdAt;
  final Timestamp? updatedAt;
  final String? createdBy;
  final GetShiftsByBusinessIdShiftsOrder order;
  GetShiftsByBusinessIdShifts.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  title = nativeFromJson<String>(json['title']),
  orderId = nativeFromJson<String>(json['orderId']),
  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']),
  location = json['location'] == null ? null : nativeFromJson<String>(json['location']),
  locationAddress = json['locationAddress'] == null ? null : nativeFromJson<String>(json['locationAddress']),
  latitude = json['latitude'] == null ? null : nativeFromJson<double>(json['latitude']),
  longitude = json['longitude'] == null ? null : nativeFromJson<double>(json['longitude']),
  description = json['description'] == null ? null : nativeFromJson<String>(json['description']),
  status = json['status'] == null ? null : shiftStatusDeserializer(json['status']),
  workersNeeded = json['workersNeeded'] == null ? null : nativeFromJson<int>(json['workersNeeded']),
  filled = json['filled'] == null ? null : nativeFromJson<int>(json['filled']),
  filledAt = json['filledAt'] == null ? null : Timestamp.fromJson(json['filledAt']),
  managers = json['managers'] == null ? null : (json['managers'] as List<dynamic>)
        .map((e) => AnyValue.fromJson(e))
        .toList(),
  durationDays = json['durationDays'] == null ? null : nativeFromJson<int>(json['durationDays']),
  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']),
  order = GetShiftsByBusinessIdShiftsOrder.fromJson(json['order']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final GetShiftsByBusinessIdShifts otherTyped = other as GetShiftsByBusinessIdShifts;
    return id == otherTyped.id && 
    title == otherTyped.title && 
    orderId == otherTyped.orderId && 
    date == otherTyped.date && 
    startTime == otherTyped.startTime && 
    endTime == otherTyped.endTime && 
    hours == otherTyped.hours && 
    cost == otherTyped.cost && 
    location == otherTyped.location && 
    locationAddress == otherTyped.locationAddress && 
    latitude == otherTyped.latitude && 
    longitude == otherTyped.longitude && 
    description == otherTyped.description && 
    status == otherTyped.status && 
    workersNeeded == otherTyped.workersNeeded && 
    filled == otherTyped.filled && 
    filledAt == otherTyped.filledAt && 
    managers == otherTyped.managers && 
    durationDays == otherTyped.durationDays && 
    createdAt == otherTyped.createdAt && 
    updatedAt == otherTyped.updatedAt && 
    createdBy == otherTyped.createdBy && 
    order == otherTyped.order;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, title.hashCode, orderId.hashCode, date.hashCode, startTime.hashCode, endTime.hashCode, hours.hashCode, cost.hashCode, location.hashCode, locationAddress.hashCode, latitude.hashCode, longitude.hashCode, description.hashCode, status.hashCode, workersNeeded.hashCode, filled.hashCode, filledAt.hashCode, managers.hashCode, durationDays.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, order.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    json['title'] = nativeToJson<String>(title);
    json['orderId'] = nativeToJson<String>(orderId);
    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 (location != null) {
      json['location'] = nativeToJson<String?>(location);
    }
    if (locationAddress != null) {
      json['locationAddress'] = nativeToJson<String?>(locationAddress);
    }
    if (latitude != null) {
      json['latitude'] = nativeToJson<double?>(latitude);
    }
    if (longitude != null) {
      json['longitude'] = nativeToJson<double?>(longitude);
    }
    if (description != null) {
      json['description'] = nativeToJson<String?>(description);
    }
    if (status != null) {
      json['status'] = 
    shiftStatusSerializer(status!)
    ;
    }
    if (workersNeeded != null) {
      json['workersNeeded'] = nativeToJson<int?>(workersNeeded);
    }
    if (filled != null) {
      json['filled'] = nativeToJson<int?>(filled);
    }
    if (filledAt != null) {
      json['filledAt'] = filledAt!.toJson();
    }
    if (managers != null) {
      json['managers'] = managers?.map((e) => e!.toJson()).toList();
    }
    if (durationDays != null) {
      json['durationDays'] = nativeToJson<int?>(durationDays);
    }
    if (createdAt != null) {
      json['createdAt'] = createdAt!.toJson();
    }
    if (updatedAt != null) {
      json['updatedAt'] = updatedAt!.toJson();
    }
    if (createdBy != null) {
      json['createdBy'] = nativeToJson<String?>(createdBy);
    }
    json['order'] = order.toJson();
    return json;
  }

  GetShiftsByBusinessIdShifts({
    required this.id,
    required this.title,
    required this.orderId,
    this.date,
    this.startTime,
    this.endTime,
    this.hours,
    this.cost,
    this.location,
    this.locationAddress,
    this.latitude,
    this.longitude,
    this.description,
    this.status,
    this.workersNeeded,
    this.filled,
    this.filledAt,
    this.managers,
    this.durationDays,
    this.createdAt,
    this.updatedAt,
    this.createdBy,
    required this.order,
  });
}

@immutable
class GetShiftsByBusinessIdShiftsOrder {
  final String id;
  final String? eventName;
  final EnumValue<OrderStatus> status;
  final EnumValue<OrderType> orderType;
  final String businessId;
  final String? vendorId;
  final GetShiftsByBusinessIdShiftsOrderBusiness business;
  final GetShiftsByBusinessIdShiftsOrderVendor? vendor;
  GetShiftsByBusinessIdShiftsOrder.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  eventName = json['eventName'] == null ? null : nativeFromJson<String>(json['eventName']),
  status = orderStatusDeserializer(json['status']),
  orderType = orderTypeDeserializer(json['orderType']),
  businessId = nativeFromJson<String>(json['businessId']),
  vendorId = json['vendorId'] == null ? null : nativeFromJson<String>(json['vendorId']),
  business = GetShiftsByBusinessIdShiftsOrderBusiness.fromJson(json['business']),
  vendor = json['vendor'] == null ? null : GetShiftsByBusinessIdShiftsOrderVendor.fromJson(json['vendor']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final GetShiftsByBusinessIdShiftsOrder otherTyped = other as GetShiftsByBusinessIdShiftsOrder;
    return id == otherTyped.id && 
    eventName == otherTyped.eventName && 
    status == otherTyped.status && 
    orderType == otherTyped.orderType && 
    businessId == otherTyped.businessId && 
    vendorId == otherTyped.vendorId && 
    business == otherTyped.business && 
    vendor == otherTyped.vendor;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, eventName.hashCode, status.hashCode, orderType.hashCode, businessId.hashCode, vendorId.hashCode, business.hashCode, vendor.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    if (eventName != null) {
      json['eventName'] = nativeToJson<String?>(eventName);
    }
    json['status'] = 
    orderStatusSerializer(status)
    ;
    json['orderType'] = 
    orderTypeSerializer(orderType)
    ;
    json['businessId'] = nativeToJson<String>(businessId);
    if (vendorId != null) {
      json['vendorId'] = nativeToJson<String?>(vendorId);
    }
    json['business'] = business.toJson();
    if (vendor != null) {
      json['vendor'] = vendor!.toJson();
    }
    return json;
  }

  GetShiftsByBusinessIdShiftsOrder({
    required this.id,
    this.eventName,
    required this.status,
    required this.orderType,
    required this.businessId,
    this.vendorId,
    required this.business,
    this.vendor,
  });
}

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

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

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    json['businessName'] = nativeToJson<String>(businessName);
    if (email != null) {
      json['email'] = nativeToJson<String?>(email);
    }
    if (contactName != null) {
      json['contactName'] = nativeToJson<String?>(contactName);
    }
    return json;
  }

  GetShiftsByBusinessIdShiftsOrderBusiness({
    required this.id,
    required this.businessName,
    this.email,
    this.contactName,
  });
}

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

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

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

  GetShiftsByBusinessIdShiftsOrderVendor({
    required this.id,
    required this.companyName,
  });
}

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

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

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

@immutable
class GetShiftsByBusinessIdVariables {
  final String businessId;
  late final Optional<Timestamp>dateFrom;
  late final Optional<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.')
  GetShiftsByBusinessIdVariables.fromJson(Map<String, dynamic> json):
  
  businessId = nativeFromJson<String>(json['businessId']) {
  
  
  
    dateFrom = Optional.optional((json) => json['dateFrom'] = Timestamp.fromJson(json['dateFrom']), defaultSerializer);
    dateFrom.value = json['dateFrom'] == null ? null : Timestamp.fromJson(json['dateFrom']);
  
  
    dateTo = Optional.optional((json) => json['dateTo'] = Timestamp.fromJson(json['dateTo']), defaultSerializer);
    dateTo.value = json['dateTo'] == null ? null : 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 GetShiftsByBusinessIdVariables otherTyped = other as GetShiftsByBusinessIdVariables;
    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);
    if(dateFrom.state == OptionalState.set) {
      json['dateFrom'] = dateFrom.toJson();
    }
    if(dateTo.state == OptionalState.set) {
      json['dateTo'] = dateTo.toJson();
    }
    if(offset.state == OptionalState.set) {
      json['offset'] = offset.toJson();
    }
    if(limit.state == OptionalState.set) {
      json['limit'] = limit.toJson();
    }
    return json;
  }

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

