import 'package:hive/hive.dart';

part 'settings_model.g.dart';

@HiveType(typeId: 5)
class SettingsModel extends HiveObject {
  @HiveField(0)
  final String userId;

  @HiveField(1)
  final String? logoPath;

  @HiveField(2)
  final int primaryColorValue; // Armazena Color.value como int

  @HiveField(3)
  final List<String> serviceTypes; // Lista de tipos de serviço/corte

  @HiveField(4, defaultValue: true)
  final bool isDark;

  @HiveField(5)
  final String? appName;

  SettingsModel({
    required this.userId,
    this.logoPath,
    this.primaryColorValue = 0xFFD4AF37, // Dourado padrão
    this.isDark = true,
    this.appName,
    List<String>? serviceTypes,
  }) : serviceTypes =
           serviceTypes ??
           [
             'Corte Simples',
             'Corte + Barba',
             'Barba',
             'Corte Degradê',
             'Corte Infantil',
             'Pigmentação',
             'Hidratação',
           ];

  SettingsModel copyWith({
    String? userId,
    String? logoPath,
    int? primaryColorValue,
    List<String>? serviceTypes,
    bool? isDark,
    String? appName,
  }) {
    return SettingsModel(
      userId: userId ?? this.userId,
      logoPath: logoPath ?? this.logoPath,
      primaryColorValue: primaryColorValue ?? this.primaryColorValue,
      serviceTypes: serviceTypes ?? this.serviceTypes,
      isDark: isDark ?? this.isDark,
      appName: appName ?? this.appName,
    );
  }
}
