UNPKG

@experteam-mx/ngx-services

Version:

Angular common services for Experteam apps

210 lines (209 loc) 12.5 kB
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, OperationAccountPaymentIn, OperationAccountPaymentOut, OperationCancelBillingIn, OperationCancelBillingOut, OperationDocumentIn, OperationDocumentOut, OperationPrintDocumentOut, OperationShipmentExternalIn, OperationShipmentExternalOut, PaymentTypeFieldAccountIn, PaymentTypeFieldAccountOut, PaymentTypeFieldAccountsOut, PaymentTypeFieldCardTypeIn, PaymentTypeFieldCardTypeOut, PaymentTypeFieldCardTypesOut, PaymentTypesOut, 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<{}>; /** * 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>; static ɵfac: i0.ɵɵFactoryDeclaration<ApiInvoicesService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<ApiInvoicesService>; }