part of 'generated.dart';

class ListVendorRatesVariablesBuilder {
  
  final FirebaseDataConnect _dataConnect;
  ListVendorRatesVariablesBuilder(this._dataConnect, );
  Deserializer<ListVendorRatesData> dataDeserializer = (dynamic json)  => ListVendorRatesData.fromJson(jsonDecode(json));
  
  Future<QueryResult<ListVendorRatesData, void>> execute() {
    return ref().execute();
  }

  QueryRef<ListVendorRatesData, void> ref() {
    
    return _dataConnect.query("listVendorRates", dataDeserializer, emptySerializer, null);
  }
}

@immutable
class ListVendorRatesVendorRates {
  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 ListVendorRatesVendorRatesVendor vendor;
  ListVendorRatesVendorRates.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 = ListVendorRatesVendorRatesVendor.fromJson(json['vendor']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

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

  ListVendorRatesVendorRates({
    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 ListVendorRatesVendorRatesVendor {
  final String companyName;
  final String? region;
  ListVendorRatesVendorRatesVendor.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 ListVendorRatesVendorRatesVendor otherTyped = other as ListVendorRatesVendorRatesVendor;
    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;
  }

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

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

    final ListVendorRatesData otherTyped = other as ListVendorRatesData;
    return vendorRates == otherTyped.vendorRates;
    
  }
  @override
  int get hashCode => vendorRates.hashCode;
  

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

  ListVendorRatesData({
    required this.vendorRates,
  });
}

