syntax = "proto3";

option java_package = "com.applemand.zmanim.core.settings.proto";
option java_multiple_files = true;

message Location {
  int64 id = 1;
  string name_en = 2;
  string name_he = 3;
  double lat = 4;
  double lng = 5;
  string tzid = 6;
  string country = 7;
  string admin = 8;
  double elevation_m = 9;
  bool is_favorite = 10;
}

message HolidayFilters {
  bool yom_tov = 1;
  bool fast = 2;
  bool minor = 3;
  bool rosh_chodesh = 4;
}

message NotificationWindows {
  bool daily_summary_enabled = 1;
  int32 daily_summary_hour = 2;
  int32 daily_summary_minute = 3;
  bool candle_lighting_enabled = 4;
  int32 candle_lighting_lead_min = 5;
  bool havdalah_enabled = 6;
  bool fast_start_enabled = 7;
  bool fast_end_enabled = 8;
  bool rosh_chodesh_enabled = 9;
  bool daf_yomi_enabled = 10;
  int32 daf_yomi_hour = 11;
  int32 daf_yomi_minute = 12;
}

enum Language {
  LANGUAGE_SYSTEM = 0;
  LANGUAGE_ENGLISH = 1;
  LANGUAGE_HEBREW = 2;
}

enum TempUnit {
  TEMP_FAHRENHEIT = 0;
  TEMP_CELSIUS = 1;
}

enum ThemeMode {
  THEME_SYSTEM = 0;
  THEME_LIGHT = 1;
  THEME_DARK = 2;
}

message UserSettings {
  Location current_location = 1;
  Language ui_language = 2;
  TempUnit temp_unit = 3;
  reserved 4;
  reserved "show_weather";
  bool show_zmanim = 5;
  bool show_zmanim_seconds = 6;
  map<string, bool> zmanim_visible = 7;
  int32 candle_lighting_minutes = 8;
  int32 havdalah_minutes = 9;
  bool show_status_bar = 10;
  bool show_daf_yomi = 11;
  bool enable_notifications = 12;
  bool auto_sync_location = 13;
  HolidayFilters holiday_filters = 14;
  int32 sync_zmanim_days = 15;
  ThemeMode theme_mode = 16;
  bool use_dynamic_color = 17;
  bool first_day_sunday = 18;
  NotificationWindows notif_windows = 19;
  bool in_israel = 20;
  bool twelve_hour_clock = 21;
  int64 schema_version = 22;
  // When true, sunrise/sunset/candle-lighting calculations use the location's
  // elevation above sea level instead of the sea-level horizon. This matches
  // visible-horizon minhagim (common in Israel / Chabad). Default off for
  // conservatism — many diaspora calendars publish sea-level times.
  bool use_elevation_for_zmanim = 23;
}
