import request from '@/utils/request'

// ======== E2E 测试 ========
export function runE2e(data) {
  return request({ url: '/workflow/lobster/e2e/run', method: 'post', data })
}

export function getE2eReport(runId) {
  return request({ url: `/workflow/lobster/e2e/report/${runId}`, method: 'get' })
}

export function listE2eRuns(params) {
  return request({ url: '/workflow/lobster/e2e/list', method: 'get', params })
}

export function stepNext(instanceId, data) {
  return request({ url: `/workflow/lobster-exec/step-next/${instanceId}`, method: 'post', data })
}

export function multiTurn(data) {
  return request({ url: '/workflow/lobster/chat/multi-turn', method: 'post', data })
}

// ======== 测试场景剧本 ========
export function listScenarios(params) {
  return request({ url: '/workflow/lobster/scenario/list', method: 'get', params })
}

export function getScenario(id) {
  return request({ url: `/workflow/lobster/scenario/${id}`, method: 'get' })
}

export function saveScenario(data) {
  return request({ url: '/workflow/lobster/scenario/save', method: 'post', data })
}

export function deleteScenario(id) {
  return request({ url: `/workflow/lobster/scenario/${id}`, method: 'delete' })
}

export function runScenarioNow(id) {
  return request({ url: `/workflow/lobster/scenario/${id}/run`, method: 'post' })
}

export function runAllScenarios() {
  return request({ url: '/workflow/lobster/scenario/run-all', method: 'post' })
}

// ======== 动态节点学习产物审批 ========
export function listDynamicImpls(status) {
  return request({ url: '/workflow/lobster/dynamic-impl/list', method: 'get', params: { status } })
}
export function approveDynamicImpl(id) {
  return request({ url: `/workflow/lobster/dynamic-impl/${id}/approve`, method: 'post' })
}
export function rejectDynamicImpl(id, reason) {
  return request({ url: `/workflow/lobster/dynamic-impl/${id}/reject`, method: 'post', params: { reason } })
}
