import request from './request'

export function initComplianceRules() {
  return request.post('/compliance/init-rules')
}

export function scanCompliance(projectId?: number) {
  return request.post('/compliance/scan', null, { params: projectId ? { project_id: projectId } : undefined })
}

export function getComplianceIssues(params?: { project_id?: number; status?: string; page?: number; page_size?: number }) {
  return request.get('/compliance/issues', { params })
}

export function resolveIssue(id: number) {
  return request.post(`/compliance/issues/${id}/resolve`)
}
