import { request } from '@/api/_service'

const BASE = 'production_configuration/technology_model/technology_flow/'

function apiParams (method, data = {}) {
  return {
    method: `production_configuration_technology_model_technology_flow_${method}`,
    platform: 'background',
    ...data
  }
}

export function getProcessRoutingList (data) {
  return request({
    url: BASE + 'list',
    method: 'get',
    params: apiParams('list', data)
  })
}

export function createProcessRouting (data) {
  return request({
    url: BASE + 'create',
    method: 'post',
    data: apiParams('create', data)
  })
}

export function editProcessRouting (data) {
  return request({
    url: BASE + 'edit',
    method: 'put',
    data: apiParams('edit', data)
  })
}

export function deleteProcessRouting (data) {
  return request({
    url: BASE + 'delete',
    method: 'delete',
    data: apiParams('delete', data)
  })
}

export function copyProcessRouting (data) {
  return request({
    url: BASE + 'copy',
    method: 'post',
    data: apiParams('copy', data)
  })
}
