part of 'generated.dart';

class GetInvoiceByIdVariablesBuilder {
  String id;

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

  QueryRef<GetInvoiceByIdData, GetInvoiceByIdVariables> ref() {
    GetInvoiceByIdVariables vars= GetInvoiceByIdVariables(id: id,);
    return _dataConnect.query("getInvoiceById", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class GetInvoiceByIdInvoice {
  final String id;
  final EnumValue<InvoiceStatus> status;
  final String vendorId;
  final String businessId;
  final String orderId;
  final EnumValue<InovicePaymentTerms>? paymentTerms;
  final String invoiceNumber;
  final Timestamp issueDate;
  final Timestamp dueDate;
  final String? hub;
  final String? managerName;
  final String? vendorNumber;
  final AnyValue? roles;
  final AnyValue? charges;
  final double? otherCharges;
  final double? subtotal;
  final double amount;
  final String? notes;
  final int? staffCount;
  final int? chargesCount;
  final AnyValue? disputedItems;
  final String? disputeReason;
  final String? disputeDetails;
  final GetInvoiceByIdInvoiceVendor vendor;
  final GetInvoiceByIdInvoiceBusiness business;
  final GetInvoiceByIdInvoiceOrder order;
  GetInvoiceByIdInvoice.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  status = invoiceStatusDeserializer(json['status']),
  vendorId = nativeFromJson<String>(json['vendorId']),
  businessId = nativeFromJson<String>(json['businessId']),
  orderId = nativeFromJson<String>(json['orderId']),
  paymentTerms = json['paymentTerms'] == null ? null : inovicePaymentTermsDeserializer(json['paymentTerms']),
  invoiceNumber = nativeFromJson<String>(json['invoiceNumber']),
  issueDate = Timestamp.fromJson(json['issueDate']),
  dueDate = Timestamp.fromJson(json['dueDate']),
  hub = json['hub'] == null ? null : nativeFromJson<String>(json['hub']),
  managerName = json['managerName'] == null ? null : nativeFromJson<String>(json['managerName']),
  vendorNumber = json['vendorNumber'] == null ? null : nativeFromJson<String>(json['vendorNumber']),
  roles = json['roles'] == null ? null : AnyValue.fromJson(json['roles']),
  charges = json['charges'] == null ? null : AnyValue.fromJson(json['charges']),
  otherCharges = json['otherCharges'] == null ? null : nativeFromJson<double>(json['otherCharges']),
  subtotal = json['subtotal'] == null ? null : nativeFromJson<double>(json['subtotal']),
  amount = nativeFromJson<double>(json['amount']),
  notes = json['notes'] == null ? null : nativeFromJson<String>(json['notes']),
  staffCount = json['staffCount'] == null ? null : nativeFromJson<int>(json['staffCount']),
  chargesCount = json['chargesCount'] == null ? null : nativeFromJson<int>(json['chargesCount']),
  disputedItems = json['disputedItems'] == null ? null : AnyValue.fromJson(json['disputedItems']),
  disputeReason = json['disputeReason'] == null ? null : nativeFromJson<String>(json['disputeReason']),
  disputeDetails = json['disputeDetails'] == null ? null : nativeFromJson<String>(json['disputeDetails']),
  vendor = GetInvoiceByIdInvoiceVendor.fromJson(json['vendor']),
  business = GetInvoiceByIdInvoiceBusiness.fromJson(json['business']),
  order = GetInvoiceByIdInvoiceOrder.fromJson(json['order']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final GetInvoiceByIdInvoice otherTyped = other as GetInvoiceByIdInvoice;
    return id == otherTyped.id && 
    status == otherTyped.status && 
    vendorId == otherTyped.vendorId && 
    businessId == otherTyped.businessId && 
    orderId == otherTyped.orderId && 
    paymentTerms == otherTyped.paymentTerms && 
    invoiceNumber == otherTyped.invoiceNumber && 
    issueDate == otherTyped.issueDate && 
    dueDate == otherTyped.dueDate && 
    hub == otherTyped.hub && 
    managerName == otherTyped.managerName && 
    vendorNumber == otherTyped.vendorNumber && 
    roles == otherTyped.roles && 
    charges == otherTyped.charges && 
    otherCharges == otherTyped.otherCharges && 
    subtotal == otherTyped.subtotal && 
    amount == otherTyped.amount && 
    notes == otherTyped.notes && 
    staffCount == otherTyped.staffCount && 
    chargesCount == otherTyped.chargesCount && 
    disputedItems == otherTyped.disputedItems && 
    disputeReason == otherTyped.disputeReason && 
    disputeDetails == otherTyped.disputeDetails && 
    vendor == otherTyped.vendor && 
    business == otherTyped.business && 
    order == otherTyped.order;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, status.hashCode, vendorId.hashCode, businessId.hashCode, orderId.hashCode, paymentTerms.hashCode, invoiceNumber.hashCode, issueDate.hashCode, dueDate.hashCode, hub.hashCode, managerName.hashCode, vendorNumber.hashCode, roles.hashCode, charges.hashCode, otherCharges.hashCode, subtotal.hashCode, amount.hashCode, notes.hashCode, staffCount.hashCode, chargesCount.hashCode, disputedItems.hashCode, disputeReason.hashCode, disputeDetails.hashCode, vendor.hashCode, business.hashCode, order.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    json['status'] = 
    invoiceStatusSerializer(status)
    ;
    json['vendorId'] = nativeToJson<String>(vendorId);
    json['businessId'] = nativeToJson<String>(businessId);
    json['orderId'] = nativeToJson<String>(orderId);
    if (paymentTerms != null) {
      json['paymentTerms'] = 
    inovicePaymentTermsSerializer(paymentTerms!)
    ;
    }
    json['invoiceNumber'] = nativeToJson<String>(invoiceNumber);
    json['issueDate'] = issueDate.toJson();
    json['dueDate'] = dueDate.toJson();
    if (hub != null) {
      json['hub'] = nativeToJson<String?>(hub);
    }
    if (managerName != null) {
      json['managerName'] = nativeToJson<String?>(managerName);
    }
    if (vendorNumber != null) {
      json['vendorNumber'] = nativeToJson<String?>(vendorNumber);
    }
    if (roles != null) {
      json['roles'] = roles!.toJson();
    }
    if (charges != null) {
      json['charges'] = charges!.toJson();
    }
    if (otherCharges != null) {
      json['otherCharges'] = nativeToJson<double?>(otherCharges);
    }
    if (subtotal != null) {
      json['subtotal'] = nativeToJson<double?>(subtotal);
    }
    json['amount'] = nativeToJson<double>(amount);
    if (notes != null) {
      json['notes'] = nativeToJson<String?>(notes);
    }
    if (staffCount != null) {
      json['staffCount'] = nativeToJson<int?>(staffCount);
    }
    if (chargesCount != null) {
      json['chargesCount'] = nativeToJson<int?>(chargesCount);
    }
    if (disputedItems != null) {
      json['disputedItems'] = disputedItems!.toJson();
    }
    if (disputeReason != null) {
      json['disputeReason'] = nativeToJson<String?>(disputeReason);
    }
    if (disputeDetails != null) {
      json['disputeDetails'] = nativeToJson<String?>(disputeDetails);
    }
    json['vendor'] = vendor.toJson();
    json['business'] = business.toJson();
    json['order'] = order.toJson();
    return json;
  }

  GetInvoiceByIdInvoice({
    required this.id,
    required this.status,
    required this.vendorId,
    required this.businessId,
    required this.orderId,
    this.paymentTerms,
    required this.invoiceNumber,
    required this.issueDate,
    required this.dueDate,
    this.hub,
    this.managerName,
    this.vendorNumber,
    this.roles,
    this.charges,
    this.otherCharges,
    this.subtotal,
    required this.amount,
    this.notes,
    this.staffCount,
    this.chargesCount,
    this.disputedItems,
    this.disputeReason,
    this.disputeDetails,
    required this.vendor,
    required this.business,
    required this.order,
  });
}

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

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

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

  GetInvoiceByIdInvoiceVendor({
    required this.companyName,
    this.address,
    this.email,
    this.phone,
  });
}

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

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

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

  GetInvoiceByIdInvoiceBusiness({
    required this.businessName,
    this.address,
    this.phone,
    this.email,
  });
}

@immutable
class GetInvoiceByIdInvoiceOrder {
  final String? eventName;
  final String? deparment;
  final String? poReference;
  final GetInvoiceByIdInvoiceOrderTeamHub teamHub;
  GetInvoiceByIdInvoiceOrder.fromJson(dynamic json):
  
  eventName = json['eventName'] == null ? null : nativeFromJson<String>(json['eventName']),
  deparment = json['deparment'] == null ? null : nativeFromJson<String>(json['deparment']),
  poReference = json['poReference'] == null ? null : nativeFromJson<String>(json['poReference']),
  teamHub = GetInvoiceByIdInvoiceOrderTeamHub.fromJson(json['teamHub']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final GetInvoiceByIdInvoiceOrder otherTyped = other as GetInvoiceByIdInvoiceOrder;
    return eventName == otherTyped.eventName && 
    deparment == otherTyped.deparment && 
    poReference == otherTyped.poReference && 
    teamHub == otherTyped.teamHub;
    
  }
  @override
  int get hashCode => Object.hashAll([eventName.hashCode, deparment.hashCode, poReference.hashCode, teamHub.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    if (eventName != null) {
      json['eventName'] = nativeToJson<String?>(eventName);
    }
    if (deparment != null) {
      json['deparment'] = nativeToJson<String?>(deparment);
    }
    if (poReference != null) {
      json['poReference'] = nativeToJson<String?>(poReference);
    }
    json['teamHub'] = teamHub.toJson();
    return json;
  }

  GetInvoiceByIdInvoiceOrder({
    this.eventName,
    this.deparment,
    this.poReference,
    required this.teamHub,
  });
}

@immutable
class GetInvoiceByIdInvoiceOrderTeamHub {
  final String address;
  final String? placeId;
  final String hubName;
  GetInvoiceByIdInvoiceOrderTeamHub.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 GetInvoiceByIdInvoiceOrderTeamHub otherTyped = other as GetInvoiceByIdInvoiceOrderTeamHub;
    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;
  }

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

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

    final GetInvoiceByIdData otherTyped = other as GetInvoiceByIdData;
    return invoice == otherTyped.invoice;
    
  }
  @override
  int get hashCode => invoice.hashCode;
  

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

  GetInvoiceByIdData({
    this.invoice,
  });
}

@immutable
class GetInvoiceByIdVariables {
  final String id;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  GetInvoiceByIdVariables.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 GetInvoiceByIdVariables otherTyped = other as GetInvoiceByIdVariables;
    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;
  }

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

