@acontplus/ng-customer 2.0.3 → 2.2.0
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/README.md +14 -19
- package/fesm2022/acontplus-ng-customer.mjs +654 -342
- package/fesm2022/acontplus-ng-customer.mjs.map +1 -1
- package/package.json +5 -8
- package/types/acontplus-ng-customer.d.ts +181 -87
|
@@ -1,63 +1,42 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
2
|
import { OnInit, InjectionToken } from '@angular/core';
|
|
3
3
|
import { FormGroup, ValidatorFn } from '@angular/forms';
|
|
4
|
+
import * as _acontplus_ng_customer from '@acontplus/ng-customer';
|
|
5
|
+
import { DataGridColumn } from '@acontplus/ng-components';
|
|
6
|
+
import { PageEvent } from '@angular/material/paginator';
|
|
4
7
|
import { Observable } from 'rxjs';
|
|
5
8
|
import { ApiResponse } from '@acontplus/core';
|
|
6
9
|
|
|
7
|
-
interface
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
interface CompanyCustomerListDto {
|
|
11
|
+
index: number;
|
|
12
|
+
clientId: number;
|
|
13
|
+
identificationTypeId: number;
|
|
14
|
+
idCard: string;
|
|
15
|
+
tradeName: string;
|
|
16
|
+
legalName: string;
|
|
17
|
+
address: string;
|
|
18
|
+
phone?: string;
|
|
19
|
+
email?: string;
|
|
20
|
+
finalConsumer: boolean;
|
|
21
|
+
sriValidation: boolean;
|
|
22
|
+
identificationType: number;
|
|
23
|
+
identificationTypeCode: string;
|
|
24
|
+
status: string;
|
|
25
|
+
totalRecord: number;
|
|
15
26
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
declare class CompanyCustomerFormDataResult {
|
|
28
|
+
identificationTypes: any[];
|
|
29
|
+
tipoContribuyentes: [];
|
|
30
|
+
tiempoCreditos: [];
|
|
31
|
+
cities: any[];
|
|
32
|
+
tiposCliente: [];
|
|
33
|
+
empresas: [];
|
|
34
|
+
cargos: [];
|
|
35
|
+
formasPagoSri: [];
|
|
36
|
+
housingTypes: any[];
|
|
37
|
+
maritalStatuses: any[];
|
|
38
|
+
employees: [];
|
|
28
39
|
}
|
|
29
|
-
interface CompanyCustomerFormConfig {
|
|
30
|
-
fields: {
|
|
31
|
-
idTipoIdentificacion: FieldConfig;
|
|
32
|
-
idFormaPagoSri: FieldConfig;
|
|
33
|
-
idTipoClienteProveedor: FieldConfig;
|
|
34
|
-
idSubContribuyente: FieldConfig;
|
|
35
|
-
idTiempoCredito: FieldConfig;
|
|
36
|
-
idCiudad: FieldConfig;
|
|
37
|
-
idCargo: FieldConfig;
|
|
38
|
-
idEmpleado: FieldConfig;
|
|
39
|
-
numeroIdentificacion: FieldConfig;
|
|
40
|
-
nombreFiscal: FieldConfig;
|
|
41
|
-
nombreComercial: FieldConfig;
|
|
42
|
-
direccion: FieldConfig;
|
|
43
|
-
correo: FieldConfig;
|
|
44
|
-
telefono: FieldConfig;
|
|
45
|
-
placa: FieldConfig;
|
|
46
|
-
nota: FieldConfig;
|
|
47
|
-
birthDate: FieldConfig;
|
|
48
|
-
estado: FieldConfig;
|
|
49
|
-
validationSri: FieldConfig;
|
|
50
|
-
configValorBruto: FieldConfig;
|
|
51
|
-
};
|
|
52
|
-
showCreditInfo?: boolean;
|
|
53
|
-
creditFields?: CreditFieldsConfig;
|
|
54
|
-
submitButtonText?: string;
|
|
55
|
-
cancelButtonText?: string;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
declare const MAIN_APP_COMPANY_CUSTOMER_CONFIG: CompanyCustomerFormConfig;
|
|
59
|
-
declare const POS_COMPANY_CUSTOMER_CONFIG: CompanyCustomerFormConfig;
|
|
60
|
-
|
|
61
40
|
interface CustomerInfoCredit {
|
|
62
41
|
maritalStatusId?: number | null;
|
|
63
42
|
conyugeNombre?: string | null;
|
|
@@ -114,14 +93,64 @@ interface Customer {
|
|
|
114
93
|
notes?: string;
|
|
115
94
|
}
|
|
116
95
|
|
|
117
|
-
|
|
96
|
+
interface FieldConfig {
|
|
97
|
+
name: string;
|
|
98
|
+
required: boolean;
|
|
99
|
+
visible: boolean;
|
|
100
|
+
readonly?: boolean;
|
|
101
|
+
label?: string;
|
|
102
|
+
placeholder?: string;
|
|
103
|
+
validators?: any[];
|
|
104
|
+
}
|
|
105
|
+
interface CreditFieldsConfig {
|
|
106
|
+
maritalStatusId: FieldConfig;
|
|
107
|
+
conyugeNombre: FieldConfig;
|
|
108
|
+
conyugeTel: FieldConfig;
|
|
109
|
+
refFamNombre: FieldConfig;
|
|
110
|
+
refFamTel: FieldConfig;
|
|
111
|
+
housingTypeId: FieldConfig;
|
|
112
|
+
dirVivienda: FieldConfig;
|
|
113
|
+
refDomicilio: FieldConfig;
|
|
114
|
+
sector: FieldConfig;
|
|
115
|
+
barrio: FieldConfig;
|
|
116
|
+
calle: FieldConfig;
|
|
117
|
+
}
|
|
118
|
+
interface CompanyCustomerFormConfig {
|
|
119
|
+
fields: {
|
|
120
|
+
idTipoIdentificacion: FieldConfig;
|
|
121
|
+
idFormaPagoSri: FieldConfig;
|
|
122
|
+
idTipoClienteProveedor: FieldConfig;
|
|
123
|
+
idSubContribuyente: FieldConfig;
|
|
124
|
+
idTiempoCredito: FieldConfig;
|
|
125
|
+
idCiudad: FieldConfig;
|
|
126
|
+
idCargo: FieldConfig;
|
|
127
|
+
idEmpleado: FieldConfig;
|
|
128
|
+
numeroIdentificacion: FieldConfig;
|
|
129
|
+
nombreFiscal: FieldConfig;
|
|
130
|
+
nombreComercial: FieldConfig;
|
|
131
|
+
direccion: FieldConfig;
|
|
132
|
+
correo: FieldConfig;
|
|
133
|
+
telefono: FieldConfig;
|
|
134
|
+
placa: FieldConfig;
|
|
135
|
+
nota: FieldConfig;
|
|
136
|
+
birthDate: FieldConfig;
|
|
137
|
+
estado: FieldConfig;
|
|
138
|
+
validationSri: FieldConfig;
|
|
139
|
+
configValorBruto: FieldConfig;
|
|
140
|
+
};
|
|
141
|
+
showCreditInfo?: boolean;
|
|
142
|
+
creditFields?: CreditFieldsConfig;
|
|
143
|
+
submitButtonText?: string;
|
|
144
|
+
cancelButtonText?: string;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
declare class CompanyCustomerForm implements OnInit {
|
|
118
148
|
formId: _angular_core.InputSignal<string | undefined>;
|
|
119
|
-
customer
|
|
120
|
-
mode:
|
|
149
|
+
customer: _angular_core.InputSignal<any>;
|
|
150
|
+
mode: _angular_core.InputSignal<"create" | "edit">;
|
|
121
151
|
showButtons: _angular_core.InputSignal<boolean>;
|
|
122
152
|
submitted: _angular_core.OutputEmitterRef<any>;
|
|
123
153
|
cancelled: _angular_core.OutputEmitterRef<void>;
|
|
124
|
-
readonly panelOpenState: _angular_core.WritableSignal<boolean>;
|
|
125
154
|
private fb;
|
|
126
155
|
config: CompanyCustomerFormConfig;
|
|
127
156
|
private customerService;
|
|
@@ -134,7 +163,12 @@ declare class CompanyCustomerFormComponent implements OnInit {
|
|
|
134
163
|
tiemposCredito: _angular_core.WritableSignal<any[]>;
|
|
135
164
|
tipoContribuyentes: _angular_core.WritableSignal<any[]>;
|
|
136
165
|
tiposCliente: _angular_core.WritableSignal<any[]>;
|
|
137
|
-
|
|
166
|
+
identificationTypes: _angular_core.WritableSignal<{
|
|
167
|
+
id: number;
|
|
168
|
+
value: string;
|
|
169
|
+
code: string;
|
|
170
|
+
sriCode: string;
|
|
171
|
+
}[]>;
|
|
138
172
|
formasPagoSri: _angular_core.WritableSignal<any[]>;
|
|
139
173
|
placas: _angular_core.WritableSignal<any[]>;
|
|
140
174
|
ciudades: _angular_core.WritableSignal<any[]>;
|
|
@@ -143,10 +177,8 @@ declare class CompanyCustomerFormComponent implements OnInit {
|
|
|
143
177
|
employees: _angular_core.WritableSignal<any[]>;
|
|
144
178
|
maritalStatuses: _angular_core.WritableSignal<any[]>;
|
|
145
179
|
housingTypes: _angular_core.WritableSignal<any[]>;
|
|
146
|
-
showRefresh: _angular_core.WritableSignal<boolean>;
|
|
147
180
|
setStep(index: number): void;
|
|
148
|
-
|
|
149
|
-
prevStep(): void;
|
|
181
|
+
private loadFormData;
|
|
150
182
|
ngOnInit(): void;
|
|
151
183
|
private getDefaultConfig;
|
|
152
184
|
getCreditFieldConfig(fieldName: keyof CreditFieldsConfig): FieldConfig | undefined;
|
|
@@ -168,23 +200,51 @@ declare class CompanyCustomerFormComponent implements OnInit {
|
|
|
168
200
|
getErrorMessage(fieldName: string): string;
|
|
169
201
|
get dataInfoCredForm(): FormGroup;
|
|
170
202
|
searchIdentificacion($event: MouseEvent): void;
|
|
171
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<
|
|
172
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<
|
|
203
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CompanyCustomerForm, never>;
|
|
204
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CompanyCustomerForm, "acp-company-customer-form", ["acpCustomerForm"], { "formId": { "alias": "formId"; "required": false; "isSignal": true; }; "customer": { "alias": "customer"; "required": false; "isSignal": true; }; "mode": { "alias": "mode"; "required": false; "isSignal": true; }; "showButtons": { "alias": "showButtons"; "required": false; "isSignal": true; }; }, { "submitted": "submitted"; "cancelled": "cancelled"; }, never, never, true, never>;
|
|
173
205
|
}
|
|
174
206
|
|
|
175
|
-
|
|
176
|
-
|
|
207
|
+
declare class CompanyCustomerAddEditDialog {
|
|
208
|
+
formId: _angular_core.WritableSignal<string>;
|
|
209
|
+
private dgRef;
|
|
210
|
+
onCustomerCreated(customer: any): void;
|
|
211
|
+
onCancel(): void;
|
|
212
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CompanyCustomerAddEditDialog, never>;
|
|
213
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CompanyCustomerAddEditDialog, "acp-company-customer-add-edit-dialog", never, {}, {}, never, never, true, never>;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
interface ICompanyCustomerHttp {
|
|
217
|
+
getFormData(): Observable<any>;
|
|
218
|
+
list(params: any): Observable<{
|
|
219
|
+
data: any[];
|
|
220
|
+
pagination: {
|
|
221
|
+
totalRecords: number;
|
|
222
|
+
};
|
|
223
|
+
}>;
|
|
177
224
|
create(customer: any): Observable<any>;
|
|
178
225
|
update(id: string, customer: any): Observable<any>;
|
|
179
226
|
getById(id: string): Observable<any>;
|
|
180
227
|
search(term: string): Observable<any[]>;
|
|
181
228
|
validate?(customer: any): Record<string, any> | null;
|
|
182
229
|
}
|
|
230
|
+
interface ICompanyCustomerMapper {
|
|
231
|
+
toModelFormData(dto: any): CompanyCustomerFormDataResult;
|
|
232
|
+
toModel(dto: any): any;
|
|
233
|
+
toModelList(dtos: any[]): {
|
|
234
|
+
data: any[];
|
|
235
|
+
pagination: {
|
|
236
|
+
totalRecords: number;
|
|
237
|
+
};
|
|
238
|
+
};
|
|
239
|
+
toCreateDTO(customer: any): any;
|
|
240
|
+
toUpdateDTO(customer: any): any;
|
|
241
|
+
}
|
|
183
242
|
|
|
184
|
-
declare class
|
|
243
|
+
declare class CompanyCustomerHttp implements ICompanyCustomerHttp {
|
|
185
244
|
private apiUrl;
|
|
186
245
|
private http;
|
|
187
246
|
private mapper;
|
|
247
|
+
getFormData(): Observable<any>;
|
|
188
248
|
list(params: any): Observable<any>;
|
|
189
249
|
create(customer: any): Observable<any>;
|
|
190
250
|
update(id: string, customer: any): Observable<any>;
|
|
@@ -193,18 +253,28 @@ declare class CompanyCustomerService implements ICompanyCustomerService {
|
|
|
193
253
|
validate(customer: any): Record<string, any> | null;
|
|
194
254
|
private isValidEmail;
|
|
195
255
|
private isValidPhone;
|
|
196
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<
|
|
197
|
-
static ɵprov: _angular_core.ɵɵInjectableDeclaration<
|
|
256
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CompanyCustomerHttp, never>;
|
|
257
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<CompanyCustomerHttp>;
|
|
198
258
|
}
|
|
199
259
|
|
|
200
|
-
interface
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
260
|
+
interface CustomerSri {
|
|
261
|
+
phone: string;
|
|
262
|
+
email: string;
|
|
263
|
+
idCard: string;
|
|
264
|
+
businessName: string;
|
|
265
|
+
address: string;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
declare class CustomerSriHttp {
|
|
269
|
+
private http;
|
|
270
|
+
private get url();
|
|
271
|
+
getById(identificationNumber: string): Observable<ApiResponse<CustomerSri>>;
|
|
272
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CustomerSriHttp, never>;
|
|
273
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<CustomerSriHttp>;
|
|
205
274
|
}
|
|
206
275
|
|
|
207
276
|
declare class CompanyCustomerDefaultMapper implements ICompanyCustomerMapper {
|
|
277
|
+
toModelFormData(response: any): any;
|
|
208
278
|
toModel(dto: any): any;
|
|
209
279
|
toModelList(response: any): {
|
|
210
280
|
data: any;
|
|
@@ -216,22 +286,43 @@ declare class CompanyCustomerDefaultMapper implements ICompanyCustomerMapper {
|
|
|
216
286
|
toUpdateDTO(customer: any): any;
|
|
217
287
|
}
|
|
218
288
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
idCard: string;
|
|
223
|
-
businessName: string;
|
|
224
|
-
address: string;
|
|
225
|
-
}
|
|
289
|
+
declare const COMPANY_CUSTOMER_MAPPER: InjectionToken<ICompanyCustomerMapper>;
|
|
290
|
+
declare const COMPANY_CUSTOMER_FORM_CONFIG: InjectionToken<CompanyCustomerFormConfig>;
|
|
291
|
+
declare const COMPANY_CUSTOMER_HTTP_TOKEN: InjectionToken<ICompanyCustomerHttp>;
|
|
226
292
|
|
|
227
|
-
|
|
228
|
-
|
|
293
|
+
declare class CompanyCustomerList implements OnInit {
|
|
294
|
+
http: _acontplus_ng_customer.ICompanyCustomerHttp;
|
|
295
|
+
canEdit: _angular_core.InputSignal<boolean>;
|
|
296
|
+
canAdd: _angular_core.InputSignal<boolean>;
|
|
297
|
+
canInactive: _angular_core.InputSignal<boolean>;
|
|
298
|
+
canGenerateReport: _angular_core.InputSignal<boolean>;
|
|
299
|
+
dataSearch: {
|
|
300
|
+
textSearch: string | null;
|
|
301
|
+
};
|
|
302
|
+
dataSource: _angular_core.WritableSignal<CompanyCustomerListDto[]>;
|
|
303
|
+
columnsDefs: DataGridColumn[];
|
|
304
|
+
pageIndex: _angular_core.WritableSignal<number>;
|
|
305
|
+
pageSize: _angular_core.WritableSignal<number>;
|
|
306
|
+
pageCount: _angular_core.WritableSignal<number>;
|
|
307
|
+
refresh(): void;
|
|
308
|
+
private list;
|
|
309
|
+
ngOnInit(): void;
|
|
310
|
+
handlePageEvent($event: PageEvent): void;
|
|
311
|
+
exportExcel(): void;
|
|
312
|
+
exportPdf(): void;
|
|
313
|
+
askToDelete(data: CompanyCustomerListDto): void;
|
|
314
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CompanyCustomerList, never>;
|
|
315
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CompanyCustomerList, "acp-company-customer-list", never, { "canEdit": { "alias": "canEdit"; "required": false; "isSignal": true; }; "canAdd": { "alias": "canAdd"; "required": false; "isSignal": true; }; "canInactive": { "alias": "canInactive"; "required": false; "isSignal": true; }; "canGenerateReport": { "alias": "canGenerateReport"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
229
316
|
}
|
|
230
317
|
|
|
231
|
-
declare
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
318
|
+
declare class CompanyCustomerAddEditDirective {
|
|
319
|
+
private dgSvc;
|
|
320
|
+
companyCustomerSaved: _angular_core.OutputEmitterRef<any>;
|
|
321
|
+
id: _angular_core.InputSignal<number>;
|
|
322
|
+
onClick(event: MouseEvent): Promise<void>;
|
|
323
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CompanyCustomerAddEditDirective, never>;
|
|
324
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CompanyCustomerAddEditDirective, "[acpCompanyCustomerAddEdit]", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; }, { "companyCustomerSaved": "companyCustomerSaved"; }, never, never, true, never>;
|
|
325
|
+
}
|
|
235
326
|
|
|
236
327
|
declare class CustomerValidators {
|
|
237
328
|
static endsWith001(): ValidatorFn;
|
|
@@ -241,5 +332,8 @@ declare class CustomerValidators {
|
|
|
241
332
|
static ecuadorianPhone(): ValidatorFn;
|
|
242
333
|
}
|
|
243
334
|
|
|
244
|
-
|
|
245
|
-
|
|
335
|
+
declare const MAIN_APP_COMPANY_CUSTOMER_CONFIG: CompanyCustomerFormConfig;
|
|
336
|
+
declare const POS_COMPANY_CUSTOMER_CONFIG: CompanyCustomerFormConfig;
|
|
337
|
+
|
|
338
|
+
export { COMPANY_CUSTOMER_FORM_CONFIG, COMPANY_CUSTOMER_HTTP_TOKEN, COMPANY_CUSTOMER_MAPPER, CompanyCustomerAddEditDialog, CompanyCustomerAddEditDirective, CompanyCustomerDefaultMapper, CompanyCustomerForm, CompanyCustomerFormDataResult, CompanyCustomerHttp, CompanyCustomerList, CustomerSriHttp, CustomerValidators, MAIN_APP_COMPANY_CUSTOMER_CONFIG, POS_COMPANY_CUSTOMER_CONFIG };
|
|
339
|
+
export type { CompanyCustomerFormConfig, CompanyCustomerListDto, CreditFieldsConfig, Customer, CustomerInfoCredit, FieldConfig, ICompanyCustomerHttp, ICompanyCustomerMapper };
|