part of 'generated.dart';

class ListRecentPaymentsByInvoiceIdsVariablesBuilder {
  List<String> invoiceIds;
  Optional<int> _offset = Optional.optional(nativeFromJson, nativeToJson);
  Optional<int> _limit = Optional.optional(nativeFromJson, nativeToJson);

  final FirebaseDataConnect _dataConnect;  ListRecentPaymentsByInvoiceIdsVariablesBuilder offset(int? t) {
   _offset.value = t;
   return this;
  }
  ListRecentPaymentsByInvoiceIdsVariablesBuilder limit(int? t) {
   _limit.value = t;
   return this;
  }

  ListRecentPaymentsByInvoiceIdsVariablesBuilder(this._dataConnect, {required  this.invoiceIds,});
  Deserializer<ListRecentPaymentsByInvoiceIdsData> dataDeserializer = (dynamic json)  => ListRecentPaymentsByInvoiceIdsData.fromJson(jsonDecode(json));
  Serializer<ListRecentPaymentsByInvoiceIdsVariables> varsSerializer = (ListRecentPaymentsByInvoiceIdsVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<ListRecentPaymentsByInvoiceIdsData, ListRecentPaymentsByInvoiceIdsVariables>> execute() {
    return ref().execute();
  }

  QueryRef<ListRecentPaymentsByInvoiceIdsData, ListRecentPaymentsByInvoiceIdsVariables> ref() {
    ListRecentPaymentsByInvoiceIdsVariables vars= ListRecentPaymentsByInvoiceIdsVariables(invoiceIds: invoiceIds,offset: _offset,limit: _limit,);
    return _dataConnect.query("listRecentPaymentsByInvoiceIds", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class ListRecentPaymentsByInvoiceIdsRecentPayments {
  final String id;
  final String? workedTime;
  final EnumValue<RecentPaymentStatus>? status;
  final String staffId;
  final String applicationId;
  final String invoiceId;
  final Timestamp? createdAt;
  final Timestamp? updatedAt;
  final String? createdBy;
  final ListRecentPaymentsByInvoiceIdsRecentPaymentsApplication application;
  final ListRecentPaymentsByInvoiceIdsRecentPaymentsInvoice invoice;
  ListRecentPaymentsByInvoiceIdsRecentPayments.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  workedTime = json['workedTime'] == null ? null : nativeFromJson<String>(json['workedTime']),
  status = json['status'] == null ? null : recentPaymentStatusDeserializer(json['status']),
  staffId = nativeFromJson<String>(json['staffId']),
  applicationId = nativeFromJson<String>(json['applicationId']),
  invoiceId = nativeFromJson<String>(json['invoiceId']),
  createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']),
  updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']),
  createdBy = json['createdBy'] == null ? null : nativeFromJson<String>(json['createdBy']),
  application = ListRecentPaymentsByInvoiceIdsRecentPaymentsApplication.fromJson(json['application']),
  invoice = ListRecentPaymentsByInvoiceIdsRecentPaymentsInvoice.fromJson(json['invoice']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListRecentPaymentsByInvoiceIdsRecentPayments otherTyped = other as ListRecentPaymentsByInvoiceIdsRecentPayments;
    return id == otherTyped.id && 
    workedTime == otherTyped.workedTime && 
    status == otherTyped.status && 
    staffId == otherTyped.staffId && 
    applicationId == otherTyped.applicationId && 
    invoiceId == otherTyped.invoiceId && 
    createdAt == otherTyped.createdAt && 
    updatedAt == otherTyped.updatedAt && 
    createdBy == otherTyped.createdBy && 
    application == otherTyped.application && 
    invoice == otherTyped.invoice;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, workedTime.hashCode, status.hashCode, staffId.hashCode, applicationId.hashCode, invoiceId.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, application.hashCode, invoice.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    if (workedTime != null) {
      json['workedTime'] = nativeToJson<String?>(workedTime);
    }
    if (status != null) {
      json['status'] = 
    recentPaymentStatusSerializer(status!)
    ;
    }
    json['staffId'] = nativeToJson<String>(staffId);
    json['applicationId'] = nativeToJson<String>(applicationId);
    json['invoiceId'] = nativeToJson<String>(invoiceId);
    if (createdAt != null) {
      json['createdAt'] = createdAt!.toJson();
    }
    if (updatedAt != null) {
      json['updatedAt'] = updatedAt!.toJson();
    }
    if (createdBy != null) {
      json['createdBy'] = nativeToJson<String?>(createdBy);
    }
    json['application'] = application.toJson();
    json['invoice'] = invoice.toJson();
    return json;
  }

  ListRecentPaymentsByInvoiceIdsRecentPayments({
    required this.id,
    this.workedTime,
    this.status,
    required this.staffId,
    required this.applicationId,
    required this.invoiceId,
    this.createdAt,
    this.updatedAt,
    this.createdBy,
    required this.application,
    required this.invoice,
  });
}

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

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

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

  ListRecentPaymentsByInvoiceIdsRecentPaymentsApplication({
    required this.id,
    required this.shiftRole,
  });
}

@immutable
class ListRecentPaymentsByInvoiceIdsRecentPaymentsApplicationShiftRole {
  final double? hours;
  final double? totalValue;
  final ListRecentPaymentsByInvoiceIdsRecentPaymentsApplicationShiftRoleRole role;
  final ListRecentPaymentsByInvoiceIdsRecentPaymentsApplicationShiftRoleShift shift;
  ListRecentPaymentsByInvoiceIdsRecentPaymentsApplicationShiftRole.fromJson(dynamic json):
  
  hours = json['hours'] == null ? null : nativeFromJson<double>(json['hours']),
  totalValue = json['totalValue'] == null ? null : nativeFromJson<double>(json['totalValue']),
  role = ListRecentPaymentsByInvoiceIdsRecentPaymentsApplicationShiftRoleRole.fromJson(json['role']),
  shift = ListRecentPaymentsByInvoiceIdsRecentPaymentsApplicationShiftRoleShift.fromJson(json['shift']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListRecentPaymentsByInvoiceIdsRecentPaymentsApplicationShiftRole otherTyped = other as ListRecentPaymentsByInvoiceIdsRecentPaymentsApplicationShiftRole;
    return hours == otherTyped.hours && 
    totalValue == otherTyped.totalValue && 
    role == otherTyped.role && 
    shift == otherTyped.shift;
    
  }
  @override
  int get hashCode => Object.hashAll([hours.hashCode, totalValue.hashCode, role.hashCode, shift.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    if (hours != null) {
      json['hours'] = nativeToJson<double?>(hours);
    }
    if (totalValue != null) {
      json['totalValue'] = nativeToJson<double?>(totalValue);
    }
    json['role'] = role.toJson();
    json['shift'] = shift.toJson();
    return json;
  }

  ListRecentPaymentsByInvoiceIdsRecentPaymentsApplicationShiftRole({
    this.hours,
    this.totalValue,
    required this.role,
    required this.shift,
  });
}

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

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

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

  ListRecentPaymentsByInvoiceIdsRecentPaymentsApplicationShiftRoleRole({
    required this.id,
    required this.name,
    required this.costPerHour,
  });
}

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

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

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

  ListRecentPaymentsByInvoiceIdsRecentPaymentsApplicationShiftRoleShift({
    required this.id,
    required this.title,
    this.date,
    this.locationAddress,
  });
}

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

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

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

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

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

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

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

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

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

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

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

  ListRecentPaymentsByInvoiceIdsRecentPaymentsInvoiceOrder({
    required this.id,
    this.eventName,
    this.location,
  });
}

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

    final ListRecentPaymentsByInvoiceIdsData otherTyped = other as ListRecentPaymentsByInvoiceIdsData;
    return recentPayments == otherTyped.recentPayments;
    
  }
  @override
  int get hashCode => recentPayments.hashCode;
  

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

  ListRecentPaymentsByInvoiceIdsData({
    required this.recentPayments,
  });
}

@immutable
class ListRecentPaymentsByInvoiceIdsVariables {
  final List<String> invoiceIds;
  late final Optional<int>offset;
  late final Optional<int>limit;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  ListRecentPaymentsByInvoiceIdsVariables.fromJson(Map<String, dynamic> json):
  
  invoiceIds = (json['invoiceIds'] as List<dynamic>)
        .map((e) => nativeFromJson<String>(e))
        .toList() {
  
  
  
    offset = Optional.optional(nativeFromJson, nativeToJson);
    offset.value = json['offset'] == null ? null : nativeFromJson<int>(json['offset']);
  
  
    limit = Optional.optional(nativeFromJson, nativeToJson);
    limit.value = json['limit'] == null ? null : nativeFromJson<int>(json['limit']);
  
  }
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListRecentPaymentsByInvoiceIdsVariables otherTyped = other as ListRecentPaymentsByInvoiceIdsVariables;
    return invoiceIds == otherTyped.invoiceIds && 
    offset == otherTyped.offset && 
    limit == otherTyped.limit;
    
  }
  @override
  int get hashCode => Object.hashAll([invoiceIds.hashCode, offset.hashCode, limit.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['invoiceIds'] = invoiceIds.map((e) => nativeToJson<String>(e)).toList();
    if(offset.state == OptionalState.set) {
      json['offset'] = offset.toJson();
    }
    if(limit.state == OptionalState.set) {
      json['limit'] = limit.toJson();
    }
    return json;
  }

  ListRecentPaymentsByInvoiceIdsVariables({
    required this.invoiceIds,
    required this.offset,
    required this.limit,
  });
}

