 {parseString} = require 'xml2js'
 Config = require('../config').config
 Rest = require('sphere-node-connect').Rest
-OAuth2 = require('sphere-node-connect').OAuth2
 Q = require('q')
 
 # Define XmlImport object

  true

exports.XmlImport.prototype.productType =->
  rest = new Rest Config
  deferred = Q.defer()
  rest.GET "/product-types", (error, response, body)->
    #console.log("PT: %j", body)
    id = JSON.parse(body).results[0].id
    deferred.resolve id
  deferred.promise

exports.XmlImport.prototype.taxCategory =->
  rest = new Rest Config
  deferred = Q.defer()
  rest.GET "/tax-categories", (error, response, body)->
    #console.log("TC: %j", body)
    id = JSON.parse(body).results[0].id
    deferred.resolve id
  deferred.promise

exports.XmlImport.prototype.customerGroup =->
  rest = new Rest Config
  deferred = Q.defer()
  rest.GET "/customer-groups", (error, response, body)->
    id = JSON.parse(body).results[0].id
    #console.log("CG: %j", body)
    deferred.resolve id

  taxCategoryId = 'TODO'
  customerGroupId = 'TODO'

  allIds = Q.all [@productType(), @taxCategory(), @customerGroup()]
  allIds.spread (pId, taxCategoryId, customerGroupId)->
    console.log productTypeId
    console.log taxCategoryId
    console.log customerGroupId

  for k,row of xmljs.row
    v =
