part of 'generated.dart';

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

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

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

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

@immutable
class ListAcceptedApplicationsByBusinessForDayApplications {
  final String id;
  final String shiftId;
  final String roleId;
  final Timestamp? checkInTime;
  final Timestamp? checkOutTime;
  final Timestamp? appliedAt;
  final ListAcceptedApplicationsByBusinessForDayApplicationsStaff staff;
  ListAcceptedApplicationsByBusinessForDayApplications.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']),
  staff = ListAcceptedApplicationsByBusinessForDayApplicationsStaff.fromJson(json['staff']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListAcceptedApplicationsByBusinessForDayApplications otherTyped = other as ListAcceptedApplicationsByBusinessForDayApplications;
    return id == otherTyped.id && 
    shiftId == otherTyped.shiftId && 
    roleId == otherTyped.roleId && 
    checkInTime == otherTyped.checkInTime && 
    checkOutTime == otherTyped.checkOutTime && 
    appliedAt == otherTyped.appliedAt && 
    staff == otherTyped.staff;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, shiftId.hashCode, roleId.hashCode, checkInTime.hashCode, checkOutTime.hashCode, appliedAt.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['staff'] = staff.toJson();
    return json;
  }

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

@immutable
class ListAcceptedApplicationsByBusinessForDayApplicationsStaff {
  final String id;
  final String fullName;
  final String? email;
  final String? phone;
  final String? photoUrl;
  ListAcceptedApplicationsByBusinessForDayApplicationsStaff.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 ListAcceptedApplicationsByBusinessForDayApplicationsStaff otherTyped = other as ListAcceptedApplicationsByBusinessForDayApplicationsStaff;
    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;
  }

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

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

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

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

@immutable
class ListAcceptedApplicationsByBusinessForDayVariables {
  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.')
  ListAcceptedApplicationsByBusinessForDayVariables.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 ListAcceptedApplicationsByBusinessForDayVariables otherTyped = other as ListAcceptedApplicationsByBusinessForDayVariables;
    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;
  }

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

