(function () {
    "use strict";

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

    function factory($http, $q) {

        var _get = function (args) {

            var deferred = $q.defer();
            $http.post('/MotorPromocao/ConsultarMotorPedido', args)
                 .success(function (data) {
                     deferred.resolve(data);
                 })
                 .error(function (data, status, headers, config) {
                     deferred.reject(data);
                 });

            return deferred.promise;
        };
        var _Sync = function () {

            var deferred = $q.defer();
            $http.post('/MotorPromocao/Sync')
                 .success(function (data) {
                     deferred.resolve(data);
                 })
                 .error(function (data, status, headers, config) {
                     deferred.reject(data);
                 });

            return deferred.promise;
        };
        return {
            get: _get,
            Sync: _Sync
        };
    };



})();