@experteam-mx/ngx-services
Version:
Angular common services for Experteam apps
281 lines (280 loc) • 16.3 kB
TypeScript
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
import { Environment } from '../ngx-services.models';
import { CancelPaymentReceiptIn, CountryPaymentTypeFieldIn, CountryPaymentTypeFieldOut, CountryPaymentTypeFieldsOut, CountryPaymentTypeIn, CountryPaymentTypeOut, CountryPaymentTypesOut, CustomerDocumentTypesOut, CustomersOut, CustomerTypesOut, DocumentStatusesOut, GetDocumentsOut, OperationAccountPaymentIn, OperationAccountPaymentOut, OperationCancelBillingIn, OperationCancelBillingOut, OperationDocumentIn, OperationDocumentOut, OperationDocumentRequestsOut, OperationPrintDocumentOut, OperationPrintXmlOut, OperationShipmentExternalIn, OperationShipmentExternalOut, PaymentTypeFieldAccountIn, PaymentTypeFieldAccountOut, PaymentTypeFieldAccountsOut, PaymentTypeFieldCardTypeIn, PaymentTypeFieldCardTypeOut, PaymentTypeFieldCardTypesOut, PaymentTypesOut, PrintCollectionReceiptOut, ToleranceIn, ToleranceOut, TolerancesOut } 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<{}>;
/**
* Sends a POST request to cancel billing for a specific operation.
*
* @param {Object} params - The parameters for the cancellation request.
* @param {string} params.invoiceId - The ID of the invoice to be canceled.
* @param {Object} params.body - Additional data to be sent in the request body.
* @return {Observable<OperationCancelBillingOut>} An observable emitting the result of the cancellation operation.
*/
postOperationCancelBilling({ invoiceId, ...body }: OperationCancelBillingIn): Observable<OperationCancelBillingOut>;
/**
* 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>;
/**
* Fetches all country payment types.
*
* @param {QueryParams} params - Query parameters to filter or customize the request.
* @return {Observable<CountryPaymentTypesOut>} An observable emitting the country payment types fetched from the server.
*/
getCountryPaymentTypes(params: QueryParams): Observable<CountryPaymentTypesOut>;
/**
* Updates an existing country payment type.
*
* @param {number} id - The ID of the country payment type to update.
* @param {CountryPaymentTypeIn} body - The updated data for the country payment type.
* @returns {Observable<CountryPaymentTypeOut>} An observable that emits the result of the update operation.
*/
putCountryPaymentType(id: number, body: CountryPaymentTypeIn): Observable<CountryPaymentTypeOut>;
/**
* Delete an existing country payment type.
*
* @param {number} id - The unique identifier of the country payment type to be deleted.
* @returns {Observable<CountryPaymentTypeOut>} An observable that emits the result of the delete operation.
*/
deleteCountryPaymentType(id: number): Observable<CountryPaymentTypeOut>;
/**
* Create a new country payment type resource.
*
* @param {CountryPaymentTypeIn} body - The input parameters required for create a new country payment type.
* @return {Observable<CountryPaymentTypeOut>} An observable that emits the result of create operation.
*/
postCountryPaymentType(body: CountryPaymentTypeIn): Observable<CountryPaymentTypeOut>;
/**
* Retrieves and returns a country payment type for a given ID.
*
* @param {number} id - The ID of the country payment type.
* @return {Observable<CountryPaymentTypeOut>} An observable that emits the result of show operation.
*/
getCountryPaymentType(id: number): Observable<CountryPaymentTypeOut>;
/**
* Fetches all country payment type fields.
*
* @param {QueryParams} params - Query parameters to filter or customize the request.
* @return {Observable<CountryPaymentTypeFieldsOut>} An observable emitting the country payment type fields fetched from the server.
*/
getCountryPaymentTypeFields(params: QueryParams): Observable<CountryPaymentTypeFieldsOut>;
/**
* Create a new country payment type field resource.
*
* @param {CountryPaymentTypeFieldIn} body - The input parameters required for create a new country payment type field.
* @return {Observable<CountryPaymentTypeFieldOut>} An observable that emits the result of create operation.
*/
postCountryPaymentTypeField(body: CountryPaymentTypeFieldIn): Observable<CountryPaymentTypeFieldOut>;
/**
* Updates an existing country payment type field.
*
* @param {number} id - The ID of the country payment type field to update.
* @param {CountryPaymentTypeFieldIn} body - The updated data for the country payment type field.
* @returns {Observable<CountryPaymentTypeFieldOut>} An observable that emits the result of the update operation.
*/
putCountryPaymentTypeField(id: number, body: CountryPaymentTypeFieldIn): Observable<CountryPaymentTypeFieldOut>;
/**
* Fetches all payment types.
*
* @param {QueryParams} params - Query parameters to filter or customize the request.
* @return {Observable<PaymentTypesOut>} An observable emitting the payment types fetched from the server.
*/
getPaymentTypes(params: QueryParams): Observable<PaymentTypesOut>;
/**
* Fetches all payment type fields card.
*
* @param {QueryParams} params - Query parameters to filter or customize the request.
* @return {Observable<PaymentTypeFieldCardTypesOut>} An observable emitting the payment type fields card fetched from the server.
*/
getPaymentTypeFieldCardTypes(params: QueryParams): Observable<PaymentTypeFieldCardTypesOut>;
/**
* Create a new payment type field card resource.
*
* @param {PaymentTypeFieldCardTypeIn} body - The input parameters required for create a new payment type field card.
* @return {Observable<PaymentTypeFieldCardTypeOut>} An observable that emits the result of create operation.
*/
postCountryPaymentTypeFieldCardType(body: PaymentTypeFieldCardTypeIn): Observable<PaymentTypeFieldCardTypeOut>;
/**
* Updates an existing payment type field card.
*
* @param {number} id - The ID of the payment type field card to update.
* @param {PaymentTypeFieldCardTypeIn} body - The updated data for the payment type field card.
* @returns {Observable<PaymentTypeFieldCardTypeOut>} An observable that emits the result of the update operation.
*/
putCountryPaymentTypeFieldCardType(id: number, body: PaymentTypeFieldCardTypeIn): Observable<PaymentTypeFieldCardTypeOut>;
/**
* Fetches all payment type fields accounts.
*
* @param {QueryParams} params - Query parameters to filter or customize the request.
* @return {Observable<PaymentTypeFieldAccountsOut>} An observable emitting the payment type fields accounts fetched from the server.
*/
getPaymentTypeFieldAccounts(params: QueryParams): Observable<PaymentTypeFieldAccountsOut>;
/**
* Create a new payment type field account resource.
*
* @param {PaymentTypeFieldAccountIn} body - The input parameters required for create a new payment type field account.
* @return {Observable<PaymentTypeFieldAccountOut>} An observable that emits the result of create operation.
*/
postCountryPaymentTypeFieldAccount(body: PaymentTypeFieldAccountIn): Observable<PaymentTypeFieldAccountOut>;
/**
* Updates an existing payment type field account.
*
* @param {number} id - The ID of the payment type field account to update.
* @param {PaymentTypeFieldAccountIn} body - The updated data for the payment type field account.
* @returns {Observable<PaymentTypeFieldAccountOut>} An observable that emits the result of the update operation.
*/
putCountryPaymentTypeFieldAccount(id: number, body: PaymentTypeFieldAccountIn): Observable<PaymentTypeFieldAccountOut>;
/**
* Fetches tolerance data from the server based on the provided query parameters.
*
* @param {QueryParams} params - The parameters to use for querying tolerances.
* @return {Observable<TolerancesOut>} An observable emitting the tolerance data.
*/
getTolerances(params: QueryParams): Observable<TolerancesOut>;
/**
* Retrieves the tolerance detail for a given identifier.
*
* @param {number} id - The unique identifier for the tolerance to retrieve.
* @return {Observable<ToleranceOut>} An observable containing the tolerance data.
*/
getTolerance(id: number): Observable<ToleranceOut>;
/**
* Sends a request to update or create a tolerance record using the provided data.
*
* @param {ToleranceIn} body - The tolerance input object containing the data to be sent in the request.
* @return {Observable<ToleranceOut>} An observable that emits the updated or created tolerance output object.
*/
postTolerance(body: ToleranceIn): Observable<ToleranceOut>;
/**
* Updates the tolerance with the specified ID using the provided data.
*
* @param {number} id - The unique identifier of the tolerance to update.
* @param {ToleranceIn} body - The data to update the tolerance with.
* @return {Observable<ToleranceOut>} An observable containing the updated tolerance information.
*/
putTolerance(id: number, body: ToleranceIn): Observable<ToleranceOut>;
/**
* Deletes the tolerance entry corresponding to the given ID.
*
* @param {number} id - The unique identifier of the tolerance to be deleted.
* @return {Observable<{}>} An Observable that emits the result of the delete operation.
*/
deleteTolerance(id: number): Observable<{}>;
/**
* Retrieves the document requests associated with a document ID.
*
* @param id - The unique identifier for the document.
* @returns An observable that emits the document requests data.
*/
getOperationDocumentRequests(id: number): Observable<OperationDocumentRequestsOut>;
/**
* Retrieves a list of documents based on the provided query parameters.
*
* @param params - The query parameters to filter and paginate the documents
* @returns An Observable that emits the documents data when the HTTP request completes
*/
getDocuments(params: QueryParams): Observable<GetDocumentsOut>;
/**
* Fetches document status values from the API.
*
* Sends an HTTP GET request to the service's `/document-status` endpoint using the supplied query parameters
* and returns the decoded `data` payload from the API success envelope.
*
* @param params - Query parameters to apply to the request (e.g. filtering, pagination, search).
* @returns An Observable that emits a DocumentStatusesOut object containing the document status data.
*/
getDocumentStatuses(params: QueryParams): Observable<DocumentStatusesOut>;
/**
* Retrieves the XML print representation for a given operation (invoice).
*
* Sends an HTTP GET request to the backend endpoint `/operation/print/xml/{documentId}` and
* unwraps the `data` field from the API success response before emitting it.
*
* @param documentId - The numeric identifier of the document to fetch.
* @returns An Observable that emits the OperationPrintXmlOut payload on success and completes.
* The Observable will error if the HTTP request fails or the response does not contain the expected data.
*/
getOperationPrintXml(documentId: number): Observable<OperationPrintXmlOut>;
static ɵfac: i0.ɵɵFactoryDeclaration<ApiInvoicesService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<ApiInvoicesService>;
}