(function () {
    "use strict";

    angular.module('pos').factory('parametroService', factory);
    factory.$inject = ['$http', '$q'];

    function factory($http, $q) {

        var _getToken = function () {
            var deferred = $q.defer();
            $http.post('/parametro/gettoken')
                .success(function (data) { deferred.resolve(data); })
                .error(function (data, status, headers, config) { deferred.reject(data); });
            return deferred.promise;
        };
        var _getParametrosCadastroCompleto = function (token) {
            var deferred = $q.defer();
            var args = { token: token };
            $http.post('/parametro/GetParametrosCadastroCompleto', args)
                .success(function (data) { deferred.resolve(data); })
                .error(function (data, status, headers, config) { deferred.reject(data); });
            return deferred.promise;
        };

        return {
            getToken: _getToken,
            getParametrosCadastroCompleto: _getParametrosCadastroCompleto,
        };
    }

})();