import request from '@/utils/request'

export function getTenantDashboard(companyId) {
  return request({ url: '/api/lobster/admin/dashboard/' + companyId, method: 'get' })
}

export function getEvolutionMetrics(companyId) {
  return request({ url: '/api/lobster/admin/evolution/metrics/' + companyId, method: 'get' })
}

export function triggerScheduler() {
  return request({ url: '/api/lobster/admin/scheduler/trigger', method: 'post' })
}

export function queryPayStatus(orderNo, gateway) {
  return request({ url: '/api/lobster/admin/pay/status', method: 'get', params: { orderNo, gateway } })
}

export function getActiveAbTests(companyId) {
  return request({ url: '/api/lobster/admin/ab-test/active/' + companyId, method: 'get' })
}

export function applyAbTest(companyId, testId) {
  return request({ url: '/api/lobster/admin/ab-test/apply/' + companyId + '/' + testId, method: 'post' })
}

export function triggerLearningCycle(companyId) {
  return request({ url: '/api/lobster/admin/learning/trigger/' + companyId, method: 'post' })
}

export function getLearningResults(companyId) {
  return request({ url: '/api/lobster/admin/learning/results/' + companyId, method: 'get' })
}

export function applyLearningResult(companyId, resultId) {
  return request({ url: '/api/lobster/admin/learning/apply/' + companyId + '/' + resultId, method: 'post' })
}

export function setOptimizationConfig(companyId, params) {
  return request({ url: '/api/lobster/admin/optimization/config/' + companyId, method: 'post', params })
}
