import 'package:freezed_annotation/freezed_annotation.dart';
part 'preferences.freezed.dart';
part 'preferences.g.dart';

@freezed
abstract class Preferences with _$Preferences {
  const factory Preferences({
    /// Scores keyed by preference type (e.g. 'sightseeing', 'shopping', 'nature')
    required Map<String, int> scores,

    /// Maximum trip duration in minutes
    required int maxTimeMinutes,

    /// Required start location [lat, lon]
    required List<double> startLocation,

    /// Optional end location
    List<double>? endLocation,

    /// Optional detour tolerance in minutes
    int? detourToleranceMinutes,
  }) = _Preferences;

  factory Preferences.fromJson(Map<String, Object?> json) => _$PreferencesFromJson(json);
}
