@experteam-mx/ngx-services 18.7.29 → 18.7.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@ import { Environment } from '../ngx-services.models';
2
2
  import { HttpClient } from '@angular/common/http';
3
3
  import { Observable } from 'rxjs';
4
4
  import { QueryParams } from './models/api.models';
5
- import { CancellationReasonIn, CancellationReasonOut, CancellationReasonsOut, CountriesOut, CountryIn, CountryOut, CurrenciesOut, ExtraChargeIn, ExtraChargeOut, ExtraChargesOut, GenericFolioIn, GenericFolioOut, GenericFoliosOut, IdentificationTypesOut, LanguagesOut, ManagementAreasOut, OperationTypesOut, PostalLocationsOut, ProductIn, ProductOut, RegionsOut, ShipmentContentTypesOut, ShipmentGroupsOut, ShipmentIncomeTypeIn, ShipmentIncomeTypeOut, ShipmentIncomeTypesOut, ShipmentScopesOut, ShipmentStatusesOut, UniqueFolioIn, UniqueFolioOut, UniqueFoliosOut, UnitsOut, ZonesOut } from './models/api-catalog.types';
5
+ import { CancellationReasonIn, CancellationReasonOut, CancellationReasonsOut, CountriesOut, CountryIn, CountryOut, CurrenciesOut, ExtraChargeIn, ExtraChargeOut, ExtraChargesOut, GenericFolioIn, GenericFolioOut, GenericFoliosOut, IdentificationTypesOut, LanguagesOut, ManagementAreasOut, OperationTypesOut, PostalLocationsOut, ProductIn, ProductOut, QuestionIn, QuestionOut, QuestionsOut, RegionsOut, ShipmentContentTypesOut, ShipmentGroupsOut, ShipmentIncomeTypeIn, ShipmentIncomeTypeOut, ShipmentIncomeTypesOut, ShipmentScopesOut, ShipmentStatusesOut, UniqueFolioIn, UniqueFolioOut, UniqueFoliosOut, UnitsOut, ZonesOut } from './models/api-catalog.types';
6
6
  import * as i0 from "@angular/core";
7
7
  export declare class ApiCatalogsService {
8
8
  private environments;
@@ -268,6 +268,65 @@ export declare class ApiCatalogsService {
268
268
  * @returns An Observable that emits the shipment statuses output.
269
269
  */
270
270
  getShipmentStatuses(params: QueryParams): Observable<ShipmentStatusesOut>;
271
+ /**
272
+ * Fetches questions from the catalogs API.
273
+ *
274
+ * Sends an HTTP GET request to `${this.url}/questions` using the supplied query parameters
275
+ * and returns the unwrapped payload (`data`) from the API response.
276
+ *
277
+ * @param params - Query parameters to include in the request (e.g. paging, filters, sorting).
278
+ * @returns An Observable that emits the QuestionsOut payload (the `data` field from ApiSuccess<QuestionsOut>).
279
+ */
280
+ getQuestions(params: QueryParams): Observable<QuestionsOut>;
281
+ /**
282
+ * Retrieve a single question by its id.
283
+ *
284
+ * Sends an HTTP GET request to the questions endpoint and returns an Observable that emits
285
+ * the QuestionOut payload extracted from the API success envelope.
286
+ *
287
+ * @param id - The numeric identifier of the question to fetch.
288
+ * @returns An Observable that emits the requested QuestionOut. The Observable will error
289
+ * if the HTTP request fails (for example network issues or non-2xx responses).
290
+ */
291
+ getQuestion(id: number): Observable<QuestionOut>;
292
+ /**
293
+ * Sends a POST request to create a new question and returns the created resource.
294
+ *
295
+ * The request payload is sent as an object with a `body` property containing the provided
296
+ * QuestionIn value (i.e. { body: QuestionIn }). On success the HTTP response is expected
297
+ * to follow the ApiSuccess<T> shape; the operator maps that response to the inner `data`
298
+ * object and emits it as a QuestionOut.
299
+ *
300
+ * @param body - The question payload to create (QuestionIn).
301
+ * @returns Observable<QuestionOut> that emits the created question on success.
302
+ */
303
+ postQuestion(body: QuestionIn): Observable<QuestionOut>;
304
+ /**
305
+ * Update a question by its ID.
306
+ *
307
+ * Sends an HTTP PUT to `${this.url}/questions/${id}` with the provided payload.
308
+ * The request body is sent as an object with a `body` property containing the
309
+ * `QuestionIn` data. The server response is expected to be an `ApiSuccess<QuestionOut>`
310
+ * and this method returns an Observable that emits the unwrapped `QuestionOut`.
311
+ *
312
+ * @param id - The identifier of the question to update.
313
+ * @param body - The update payload for the question.
314
+ * @returns An Observable that emits the updated `QuestionOut` on success.
315
+ */
316
+ putQuestion(id: number, body: QuestionIn): Observable<QuestionOut>;
317
+ /**
318
+ * Deletes a question by its ID.
319
+ *
320
+ * Sends an HTTP DELETE request to the backend endpoint `/questions/{id}` and
321
+ * returns an Observable that emits the API response's `data` payload (typically an empty object).
322
+ *
323
+ * The implementation maps an ApiSuccess wrapper to its `data` property before emitting.
324
+ *
325
+ * @param id - The numeric identifier of the question to delete.
326
+ * @returns An Observable that emits the deleted resource payload ({} expected) on success.
327
+ * The Observable will emit an error if the HTTP request fails.
328
+ */
329
+ deleteQuestion(id: number): Observable<{}>;
271
330
  static ɵfac: i0.ɵɵFactoryDeclaration<ApiCatalogsService, never>;
272
331
  static ɵprov: i0.ɵɵInjectableDeclaration<ApiCatalogsService>;
273
332
  }
@@ -1,7 +1,7 @@
1
1
  import { HttpClient } from '@angular/common/http';
2
2
  import { Observable } from 'rxjs';
3
3
  import { Environment } from '../ngx-services.models';
4
- import { CancelPaymentReceiptIn, CountryPaymentTypeFieldIn, CountryPaymentTypeFieldOut, CountryPaymentTypeFieldsOut, CountryPaymentTypeIn, CountryPaymentTypeOut, CountryPaymentTypesOut, CustomerDocumentTypesOut, CustomersOut, CustomerTypesOut, OperationAccountPaymentIn, OperationAccountPaymentOut, OperationCancelBillingIn, OperationCancelBillingOut, OperationDocumentIn, OperationDocumentOut, OperationDocumentRequestsOut, OperationPrintDocumentOut, OperationShipmentExternalIn, OperationShipmentExternalOut, PaymentTypeFieldAccountIn, PaymentTypeFieldAccountOut, PaymentTypeFieldAccountsOut, PaymentTypeFieldCardTypeIn, PaymentTypeFieldCardTypeOut, PaymentTypeFieldCardTypesOut, PaymentTypesOut, PrintCollectionReceiptOut, ToleranceIn, ToleranceOut, TolerancesOut } from './models/api-invoices.types';
4
+ import { CancelPaymentReceiptIn, CountryPaymentTypeFieldIn, CountryPaymentTypeFieldOut, CountryPaymentTypeFieldsOut, CountryPaymentTypeIn, CountryPaymentTypeOut, CountryPaymentTypesOut, CustomerDocumentTypesOut, CustomersOut, CustomerTypesOut, GetDocumentsOut, OperationAccountPaymentIn, OperationAccountPaymentOut, OperationCancelBillingIn, OperationCancelBillingOut, OperationDocumentIn, OperationDocumentOut, OperationDocumentRequestsOut, OperationPrintDocumentOut, OperationShipmentExternalIn, OperationShipmentExternalOut, PaymentTypeFieldAccountIn, PaymentTypeFieldAccountOut, PaymentTypeFieldAccountsOut, PaymentTypeFieldCardTypeIn, PaymentTypeFieldCardTypeOut, PaymentTypeFieldCardTypesOut, PaymentTypesOut, PrintCollectionReceiptOut, ToleranceIn, ToleranceOut, TolerancesOut } from './models/api-invoices.types';
5
5
  import { QueryParams } from './models/api.models';
6
6
  import * as i0 from "@angular/core";
7
7
  export declare class ApiInvoicesService {
@@ -247,6 +247,13 @@ export declare class ApiInvoicesService {
247
247
  * @returns An observable that emits the document requests data.
248
248
  */
249
249
  getOperationDocumentRequests(id: number): Observable<OperationDocumentRequestsOut>;
250
+ /**
251
+ * Retrieves a list of documents based on the provided query parameters.
252
+ *
253
+ * @param params - The query parameters to filter and paginate the documents
254
+ * @returns An Observable that emits the documents data when the HTTP request completes
255
+ */
256
+ getDocuments(params: QueryParams): Observable<GetDocumentsOut>;
250
257
  static ɵfac: i0.ɵɵFactoryDeclaration<ApiInvoicesService, never>;
251
258
  static ɵprov: i0.ɵɵInjectableDeclaration<ApiInvoicesService>;
252
259
  }
@@ -197,3 +197,10 @@ export interface ShipmentStatus extends SymfonyModel {
197
197
  code: string;
198
198
  description: string;
199
199
  }
200
+ export interface Question extends SymfonyModel {
201
+ description: string;
202
+ type: string;
203
+ questionOrder: number;
204
+ countryId: number;
205
+ isRequiredValue: boolean;
206
+ }
@@ -1,4 +1,4 @@
1
- import { CancellationReason, Country, Currency, ExtraCharge, GenericFolio, IdentificationType, Language, ManagementArea, OperationType, PostalLocation, Product, Region, ShipmentContentType, ShipmentGroup, ShipmentIncomeType, ShipmentScope, ShipmentStatus, UniqueFolio, Unit, Zone } from './api-catalog.interfaces';
1
+ import { CancellationReason, Country, Currency, ExtraCharge, GenericFolio, IdentificationType, Language, ManagementArea, OperationType, PostalLocation, Product, Question, Region, ShipmentContentType, ShipmentGroup, ShipmentIncomeType, ShipmentScope, ShipmentStatus, UniqueFolio, Unit, Zone } from './api-catalog.interfaces';
2
2
  export type OperationTypesOut = {
3
3
  total: number;
4
4
  operationTypes: OperationType[];
@@ -163,3 +163,18 @@ export type ShipmentStatusesOut = {
163
163
  shipmentStatuses: ShipmentStatus[];
164
164
  total: number;
165
165
  };
166
+ export type QuestionsOut = {
167
+ questions: Question[];
168
+ total: number;
169
+ };
170
+ export type QuestionOut = {
171
+ question: Question;
172
+ };
173
+ export type QuestionIn = {
174
+ description: string;
175
+ type: 'marketing';
176
+ questionOrder: number;
177
+ isActive: boolean;
178
+ countryId: number;
179
+ isRequiredValue: boolean;
180
+ };
@@ -182,3 +182,7 @@ export type ToleranceOut = {
182
182
  export type OperationDocumentRequestsOut = {
183
183
  requests: DocumentRequests[];
184
184
  };
185
+ export type GetDocumentsOut = {
186
+ documents: Document[];
187
+ total: number;
188
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@experteam-mx/ngx-services",
3
- "version": "18.7.29",
3
+ "version": "18.7.31",
4
4
  "description": "Angular common services for Experteam apps",
5
5
  "author": "Experteam Cía. Ltda.",
6
6
  "keywords": [