part of 'generated.dart';

class GetOrderByIdVariablesBuilder {
  String id;

  final FirebaseDataConnect _dataConnect;
  GetOrderByIdVariablesBuilder(this._dataConnect, {required  this.id,});
  Deserializer<GetOrderByIdData> dataDeserializer = (dynamic json)  => GetOrderByIdData.fromJson(jsonDecode(json));
  Serializer<GetOrderByIdVariables> varsSerializer = (GetOrderByIdVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<GetOrderByIdData, GetOrderByIdVariables>> execute() {
    return ref().execute();
  }

  QueryRef<GetOrderByIdData, GetOrderByIdVariables> ref() {
    GetOrderByIdVariables vars= GetOrderByIdVariables(id: id,);
    return _dataConnect.query("getOrderById", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class GetOrderByIdOrder {
  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 GetOrderByIdOrderBusiness business;
  final GetOrderByIdOrderVendor? vendor;
  GetOrderByIdOrder.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 = GetOrderByIdOrderBusiness.fromJson(json['business']),
  vendor = json['vendor'] == null ? null : GetOrderByIdOrderVendor.fromJson(json['vendor']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

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

  GetOrderByIdOrder({
    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 GetOrderByIdOrderBusiness {
  final String id;
  final String businessName;
  final String? email;
  final String? contactName;
  GetOrderByIdOrderBusiness.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 GetOrderByIdOrderBusiness otherTyped = other as GetOrderByIdOrderBusiness;
    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;
  }

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

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

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

@immutable
class GetOrderByIdData {
  final GetOrderByIdOrder? order;
  GetOrderByIdData.fromJson(dynamic json):
  
  order = json['order'] == null ? null : GetOrderByIdOrder.fromJson(json['order']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final GetOrderByIdData otherTyped = other as GetOrderByIdData;
    return order == otherTyped.order;
    
  }
  @override
  int get hashCode => order.hashCode;
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    if (order != null) {
      json['order'] = order!.toJson();
    }
    return json;
  }

  GetOrderByIdData({
    this.order,
  });
}

@immutable
class GetOrderByIdVariables {
  final String id;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  GetOrderByIdVariables.fromJson(Map<String, dynamic> json):
  
  id = nativeFromJson<String>(json['id']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final GetOrderByIdVariables otherTyped = other as GetOrderByIdVariables;
    return id == otherTyped.id;
    
  }
  @override
  int get hashCode => id.hashCode;
  

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

  GetOrderByIdVariables({
    required this.id,
  });
}

