@experteam-mx/ngx-services 18.9.3 → 18.9.6
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.
- package/esm2022/lib/apis/api-catalogs.service.mjs +75 -1
- package/esm2022/lib/apis/models/api-catalog.interfaces.mjs +1 -1
- package/esm2022/lib/apis/models/api-catalog.types.mjs +1 -1
- package/esm2022/lib/apis/models/api-invoices.interfaces.mjs +1 -1
- package/fesm2022/experteam-mx-ngx-services.mjs +74 -0
- package/fesm2022/experteam-mx-ngx-services.mjs.map +1 -1
- package/lib/apis/api-catalogs.service.d.ts +60 -1
- package/lib/apis/models/api-catalog.interfaces.d.ts +5 -0
- package/lib/apis/models/api-catalog.types.d.ts +14 -1
- package/lib/apis/models/api-invoices.interfaces.d.ts +10 -12
- package/package.json +1 -1
|
@@ -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, 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, 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;
|
|
@@ -320,6 +320,65 @@ export declare class ApiCatalogsService {
|
|
|
320
320
|
* The Observable will emit an error if the HTTP request fails.
|
|
321
321
|
*/
|
|
322
322
|
deleteQuestion(id: number): Observable<{}>;
|
|
323
|
+
/**
|
|
324
|
+
* Fetches holidays from the catalogs API.
|
|
325
|
+
*
|
|
326
|
+
* Sends an HTTP GET request to `${this.url}/holidays` using the supplied query parameters
|
|
327
|
+
* and returns the unwrapped payload (`data`) from the API response.
|
|
328
|
+
*
|
|
329
|
+
* @param params - Query parameters to include in the request (e.g. paging, filters, sorting).
|
|
330
|
+
* @returns An Observable that emits the HolidaysOut payload (the `data` field from ApiSuccess<HolidaysOut>).
|
|
331
|
+
*/
|
|
332
|
+
getHolidays(params: QueryParams): Observable<HolidaysOut>;
|
|
333
|
+
/**
|
|
334
|
+
* Retrieve a single holiday by its id.
|
|
335
|
+
*
|
|
336
|
+
* Sends an HTTP GET request to the holidays endpoint and returns an Observable that emits
|
|
337
|
+
* the HolidayOut payload extracted from the API success envelope.
|
|
338
|
+
*
|
|
339
|
+
* @param id - The numeric identifier of the holiday to fetch.
|
|
340
|
+
* @returns An Observable that emits the requested HolidayOut. The Observable will error
|
|
341
|
+
* if the HTTP request fails (for example network issues or non-2xx responses).
|
|
342
|
+
*/
|
|
343
|
+
getHoliday(id: number): Observable<HolidayOut>;
|
|
344
|
+
/**
|
|
345
|
+
* Sends a POST request to create a new holiday and returns the created resource.
|
|
346
|
+
*
|
|
347
|
+
* The request payload is sent as an object with a `body` property containing the provided
|
|
348
|
+
* HolidayIn value (i.e. { body: HolidayIn }). On success the HTTP response is expected
|
|
349
|
+
* to follow the ApiSuccess<T> shape; the operator maps that response to the inner `data`
|
|
350
|
+
* object and emits it as a HolidayOut.
|
|
351
|
+
*
|
|
352
|
+
* @param body - The holiday payload to create (HolidayIn).
|
|
353
|
+
* @returns Observable<HolidayOut> that emits the created holiday on success.
|
|
354
|
+
*/
|
|
355
|
+
postHoliday(body: HolidayIn): Observable<HolidayOut>;
|
|
356
|
+
/**
|
|
357
|
+
* Update a holiday by its ID.
|
|
358
|
+
*
|
|
359
|
+
* Sends an HTTP PUT to `${this.url}/holidays/${id}` with the provided payload.
|
|
360
|
+
* The request body is sent as an object with a `body` property containing the
|
|
361
|
+
* `HolidayIn` data. The server response is expected to be an `ApiSuccess<HolidayOut>`
|
|
362
|
+
* and this method returns an Observable that emits the unwrapped `HolidayOut`.
|
|
363
|
+
*
|
|
364
|
+
* @param id - The identifier of the holiday to update.
|
|
365
|
+
* @param body - The update payload for the holiday.
|
|
366
|
+
* @returns An Observable that emits the updated `HolidayOut` on success.
|
|
367
|
+
*/
|
|
368
|
+
putHoliday(id: number, body: HolidayIn): Observable<HolidayOut>;
|
|
369
|
+
/**
|
|
370
|
+
* Deletes a question by its ID.
|
|
371
|
+
*
|
|
372
|
+
* Sends an HTTP DELETE request to the backend endpoint `/questions/{id}` and
|
|
373
|
+
* returns an Observable that emits the API response's `data` payload (typically an empty object).
|
|
374
|
+
*
|
|
375
|
+
* The implementation maps an ApiSuccess wrapper to its `data` property before emitting.
|
|
376
|
+
*
|
|
377
|
+
* @param id - The numeric identifier of the question to delete.
|
|
378
|
+
* @returns An Observable that emits the deleted resource payload ({} expected) on success.
|
|
379
|
+
* The Observable will emit an error if the HTTP request fails.
|
|
380
|
+
*/
|
|
381
|
+
deleteHoliday(id: number): Observable<{}>;
|
|
323
382
|
static ɵfac: i0.ɵɵFactoryDeclaration<ApiCatalogsService, never>;
|
|
324
383
|
static ɵprov: i0.ɵɵInjectableDeclaration<ApiCatalogsService>;
|
|
325
384
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CancellationReason, Country, Currency, ExtraCharge, GenericFolio, IdentificationType, Language, ManagementArea, OperationType, 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, 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[];
|
|
@@ -174,3 +174,16 @@ export type QuestionIn = {
|
|
|
174
174
|
countryId: number;
|
|
175
175
|
isRequiredValue: boolean;
|
|
176
176
|
};
|
|
177
|
+
export type HolidaysOut = {
|
|
178
|
+
holidays: Holiday[];
|
|
179
|
+
total: number;
|
|
180
|
+
};
|
|
181
|
+
export type HolidayOut = {
|
|
182
|
+
holiday: Holiday;
|
|
183
|
+
};
|
|
184
|
+
export type HolidayIn = {
|
|
185
|
+
date: string;
|
|
186
|
+
description: string;
|
|
187
|
+
countryId: number;
|
|
188
|
+
isActive: boolean;
|
|
189
|
+
};
|
|
@@ -150,21 +150,19 @@ export interface Customer extends LaravelModel {
|
|
|
150
150
|
company_name: string;
|
|
151
151
|
full_name: string;
|
|
152
152
|
email: string;
|
|
153
|
-
phone_code: string;
|
|
154
|
-
phone_number: number;
|
|
155
|
-
birth_date: string;
|
|
156
|
-
postal_code: number;
|
|
157
|
-
state: string;
|
|
158
|
-
county_name: string;
|
|
159
|
-
city_name: string;
|
|
153
|
+
phone_code: string | null;
|
|
154
|
+
phone_number: number | null;
|
|
155
|
+
birth_date: string | null;
|
|
156
|
+
postal_code: number | null;
|
|
157
|
+
state: string | null;
|
|
158
|
+
county_name: string | null;
|
|
159
|
+
city_name: string | null;
|
|
160
160
|
address_line1: string;
|
|
161
|
-
address_line2: string;
|
|
162
|
-
address_line3: string;
|
|
161
|
+
address_line2: string | null;
|
|
162
|
+
address_line3: string | null;
|
|
163
163
|
company_id: number;
|
|
164
164
|
identification_type_id: number;
|
|
165
|
-
extra_fields:
|
|
166
|
-
[key: string]: string | number | boolean | null;
|
|
167
|
-
};
|
|
165
|
+
extra_fields: Record<string, string | number | boolean | null>;
|
|
168
166
|
country_id: number;
|
|
169
167
|
customer_type_id: number;
|
|
170
168
|
}
|