import service from '@/utils/apiService'
const baseUrl = '/api/buildings'

export function getBuilding(id) {
  return service({
    url: `${baseUrl}/${id}`,
    method: 'get'
  })
}

export function getBuildings(params) {
  return service({
    url: `${baseUrl}`,
    method: 'get',
    params
  })
}

export function createBuilding(data) {
  return service({
    url: `${baseUrl}`,
    method: 'post',
    data
  })
}

export function updateBuilding(id, data) {
  return service({
    url: `${baseUrl}/${id}`,
    method: 'put',
    data
  })
}

export function deleteBuilding(id) {
  return service({
    url: `${baseUrl}/${id}`,
    method: 'delete'
  })
}

export function lookupBySection(sectionId) {
  return service({
    url: `${baseUrl}/lookup/by-section/${sectionId}`,
    method: 'get'
  })
}

export function lookupByProject(projectId) {
  return service({
    url: `${baseUrl}/lookup/by-project/${projectId}`,
    method: 'get'
  })
}
