part of 'generated.dart';

class ListInvoicesForSpendByVendorVariablesBuilder {
  String vendorId;
  Timestamp startDate;
  Timestamp endDate;

  final FirebaseDataConnect _dataConnect;
  ListInvoicesForSpendByVendorVariablesBuilder(this._dataConnect, {required  this.vendorId,required  this.startDate,required  this.endDate,});
  Deserializer<ListInvoicesForSpendByVendorData> dataDeserializer = (dynamic json)  => ListInvoicesForSpendByVendorData.fromJson(jsonDecode(json));
  Serializer<ListInvoicesForSpendByVendorVariables> varsSerializer = (ListInvoicesForSpendByVendorVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<ListInvoicesForSpendByVendorData, ListInvoicesForSpendByVendorVariables>> execute() {
    return ref().execute();
  }

  QueryRef<ListInvoicesForSpendByVendorData, ListInvoicesForSpendByVendorVariables> ref() {
    ListInvoicesForSpendByVendorVariables vars= ListInvoicesForSpendByVendorVariables(vendorId: vendorId,startDate: startDate,endDate: endDate,);
    return _dataConnect.query("listInvoicesForSpendByVendor", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class ListInvoicesForSpendByVendorInvoices {
  final String id;
  final Timestamp issueDate;
  final Timestamp dueDate;
  final double amount;
  final EnumValue<InvoiceStatus> status;
  final String invoiceNumber;
  final ListInvoicesForSpendByVendorInvoicesVendor vendor;
  final ListInvoicesForSpendByVendorInvoicesBusiness business;
  final ListInvoicesForSpendByVendorInvoicesOrder order;
  ListInvoicesForSpendByVendorInvoices.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  issueDate = Timestamp.fromJson(json['issueDate']),
  dueDate = Timestamp.fromJson(json['dueDate']),
  amount = nativeFromJson<double>(json['amount']),
  status = invoiceStatusDeserializer(json['status']),
  invoiceNumber = nativeFromJson<String>(json['invoiceNumber']),
  vendor = ListInvoicesForSpendByVendorInvoicesVendor.fromJson(json['vendor']),
  business = ListInvoicesForSpendByVendorInvoicesBusiness.fromJson(json['business']),
  order = ListInvoicesForSpendByVendorInvoicesOrder.fromJson(json['order']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListInvoicesForSpendByVendorInvoices otherTyped = other as ListInvoicesForSpendByVendorInvoices;
    return id == otherTyped.id && 
    issueDate == otherTyped.issueDate && 
    dueDate == otherTyped.dueDate && 
    amount == otherTyped.amount && 
    status == otherTyped.status && 
    invoiceNumber == otherTyped.invoiceNumber && 
    vendor == otherTyped.vendor && 
    business == otherTyped.business && 
    order == otherTyped.order;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, issueDate.hashCode, dueDate.hashCode, amount.hashCode, status.hashCode, invoiceNumber.hashCode, vendor.hashCode, business.hashCode, order.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    json['issueDate'] = issueDate.toJson();
    json['dueDate'] = dueDate.toJson();
    json['amount'] = nativeToJson<double>(amount);
    json['status'] = 
    invoiceStatusSerializer(status)
    ;
    json['invoiceNumber'] = nativeToJson<String>(invoiceNumber);
    json['vendor'] = vendor.toJson();
    json['business'] = business.toJson();
    json['order'] = order.toJson();
    return json;
  }

  ListInvoicesForSpendByVendorInvoices({
    required this.id,
    required this.issueDate,
    required this.dueDate,
    required this.amount,
    required this.status,
    required this.invoiceNumber,
    required this.vendor,
    required this.business,
    required this.order,
  });
}

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

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

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

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

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

  ListInvoicesForSpendByVendorInvoicesBusiness({
    required this.id,
    required this.businessName,
  });
}

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

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

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

  ListInvoicesForSpendByVendorInvoicesOrder({
    required this.id,
    this.eventName,
  });
}

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

    final ListInvoicesForSpendByVendorData otherTyped = other as ListInvoicesForSpendByVendorData;
    return invoices == otherTyped.invoices;
    
  }
  @override
  int get hashCode => invoices.hashCode;
  

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

  ListInvoicesForSpendByVendorData({
    required this.invoices,
  });
}

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

    final ListInvoicesForSpendByVendorVariables otherTyped = other as ListInvoicesForSpendByVendorVariables;
    return vendorId == otherTyped.vendorId && 
    startDate == otherTyped.startDate && 
    endDate == otherTyped.endDate;
    
  }
  @override
  int get hashCode => Object.hashAll([vendorId.hashCode, startDate.hashCode, endDate.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['vendorId'] = nativeToJson<String>(vendorId);
    json['startDate'] = startDate.toJson();
    json['endDate'] = endDate.toJson();
    return json;
  }

  ListInvoicesForSpendByVendorVariables({
    required this.vendorId,
    required this.startDate,
    required this.endDate,
  });
}

