@experteam-mx/ngx-services
Version:
Angular common services for Experteam apps
1,600 lines (1,570 loc) • 325 kB
TypeScript
import * as i0 from '@angular/core';
import { InjectionToken, ModuleWithProviders, EnvironmentProviders } from '@angular/core';
import { Observable } from 'rxjs';
import { HttpResponse, HttpRequest, HttpHandlerFn, HttpEvent, HttpParams, HttpHeaders } from '@angular/common/http';
import { Channel } from 'pusher-js';
/**
* Represents the configuration settings for the application's environment.
* This type includes various API endpoint URLs, authentication details, caching options, and other relevant settings.
*
* Properties:
* - apiCompaniesUrl: The URL for the companies API endpoint.
* - apiEventsUrl: The URL for the events API endpoint.
* - apiInvoicesUrl: The URL for the invoices API endpoint.
* - apiReportsUrl: The URL for the reports API endpoint.
* - apiSecurityUrl: The URL for the security-related API endpoint.
* - apiShipmentUrl: The URL for the shipment API endpoint.
* - authCookie: The name of the authentication cookie used for user sessions.
* - cacheTtl: Optional. Specifies the time-to-live (TTL) for cached items.
* - printUrl: Optional. The URL used for generating or downloading printable documents.
* - secretKey: A secret key used for authentication or other secure operations.
*/
type Environment = {
apiBillingCO?: string;
apiBillingDO?: string;
apiBillingGT?: string;
apiBillingMX?: string;
apiBillingPA?: string;
apiBillingSV?: string;
apiCashOperationsUrl?: string;
apiCatalogsUrl?: string;
apiCompaniesUrl?: string;
apiCompositionUrl?: string;
apiCustomsUrl?: string;
apiDiscountsUrl?: string;
apiEToolsAutoBilling?: string;
apiEventsUrl?: string;
apiExternalOperationsKey?: string;
apiExternalOperationsUrl?: string;
apiInventoriesUrl?: string;
apiInvoicesUrl?: string;
apiNotificationsUrl?: string;
apiOpenItemsUrl?: string;
apiQuotesUrl?: string;
apiReportsUrl?: string;
apiSecurityUrl?: string;
apiServicesUrl?: string;
apiShipmentUrl?: string;
apiSuppliesUrl?: string;
apiSurveysKey?: string;
apiSurveysUrl?: string;
authCookie?: string;
cacheTtl?: number;
printUrl?: string;
secretKey?: string;
sockets?: {
app_key: string;
debug?: boolean;
port: number;
url: string;
};
};
/**
* Injection token used to inject environment configurations.
*
* `ENVIRONMENT_TOKEN` is a dependency injection token that allows
* for the provision and retrieval of environment-specific configurations
* within the application. This token is typically associated with an
* `Environment` type that defines the structure of the configuration.
*/
declare const ENVIRONMENT_TOKEN: InjectionToken<Environment>;
declare class NgxServicesModule {
/**
* Returns a module with providers for the NgxServicesModule.
*
* @param {Environment} environment - The environment configuration object.
*
* @return {ModuleWithProviders<NgxServicesModule>} The module with providers for the NgxServicesModule.
*
* @deprecated Use `provideNgxServices(environment)` in `ApplicationConfig.providers`
* for standalone applications. This API will be removed in `20.2.0`.
*/
static forRoot(environment: Environment): ModuleWithProviders<NgxServicesModule>;
static ɵfac: i0.ɵɵFactoryDeclaration<NgxServicesModule, never>;
static ɵmod: i0.ɵɵNgModuleDeclaration<NgxServicesModule, never, never, never>;
static ɵinj: i0.ɵɵInjectorDeclaration<NgxServicesModule>;
}
/**
* Provides ngx-services dependencies for standalone Angular applications.
*
* Register this provider in `ApplicationConfig.providers` so all services in
* this library can resolve the environment-based configuration.
*/
declare function provideNgxServices(environment: Environment): EnvironmentProviders;
interface ApiResponse {
status: 'success' | 'fail' | 'error';
}
interface ApiSuccess<T> extends ApiResponse {
status: 'success';
data: T;
}
interface ApiModel {
id: number;
}
interface LaravelModel extends ApiModel {
is_active: boolean;
created_at: string;
updated_at: string;
}
interface ActiveLessLaravelModel extends ApiModel {
created_at: string;
updated_at: string;
}
interface SymfonyModel extends ApiModel {
isActive: boolean;
createdAt: string;
updatedAt: string;
}
interface ActiveLessSymfonyModel extends ApiModel {
createdAt: string;
updatedAt: string;
}
type QueryParams = {
[param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
};
interface Translations {
[key: string]: TranslateLang;
}
interface TranslateLang {
[langCode: string]: string;
}
interface CoCustomer {
identification_number: string;
identification_type_id: number;
customer_type_id: number | null;
company_name: string;
full_name: string;
email: string;
phone_code: string;
phone_number: string;
birth_date: string | null;
postal_code: string;
state: string;
county_name: string | null;
city_name: string | null;
address_line1: string;
address_line2: string | null;
address_line3: string | null;
company_id: number | null;
country_id: number | null;
extra_fields: CoExtraFields;
}
interface CoExtraFields {
social_reason: string;
comercial_name: string | null;
mercantile_registration: string | null;
notification_mail: string;
fiscal_responsibilities: string[];
tributes: string[];
fiscal_regime: string;
first_name: string;
other_name: string;
last_name: string;
second_last_name: string;
department: string;
municipality: string;
open_id: number;
[key: string]: string | number | boolean | string[] | null;
}
interface CoDepartment extends LaravelModel {
code: string;
description: string;
}
interface CoMunicipality extends LaravelModel {
department_id: number;
code: string;
description: string;
}
interface CoPostalCode extends LaravelModel {
code: string;
}
interface CoFiscalRegime extends LaravelModel {
code: string;
description: string;
}
interface CoFiscalResponsibility extends LaravelModel {
code: string;
description: string;
applies_to: string;
}
interface CoTribute extends LaravelModel {
code: string;
name: string;
type: string;
description: string;
applies_tribute: boolean;
applies_to_tribute: string;
}
type CoGetCustomerOut = {
customer: CoCustomer;
};
type CoPostCustomerOut = {
identification_number: string;
action: 'created' | 'update';
open_services_response: {
success: boolean;
adq_id: number;
};
};
type CoDepartmentsOut = {
departments: CoDepartment[];
total: number;
};
type CoMunicipalitiesOut = {
municipalities: CoMunicipality[];
total: number;
};
type CoPostalCodesOut = {
postal_codes: CoPostalCode[];
total: number;
};
type CoFiscalRegimesOut = {
fiscal_regimes: CoFiscalRegime[];
total: number;
};
type CoFiscalResponsibilitiesOut = {
fiscal_responsibilities: CoFiscalResponsibility[];
total: number;
};
type CoTributesOut = {
tributes: CoTribute[];
total: number;
};
type CoCustomerIn = {
customer: {
identification_number: string;
identification_type_id: number;
company_name: string;
full_name: string;
email: string;
phone_number: string;
postal_code: string;
state: string;
address_line1: string;
extra_fields: {
social_reason: string;
comercial_name: string | null;
notification_mail: string;
fiscal_responsibilities: string[];
tributes: string[];
fiscal_regime: string | null;
first_name: string | null;
other_name: string | null;
last_name: string | null;
second_last_name: string | null;
department: string;
municipality: string;
contacts?: [] | null;
open_id?: number;
};
};
};
declare class ApiBillingCOService {
private environments;
private http;
/**
* Retrieves the URL for the billing API.
* If the URL is not defined in the environments configuration, returns an empty string.
*
* @returns {string} The billing API URL or an empty string if not set.
*/
get url(): string;
/**
* Retrieves the information of a customer by its identifier.
*
* @param {number} id - Unique customer identifier.
* @returns {Observable<CoGetCustomerOut>}
* Observable emitting the customer information.
*/
getCustomer(id: number): Observable<CoGetCustomerOut>;
/**
* Creates a new customer.
*
* @param {CoCustomerIn} body - Customer data to be created.
* @returns {Observable<CoPostCustomerOut>}
* Observable emitting the created customer information.
*/
postCustomer(body: CoCustomerIn): Observable<CoPostCustomerOut>;
/**
* Retrieves the list of departments based on the provided query parameters.
*
* @param {QueryParams} params - Query parameters used to filter or paginate the request.
* @returns {Observable<CoDepartmentsOut>}
* Observable emitting the departments list.
*/
getDepartments(params: QueryParams): Observable<CoDepartmentsOut>;
/**
* Retrieves the list of municipalities based on the provided query parameters.
*
* @param {QueryParams} params - Query parameters used to filter or paginate the request.
* @returns {Observable<CoMunicipalitiesOut>}
* Observable emitting the municipalities list.
*/
getMunicipalities(params: QueryParams): Observable<CoMunicipalitiesOut>;
/**
* Retrieves the list of postal codes based on the provided query parameters.
*
* @param {QueryParams} params - Query parameters used to filter or paginate the request.
* @returns {Observable<CoPostalCodesOut>}
* Observable emitting the postal codes list.
*/
getPostalCodes(params: QueryParams): Observable<CoPostalCodesOut>;
/**
* Retrieves the list of fiscal regimes based on the provided query parameters.
*
* @param {QueryParams} params - Query parameters used to filter or paginate the request.
* @returns {Observable<CoFiscalRegimesOut>}
* Observable emitting the fiscal regimes list.
*/
getFiscalRegimes(params: QueryParams): Observable<CoFiscalRegimesOut>;
/**
* Retrieves the list of fiscal responsibilities based on the provided query parameters.
*
* @param {QueryParams} params - Query parameters used to filter or paginate the request.
* @returns {Observable<CoFiscalResponsibilitiesOut>}
* Observable emitting the fiscal responsibilities list.
*/
getFiscalResponsibilities(params: QueryParams): Observable<CoFiscalResponsibilitiesOut>;
/**
* Retrieves the list of tributes based on the provided query parameters.
*
* @param {QueryParams} params - Query parameters used to filter or paginate the request.
* @returns {Observable<CoTributesOut>}
* Observable emitting the tributes list.
*/
getTributes(params: QueryParams): Observable<CoTributesOut>;
static ɵfac: i0.ɵɵFactoryDeclaration<ApiBillingCOService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<ApiBillingCOService>;
}
interface IncomeType extends LaravelModel {
code: string;
name: string;
billing_code: string;
}
type IncomeTypesOut = {
income_types: IncomeType[];
total: number;
};
declare class ApiBillingDOService {
private environments;
private http;
/**
* Gets the base URL for Billing DO API endpoints.
*
* @returns {string} Billing DO API base URL, or an empty string when it is not configured.
*/
get url(): string;
/**
* Retrieves the list of income types from Billing DO.
*
* @returns {Observable<IncomeTypesOut>} Observable that emits the income types payload.
*/
getIncomeTypes(): Observable<IncomeTypesOut>;
static ɵfac: i0.ɵɵFactoryDeclaration<ApiBillingDOService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<ApiBillingDOService>;
}
interface BillingPaCustomer {
document_id: number;
name: string;
number: string;
type_ruc: number;
type_ruc_code: string;
verification_code: string;
type_rec: string;
identification_type_id: number;
}
interface District extends LaravelModel {
code: string;
name: string;
province_id: number;
}
interface Parish extends LaravelModel {
code: string;
name: string;
district_id: number;
province_id: number;
}
interface Province extends LaravelModel {
code: string;
name: string;
}
type DistrictsOut = {
total: number;
districts: District[];
};
type BillingPaCustomerOut = {
customer: BillingPaCustomer;
};
type ParishesOut = {
total: number;
parishes: Parish[];
};
type ProvincesOut = {
total: number;
provinces: Province[];
};
interface ApiBillingConfigurable {
getConfigs(): Observable<BillingConfigsOut>;
getConfig(id: number): Observable<BillingConfigOut>;
postConfigs(body: BillingConfigIn): Observable<BillingConfigOut>;
getDistricts?(params: QueryParams): Observable<DistrictsOut>;
getParishes?(params: QueryParams): Observable<ParishesOut>;
getProvinces?(params: QueryParams): Observable<ProvincesOut>;
}
type BillingConfig = {
label: string;
field: string;
is_required: boolean;
type?: string;
};
type BillingConfigsOut = {
configurations: BillingConfig[];
total: number;
};
type BillingConfigIn = {
[key: string]: string | number;
};
type BillingConfigOut = {
[key: string]: [key: string | number][];
};
declare class ApiBillingGtService implements ApiBillingConfigurable {
private environments;
private http;
/**
* Gets the base URL for Billing GT API endpoints.
*
* @returns {string} Billing GT API base URL, or an empty string when it is not configured.
*/
get url(): string;
/**
* Retrieves the list of billing configurations by location.
*
* @returns {Observable<BillingConfigsOut>} Observable that emits the billing configurations payload.
*/
getConfigs(): Observable<BillingConfigsOut>;
/**
* Retrieves billing configuration details for a location.
*
* @param {number} id - Location identifier to fetch.
* @returns {Observable<BillingConfigOut>} Observable that emits the location billing configuration payload.
*/
getConfig(id: number): Observable<BillingConfigOut>;
/**
* Creates a billing configuration for a location.
*
* @param {BillingConfigIn} body - Billing configuration payload for the location.
* @returns {Observable<BillingConfigOut>} Observable that emits the created billing configuration payload.
*/
postConfigs(body: BillingConfigIn): Observable<BillingConfigOut>;
static ɵfac: i0.ɵɵFactoryDeclaration<ApiBillingGtService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<ApiBillingGtService>;
}
interface CFDI extends LaravelModel {
code: string;
description: string;
fiscal_regimen_receptor: string;
moral_person: string;
physical_person: string;
}
interface FiscalRegimen extends LaravelModel {
code: string;
description: string;
moral_person: string;
physical_person: string;
}
interface PostalCodeBillings extends LaravelModel {
city: string;
municipality: string;
state: string;
suburb: string;
postal_code_number: string;
}
type FiscalRegimensAcceptedOut = {
total: number;
cfdi_use: CFDI[];
};
type FiscalRegimensOut = {
total: number;
fiscal_regimen: FiscalRegimen[];
};
type PostalCodesOut = {
postal_code: PostalCodeBillings[];
total: number;
};
declare class ApiBillingMxService {
private environments;
private http;
/**
* Gets the base URL for Billing MX API endpoints.
*
* @returns {string} Billing MX API base URL, or an empty string when it is not configured.
*/
get url(): string;
/**
* Retrieves the list of fiscal regimens from Billing MX.
*
* @returns {Observable<FiscalRegimensOut>} Observable that emits the fiscal regimens payload.
*/
getFiscalRegimens(): Observable<FiscalRegimensOut>;
/**
* Retrieves the CFDI uses accepted for a fiscal regimen.
*
* @param {number} fiscalRegimen Fiscal regimen identifier used to filter accepted CFDI uses.
* @returns {Observable<FiscalRegimensAcceptedOut>} Observable that emits the accepted CFDI uses payload.
*/
getFiscalRegimensAccepted(fiscalRegimen: number): Observable<FiscalRegimensAcceptedOut>;
/**
* Retrieves postal code information from Billing MX.
*
* @param {QueryParams} params Query parameters used by the postal codes endpoint.
* @returns {Observable<PostalCodesOut>} Observable that emits the postal code data payload.
*/
getPostalCodes(params: QueryParams): Observable<PostalCodesOut>;
static ɵfac: i0.ɵɵFactoryDeclaration<ApiBillingMxService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<ApiBillingMxService>;
}
declare class ApiBillingPaService implements ApiBillingConfigurable {
private environments;
private http;
/**
* Gets the base URL for Billing PA API endpoints.
*
* @returns {string} Billing PA API base URL, or an empty string when it is not configured.
*/
get url(): string;
/**
* Retrieves the list of districts.
*
* @param {QueryParams} params Query parameters used by the districts endpoint.
* @returns {Observable<DistrictsOut>} Observable that emits the districts payload.
*/
getDistricts(params: QueryParams): Observable<DistrictsOut>;
/**
* Retrieves the list of parishes.
*
* @param {QueryParams} params Query parameters used by the parishes endpoint.
* @returns {Observable<ParishesOut>} Observable that emits the parishes payload.
*/
getParishes(params: QueryParams): Observable<ParishesOut>;
/**
* Retrieves the list of provinces.
*
* @param {QueryParams} params Query parameters used by the provinces endpoint.
* @returns {Observable<ProvincesOut>} Observable that emits the provinces payload.
*/
getProvinces(params: QueryParams): Observable<ProvincesOut>;
/**
* Validates a customer using Billing PA.
*
* @param {QueryParams} params Query parameters used by the customer validation endpoint.
* @returns {Observable<BillingPaCustomerOut>} Observable that emits customer validation data.
*/
getValidateCustomer(params: QueryParams): Observable<BillingPaCustomerOut>;
/**
* Retrieves billing configurations by location.
*
* @returns {Observable<BillingConfigsOut>} Observable that emits billing configuration items.
*/
getConfigs(): Observable<BillingConfigsOut>;
/**
* Retrieves the billing configuration for a location.
*
* @param {number} id Location identifier.
* @returns {Observable<BillingConfigOut>} Observable that emits the location billing configuration payload.
*/
getConfig(id: number): Observable<BillingConfigOut>;
/**
* Creates a billing configuration for a location.
*
* @param {BillingConfigIn} body Billing configuration payload for the new location.
* @returns {Observable<BillingConfigOut>} Observable that emits the created billing configuration payload.
*/
postConfigs(body: BillingConfigIn): Observable<BillingConfigOut>;
static ɵfac: i0.ɵɵFactoryDeclaration<ApiBillingPaService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<ApiBillingPaService>;
}
interface PersonType extends LaravelModel {
code: string;
name: string;
}
interface EconomicActivity extends LaravelModel {
code: string;
name: string;
}
interface EstablishmentType extends LaravelModel {
code: string;
name: string;
}
interface Department extends LaravelModel {
code: string;
name: string;
}
interface Municipality extends LaravelModel {
code: string;
name: string;
department_code: string;
}
type EconomicActivitiesOut = {
economic_activities: EconomicActivity[];
total: number;
};
type PersonTypesOut = {
person_types: PersonType[];
total: number;
};
type EstablishmentTypesOut = {
establishment_types: EstablishmentType[];
total: number;
};
type DepartmentsOut = {
departments: Department[];
total: number;
};
type MunicipalitiesOut = {
municipalities: Municipality[];
total: number;
};
declare class ApiBillingSvService {
private environments;
private http;
/**
* Retrieves the URL for the billing API.
* If the URL is not defined in the environments configuration, returns an empty string.
*
* @returns {string} The billing API URL or an empty string if not set.
*/
get url(): string;
/**
* Fetches the list of economic activities based on the provided query parameters.
*
* @param {QueryParams} params - The query parameters used to filter the economic activities.
* @returns {Observable<EconomicActivitiesOut>} An observable that emits the list of economic activities.
*/
getEconomicActivities(params: QueryParams): Observable<EconomicActivitiesOut>;
/**
* Retrieves the list of person types based on given query parameters.
*
* @param {QueryParams} params - The query parameters used to filter the person types.
* @returns {Observable<PersonTypesOut>} An observable that emits a list of person types.
*/
getPersonTypes(params: QueryParams): Observable<PersonTypesOut>;
/**
* Fetches the list of establishment types.
*
* @param {QueryParams} params The query parameters to be sent with the HTTP request.
* @returns {Observable<EstablishmentTypesOut>} An observable that emits the establishment types data.
*/
getEstablishmentTypes(params: QueryParams): Observable<EstablishmentTypesOut>;
/**
* Fetches the list of departments based on the provided query parameters.
*
* @param {QueryParams} params - The query parameters to filter or modify the departments fetch request.
* @returns {Observable<DepartmentsOut>} An observable emitting the list of departments.
*/
getDepartments(params: QueryParams): Observable<DepartmentsOut>;
/**
* Retrieves a list of municipalities based on the provided query parameters.
*
* @param {QueryParams} params - The query parameters used to filter the municipalities.
* @returns {Observable<MunicipalitiesOut>} An observable that emits the retrieved municipalities data.
*/
getMunicipalities(params: QueryParams): Observable<MunicipalitiesOut>;
static ɵfac: i0.ɵɵFactoryDeclaration<ApiBillingSvService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<ApiBillingSvService>;
}
declare enum DepositTypeCode {
CASH = "CASH",
CHECK = "CHECK"
}
declare enum OpeningStatusCode {
OPEN = "ABT",
UPDATING_INVENTORY = "AIV",
FINISH_INVENTORY_UPDATE = "FIV",
PRE_CLOSING_REQUEST = "SPR",
PRE_CLOSING_DENIED = "PRD",
PRE_CLOSING_APPROVED = "PRA",
PRE_CLOSING = "PRE",
CLOSED = "CER"
}
declare enum TransferenceTypeCode {
RETC = "RETC"
}
interface InstallationCountryReferenceCurrency extends ActiveLessSymfonyModel {
installationId?: number;
countryReferenceCurrencyId: number;
minCashValue?: number;
maxCashValue?: number;
}
interface CashValueSummary {
countryReferenceCurrencyId: number;
currencyCode: string;
balanceInitial: number;
transfers: number;
payments: number;
totalBalance: number;
minCashValue: number;
maxAmount: number;
}
interface OpeningTransference extends ActiveLessSymfonyModel {
openingId: number;
openingReferenceId: number;
transferenceTypeId: number;
userId: number;
amount: number;
countryReferenceCurrencyId: number;
transferenceCode: string;
receiptNumber: string;
userName: string | null;
userUsername: string | null;
currencyCode: string | null;
maxCashExceeded: boolean;
transferenceType: TransferenceType;
}
interface ReceiptFile {
format: string;
base64: string;
}
interface TransferenceType extends SymfonyModel {
code: string;
name: string;
}
interface Opening extends SymfonyModel {
openingId: number;
installationId: number;
userId: number;
roleId: number;
openingStatus: OpeningStatus;
closing: Closing | null;
openingCountryReferenceCurrencies: OpeningCountryReferenceCurrency[] | null;
openingHistories: OpeningHistory[];
locationId: number;
openingTransferences: OpeningTransference[];
userName: number;
userUsername: string;
locationName: string;
locationCode: string;
installationNumber: number;
closingPending?: boolean;
firstOfTheDay: boolean;
maxCashExceeded?: boolean;
}
interface OpeningStatus extends SymfonyModel {
code: OpeningStatusCode;
name: string;
isActive: boolean;
}
interface Closing extends SymfonyModel {
locationId: number;
userId: number;
closingPayments: ClosingPayment[];
deposits: Deposit[];
}
interface ClosingPayment extends SymfonyModel {
countryReferenceCurrencyId: number;
amount: number;
locationId: number;
paymentId: number;
}
interface Deposit extends SymfonyModel {
locationId: number;
userId: number;
countryReferenceCurrencyId: number;
countryPaymentTypeId: number;
countryPaymentTypeName: string;
amount: number;
number: string;
currencyCode: string;
bankAccount: BankAccount;
}
interface BankAccount extends SymfonyModel {
number: string;
name: string;
bank: Bank;
bankAccountType: BankAccountType;
countryReferenceCurrencyId: number;
sapNumber: string;
operationTypeId: number;
depositTypeCode: DepositTypeCode[];
isDefault: boolean;
label: string;
}
interface Bank extends SymfonyModel {
name: string;
companyCountryId: number;
}
interface BankAccountType extends SymfonyModel {
code: string;
name: string;
}
interface OpeningHistory extends SymfonyModel {
userId: number;
openingStatus: OpeningStatus;
description: string;
}
interface OpeningCountryReferenceCurrency extends SymfonyModel {
countryReferenceCurrencyId: number;
balanceInitial: number;
balanceFinal: number;
currencyCode: string;
installationCountryReferenceCurrency: InstallationCountryReferenceCurrency | null;
}
type InstallationCountryReferenceCurrenciesOut = {
total: number;
installationCountryReferenceCurrencies: InstallationCountryReferenceCurrency[];
};
type InstallationCountryReferenceCurrencyIn = {
installationId?: number;
countryReferenceCurrencyId: number;
minCashValue?: number;
maxCashValue?: number;
};
type InstallationCountryReferenceCurrencyOut = {
installationCountryReferenceCurrencies: InstallationCountryReferenceCurrency;
};
type CashValueSummaryOut = {
total: number;
cashValueSummary: CashValueSummary[];
};
type OpeningTransferenceIn = {
openingId: number;
amount: number;
countryReferenceCurrencyId: number;
transferenceTypeCode: string;
};
type OpeningTransferenceOut = {
openingTransference: OpeningTransference;
};
type ReceiptFileOut = {
receipt: ReceiptFile;
};
type DepositSlipOut = {
depositSlip: {
format: string;
base64: string;
};
};
type OpeningsOut = {
openings: Opening[];
total: number;
};
type OpeningIn = {
roleId: number;
installationId: number;
};
type OpeningOut = {
opening: Opening;
};
type BankAccountsOut = {
bankAccounts: BankAccount[];
total: number;
};
type OpeningPreClosingRequestIn = {
approved: boolean;
};
type ClosingIn = {
deposits: {
countryReferenceCurrencyId: number;
cash: {
deposit: boolean;
bankAccountId: number | null;
partialDeposit: boolean;
depositAmount: number | null;
};
checkingBankAccountId: number | null;
}[];
};
type ClosingOut = {
closing: Closing;
};
type DepositIn = {
number: string;
};
type DepositOut = {
deposit: Deposit;
};
declare class ApiCashOperationsService {
private environments;
private http;
/**
* Retrieves the URL for the cash operations API from the environment configurations.
*
* @returns {string} The URL of the cash operations API.
*/
get url(): string;
/**
* Creates a new installation country reference currency.
*
* @param {InstallationCountryReferenceCurrencyIn} body - The data for the new reference currency.
* @returns {Observable<InstallationCountryReferenceCurrencyOut>} The created reference currency.
*/
postInstallationCountryReferenceCurrency(body: InstallationCountryReferenceCurrencyIn): Observable<InstallationCountryReferenceCurrencyOut>;
/**
* Updates an existing installation country reference currency.
*
* @param {number} id - The ID of the reference currency to update.
* @param {InstallationCountryReferenceCurrencyIn} body - The updated data for the reference currency.
* @returns {Observable<InstallationCountryReferenceCurrencyOut>} The updated reference currency.
*/
putInstallationCountryReferenceCurrency(id: number, body: InstallationCountryReferenceCurrencyIn): Observable<InstallationCountryReferenceCurrencyOut>;
/**
* Retrieves a list of installation country reference currencies based on query parameters.
*
* @param {QueryParams} params - Query parameters for filtering the currencies.
* @returns {Observable<InstallationCountryReferenceCurrenciesOut>} The list of reference currencies.
*/
getInstallationCompanyCountryCurrencies(params: QueryParams): Observable<InstallationCountryReferenceCurrenciesOut>;
/**
* Retrieves the cash value summary for a specific opening ID.
*
* @param {number} id - The ID of the opening for which to retrieve the cash value summary.
* @returns {Observable<CashValueSummaryOut>} An observable that emits the cash value summary data.
*/
getOpeningCashValueSummary(id: number): Observable<CashValueSummaryOut>;
/**
* Creates a new opening transference record.
*
* @param {OpeningTransferenceIn} body - The data to create the new opening transference.
* @returns {Observable<OpeningTransferenceOut>} An observable that emits the newly created opening transference.
*/
postOpeningTransferences(body: OpeningTransferenceIn): Observable<OpeningTransferenceOut>;
/**
* Retrieves the receipt file associated with the given opening transference ID.
*
* @param {number} id - The ID of the opening transference whose receipt is to be retrieved.
* @returns {Observable<ReceiptFileOut>} An observable that emits the receipt file data.
*/
getOpeningTransferenceReceipt(id: number): Observable<ReceiptFileOut>;
/**
* Retrieves a deposit slip by its ID.
* @param id - The unique identifier of the deposit slip to retrieve
* @returns An Observable that emits the deposit slip data
*/
getDepositSlip(id: number): Observable<DepositSlipOut>;
/**
* Creates a batch deposit slip for the provided deposit IDs.
*
* @param {number[]} ids - The deposit IDs to include in the batch slip.
* @returns {Observable<DepositSlipOut>} The generated deposit slip.
*/
postDepositsBatchSlip(ids: number[]): Observable<DepositSlipOut>;
/**
* Creates a new opening.
*
* @param {OpeningIn} body - The data to create the new opening.
* @returns {Observable<OpeningOut>} An observable that emits the newly created opening.
*/
postOpening(body: OpeningIn): Observable<OpeningOut>;
/**
* Retrieves a specific opening by its ID.
*
* @param {number} id - The ID of the opening to retrieve.
* @returns {Observable<OpeningOut>} The requested opening.
*/
getOpening(id: number): Observable<OpeningOut>;
/**
* Retrieves openings using the provided query parameters.
*
* @param {QueryParams} params - Query parameters for filtering openings.
* @returns {Observable<OpeningsOut>} The list of openings.
*/
getOpenings(params: QueryParams): Observable<OpeningsOut>;
/**
* Retrieves bank accounts using the provided query parameters.
*
* @param {QueryParams} params - Query parameters for filtering bank accounts.
* @returns {Observable<BankAccountsOut>} The list of bank accounts.
*/
getBankAccounts(params: QueryParams): Observable<BankAccountsOut>;
/**
* Creates a pre-closing request for the current opening.
*
* @returns {Observable<{}>} The pre-closing request response.
*/
postOpeningPreClosingRequest(): Observable<{}>;
/**
* Updates a pre-closing request for the specified opening.
*
* @param {number} id - The ID of the opening to update.
* @param {OpeningPreClosingRequestIn} body - The updated pre-closing request data.
* @returns {Observable<OpeningOut>} The updated opening.
*/
patchOpeningPreClosingRequest(id: number, body: OpeningPreClosingRequestIn): Observable<OpeningOut>;
/**
* Creates a pre-closing for the current opening.
*
* @returns {Observable<{}>} The pre-closing response.
*/
postOpeningPreClosing(): Observable<{}>;
/**
* Creates a closing record.
*
* @param {ClosingIn} body - The closing data to submit.
* @returns {Observable<ClosingOut>} The created closing record.
*/
postClosing(body: ClosingIn): Observable<ClosingOut>;
/**
* Updates an existing deposit.
*
* @param {number} id - The ID of the deposit to update.
* @param {DepositIn} body - The updated deposit data.
* @returns {Observable<DepositOut>} The updated deposit.
*/
patchDeposit(id: number, body: DepositIn): Observable<DepositOut>;
static ɵfac: i0.ɵɵFactoryDeclaration<ApiCashOperationsService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<ApiCashOperationsService>;
}
declare enum ViewSectionOption {
SHIPMENT = "shipment",
PICKUP = "pickup",
EMPLOYEE_DHL = "employeeDhl",
BILLING = "billing",
CUSTOMER_RESTRICTION = "customerRestriction"
}
interface Country extends SymfonyModel {
name: string;
code: string;
codeAndName: string;
isoCode: string;
codePhone: string;
locale: string;
locationType: LocationType;
unit: Unit;
timezone: string;
hasImportService: boolean;
phoneDigits: number;
locationTypeFields: LocationTypeFields;
postalCodeSuffixRegex: string;
decimalPoint: number;
max_quantity_document_piece: number;
max_quantity_package_piece: number;
weight_restriction_piece: number;
restriction_shipment: number;
restriction_dimension: number;
max_declared_value: number;
decimal_separator: string;
thousands_separator: string;
label_printer_name: string;
receipt_printer_name: string;
others_printer_name: string;
territories: number[];
use_billing?: boolean;
translations: Translations;
}
interface LocationType extends SymfonyModel {
code: string;
name: string;
priority: number;
}
interface LocationTypeFields {
city: City;
postalCode: PostalCode;
suburb: Suburb;
}
interface City {
enabled: boolean;
required: boolean;
}
interface PostalCode {
enabled: boolean;
required: boolean;
}
interface Suburb {
enabled: boolean;
required: boolean;
}
interface Language extends SymfonyModel {
code: string;
name: string;
}
interface State extends SymfonyModel {
country: Country;
code: string;
name: string;
}
interface IdentificationType extends SymfonyModel {
code: string;
countryId: number;
identificationType: number | null;
name: string;
viewSection?: Record<ViewSectionOption, boolean>;
regex: string[] | null;
isExternalValidation: boolean;
}
interface OperationType extends SymfonyModel {
code: string;
name: string;
translations?: Translations;
}
interface BoardingProcessStatus {
id: number;
code: string;
createdAt: string;
updatedAt: string;
}
interface ExtraCharge extends SymfonyModel {
code: string;
name: string;
isDiscount: boolean;
aggregated: boolean;
}
interface Region extends SymfonyModel {
code: string;
name: string;
country: Country;
}
interface Zone extends SymfonyModel {
code: string;
name: string;
country: Country;
}
interface ManagementArea extends SymfonyModel {
name: string;
country: Country;
}
interface CancellationReason extends SymfonyModel {
code: string;
name: string;
eventReasonCode: string;
countryId: number;
}
interface Currency extends SymfonyModel {
code: string;
name: string;
symbol: string;
}
interface Currency extends SymfonyModel {
code: string;
name: string;
symbol: string;
}
interface Unit extends SymfonyModel {
name: string;
weight: string;
dimension: string;
}
interface Unit extends SymfonyModel {
name: string;
weight: string;
dimension: string;
}
interface ShipmentScope extends SymfonyModel {
code: string;
name: string;
}
interface ShipmentContentType extends SymfonyModel {
code: string;
name: string;
}
interface GenericFolio extends SymfonyModel {
countryId: number;
code: string;
customer: string;
accountNumber: string;
content: string;
packaging: true;
destinationFullName: string;
destinationAddressLine1: string;
destinationAddressLine2: string;
destinationAddressLine3: string;
destinationCountryId: number;
destinationCountryCode: string;
destinationPostalCode: string;
destinationCityName: string;
destinationCountyName: string;
destinationStateCode: string;
destinationPhoneCode: string;
destinationPhoneNumber: string;
destinationEmail: string;
countryReferenceProductIds: number[];
productLocalCodes: string;
}
interface Product extends SymfonyModel {
globalCode: number;
localCode: string;
globalName: string;
localName: string;
isDocument: string;
restrictedAccounts: {
id: string;
number: string;
isActive: boolean;
}[];
discounts: [];
}
interface ShipmentIncomeType extends SymfonyModel {
countryId: number;
code: string;
name: string;
}
interface UniqueFolio extends SymfonyModel {
code: number;
customer: string;
content: string;
kad: string | null;
executive: string;
}
interface ShipmentGroup extends SymfonyModel {
code: string;
name: string;
}
interface ShipmentStatus extends SymfonyModel {
code: string;
description: string;
}
interface Question extends SymfonyModel {
description: string;
type: string;
questionOrder: number;
countryId: number;
isRequiredValue: boolean;
}
interface Holiday extends SymfonyModel {
date: string;
description: string;
country: Country;
}
interface BusinessPartyTraderType extends SymfonyModel {
code: string;
name: string;
description: string | null;
category: string | null;
esbCode: string;
}
interface PackageLocation extends SymfonyModel {
name: string;
}
interface CountryToExportReason extends ApiModel {
name: string;
}
interface ExportReason extends SymfonyModel {
code: string;
name: string;
exportReasonType: ExportReasonTypes;
countryIds: CountryToExportReason[];
}
interface ExportReasonTypes extends SymfonyModel {
code: string;
name: string;
}
type OperationTypesOut = {
total: number;
operationTypes: OperationType[];
};
interface IdentificationTypesOut {
total: number;
identificationTypes: IdentificationType[];
}
type IdentificationTypeOut = {
IdentificationType: IdentificationType;
};
type IdentificationTypeIn = {
code: string;
countryId: number;
identificationType?: number | null;
name: string;
viewSection: Record<ViewSectionOption, boolean>;
regex: string[] | null;
isExternalValidation?: boolean;
isActive: boolean;
};
type ExtraChargesOut = {
total: number;
extracharges: ExtraCharge[];
};
type CountriesOut = {
total: number;
countries: Country[];
};
type CountryIn = {
code: string;
name: string;
locationTypeId: number;
unitId: number;
timezone: string;
hasImportService: boolean;
isActive: boolean;
isoCode: string;
codePhone: string;
phoneDigits: number;
};
type CountryOut = {
country: Country;
};
type RegionsOut = {
total: number;
regions: Region[];
};
type ZonesOut = {
total: number;
zones: Zone[];
};
type ManagementAreasOut = {
total: number;
managementAreas: ManagementArea[];
};
type CancellationReasonsOut = {
total: number;
cancellationReasons: CancellationReason[];
};
type CancellationReasonIn = {
code: string;
name: string;
eventReasonCode: string | null;
isActive: boolean;
countryId: number;
};
type CancellationReasonOut = {
cancellationReason: CancellationReason;
};
type CurrenciesOut = {
total: number;
currencies: Currency[];
};
type CurrencyOut = {
currency: Currency;
};
type LanguagesOut = {
total: number;
languages: Language[];
};
type UnitsOut = {
total: number;
units: Unit[];
};
type ShipmentScopesOut = {
total: number;
shipmentScopes: ShipmentScope[];
};
type ShipmentContentTypesOut = {
total: number;
shipmentContentTypes: ShipmentContentType[];
};
type ExtraChargeIn = {
code: string;
name: string;
isDiscount: boolean;
aggregated: boolean;
};
type ExtraChargeOut = {
extraCharge: ExtraCharge;
};
type GenericFoliosOut = {
total: number;
genericFolios: GenericFolio[];
};
type GenericFolioIn = {
accountNumber: string;
code: string;
content: string;
countryReferenceProductIds: number[];
customer: string;
destinationAddressLine1: string;
destinationAddressLine2: string;
destinationAddressLine3: string;
destinationCityName?: string;
destinationCountryId: number;
destinationCountyName?: string;
destinationEmail: string;
destinationFullName: string;
destinationPhoneCode: string;
destinationPhoneNumber: string;
destinationPostalCode?: string;
destinationStateCode?: string;
isActive: boolean;
packaging: boolean;
countryId: number;
};
type GenericFolioOut = {
genericFolio: GenericFolio;
};
type ProductIn = {
globalCode: number;
localCode: string;
globalName: string;
localName: string;
isDocument: boolean;
};
type ProductOut = {
product: Product;
};
type ShipmentIncomeTypesOut = {
total: number;
shipmentIncomeTypes: ShipmentIncomeType[];
};
type ShipmentIncomeTypeIn = {
countryId: number;
code: string;
name: string;
isActive: boolean;
};
type ShipmentIncomeTypeOut = {
shipmentIncomeType: ShipmentIncomeType;
};
type UniqueFolioIn = {
code: number;
customer: string;
content: string;
kad: string | null;
executive: string;
isActive: boolean;
};
type UniqueFolioOut = {
uniqueFolio: UniqueFolio;
};
type UniqueFoliosOut = {
total: number;
uniqueFolios: UniqueFolio[];
};
type ShipmentGroupsOut = {
shipmentGroups: ShipmentGroup[];
total: number;
};
type ShipmentStatusesOut = {
shipmentStatuses: ShipmentStatus[];
total: number;
};
type QuestionsOut = {
questions: Question[];
total: number;
};
type QuestionOut = {
question: Question;
};
type QuestionIn = {
description: string;
type: 'marketing';
questionOrder: number;
isActive: boolean;
countryId: number;
isRequiredValue: boolean;
};
type HolidaysOut = {
holidays: Holiday[];
total: number;
};
type HolidayOut = {
holiday: Holiday;
};
type HolidayIn = {
date: string;
description: string;
countryId: number;
isActive: boolean;
};
type IdentificationTypeNumberValidationIn = {
identificationTypeId: number;
identificationNumber: string;
section: string;
};
type IdentificationTypeNumberValidationOut = {};
type BusinessPartyTraderTypesOut = {
total: number;
businessPartyTraderTypes: BusinessPartyTraderType[];
};
type PackageLocationsData = {
total: number;
packageLocations: PackageLocation[];
};
type ExportReasonsOut = {
exportReasons: ExportReason[];
total: number;
};
type ExportReasonIn = {
countryIds: number[];
name: string;
exportReasonType: number | null;
isActive: boolean;
};
type ExportReasonTypesOut = {
exportReasonTypes: ExportReasonTypes[];
total: number;
};
type ExportReasonOut = {
exportReason: ExportReason;
};
declare class ApiCatalogsService {
private environments;
private http;
/**
* Retrieves the URL for the reports API from the environment configurations.
*
* @return {string} The URL of the reports API.
*/
get url(): string;
/**
* Retrieves the list of collection payments
*
* @param {QueryParams} params - The query parameters used to fetch the operation types.
* @return {Observable<OperationTypesOut[]>} An observable that emits an array of operation type.
*/
getOperationTypes(params: QueryParams): Observable<OperationTypesOut>;
/**
* Retrieves the list of identificatios types
*
* @param {QueryParams} params - The query parameters used to fetch the identification types.
* @return {Observable<IdentificationTypesOut[]>} An observable that emits an array of identification type.
*/
getIdentificationTypes(params: QueryParams): Observable<IdentificationTypesOut>;
/**
* Retrieve a single identification type by its id.
*
* Sends an HTTP GET request to the indentification type endpoint and returns an Observable that emits
* the IdentificationTypeOut payload extracted from the API success envelope.
*
* @param id - The numeric identifier of the identification type to fetch.
* @returns An Observable that emits the requested IdentificationTypeOut. The Observable will error
* if the HTTP request fails (for example network issues or non-2xx responses).
*/
getIdentificationType(id: number): Observable<IdentificationTypeOut>;
/**
* Sends a POST request to create a new identification type and returns the created resource.
*
* The request payload is sent as an object with a `body` property containing the provided
* IdentificationTypeIn value (i.e. { body: IdentificationTypeIn }). On success the HTTP response is expected
* to follow the ApiSuccess<T> shape; the operator maps that response to the inner `data`
* object and emits it as a IdentificationTypeOut.
*
* @param body - The identification type payload to create (IdentificationTypeIn).
* @returns Observable<IdentificationTypeOut> that emits the created identification type on success.
*/
postIdentificationType(body: IdentificationTypeIn): Observable<IdentificationTypeOut>;
/**
* Update a identification type by its ID.
*
* Sends an HTTP PUT to `${this.url}/identification-types/${id}` with the provided payload.
* The request body is sent as an object with a `body` property containing the
* `IdentificationTypeIn` data. The server response is expected to be an `ApiSuccess<IdentificationTypeOut>`
* and this method returns an Observable that emits the unwrapped `IdentificationTypeOut`.
*
* @param id - The identifier of the identification type to update.
* @param body - The update payload for the identification type.
* @returns An Observable that emits the updated `IdentificationTypeOut` on success.
*/
putIdentificationType(id: number, body: IdentificationTypeIn): Observable<IdentificationTypeOut>;
/**
* Delete a identification type by its ID.
*
* Sends an HTTP DELETE request to the backend endpoint `/identification-types/{id}` and
* returns an Observable that emits the API response's `data` payload (typically an empty object).
*
* The implementation maps an ApiSuccess wrapper to its `data` property before emitting.
*
* @param id - The numeric identifier of the identification type to delete.
* @returns An Observable that emits the deleted resource payload ({} expected) on success.
* The Observable will emit an error if the HTTP request fails.
*/
deleteIdentificationType(id: number): Observable<{}>;
/**
* Sends a POST request to validate identification type number.
*
* The request payload is sent as an object with a `body` property containing the provided
* IdentificationTypeNumberValidationIn value (i.e. { body: IdentificationTypeNumberValidationIn }). On success the HTTP response is expected
* to follow the ApiSuccess<T> shape; the operator maps that response to the inner `data`
* object and emits it as a IdentificationTypeNumberValidationOut.
*
* @param body - The identification type number validation payload to validate (IdentificationTypeNumberValidationIn).
* @returns Observable<IdentificationTypeNumberValidationOut> that emits the validate status.
*/
postIdentificationTypeNumberValidation(body: IdentificationTypeNumberValidationIn): Observable<IdentificationTypeNumberValidationOut>;
/**
* Fetches the extra charges based on the provided query parameters.