const deviceFieldMap = {
  device_name: "name",
  device_hard_id: "device_id",
  device_ip: "ip",
  ip_address: "ip",
  mac_address: "mac",
  device_mac: "mac",
  core_version: "firmware_core_version",
  type: "device_type",
};

export function unifyDeviceFields(device) {
  const normalized = {};

  for (const [field, value] of Object.entries(device || {})) {
    normalized[deviceFieldMap[field] || field] = value;
  }

  return normalized;
}
