import client from './client'

export function createChannelAccount(data: any) {
  return client.post('/api/v1/channel-account', data)
}

export function listChannelAccounts() {
  return client.get('/api/v1/channel-account/list')
}

export function updateChannelAccount(id: number, data: any) {
  return client.put(`/api/v1/channel-account/${id}`, data)
}

export function deleteChannelAccount(id: number) {
  return client.delete(`/api/v1/channel-account/${id}`)
}

export function updateChannelAccountStatus(id: number, data: any) {
  return client.patch(`/api/v1/channel-account/${id}/status`, data)
}

export function getChannelAccountStatus(id: number) {
  return client.get(`/api/v1/channel-account/${id}/status`)
}

export function initChannelAccount(data: any) {
  return client.post('/api/v1/channel-account/init', data)
}

export function syncChannelAccountContacts(id: number) {
  return client.post(`/api/v1/channel-account/${id}/sync-contacts`)
}

export function syncChannelAccountConversations(id: number) {
  return client.post(`/api/v1/channel-account/${id}/sync-conversations`)
}
