export type ActivityType = {
  id: string
  name: string
  code: string | null
  created_at: string
  updated_at: string
}

export type CreateActivityTypePayload = {
  name: string
  code?: string | null
}

export type ActivityGalleryImage = {
  id: string
  activity_id: string
  name: string
  description: string | null
  mime_type: string
  file_size: number
  uploaded_by: string
  url: string
  created_at: string
}

export type ActivityDocument = {
  id: string
  activity_id: string
  name: string
  type: string | null
  description: string | null
  mime_type: string
  file_size: number
  uploaded_by: string
  url: string
  created_at: string
}

export type ActivityReport = {
  id: string
  activity_id: string
  report_text: string
  prepared_by: string
  prepared_by_user?: {
    id: string
    name: string
    email: string
  } | null
  created_at: string
  updated_at: string
}

export type ActivityDetail = {
  id: string
  activity_type_id: string
  activity_type: ActivityType | null
  title: string
  reference_number: string | null
  description: string | null
  start_datetime: string | null
  end_datetime: string | null
  organizer: string | null
  location: string | null
  is_active: boolean
  documents: ActivityDocument[]
  gallery_images: ActivityGalleryImage[]
  reports: ActivityReport[]
  created_at: string
  updated_at: string
}

export type ActivityListItem = {
  id: string
  activity_type_id: string
  activity_type: ActivityType | null
  title: string
  reference_number: string | null
  description: string | null
  start_datetime: string | null
  end_datetime: string | null
  organizer: string | null
  location: string | null
  is_active: boolean
  gallery_image_count: number
  documents_count: number
  cover_image: ActivityGalleryImage | null
  created_at: string
  updated_at: string
}

export type ListActivitiesParams = {
  page?: number
  per_page?: number
  search?: string
  sort_by?: string
  sort_order?: 'asc' | 'desc'
}

export type UpdateActivityPayload = {
  activity_type_id: string
  title: string
  reference_number?: string | null
  description?: string | null
  start_datetime?: string | null
  end_datetime?: string | null
  organizer?: string | null
  location?: string | null
  is_active: boolean
}

export type CreateActivityPayload = UpdateActivityPayload

export type UpdateActivityFiles = {
  documents?: File[]
  gallery?: File[]
}

export type CreateActivityReportPayload = {
  activity_id: string
  report_text: string
}

export type UpdateActivityReportPayload = {
  activity_id: string
  report_text: string
}
