export type ApiLinks = {
  first?: string | null
  last?: string | null
  prev?: string | null
  next?: string | null
}

export type ApiMeta = {
  current_page?: number
  last_page?: number
  per_page?: number
  total?: number
}

export type ApiListResponse<T> = {
  data: T[]
  meta?: ApiMeta
  links?: ApiLinks
}

export type ApiItemResponse<T> = {
  data: T
}

export type PaginatedResult<T> = {
  items: T[]
  meta: {
    currentPage: number
    lastPage: number
    perPage: number
    total: number
  }
  links: ApiLinks
}

export type AuthUser = {
  id: number | string
  name: string
  email: string
  roles: string[]
  permissions: string[]
}

export type AdminUserRecord = {
  id: number | string
  name: string
  email: string
  role: string
  roles: string[]
  status: 'active' | 'inactive' | 'invited'
  createdAt: string | null
  updatedAt: string | null
}

export type AdminRoleRecord = {
  id: number | string
  name: string
  permissions: string[]
  permissionCount: number
  isSystem: boolean
}

export type PermissionGroup = {
  group: string
  permissions: string[]
}

export type AdminCategoryRecord = {
  id: number | string
  name: string
  slug: string
  description: string
  image: string | null
  icon: string | null
  isActive: boolean
  sortOrder: number
  metaTitle: string | null
  metaDescription: string | null
}

export type AdminCourseRecord = {
  id: number | string
  categoryId: number | string | null
  categoryName: string
  categorySlug: string
  slug: string
  title: string
  sub: string | null
  description: string
  longDescription: string
  duration: string
  students: number
  rating: number
  badge: string | null
  badgeLabel: string | null
  image: string | null
  price: string | null
  includes: string[]
  requirements: string[]
  metaTitle: string | null
  metaDescription: string | null
  scope: string[]
  standard: string | null
  language: string | null
  location: string | null
}

export type AdminScheduleRecord = {
  id: number | string
  courseId: number | string | null
  courseTitle: string
  startDate: string | null
  endDate: string | null
  location: string
  instructor: string | null
  quota: number
  enrolledCount: number
  availableSeats: number
  priceOverride: number | null
  status: string
  notes: string | null
}

export type AdminAnnouncementRecord = {
  id: number | string
  slug: string
  title: string
  category: string
  excerpt: string
  content: string
  image: string | null
  isFeatured: boolean
  metaTitle: string | null
  metaDescription: string | null
  publishedAt: string | null
  createdAt: string | null
  updatedAt: string | null
}

export type AdminHeroSlideRecord = {
  id: number | string
  title: string
  subtitle: string | null
  label: string | null
  description: string | null
  buttonText: string | null
  buttonUrl: string | null
  mediaType: 'image' | 'video'
  image: string | null
  mobileImage: string | null
  videoUrl: string | null
  mobileVideoUrl: string | null
  orderIndex: number
  isActive: boolean
  createdAt: string | null
  updatedAt: string | null
}

export type AdminLeadRecord = {
  id: number | string
  name: string
  phone: string
  email: string | null
  source: string | null
  status: string
  targetCourse: string | null
  educationLevel: string | null
  subject: string | null
  message: string | null
  utmSource: string | null
  utmMedium: string | null
  utmCampaign: string | null
  kvkkConsent: boolean
  marketingConsent: boolean
  isRead: boolean
  adminNote: string | null
  createdAt: string | null
  updatedAt: string | null
}

export type AdminMenuRecord = {
  id: number | string
  label: string
  url: string
  location: string
  type: string
  parentId: number | string | null
  orderIndex: number
  isActive: boolean
  children: AdminMenuRecord[]
  createdAt: string | null
  updatedAt: string | null
}

export type AdminCommentRecord = {
  id: number | string
  commentableType: string
  commentableId: number | string
  authorName: string
  content: string
  rating: number | null
  isApproved: boolean
  adminReply: string | null
  createdAt: string | null
  updatedAt: string | null
}

export type AdminFaqRecord = {
  id: number | string
  question: string
  answer: string
  category: string
  orderIndex: number
  isActive: boolean
  createdAt: string | null
  updatedAt: string | null
}

export type AdminGuideCardRecord = {
  id: number | string
  title: string
  description: string
  icon: string
  orderIndex: number
  isActive: boolean
  createdAt: string | null
  updatedAt: string | null
}

export type AdminSettingRecord = {
  id: number | string
  key: string
  value: string | null
  group: string
  type: string
  label: string | null
  orderIndex: number
}

export type AdminPageRecord = {
  id: number | string
  slug: string
  title: string
  content: string | null
  metaTitle: string | null
  metaDescription: string | null
  isActive: boolean
  blocks: AdminPageBlockRecord[]
  createdAt: string | null
  updatedAt: string | null
}

export type AdminPageBlockRecord = {
  id: number | string
  type: string
  content: Record<string, unknown> | null
  orderIndex: number
}

export type AdminStoryRecord = {
  id: number | string
  title: string
  badge: string | null
  content: string
  image: string | null
  ctaText: string | null
  ctaUrl: string | null
  orderIndex: number
  isActive: boolean
  createdAt: string | null
  updatedAt: string | null
}
