// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'gift_catalog_model.dart';

// **************************************************************************
// TypeAdapterGenerator
// **************************************************************************

class GiftCatalogModelAdapter extends TypeAdapter<GiftCatalogModel> {
  @override
  final typeId = 11;

  @override
  GiftCatalogModel read(BinaryReader reader) {
    final numOfFields = reader.readByte();
    final fields = <int, dynamic>{
      for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
    };
    return GiftCatalogModel(
      catalogId: fields[0] as String,
      name: fields[1] as String,
      description: fields[2] as String,
      imageUrl: fields[3] as String?,
      category: fields[4] as GiftCategory,
      pointsCost: (fields[5] as num).toInt(),
      cashValue: (fields[6] as num).toDouble(),
      quantityAvailable: (fields[7] as num).toInt(),
      quantityRedeemed: (fields[8] as num).toInt(),
      termsConditions: fields[9] as String?,
      isActive: fields[10] as bool,
      validFrom: fields[11] as DateTime?,
      validUntil: fields[12] as DateTime?,
      createdAt: fields[13] as DateTime,
      updatedAt: fields[14] as DateTime?,
    );
  }

  @override
  void write(BinaryWriter writer, GiftCatalogModel obj) {
    writer
      ..writeByte(15)
      ..writeByte(0)
      ..write(obj.catalogId)
      ..writeByte(1)
      ..write(obj.name)
      ..writeByte(2)
      ..write(obj.description)
      ..writeByte(3)
      ..write(obj.imageUrl)
      ..writeByte(4)
      ..write(obj.category)
      ..writeByte(5)
      ..write(obj.pointsCost)
      ..writeByte(6)
      ..write(obj.cashValue)
      ..writeByte(7)
      ..write(obj.quantityAvailable)
      ..writeByte(8)
      ..write(obj.quantityRedeemed)
      ..writeByte(9)
      ..write(obj.termsConditions)
      ..writeByte(10)
      ..write(obj.isActive)
      ..writeByte(11)
      ..write(obj.validFrom)
      ..writeByte(12)
      ..write(obj.validUntil)
      ..writeByte(13)
      ..write(obj.createdAt)
      ..writeByte(14)
      ..write(obj.updatedAt);
  }

  @override
  int get hashCode => typeId.hashCode;

  @override
  bool operator ==(Object other) =>
      identical(this, other) ||
      other is GiftCatalogModelAdapter &&
          runtimeType == other.runtimeType &&
          typeId == other.typeId;
}
