@experteam-mx/ngx-services 18.8.4 → 18.8.5

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, QuestionIn, QuestionOut, QuestionsOut, 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, HolidayIn, HolidayOut, HolidaysOut, 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;
@@ -327,6 +327,65 @@ export declare class ApiCatalogsService {
327
327
  * The Observable will emit an error if the HTTP request fails.
328
328
  */
329
329
  deleteQuestion(id: number): Observable<{}>;
330
+ /**
331
+ * Fetches holidays from the catalogs API.
332
+ *
333
+ * Sends an HTTP GET request to `${this.url}/holidays` using the supplied query parameters
334
+ * and returns the unwrapped payload (`data`) from the API response.
335
+ *
336
+ * @param params - Query parameters to include in the request (e.g. paging, filters, sorting).
337
+ * @returns An Observable that emits the HolidaysOut payload (the `data` field from ApiSuccess<HolidaysOut>).
338
+ */
339
+ getHolidays(params: QueryParams): Observable<HolidaysOut>;
340
+ /**
341
+ * Retrieve a single holiday by its id.
342
+ *
343
+ * Sends an HTTP GET request to the holidays endpoint and returns an Observable that emits
344
+ * the HolidayOut payload extracted from the API success envelope.
345
+ *
346
+ * @param id - The numeric identifier of the holiday to fetch.
347
+ * @returns An Observable that emits the requested HolidayOut. The Observable will error
348
+ * if the HTTP request fails (for example network issues or non-2xx responses).
349
+ */
350
+ getHoliday(id: number): Observable<HolidayOut>;
351
+ /**
352
+ * Sends a POST request to create a new holiday and returns the created resource.
353
+ *
354
+ * The request payload is sent as an object with a `body` property containing the provided
355
+ * HolidayIn value (i.e. { body: HolidayIn }). On success the HTTP response is expected
356
+ * to follow the ApiSuccess<T> shape; the operator maps that response to the inner `data`
357
+ * object and emits it as a HolidayOut.
358
+ *
359
+ * @param body - The holiday payload to create (HolidayIn).
360
+ * @returns Observable<HolidayOut> that emits the created holiday on success.
361
+ */
362
+ postHoliday(body: HolidayIn): Observable<HolidayOut>;
363
+ /**
364
+ * Update a holiday by its ID.
365
+ *
366
+ * Sends an HTTP PUT to `${this.url}/holidays/${id}` with the provided payload.
367
+ * The request body is sent as an object with a `body` property containing the
368
+ * `HolidayIn` data. The server response is expected to be an `ApiSuccess<HolidayOut>`
369
+ * and this method returns an Observable that emits the unwrapped `HolidayOut`.
370
+ *
371
+ * @param id - The identifier of the holiday to update.
372
+ * @param body - The update payload for the holiday.
373
+ * @returns An Observable that emits the updated `HolidayOut` on success.
374
+ */
375
+ putHoliday(id: number, body: HolidayIn): Observable<HolidayOut>;
376
+ /**
377
+ * Deletes a question by its ID.
378
+ *
379
+ * Sends an HTTP DELETE request to the backend endpoint `/questions/{id}` and
380
+ * returns an Observable that emits the API response's `data` payload (typically an empty object).
381
+ *
382
+ * The implementation maps an ApiSuccess wrapper to its `data` property before emitting.
383
+ *
384
+ * @param id - The numeric identifier of the question to delete.
385
+ * @returns An Observable that emits the deleted resource payload ({} expected) on success.
386
+ * The Observable will emit an error if the HTTP request fails.
387
+ */
388
+ deleteHoliday(id: number): Observable<{}>;
330
389
  static ɵfac: i0.ɵɵFactoryDeclaration<ApiCatalogsService, never>;
331
390
  static ɵprov: i0.ɵɵInjectableDeclaration<ApiCatalogsService>;
332
391
  }
@@ -204,3 +204,8 @@ export interface Question extends SymfonyModel {
204
204
  countryId: number;
205
205
  isRequiredValue: boolean;
206
206
  }
207
+ export interface Holiday extends SymfonyModel {
208
+ date: string;
209
+ description: string;
210
+ country: Country;
211
+ }
@@ -1,4 +1,4 @@
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';
1
+ import { CancellationReason, Country, Currency, ExtraCharge, GenericFolio, Holiday, 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[];
@@ -178,3 +178,16 @@ export type QuestionIn = {
178
178
  countryId: number;
179
179
  isRequiredValue: boolean;
180
180
  };
181
+ export type HolidaysOut = {
182
+ holidays: Holiday[];
183
+ total: number;
184
+ };
185
+ export type HolidayOut = {
186
+ holiday: Holiday;
187
+ };
188
+ export type HolidayIn = {
189
+ date: string;
190
+ description: string;
191
+ countryId: number;
192
+ isActive: boolean;
193
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@experteam-mx/ngx-services",
3
- "version": "18.8.4",
3
+ "version": "18.8.5",
4
4
  "description": "Angular common services for Experteam apps",
5
5
  "author": "Experteam Cía. Ltda.",
6
6
  "keywords": [