@experteam-mx/ngx-services 18.7.27 → 18.7.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,110 @@
1
+ import { Environment } from '../ngx-services.models';
2
+ import { HttpClient } from '@angular/common/http';
3
+ import { QueryParams } from './models/api.models';
4
+ import { Observable } from 'rxjs';
5
+ import { CatalogsOut, CountryGroupsOut, CriteriaIn, CriteriaOut, FieldsOut, OverridesOut, RuleCriteriaIn, RuleIn, RuleOut, RulesByCriteriaOut, RulesIn, RulesOut } from './models/api-customs.types';
6
+ import * as i0 from "@angular/core";
7
+ export declare class ApiCustomsService {
8
+ private environments;
9
+ private http;
10
+ constructor(environments: Environment, http: HttpClient);
11
+ /**
12
+ * Retrieves the URL for the cash operations API from the environment configurations.
13
+ *
14
+ * @return {string} The URL of the cash operations API.
15
+ */
16
+ get url(): string;
17
+ /**
18
+ * Fetches the available fields for a given level.
19
+ *
20
+ * @return {Observable<FieldsOut>} An Observable that emits the list of fields.
21
+ * @param params
22
+ */
23
+ getFields(params: QueryParams): Observable<FieldsOut>;
24
+ /**
25
+ * Retrieves override configurations for a given level.
26
+ *
27
+ * @return {Observable<OverridesOut>} An Observable that emits the overrides configuration.
28
+ * @param params
29
+ */
30
+ getOverrides(params: QueryParams): Observable<OverridesOut>;
31
+ /**
32
+ * Fetches the catalogs used in customs operations.
33
+ *
34
+ * @return {Observable<CatalogsOut>} An Observable that emits the catalogs.
35
+ */
36
+ getCatalogs(params: QueryParams): Observable<CatalogsOut>;
37
+ /**
38
+ * Retrieves the list of rules based on the provided query parameters.
39
+ *
40
+ * @param {QueryParams} params - Query parameters to filter the rules.
41
+ * @return {Observable<RulesOut>} An Observable that emits the list of rules.
42
+ */
43
+ getRules(params: QueryParams): Observable<RulesOut>;
44
+ /**
45
+ * Retrieves the details of a specific rule by its ID.
46
+ *
47
+ * @param {number} id - The ID of the rule.
48
+ * @return {Observable<RuleOut>} An Observable that emits the rule details.
49
+ */
50
+ getRule(id: number): Observable<RuleOut>;
51
+ /**
52
+ * Creates a new criteria.
53
+ *
54
+ * @param {CriteriaIn} body - The criteria payload to create.
55
+ * @return {Observable<CriteriaOut>} An Observable that emits the created criteria.
56
+ */
57
+ postCriteria(body: CriteriaIn): Observable<CriteriaOut>;
58
+ /**
59
+ * Creates a new rule.
60
+ *
61
+ * @param {RuleIn} body - The rule payload to create.
62
+ * @return {Observable<RuleOut>} An Observable that emits the created rule.
63
+ */
64
+ postRules(body: RuleIn): Observable<RuleOut>;
65
+ /**
66
+ * Retrieves rules that match the given criteria.
67
+ *
68
+ * @param {RuleCriteriaIn} params - Criteria used to search for matching rules.
69
+ * @return {Observable<RulesByCriteriaOut>} An Observable that emits the list of matching rules.
70
+ */
71
+ postRulesByCriteria(params: RuleCriteriaIn): Observable<RulesByCriteriaOut>;
72
+ /**
73
+ * Enables a specific rule by its ID.
74
+ *
75
+ * @param {number} id - The ID of the rule to enable.
76
+ * @return {Observable<{}>} An Observable that emits an empty array on success.
77
+ */
78
+ putRuleActivate(id: number): Observable<{}>;
79
+ /**
80
+ * Disables (deletes) a specific rule by its ID.
81
+ *
82
+ * @param {number} id - The ID of the rule to disable.
83
+ * @return {Observable<[]>} An Observable that emits an empty array on success.
84
+ */
85
+ deleteRule(id: number): Observable<{}>;
86
+ /**
87
+ * Updates an existing criteria by its ID.
88
+ *
89
+ * @param {number} id - The ID of the criteria.
90
+ * @param {CriteriaIn} body - The updated criteria payload.
91
+ * @return {Observable<CriteriaOut>} An Observable that emits the updated criteria.
92
+ */
93
+ putCriteria(id: number, body: CriteriaIn): Observable<CriteriaOut>;
94
+ /**
95
+ * Updates an existing rule by its ID.
96
+ *
97
+ * @param {number} id - The ID of the rule.
98
+ * @param {RulesIn} body - The updated rule payload.
99
+ * @return {Observable<RuleOut>} An Observable that emits the updated rule.
100
+ */
101
+ putRule(id: number, body: RulesIn): Observable<RuleOut>;
102
+ /**
103
+ * Retrieves the list of country groups used in customs operations.
104
+ *
105
+ * @return {Observable<CountryGroupsOut>} An Observable that emits the list of country groups.
106
+ */
107
+ getCountryGroups(params: QueryParams): Observable<CountryGroupsOut>;
108
+ static ɵfac: i0.ɵɵFactoryDeclaration<ApiCustomsService, never>;
109
+ static ɵprov: i0.ɵɵInjectableDeclaration<ApiCustomsService>;
110
+ }
@@ -146,6 +146,11 @@ export interface Installation extends LaravelModel {
146
146
  location_id: number;
147
147
  number: number;
148
148
  system: System;
149
+ customer_screen: boolean;
150
+ epod_capture: boolean;
151
+ cx_survey: boolean;
152
+ customer_flow: boolean;
153
+ promotional_content: boolean;
149
154
  }
150
155
  export interface Location extends LaravelModel {
151
156
  accounts: Account[];
@@ -23,6 +23,11 @@ export type InstallationIn = {
23
23
  ip_address: string;
24
24
  location_id: number;
25
25
  number: number;
26
+ customer_screen: boolean;
27
+ epod_capture: boolean;
28
+ cx_survey: boolean;
29
+ customer_flow: boolean;
30
+ promotional_content: boolean;
26
31
  };
27
32
  export type InstallationOut = {
28
33
  installation: Installation;
@@ -0,0 +1,125 @@
1
+ import { ActiveLessSymfonyModel, ApiModel, SymfonyModel } from './api.models';
2
+ export interface Field extends ActiveLessSymfonyModel {
3
+ name: string;
4
+ label: string;
5
+ level: string;
6
+ dhlCodes: DhlCode[];
7
+ }
8
+ export interface DhlCode extends ActiveLessSymfonyModel {
9
+ code: string;
10
+ customerCode: string;
11
+ description: string;
12
+ }
13
+ export interface Override extends ApiModel {
14
+ field: string;
15
+ name: string;
16
+ level: string;
17
+ }
18
+ export interface Catalog extends SymfonyModel {
19
+ name: string;
20
+ }
21
+ export interface Rule extends SymfonyModel {
22
+ ruleType: string;
23
+ criteria: CriteriaCustom | null;
24
+ name: string;
25
+ description: string | null;
26
+ level: string;
27
+ roleTypes: string[];
28
+ warning: string | null;
29
+ attributes: Attribute[];
30
+ }
31
+ export interface CriteriaCustom extends ApiModel {
32
+ origins: string[];
33
+ originGroups: string[];
34
+ originExclusions: string[];
35
+ destinations: string[];
36
+ destinationGroups: string[];
37
+ destinationExclusions: string[];
38
+ dutiable: boolean;
39
+ declaredValue: null | {
40
+ operator: number;
41
+ };
42
+ }
43
+ export interface Attribute extends ActiveLessSymfonyModel {
44
+ field: FieldLess | null;
45
+ dhlCode: DhlCodeLess | null;
46
+ inputType: string;
47
+ inputLabel: string;
48
+ inputTooltip: string | null;
49
+ exclusive: boolean;
50
+ exclusiveDefault: boolean;
51
+ required: boolean;
52
+ text: TextConfig | null;
53
+ dropdown: DropdownConfig | null;
54
+ number: null | {
55
+ min: number;
56
+ max: number;
57
+ };
58
+ dependentRules: DependentRules | null;
59
+ fillFrom: FillFrom | null;
60
+ override: Override | null;
61
+ }
62
+ export interface FieldLess extends ApiModel {
63
+ name: string;
64
+ label: string;
65
+ }
66
+ export interface TextConfig {
67
+ minLength: number | null;
68
+ maxLength: number | null;
69
+ regex: string | null;
70
+ alphaNumeric: string | null;
71
+ placeHolder: string | null;
72
+ format: string | null;
73
+ prefix: string | null;
74
+ suffix: string | null;
75
+ masked: boolean;
76
+ isFormat?: boolean;
77
+ }
78
+ export interface DropdownConfig extends Dropdown {
79
+ catalog: CatalogLess | null | number;
80
+ }
81
+ export interface DependentRules {
82
+ conditionType: string;
83
+ ruleIds: number[];
84
+ }
85
+ export interface FillFrom {
86
+ attributeIndex: number;
87
+ attributeId: number;
88
+ using: string;
89
+ disabled: boolean;
90
+ }
91
+ export interface CatalogLess extends ApiModel {
92
+ name: string;
93
+ isActive: boolean;
94
+ }
95
+ export interface CriteriaWithTimestamps {
96
+ createdAt: string;
97
+ updatedAt: string;
98
+ }
99
+ export interface CountryGroups extends ActiveLessSymfonyModel {
100
+ code: string;
101
+ name: string;
102
+ countries: string[];
103
+ }
104
+ export interface DhlCodeLess extends ApiModel {
105
+ code: string;
106
+ customerCode: string;
107
+ description: string;
108
+ }
109
+ export interface RuleByCriteria extends ApiModel {
110
+ ruleType: string;
111
+ criteria: CriteriaCustom | null;
112
+ name: string;
113
+ description: string | null;
114
+ level: string;
115
+ roleTypes: string[];
116
+ }
117
+ export interface Dropdown {
118
+ values: string[];
119
+ catalogId: number;
120
+ loadOnDemand: boolean;
121
+ defaultValue: string | null;
122
+ prefix: string | null;
123
+ suffix: string | null;
124
+ _catalogName?: string | null;
125
+ }
@@ -0,0 +1,90 @@
1
+ import { Catalog, CountryGroups, CriteriaCustom, CriteriaWithTimestamps, DependentRules, Dropdown, Field, Override, Rule, RuleByCriteria, TextConfig } from './api-customs.interfaces';
2
+ export type FieldsOut = {
3
+ total: number;
4
+ fields: Field[];
5
+ };
6
+ export type OverridesOut = {
7
+ total: number;
8
+ overrides: Override[];
9
+ };
10
+ export type CatalogsOut = {
11
+ total: number;
12
+ catalogs: Catalog[];
13
+ };
14
+ export type RulesOut = {
15
+ total: number;
16
+ rules: Rule[];
17
+ };
18
+ export type RuleOut = {
19
+ rule: Rule;
20
+ };
21
+ export type CriteriaIn = {
22
+ origins: string[];
23
+ originGroups: string[];
24
+ originExclusions: string[];
25
+ destinations: string[];
26
+ destinationGroups: string[];
27
+ destinationExclusions: string[];
28
+ dutiable: boolean;
29
+ declaredValue: {
30
+ operator: number;
31
+ } | null;
32
+ touched?: boolean;
33
+ valid?: boolean;
34
+ };
35
+ export type CriteriaOut = {
36
+ criteria: CriteriaCustom & CriteriaWithTimestamps;
37
+ };
38
+ export type RuleIn = {
39
+ ruleType: string;
40
+ criteriaId: number | null;
41
+ name: string;
42
+ description: string | null;
43
+ level: string;
44
+ roleTypes: string[];
45
+ warning: string | null;
46
+ attributes: AttributeIn[];
47
+ isActive: boolean;
48
+ };
49
+ export type AttributeIn = {
50
+ fieldId: number | null;
51
+ dhlCodeId: number | null;
52
+ inputType: string;
53
+ inputLabel: string;
54
+ inputTooltip: string | null;
55
+ exclusive: boolean;
56
+ exclusiveDefault: boolean;
57
+ required: boolean;
58
+ text: TextConfig | null;
59
+ dropdown: Dropdown | null;
60
+ number: number | null | {
61
+ min: number | null;
62
+ max: number | null;
63
+ };
64
+ dependentRules: DependentRules | null;
65
+ fillFrom: FillFromIn | null;
66
+ overrideId: number | null;
67
+ isActive: boolean;
68
+ };
69
+ export type FillFromIn = {
70
+ attributeIndex: number;
71
+ using: string;
72
+ disabled: boolean;
73
+ };
74
+ export type RuleCriteriaIn = CriteriaIn & {
75
+ ruleType: string | null;
76
+ };
77
+ export type AttributeWithId = AttributeIn & {
78
+ id: number;
79
+ };
80
+ export type RulesIn = Omit<RuleIn, 'attributes'> & {
81
+ id: number | null;
82
+ attributes: AttributeWithId[];
83
+ };
84
+ export type CountryGroupsOut = {
85
+ countryGroups: CountryGroups[];
86
+ };
87
+ export type RulesByCriteriaOut = {
88
+ total: number;
89
+ rules: RuleByCriteria[];
90
+ };
@@ -25,6 +25,7 @@ export type Environment = {
25
25
  apiCatalogsUrl?: string;
26
26
  apiCompaniesUrl?: string;
27
27
  apiCompositionUrl?: string;
28
+ apiCustomsUrl?: string;
28
29
  apiDiscountsUrl?: string;
29
30
  apiEventsUrl?: string;
30
31
  apiEToolsAutoBilling?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@experteam-mx/ngx-services",
3
- "version": "18.7.27",
3
+ "version": "18.7.29",
4
4
  "description": "Angular common services for Experteam apps",
5
5
  "author": "Experteam Cía. Ltda.",
6
6
  "keywords": [
package/public-api.d.ts CHANGED
@@ -9,6 +9,7 @@ export * from './lib/apis/api-cash-operations.service';
9
9
  export * from './lib/apis/api-catalogs.service';
10
10
  export * from './lib/apis/api-companies.service';
11
11
  export * from './lib/apis/api-composition.service';
12
+ export * from './lib/apis/api-customs.service';
12
13
  export * from './lib/apis/api-discounts.service';
13
14
  export * from './lib/apis/api-events.service';
14
15
  export * from './lib/apis/api-e-tools-auto-billing.service';
@@ -39,6 +40,8 @@ export * from './lib/apis/models/api-companies.interfaces';
39
40
  export * from './lib/apis/models/api-companies.types';
40
41
  export * from './lib/apis/models/api-composition.interfaces';
41
42
  export * from './lib/apis/models/api-composition.types';
43
+ export * from './lib/apis/models/api-customs.interfaces';
44
+ export * from './lib/apis/models/api-customs.types';
42
45
  export * from './lib/apis/models/api-discounts.interfaces';
43
46
  export * from './lib/apis/models/api-discounts.types';
44
47
  export * from './lib/apis/models/api-events.enum';