part of 'generated.dart';

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

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

@immutable
class ListCustomRateCardsCustomRateCards {
  final String id;
  final String name;
  final String? baseBook;
  final double? discount;
  final bool? isDefault;
  final Timestamp? createdAt;
  final Timestamp? updatedAt;
  ListCustomRateCardsCustomRateCards.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  name = nativeFromJson<String>(json['name']),
  baseBook = json['baseBook'] == null ? null : nativeFromJson<String>(json['baseBook']),
  discount = json['discount'] == null ? null : nativeFromJson<double>(json['discount']),
  isDefault = json['isDefault'] == null ? null : nativeFromJson<bool>(json['isDefault']),
  createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']),
  updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListCustomRateCardsCustomRateCards otherTyped = other as ListCustomRateCardsCustomRateCards;
    return id == otherTyped.id && 
    name == otherTyped.name && 
    baseBook == otherTyped.baseBook && 
    discount == otherTyped.discount && 
    isDefault == otherTyped.isDefault && 
    createdAt == otherTyped.createdAt && 
    updatedAt == otherTyped.updatedAt;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, name.hashCode, baseBook.hashCode, discount.hashCode, isDefault.hashCode, createdAt.hashCode, updatedAt.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    json['name'] = nativeToJson<String>(name);
    if (baseBook != null) {
      json['baseBook'] = nativeToJson<String?>(baseBook);
    }
    if (discount != null) {
      json['discount'] = nativeToJson<double?>(discount);
    }
    if (isDefault != null) {
      json['isDefault'] = nativeToJson<bool?>(isDefault);
    }
    if (createdAt != null) {
      json['createdAt'] = createdAt!.toJson();
    }
    if (updatedAt != null) {
      json['updatedAt'] = updatedAt!.toJson();
    }
    return json;
  }

  ListCustomRateCardsCustomRateCards({
    required this.id,
    required this.name,
    this.baseBook,
    this.discount,
    this.isDefault,
    this.createdAt,
    this.updatedAt,
  });
}

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

    final ListCustomRateCardsData otherTyped = other as ListCustomRateCardsData;
    return customRateCards == otherTyped.customRateCards;
    
  }
  @override
  int get hashCode => customRateCards.hashCode;
  

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

  ListCustomRateCardsData({
    required this.customRateCards,
  });
}

