export const ReminderType = {
  LEASE_EXPIRY: 'LEASE_EXPIRY',
  BREAK_OPTION: 'BREAK_OPTION',
  RENT_REVIEW: 'RENT_REVIEW',
  INSPECTION: 'INSPECTION',
  INSURANCE_RENEWAL: 'INSURANCE_RENEWAL',
  MAINTENANCE: 'MAINTENANCE',
  SCHATTENMARKT_RELEASE: 'SCHATTENMARKT_RELEASE',
  CUSTOM: 'CUSTOM',
} as const
export type ReminderType = typeof ReminderType[keyof typeof ReminderType]

export const ReminderPriority = {
  URGENT: 'URGENT',     // ≤14 days
  HIGH: 'HIGH',         // 15–30 days
  MEDIUM: 'MEDIUM',     // 31–60 days
  LOW: 'LOW',           // >60 days
} as const
export type ReminderPriority = typeof ReminderPriority[keyof typeof ReminderPriority]

export const ReminderStatus = {
  ACTIVE: 'ACTIVE',
  SNOOZED: 'SNOOZED',
  COMPLETED: 'COMPLETED',
  DISMISSED: 'DISMISSED',
} as const
export type ReminderStatus = typeof ReminderStatus[keyof typeof ReminderStatus]

export const ShadowMarketRisk = {
  NONE: 'NONE',
  LOW: 'LOW',
  MEDIUM: 'MEDIUM',
  HIGH: 'HIGH',
} as const
export type ShadowMarketRisk = typeof ShadowMarketRisk[keyof typeof ShadowMarketRisk]

export interface ReminderActivity {
  at: string        // ISO date
  by: string        // user display name
  action: 'CREATED' | 'SNOOZED' | 'COMPLETED' | 'DISMISSED' | 'NOTED'
  note?: string
}

export interface Reminder {
  id: string
  type: ReminderType
  priority: ReminderPriority
  status: ReminderStatus

  propertyId: string
  propertyTitle: string
  propertyCity: string
  propertyDistrict?: string
  tenantName: string

  dueDate: string           // ISO date — when action must be taken
  eventDate: string         // ISO date — contract event date (expiry / review / etc.)
  contractEndDate?: string  // ISO date — lease end
  breakOptionDate?: string  // ISO date

  areaSqm: number
  currentRentPerSqm: number
  currency: 'CHF'

  shadowMarketRisk: ShadowMarketRisk
  schattenmarktEnabled: boolean

  note?: string
  snoozedUntil?: string     // ISO date

  activity: ReminderActivity[]

  organizationId: string
  createdAt: string
  updatedAt: string
}
