part of 'generated.dart';

class GetVendorRateByIdVariablesBuilder {
  String id;

  final FirebaseDataConnect _dataConnect;
  GetVendorRateByIdVariablesBuilder(this._dataConnect, {required  this.id,});
  Deserializer<GetVendorRateByIdData> dataDeserializer = (dynamic json)  => GetVendorRateByIdData.fromJson(jsonDecode(json));
  Serializer<GetVendorRateByIdVariables> varsSerializer = (GetVendorRateByIdVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<GetVendorRateByIdData, GetVendorRateByIdVariables>> execute() {
    return ref().execute();
  }

  QueryRef<GetVendorRateByIdData, GetVendorRateByIdVariables> ref() {
    GetVendorRateByIdVariables vars= GetVendorRateByIdVariables(id: id,);
    return _dataConnect.query("getVendorRateById", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class GetVendorRateByIdVendorRate {
  final String id;
  final String vendorId;
  final String? roleName;
  final EnumValue<CategoryType>? category;
  final double? clientRate;
  final double? employeeWage;
  final double? markupPercentage;
  final double? vendorFeePercentage;
  final bool? isActive;
  final String? notes;
  final Timestamp? createdAt;
  final GetVendorRateByIdVendorRateVendor vendor;
  GetVendorRateByIdVendorRate.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  vendorId = nativeFromJson<String>(json['vendorId']),
  roleName = json['roleName'] == null ? null : nativeFromJson<String>(json['roleName']),
  category = json['category'] == null ? null : categoryTypeDeserializer(json['category']),
  clientRate = json['clientRate'] == null ? null : nativeFromJson<double>(json['clientRate']),
  employeeWage = json['employeeWage'] == null ? null : nativeFromJson<double>(json['employeeWage']),
  markupPercentage = json['markupPercentage'] == null ? null : nativeFromJson<double>(json['markupPercentage']),
  vendorFeePercentage = json['vendorFeePercentage'] == null ? null : nativeFromJson<double>(json['vendorFeePercentage']),
  isActive = json['isActive'] == null ? null : nativeFromJson<bool>(json['isActive']),
  notes = json['notes'] == null ? null : nativeFromJson<String>(json['notes']),
  createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']),
  vendor = GetVendorRateByIdVendorRateVendor.fromJson(json['vendor']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final GetVendorRateByIdVendorRate otherTyped = other as GetVendorRateByIdVendorRate;
    return id == otherTyped.id && 
    vendorId == otherTyped.vendorId && 
    roleName == otherTyped.roleName && 
    category == otherTyped.category && 
    clientRate == otherTyped.clientRate && 
    employeeWage == otherTyped.employeeWage && 
    markupPercentage == otherTyped.markupPercentage && 
    vendorFeePercentage == otherTyped.vendorFeePercentage && 
    isActive == otherTyped.isActive && 
    notes == otherTyped.notes && 
    createdAt == otherTyped.createdAt && 
    vendor == otherTyped.vendor;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, vendorId.hashCode, roleName.hashCode, category.hashCode, clientRate.hashCode, employeeWage.hashCode, markupPercentage.hashCode, vendorFeePercentage.hashCode, isActive.hashCode, notes.hashCode, createdAt.hashCode, vendor.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    json['vendorId'] = nativeToJson<String>(vendorId);
    if (roleName != null) {
      json['roleName'] = nativeToJson<String?>(roleName);
    }
    if (category != null) {
      json['category'] = 
    categoryTypeSerializer(category!)
    ;
    }
    if (clientRate != null) {
      json['clientRate'] = nativeToJson<double?>(clientRate);
    }
    if (employeeWage != null) {
      json['employeeWage'] = nativeToJson<double?>(employeeWage);
    }
    if (markupPercentage != null) {
      json['markupPercentage'] = nativeToJson<double?>(markupPercentage);
    }
    if (vendorFeePercentage != null) {
      json['vendorFeePercentage'] = nativeToJson<double?>(vendorFeePercentage);
    }
    if (isActive != null) {
      json['isActive'] = nativeToJson<bool?>(isActive);
    }
    if (notes != null) {
      json['notes'] = nativeToJson<String?>(notes);
    }
    if (createdAt != null) {
      json['createdAt'] = createdAt!.toJson();
    }
    json['vendor'] = vendor.toJson();
    return json;
  }

  GetVendorRateByIdVendorRate({
    required this.id,
    required this.vendorId,
    this.roleName,
    this.category,
    this.clientRate,
    this.employeeWage,
    this.markupPercentage,
    this.vendorFeePercentage,
    this.isActive,
    this.notes,
    this.createdAt,
    required this.vendor,
  });
}

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

    final GetVendorRateByIdVendorRateVendor otherTyped = other as GetVendorRateByIdVendorRateVendor;
    return companyName == otherTyped.companyName && 
    region == otherTyped.region;
    
  }
  @override
  int get hashCode => Object.hashAll([companyName.hashCode, region.hashCode]);
  

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

  GetVendorRateByIdVendorRateVendor({
    required this.companyName,
    this.region,
  });
}

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

    final GetVendorRateByIdData otherTyped = other as GetVendorRateByIdData;
    return vendorRate == otherTyped.vendorRate;
    
  }
  @override
  int get hashCode => vendorRate.hashCode;
  

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

  GetVendorRateByIdData({
    this.vendorRate,
  });
}

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

    final GetVendorRateByIdVariables otherTyped = other as GetVendorRateByIdVariables;
    return id == otherTyped.id;
    
  }
  @override
  int get hashCode => id.hashCode;
  

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

  GetVendorRateByIdVariables({
    required this.id,
  });
}

