// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'user_model.dart';

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

class UserModelAdapter extends TypeAdapter<UserModel> {
  @override
  final typeId = 0;

  @override
  UserModel read(BinaryReader reader) {
    final numOfFields = reader.readByte();
    final fields = <int, dynamic>{
      for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
    };
    return UserModel(
      userId: fields[0] as String,
      phoneNumber: fields[1] as String,
      passwordHash: fields[2] as String?,
      fullName: fields[3] as String,
      email: fields[4] as String?,
      role: fields[5] as UserRole,
      status: fields[6] as UserStatus,
      loyaltyTier: fields[7] as LoyaltyTier,
      totalPoints: (fields[8] as num).toInt(),
      companyInfo: fields[9] as String?,
      cccd: fields[10] as String?,
      attachments: fields[11] as String?,
      address: fields[12] as String?,
      avatarUrl: fields[13] as String?,
      referralCode: fields[14] as String?,
      referredBy: fields[15] as String?,
      erpnextCustomerId: fields[16] as String?,
      createdAt: fields[17] as DateTime,
      updatedAt: fields[18] as DateTime?,
      lastLoginAt: fields[19] as DateTime?,
    );
  }

  @override
  void write(BinaryWriter writer, UserModel obj) {
    writer
      ..writeByte(20)
      ..writeByte(0)
      ..write(obj.userId)
      ..writeByte(1)
      ..write(obj.phoneNumber)
      ..writeByte(2)
      ..write(obj.passwordHash)
      ..writeByte(3)
      ..write(obj.fullName)
      ..writeByte(4)
      ..write(obj.email)
      ..writeByte(5)
      ..write(obj.role)
      ..writeByte(6)
      ..write(obj.status)
      ..writeByte(7)
      ..write(obj.loyaltyTier)
      ..writeByte(8)
      ..write(obj.totalPoints)
      ..writeByte(9)
      ..write(obj.companyInfo)
      ..writeByte(10)
      ..write(obj.cccd)
      ..writeByte(11)
      ..write(obj.attachments)
      ..writeByte(12)
      ..write(obj.address)
      ..writeByte(13)
      ..write(obj.avatarUrl)
      ..writeByte(14)
      ..write(obj.referralCode)
      ..writeByte(15)
      ..write(obj.referredBy)
      ..writeByte(16)
      ..write(obj.erpnextCustomerId)
      ..writeByte(17)
      ..write(obj.createdAt)
      ..writeByte(18)
      ..write(obj.updatedAt)
      ..writeByte(19)
      ..write(obj.lastLoginAt);
  }

  @override
  int get hashCode => typeId.hashCode;

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