part of 'generated.dart';

class GetOrdersByDateRangeVariablesBuilder {
  Timestamp start;
  Timestamp end;
  Optional<int> _offset = Optional.optional(nativeFromJson, nativeToJson);
  Optional<int> _limit = Optional.optional(nativeFromJson, nativeToJson);

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

  GetOrdersByDateRangeVariablesBuilder(this._dataConnect, {required  this.start,required  this.end,});
  Deserializer<GetOrdersByDateRangeData> dataDeserializer = (dynamic json)  => GetOrdersByDateRangeData.fromJson(jsonDecode(json));
  Serializer<GetOrdersByDateRangeVariables> varsSerializer = (GetOrdersByDateRangeVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<GetOrdersByDateRangeData, GetOrdersByDateRangeVariables>> execute() {
    return ref().execute();
  }

  QueryRef<GetOrdersByDateRangeData, GetOrdersByDateRangeVariables> ref() {
    GetOrdersByDateRangeVariables vars= GetOrdersByDateRangeVariables(start: start,end: end,offset: _offset,limit: _limit,);
    return _dataConnect.query("getOrdersByDateRange", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class GetOrdersByDateRangeOrders {
  final String id;
  final String? eventName;
  final String? vendorId;
  final String businessId;
  final EnumValue<OrderType> orderType;
  final String? location;
  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 String? hub;
  final AnyValue? recurringDays;
  final AnyValue? permanentDays;
  final String? poReference;
  final AnyValue? detectedConflicts;
  final String? notes;
  final Timestamp? createdAt;
  final GetOrdersByDateRangeOrdersBusiness business;
  final GetOrdersByDateRangeOrdersVendor? vendor;
  GetOrdersByDateRangeOrders.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']),
  location = json['location'] == null ? null : nativeFromJson<String>(json['location']),
  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']),
  hub = json['hub'] == null ? null : nativeFromJson<String>(json['hub']),
  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 = GetOrdersByDateRangeOrdersBusiness.fromJson(json['business']),
  vendor = json['vendor'] == null ? null : GetOrdersByDateRangeOrdersVendor.fromJson(json['vendor']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final GetOrdersByDateRangeOrders otherTyped = other as GetOrdersByDateRangeOrders;
    return id == otherTyped.id && 
    eventName == otherTyped.eventName && 
    vendorId == otherTyped.vendorId && 
    businessId == otherTyped.businessId && 
    orderType == otherTyped.orderType && 
    location == otherTyped.location && 
    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 && 
    hub == otherTyped.hub && 
    recurringDays == otherTyped.recurringDays && 
    permanentDays == otherTyped.permanentDays && 
    poReference == otherTyped.poReference && 
    detectedConflicts == otherTyped.detectedConflicts && 
    notes == otherTyped.notes && 
    createdAt == otherTyped.createdAt && 
    business == otherTyped.business && 
    vendor == otherTyped.vendor;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, eventName.hashCode, vendorId.hashCode, businessId.hashCode, orderType.hashCode, location.hashCode, status.hashCode, date.hashCode, startDate.hashCode, endDate.hashCode, duration.hashCode, lunchBreak.hashCode, total.hashCode, assignedStaff.hashCode, shifts.hashCode, requested.hashCode, hub.hashCode, recurringDays.hashCode, permanentDays.hashCode, poReference.hashCode, detectedConflicts.hashCode, notes.hashCode, createdAt.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);
    }
    if (vendorId != null) {
      json['vendorId'] = nativeToJson<String?>(vendorId);
    }
    json['businessId'] = nativeToJson<String>(businessId);
    json['orderType'] = 
    orderTypeSerializer(orderType)
    ;
    if (location != null) {
      json['location'] = nativeToJson<String?>(location);
    }
    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 (hub != null) {
      json['hub'] = nativeToJson<String?>(hub);
    }
    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();
    }
    return json;
  }

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

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

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

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

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

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

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

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

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

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

  GetOrdersByDateRangeVariables({
    required this.start,
    required this.end,
    required this.offset,
    required this.limit,
  });
}

