// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'redeemed_gift_model.dart';

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

class RedeemedGiftModelAdapter extends TypeAdapter<RedeemedGiftModel> {
  @override
  final typeId = 12;

  @override
  RedeemedGiftModel read(BinaryReader reader) {
    final numOfFields = reader.readByte();
    final fields = <int, dynamic>{
      for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
    };
    return RedeemedGiftModel(
      giftId: fields[0] as String,
      userId: fields[1] as String,
      catalogId: fields[2] as String,
      name: fields[3] as String,
      description: fields[4] as String,
      voucherCode: fields[5] as String?,
      qrCodeImage: fields[6] as String?,
      giftType: fields[7] as GiftCategory,
      pointsCost: (fields[8] as num).toInt(),
      cashValue: (fields[9] as num).toDouble(),
      expiryDate: fields[10] as DateTime?,
      status: fields[11] as GiftStatus,
      redeemedAt: fields[12] as DateTime,
      usedAt: fields[13] as DateTime?,
      usedLocation: fields[14] as String?,
      usedReference: fields[15] as String?,
    );
  }

  @override
  void write(BinaryWriter writer, RedeemedGiftModel obj) {
    writer
      ..writeByte(16)
      ..writeByte(0)
      ..write(obj.giftId)
      ..writeByte(1)
      ..write(obj.userId)
      ..writeByte(2)
      ..write(obj.catalogId)
      ..writeByte(3)
      ..write(obj.name)
      ..writeByte(4)
      ..write(obj.description)
      ..writeByte(5)
      ..write(obj.voucherCode)
      ..writeByte(6)
      ..write(obj.qrCodeImage)
      ..writeByte(7)
      ..write(obj.giftType)
      ..writeByte(8)
      ..write(obj.pointsCost)
      ..writeByte(9)
      ..write(obj.cashValue)
      ..writeByte(10)
      ..write(obj.expiryDate)
      ..writeByte(11)
      ..write(obj.status)
      ..writeByte(12)
      ..write(obj.redeemedAt)
      ..writeByte(13)
      ..write(obj.usedAt)
      ..writeByte(14)
      ..write(obj.usedLocation)
      ..writeByte(15)
      ..write(obj.usedReference);
  }

  @override
  int get hashCode => typeId.hashCode;

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