import 'package:hive_flutter/hive_flutter.dart';

part 'cached_prayer_times.g.dart';

/// Cached prayer times for a specific location + date.
@HiveType(typeId: 5)
class CachedPrayerTimes extends HiveObject {
  @HiveField(0)
  String key; // 'lat_lng_yyyy-MM-dd'

  @HiveField(1)
  double lat;

  @HiveField(2)
  double lng;

  @HiveField(3)
  String date;

  @HiveField(4)
  DateTime fajr;

  @HiveField(5)
  DateTime sunrise;

  @HiveField(6)
  DateTime dhuhr;

  @HiveField(7)
  DateTime asr;

  @HiveField(8)
  DateTime maghrib;

  @HiveField(9)
  DateTime isha;

  CachedPrayerTimes({
    required this.key,
    required this.lat,
    required this.lng,
    required this.date,
    required this.fajr,
    required this.sunrise,
    required this.dhuhr,
    required this.asr,
    required this.maghrib,
    required this.isha,
  });
}
