UNPKG

@experteam-mx/ngx-services

Version:

Angular common services for Experteam apps

51 lines (50 loc) 2.71 kB
import { HttpClient } from '@angular/common/http'; import { Observable } from 'rxjs'; import { Environment } from '../ngx-services.models'; import { ManifestMultipleIn, ManifestMultipleOut, ShipmentEmployeeCustomer, ShipmentCancellationIn, ShipmentCancellationOut, ValidateAccountIn, ValidateAccountOut } from './models/api-shipments.types'; import * as i0 from "@angular/core"; export declare class ApiShipmentsService { private environments; private http; constructor(environments: Environment, http: HttpClient); /** * Retrieves the URL for the shipments API from the environment configurations. * * @return {string} The URL of the shipments API. */ get url(): string; /** * Retrieves the parameter values based on the provided parameter names. * * @param {ValidateAccountIn} body - An object of parameter names for which the values need to be fetched. * @return {Observable<ValidateAccountIn>} An observable that emits the fetched parameter values * @param body */ postValidateAccount(body: ValidateAccountIn): Observable<ValidateAccountOut>; /** * Sends a POST request to the shipments manifest endpoint with the provided body. * * @param body - The request payload of type `ManifestMultipleIn`. * @returns An observable that emits the response data of type `ManifestMultipleOut`. */ postManifestMultiple(body: ManifestMultipleIn): Observable<ManifestMultipleOut>; /** * Validates and obtains the number of shipments allowed by an employee customer * * @param {id} params - The id employee customer * @return {Observable<ShipmentEmployeeCustomer>} An observable containing the shipments allowed by an employee */ getEmployeeCustomer(id: number): Observable<ShipmentEmployeeCustomer>; /** * Cancels a specific shipment by providing its ID and a reason for cancellation. * Sends a PATCH request to update the shipment's cancellation status with the specified reason. * * @param {Object} param0 - The input object containing shipment cancellation details. * @param {string} param0.shipmentId - The unique identifier of the shipment to be canceled. * @param {string} param0.reasonId - The unique identifier of the reason for cancellation. * @return {Observable<ShipmentCancellationOut>} An observable emitting the result of the cancellation operation. */ patchShipmentsCancellation({ shipmentId, reasonId }: ShipmentCancellationIn): Observable<ShipmentCancellationOut>; static ɵfac: i0.ɵɵFactoryDeclaration<ApiShipmentsService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<ApiShipmentsService>; }