part of 'generated.dart';

class ListStaffsApplicationsByBusinessForDayVariablesBuilder {
  String businessId;
  Timestamp dayStart;
  Timestamp dayEnd;
  Optional<int> _offset = Optional.optional(nativeFromJson, nativeToJson);
  Optional<int> _limit = Optional.optional(nativeFromJson, nativeToJson);

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

  ListStaffsApplicationsByBusinessForDayVariablesBuilder(this._dataConnect, {required  this.businessId,required  this.dayStart,required  this.dayEnd,});
  Deserializer<ListStaffsApplicationsByBusinessForDayData> dataDeserializer = (dynamic json)  => ListStaffsApplicationsByBusinessForDayData.fromJson(jsonDecode(json));
  Serializer<ListStaffsApplicationsByBusinessForDayVariables> varsSerializer = (ListStaffsApplicationsByBusinessForDayVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<ListStaffsApplicationsByBusinessForDayData, ListStaffsApplicationsByBusinessForDayVariables>> execute() {
    return ref().execute();
  }

  QueryRef<ListStaffsApplicationsByBusinessForDayData, ListStaffsApplicationsByBusinessForDayVariables> ref() {
    ListStaffsApplicationsByBusinessForDayVariables vars= ListStaffsApplicationsByBusinessForDayVariables(businessId: businessId,dayStart: dayStart,dayEnd: dayEnd,offset: _offset,limit: _limit,);
    return _dataConnect.query("listStaffsApplicationsByBusinessForDay", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class ListStaffsApplicationsByBusinessForDayApplications {
  final String id;
  final String shiftId;
  final String roleId;
  final Timestamp? checkInTime;
  final Timestamp? checkOutTime;
  final Timestamp? appliedAt;
  final EnumValue<ApplicationStatus> status;
  final ListStaffsApplicationsByBusinessForDayApplicationsShiftRole shiftRole;
  final ListStaffsApplicationsByBusinessForDayApplicationsStaff staff;
  ListStaffsApplicationsByBusinessForDayApplications.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  shiftId = nativeFromJson<String>(json['shiftId']),
  roleId = nativeFromJson<String>(json['roleId']),
  checkInTime = json['checkInTime'] == null ? null : Timestamp.fromJson(json['checkInTime']),
  checkOutTime = json['checkOutTime'] == null ? null : Timestamp.fromJson(json['checkOutTime']),
  appliedAt = json['appliedAt'] == null ? null : Timestamp.fromJson(json['appliedAt']),
  status = applicationStatusDeserializer(json['status']),
  shiftRole = ListStaffsApplicationsByBusinessForDayApplicationsShiftRole.fromJson(json['shiftRole']),
  staff = ListStaffsApplicationsByBusinessForDayApplicationsStaff.fromJson(json['staff']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListStaffsApplicationsByBusinessForDayApplications otherTyped = other as ListStaffsApplicationsByBusinessForDayApplications;
    return id == otherTyped.id && 
    shiftId == otherTyped.shiftId && 
    roleId == otherTyped.roleId && 
    checkInTime == otherTyped.checkInTime && 
    checkOutTime == otherTyped.checkOutTime && 
    appliedAt == otherTyped.appliedAt && 
    status == otherTyped.status && 
    shiftRole == otherTyped.shiftRole && 
    staff == otherTyped.staff;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, shiftId.hashCode, roleId.hashCode, checkInTime.hashCode, checkOutTime.hashCode, appliedAt.hashCode, status.hashCode, shiftRole.hashCode, staff.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    json['shiftId'] = nativeToJson<String>(shiftId);
    json['roleId'] = nativeToJson<String>(roleId);
    if (checkInTime != null) {
      json['checkInTime'] = checkInTime!.toJson();
    }
    if (checkOutTime != null) {
      json['checkOutTime'] = checkOutTime!.toJson();
    }
    if (appliedAt != null) {
      json['appliedAt'] = appliedAt!.toJson();
    }
    json['status'] = 
    applicationStatusSerializer(status)
    ;
    json['shiftRole'] = shiftRole.toJson();
    json['staff'] = staff.toJson();
    return json;
  }

  ListStaffsApplicationsByBusinessForDayApplications({
    required this.id,
    required this.shiftId,
    required this.roleId,
    this.checkInTime,
    this.checkOutTime,
    this.appliedAt,
    required this.status,
    required this.shiftRole,
    required this.staff,
  });
}

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

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

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

  ListStaffsApplicationsByBusinessForDayApplicationsShiftRole({
    required this.shift,
    required this.count,
    this.assigned,
    this.hours,
    required this.role,
  });
}

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

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

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

  ListStaffsApplicationsByBusinessForDayApplicationsShiftRoleShift({
    this.location,
    this.cost,
  });
}

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

    final ListStaffsApplicationsByBusinessForDayApplicationsShiftRoleRole otherTyped = other as ListStaffsApplicationsByBusinessForDayApplicationsShiftRoleRole;
    return name == otherTyped.name;
    
  }
  @override
  int get hashCode => name.hashCode;
  

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

  ListStaffsApplicationsByBusinessForDayApplicationsShiftRoleRole({
    required this.name,
  });
}

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

    final ListStaffsApplicationsByBusinessForDayApplicationsStaff otherTyped = other as ListStaffsApplicationsByBusinessForDayApplicationsStaff;
    return id == otherTyped.id && 
    fullName == otherTyped.fullName && 
    email == otherTyped.email && 
    phone == otherTyped.phone && 
    photoUrl == otherTyped.photoUrl;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, fullName.hashCode, email.hashCode, phone.hashCode, photoUrl.hashCode]);
  

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

  ListStaffsApplicationsByBusinessForDayApplicationsStaff({
    required this.id,
    required this.fullName,
    this.email,
    this.phone,
    this.photoUrl,
  });
}

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

    final ListStaffsApplicationsByBusinessForDayData otherTyped = other as ListStaffsApplicationsByBusinessForDayData;
    return applications == otherTyped.applications;
    
  }
  @override
  int get hashCode => applications.hashCode;
  

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

  ListStaffsApplicationsByBusinessForDayData({
    required this.applications,
  });
}

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

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

  ListStaffsApplicationsByBusinessForDayVariables({
    required this.businessId,
    required this.dayStart,
    required this.dayEnd,
    required this.offset,
    required this.limit,
  });
}

