@experteam-mx/ngx-services
Version:
Angular common services for Experteam apps
111 lines (110 loc) • 4.5 kB
TypeScript
import { Environment } from '../ngx-services.models';
import { HttpClient } from '@angular/common/http';
import { QueryParams } from './models/api.models';
import { Observable } from 'rxjs';
import { CatalogsOut, CountryGroupsOut, CriteriaIn, CriteriaOut, FieldsOut, OverridesOut, RuleCriteriaIn, RuleIn, RuleOut, RulesByCriteriaOut, RulesIn, RulesOut } from './models/api-customs.types';
import * as i0 from "@angular/core";
export declare class ApiCustomsService {
private environments;
private http;
constructor(environments: Environment, http: HttpClient);
/**
* Retrieves the URL for the cash operations API from the environment configurations.
*
* @return {string} The URL of the cash operations API.
*/
get url(): string;
/**
* Fetches the available fields for a given level.
*
* @return {Observable<FieldsOut>} An Observable that emits the list of fields.
* @param params
*/
getFields(params: QueryParams): Observable<FieldsOut>;
/**
* Retrieves override configurations for a given level.
*
* @return {Observable<OverridesOut>} An Observable that emits the overrides configuration.
* @param params
*/
getOverrides(params: QueryParams): Observable<OverridesOut>;
/**
* Fetches the catalogs used in customs operations.
*
* @return {Observable<CatalogsOut>} An Observable that emits the catalogs.
*/
getCatalogs(params: QueryParams): Observable<CatalogsOut>;
/**
* Retrieves the list of rules based on the provided query parameters.
*
* @param {QueryParams} params - Query parameters to filter the rules.
* @return {Observable<RulesOut>} An Observable that emits the list of rules.
*/
getRules(params: QueryParams): Observable<RulesOut>;
/**
* Retrieves the details of a specific rule by its ID.
*
* @param {number} id - The ID of the rule.
* @return {Observable<RuleOut>} An Observable that emits the rule details.
*/
getRule(id: number): Observable<RuleOut>;
/**
* Creates a new criteria.
*
* @param {CriteriaIn} body - The criteria payload to create.
* @return {Observable<CriteriaOut>} An Observable that emits the created criteria.
*/
postCriteria(body: CriteriaIn): Observable<CriteriaOut>;
/**
* Creates a new rule.
*
* @param {RuleIn} body - The rule payload to create.
* @return {Observable<RuleOut>} An Observable that emits the created rule.
*/
postRules(body: RuleIn): Observable<RuleOut>;
/**
* Retrieves rules that match the given criteria.
*
* @param {RuleCriteriaIn} params - Criteria used to search for matching rules.
* @return {Observable<RulesByCriteriaOut>} An Observable that emits the list of matching rules.
*/
postRulesByCriteria(params: RuleCriteriaIn): Observable<RulesByCriteriaOut>;
/**
* Enables a specific rule by its ID.
*
* @param {number} id - The ID of the rule to enable.
* @return {Observable<{}>} An Observable that emits an empty array on success.
*/
putRuleActivate(id: number): Observable<{}>;
/**
* Disables (deletes) a specific rule by its ID.
*
* @param {number} id - The ID of the rule to disable.
* @return {Observable<[]>} An Observable that emits an empty array on success.
*/
deleteRule(id: number): Observable<{}>;
/**
* Updates an existing criteria by its ID.
*
* @param {number} id - The ID of the criteria.
* @param {CriteriaIn} body - The updated criteria payload.
* @return {Observable<CriteriaOut>} An Observable that emits the updated criteria.
*/
putCriteria(id: number, body: CriteriaIn): Observable<CriteriaOut>;
/**
* Updates an existing rule by its ID.
*
* @param {number} id - The ID of the rule.
* @param {RulesIn} body - The updated rule payload.
* @return {Observable<RuleOut>} An Observable that emits the updated rule.
*/
putRule(id: number, body: RulesIn): Observable<RuleOut>;
/**
* Retrieves the list of country groups used in customs operations.
*
* @return {Observable<CountryGroupsOut>} An Observable that emits the list of country groups.
*/
getCountryGroups(params: QueryParams): Observable<CountryGroupsOut>;
static ɵfac: i0.ɵɵFactoryDeclaration<ApiCustomsService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<ApiCustomsService>;
}