@experteam-mx/ngx-services
Version:
Angular common services for Experteam apps
1 lines • 237 kB
Source Map (JSON)
{"version":3,"file":"experteam-mx-ngx-services.mjs","sources":["../../../../projects/experteam-mx/ngx-services/src/lib/ngx-services.models.ts","../../../../projects/experteam-mx/ngx-services/src/lib/ngx-services.module.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-billing-do.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-billing-mx.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-billing-pa.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-cash-operations.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-catalogs.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-companies.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-e-tools-auto-billing.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-external-pickups.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-inventories.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-invoices.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-open-items.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-reports.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-security.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-shipments.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/models/api-inventories.enum.ts","../../../../projects/experteam-mx/ngx-services/src/lib/websockets/web-sockets.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/cypher/crypto.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/interceptors/api-headers.interceptor.ts","../../../../projects/experteam-mx/ngx-services/src/lib/interceptors/api-token.interceptor.ts","../../../../projects/experteam-mx/ngx-services/src/lib/interceptors/http-caching.interceptor.ts","../../../../projects/experteam-mx/ngx-services/src/lib/helpers/http.ts","../../../../projects/experteam-mx/ngx-services/src/public-api.ts","../../../../projects/experteam-mx/ngx-services/src/experteam-mx-ngx-services.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core'\r\n\r\n/**\r\n * Represents the configuration settings for the application's environment.\r\n * This type includes various API endpoint URLs, authentication details, caching options, and other relevant settings.\r\n *\r\n * Properties:\r\n * - apiCompaniesUrl: The URL for the companies API endpoint.\r\n * - apiInvoicesUrl: The URL for the invoices API endpoint.\r\n * - apiReportsUrl: The URL for the reports API endpoint.\r\n * - apiSecurityUrl: The URL for the security-related API endpoint.\r\n * - apiShipmentUrl: The URL for the shipment API endpoint.\r\n * - authCookie: The name of the authentication cookie used for user sessions.\r\n * - cacheTtl: Optional. Specifies the time-to-live (TTL) for cached items.\r\n * - printUrl: Optional. The URL used for generating or downloading printable documents.\r\n * - secretKey: A secret key used for authentication or other secure operations.\r\n */\r\nexport type Environment = {\r\n apiBillingDO?: string\r\n apiBillingMX?: string\r\n apiBillingPA?: string\r\n apiCashOperationsUrl?: string\r\n apiCatalogsUrl?: string\r\n apiCompaniesUrl?: string\r\n apiEToolsAutoBilling?: string\r\n apiExternalOperationsKey?: string\r\n apiExternalOperationsUrl?: string\r\n apiInventoriesUrl?: string\r\n apiInvoicesUrl?: string\r\n apiOpenItemsUrl?: string\r\n apiReportsUrl?: string\r\n apiSecurityUrl?: string\r\n apiShipmentUrl?: string\r\n authCookie: string\r\n cacheTtl?: number\r\n printUrl?: string\r\n secretKey: string\r\n sockets?: {\r\n app_key: string\r\n debug?: boolean\r\n port: number\r\n url: string\r\n }\r\n}\r\n\r\n/**\r\n * Injection token used to inject environment configurations.\r\n *\r\n * `ENVIRONMENT_TOKEN` is a dependency injection token that allows\r\n * for the provision and retrieval of environment-specific configurations\r\n * within the application. This token is typically associated with an\r\n * `Environment` type that defines the structure of the configuration.\r\n */\r\nexport const ENVIRONMENT_TOKEN = new InjectionToken<Environment>('Environments token')\r\n","import { ModuleWithProviders, NgModule } from '@angular/core'\r\nimport { Environment } from './ngx-services.models'\r\nimport { provideHttpClient } from '@angular/common/http'\r\n\r\n@NgModule({\r\n providers: [provideHttpClient()]\r\n})\r\nexport class NgxServicesModule {\r\n /**\r\n * Returns a module with providers for the NgxServicesModule.\r\n *\r\n * @param {Environment} environment - The environment configuration object.\r\n *\r\n * @return {ModuleWithProviders<NgxServicesModule>} The module with providers for the NgxServicesModule.\r\n */\r\n public static forRoot (environment: Environment): ModuleWithProviders<NgxServicesModule> {\r\n return {\r\n ngModule: NgxServicesModule,\r\n providers: [\r\n {\r\n provide: 'env',\r\n useValue: environment\r\n }\r\n ]\r\n }\r\n }\r\n}\r\n","import { Inject, Injectable } from '@angular/core'\r\nimport { Environment } from '../ngx-services.models'\r\nimport { HttpClient } from '@angular/common/http'\r\nimport { map, Observable } from 'rxjs'\r\nimport { ApiSuccess } from './models/api.models'\r\nimport { IncomeTypesOut } from './models/api-billing.types'\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class ApiBillingDOService {\r\n constructor (\r\n @Inject('env') private environments: Environment,\r\n private http: HttpClient\r\n ) { }\r\n\r\n /**\r\n * Retrieves the URL for the shipments API from the environment configurations.\r\n *\r\n * @return {string} The URL of the shipments API.\r\n */\r\n get url (): string {\r\n return this.environments.apiBillingDO ?? ''\r\n }\r\n\r\n /**\r\n * Retrieves a list of income types\r\n *\r\n * @return {Observable<ApiSuccess<IncomeTypesOut>>} An observable that emits the income types data.\r\n */\r\n getIncomeTypes (): Observable<IncomeTypesOut> {\r\n return this.http.get<ApiSuccess<IncomeTypesOut>>(`${this.url}/income-types`)\r\n .pipe(map(({ data }) => data))\r\n }\r\n}\r\n","import { Inject, Injectable } from '@angular/core'\r\nimport { Environment } from '../ngx-services.models'\r\nimport { HttpClient } from '@angular/common/http'\r\nimport { map, Observable } from 'rxjs'\r\nimport { ApiSuccess, QueryParams } from './models/api.models'\r\nimport { FiscalRegimensAcceptedOut, FiscalRegimensOut, PostalCodesOut } from './models/api-billing.types'\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class ApiBillingMxService {\r\n constructor (\r\n @Inject('env') private environments: Environment,\r\n private http: HttpClient\r\n ) { }\r\n\r\n /**\r\n * Retrieves the URL for the shipments API from the environment configurations.\r\n *\r\n * @return {string} The URL of the shipments API.\r\n */\r\n get url (): string {\r\n return this.environments.apiBillingMX ?? ''\r\n }\r\n\r\n /**\r\n * Fetches the tax regimen data from the server.\r\n *\r\n * @return {Observable<FiscalRegimensOut>} An observable that emits the fiscal regimen data.\r\n */\r\n getFiscalRegimens (): Observable<FiscalRegimensOut> {\r\n return this.http.get<ApiSuccess<FiscalRegimensOut>>(`${this.url}/fiscal-regimens`)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Fetches a paginated list of CFDIs (Comprobante Fiscal Digital por Internet) based on the provided fiscal regimen.\r\n *\r\n * @param {number} fiscalRegimen - The fiscal regimen identifier to filter the CFDIs.\r\n * @return {Observable<FiscalRegimensAcceptedOut>} An observable containing the paginated list of CFDIs.\r\n */\r\n getFiscalRegimensAccepted (fiscalRegimen: number): Observable<FiscalRegimensAcceptedOut> {\r\n const params = { 'fiscal-regimen': fiscalRegimen }\r\n\r\n return this.http.get<ApiSuccess<FiscalRegimensAcceptedOut>>(`${this.url}/cfdi-uses/fiscal-regimen-accepted/list`, { params })\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Fetches and validates postal code data from the server.\r\n *\r\n * @param {QueryParams} params - Query parameters used to filter the postal code data.\r\n * @return {Observable<PostalCodesOut>} - An observable emitting the validated postal code data.\r\n */\r\n getPostalCodes (params: QueryParams): Observable<PostalCodesOut> {\r\n return this.http.get<ApiSuccess<PostalCodesOut>>(`${this.url}/postal-codes`, { params })\r\n .pipe(map(({ data }) => data))\r\n }\r\n}\r\n","import { Inject, Injectable } from '@angular/core'\r\nimport { Environment } from '../ngx-services.models'\r\nimport { HttpClient } from '@angular/common/http'\r\nimport { ApiSuccess, QueryParams } from './models/api.models'\r\nimport { map, Observable } from 'rxjs'\r\nimport { BillingPaCustomerOut, DistrictsOut, ParishesOut, ProvincesOut } from './models/api-billing-pa.types'\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class ApiBillingPaService {\r\n constructor (\r\n @Inject('env') private environments: Environment,\r\n private http: HttpClient\r\n ) { }\r\n\r\n /**\r\n * Retrieves the URL for the Billing Pa API from the environment configurations.\r\n *\r\n * @return {string} The URL of the Billing Pa API.\r\n */\r\n get url (): string {\r\n return this.environments.apiBillingPA ?? ''\r\n }\r\n\r\n /**\r\n * Retrieves a list of districts based on query parameters.\r\n *\r\n * @param {QueryParams} params - Query parameters for filtering the districts.\r\n * @returns {Observable<DistrictsOut>} The list of districts.\r\n */\r\n getDistricts (params: QueryParams): Observable<DistrictsOut> {\r\n return this.http.get<ApiSuccess<DistrictsOut>>(`${this.url}/districts`, {\r\n params\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves a list of parishes based on query parameters.\r\n *\r\n * @param {QueryParams} params - Query parameters for filtering the parishes.\r\n * @returns {Observable<ParishesOut>} The list of parishes.\r\n */\r\n getParishes (params: QueryParams): Observable<ParishesOut> {\r\n return this.http.get<ApiSuccess<ParishesOut>>(`${this.url}/parishes`, {\r\n params\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves a list of provinces based on query parameters.\r\n *\r\n * @param {QueryParams} params - Query parameters for filtering the provinces.\r\n * @returns {Observable<ProvincesOut>} The list of provinces.\r\n */\r\n getProvinces (params: QueryParams): Observable<ProvincesOut> {\r\n return this.http.get<ApiSuccess<ProvincesOut>>(`${this.url}/provinces`, {\r\n params\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves the details of a customer based on query parameters.\r\n *\r\n * @param {QueryParams} params - Query parameters for get customer.\r\n * @return {Observable<BillingPaCustomerOut>} An observable that emits customer data.\r\n */\r\n getValidateCustomer (params: QueryParams): Observable<BillingPaCustomerOut> {\r\n return this.http.get<ApiSuccess<BillingPaCustomerOut>>(`${this.url}/validate-customer`, {\r\n params\r\n }).pipe(map(({ data }) => data))\r\n }\r\n}\r\n","import { Inject, Injectable } from '@angular/core'\r\nimport { Environment } from '../ngx-services.models'\r\nimport { HttpClient } from '@angular/common/http'\r\nimport { ApiSuccess, QueryParams } from './models/api.models'\r\nimport { map, Observable } from 'rxjs'\r\nimport {\r\n InstallationCountryReferenceCurrenciesOut,\r\n InstallationCountryReferenceCurrencyIn,\r\n InstallationCountryReferenceCurrencyOut\r\n} from './models/api-cash-operations.types'\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class ApiCashOperationsService {\r\n constructor (\r\n @Inject('env') private environments: Environment,\r\n private http: HttpClient\r\n ) { }\r\n\r\n /**\r\n * Retrieves the URL for the cash operations API from the environment configurations.\r\n *\r\n * @return {string} The URL of the cash operations API.\r\n */\r\n get url (): string {\r\n return this.environments.apiCashOperationsUrl ?? ''\r\n }\r\n\r\n /**\r\n * Creates a new installation country reference currency.\r\n *\r\n * @param {InstallationCountryReferenceCurrencyIn} body - The data for the new reference currency.\r\n * @returns {Observable<InstallationCountryReferenceCurrencyOut>} The created reference currency.\r\n */\r\n postInstallationCountryReferenceCurrency (body: InstallationCountryReferenceCurrencyIn): Observable<InstallationCountryReferenceCurrencyOut> {\r\n return this.http.post<ApiSuccess<InstallationCountryReferenceCurrencyOut>>(`${this.url}/installation-country-reference-currencies`,\r\n body\r\n ).pipe(\r\n map(({ data }) => data)\r\n )\r\n }\r\n\r\n /**\r\n * Updates an existing installation country reference currency.\r\n *\r\n * @param {number} id - The ID of the reference currency to update.\r\n * @param {InstallationCountryReferenceCurrencyIn} body - The updated data for the reference currency.\r\n * @returns {Observable<InstallationCountryReferenceCurrencyOut>} The updated reference currency.\r\n */\r\n putInstallationCountryReferenceCurrency (id:number, body: InstallationCountryReferenceCurrencyIn): Observable<InstallationCountryReferenceCurrencyOut> {\r\n return this.http.put<ApiSuccess<InstallationCountryReferenceCurrencyOut>>(`${this.url}/installation-country-reference-currencies/${id}`, body)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves a list of installation country reference currencies based on query parameters.\r\n *\r\n * @param {QueryParams} params - Query parameters for filtering the currencies.\r\n * @returns {Observable<InstallationCountryReferenceCurrenciesOut>} The list of reference currencies.\r\n */\r\n getInstallationCompanyCountryCurrencies (params: QueryParams): Observable<InstallationCountryReferenceCurrenciesOut> {\r\n return this.http.get<ApiSuccess<InstallationCountryReferenceCurrenciesOut>>(`${this.url}/installation-country-reference-currencies`, {\r\n params\r\n }).pipe(map(({ data }) => data))\r\n }\r\n}\r\n","import { Inject, Injectable } from '@angular/core'\r\nimport { Environment } from '../ngx-services.models'\r\nimport { HttpClient } from '@angular/common/http'\r\nimport { map, Observable } from 'rxjs'\r\nimport { ApiSuccess, QueryParams } from './models/api.models'\r\nimport {\r\n CancellationReasonIn,\r\n CancellationReasonOut,\r\n CancellationReasonsOut,\r\n CountriesOut,\r\n CountryIn,\r\n CountryOut,\r\n CurrenciesOut,\r\n ExtraChargeIn,\r\n ExtraChargeOut,\r\n ExtraChargesOut,\r\n GenericFolioIn,\r\n GenericFolioOut,\r\n GenericFoliosOut,\r\n IdentificationTypesOut,\r\n LanguagesOut,\r\n ManagementAreasOut,\r\n OperationTypesOut,\r\n PostalLocationsOut,\r\n ProductIn,\r\n ProductOut,\r\n RegionsOut,\r\n ShipmentContentTypesOut,\r\n ShipmentIncomeTypeIn,\r\n ShipmentIncomeTypeOut,\r\n ShipmentIncomeTypesOut,\r\n ShipmentScopesOut,\r\n UniqueFolioIn,\r\n UniqueFolioOut,\r\n UniqueFoliosOut,\r\n UnitsOut,\r\n ZonesOut\r\n} from './models/api-catalog.types'\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class ApiCatalogsService {\r\n constructor (\r\n @Inject('env') private environments: Environment,\r\n private http: HttpClient\r\n ) { }\r\n\r\n /**\r\n * Retrieves the URL for the reports API from the environment configurations.\r\n *\r\n * @return {string} The URL of the reports API.\r\n */\r\n get url (): string {\r\n return this.environments.apiCatalogsUrl ?? ''\r\n }\r\n\r\n /**\r\n * Retrieves the list of collection payments\r\n *\r\n * @param {QueryParams} params - The query parameters used to fetch the operation types.\r\n * @return {Observable<OperationTypesOut[]>} An observable that emits an array of operation type.\r\n */\r\n getOperationTypes (params: QueryParams): Observable<OperationTypesOut> {\r\n return this.http.get<ApiSuccess<OperationTypesOut>>(`${this.url}/operation-types`, {\r\n params\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves the list of identificatios types\r\n *\r\n * @param {QueryParams} params - The query parameters used to fetch the identification types.\r\n * @return {Observable<IdentificationTypesOut[]>} An observable that emits an array of identification type.\r\n */\r\n getIdentificationTypes (params: QueryParams): Observable<IdentificationTypesOut> {\r\n return this.http.get<ApiSuccess<IdentificationTypesOut>>(`${this.url}/identification-types`, {\r\n params\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Fetches the extra charges based on the provided query parameters.\r\n *\r\n * @param {QueryParams} params - The query parameters to filter the results.\r\n * @return {Observable<ExtraChargesOut>} An observable emitting the extra charges data.\r\n */\r\n getExtraCharges (params: QueryParams): Observable<ExtraChargesOut> {\r\n return this.http.get<ApiSuccess<ExtraChargesOut>>(`${this.url}/extracharges`, {\r\n params\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Submits an extra charge request to the server and returns the created extra charge details.\r\n *\r\n * @param {ExtraChargeIn} body - The data for the extra charge to be created.\r\n * @return {Observable<ExtraChargeOut>} An observable that emits the details of the created extra charge.\r\n */\r\n postExtraCharge (body: ExtraChargeIn): Observable<ExtraChargeOut> {\r\n return this.http.post<ApiSuccess<ExtraChargeOut>>(`${this.url}/extracharges`, body)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Updates an extra charge entity with new data and returns the updated entity.\r\n *\r\n * @param {number} id - The unique identifier of the extra charge to update.\r\n * @param {ExtraChargeIn} body - The new data for the extra charge.\r\n * @return {Observable<ExtraChargeOut>} An observable emitting the updated extra charge entity.\r\n */\r\n putExtraCharge (id: number, body: ExtraChargeIn): Observable<ExtraChargeOut> {\r\n return this.http.put<ApiSuccess<ExtraChargeOut>>(`${this.url}/extracharges/${id}`, body)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Fetches a list of countries from the API.\r\n *\r\n * @param {QueryParams} params - The query parameters to be passed to the API request.\r\n * @return {Observable<CountriesOut>} An observable containing the list of countries.\r\n */\r\n getCountries (params: QueryParams): Observable<CountriesOut> {\r\n return this.http.get<ApiSuccess<CountriesOut>>(`${this.url}/countries`, { params })\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves the details of a country based on its ID.\r\n *\r\n * @param {number} id - The identifier of the country to fetch.\r\n * @return {Observable<CountryOut>} An observable that emits the country data.\r\n */\r\n getCountry (id: number): Observable<CountryOut> {\r\n return this.http.get<ApiSuccess<CountryOut>>(`${this.url}/countries/${id}`)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Updates the details of a specific country by its ID.\r\n *\r\n * @param {number} id - The unique identifier of the country to be updated.\r\n * @param {CountryIn} body - The data to update the country with.\r\n * @return {Observable<CountryOut>} An observable that emits the updated country data.\r\n */\r\n putCountry (id: number, body: CountryIn): Observable<CountryOut> {\r\n return this.http.put<ApiSuccess<CountryOut>>(`${this.url}/countries/${id}`, body)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Fetches postal location details based on the provided query parameters.\r\n *\r\n * @param {QueryParams} params - The query parameters to filter and fetch postal location data.\r\n * @return {Observable<PostalLocationsOut>} An observable that emits the postal location details.\r\n */\r\n getPostalLocations (params: QueryParams): Observable<PostalLocationsOut> {\r\n return this.http.get<ApiSuccess<PostalLocationsOut>>(`${this.url}/postal-locations`, { params })\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Fetches a list of regions based on the provided query parameters.\r\n *\r\n * @param {QueryParams} params - The query parameters used to filter the regions.\r\n * @return {Observable<RegionsOut>} An observable that emits the list of regions.\r\n */\r\n getRegions (params: QueryParams): Observable<RegionsOut> {\r\n return this.http.get<ApiSuccess<RegionsOut>>(`${this.url}/regions`, { params })\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Fetches the zones data based on the provided query parameters.\r\n *\r\n * @param {QueryParams} params - The query parameters used to filter the zones data.\r\n * @return {Observable<ZonesOut>} An observable that emits the fetched zones data.\r\n */\r\n getZones (params: QueryParams): Observable<ZonesOut> {\r\n return this.http.get<ApiSuccess<ZonesOut>>(`${this.url}/zones`, { params })\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Fetches the management areas based on the provided query parameters.\r\n *\r\n * @param {QueryParams} params - The query parameters to filter the management areas.\r\n * @return {Observable<ManagementAreasOut>} An observable that emits the management areas data.\r\n */\r\n getManagementAreas (params: QueryParams): Observable<ManagementAreasOut> {\r\n return this.http.get<ApiSuccess<ManagementAreasOut>>(`${this.url}/management-areas`, { params })\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves cancellation reasons from the server based on the provided query parameters.\r\n *\r\n * @param {QueryParams} params - The query parameters to filter the cancellation reasons.\r\n * @return {Observable<CancellationReasonsOut>} An observable containing the retrieved cancellation reasons.\r\n */\r\n getCancellationReasons (params: QueryParams): Observable<CancellationReasonsOut> {\r\n return this.http.get<ApiSuccess<CancellationReasonsOut>>(`${this.url}/cancellation-reasons`, { params })\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Sends a cancellation reason to the server.\r\n *\r\n * @param {CancellationReasonIn} body - The cancellation reason object to be sent.\r\n * @return {Observable<CancellationReasonOut>} An observable containing the server's response with the processed cancellation reason.\r\n */\r\n postCancellationReason (body: CancellationReasonIn): Observable<CancellationReasonOut> {\r\n return this.http.post<ApiSuccess<CancellationReasonOut>>(`${this.url}/cancellation-reasons`, body)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Updates the cancellation reason for the specified ID with the provided data.\r\n *\r\n * @param {number} id - The unique identifier of the cancellation reason to update.\r\n * @param {CancellationReasonIn} body - The details of the cancellation reason to be updated.\r\n * @return {Observable<CancellationReasonOut>} An observable containing the updated cancellation reason.\r\n */\r\n putCancellationReason (id: number, body: CancellationReasonIn): Observable<CancellationReasonOut> {\r\n return this.http.put<ApiSuccess<CancellationReasonOut>>(`${this.url}/cancellation-reasons/${id}`, body)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves a list of currencies based on the provided query parameters.\r\n *\r\n * @param {QueryParams} params - The query parameters to customize the currency retrieval request.\r\n * @return {Observable<CurrenciesOut>} An observable that emits the retrieved currencies data.\r\n */\r\n getCurrencies (params: QueryParams): Observable<CurrenciesOut> {\r\n return this.http.get<ApiSuccess<CurrenciesOut>>(`${this.url}/currencies`, { params })\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Fetches the list of available languages based on the provided query parameters.\r\n *\r\n * @param {QueryParams} params - The query parameters to pass with the HTTP request.\r\n * @return {Observable<LanguagesOut>} An observable that emits the available languages.\r\n */\r\n getLanguages (params: QueryParams): Observable<LanguagesOut> {\r\n return this.http.get<ApiSuccess<LanguagesOut>>(`${this.url}/languages`, { params })\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Fetches the available units from the API based on the provided query parameters.\r\n *\r\n * @param {QueryParams} params - The query parameters to filter the units being fetched.\r\n * @return {Observable<UnitsOut>} An observable that emits the retrieved units data.\r\n */\r\n getUnits (params: QueryParams): Observable<UnitsOut> {\r\n return this.http.get<ApiSuccess<UnitsOut>>(`${this.url}/units`, { params })\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves the shipment scopes based on the provided query parameters.\r\n *\r\n * @param {QueryParams} params The query parameters to filter or modify the request for shipment scopes.\r\n * @return {Observable<ShipmentScopesOut>} An observable that emits the shipment scopes data.\r\n */\r\n getShipmentScopes (params: QueryParams): Observable<ShipmentScopesOut> {\r\n return this.http.get<ApiSuccess<ShipmentScopesOut>>(`${this.url}/shipment-scopes`, { params })\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Fetches the available shipment content types based on the provided query parameters.\r\n *\r\n * @param {QueryParams} params - The query parameters to filter the shipment content types.\r\n * @return {Observable<ShipmentContentTypesOut>} An observable that emits the shipment content types data.\r\n */\r\n getShipmentContentTypes (params: QueryParams): Observable<ShipmentContentTypesOut> {\r\n return this.http.get<ApiSuccess<ShipmentContentTypesOut>>(`${this.url}/shipment-content-types`, { params })\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Fetches a list of generic folios based on the given query parameters.\r\n *\r\n * @param {QueryParams} params - The query parameters used to filter the generic folios.\r\n * @return {Observable<GenericFoliosOut>} An observable containing the fetched generic folios.\r\n */\r\n getGenericFolios (params: QueryParams): Observable<GenericFoliosOut> {\r\n return this.http.get<ApiSuccess<GenericFoliosOut>>(`${this.url}/generic-folios`, { params })\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Sends a POST request to create or update a generic folio.\r\n *\r\n * @param {GenericFolioIn} body - The payload containing the details of the generic folio to be created or updated.\r\n * @return {Observable<GenericFolioOut>} An observable containing the response data of the created or updated generic folio.\r\n */\r\n postGenericFolio (body: GenericFolioIn): Observable<GenericFolioOut> {\r\n return this.http.post<ApiSuccess<GenericFolioOut>>(`${this.url}/generic-folios`, body)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Updates a generic folio with the specified ID using the provided data.\r\n *\r\n * @param {number} id - The unique identifier of the generic folio to update.\r\n * @param {GenericFolioIn} body - The data to update the generic folio with.\r\n * @return {Observable<GenericFolioOut>} An observable containing the updated generic folio.\r\n */\r\n putGenericFolio (id: number, body: GenericFolioIn): Observable<GenericFolioOut> {\r\n return this.http.put<ApiSuccess<GenericFolioOut>>(`${this.url}/generic-folios/${id}`, body)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Sends a PUT request to update a Generic Folio resource with the specified ID and body data, and returns the updated resource.\r\n *\r\n * @param {number} id - The unique identifier of the Generic Folio to be updated.\r\n * @param {Partial<GenericFolioIn>} body - The partial data representing the changes to be applied to the Generic Folio.\r\n * @return {Observable<GenericFolioOut>} An observable containing the updated Generic Folio resource.\r\n */\r\n pathGenericFolio (id: number, body: Partial<GenericFolioIn>): Observable<GenericFolioOut> {\r\n return this.http.put<ApiSuccess<GenericFolioOut>>(`${this.url}/generic-folios/${id}`, body)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Sends a POST request to create a new product.\r\n *\r\n * @param {ProductIn} body - The product data to be sent in the request body.\r\n * @return {Observable<ProductOut>} An observable emitting the created product data.\r\n */\r\n postProduct (body: ProductIn): Observable<ProductOut> {\r\n return this.http.post<ApiSuccess<ProductOut>>(`${this.url}/products`, body)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Updates an existing product with the given ID using the provided data.\r\n *\r\n * @param {number} id - The unique identifier of the product to update.\r\n * @param {ProductIn} body - The product data to update.\r\n * @return {Observable<ProductOut>} An observable containing the updated product data.\r\n */\r\n putProduct (id: number, body: ProductIn): Observable<ProductOut> {\r\n return this.http.put<ApiSuccess<ProductOut>>(`${this.url}/products/${id}`, body)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves a list of shipment income types based on the provided query parameters.\r\n *\r\n * @param {QueryParams} params - The query parameters to filter the shipment income types.\r\n * @return {Observable<ShipmentIncomeTypesOut>} An observable containing the shipment income types data.\r\n */\r\n getShipmentIncomeTypes (params: QueryParams): Observable<ShipmentIncomeTypesOut> {\r\n return this.http.get<ApiSuccess<ShipmentIncomeTypesOut>>(`${this.url}/shipment-income-types`, { params })\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Sends a POST request to create a new shipment income type.\r\n *\r\n * @param {ShipmentIncomeTypeIn} body The payload containing the details of the shipment income type to be created.\r\n * @return {Observable<ShipmentIncomeTypeOut>} An observable that emits the created shipment income type data.\r\n */\r\n postShipmentIncomeType (body: ShipmentIncomeTypeIn): Observable<ShipmentIncomeTypeOut> {\r\n return this.http.post<ApiSuccess<ShipmentIncomeTypeOut>>(`${this.url}/shipment-income-types`, body)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Updates the shipment income type with the specified ID.\r\n *\r\n * @param {number} id - The identifier of the shipment income type to update.\r\n * @param {ShipmentIncomeTypeIn} body - The data to update the shipment income type with.\r\n * @return {Observable<ShipmentIncomeTypeOut>} An observable emitting the updated shipment income type.\r\n */\r\n putShipmentIncomeType (id: number, body: ShipmentIncomeTypeIn): Observable<ShipmentIncomeTypeOut> {\r\n return this.http.put<ApiSuccess<ShipmentIncomeTypeOut>>(`${this.url}/shipment-income-types/${id}`, body)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves a list of unique folios based on the provided query parameters.\r\n *\r\n * @param {QueryParams} params - The query parameters used to filter and fetch unique folios.\r\n * @return {Observable<UniqueFoliosOut>} An observable that emits the unique folios data.\r\n */\r\n getUniqueFolios (params: QueryParams): Observable<UniqueFoliosOut> {\r\n return this.http.get<ApiSuccess<UniqueFoliosOut>>(`${this.url}/unique-folios`, { params })\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Sends a POST request to create a unique folio.\r\n *\r\n * @param {UniqueFolioIn} body - The data object containing details for the unique folio to be created.\r\n * @return {Observable<UniqueFolioOut>} An observable that emits the created unique folio details.\r\n */\r\n postUniqueFolio (body: UniqueFolioIn): Observable<UniqueFolioOut> {\r\n return this.http.post<ApiSuccess<UniqueFolioOut>>(`${this.url}/unique-folios`, body)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Updates a unique folio with the given data using the provided ID.\r\n *\r\n * @param {number} id - The ID of the unique folio to be updated.\r\n * @param {UniqueFolioIn} body - The payload containing the details of the unique folio to update.\r\n * @return {Observable<UniqueFolioOut>} An observable that emits the updated unique folio.\r\n */\r\n putUniqueFolio (id: number, body: UniqueFolioIn): Observable<UniqueFolioOut> {\r\n return this.http.put<ApiSuccess<UniqueFolioOut>>(`${this.url}/unique-folios/${id}`, body)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Updates a unique folio by its identifier with the provided data.\r\n *\r\n * @param {number} id - The identifier of the unique folio to update.\r\n * @param {Partial<UniqueFolioIn>} body - The partial data of the unique folio to update.\r\n * @return {Observable<UniqueFolioOut>} An observable emitting the updated unique folio data.\r\n */\r\n pathUniqueFolio (id: number, body: Partial<UniqueFolioIn>): Observable<UniqueFolioOut> {\r\n return this.http.put<ApiSuccess<UniqueFolioOut>>(`${this.url}/unique-folios/${id}`, body)\r\n .pipe(map(({ data }) => data))\r\n }\r\n}\r\n","import { Inject, Injectable } from '@angular/core'\r\nimport { Environment } from '../ngx-services.models'\r\nimport { HttpClient } from '@angular/common/http'\r\nimport {\r\n AccountCategoriesOut,\r\n AccountEntitiesIn,\r\n AccountEntitiesOut,\r\n AccountIn,\r\n AccountOut,\r\n AccountsOut,\r\n AccountTypeIn,\r\n AccountTypeOut,\r\n AccountTypesOut,\r\n BoardingProcessIdIn,\r\n BoardingProcessIn,\r\n CompanyCountriesOut,\r\n CompanyCountryIn,\r\n CompanyCountryOut,\r\n CompanyCountryTaxesOut,\r\n CompanyIn,\r\n CompanyOut,\r\n CountryReferenceCurrenciesOut,\r\n CountryReferenceCurrencyIn,\r\n CountryReferenceCurrencyOut,\r\n CountryReferenceExtraChargeIn,\r\n CountryReferenceExtraChargeOut,\r\n CountryReferenceIn,\r\n CountryReferenceOut,\r\n CountryReferenceProductIn,\r\n CountryReferenceProductOut,\r\n CountryReferenceProductsOut,\r\n CountryReferencesOut,\r\n EmployeeCustomersIn,\r\n EmployeeCustomersOut,\r\n EmployeeIn,\r\n EmployeeOut,\r\n EmployeesCustomersOut,\r\n EmployeesOut,\r\n ExchangeIn,\r\n ExchangeOut,\r\n ExchangesOut,\r\n ExtraChargeEntitiesIn,\r\n ExtraChargeEntitiesOut,\r\n InstallationIn,\r\n InstallationOut,\r\n InstallationsOut,\r\n LocationEmployeeBatchIn,\r\n LocationEmployeeOut,\r\n LocationEmployeesOut,\r\n LocationIn,\r\n LocationOut,\r\n LocationsOut,\r\n ParameterConfigIn,\r\n ParameterConfigOut,\r\n ParameterConfigsOut,\r\n ParametersByLevelIn,\r\n ParametersOut,\r\n ParametersValuesIn,\r\n ParametersValuesOut,\r\n ParameterValueIn,\r\n ParameterValueOut,\r\n ProductEntitiesIn,\r\n ProductEntitiesOut,\r\n SupplyEntitiesIn,\r\n SupplyEntitiesOut,\r\n SystemEntitiesIn,\r\n SystemEntitiesOut,\r\n SystemIn,\r\n SystemOut,\r\n SystemsOut,\r\n WorkflowConfigsBatchIn,\r\n WorkflowConfigsOut,\r\n WorkflowsOut\r\n} from './models/api-companies.types'\r\nimport { ApiSuccess, QueryParams } from './models/api.models'\r\nimport { forkJoin, map, mergeMap, Observable } from 'rxjs'\r\nimport {\r\n CountryCurrencyRate,\r\n CountryReferenceExtraCharge,\r\n EmployeeCustomerDhl,\r\n} from './models/api-companies.interfaces'\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class ApiCompaniesService {\r\n constructor (\r\n @Inject('env') private environments: Environment,\r\n private http: HttpClient\r\n ) { }\r\n\r\n /**\r\n * Retrieves the URL for the companies API from the environment configurations.\r\n *\r\n * @return {string} The URL of the companies API.\r\n */\r\n get url (): string {\r\n return this.environments.apiCompaniesUrl ?? ''\r\n }\r\n\r\n /**\r\n * Fetches the installations based on the provided query parameters.\r\n *\r\n * @param {QueryParams} params - The parameters used to filter the installations query.\r\n * @return {Observable<InstallationsOut>} An observable that emits the installation's data.\r\n */\r\n getInstallations (params: QueryParams): Observable<InstallationsOut> {\r\n return this.http.get<ApiSuccess<InstallationsOut>>(`${this.url}/installations`, { params })\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves the installation details based on the given installation ID.\r\n *\r\n * @param {number} id - The unique identifier of the installation to retrieve.\r\n * @returns {Observable<InstallationOut>} An observable of the installation details.\r\n */\r\n getInstallation (id: number): Observable<InstallationOut> {\r\n return this.http.get<ApiSuccess<InstallationOut>>(`${this.url}/installations/${id}`)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Sends a post-installation request to the server and retrieves the installation details.\r\n *\r\n * @param {InstallationIn} body - The installation details to be sent in the request body.\r\n * @return {Observable<InstallationOut>} An observable that emits the response containing installation output details.\r\n */\r\n postInstallation (body: InstallationIn): Observable<InstallationOut> {\r\n return this.http.post<ApiSuccess<InstallationOut>>(`${this.url}/installations`, body)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Updates an existing installation record by its ID.\r\n *\r\n * @param id The unique identifier of the installation to update.\r\n * @param body The data payload containing the updated installation information.\r\n * @return An observable that emits the updated installation data upon a successful update.\r\n */\r\n putInstallation (id: number, body: InstallationIn): Observable<InstallationOut> {\r\n return this.http.put<ApiSuccess<InstallationOut>>(`${this.url}/installations/${id}`, body)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Deletes an installation by its unique identifier.\r\n *\r\n * @param {number} id - The unique identifier of the installation to be deleted.\r\n * @return {Observable<{}>} An observable that emits the response after the installation is deleted.\r\n */\r\n deleteInstallation (id: number): Observable<{}> {\r\n return this.http.delete<ApiSuccess<{}>>(`${this.url}/installations/${id}`)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves a list of locations based on the provided query parameters.\r\n *\r\n * @param {QueryParams} params - The parameters to use for querying locations.\r\n * @return {Observable<LocationsOut>} An observable that emits the location's data.\r\n */\r\n getLocations (params: QueryParams): Observable<LocationsOut> {\r\n return this.http.get<ApiSuccess<LocationsOut>>(`${this.url}/locations`, { params })\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Fetches the location details for a given location ID.\r\n *\r\n * @param {number} id - The unique identifier of the location.\r\n * @return {Observable<LocationOut>} An Observable containing the location details.\r\n */\r\n getLocation (id: number): Observable<LocationOut> {\r\n return this.http.get<ApiSuccess<LocationOut>>(`${this.url}/locations/${id}`)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Sends a location object to the server and returns the created location data.\r\n *\r\n * @param {LocationIn} body - The location input object to be sent in the request body.\r\n * @return {Observable<LocationOut>} An observable emitting the created location output object.\r\n */\r\n postLocation (body: LocationIn): Observable<LocationOut> {\r\n return this.http.post<ApiSuccess<LocationOut>>(`${this.url}/locations`, body)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Updates the location information for the specified ID.\r\n *\r\n * @param {number} id - The unique identifier of the location to be updated.\r\n * @param {LocationIn} body - The updated location data to be sent in the request body.\r\n * @return {Observable<LocationOut>} An observable containing the updated location information.\r\n */\r\n putLocation (id: number, body: LocationIn): Observable<LocationOut> {\r\n return this.http.put<ApiSuccess<LocationOut>>(`${this.url}/locations/${id}`, body)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Deletes a location by its unique identifier.\r\n *\r\n * @param {number} id - The unique identifier of the location to be deleted.\r\n * @return {Observable<{}>} An observable that emits an empty object upon successful deletion.\r\n */\r\n deleteLocation (id: number): Observable<{}> {\r\n return this.http.delete<ApiSuccess<{}>>(`${this.url}/locations/${id}`)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves a list of active supply entities.\r\n *\r\n * @param {QueryParams} params - The query parameters to filter supply entities.\r\n * @return {Observable<SupplyEntitiesOut>} Observable emitting supply entities data.\r\n */\r\n getSupplyEntitiesActives (params: QueryParams): Observable<SupplyEntitiesOut> {\r\n return this.http.get<ApiSuccess<SupplyEntitiesOut>>(`${this.url}/supply-entities/actives`, { params })\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves supply entities based on the provided query parameters.\r\n *\r\n * @param {QueryParams} params - The query parameters used to filter and fetch the supply entities.\r\n * @return {Observable<SupplyEntitiesOut>} An observable that emits the supply entities data.\r\n */\r\n getSupplyEntities (params: QueryParams): Observable<SupplyEntitiesOut> {\r\n return this.http.get<ApiSuccess<SupplyEntitiesOut>>(`${this.url}/supply-entities`, { params })\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Sends supply entities information to the server and receives the processed supply entities data in response.\r\n *\r\n * @param {SupplyEntitiesIn} body - The supply entities data to be sent to the server.\r\n * @return {Observable<SupplyEntitiesOut>} An observable containing the processed supply entities data.\r\n */\r\n putSupplyEntities (body: SupplyEntitiesIn): Observable<SupplyEntitiesOut> {\r\n return this.http.post<ApiSuccess<SupplyEntitiesOut>>(`${this.url}/accounts`, body)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Fetches a list of employees based on the specified query parameters.\r\n *\r\n * @param {QueryParams} params - The parameters to filter and sort the employees.\r\n * @return {Observable<EmployeesOut>} An observable that emits the list of employees.\r\n */\r\n getEmployees (params: QueryParams): Observable<EmployeesOut> {\r\n return this.http.get<ApiSuccess<EmployeesOut>>(`${this.url}/employees`, {\r\n params,\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Fetches an employee's details based on the provided employee ID.\r\n *\r\n * @param {number} id - The unique identifier of the employee.\r\n * @return {Observable<EmployeeOut>} An observable that emits the employee's details.\r\n */\r\n getEmployee (id: number): Observable<EmployeeOut> {\r\n return this.http.get<ApiSuccess<EmployeeOut>>(`${this.url}/employees/${id}`)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Sends a POST request to create a new employee record.\r\n *\r\n * @param {EmployeeIn} body - The data of the employee to be created.\r\n * @return {Observable<EmployeeOut>} An observable containing the created employee data.\r\n */\r\n postEmployee (body: EmployeeIn): Observable<EmployeeOut> {\r\n return this.http.post<ApiSuccess<EmployeeOut>>(`${this.url}/employees`, body)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Updates an existing employee record with the specified data.\r\n *\r\n * @param {number} id - The unique identifier of the employee to be updated.\r\n * @param {EmployeeIn} body - The employee data to update the record with.\r\n * @return {Observable<EmployeeOut>} An observable containing the updated employee data.\r\n */\r\n putEmployee (id: number, body: EmployeeIn): Observable<EmployeeOut> {\r\n return this.http.put<ApiSuccess<EmployeeOut>>(`${this.url}/employees/${id}`, body)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Deletes an employee based on the provided ID.\r\n *\r\n * @param {number} id - The unique identifier of the employee to delete.\r\n * @return {Observable<{}>} An observable containing the response data after the employee is deleted.\r\n */\r\n deleteEmployee (id: number): Observable<{}> {\r\n return this.http.delete<ApiSuccess<{}>>(`${this.url}/employees/${id}`)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves the list of employees for a specified location based on provided query parameters.\r\n *\r\n * @param {QueryParams} params - The query parameters used to filter and retrieve the location employees.\r\n * @returns {Observable<LocationEmployeesOut>} An observable that emits the list of employees for the specified location.\r\n */\r\n getLocationEmployees (params: QueryParams): Observable<LocationEmployeesOut> {\r\n return this.http.get<ApiSuccess<LocationEmployeesOut>>(`${this.url}/location-employees`, {\r\n params,\r\n }).pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Fetches the location employee details for a given employee ID.\r\n *\r\n * @param {number} id - The unique identifier of the employee whose location details are to be retrieved.\r\n * @return {Observable<LocationEmployeeOut>} An observable containing the location employee details.\r\n */\r\n getLocationEmployee (id: number): Observable<LocationEmployeeOut> {\r\n return this.http.get<ApiSuccess<LocationEmployeeOut>>(`${this.url}/location-employees/${id}`)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Deletes a specific location employee by their unique identifier.\r\n *\r\n * @param {number} id - The unique identifier of the employee to be deleted.\r\n * @return {Observable<{}>} - An observable emitting the server's response after the deletion.\r\n */\r\n deleteLocationEmployee (id: number): Observable<{}> {\r\n return this.http.delete<ApiSuccess<{}>>(`${this.url}/location-employees/${id}`)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Sends a batch of location-employee associations to the server for processing.\r\n *\r\n * @param {LocationEmployeeBatchIn} body - The object containing a batch of location-employee data to be posted.\r\n * @return {Observable<EmployeeOut>} An observable emitting the processed employee data from the server's response.\r\n */\r\n postLocationEmployeeBatch (body: LocationEmployeeBatchIn): Observable<EmployeeOut> {\r\n return this.http.post<ApiSuccess<EmployeeOut>>(`${this.url}/location-employees/batch`, body)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves a list of countries where the company operates.\r\n *\r\n * @param {QueryParams} params - The query parameters for the API request.\r\n * @return {Observable<CompanyCountriesOut>} An observable containing the list of company countries.\r\n */\r\n getCompanyCountries (params: QueryParams): Observable<CompanyCountriesOut> {\r\n return this.http.get<ApiSuccess<CompanyCountriesOut>>(`${this.url}/company-countries`, { params })\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Retrieves the country information for a specified company by its ID.\r\n *\r\n * @param {number} id - The unique identifier of the company.\r\n * @return {Observable<CompanyCountryOut>} An observable containing the country information of the company.\r\n */\r\n getCompanyCountry (id: number): Observable<CompanyCountryOut> {\r\n return this.http.get<ApiSuccess<CompanyCountryOut>>(`${this.url}/company-countries/${id}`)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Sends a request to update or create a company country entry on the server.\r\n *\r\n * @param {CompanyCountryIn} body The data object representing the company country information to be sent to the server.\r\n * @return {Observable<CompanyCountryOut>} An observable containing the server response with the updated or created company country data.\r\n */\r\n postCompanyCountry (body: CompanyCountryIn): Observable<CompanyCountryOut> {\r\n return this.http.put<ApiSuccess<CompanyCountryOut>>(`${this.url}/company-countries`, body)\r\n .pipe(map(({ data }) => data))\r\n }\r\n\r\n /**\r\n * Updates the country information for a specific company.\r\n *\r\n * @param {number} id - The unique identifier of the company whose country information needs to be updated.\r\n * @param {CompanyCountryIn} body - The updated country information to be applied to the company.\r\n * @return {Observable<Company