export type ProjectMode = 'EINSATZ' | 'UEBUNG'

export interface Project {
  id: string
  title: string
  mode?: ProjectMode
  exerciseEvaluation?: string | null
  location?: string
  description?: string
  einsatzleiter?: string
  journalfuehrer?: string
  mapCenter: { lng: number; lat: number }
  mapZoom: number
  isLocked: boolean
  featuresVersion?: number
  editingById?: string | null
  editingUserName?: string | null
  editingStartedAt?: string | null
  planImageKey?: string | null
  planBounds?: { north: number; south: number; east: number; west: number } | null
  createdAt: string
  updatedAt: string
}

export interface DrawFeature {
  id: string
  type: string
  geometry: {
    type: string
    coordinates: number[] | number[][] | number[][][]
  }
  properties: Record<string, any>
}

// Mapbox Feature Types
export type Feature = {
  id?: string | number
  type: 'Feature'
  geometry: {
    type: string
    coordinates: any
  }
  properties: Record<string, any>
}

export type DrawMode = 
  | 'select'
  | 'point'
  | 'linestring'
  | 'polygon'
  | 'rectangle'
  | 'circle'
  | 'freehand'
  | 'text'
  | 'arrow'
  | 'measure'
  | 'dangerzone'
  | 'eraser'

export interface JournalEntry {
  id: string
  type: 'TEXT' | 'IMAGE' | 'AUDIO' | 'SOMA' | 'DANGER'
  content?: string
  timestamp: string
  userId?: string
  userName?: string
  userRole?: string
  isDone?: boolean
  fileUrl?: string
  fileKey?: string
  somaTemplateId?: string
  somaChecked?: boolean
  isCorrected?: boolean
  correctionOfId?: string
}
