import {
  mockMachineDepartments,
  mockMachineTypes,
} from '../mock/mockMachineDictionaries'
import type { MachineDictionaryOption } from '../model/types'

function cloneOption(option: MachineDictionaryOption): MachineDictionaryOption {
  return { ...option }
}

export const machineDictionariesService = {
  async getMachineTypes(): Promise<MachineDictionaryOption[]> {
    return mockMachineTypes.map(cloneOption)
  },

  async getMachineDepartments(): Promise<MachineDictionaryOption[]> {
    return mockMachineDepartments.map(cloneOption)
  },
}
