part of 'generated.dart';

class ListRecentPaymentsVariablesBuilder {
  Optional<int> _offset = Optional.optional(nativeFromJson, nativeToJson);
  Optional<int> _limit = Optional.optional(nativeFromJson, nativeToJson);

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

  ListRecentPaymentsVariablesBuilder(this._dataConnect, );
  Deserializer<ListRecentPaymentsData> dataDeserializer = (dynamic json)  => ListRecentPaymentsData.fromJson(jsonDecode(json));
  Serializer<ListRecentPaymentsVariables> varsSerializer = (ListRecentPaymentsVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<ListRecentPaymentsData, ListRecentPaymentsVariables>> execute() {
    return ref().execute();
  }

  QueryRef<ListRecentPaymentsData, ListRecentPaymentsVariables> ref() {
    ListRecentPaymentsVariables vars= ListRecentPaymentsVariables(offset: _offset,limit: _limit,);
    return _dataConnect.query("listRecentPayments", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class ListRecentPaymentsRecentPayments {
  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 ListRecentPaymentsRecentPaymentsApplication application;
  final ListRecentPaymentsRecentPaymentsInvoice invoice;
  ListRecentPaymentsRecentPayments.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 = ListRecentPaymentsRecentPaymentsApplication.fromJson(json['application']),
  invoice = ListRecentPaymentsRecentPaymentsInvoice.fromJson(json['invoice']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

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

  ListRecentPaymentsRecentPayments({
    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 ListRecentPaymentsRecentPaymentsApplication {
  final Timestamp? checkInTime;
  final Timestamp? checkOutTime;
  final ListRecentPaymentsRecentPaymentsApplicationShiftRole shiftRole;
  ListRecentPaymentsRecentPaymentsApplication.fromJson(dynamic json):
  
  checkInTime = json['checkInTime'] == null ? null : Timestamp.fromJson(json['checkInTime']),
  checkOutTime = json['checkOutTime'] == null ? null : Timestamp.fromJson(json['checkOutTime']),
  shiftRole = ListRecentPaymentsRecentPaymentsApplicationShiftRole.fromJson(json['shiftRole']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

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

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

  ListRecentPaymentsRecentPaymentsApplication({
    this.checkInTime,
    this.checkOutTime,
    required this.shiftRole,
  });
}

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

    final ListRecentPaymentsRecentPaymentsApplicationShiftRole otherTyped = other as ListRecentPaymentsRecentPaymentsApplicationShiftRole;
    return hours == otherTyped.hours && 
    totalValue == otherTyped.totalValue && 
    startTime == otherTyped.startTime && 
    endTime == otherTyped.endTime && 
    role == otherTyped.role && 
    shift == otherTyped.shift;
    
  }
  @override
  int get hashCode => Object.hashAll([hours.hashCode, totalValue.hashCode, startTime.hashCode, endTime.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);
    }
    if (startTime != null) {
      json['startTime'] = startTime!.toJson();
    }
    if (endTime != null) {
      json['endTime'] = endTime!.toJson();
    }
    json['role'] = role.toJson();
    json['shift'] = shift.toJson();
    return json;
  }

  ListRecentPaymentsRecentPaymentsApplicationShiftRole({
    this.hours,
    this.totalValue,
    this.startTime,
    this.endTime,
    required this.role,
    required this.shift,
  });
}

@immutable
class ListRecentPaymentsRecentPaymentsApplicationShiftRoleRole {
  final String name;
  final double costPerHour;
  ListRecentPaymentsRecentPaymentsApplicationShiftRoleRole.fromJson(dynamic json):
  
  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 ListRecentPaymentsRecentPaymentsApplicationShiftRoleRole otherTyped = other as ListRecentPaymentsRecentPaymentsApplicationShiftRoleRole;
    return name == otherTyped.name && 
    costPerHour == otherTyped.costPerHour;
    
  }
  @override
  int get hashCode => Object.hashAll([name.hashCode, costPerHour.hashCode]);
  

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

  ListRecentPaymentsRecentPaymentsApplicationShiftRoleRole({
    required this.name,
    required this.costPerHour,
  });
}

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

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

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

  ListRecentPaymentsRecentPaymentsApplicationShiftRoleShift({
    required this.title,
    this.date,
    this.location,
    this.locationAddress,
    this.description,
  });
}

@immutable
class ListRecentPaymentsRecentPaymentsInvoice {
  final EnumValue<InvoiceStatus> status;
  final String invoiceNumber;
  final Timestamp issueDate;
  final ListRecentPaymentsRecentPaymentsInvoiceBusiness business;
  final ListRecentPaymentsRecentPaymentsInvoiceVendor vendor;
  final ListRecentPaymentsRecentPaymentsInvoiceOrder order;
  ListRecentPaymentsRecentPaymentsInvoice.fromJson(dynamic json):
  
  status = invoiceStatusDeserializer(json['status']),
  invoiceNumber = nativeFromJson<String>(json['invoiceNumber']),
  issueDate = Timestamp.fromJson(json['issueDate']),
  business = ListRecentPaymentsRecentPaymentsInvoiceBusiness.fromJson(json['business']),
  vendor = ListRecentPaymentsRecentPaymentsInvoiceVendor.fromJson(json['vendor']),
  order = ListRecentPaymentsRecentPaymentsInvoiceOrder.fromJson(json['order']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

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

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

  ListRecentPaymentsRecentPaymentsInvoice({
    required this.status,
    required this.invoiceNumber,
    required this.issueDate,
    required this.business,
    required this.vendor,
    required this.order,
  });
}

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

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

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

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

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

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

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

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

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

@immutable
class ListRecentPaymentsVariables {
  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.')
  ListRecentPaymentsVariables.fromJson(Map<String, dynamic> json) {
  
  
    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 ListRecentPaymentsVariables otherTyped = other as ListRecentPaymentsVariables;
    return offset == otherTyped.offset && 
    limit == otherTyped.limit;
    
  }
  @override
  int get hashCode => Object.hashAll([offset.hashCode, limit.hashCode]);
  

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

  ListRecentPaymentsVariables({
    required this.offset,
    required this.limit,
  });
}

