/**
 * Well-known keys for the `settings` table (key/value business config).
 * Anything a user should be able to change without a redeploy lives in the DB
 * under one of these keys — not as a literal in code. Add keys here to document
 * and type them; the values are always read from the database at runtime.
 */
export const SettingKey = {
  // Localisation
  CURRENCY: 'currency', // e.g. "HKD"
  CURRENCY_SYMBOL: 'currency.symbol', // e.g. "HK$"
  TIMEZONE: 'timezone', // e.g. "Asia/Hong_Kong"
  LOCALE_DEFAULT: 'locale.default', // "en" | "zh-HK"

  // Invoicing / billing cycle
  INVOICE_ISSUE_DAY: 'invoice.issue_day_of_month', // day the monthly run drafts
  INVOICE_DUE_DAY: 'invoice.due_day_of_month', // default due day
  INVOICE_FIRST_DUE_OFFSET_DAYS: 'invoice.first_due_offset_days',
  INVOICE_AUTO_ISSUE: 'invoice.auto_issue', // false => draft for human review

  // Deposits
  DEPOSIT_DEFAULT_MONTHS: 'deposit.default_months',

  // Late interest (defaults; per-lease/per-org policies override)
  INTEREST_DEFAULT_POLICY_CODE: 'interest.default_policy_code',

  // Company identity used on PDFs / emails (falls back to organization record)
  BRAND_NAME: 'brand.name',
  BRAND_LOGO_MEDIA_ID: 'brand.logo_media_id',
} as const;

export type SettingKey = (typeof SettingKey)[keyof typeof SettingKey];
