import 'package:equatable/equatable.dart';

class TaskReminderConfig extends Equatable {
  final int minutesBefore;
  final String channel; // 'push' o 'email'

  const TaskReminderConfig({
    required this.minutesBefore,
    required this.channel,
  });

  String get friendlyTime {
    if (minutesBefore < 60) return '$minutesBefore minuti prima';
    if (minutesBefore == 60) return '1 ora prima';
    if (minutesBefore < 1440) return '${minutesBefore ~/ 60} ore prima';
    if (minutesBefore == 1440) return '1 giorno prima';
    return '${minutesBefore ~/ 1440} giorni prima';
  }

  @override
  List<Object?> get props => [minutesBefore, channel];
}
