service.js 1.24 KB
angular.module('focaModalDetalleHojaRuta')
    .service('focaModalDetalleHojaRutaService', [
        '$http',
        'API_ENDPOINT',
        function($http, API_ENDPOINT) {
            return {
                getDetallesHojaRuta: function() {
                    return $http.get(API_ENDPOINT.URL + '/transportista');
                },
                getCisternasByIdRemito: function(idRemito) {
                    return $http.get(API_ENDPOINT.URL + '/cisternas/obtener/remito/' + idRemito);
                },
                getRemitoById: function(idRemito) {
                    return $http.get(API_ENDPOINT.URL + '/remito/obtener/' + idRemito + '/punto');
                },
                postMovimientoHojaRuta: function(datos) {
                    return $http.post(API_ENDPOINT.URL + '/hoja-ruta/movimiento', datos);
                },
                rechazarRemito: function(remito) {
                    return $http.post(API_ENDPOINT.URL + '/remito/update', {remito: remito});
                },
                updatePuntoDescarga: function(puntoDescarga) {
                    return $http.post(API_ENDPOINT.URL + '/punto-descarga',
                        {puntoDescarga: puntoDescarga});
                }
            };
        }
    ]);