part of 'generated.dart';

class ListShiftRolesByBusinessAndOrderVariablesBuilder {
  String businessId;
  String orderId;
  Optional<int> _offset = Optional.optional(nativeFromJson, nativeToJson);
  Optional<int> _limit = Optional.optional(nativeFromJson, nativeToJson);

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

  ListShiftRolesByBusinessAndOrderVariablesBuilder(this._dataConnect, {required  this.businessId,required  this.orderId,});
  Deserializer<ListShiftRolesByBusinessAndOrderData> dataDeserializer = (dynamic json)  => ListShiftRolesByBusinessAndOrderData.fromJson(jsonDecode(json));
  Serializer<ListShiftRolesByBusinessAndOrderVariables> varsSerializer = (ListShiftRolesByBusinessAndOrderVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<ListShiftRolesByBusinessAndOrderData, ListShiftRolesByBusinessAndOrderVariables>> execute() {
    return ref().execute();
  }

  QueryRef<ListShiftRolesByBusinessAndOrderData, ListShiftRolesByBusinessAndOrderVariables> ref() {
    ListShiftRolesByBusinessAndOrderVariables vars= ListShiftRolesByBusinessAndOrderVariables(businessId: businessId,orderId: orderId,offset: _offset,limit: _limit,);
    return _dataConnect.query("listShiftRolesByBusinessAndOrder", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class ListShiftRolesByBusinessAndOrderShiftRoles {
  final String id;
  final String shiftId;
  final String roleId;
  final int count;
  final int? assigned;
  final Timestamp? startTime;
  final Timestamp? endTime;
  final double? hours;
  final EnumValue<BreakDuration>? breakType;
  final double? totalValue;
  final Timestamp? createdAt;
  final ListShiftRolesByBusinessAndOrderShiftRolesRole role;
  final ListShiftRolesByBusinessAndOrderShiftRolesShift shift;
  ListShiftRolesByBusinessAndOrderShiftRoles.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  shiftId = nativeFromJson<String>(json['shiftId']),
  roleId = nativeFromJson<String>(json['roleId']),
  count = nativeFromJson<int>(json['count']),
  assigned = json['assigned'] == null ? null : nativeFromJson<int>(json['assigned']),
  startTime = json['startTime'] == null ? null : Timestamp.fromJson(json['startTime']),
  endTime = json['endTime'] == null ? null : Timestamp.fromJson(json['endTime']),
  hours = json['hours'] == null ? null : nativeFromJson<double>(json['hours']),
  breakType = json['breakType'] == null ? null : breakDurationDeserializer(json['breakType']),
  totalValue = json['totalValue'] == null ? null : nativeFromJson<double>(json['totalValue']),
  createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']),
  role = ListShiftRolesByBusinessAndOrderShiftRolesRole.fromJson(json['role']),
  shift = ListShiftRolesByBusinessAndOrderShiftRolesShift.fromJson(json['shift']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListShiftRolesByBusinessAndOrderShiftRoles otherTyped = other as ListShiftRolesByBusinessAndOrderShiftRoles;
    return id == otherTyped.id && 
    shiftId == otherTyped.shiftId && 
    roleId == otherTyped.roleId && 
    count == otherTyped.count && 
    assigned == otherTyped.assigned && 
    startTime == otherTyped.startTime && 
    endTime == otherTyped.endTime && 
    hours == otherTyped.hours && 
    breakType == otherTyped.breakType && 
    totalValue == otherTyped.totalValue && 
    createdAt == otherTyped.createdAt && 
    role == otherTyped.role && 
    shift == otherTyped.shift;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, shiftId.hashCode, roleId.hashCode, count.hashCode, assigned.hashCode, startTime.hashCode, endTime.hashCode, hours.hashCode, breakType.hashCode, totalValue.hashCode, createdAt.hashCode, role.hashCode, shift.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    json['shiftId'] = nativeToJson<String>(shiftId);
    json['roleId'] = nativeToJson<String>(roleId);
    json['count'] = nativeToJson<int>(count);
    if (assigned != null) {
      json['assigned'] = nativeToJson<int?>(assigned);
    }
    if (startTime != null) {
      json['startTime'] = startTime!.toJson();
    }
    if (endTime != null) {
      json['endTime'] = endTime!.toJson();
    }
    if (hours != null) {
      json['hours'] = nativeToJson<double?>(hours);
    }
    if (breakType != null) {
      json['breakType'] = 
    breakDurationSerializer(breakType!)
    ;
    }
    if (totalValue != null) {
      json['totalValue'] = nativeToJson<double?>(totalValue);
    }
    if (createdAt != null) {
      json['createdAt'] = createdAt!.toJson();
    }
    json['role'] = role.toJson();
    json['shift'] = shift.toJson();
    return json;
  }

  ListShiftRolesByBusinessAndOrderShiftRoles({
    required this.id,
    required this.shiftId,
    required this.roleId,
    required this.count,
    this.assigned,
    this.startTime,
    this.endTime,
    this.hours,
    this.breakType,
    this.totalValue,
    this.createdAt,
    required this.role,
    required this.shift,
  });
}

@immutable
class ListShiftRolesByBusinessAndOrderShiftRolesRole {
  final String id;
  final String name;
  final double costPerHour;
  ListShiftRolesByBusinessAndOrderShiftRolesRole.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 ListShiftRolesByBusinessAndOrderShiftRolesRole otherTyped = other as ListShiftRolesByBusinessAndOrderShiftRolesRole;
    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;
  }

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

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

    final ListShiftRolesByBusinessAndOrderShiftRolesShift otherTyped = other as ListShiftRolesByBusinessAndOrderShiftRolesShift;
    return id == otherTyped.id && 
    title == otherTyped.title && 
    date == otherTyped.date && 
    orderId == otherTyped.orderId && 
    location == otherTyped.location && 
    locationAddress == otherTyped.locationAddress && 
    order == otherTyped.order;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, title.hashCode, date.hashCode, orderId.hashCode, location.hashCode, locationAddress.hashCode, order.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();
    }
    json['orderId'] = nativeToJson<String>(orderId);
    if (location != null) {
      json['location'] = nativeToJson<String?>(location);
    }
    if (locationAddress != null) {
      json['locationAddress'] = nativeToJson<String?>(locationAddress);
    }
    json['order'] = order.toJson();
    return json;
  }

  ListShiftRolesByBusinessAndOrderShiftRolesShift({
    required this.id,
    required this.title,
    this.date,
    required this.orderId,
    this.location,
    this.locationAddress,
    required this.order,
  });
}

@immutable
class ListShiftRolesByBusinessAndOrderShiftRolesShiftOrder {
  final String? vendorId;
  final Timestamp? date;
  final String? location;
  ListShiftRolesByBusinessAndOrderShiftRolesShiftOrder.fromJson(dynamic json):
  
  vendorId = json['vendorId'] == null ? null : nativeFromJson<String>(json['vendorId']),
  date = json['date'] == null ? null : Timestamp.fromJson(json['date']),
  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 ListShiftRolesByBusinessAndOrderShiftRolesShiftOrder otherTyped = other as ListShiftRolesByBusinessAndOrderShiftRolesShiftOrder;
    return vendorId == otherTyped.vendorId && 
    date == otherTyped.date && 
    location == otherTyped.location;
    
  }
  @override
  int get hashCode => Object.hashAll([vendorId.hashCode, date.hashCode, location.hashCode]);
  

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

  ListShiftRolesByBusinessAndOrderShiftRolesShiftOrder({
    this.vendorId,
    this.date,
    this.location,
  });
}

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

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

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

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

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

  ListShiftRolesByBusinessAndOrderVariables({
    required this.businessId,
    required this.orderId,
    required this.offset,
    required this.limit,
  });
}

