import 'package:hive/hive.dart';

part 'user_model.g.dart';

@HiveType(typeId: 0)
class UserModel extends HiveObject {
  @HiveField(0)
  final String id;
  
  @HiveField(1)
  final String email;
  
  @HiveField(2)
  final String passwordHash;
  
  @HiveField(3)
  final String barberName;
  
  @HiveField(4)
  final String barberShopName;
  
  @HiveField(5)
  final DateTime createdAt;

  UserModel({
    required this.id,
    required this.email,
    required this.passwordHash,
    required this.barberName,
    required this.barberShopName,
    required this.createdAt,
  });

  UserModel copyWith({
    String? id,
    String? email,
    String? passwordHash,
    String? barberName,
    String? barberShopName,
    DateTime? createdAt,
  }) {
    return UserModel(
      id: id ?? this.id,
      email: email ?? this.email,
      passwordHash: passwordHash ?? this.passwordHash,
      barberName: barberName ?? this.barberName,
      barberShopName: barberShopName ?? this.barberShopName,
      createdAt: createdAt ?? this.createdAt,
    );
  }
}
