// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'loyalty_point_entry_model.dart';

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

class LoyaltyPointEntryModelAdapter
    extends TypeAdapter<LoyaltyPointEntryModel> {
  @override
  final typeId = 10;

  @override
  LoyaltyPointEntryModel read(BinaryReader reader) {
    final numOfFields = reader.readByte();
    final fields = <int, dynamic>{
      for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
    };
    return LoyaltyPointEntryModel(
      entryId: fields[0] as String,
      userId: fields[1] as String,
      points: (fields[2] as num).toInt(),
      entryType: fields[3] as EntryType,
      source: fields[4] as EntrySource,
      description: fields[5] as String,
      referenceId: fields[6] as String?,
      referenceType: fields[7] as String?,
      complaint: fields[8] as String?,
      complaintStatus: fields[9] as ComplaintStatus,
      balanceAfter: (fields[10] as num).toInt(),
      expiryDate: fields[11] as DateTime?,
      timestamp: fields[12] as DateTime,
      erpnextEntryId: fields[13] as String?,
    );
  }

  @override
  void write(BinaryWriter writer, LoyaltyPointEntryModel obj) {
    writer
      ..writeByte(14)
      ..writeByte(0)
      ..write(obj.entryId)
      ..writeByte(1)
      ..write(obj.userId)
      ..writeByte(2)
      ..write(obj.points)
      ..writeByte(3)
      ..write(obj.entryType)
      ..writeByte(4)
      ..write(obj.source)
      ..writeByte(5)
      ..write(obj.description)
      ..writeByte(6)
      ..write(obj.referenceId)
      ..writeByte(7)
      ..write(obj.referenceType)
      ..writeByte(8)
      ..write(obj.complaint)
      ..writeByte(9)
      ..write(obj.complaintStatus)
      ..writeByte(10)
      ..write(obj.balanceAfter)
      ..writeByte(11)
      ..write(obj.expiryDate)
      ..writeByte(12)
      ..write(obj.timestamp)
      ..writeByte(13)
      ..write(obj.erpnextEntryId);
  }

  @override
  int get hashCode => typeId.hashCode;

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