@experteam-mx/ngx-services
Version:
Angular common services for Experteam apps
99 lines (98 loc) • 5.82 kB
TypeScript
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
import { Environment } from '../ngx-services.models';
import { CancelPaymentReceiptIn, CustomerDocumentTypesOut, CustomersOut, CustomerTypesOut, OperationAccountPaymentIn, OperationAccountPaymentOut, OperationCancelBillingIn, OperationDocumentIn, OperationDocumentOut, OperationPrintDocumentOut, OperationShipmentExternalIn, OperationShipmentExternalOut, PrintCollectionReceiptOut } from './models/api-invoices.types';
import { QueryParams } from './models/api.models';
import * as i0 from "@angular/core";
export declare class ApiInvoicesService {
private environments;
private http;
constructor(environments: Environment, http: HttpClient);
/**
* Retrieves the API URL for invoices from the environments configuration.
*
* @return {string} The API URL for invoices.
*/
get url(): string;
/**
* Sends an operation document to the server and processes the response.
*
* @param {OperationDocumentIn} body - The input data for the operation document.
* @return {Observable<OperationDocumentOut>} An observable containing the processed operation document output.
*/
postOperationDocument(body: OperationDocumentIn): Observable<OperationDocumentOut>;
/**
* Fetches and returns the collection receipt data for a given collection ID.
*
* @param {number} id - The unique identifier of the collection for which the receipt needs to be retrieved.
* @return {Observable<PrintCollectionReceiptOut>} An observable containing the collection receipt data.
*/
getPrintCollectionReceipt(id: number): Observable<PrintCollectionReceiptOut>;
/**
* Handles the account payment operation by sending a POST request to the specified endpoint.
* Processes the response and returns the operation data.
*
* @param {OperationAccountPaymentIn} body The payload containing information for the account payment operation.
* @return {Observable<OperationAccountPaymentOut>} An observable emitting the processed account payment operation data.
*/
postOperationAccountPayment(body: OperationAccountPaymentIn): Observable<OperationAccountPaymentOut>;
/**
* Cancels a payment receipt based on the provided input.
* This method sends a POST request to cancel a document.
*
* @param body The data required to cancel the payment receipt, encapsulated in a CancelPaymentReceiptIn object.
* @return An Observable representing the result of the cancellation. Emits an empty object on success.
*/
postOperationCancelDocument(body: CancelPaymentReceiptIn): Observable<{}>;
/**
* Cancels an invoice based on the provided invoice ID and additional parameters.
*
* @param {Object} parameters - The parameters required to cancel the invoice, encapsulated in a CancelBillingIn object.
* @return {Observable<Object>} An observable that emits the response of the cancellation operation.
*/
postOperationCancelBilling({ invoiceId, ...body }: OperationCancelBillingIn): Observable<{}>;
/**
* Fetches a list of customer types from the server.
*
* @param {QueryParams} params - Query parameters to filter or customize the request.
* @return {Observable<CustomerTypesOut>} An observable emitting the customer types fetched from the server.
*/
getCustomerTypes(params: QueryParams): Observable<CustomerTypesOut>;
/**
* Retrieves document types specific to a given country.
*
* @param {QueryParams} params - The query parameters containing country-specific information.
* @return {Observable<CustomerDocumentTypesOut>} An observable emitting the document types available for the specified country.
*/
getCustomerDocumentTypes(params: QueryParams): Observable<CustomerDocumentTypesOut>;
/**
* Fetches customer invoice details filtered by a custom invoice type.
*
* @param {InvoiceTypeCustomParamsIn} params - An object containing the filter parameters for the custom invoice type.
* @return {Observable<CustomersOut>} An observable containing customer invoice details of the specified type.
*/
getCustomers(params: QueryParams): Observable<CustomersOut>;
/**
* Sends a POST request to create or update an external shipment operation.
*
* @param {OperationShipmentExternalIn} params - The input parameters for the external shipment operation.
* @return {Observable<OperationShipmentExternalOut>} An observable that emits the result of the external shipment operation.
*/
postOperationShipmentExternal(params: OperationShipmentExternalIn): Observable<OperationShipmentExternalOut>;
/**
* Processes an external payment operation for a shipment.
*
* @param {OperationShipmentExternalIn} params - The input parameters required for the external payment operation.
* @return {Observable<OperationShipmentExternalOut>} An observable that emits the result of the external payment operation for a shipment.
*/
postOperationShipmentExternalPayment(params: OperationShipmentExternalIn): Observable<OperationShipmentExternalOut>;
/**
* Retrieves and returns billing operation print details for a given document ID.
*
* @param {number} documentId - The ID of the document for which to fetch the print billing operation details.
* @return {Observable<OperationPrintDocumentOut>} An observable emitting the print billing operation details for the specified document.
*/
getOperationPrintDocument(documentId: number): Observable<OperationPrintDocumentOut>;
static ɵfac: i0.ɵɵFactoryDeclaration<ApiInvoicesService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<ApiInvoicesService>;
}