part of 'generated.dart';

class ListTimesheetsForSpendVariablesBuilder {
  Timestamp startTime;
  Timestamp endTime;

  final FirebaseDataConnect _dataConnect;
  ListTimesheetsForSpendVariablesBuilder(this._dataConnect, {required  this.startTime,required  this.endTime,});
  Deserializer<ListTimesheetsForSpendData> dataDeserializer = (dynamic json)  => ListTimesheetsForSpendData.fromJson(jsonDecode(json));
  Serializer<ListTimesheetsForSpendVariables> varsSerializer = (ListTimesheetsForSpendVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<ListTimesheetsForSpendData, ListTimesheetsForSpendVariables>> execute() {
    return ref().execute();
  }

  QueryRef<ListTimesheetsForSpendData, ListTimesheetsForSpendVariables> ref() {
    ListTimesheetsForSpendVariables vars= ListTimesheetsForSpendVariables(startTime: startTime,endTime: endTime,);
    return _dataConnect.query("listTimesheetsForSpend", dataDeserializer, varsSerializer, vars);
  }
}

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

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

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

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

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

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

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

  ListTimesheetsForSpendShiftRolesShift({
    required this.title,
    this.location,
    this.status,
    this.date,
    required this.order,
  });
}

@immutable
class ListTimesheetsForSpendShiftRolesShiftOrder {
  final ListTimesheetsForSpendShiftRolesShiftOrderBusiness business;
  ListTimesheetsForSpendShiftRolesShiftOrder.fromJson(dynamic json):
  
  business = ListTimesheetsForSpendShiftRolesShiftOrderBusiness.fromJson(json['business']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListTimesheetsForSpendShiftRolesShiftOrder otherTyped = other as ListTimesheetsForSpendShiftRolesShiftOrder;
    return business == otherTyped.business;
    
  }
  @override
  int get hashCode => business.hashCode;
  

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

  ListTimesheetsForSpendShiftRolesShiftOrder({
    required this.business,
  });
}

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

    final ListTimesheetsForSpendShiftRolesShiftOrderBusiness otherTyped = other as ListTimesheetsForSpendShiftRolesShiftOrderBusiness;
    return businessName == otherTyped.businessName;
    
  }
  @override
  int get hashCode => businessName.hashCode;
  

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

  ListTimesheetsForSpendShiftRolesShiftOrderBusiness({
    required this.businessName,
  });
}

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

    final ListTimesheetsForSpendShiftRolesRole otherTyped = other as ListTimesheetsForSpendShiftRolesRole;
    return costPerHour == otherTyped.costPerHour;
    
  }
  @override
  int get hashCode => costPerHour.hashCode;
  

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

  ListTimesheetsForSpendShiftRolesRole({
    required this.costPerHour,
  });
}

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

    final ListTimesheetsForSpendData otherTyped = other as ListTimesheetsForSpendData;
    return shiftRoles == otherTyped.shiftRoles;
    
  }
  @override
  int get hashCode => shiftRoles.hashCode;
  

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

  ListTimesheetsForSpendData({
    required this.shiftRoles,
  });
}

@immutable
class ListTimesheetsForSpendVariables {
  final Timestamp startTime;
  final Timestamp endTime;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  ListTimesheetsForSpendVariables.fromJson(Map<String, dynamic> json):
  
  startTime = Timestamp.fromJson(json['startTime']),
  endTime = Timestamp.fromJson(json['endTime']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListTimesheetsForSpendVariables otherTyped = other as ListTimesheetsForSpendVariables;
    return startTime == otherTyped.startTime && 
    endTime == otherTyped.endTime;
    
  }
  @override
  int get hashCode => Object.hashAll([startTime.hashCode, endTime.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['startTime'] = startTime.toJson();
    json['endTime'] = endTime.toJson();
    return json;
  }

  ListTimesheetsForSpendVariables({
    required this.startTime,
    required this.endTime,
  });
}

