import 'package:json_annotation/json_annotation.dart';

part 'addon_model.g.dart';

@JsonSerializable(fieldRename: FieldRename.snake)
class AddonModel {
  String id;
  String? name;
  int? price;

  AddonModel({required this.id, this.name, this.price});

  factory AddonModel.fromJson(Map<String, dynamic> json) {
    return _$AddonModelFromJson(json);
  }

  Map<String, dynamic> toJson() => _$AddonModelToJson(this);

  @override
  int get hashCode => id.hashCode ^ name.hashCode ^ price.hashCode;

  @override
  bool operator ==(Object other) {
    if (identical(this, other)) return true;
    if (other is! AddonModel) return false;
    return id == other.id && name == other.name && price == other.price;
  }
}
