@acontplus/ng-customer 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts ADDED
@@ -0,0 +1,286 @@
1
+ import * as dist_packages_core_src from 'dist/packages/core/src';
2
+ import * as _acontplus_core from '@acontplus/core';
3
+ import { ApiResponse, PagedResult, IdentificationNumberVo, SRI_DOCUMENT_TYPE } from '@acontplus/core';
4
+ import * as _acontplus_ng_customer from '@acontplus/ng-customer';
5
+ import * as _angular_core from '@angular/core';
6
+ import { OnInit } from '@angular/core';
7
+ import { Observable } from 'rxjs';
8
+ import { AbstractControl, ValidationErrors, FormGroup, FormControl } from '@angular/forms';
9
+ import { MatSelectChange } from '@angular/material/select';
10
+
11
+ interface Customer {
12
+ id: number;
13
+ }
14
+
15
+ interface CustomerExternal {
16
+ phone: string;
17
+ email: string;
18
+ idCard: string;
19
+ businessName: string;
20
+ address: string;
21
+ }
22
+
23
+ interface CustomerFilter {
24
+ search?: string;
25
+ limit?: number;
26
+ }
27
+ interface CustomerSearch {
28
+ search?: string;
29
+ pageSize?: number;
30
+ pageIndex?: number;
31
+ }
32
+
33
+ interface CustomerRepository {
34
+ getAll<T>(obj: T): Promise<ApiResponse<PagedResult<any>>>;
35
+ getById(id: number): Promise<ApiResponse<any>>;
36
+ create(dto: any): Promise<ApiResponse<any>>;
37
+ update(dto: any): Promise<ApiResponse<any>>;
38
+ getFormData(): Promise<ApiResponse<any>>;
39
+ checkExistence(identificationNumber: string): Promise<ApiResponse<any>>;
40
+ updateState(id: number): Promise<ApiResponse<any>>;
41
+ search(params: CustomerSearch): Promise<ApiResponse<any>>;
42
+ }
43
+
44
+ interface CustomerExternalRepository {
45
+ getById(id: IdentificationNumberVo): Promise<ApiResponse<CustomerExternal>>;
46
+ }
47
+
48
+ declare class CustomerUseCase {
49
+ private repo;
50
+ constructor(repo: CustomerRepository);
51
+ getAll(params: any): Promise<dist_packages_core_src.ApiResponse<dist_packages_core_src.PagedResult<any>>>;
52
+ getFormData(): Promise<dist_packages_core_src.ApiResponse<any>>;
53
+ getById(id: number): Promise<dist_packages_core_src.ApiResponse<any>>;
54
+ checkExistence(identificationNumber: string): Promise<dist_packages_core_src.ApiResponse<any>>;
55
+ create(params: any): Promise<dist_packages_core_src.ApiResponse<any>>;
56
+ update(params: any): Promise<dist_packages_core_src.ApiResponse<any>>;
57
+ updateState(id: number): Promise<dist_packages_core_src.ApiResponse<any>>;
58
+ search(filter: CustomerSearch): Promise<dist_packages_core_src.ApiResponse<any>>;
59
+ }
60
+
61
+ declare class CustomerExternalUseCase {
62
+ private repo;
63
+ constructor(repo: CustomerExternalRepository);
64
+ getById(identification: string): Promise<_acontplus_core.ApiResponse<_acontplus_ng_customer.CustomerExternal>>;
65
+ }
66
+
67
+ declare const CUSTOMER_API: {
68
+ BILLING: string;
69
+ };
70
+
71
+ interface CustomerListItemDto {
72
+ index: number;
73
+ id: number;
74
+ identificationTypeId: number;
75
+ idCard: string;
76
+ businessName: string;
77
+ tradeName: string;
78
+ address: string;
79
+ phone: string;
80
+ email: string;
81
+ finalConsumer: boolean;
82
+ sriValidation: boolean;
83
+ sriValidationName: 'SI' | 'NO';
84
+ identificationType: string;
85
+ isActive: boolean;
86
+ statusName: 'Activo' | 'Inactivo';
87
+ isFinalConsumer: boolean;
88
+ totalRecords: number;
89
+ }
90
+ interface CustomerCreateDTO {
91
+ name: string;
92
+ email: string;
93
+ }
94
+ interface CustomerUpdateDTO {
95
+ name?: string;
96
+ email?: string;
97
+ }
98
+ interface CustomerFilterDTO {
99
+ search?: string;
100
+ limit?: number;
101
+ }
102
+ interface CustomerSearchDTO {
103
+ /** Texto de búsqueda libre (nombre, identificación, comercio, etc.) */
104
+ search?: string;
105
+ /** Número de resultados por página */
106
+ pageSize?: number;
107
+ /** Índice de página (0-based) */
108
+ pageIndex?: number;
109
+ }
110
+
111
+ interface CustomerExternalDTO {
112
+ phone: string;
113
+ email: string;
114
+ idCard: string;
115
+ businessName: string;
116
+ address: string;
117
+ }
118
+
119
+ declare class CompanySearchMapper {
120
+ static toJson(params: CustomerSearch): string;
121
+ static fromJson(response: any): any[];
122
+ }
123
+
124
+ declare class CustomerCreateUpdateMapper {
125
+ static toJson(param: any): {
126
+ idCliente: number | null | undefined;
127
+ idEmpleado: number | null | undefined;
128
+ idTipoIdentificacion: any;
129
+ idTipoClienteProveedor: number | null | undefined;
130
+ idTipoEntidad: number | null | undefined;
131
+ idCiudad: number | null | undefined;
132
+ idSubContribuyente: number | null | undefined;
133
+ idTiempoCredito: number | null | undefined;
134
+ idEmpresa: number | null | undefined;
135
+ idCargo: number | null | undefined;
136
+ numeroIdentificacion: any;
137
+ nombreFiscal: any;
138
+ nombreComercial: any;
139
+ direccion: any;
140
+ telefono: any;
141
+ correo: any;
142
+ placa: any;
143
+ montoCredito: any;
144
+ nota: any;
145
+ validationSri: any;
146
+ idFormaPagoSri: number | null | undefined;
147
+ estado: any;
148
+ infoCrediticia: any;
149
+ configValorBruto: any;
150
+ birthDate: string | null;
151
+ };
152
+ static fromJson(response: any): any;
153
+ }
154
+
155
+ declare class CustomerFormDataMapper {
156
+ static toJson(): string;
157
+ static fromJson(response: any): any;
158
+ }
159
+
160
+ declare class CustomerGetByIdMapper {
161
+ static fromJson(response: any): any;
162
+ }
163
+
164
+ declare class ListCustomerMapper {
165
+ static toJson(params: any): string;
166
+ static fromJson(response: any): any;
167
+ }
168
+
169
+ declare class CustomerExternalHttpRepository implements CustomerExternalRepository {
170
+ private get http();
171
+ private get url();
172
+ getById(identification: IdentificationNumberVo): Promise<ApiResponse<CustomerExternal>>;
173
+ }
174
+
175
+ declare class CustomerHttpRepository implements CustomerRepository {
176
+ private get http();
177
+ private get url();
178
+ checkExistence(identificationNumber: string): Promise<ApiResponse<any>>;
179
+ getFormData(): Promise<ApiResponse<any>>;
180
+ getAll<T>(obj: T): Promise<ApiResponse<PagedResult<any>>>;
181
+ create(dto: any): Promise<ApiResponse<any>>;
182
+ update(dto: any): Promise<ApiResponse<any>>;
183
+ updateState(id: number): Promise<ApiResponse<any>>;
184
+ getById(id: number): Promise<ApiResponse<any>>;
185
+ search(params: CustomerSearch): Promise<ApiResponse<any>>;
186
+ }
187
+
188
+ declare class CustomerAddEditComponent implements OnInit {
189
+ private readonly dialogRef;
190
+ private readonly customerUseCase;
191
+ private readonly customerExternalUseCase;
192
+ btnText: _angular_core.WritableSignal<string>;
193
+ readonly paramsOptions: {
194
+ id: number;
195
+ descripcion: null | string;
196
+ dataOfSri?: boolean;
197
+ numeroIdentificacion?: string;
198
+ codigoSri?: string;
199
+ data: any;
200
+ };
201
+ readonly params: any;
202
+ private notificationService;
203
+ title: string;
204
+ loading: boolean;
205
+ emails: string[];
206
+ telephones: string[];
207
+ tiemposCredito: _angular_core.WritableSignal<any[]>;
208
+ tipoContribuyentes: _angular_core.WritableSignal<any[]>;
209
+ tiposCliente: _angular_core.WritableSignal<any[]>;
210
+ tiposIdentificacion: _angular_core.WritableSignal<any[]>;
211
+ formasPagoSri: _angular_core.WritableSignal<any[]>;
212
+ placas: _angular_core.WritableSignal<any[]>;
213
+ ciudades: _angular_core.WritableSignal<any[]>;
214
+ cargos: _angular_core.WritableSignal<any[]>;
215
+ empresas: _angular_core.WritableSignal<any[]>;
216
+ employees: _angular_core.WritableSignal<any[]>;
217
+ maritalStatuses: _angular_core.WritableSignal<any[]>;
218
+ housingTypes: _angular_core.WritableSignal<any[]>;
219
+ showRefresh: _angular_core.WritableSignal<boolean>;
220
+ endsWith001Validator(control: AbstractControl): ValidationErrors | null;
221
+ customerForm: FormGroup<{
222
+ direccion: FormControl<string | null>;
223
+ idCargo: FormControl<number | null>;
224
+ idCliente: FormControl<number | null>;
225
+ idEmpresa: FormControl<number | null>;
226
+ idFormaPagoSri: FormControl<number | null>;
227
+ idTipoClienteProveedor: FormControl<number | null>;
228
+ idTipoEntidad: FormControl<number | null>;
229
+ idCiudad: FormControl<number | null>;
230
+ idEmpleado: FormControl<number | null | undefined>;
231
+ nombreFiscal: FormControl<string | null>;
232
+ nombreComercial: FormControl<string | null>;
233
+ numeroIdentificacion: FormControl<string | null>;
234
+ correo: FormControl<string | null>;
235
+ telefono: FormControl<string | null>;
236
+ placa: FormControl<string | null>;
237
+ nota: FormControl<string | null>;
238
+ estado: FormControl<boolean | null>;
239
+ birthDate: FormControl<Date | null>;
240
+ validationSri: FormControl<boolean | null>;
241
+ configValorBruto: FormControl<boolean | null>;
242
+ dataInfoCred: FormGroup<{
243
+ maritalStatusId: FormControl<number | null>;
244
+ conyugeNombre: FormControl<string | null>;
245
+ conyugeTel: FormControl<string | null>;
246
+ refFamNombre: FormControl<string | null>;
247
+ refFamTel: FormControl<string | null>;
248
+ housingTypeId: FormControl<number | null>;
249
+ dirVivienda: FormControl<string | null>;
250
+ refDomicilio: FormControl<string | null>;
251
+ sector: FormControl<string | null>;
252
+ barrio: FormControl<string | null>;
253
+ calle: FormControl<string | null>;
254
+ }>;
255
+ }>;
256
+ getCustomer(codigo: string, id: string): void;
257
+ getLoadData(): Observable<any>;
258
+ ngOnInit(): void;
259
+ identificationTypeChange(event: MatSelectChange): void;
260
+ updateFormControlNumeroIdentificacion(codigoSri: SRI_DOCUMENT_TYPE.RUC | SRI_DOCUMENT_TYPE.CEDULA): void;
261
+ setIdentificationTypeChange(codigoSri: SRI_DOCUMENT_TYPE.RUC | SRI_DOCUMENT_TYPE.CEDULA): void;
262
+ get numeroIdentificacionControl(): AbstractControl<string | null, string | null, any> | null;
263
+ get birthDateCtrl(): AbstractControl<Date | null, Date | null, any> | null;
264
+ onKeyDownGovernmentId($event?: Event): void;
265
+ private isDataOfSri;
266
+ private isCreate;
267
+ isUpdate: () => boolean;
268
+ onSave(): void;
269
+ close(): void;
270
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CustomerAddEditComponent, never>;
271
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<CustomerAddEditComponent, "acp-customer-add-edit", never, {}, {}, never, never, true, never>;
272
+ }
273
+
274
+ declare class CustomerCardComponent {
275
+ customer: _angular_core.InputSignal<CustomerListItemDto>;
276
+ editCustomer: _angular_core.OutputEmitterRef<CustomerListItemDto>;
277
+ deleteCustomer: _angular_core.OutputEmitterRef<CustomerListItemDto>;
278
+ getLogoSliceBusinessName: _angular_core.Signal<string>;
279
+ onEditClick(): void;
280
+ onDeleteClick(): void;
281
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CustomerCardComponent, never>;
282
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<CustomerCardComponent, "acp-customer-card", never, { "customer": { "alias": "customer"; "required": true; "isSignal": true; }; }, { "editCustomer": "editCustomer"; "deleteCustomer": "deleteCustomer"; }, never, never, true, never>;
283
+ }
284
+
285
+ export { CUSTOMER_API, CompanySearchMapper, CustomerAddEditComponent, CustomerCardComponent, CustomerCreateUpdateMapper, CustomerExternalHttpRepository, CustomerExternalUseCase, CustomerFormDataMapper, CustomerGetByIdMapper, CustomerHttpRepository, CustomerUseCase, ListCustomerMapper };
286
+ export type { Customer, CustomerCreateDTO, CustomerExternal, CustomerExternalDTO, CustomerExternalRepository, CustomerFilter, CustomerFilterDTO, CustomerListItemDto, CustomerRepository, CustomerSearch, CustomerSearchDTO, CustomerUpdateDTO };
package/package.json CHANGED
@@ -1,17 +1,20 @@
1
1
  {
2
2
  "name": "@acontplus/ng-customer",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Acontplus Angular Customer Module",
5
+ "dependencies": {
6
+ "@acontplus/ng-notifications": "^1.0.5",
7
+ "tslib": "^2.3.0"
8
+ },
5
9
  "peerDependencies": {
6
- "@acontplus/ng-components": "^1.0.6",
7
- "@acontplus/ng-core": "^1.0.5",
8
- "@acontplus/ng-notifications": "^1.0.1",
10
+ "@acontplus/ng-components": "^1.0.8",
11
+ "@acontplus/ng-core": "^1.0.8",
9
12
  "@angular/common": "^20.3.1",
10
13
  "@angular/core": "^20.3.1"
11
14
  },
12
15
  "sideEffects": false,
13
- "main": "fesm2022/ng-customer.mjs",
14
- "module": "fesm2022/ng-customer.mjs",
16
+ "main": "fesm2022/acontplus-ng-customer.mjs",
17
+ "module": "fesm2022/acontplus-ng-customer.mjs",
15
18
  "typings": "index.d.ts",
16
19
  "files": [
17
20
  "index.d.ts",
@@ -50,5 +53,14 @@
50
53
  "branches": [
51
54
  "main"
52
55
  ]
56
+ },
57
+ "exports": {
58
+ "./package.json": {
59
+ "default": "./package.json"
60
+ },
61
+ ".": {
62
+ "types": "./index.d.ts",
63
+ "default": "./fesm2022/acontplus-ng-customer.mjs"
64
+ }
53
65
  }
54
- }
66
+ }