part of 'generated.dart';

class GetOrdersByStatusVariablesBuilder {
  OrderStatus status;
  Optional<int> _offset = Optional.optional(nativeFromJson, nativeToJson);
  Optional<int> _limit = Optional.optional(nativeFromJson, nativeToJson);

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

  GetOrdersByStatusVariablesBuilder(this._dataConnect, {required  this.status,});
  Deserializer<GetOrdersByStatusData> dataDeserializer = (dynamic json)  => GetOrdersByStatusData.fromJson(jsonDecode(json));
  Serializer<GetOrdersByStatusVariables> varsSerializer = (GetOrdersByStatusVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<GetOrdersByStatusData, GetOrdersByStatusVariables>> execute() {
    return ref().execute();
  }

  QueryRef<GetOrdersByStatusData, GetOrdersByStatusVariables> ref() {
    GetOrdersByStatusVariables vars= GetOrdersByStatusVariables(status: status,offset: _offset,limit: _limit,);
    return _dataConnect.query("getOrdersByStatus", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class GetOrdersByStatusOrders {
  final String id;
  final String? eventName;
  final String? vendorId;
  final String businessId;
  final EnumValue<OrderType> orderType;
  final EnumValue<OrderStatus> status;
  final Timestamp? date;
  final Timestamp? startDate;
  final Timestamp? endDate;
  final EnumValue<OrderDuration>? duration;
  final int? lunchBreak;
  final double? total;
  final AnyValue? assignedStaff;
  final AnyValue? shifts;
  final int? requested;
  final AnyValue? recurringDays;
  final AnyValue? permanentDays;
  final String? poReference;
  final AnyValue? detectedConflicts;
  final String? notes;
  final Timestamp? createdAt;
  final GetOrdersByStatusOrdersBusiness business;
  final GetOrdersByStatusOrdersVendor? vendor;
  final GetOrdersByStatusOrdersTeamHub teamHub;
  GetOrdersByStatusOrders.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  eventName = json['eventName'] == null ? null : nativeFromJson<String>(json['eventName']),
  vendorId = json['vendorId'] == null ? null : nativeFromJson<String>(json['vendorId']),
  businessId = nativeFromJson<String>(json['businessId']),
  orderType = orderTypeDeserializer(json['orderType']),
  status = orderStatusDeserializer(json['status']),
  date = json['date'] == null ? null : Timestamp.fromJson(json['date']),
  startDate = json['startDate'] == null ? null : Timestamp.fromJson(json['startDate']),
  endDate = json['endDate'] == null ? null : Timestamp.fromJson(json['endDate']),
  duration = json['duration'] == null ? null : orderDurationDeserializer(json['duration']),
  lunchBreak = json['lunchBreak'] == null ? null : nativeFromJson<int>(json['lunchBreak']),
  total = json['total'] == null ? null : nativeFromJson<double>(json['total']),
  assignedStaff = json['assignedStaff'] == null ? null : AnyValue.fromJson(json['assignedStaff']),
  shifts = json['shifts'] == null ? null : AnyValue.fromJson(json['shifts']),
  requested = json['requested'] == null ? null : nativeFromJson<int>(json['requested']),
  recurringDays = json['recurringDays'] == null ? null : AnyValue.fromJson(json['recurringDays']),
  permanentDays = json['permanentDays'] == null ? null : AnyValue.fromJson(json['permanentDays']),
  poReference = json['poReference'] == null ? null : nativeFromJson<String>(json['poReference']),
  detectedConflicts = json['detectedConflicts'] == null ? null : AnyValue.fromJson(json['detectedConflicts']),
  notes = json['notes'] == null ? null : nativeFromJson<String>(json['notes']),
  createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']),
  business = GetOrdersByStatusOrdersBusiness.fromJson(json['business']),
  vendor = json['vendor'] == null ? null : GetOrdersByStatusOrdersVendor.fromJson(json['vendor']),
  teamHub = GetOrdersByStatusOrdersTeamHub.fromJson(json['teamHub']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final GetOrdersByStatusOrders otherTyped = other as GetOrdersByStatusOrders;
    return id == otherTyped.id && 
    eventName == otherTyped.eventName && 
    vendorId == otherTyped.vendorId && 
    businessId == otherTyped.businessId && 
    orderType == otherTyped.orderType && 
    status == otherTyped.status && 
    date == otherTyped.date && 
    startDate == otherTyped.startDate && 
    endDate == otherTyped.endDate && 
    duration == otherTyped.duration && 
    lunchBreak == otherTyped.lunchBreak && 
    total == otherTyped.total && 
    assignedStaff == otherTyped.assignedStaff && 
    shifts == otherTyped.shifts && 
    requested == otherTyped.requested && 
    recurringDays == otherTyped.recurringDays && 
    permanentDays == otherTyped.permanentDays && 
    poReference == otherTyped.poReference && 
    detectedConflicts == otherTyped.detectedConflicts && 
    notes == otherTyped.notes && 
    createdAt == otherTyped.createdAt && 
    business == otherTyped.business && 
    vendor == otherTyped.vendor && 
    teamHub == otherTyped.teamHub;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, eventName.hashCode, vendorId.hashCode, businessId.hashCode, orderType.hashCode, status.hashCode, date.hashCode, startDate.hashCode, endDate.hashCode, duration.hashCode, lunchBreak.hashCode, total.hashCode, assignedStaff.hashCode, shifts.hashCode, requested.hashCode, recurringDays.hashCode, permanentDays.hashCode, poReference.hashCode, detectedConflicts.hashCode, notes.hashCode, createdAt.hashCode, business.hashCode, vendor.hashCode, teamHub.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    if (eventName != null) {
      json['eventName'] = nativeToJson<String?>(eventName);
    }
    if (vendorId != null) {
      json['vendorId'] = nativeToJson<String?>(vendorId);
    }
    json['businessId'] = nativeToJson<String>(businessId);
    json['orderType'] = 
    orderTypeSerializer(orderType)
    ;
    json['status'] = 
    orderStatusSerializer(status)
    ;
    if (date != null) {
      json['date'] = date!.toJson();
    }
    if (startDate != null) {
      json['startDate'] = startDate!.toJson();
    }
    if (endDate != null) {
      json['endDate'] = endDate!.toJson();
    }
    if (duration != null) {
      json['duration'] = 
    orderDurationSerializer(duration!)
    ;
    }
    if (lunchBreak != null) {
      json['lunchBreak'] = nativeToJson<int?>(lunchBreak);
    }
    if (total != null) {
      json['total'] = nativeToJson<double?>(total);
    }
    if (assignedStaff != null) {
      json['assignedStaff'] = assignedStaff!.toJson();
    }
    if (shifts != null) {
      json['shifts'] = shifts!.toJson();
    }
    if (requested != null) {
      json['requested'] = nativeToJson<int?>(requested);
    }
    if (recurringDays != null) {
      json['recurringDays'] = recurringDays!.toJson();
    }
    if (permanentDays != null) {
      json['permanentDays'] = permanentDays!.toJson();
    }
    if (poReference != null) {
      json['poReference'] = nativeToJson<String?>(poReference);
    }
    if (detectedConflicts != null) {
      json['detectedConflicts'] = detectedConflicts!.toJson();
    }
    if (notes != null) {
      json['notes'] = nativeToJson<String?>(notes);
    }
    if (createdAt != null) {
      json['createdAt'] = createdAt!.toJson();
    }
    json['business'] = business.toJson();
    if (vendor != null) {
      json['vendor'] = vendor!.toJson();
    }
    json['teamHub'] = teamHub.toJson();
    return json;
  }

  GetOrdersByStatusOrders({
    required this.id,
    this.eventName,
    this.vendorId,
    required this.businessId,
    required this.orderType,
    required this.status,
    this.date,
    this.startDate,
    this.endDate,
    this.duration,
    this.lunchBreak,
    this.total,
    this.assignedStaff,
    this.shifts,
    this.requested,
    this.recurringDays,
    this.permanentDays,
    this.poReference,
    this.detectedConflicts,
    this.notes,
    this.createdAt,
    required this.business,
    this.vendor,
    required this.teamHub,
  });
}

@immutable
class GetOrdersByStatusOrdersBusiness {
  final String id;
  final String businessName;
  final String? email;
  final String? contactName;
  GetOrdersByStatusOrdersBusiness.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 GetOrdersByStatusOrdersBusiness otherTyped = other as GetOrdersByStatusOrdersBusiness;
    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;
  }

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

@immutable
class GetOrdersByStatusOrdersVendor {
  final String id;
  final String companyName;
  GetOrdersByStatusOrdersVendor.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 GetOrdersByStatusOrdersVendor otherTyped = other as GetOrdersByStatusOrdersVendor;
    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;
  }

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

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

    final GetOrdersByStatusOrdersTeamHub otherTyped = other as GetOrdersByStatusOrdersTeamHub;
    return address == otherTyped.address && 
    placeId == otherTyped.placeId && 
    hubName == otherTyped.hubName;
    
  }
  @override
  int get hashCode => Object.hashAll([address.hashCode, placeId.hashCode, hubName.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['address'] = nativeToJson<String>(address);
    if (placeId != null) {
      json['placeId'] = nativeToJson<String?>(placeId);
    }
    json['hubName'] = nativeToJson<String>(hubName);
    return json;
  }

  GetOrdersByStatusOrdersTeamHub({
    required this.address,
    this.placeId,
    required this.hubName,
  });
}

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

    final GetOrdersByStatusData otherTyped = other as GetOrdersByStatusData;
    return orders == otherTyped.orders;
    
  }
  @override
  int get hashCode => orders.hashCode;
  

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

  GetOrdersByStatusData({
    required this.orders,
  });
}

@immutable
class GetOrdersByStatusVariables {
  final OrderStatus status;
  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.')
  GetOrdersByStatusVariables.fromJson(Map<String, dynamic> json):
  
  status = OrderStatus.values.byName(json['status']) {
  
  
  
    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 GetOrdersByStatusVariables otherTyped = other as GetOrdersByStatusVariables;
    return status == otherTyped.status && 
    offset == otherTyped.offset && 
    limit == otherTyped.limit;
    
  }
  @override
  int get hashCode => Object.hashAll([status.hashCode, offset.hashCode, limit.hashCode]);
  

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

  GetOrdersByStatusVariables({
    required this.status,
    required this.offset,
    required this.limit,
  });
}

