part of 'generated.dart';

class ListInvoicesForSpendByOrderVariablesBuilder {
  String orderId;
  Timestamp startDate;
  Timestamp endDate;

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

  QueryRef<ListInvoicesForSpendByOrderData, ListInvoicesForSpendByOrderVariables> ref() {
    ListInvoicesForSpendByOrderVariables vars= ListInvoicesForSpendByOrderVariables(orderId: orderId,startDate: startDate,endDate: endDate,);
    return _dataConnect.query("listInvoicesForSpendByOrder", dataDeserializer, varsSerializer, vars);
  }
}

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

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

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

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

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

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

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

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

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

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

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

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

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

  ListInvoicesForSpendByOrderVariables({
    required this.orderId,
    required this.startDate,
    required this.endDate,
  });
}

