import { defineStore } from 'pinia'
import { ref } from 'vue'
import type { WipeProfile, WipeSchedule, WipeHistory } from '@/types'

export const useWipeStore = defineStore('wipe', () => {
  const profiles = ref<WipeProfile[]>([])
  const schedules = ref<WipeSchedule[]>([])
  const history = ref<WipeHistory[]>([])
  const isLoading = ref(false)

  async function fetchProfiles() {
    // TODO: GET /api/profiles
  }

  async function fetchSchedules() {
    // TODO: GET /api/schedules
  }

  async function fetchHistory() {
    // TODO: GET /api/wipes/history
  }

  async function triggerWipe(_wipeType: string, _profileId: string) {
    // TODO: POST /api/wipes/:server_id/trigger
  }

  async function triggerDryRun(_wipeType: string, _profileId: string) {
    // TODO: POST /api/wipes/:server_id/dry-run
  }

  return {
    profiles,
    schedules,
    history,
    isLoading,
    fetchProfiles,
    fetchSchedules,
    fetchHistory,
    triggerWipe,
    triggerDryRun,
  }
})
