part of 'generated.dart';

class ListInvoicesForSpendByBusinessVariablesBuilder {
  String businessId;
  Timestamp startDate;
  Timestamp endDate;

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

  QueryRef<ListInvoicesForSpendByBusinessData, ListInvoicesForSpendByBusinessVariables> ref() {
    ListInvoicesForSpendByBusinessVariables vars= ListInvoicesForSpendByBusinessVariables(businessId: businessId,startDate: startDate,endDate: endDate,);
    return _dataConnect.query("listInvoicesForSpendByBusiness", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class ListInvoicesForSpendByBusinessInvoices {
  final String id;
  final Timestamp issueDate;
  final Timestamp dueDate;
  final double amount;
  final EnumValue<InvoiceStatus> status;
  final String invoiceNumber;
  final ListInvoicesForSpendByBusinessInvoicesVendor vendor;
  final ListInvoicesForSpendByBusinessInvoicesBusiness business;
  final ListInvoicesForSpendByBusinessInvoicesOrder order;
  ListInvoicesForSpendByBusinessInvoices.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 = ListInvoicesForSpendByBusinessInvoicesVendor.fromJson(json['vendor']),
  business = ListInvoicesForSpendByBusinessInvoicesBusiness.fromJson(json['business']),
  order = ListInvoicesForSpendByBusinessInvoicesOrder.fromJson(json['order']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

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

  ListInvoicesForSpendByBusinessInvoices({
    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 ListInvoicesForSpendByBusinessInvoicesVendor {
  final String id;
  final String companyName;
  ListInvoicesForSpendByBusinessInvoicesVendor.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 ListInvoicesForSpendByBusinessInvoicesVendor otherTyped = other as ListInvoicesForSpendByBusinessInvoicesVendor;
    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;
  }

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

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

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

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

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

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

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

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

@immutable
class ListInvoicesForSpendByBusinessVariables {
  final String businessId;
  final Timestamp startDate;
  final Timestamp endDate;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  ListInvoicesForSpendByBusinessVariables.fromJson(Map<String, dynamic> json):
  
  businessId = nativeFromJson<String>(json['businessId']),
  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 ListInvoicesForSpendByBusinessVariables otherTyped = other as ListInvoicesForSpendByBusinessVariables;
    return businessId == otherTyped.businessId && 
    startDate == otherTyped.startDate && 
    endDate == otherTyped.endDate;
    
  }
  @override
  int get hashCode => Object.hashAll([businessId.hashCode, startDate.hashCode, endDate.hashCode]);
  

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

  ListInvoicesForSpendByBusinessVariables({
    required this.businessId,
    required this.startDate,
    required this.endDate,
  });
}

