import client from './client'

export function listPolicyGroups() {
  return client.get('/api/v1/policy-group/list')
}

export function getPolicyGroup(groupCode: string) {
  return client.get(`/api/v1/policy-group/${groupCode}`)
}

export function createPolicyGroup(data: any) {
  return client.post('/api/v1/policy-group', data)
}

export function updatePolicyGroup(groupCode: string, data: any) {
  return client.post(`/api/v1/policy-group/${groupCode}`, data)
}

export function updatePolicyGroupStatus(groupCode: string, status: number) {
  return client.post(`/api/v1/policy-group/${groupCode}/status`, { status })
}

export function deletePolicyGroup(groupCode: string) {
  return client.post(`/api/v1/policy-group/${groupCode}/delete`)
}
