ravcredit-lib 0.0.32 → 0.0.34

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.
Files changed (68) hide show
  1. package/fesm2022/ravcredit-lib.mjs +2257 -0
  2. package/fesm2022/ravcredit-lib.mjs.map +1 -0
  3. package/index.d.ts +1897 -0
  4. package/package.json +25 -14
  5. package/ng-package.json +0 -7
  6. package/src/index.d.ts +0 -66
  7. package/src/lib/ravcredit-lib.component.spec.ts +0 -23
  8. package/src/lib/ravcredit-lib.component.ts +0 -16
  9. package/src/lib/ravcredit-lib.service.spec.ts +0 -16
  10. package/src/lib/ravcredit-lib.service.ts +0 -9
  11. package/src/lib/v1/const/constants.ts +0 -37
  12. package/src/lib/v1/idb/idb.service.spec.ts +0 -16
  13. package/src/lib/v1/idb/indexed-db.service.ts +0 -396
  14. package/src/lib/v1/objects/oAddress.ts +0 -9
  15. package/src/lib/v1/objects/oBusiness.ts +0 -93
  16. package/src/lib/v1/objects/oClient.ts +0 -46
  17. package/src/lib/v1/objects/oConekta.ts +0 -361
  18. package/src/lib/v1/objects/oContract.ts +0 -31
  19. package/src/lib/v1/objects/oContractAll.ts +0 -37
  20. package/src/lib/v1/objects/oCustomer.ts +0 -36
  21. package/src/lib/v1/objects/oDevice.ts +0 -5
  22. package/src/lib/v1/objects/oFinancial.ts +0 -32
  23. package/src/lib/v1/objects/oLogIn.ts +0 -26
  24. package/src/lib/v1/objects/oNewPayment.ts +0 -18
  25. package/src/lib/v1/objects/oNotification.ts +0 -33
  26. package/src/lib/v1/objects/oPassport.ts +0 -60
  27. package/src/lib/v1/objects/oUser.ts +0 -35
  28. package/src/lib/v1/objects/oVerification.ts +0 -79
  29. package/src/lib/v1/util/UtilBusiness.ts +0 -187
  30. package/src/lib/v1/util/UtilClient.ts +0 -300
  31. package/src/lib/v1/util/UtilConekta.ts +0 -97
  32. package/src/lib/v1/util/UtilContract.ts +0 -430
  33. package/src/lib/v1/util/UtilDashboard.ts +0 -19
  34. package/src/lib/v1/util/UtilDynamiCore.ts +0 -752
  35. package/src/lib/v1/util/UtilNotification.ts +0 -46
  36. package/src/lib/v1/util/UtilPassport.ts +0 -33
  37. package/src/lib/v1/util/UtilPayment.ts +0 -22
  38. package/src/lib/v1/util/UtilTime.ts +0 -179
  39. package/src/lib/v1/util/UtilsHttp.ts +0 -25
  40. package/src/lib/v2/constant/constants.ts +0 -125
  41. package/src/lib/v2/constant/messages.ts +0 -28
  42. package/src/lib/v2/enum/EnumAsset.ts +0 -4
  43. package/src/lib/v2/enum/EnumAuth.ts +0 -29
  44. package/src/lib/v2/enum/EnumClient.ts +0 -7
  45. package/src/lib/v2/enum/EnumConekta.ts +0 -14
  46. package/src/lib/v2/enum/EnumDynamic.ts +0 -8
  47. package/src/lib/v2/enum/EnumNotification.ts +0 -1
  48. package/src/lib/v2/enum/EnumPassport.ts +0 -4
  49. package/src/lib/v2/enum/EnumPayment.ts +0 -5
  50. package/src/lib/v2/enum/EnumRoles.ts +0 -7
  51. package/src/lib/v2/enum/EnumToken.ts +0 -11
  52. package/src/lib/v2/enum/EnumUtil.ts +0 -22
  53. package/src/lib/v2/enum/EnumVerification.ts +0 -22
  54. package/src/lib/v2/objects/oAsset.ts +0 -44
  55. package/src/lib/v2/objects/oAws.ts +0 -8
  56. package/src/lib/v2/objects/oCatalog.ts +0 -6
  57. package/src/lib/v2/objects/oClient.ts +0 -36
  58. package/src/lib/v2/objects/oCompany.ts +0 -10
  59. package/src/lib/v2/objects/oContract.ts +0 -10
  60. package/src/lib/v2/objects/oHttp.ts +0 -33
  61. package/src/lib/v2/objects/oMediaDto.ts +0 -10
  62. package/src/lib/v2/objects/oMessaging.ts +0 -10
  63. package/src/lib/v2/objects/oScoreDto.ts +0 -38
  64. package/src/lib/v2/objects/oUtil.ts +0 -68
  65. package/src/public-api.ts +0 -66
  66. package/tsconfig.lib.json +0 -15
  67. package/tsconfig.lib.prod.json +0 -11
  68. package/tsconfig.spec.json +0 -15
@@ -0,0 +1,2257 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, Component, runInInjectionContext, inject } from '@angular/core';
3
+ import { UntypedFormControl, Validators, UntypedFormArray } from '@angular/forms';
4
+ import { add, getDate, format } from 'date-fns';
5
+ import { es } from 'date-fns/locale/es';
6
+ import { openDB } from 'idb';
7
+
8
+ class RavcreditLibService {
9
+ constructor() { }
10
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: RavcreditLibService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
11
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: RavcreditLibService, providedIn: 'root' });
12
+ }
13
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: RavcreditLibService, decorators: [{
14
+ type: Injectable,
15
+ args: [{
16
+ providedIn: 'root'
17
+ }]
18
+ }], ctorParameters: () => [] });
19
+
20
+ class RavcreditLibComponent {
21
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: RavcreditLibComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
22
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.1", type: RavcreditLibComponent, isStandalone: true, selector: "lib-ravcredit-lib", ngImport: i0, template: `
23
+ <p>
24
+ ravcredit-lib works!
25
+ </p>
26
+ `, isInline: true, styles: [""] });
27
+ }
28
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: RavcreditLibComponent, decorators: [{
29
+ type: Component,
30
+ args: [{ selector: 'lib-ravcredit-lib', standalone: true, imports: [], template: `
31
+ <p>
32
+ ravcredit-lib works!
33
+ </p>
34
+ ` }]
35
+ }] });
36
+
37
+ //
38
+ // {
39
+ // data: {
40
+ // object: {
41
+ // id: '66bf1b25e341ed00158a169a',
42
+ // livemode: false,
43
+ // created_at: 1723800357,
44
+ // currency: 'MXN',
45
+ // payment_method: [Object],
46
+ // object: 'charge',
47
+ // description: 'Payment from order',
48
+ // status: 'paid',
49
+ // amount: 28125,
50
+ // paid_at: 1723800396,
51
+ // fee: 1273,
52
+ // customer_id: '',
53
+ // order_id: 'ord_2wTWbvyFgywHDvTZg'
54
+ // },
55
+ // previous_attributes: { status: 'pending_payment' }
56
+ // },
57
+ // livemode: false,
58
+ // webhook_status: 'pending',
59
+ // webhook_logs: [
60
+ // {
61
+ // id: 'webhl_2wTWcRE8ThHpvG1QQ',
62
+ // url: 'https://b1b6-2806-230-2610-b3ed-dcbe-6d32-758f-17c6.ngrok-free.app/api/v1/webhook',
63
+ // failed_attempts: 0,
64
+ // last_http_response_status: -1,
65
+ // response_data: null,
66
+ // object: 'webhook_log',
67
+ // last_attempted_at: 0
68
+ // }
69
+ // ],
70
+ // id: '66bf1b4c2973ff0001dff653',
71
+ // object: 'event',
72
+ // type: 'charge.paid',
73
+ // created_at: 1723800396
74
+ // }
75
+
76
+ //
77
+ // export interface iCustomerInfo = Pick<iCustomer, email | id | name | phone> {
78
+ //
79
+ // customer_id:string
80
+ // }
81
+ // {
82
+ // livemode: false,
83
+ // name: Vicente Mendoza,
84
+ // email: vicente.mendoza@conekta.com,
85
+ // phone: 5566982093,
86
+ // id: cus_2wHtqBNsSggaYdfXu,
87
+ // object: customer,
88
+ // created_at: 1721258796,
89
+ // corporate: false,
90
+ // custom_reference:
91
+ // }
92
+
93
+ const cTopic = "RavCreditClients";
94
+ const cNotification = {
95
+ notification: {
96
+ title: "",
97
+ body: ""
98
+ },
99
+ data: {
100
+ route: ""
101
+ }
102
+ };
103
+
104
+ /** ******************************** */
105
+
106
+ // export enum oGenVerificationProvider {
107
+ // pending, approved, expired
108
+ // }
109
+ //
110
+ // export interface oVerificationLookup {
111
+ // carrier: any[]
112
+ // }
113
+ //
114
+ // export interface oVerificationSenCodeAttempt {
115
+ // attempt_sid: any[],
116
+ // channel: any[],
117
+ // time: any[]
118
+ // }
119
+ //
120
+ // export interface oGenVerification {
121
+ // Sid: string
122
+ // ServiceSid: string,
123
+ // AccountSid: string,
124
+ // To: string,
125
+ // Channel: any,
126
+ // Status: oGenVerificationProvider,
127
+ // Valid: boolean,
128
+ // Lookup: oVerificationLookup,
129
+ // SendCodeAttempts: oVerificationSenCodeAttempt[],
130
+ // DateCreated: string,
131
+ // DateUpdated: string,
132
+ // Url: string
133
+ // }
134
+ //
135
+ // export interface oVerification {
136
+ // Sid : string,
137
+ // ServiceSid : string,
138
+ // AccountSid : string,
139
+ // To : string,
140
+ // Channel : any,
141
+ // Status : oGenVerificationProvider,
142
+ // Valid : boolean,
143
+ // DateCreated : string,
144
+ // DateUpdated : string
145
+ // }
146
+
147
+ var eClientStatus;
148
+ (function (eClientStatus) {
149
+ eClientStatus["ACTIVE"] = "active";
150
+ eClientStatus["COMPLETED"] = "completed";
151
+ eClientStatus["PAUSED"] = "paused";
152
+ eClientStatus["CANCELED"] = "canceled";
153
+ eClientStatus["LATE"] = "late";
154
+ })(eClientStatus || (eClientStatus = {}));
155
+
156
+ var eRoles;
157
+ (function (eRoles) {
158
+ eRoles["Administrator"] = "Administrator";
159
+ eRoles["Seller"] = "Seller";
160
+ eRoles["Consultant"] = "Consultant";
161
+ eRoles["Client"] = "Client";
162
+ eRoles["User"] = "User";
163
+ })(eRoles || (eRoles = {}));
164
+
165
+ var HttpStatus;
166
+ (function (HttpStatus) {
167
+ HttpStatus[HttpStatus["CONTINUE"] = 100] = "CONTINUE";
168
+ HttpStatus[HttpStatus["SWITCHING_PROTOCOLS"] = 101] = "SWITCHING_PROTOCOLS";
169
+ HttpStatus[HttpStatus["PROCESSING"] = 102] = "PROCESSING";
170
+ HttpStatus[HttpStatus["EARLYHINTS"] = 103] = "EARLYHINTS";
171
+ HttpStatus[HttpStatus["OK"] = 200] = "OK";
172
+ HttpStatus[HttpStatus["CREATED"] = 201] = "CREATED";
173
+ HttpStatus[HttpStatus["ACCEPTED"] = 202] = "ACCEPTED";
174
+ HttpStatus[HttpStatus["NON_AUTHORITATIVE_INFORMATION"] = 203] = "NON_AUTHORITATIVE_INFORMATION";
175
+ HttpStatus[HttpStatus["NO_CONTENT"] = 204] = "NO_CONTENT";
176
+ HttpStatus[HttpStatus["RESET_CONTENT"] = 205] = "RESET_CONTENT";
177
+ HttpStatus[HttpStatus["PARTIAL_CONTENT"] = 206] = "PARTIAL_CONTENT";
178
+ HttpStatus[HttpStatus["AMBIGUOUS"] = 300] = "AMBIGUOUS";
179
+ HttpStatus[HttpStatus["MOVED_PERMANENTLY"] = 301] = "MOVED_PERMANENTLY";
180
+ HttpStatus[HttpStatus["FOUND"] = 302] = "FOUND";
181
+ HttpStatus[HttpStatus["SEE_OTHER"] = 303] = "SEE_OTHER";
182
+ HttpStatus[HttpStatus["NOT_MODIFIED"] = 304] = "NOT_MODIFIED";
183
+ HttpStatus[HttpStatus["TEMPORARY_REDIRECT"] = 307] = "TEMPORARY_REDIRECT";
184
+ HttpStatus[HttpStatus["PERMANENT_REDIRECT"] = 308] = "PERMANENT_REDIRECT";
185
+ HttpStatus[HttpStatus["BAD_REQUEST"] = 400] = "BAD_REQUEST";
186
+ HttpStatus[HttpStatus["UNAUTHORIZED"] = 401] = "UNAUTHORIZED";
187
+ HttpStatus[HttpStatus["PAYMENT_REQUIRED"] = 402] = "PAYMENT_REQUIRED";
188
+ HttpStatus[HttpStatus["FORBIDDEN"] = 403] = "FORBIDDEN";
189
+ HttpStatus[HttpStatus["NOT_FOUND"] = 404] = "NOT_FOUND";
190
+ HttpStatus[HttpStatus["METHOD_NOT_ALLOWED"] = 405] = "METHOD_NOT_ALLOWED";
191
+ HttpStatus[HttpStatus["NOT_ACCEPTABLE"] = 406] = "NOT_ACCEPTABLE";
192
+ HttpStatus[HttpStatus["PROXY_AUTHENTICATION_REQUIRED"] = 407] = "PROXY_AUTHENTICATION_REQUIRED";
193
+ HttpStatus[HttpStatus["REQUEST_TIMEOUT"] = 408] = "REQUEST_TIMEOUT";
194
+ HttpStatus[HttpStatus["CONFLICT"] = 409] = "CONFLICT";
195
+ HttpStatus[HttpStatus["GONE"] = 410] = "GONE";
196
+ HttpStatus[HttpStatus["LENGTH_REQUIRED"] = 411] = "LENGTH_REQUIRED";
197
+ HttpStatus[HttpStatus["PRECONDITION_FAILED"] = 412] = "PRECONDITION_FAILED";
198
+ HttpStatus[HttpStatus["PAYLOAD_TOO_LARGE"] = 413] = "PAYLOAD_TOO_LARGE";
199
+ HttpStatus[HttpStatus["URI_TOO_LONG"] = 414] = "URI_TOO_LONG";
200
+ HttpStatus[HttpStatus["UNSUPPORTED_MEDIA_TYPE"] = 415] = "UNSUPPORTED_MEDIA_TYPE";
201
+ HttpStatus[HttpStatus["REQUESTED_RANGE_NOT_SATISFIABLE"] = 416] = "REQUESTED_RANGE_NOT_SATISFIABLE";
202
+ HttpStatus[HttpStatus["EXPECTATION_FAILED"] = 417] = "EXPECTATION_FAILED";
203
+ HttpStatus[HttpStatus["I_AM_A_TEAPOT"] = 418] = "I_AM_A_TEAPOT";
204
+ HttpStatus[HttpStatus["MISDIRECTED"] = 421] = "MISDIRECTED";
205
+ HttpStatus[HttpStatus["UNPROCESSABLE_ENTITY"] = 422] = "UNPROCESSABLE_ENTITY";
206
+ HttpStatus[HttpStatus["FAILED_DEPENDENCY"] = 424] = "FAILED_DEPENDENCY";
207
+ HttpStatus[HttpStatus["PRECONDITION_REQUIRED"] = 428] = "PRECONDITION_REQUIRED";
208
+ HttpStatus[HttpStatus["TOO_MANY_REQUESTS"] = 429] = "TOO_MANY_REQUESTS";
209
+ HttpStatus[HttpStatus["INTERNAL_SERVER_ERROR"] = 500] = "INTERNAL_SERVER_ERROR";
210
+ HttpStatus[HttpStatus["NOT_IMPLEMENTED"] = 501] = "NOT_IMPLEMENTED";
211
+ HttpStatus[HttpStatus["BAD_GATEWAY"] = 502] = "BAD_GATEWAY";
212
+ HttpStatus[HttpStatus["SERVICE_UNAVAILABLE"] = 503] = "SERVICE_UNAVAILABLE";
213
+ HttpStatus[HttpStatus["GATEWAY_TIMEOUT"] = 504] = "GATEWAY_TIMEOUT";
214
+ HttpStatus[HttpStatus["HTTP_VERSION_NOT_SUPPORTED"] = 505] = "HTTP_VERSION_NOT_SUPPORTED";
215
+ })(HttpStatus || (HttpStatus = {}));
216
+
217
+ const cSingleOptionClientStatus = {
218
+ viewValue: "",
219
+ value: ""
220
+ };
221
+ const cOptionsClientStatus = [
222
+ {
223
+ value: eClientStatus.ACTIVE,
224
+ viewValue: "Activar"
225
+ }, {
226
+ value: eClientStatus.COMPLETED,
227
+ viewValue: "Completar"
228
+ }, {
229
+ value: eClientStatus.PAUSED,
230
+ viewValue: "Pausar"
231
+ }, {
232
+ value: eClientStatus.LATE,
233
+ viewValue: "Marcar con atraso"
234
+ }, {
235
+ value: eClientStatus.CANCELED,
236
+ viewValue: "Cancelar"
237
+ }
238
+ ];
239
+ const eRolesSelect = [
240
+ {
241
+ value: eRoles.Administrator,
242
+ viewValue: eRoles.Administrator
243
+ },
244
+ {
245
+ value: eRoles.Consultant,
246
+ viewValue: eRoles.Consultant
247
+ },
248
+ {
249
+ value: eRoles.Seller,
250
+ viewValue: eRoles.Seller
251
+ },
252
+ ];
253
+ const cPaymentDelay = {
254
+ today: 0,
255
+ nextPayment: 0,
256
+ daysDelay: 0,
257
+ late: false,
258
+ };
259
+ const snackBarConfigAction = {
260
+ horizontalPosition: "start"
261
+ };
262
+ const snackBarConfigNoAction = {
263
+ duration: 4000,
264
+ horizontalPosition: "start"
265
+ };
266
+ const snackBarConfigNoActionLong = {
267
+ duration: 8000,
268
+ horizontalPosition: "start"
269
+ };
270
+ const cTyClientContract = { ...cClient, ...cContract };
271
+ const cAddress = {
272
+ street: "",
273
+ city: "",
274
+ neighbor: "",
275
+ zip: "",
276
+ ext: "",
277
+ int: "",
278
+ state: ""
279
+ };
280
+ const cOxxoRecurrentSourcesData = {
281
+ id: "",
282
+ object: "",
283
+ type: "",
284
+ provider: "",
285
+ reference: "",
286
+ barcode: "",
287
+ barcode_url: "",
288
+ expires_at: 0,
289
+ created_at: 0,
290
+ parent_id: ""
291
+ };
292
+ const cOxxoRecurrentSources = {
293
+ object: "",
294
+ has_more: false,
295
+ total: 0,
296
+ data: []
297
+ };
298
+ const cConektaRecurrent = {
299
+ livemode: false,
300
+ name: "",
301
+ email: "",
302
+ phone: "",
303
+ id: "",
304
+ object: "",
305
+ created_at: 0,
306
+ corporate: false,
307
+ custom_id: "",
308
+ payment_sources: cOxxoRecurrentSources
309
+ };
310
+ const cAuthConfig = {
311
+ title: "",
312
+ desc: "",
313
+ data: true,
314
+ };
315
+ const cDaySchedule = {
316
+ open: 0,
317
+ close: 0
318
+ };
319
+ const cResponse = {
320
+ path: '',
321
+ statusCode: HttpStatus.CONTINUE,
322
+ epochTime: 0,
323
+ data: null,
324
+ };
325
+
326
+ const cSchedule = {
327
+ day: "",
328
+ open: 0,
329
+ close: 0,
330
+ };
331
+ const cEmptyDay = {
332
+ close: 0, open: 0, day: ""
333
+ };
334
+ const week = [
335
+ "monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"
336
+ ];
337
+ const cDefinedSchedule = [
338
+ { close: 0, open: 0, day: "monday" },
339
+ { close: 0, open: 0, day: "tuesday" },
340
+ { close: 0, open: 0, day: "wednesday" },
341
+ { close: 0, open: 0, day: "thursday" },
342
+ { close: 0, open: 0, day: "friday" },
343
+ { close: 0, open: 0, day: "saturday" },
344
+ { close: 0, open: 0, day: "sunday" },
345
+ ];
346
+ const cBusinessInfo = {
347
+ version: "v2024",
348
+ name: "",
349
+ address: cAddress,
350
+ phones: [],
351
+ email: "",
352
+ };
353
+ const cBusinessDeadlines = {
354
+ weeks: 0,
355
+ interest: 0
356
+ };
357
+ const cBusinessConfig = {
358
+ version: "",
359
+ apiVersion: "",
360
+ adminVersion: "",
361
+ mobileVersion: "",
362
+ mobileVersionPrev: "",
363
+ deadlines: [],
364
+ downloadsClient: false,
365
+ passportPaymentReference: false,
366
+ conektaPaymentReference: false,
367
+ conektaPaymentLink: false,
368
+ dynamicPaymentReference: false,
369
+ apkUrl: "https://firebasestorage.googleapis.com/v0/b/ravcredit-2b079.appspot.com/o/mobile-app%2Fapp-release.apk?alt=media&token=ae05f332-a39a-46ad-8a64-312ae1487496"
370
+ };
371
+ class FactoryBusiness {
372
+ static FormBusinessInfo(info) {
373
+ let data = cBusinessInfo;
374
+ if (info)
375
+ data = info;
376
+ if (!info?.address)
377
+ data.address = cAddress;
378
+ return {
379
+ name: new UntypedFormControl(data.name, Validators.required),
380
+ email: new UntypedFormControl(data.email, [Validators.required, Validators.email]),
381
+ desc: new UntypedFormControl(data.desc, [Validators.required, Validators.email]),
382
+ street: new UntypedFormControl(data.address.street, Validators.required),
383
+ neighbor: new UntypedFormControl(data.address.neighbor, Validators.required),
384
+ cp: new UntypedFormControl(data.address.zip, Validators.required),
385
+ ext: new UntypedFormControl(data.address.ext, Validators.required),
386
+ int: new UntypedFormControl(data.address.int),
387
+ city: new UntypedFormControl(data.address.city, Validators.required),
388
+ state: new UntypedFormControl(data.address.state, Validators.required),
389
+ phones: new UntypedFormControl(data.phones),
390
+ mondayOpen: new UntypedFormControl(data.schedule?.monday.open),
391
+ mondayClose: new UntypedFormControl(data.schedule?.monday.close),
392
+ tuesdayOpen: new UntypedFormControl(data.schedule?.tuesday.open),
393
+ tuesdayClose: new UntypedFormControl(data.schedule?.tuesday.close),
394
+ wednesdayOpen: new UntypedFormControl(data.schedule?.wednesday.open),
395
+ wednesdayClose: new UntypedFormControl(data.schedule?.wednesday.close),
396
+ thursdayOpen: new UntypedFormControl(data.schedule?.thursday.open),
397
+ thursdayClose: new UntypedFormControl(data.schedule?.thursday.close),
398
+ fridayOpen: new UntypedFormControl(data.schedule?.friday.open),
399
+ fridayClose: new UntypedFormControl(data.schedule?.friday.close),
400
+ saturdayOpen: new UntypedFormControl(data.schedule?.saturday.open),
401
+ saturdayClose: new UntypedFormControl(data.schedule?.saturday.close),
402
+ sundayOpen: new UntypedFormControl(data.schedule?.sunday.open),
403
+ sundayClose: new UntypedFormControl(data.schedule?.sunday.close),
404
+ };
405
+ }
406
+ static CreateBusinessInfoObj(data) {
407
+ const address = cAddress;
408
+ const schedule = {
409
+ monday: cDaySchedule,
410
+ tuesday: cDaySchedule,
411
+ wednesday: cDaySchedule,
412
+ thursday: cDaySchedule,
413
+ friday: cDaySchedule,
414
+ saturday: cDaySchedule,
415
+ sunday: cDaySchedule
416
+ };
417
+ if (data.street)
418
+ address.street = data.street;
419
+ if (data.state)
420
+ address.state = data.state;
421
+ if (data.neighbor)
422
+ address.neighbor = data.neighbor;
423
+ if (data.city)
424
+ address.city = data.city;
425
+ if (data.ext)
426
+ address.ext = data.ext;
427
+ if (data.int)
428
+ address.int = data.int;
429
+ if (data.cp)
430
+ address.zip = data.cp;
431
+ if (data.mondayOpen)
432
+ schedule.monday.open = Number(data.mondayOpen);
433
+ if (data.mondayClose)
434
+ schedule.monday.close = Number(data.mondayClose);
435
+ if (data.tuesdayOpen)
436
+ schedule.tuesday.open = Number(data.tuesdayOpen);
437
+ if (data.tuesdayClose)
438
+ schedule.tuesday.close = Number(data.tuesdayClose);
439
+ if (data.wednesdayOpen)
440
+ schedule.wednesday.open = Number(data.wednesdayOpen);
441
+ if (data.wednesdayClose)
442
+ schedule.wednesday.close = Number(data.wednesdayClose);
443
+ if (data.thursdayOpen)
444
+ schedule.thursday.open = Number(data.thursdayOpen);
445
+ if (data.thursdayClose)
446
+ schedule.thursday.close = Number(data.thursdayClose);
447
+ if (data.fridayOpen)
448
+ schedule.friday.open = Number(data.fridayOpen);
449
+ if (data.fridayClose)
450
+ schedule.friday.close = Number(data.fridayClose);
451
+ if (data.saturdayOpen)
452
+ schedule.saturday.open = Number(data.saturdayOpen);
453
+ if (data.saturdayClose)
454
+ schedule.saturday.close = Number(data.saturdayClose);
455
+ if (data.sundayOpen)
456
+ schedule.sunday.open = Number(data.sundayOpen);
457
+ if (data.sundayClose)
458
+ schedule.sunday.close = Number(data.sundayClose);
459
+ const info = {
460
+ version: "v2024",
461
+ name: data.name ? data.name : "",
462
+ address: address,
463
+ phones: data.phones ? data.phones : [],
464
+ email: data.email ? data.email : "",
465
+ schedule: schedule,
466
+ desc: data.desc ? data.desc : ""
467
+ };
468
+ return info;
469
+ }
470
+ static FormDeadlineConfig(data) {
471
+ // if (!data) data = cBusinessDeadlines
472
+ return {
473
+ weeks: new UntypedFormControl(data.weeks),
474
+ interest: new UntypedFormControl(data.interest),
475
+ };
476
+ }
477
+ static FormBusinessConfig(config) {
478
+ let data = cBusinessConfig;
479
+ if (config)
480
+ data = config;
481
+ return {
482
+ downloadsClient: new UntypedFormControl(data.downloadsClient),
483
+ passportPaymentReference: new UntypedFormControl(data.passportPaymentReference),
484
+ conektaPaymentReference: new UntypedFormControl(data.conektaPaymentReference),
485
+ conektaPaymentLink: new UntypedFormControl(data.conektaPaymentLink),
486
+ dynamicPaymentReference: new UntypedFormControl(data.dynamicPaymentReference),
487
+ deadlines: new UntypedFormArray([])
488
+ };
489
+ }
490
+ static testBusiness(message) {
491
+ return `Message ${message}`;
492
+ }
493
+ }
494
+
495
+ var eProvider;
496
+ (function (eProvider) {
497
+ eProvider["none"] = "";
498
+ eProvider["Conekta"] = "Conekta";
499
+ eProvider["Passport"] = "Passport";
500
+ eProvider["DynamiCore"] = "DynamiCore";
501
+ })(eProvider || (eProvider = {}));
502
+ const cDevice = {
503
+ device: "",
504
+ IMEI: ""
505
+ };
506
+ const cFinancial = {
507
+ total: 0,
508
+ initial: 0,
509
+ deadlines: cBusinessDeadlines,
510
+ initDate: 0,
511
+ weeklyPayment: 0,
512
+ pendingOf: [],
513
+ progress: [],
514
+ interest: 0,
515
+ provider: eProvider.DynamiCore,
516
+ financed: 0,
517
+ nextPayment: 0,
518
+ amount_commission_opening: 0,
519
+ principal_disbursed: 0,
520
+ expected_disbursed: 0, // ---------
521
+ credit_type: 'Arrendamiento',
522
+ interest_rate: 0,
523
+ commission_opening: 0,
524
+ interest_arrears: 0,
525
+ };
526
+ const cContract = {
527
+ id: "",
528
+ client: "",
529
+ address: cAddress,
530
+ device: cDevice,
531
+ financial: cFinancial,
532
+ by: "",
533
+ active: true
534
+ };
535
+ class FactoryContract {
536
+ static FormClient(client) {
537
+ let data = cClient;
538
+ if (client)
539
+ data = client;
540
+ return {
541
+ name: new UntypedFormControl(data.name, [Validators.required, Validators.minLength(10)]),
542
+ email: new UntypedFormControl(data.username, [Validators.required, Validators.email]),
543
+ phone: new UntypedFormControl(data.phone, [Validators.required, Validators.min(10)]),
544
+ curp: new UntypedFormControl(data.curp, [Validators.required, Validators.minLength(16)]),
545
+ userReferences: new UntypedFormArray([])
546
+ };
547
+ }
548
+ static CreateUserReferenceFormObj(user) {
549
+ let data = cUserReference;
550
+ if (user.name != "")
551
+ data = user;
552
+ return {
553
+ name: new UntypedFormControl(data.name, [Validators.required, Validators.minLength(10)]),
554
+ phone: new UntypedFormControl(data.phone, [Validators.required]),
555
+ relationship: new UntypedFormControl(data.relationship, [Validators.required]),
556
+ };
557
+ }
558
+ static FormAddress(address) {
559
+ let data = cAddress;
560
+ if (address)
561
+ data = address;
562
+ return {
563
+ street: new UntypedFormControl(data.street, Validators.required),
564
+ neighbor: new UntypedFormControl(data.neighbor, Validators.required),
565
+ cp: new UntypedFormControl(data.zip, Validators.required),
566
+ ext: new UntypedFormControl(data.ext, Validators.required),
567
+ int: new UntypedFormControl(data.int),
568
+ city: new UntypedFormControl(data.city, Validators.required),
569
+ state: new UntypedFormControl(data.state, Validators.required),
570
+ };
571
+ }
572
+ static FormDevice(device) {
573
+ let data = cDevice;
574
+ if (device)
575
+ data = device;
576
+ return {
577
+ model: new UntypedFormControl(data.device, Validators.required),
578
+ IMEI: new UntypedFormControl(data.IMEI, Validators.required),
579
+ ID: new UntypedFormControl(data.id),
580
+ };
581
+ }
582
+ static FormFinancial(financial) {
583
+ let data = cFinancial;
584
+ if (financial)
585
+ data = financial;
586
+ data.credit_type = "Arrendamiento";
587
+ // data.deadlines.weeks = cBusinessDeadlines
588
+ return {
589
+ total: new UntypedFormControl(data.total, [Validators.required, Validators.min(1)]),
590
+ initial: new UntypedFormControl(data.initial, [Validators.required]),
591
+ financed: new UntypedFormControl(data.financed, Validators.min(1)),
592
+ weeklyPayment: new UntypedFormControl(data.weeklyPayment, [Validators.required, Validators.min(1)]),
593
+ deadlines: new UntypedFormControl(data.deadlines, [Validators.required]),
594
+ initDate: new UntypedFormControl(data.initDate),
595
+ provider: new UntypedFormControl(data.provider),
596
+ credit_type: new UntypedFormControl(data.credit_type ? data.credit_type : 0),
597
+ interest_rate: new UntypedFormControl(data.interest_rate ? data.interest_rate : 0), // interes credit dynamic
598
+ commission_opening: new UntypedFormControl(data.commission_opening ? data.commission_opening : 0),
599
+ interest_arrears: new UntypedFormControl(data.interest_arrears ? data.interest_arrears : 0), // intereses moratorios dynamic
600
+ amount_commission_opening: new UntypedFormControl(data.amount_commission_opening), // comision por apertura dynamic
601
+ principal_disbursed: new UntypedFormControl(data.principal_disbursed),
602
+ expected_disbursed: new UntypedFormControl(data.expected_disbursed)
603
+ };
604
+ }
605
+ static CreateContractFromFormObj(data, finalPay) {
606
+ const date = new Date();
607
+ const device = {
608
+ device: data["device"][0].model,
609
+ id: data["device"][0].ID,
610
+ IMEI: data["device"][0].IMEI
611
+ };
612
+ const address = {
613
+ street: data["address"][0].street,
614
+ city: data["address"][0].city,
615
+ neighbor: data["address"][0].neighbor,
616
+ zip: data["address"][0].cp,
617
+ ext: data["address"][0].ext,
618
+ int: data["address"][0].int,
619
+ state: data["address"][0].state
620
+ };
621
+ const financial = {
622
+ total: Number(data["financial"][0].total),
623
+ initial: data["financial"][0].initial,
624
+ deadlines: data["financial"][0].deadlines,
625
+ progress: [],
626
+ pendingOf: [],
627
+ weeklyPayment: data["financial"][0].weeklyPayment,
628
+ interest: data["financial"][0].interest_rate,
629
+ finalDate: date.getTime() + (data["financial"][0].deadlines.weeks * (604800 * 1000)),
630
+ initDate: date.getDate(),
631
+ dayCut: date.getDate(),
632
+ provider: data["financial"][0].provider,
633
+ finalPayment: finalPay,
634
+ financed: data["financial"][0].financed,
635
+ nextPayment: data["financial"][0].nextPayment
636
+ };
637
+ if (data["financial"][0].provider == eProvider.DynamiCore) {
638
+ financial.initial = data["financial"][0].amount_commission_opening ? Number(data["financial"][0].amount_commission_opening) : 0;
639
+ financial.expected_disbursed = data["financial"][0].expected_disbursed ? Number(data["financial"][0].expected_disbursed) : 0;
640
+ financial.principal_disbursed = data["financial"][0].principal_disbursed ? Number(data["financial"][0].principal_disbursed) : 0;
641
+ financial.interest_arrears = data["financial"][0].interest_rate ? Number(data["financial"][0].interest_rate) : 0;
642
+ financial.commission_opening = data["financial"][0].commission_opening ? Number(data["financial"][0].commission_opening) : 0;
643
+ financial.credit_type = data["financial"][0].credit_type ? data["financial"][0].credit_type : "";
644
+ financial.clabe = data["financial"][0].clabe ? data["financial"][0].clabe : "";
645
+ }
646
+ if (data["financial"][0].amount_commission_opening != undefined) {
647
+ if (Number(data["financial"][0].amount_commission_opening) > 0)
648
+ financial.initial = Number(data["financial"][0].amount_commission_opening);
649
+ else
650
+ financial.initial = Number(data["financial"][0].initial);
651
+ }
652
+ if (Number(data["financial"][0].amount_commission_opening) > 0)
653
+ financial.amount_commission_opening = Number(data["financial"][0].amount_commission_opening);
654
+ else
655
+ financial.amount_commission_opening = financial.initial;
656
+ if (financial.nextPayment == undefined)
657
+ financial.nextPayment = 0;
658
+ const contract = {
659
+ id: "",
660
+ client: "",
661
+ address: address,
662
+ device: device,
663
+ financial: financial,
664
+ by: "",
665
+ active: true,
666
+ lastPayment: date.getTime(),
667
+ createdAt: date.getTime()
668
+ };
669
+ return contract;
670
+ }
671
+ static CreateContractToConektaObj(data, monthlyPay, finalPay) {
672
+ const o = {};
673
+ const score = {
674
+ name: "",
675
+ score: 0
676
+ };
677
+ const catalog = {
678
+ name: "",
679
+ description: "",
680
+ id: "",
681
+ createdAt: 0
682
+ };
683
+ const brand = {
684
+ name: "",
685
+ id: "",
686
+ description: ""
687
+ };
688
+ const category = {
689
+ name: "",
690
+ id: "",
691
+ createAt: 0
692
+ };
693
+ const deviceV2 = {
694
+ name: "",
695
+ id: "",
696
+ createAt: new Date().getTime(),
697
+ category: category,
698
+ brand: brand,
699
+ price: 0,
700
+ model: "",
701
+ imageUrl: [],
702
+ paymentOption: [],
703
+ catalog: catalog,
704
+ offers: [],
705
+ score: score,
706
+ IMEI: ""
707
+ };
708
+ const device = {
709
+ device: data.device.device,
710
+ id: data.device.id,
711
+ IMEI: data.device.IMEI
712
+ };
713
+ const address = {
714
+ street: data.address.street,
715
+ city: data.address.city,
716
+ neighbor: data.address.neighbor,
717
+ zip: data.address.zip,
718
+ ext: data.address.ext,
719
+ int: data.address.int,
720
+ state: data.address.state
721
+ };
722
+ const financial = {
723
+ total: data.financial.total,
724
+ initial: data.financial.initial,
725
+ deadlines: data.financial.deadlines,
726
+ progress: data.financial.progress,
727
+ pendingOf: data.financial.pendingOf,
728
+ weeklyPayment: data.financial.weeklyPayment,
729
+ interest: data.financial.interest,
730
+ finalDate: data.financial.finalDate,
731
+ initDate: data.financial.initDate,
732
+ dayCut: data.financial.dayCut,
733
+ provider: data.financial.provider,
734
+ finalPayment: data.financial.finalPayment,
735
+ financed: data.financial.financed,
736
+ nextPayment: data.financial.nextPayment
737
+ };
738
+ const contract = {
739
+ id: "",
740
+ client: "",
741
+ address: address,
742
+ device: device,
743
+ financial: financial,
744
+ by: "",
745
+ active: true
746
+ };
747
+ return contract;
748
+ }
749
+ static CreateAuthForm(username, curp) {
750
+ const password = this.createPassword(curp);
751
+ return {
752
+ username: new UntypedFormControl(username, Validators.required),
753
+ password: new UntypedFormControl(password, Validators.required),
754
+ };
755
+ }
756
+ static createPassword(curp) {
757
+ const _curp = curp.split("");
758
+ let password = "";
759
+ const limit = 7;
760
+ if (_curp.length < 16)
761
+ return "";
762
+ password += _curp[0].toLowerCase();
763
+ for (let i = 1; i <= limit; i++)
764
+ password += _curp[i].toUpperCase();
765
+ password += `*`;
766
+ return password;
767
+ }
768
+ static MapperTypeContCli_Contract(_contract) {
769
+ const contract = {
770
+ id: _contract.contract,
771
+ client: _contract.client,
772
+ address: _contract.address,
773
+ device: _contract.device,
774
+ financial: _contract.financial,
775
+ by: _contract.by,
776
+ active: _contract.active,
777
+ lastPayment: _contract.lastPayment,
778
+ createdAt: _contract.createdAt,
779
+ dynamicAccount: _contract.dynamicAccount,
780
+ };
781
+ return contract;
782
+ }
783
+ static MapperSyncContractDynamic(base, account) {
784
+ let nContract = base;
785
+ let _financial = base.financial;
786
+ let _device = base.device;
787
+ const financial = {
788
+ total: _financial.total,
789
+ initial: account.properties.amount_commission_opening ? account.properties.amount_commission_opening : _financial.initial,
790
+ deadlines: _financial.deadlines,
791
+ progress: _financial.progress ? _financial.progress : [],
792
+ pendingOf: _financial.pendingOf ? _financial.pendingOf : [],
793
+ weeklyPayment: _financial.weeklyPayment,
794
+ interest: _financial.interest,
795
+ finalDate: _financial.finalDate,
796
+ initDate: _financial.initDate,
797
+ dayCut: _financial.dayCut,
798
+ provider: _financial.provider,
799
+ finalPayment: _financial.finalPayment,
800
+ financed: _financial.financed,
801
+ nextPayment: _financial.nextPayment ? _financial.nextPayment : 0,
802
+ amount_commission_opening: account.properties.amount_commission_opening,
803
+ expected_disbursed: account.properties.expected_disbursed ?
804
+ Number(account.properties.expected_disbursed) :
805
+ Number(_financial.expected_disbursed),
806
+ principal_disbursed: account.properties.principal_disbursed ?
807
+ account.properties.principal_disbursed :
808
+ _financial.principal_disbursed,
809
+ commission_opening: account.config.commission_opening ?
810
+ Number(account.config.commission_opening) :
811
+ Number(_financial.commission_opening),
812
+ credit_type: account.config.credit_type ? account.config.credit_type : _financial.credit_type,
813
+ clabe: String(account.properties.clabe ? account.properties.clabe : _financial.clabe)
814
+ };
815
+ const interestArrears = account.config.interest_arrears;
816
+ const prevInterestArrears = _financial.interest_arrears;
817
+ if (interestArrears != undefined) {
818
+ financial.interest_arrears = interestArrears;
819
+ }
820
+ else if (prevInterestArrears != undefined) {
821
+ financial.interest_arrears = prevInterestArrears;
822
+ }
823
+ else {
824
+ financial.interest_arrears = 0;
825
+ }
826
+ const interest = account.config.interest_rate;
827
+ const prevInterest = _financial.interest;
828
+ if (interest != undefined) {
829
+ financial.interest = interest;
830
+ }
831
+ else if (prevInterest != undefined) {
832
+ financial.interest = prevInterest;
833
+ }
834
+ else {
835
+ financial.interest = 0;
836
+ }
837
+ if (account.properties.amount_commission_opening != undefined) {
838
+ if (Number(account.properties.amount_commission_opening) > 0) {
839
+ financial.initial = Number(account.properties.amount_commission_opening);
840
+ financial.amount_commission_opening = Number(account.properties.amount_commission_opening);
841
+ }
842
+ else {
843
+ financial.initial = Number(_financial.initial);
844
+ financial.amount_commission_opening = financial.initial;
845
+ }
846
+ }
847
+ const seller = account.properties.seller_name;
848
+ nContract.by = seller != null ? seller : "";
849
+ nContract.device.id = _device.id ? _device.id : "";
850
+ nContract.financial = financial;
851
+ return nContract;
852
+ }
853
+ }
854
+ var eContractStatus;
855
+ (function (eContractStatus) {
856
+ eContractStatus["APPROVED"] = "APPROVED";
857
+ eContractStatus["DENIED"] = "DENIED";
858
+ eContractStatus["CANCELED"] = "CANCELED";
859
+ eContractStatus["PENDING"] = "PENDING";
860
+ eContractStatus["CHECKING"] = "CHECKING";
861
+ })(eContractStatus || (eContractStatus = {}));
862
+
863
+ const cClient = {
864
+ id: "",
865
+ name: "",
866
+ username: "",
867
+ email: "",
868
+ phone: "",
869
+ curp: "",
870
+ contract_temporary: "",
871
+ conekta_id: "",
872
+ userReferences: [],
873
+ status: ""
874
+ };
875
+ const cUserReference = {
876
+ name: "",
877
+ phone: "",
878
+ relationship: ""
879
+ };
880
+ const cClientConekta = {
881
+ conekta: cConektaRecurrent,
882
+ ravcredit: cClient
883
+ };
884
+ const cClientContract = {
885
+ client: cClient,
886
+ contract: cContract,
887
+ };
888
+ class FactoryClient {
889
+ static CreateClientToConektaObj(data) {
890
+ const o = {};
891
+ if (data.name && data.name.length > 0)
892
+ o.name = data.name;
893
+ if (data.username && data.name.length > 0)
894
+ o.username = data.username;
895
+ if (data.email && data.email.length > 0)
896
+ o.email = data.email;
897
+ if (data.phone && data.phone.length > 0)
898
+ o.phone = String(data.phone);
899
+ if (data.curp && data.curp.length > 0)
900
+ o.curp = data.curp;
901
+ if (data.userReferences && data.userReferences.length > 0)
902
+ o.userReferences = data.userReferences;
903
+ if (data.contract)
904
+ o.contract = data.contract;
905
+ if (data.createdAt)
906
+ o.createdAt = data.createdAt;
907
+ if (data.lastLogin)
908
+ o.lastLogin = data.lastLogin;
909
+ if (data.conekta_id)
910
+ o.conekta_id = data.conekta_id;
911
+ return o;
912
+ }
913
+ static CreateClientFromFormObj(data, client) {
914
+ const o = {
915
+ id: "",
916
+ name: data["client"][0].name,
917
+ username: data["auth"][0].username,
918
+ password: data["auth"][0].password,
919
+ email: data["client"][0].email,
920
+ phone: String(data["client"][0].phone),
921
+ curp: data["client"][0].curp,
922
+ userReferences: data["client"][0].userReferences,
923
+ status: eClientStatus.ACTIVE
924
+ };
925
+ if (client != undefined) {
926
+ if (client.dynamic_id)
927
+ o.dynamic_id = client.dynamic_id;
928
+ if (client.dynamic_account)
929
+ o.dynamic_account = client.dynamic_account;
930
+ if (client.conekta_id)
931
+ o.conekta_id = client.conekta_id;
932
+ }
933
+ return o;
934
+ }
935
+ static CreateClientConektaObj(data, finalDate) {
936
+ const sources = {
937
+ type: "oxxo_recurrent",
938
+ expires_at: finalDate
939
+ };
940
+ return {
941
+ name: data.name,
942
+ email: data.email,
943
+ phone: data.phone,
944
+ contract: data.contract_temporary,
945
+ client_id: data.id,
946
+ payment_sources: [sources]
947
+ };
948
+ }
949
+ static MapperConektaClient(client, conekta) {
950
+ const o = client;
951
+ o.name = conekta.name;
952
+ o.email = conekta.email;
953
+ o.phone = conekta.phone;
954
+ o.conekta_id = conekta.id;
955
+ return {
956
+ client: o,
957
+ contract: cContract
958
+ };
959
+ }
960
+ static MapperTypeContCli_Client(_client) {
961
+ const client = {
962
+ id: _client.id,
963
+ name: _client.name,
964
+ username: _client.username,
965
+ email: _client.email,
966
+ phone: _client.phone,
967
+ curp: _client.curp,
968
+ userReferences: _client.userReferences,
969
+ status: _client.status,
970
+ contract: _client.contract,
971
+ reference: _client.reference,
972
+ references: _client.references,
973
+ conekta_id: _client.conekta_id,
974
+ dynamic_account: _client.dynamic_account,
975
+ token: _client.token,
976
+ contract_temporary: _client.contract_temporary,
977
+ lastLogin: _client.lastLogin,
978
+ dynamic_id: _client.dynamic_id,
979
+ createdAt: _client.createdAt,
980
+ payments: _client.payments,
981
+ password: _client.password,
982
+ contractUrl: _client.contractUrl,
983
+ dynamic_ref: _client.dynamic_ref,
984
+ exists: _client.exists,
985
+ passport_id: _client.passport_id,
986
+ };
987
+ return client;
988
+ }
989
+ static MapperDynamicClient(dynamic, client, contract, clientDyn, account) {
990
+ // constant o: tyClientContract = cTyClientContract
991
+ /* Client ------------------------------------------------------ */
992
+ client.username = `${dynamic.pii.name} ${dynamic.pii.motherlastname} ${dynamic.pii.lastname}`;
993
+ client.phone = dynamic.pii.phone;
994
+ client.dynamic_id = dynamic.id;
995
+ client.curp = dynamic.pii.curp;
996
+ client.email = dynamic.pii.email;
997
+ if (account)
998
+ client.dynamic_account = account.id;
999
+ /* Auth ---------------------------------------------------------- */
1000
+ /* Device -------------------------------------------------------- */
1001
+ contract.device.IMEI = clientDyn.pii.imei;
1002
+ contract.device.device = clientDyn.pii.model;
1003
+ /* Contract ------------------------------------------------------ */
1004
+ contract.by = clientDyn.pii.seller_name;
1005
+ if (clientDyn.pii.fotografia_del_cliente_con_el_equipo != undefined) {
1006
+ const oPhoto = clientDyn.pii.fotografia_del_cliente_con_el_equipo;
1007
+ if (oPhoto != "") {
1008
+ const _photo = JSON.parse(oPhoto);
1009
+ if (_photo)
1010
+ contract.photo = _photo[0].url;
1011
+ }
1012
+ }
1013
+ contract.address.state = dynamic.pii.state;
1014
+ contract.address.city = dynamic.pii.city;
1015
+ contract.address.street = dynamic.pii.street;
1016
+ contract.address.ext = dynamic.pii.num_ext;
1017
+ contract.address.zip = dynamic.pii.zipcode;
1018
+ contract.address.neighbor = dynamic.pii.colony;
1019
+ /* Financial ------------------------------------------------------ */
1020
+ contract.dynamicAccount = Number(account?.id);
1021
+ if (account?.config.installments) {
1022
+ contract.financial.deadlines = {
1023
+ weeks: account.config.installments,
1024
+ interest: 0
1025
+ };
1026
+ }
1027
+ if (account?.properties.expected_disbursed)
1028
+ contract.financial.total = account?.properties.expected_disbursed;
1029
+ if (account?.properties.principal_disbursed)
1030
+ contract.financial.financed = account?.properties.principal_disbursed;
1031
+ if (account?.properties.amount_commission_opening) {
1032
+ contract.financial.initial = account?.properties.amount_commission_opening;
1033
+ contract.financial.amount_commission_opening = account?.properties.amount_commission_opening;
1034
+ }
1035
+ contract.financial.interest_rate = Number(clientDyn.pii.interest_rate);
1036
+ contract.financial.interest_arrears = account?.config.interest_arrears;
1037
+ contract.financial.commission_opening = account?.config.commission_opening;
1038
+ contract.financial.credit_type = account?.config.credit_type;
1039
+ contract.financial.principal_disbursed = account?.properties.principal_disbursed;
1040
+ contract.financial.expected_disbursed = account?.properties.expected_disbursed;
1041
+ contract.financial.weeklyPayment = Number(clientDyn.pii.amount_by_period);
1042
+ return {
1043
+ client: client,
1044
+ contract: contract,
1045
+ };
1046
+ }
1047
+ static MapperFinancialContract(contract, account) {
1048
+ contract.dynamicAccount = Number(account.id);
1049
+ if (account.config.installments) {
1050
+ contract.financial.deadlines = {
1051
+ weeks: account.config.installments,
1052
+ interest: 0
1053
+ };
1054
+ }
1055
+ const total = account.config.financed_amount != undefined ? account.config.financed_amount : 0;
1056
+ if (total > 0)
1057
+ contract.financial.total = total;
1058
+ // if (account.properties.expected_disbursed)
1059
+ const expected_disbursed = account.properties.expected_disbursed != undefined ? account.properties.expected_disbursed : 0;
1060
+ if (expected_disbursed > 0)
1061
+ contract.financial.total = expected_disbursed;
1062
+ contract.financial.expected_disbursed = expected_disbursed;
1063
+ contract.financial.interest_rate = account.config.interest_rate;
1064
+ contract.financial.interest_arrears = account.config.interest_arrears;
1065
+ // if (account.properties.principal_disbursed)
1066
+ if (account.properties.principal_disbursed > 0)
1067
+ contract.financial.financed = account.properties.principal_disbursed;
1068
+ contract.financial.principal_disbursed = account.properties.principal_disbursed;
1069
+ const amount_commission_opening = account.properties.amount_commission_opening != undefined ? account.properties.amount_commission_opening : 0;
1070
+ if (amount_commission_opening > 0)
1071
+ contract.financial.initial = amount_commission_opening;
1072
+ contract.financial.amount_commission_opening = amount_commission_opening;
1073
+ contract.financial.interest_arrears = account.config.interest_arrears;
1074
+ contract.financial.commission_opening = account.config.commission_opening;
1075
+ contract.financial.credit_type = account.config.credit_type;
1076
+ contract.financial.clabe = String(account.properties.clabe);
1077
+ return contract.financial;
1078
+ }
1079
+ static CheckEmail = (email) => email.includes("@") && email.endsWith(".com");
1080
+ }
1081
+ var eIdentityTypes;
1082
+ (function (eIdentityTypes) {
1083
+ eIdentityTypes["SELFIE"] = "SELFIE";
1084
+ eIdentityTypes["IDENTITY_FRONT"] = "IDENTITY_FRONT";
1085
+ eIdentityTypes["IDENTITY_BACK"] = "IDENTITY_BACK";
1086
+ eIdentityTypes["PASSPORT_FRONT"] = "PASSPORT_FRONT";
1087
+ eIdentityTypes["PASSPORT_BACK"] = "PASSPORT_BACK";
1088
+ eIdentityTypes["SERVICE"] = "SERVICE";
1089
+ eIdentityTypes["WITH_DEVICE"] = "WITH_DEVICE";
1090
+ })(eIdentityTypes || (eIdentityTypes = {}));
1091
+
1092
+ class UtilsHttp {
1093
+ static CreateHeadersRavcreditApi(token) {
1094
+ return {
1095
+ 'Content-Type': 'application/json',
1096
+ 'Accept': 'application/json',
1097
+ 'Access-Control-Allow-Headers': 'Content-Type',
1098
+ 'Authorization': `Bearer ${token}`
1099
+ };
1100
+ }
1101
+ static CreateSimpleHeadersApi() {
1102
+ return {
1103
+ 'Content-Type': 'application/json',
1104
+ 'Accept': 'application/json',
1105
+ 'Access-Control-Allow-Headers': 'Content-Type',
1106
+ };
1107
+ }
1108
+ static CreateAwsHeadersApi() {
1109
+ return {
1110
+ 'Content-Type': 'application/json'
1111
+ };
1112
+ }
1113
+ }
1114
+
1115
+ var eReferenceStatusRav;
1116
+ (function (eReferenceStatusRav) {
1117
+ eReferenceStatusRav["Disponible"] = "Disponible";
1118
+ eReferenceStatusRav["Active"] = "Activo con credito vigente";
1119
+ eReferenceStatusRav["ActiveEnded"] = "Activo sin credito vigente";
1120
+ eReferenceStatusRav["Registered"] = "Registrado";
1121
+ eReferenceStatusRav["NonRegistered"] = "No registrado";
1122
+ eReferenceStatusRav["NonVerified"] = "No verificado";
1123
+ eReferenceStatusRav["Rejected"] = "Rechazado";
1124
+ eReferenceStatusRav["Pending"] = "Pendiente";
1125
+ })(eReferenceStatusRav || (eReferenceStatusRav = {}));
1126
+ var eAccountDynamicStatus;
1127
+ (function (eAccountDynamicStatus) {
1128
+ eAccountDynamicStatus["OK"] = "Con cuenta activa";
1129
+ eAccountDynamicStatus["NOK"] = "Sin cuenta activa";
1130
+ })(eAccountDynamicStatus || (eAccountDynamicStatus = {}));
1131
+ //
1132
+ // export enum eAccountDynamicRegister {
1133
+ // "Active" = "Activo", // Ok
1134
+ // "NonAuthorized" = "No autorizado",
1135
+ // "Authorized" = "Autorizado", // Non ref
1136
+ // "Accepted" = "Aceptado", // Non ref
1137
+ // "Rejected" = "Rechazado", // Non ref
1138
+ // "Pending" = "Pendiente", // Non ref
1139
+ // "NotFound" = "No registrado"
1140
+ // }
1141
+ var eClientDynamicStatus;
1142
+ (function (eClientDynamicStatus) {
1143
+ eClientDynamicStatus["Active"] = "Active";
1144
+ eClientDynamicStatus["Pending"] = "Pending";
1145
+ eClientDynamicStatus["Accepted"] = "Accepted";
1146
+ eClientDynamicStatus["Rejected"] = "Rejected";
1147
+ eClientDynamicStatus["approved"] = "Aprobado";
1148
+ })(eClientDynamicStatus || (eClientDynamicStatus = {}));
1149
+ const cClientDynamicStatus = {
1150
+ Active: {
1151
+ value: "Active",
1152
+ viewValue: "Activo"
1153
+ },
1154
+ Pending: {
1155
+ value: "Pending",
1156
+ viewValue: "Pendiente"
1157
+ },
1158
+ Accepted: {
1159
+ value: "Accepted",
1160
+ viewValue: "Pre autorizado"
1161
+ },
1162
+ Rejected: {
1163
+ value: "Rejected",
1164
+ viewValue: "Rechazado"
1165
+ },
1166
+ Idle: {
1167
+ value: "Idle",
1168
+ viewValue: ""
1169
+ },
1170
+ };
1171
+ var eContractSteps;
1172
+ (function (eContractSteps) {
1173
+ eContractSteps["idle"] = "idle";
1174
+ eContractSteps["general"] = "General";
1175
+ eContractSteps["address"] = "Address";
1176
+ eContractSteps["device"] = "Device";
1177
+ eContractSteps["financial"] = "Financial";
1178
+ eContractSteps["app"] = "App";
1179
+ })(eContractSteps || (eContractSteps = {}));
1180
+ const cIDCDataPii = {
1181
+ icc: "",
1182
+ rfc: "",
1183
+ sex: "",
1184
+ city: "",
1185
+ curp: "",
1186
+ days: "",
1187
+ imei: "",
1188
+ name: "",
1189
+ step: "",
1190
+ term: "",
1191
+ brand: "",
1192
+ email: "",
1193
+ model: "",
1194
+ phone: "",
1195
+ score: "",
1196
+ state: "",
1197
+ amount: "",
1198
+ colony: "",
1199
+ period: "",
1200
+ street: "",
1201
+ ticket: "",
1202
+ num_ext: "",
1203
+ num_int: "",
1204
+ zipcode: "",
1205
+ evidence: "",
1206
+ financed: "",
1207
+ house_is: "",
1208
+ lastname: "",
1209
+ type_job: "",
1210
+ birthdate: "",
1211
+ birthstate: "",
1212
+ dicio_data: "",
1213
+ dicio_step: "",
1214
+ secondname: "",
1215
+ nationality: "",
1216
+ seller_name: "",
1217
+ down_payment: "",
1218
+ municipality: "",
1219
+ score_no_hit: "",
1220
+ study_degree: "",
1221
+ branch_office: "",
1222
+ identity_data: "",
1223
+ interest_rate: "",
1224
+ score_interno: "",
1225
+ marital_status: "",
1226
+ monthly_income: "",
1227
+ motherlastname: "",
1228
+ score_rcc_fico: "",
1229
+ identity_selfie: "",
1230
+ amount_by_period: "",
1231
+ identity_id_back: "",
1232
+ proof_of_address: "",
1233
+ identity_id_front: "",
1234
+ economic_dependents: "",
1235
+ identity_id_request: "",
1236
+ identity_verification: "",
1237
+ is_address_ine_currently_live: "",
1238
+ fotografia_del_cliente_con_el_equipo: "",
1239
+ estado: "",
1240
+ gender: ""
1241
+ };
1242
+ /**
1243
+ * Base customer for create customer with DynamiCore provider
1244
+ * */
1245
+ const cIDCCustomer = {
1246
+ pii: cIDCDataPii,
1247
+ client_type: 662
1248
+ };
1249
+ const cIDCPayment = {
1250
+ operation: 98,
1251
+ account: "",
1252
+ date: "",
1253
+ amount: 0,
1254
+ dst_account: "",
1255
+ reference: ""
1256
+ };
1257
+ const cIDCCharge = {
1258
+ barcode_url: "",
1259
+ currency: "",
1260
+ expires_at: 0,
1261
+ object: "",
1262
+ quantity: 0,
1263
+ reference: "",
1264
+ service_name: "",
1265
+ store_name: "",
1266
+ type: "",
1267
+ unit_price: 0
1268
+ };
1269
+ const cIDCGeneratedReference = {
1270
+ account: 0,
1271
+ active: 0,
1272
+ amount: 0,
1273
+ channel: "",
1274
+ charge: cIDCCharge,
1275
+ company: 0,
1276
+ id: "",
1277
+ operation: 0
1278
+ };
1279
+ /**
1280
+ * Common Factory Dynamic
1281
+ * */
1282
+ class FactoryDynamiCore {
1283
+ static CreateReferenceBody(client, contract, dateTime) {
1284
+ const customerInfo = {
1285
+ name: client.name,
1286
+ email: client.email,
1287
+ phone: client.phone,
1288
+ };
1289
+ const customerItems = {
1290
+ name: "Referencia Oxxo",
1291
+ unit_price: contract.financial.weeklyPayment,
1292
+ quantity: 1
1293
+ };
1294
+ const paymentMethod = {
1295
+ type: "oxxo_cash"
1296
+ };
1297
+ if (!client.dynamic_account)
1298
+ return null;
1299
+ const body = {
1300
+ id: client.id,
1301
+ data: {
1302
+ account: Number(client.dynamic_account),
1303
+ operation: 98,
1304
+ customer_info: customerInfo,
1305
+ items: customerItems,
1306
+ payment_method: paymentMethod
1307
+ }
1308
+ };
1309
+ if (dateTime != undefined)
1310
+ body.date = dateTime;
1311
+ return body;
1312
+ }
1313
+ static CreateEmptyCustomer() {
1314
+ return cIDCCustomer;
1315
+ }
1316
+ static CreateCustomerFromOClient(client, contract) {
1317
+ const o = cIDCCustomer;
1318
+ o.pii.email = client.email;
1319
+ o.pii.name = client.name;
1320
+ o.pii.curp = client.curp;
1321
+ o.pii.phone = client.phone;
1322
+ o.pii.amount = String(contract.financial.total);
1323
+ o.pii.financed = String(contract.financial.financed);
1324
+ o.pii.amount_by_period = String(contract.financial.weeklyPayment);
1325
+ o.pii.zipcode = contract.address.zip;
1326
+ o.pii.street = contract.address.street;
1327
+ o.pii.city = contract.address.city;
1328
+ o.pii.state = contract.address.state;
1329
+ o.pii.colony = contract.address.neighbor;
1330
+ o.pii.num_ext = contract.address.ext;
1331
+ return o;
1332
+ }
1333
+ static CreateDynamicCredit(client, contract, clientDynamic) {
1334
+ const properties = {
1335
+ start_date: "",
1336
+ principal_disbursed: 0,
1337
+ expected_disbursed: 0,
1338
+ amount_commission_opening: 0
1339
+ };
1340
+ const config = {
1341
+ contract: `FP-${client.name}`,
1342
+ credit_type: "Arrendamiento",
1343
+ interest_rate: 528,
1344
+ installments: 0,
1345
+ periodicity: "WEEK",
1346
+ interest_base: "ACT/ACT",
1347
+ commission_opening: 40,
1348
+ financed_amount: contract.financial.financed,
1349
+ interest_arrears: 0
1350
+ };
1351
+ if (!client.dynamic_account)
1352
+ return null;
1353
+ return {
1354
+ id: Number(client.dynamic_account),
1355
+ group: clientDynamic.group,
1356
+ company: clientDynamic.company,
1357
+ client: clientDynamic.id,
1358
+ created_at: "",
1359
+ currency: "484",
1360
+ status: "pending",
1361
+ properties: properties,
1362
+ product: 1756,
1363
+ enabled: "1",
1364
+ config: config,
1365
+ amount: 0,
1366
+ type: "liabilities",
1367
+ identifier: null,
1368
+ start_at: null
1369
+ };
1370
+ }
1371
+ static CreatePayment(contract, clientDynamic) {
1372
+ return {
1373
+ account: String(clientDynamic.id),
1374
+ amount: contract.financial.weeklyPayment,
1375
+ date: "",
1376
+ dst_account: String(clientDynamic.id),
1377
+ external_id: "",
1378
+ extras: {},
1379
+ operation: 98,
1380
+ reference: ""
1381
+ };
1382
+ }
1383
+ static getNextDateTime() {
1384
+ const now = new Date();
1385
+ const nextDateTime = new Date(now.getTime() + 1000); // Add 1 second as an example
1386
+ const year = nextDateTime.getFullYear();
1387
+ const month = String(nextDateTime.getMonth() + 1).padStart(2, '0');
1388
+ const day = String(nextDateTime.getDate()).padStart(2, '0');
1389
+ const hours = String(nextDateTime.getHours()).padStart(2, '0');
1390
+ const minutes = String(nextDateTime.getMinutes()).padStart(2, '0');
1391
+ const seconds = String(nextDateTime.getSeconds()).padStart(2, '0');
1392
+ return `${year}-${month}-${day}T${hours}:${minutes}:${seconds}`;
1393
+ }
1394
+ static getIsoDate() {
1395
+ const now = new Date();
1396
+ return now.toISOString();
1397
+ }
1398
+ static FormPayment(contract, account) {
1399
+ let data = FactoryDynamiCore.CreatePayment(contract, account);
1400
+ return {
1401
+ amount: new UntypedFormControl(data.amount, [Validators.required, Validators.min(0)]),
1402
+ };
1403
+ }
1404
+ }
1405
+
1406
+ var ePaymentType;
1407
+ (function (ePaymentType) {
1408
+ ePaymentType["OXXO"] = "OXXO";
1409
+ ePaymentType["ALTERNA"] = "ALTERNA";
1410
+ ePaymentType["OXXO_RECURRENT"] = "oxxo_recurrent";
1411
+ })(ePaymentType || (ePaymentType = {}));
1412
+ class FactoryConekta {
1413
+ static createOrder(client, contract, dateTime) {
1414
+ if (client.conekta_id == undefined)
1415
+ return {
1416
+ data: {
1417
+ charges: [],
1418
+ currency: "",
1419
+ customer_info: { customer_id: "" },
1420
+ line_items: []
1421
+ },
1422
+ id: ""
1423
+ };
1424
+ const customer_info = {
1425
+ customer_id: client.conekta_id
1426
+ };
1427
+ const week = ((3600 * 24) * 30) * 1000;
1428
+ let next = new Date().getTime() + week;
1429
+ next = Math.floor(next / 1000);
1430
+ const method = {
1431
+ type: "cash",
1432
+ expires_at: next,
1433
+ };
1434
+ const charge = {
1435
+ amount: contract.financial.weeklyPayment * 100,
1436
+ payment_method: method
1437
+ };
1438
+ const charges = [charge];
1439
+ const antifraud_info = {
1440
+ newKey: "Key"
1441
+ };
1442
+ const lineItem = {
1443
+ antifraud_info: antifraud_info,
1444
+ name: `Referencia credito ${client.name}`,
1445
+ quantity: 1,
1446
+ unit_price: contract.financial.weeklyPayment * 100,
1447
+ };
1448
+ const lineItems = [lineItem];
1449
+ const orderData = {
1450
+ customer_info: customer_info,
1451
+ charges: charges,
1452
+ currency: "MXN",
1453
+ line_items: lineItems
1454
+ };
1455
+ const order = {
1456
+ data: orderData,
1457
+ id: client.id
1458
+ };
1459
+ if (dateTime != undefined)
1460
+ order.date = dateTime;
1461
+ return order;
1462
+ }
1463
+ }
1464
+ // '
1465
+ // {
1466
+ // "customer_info": {
1467
+ // "name": "DevTest",
1468
+ // "email": "test@femsa.com",
1469
+ // "phone": "5522997233"
1470
+ // },
1471
+ // "currency": "MXN",
1472
+ // "line_items": [
1473
+ // {
1474
+ // "name": "Box of Cohiba S1s",
1475
+ // "quantity": 1,
1476
+ // "unit_price": 20000
1477
+ // }
1478
+ // ]
1479
+ // }
1480
+ // '
1481
+
1482
+ const ROUTE_NOTIFICATIONS = "notifications";
1483
+ const ROUTE_GLOBAL_REFERENCE2 = "/contract-reference";
1484
+ const prodFunction = "https://us-central1-ravcredit-2b079.cloudfunctions.net/CustomerNotification";
1485
+ const prodFunction2 = "https://customernotification-2imgfxveka-uc.a.run.app";
1486
+ const localTest = "http://127.0.0.1:5001/ravcredit-2b079/us-central1/CustomerNotification";
1487
+ const ravCreditFunctions = prodFunction;
1488
+ class FactoryNotification {
1489
+ static FormNotification(notification) {
1490
+ let data = cNotification;
1491
+ if (notification)
1492
+ data = notification;
1493
+ return {
1494
+ title: new UntypedFormControl(data.notification.title, [Validators.required, Validators.min(1)]),
1495
+ body: new UntypedFormControl(data.notification.body, [Validators.required, Validators.min(1)]),
1496
+ };
1497
+ }
1498
+ static CreateGlobalNotificationObj(data) {
1499
+ const o = {};
1500
+ if (data.notification) {
1501
+ const not = {};
1502
+ if (data.notification.body)
1503
+ not["body"] = data.notification.body;
1504
+ if (data.notification.title)
1505
+ not["title"] = data.notification.title;
1506
+ if (data.ids)
1507
+ not["ids"] = data.ids;
1508
+ if (data.tokens)
1509
+ not["tokens"] = data.tokens;
1510
+ if (data.type)
1511
+ not["type"] = data.type;
1512
+ if (data.data)
1513
+ if (data.data.route)
1514
+ not["route"] = data.data.route;
1515
+ o["data"] = not;
1516
+ }
1517
+ return o;
1518
+ }
1519
+ }
1520
+
1521
+ const keyUserID = "rc_uid";
1522
+ const dbVersion = 1;
1523
+ const dbName = "RavCreditDB";
1524
+ const keyPathId = "id";
1525
+ const dbAuthStore = "authStore";
1526
+ const dbUsersStore = "usersStore";
1527
+ const dbContractsStore = "contractsStore";
1528
+ const dbClientsStore = "clientsStore";
1529
+ const dbBusinessInfo = "businessInfo";
1530
+ const dbBusinessConfig = "businessConfig";
1531
+ const dbConektaClientsStore = "conektaClientsStore";
1532
+ const dbConektaReferencesStore = "conektaReferencesStore";
1533
+ const dbPassportReferencesStore = "passportReferencesStore";
1534
+ const dbDynamicReferencesStore = "dynamicReferencesStore";
1535
+ const dbDynamicAccountStore = "dynamicAccountStore";
1536
+ const dbNotificationsStore = "notificationsStore";
1537
+ const dbPaymentsStore = "paymentsStore";
1538
+ const dbIndexAuth = "iAuth";
1539
+ const dbIndexUsers = "iUsers";
1540
+ const dbIndexContracts = "iContracts";
1541
+ const dbIndexClients = "iClients";
1542
+ const dbIndexBusiness = "iBusiness";
1543
+ const dbIndexConektaClients = "iConecktaClients";
1544
+ const dbIndexConektaClientsRef = "iConecktaClientsRef";
1545
+ const dbIndexPassportClientsRef = "iPassportClientsRef";
1546
+ const dbIndexNotification = "iNotification";
1547
+ const dbIndexPayments = "iNotification";
1548
+ const dateFormat = "EEEE, dd MMM yyyy";
1549
+ const dateFormatSimple = "EEEEEE, dd MMM yyyy";
1550
+ const dateCompleteFormat = "EEEE, dd MMM yyyy hh:mm aaaa";
1551
+ const timeFormat = "hh:mm aaaa";
1552
+ const expiredPayment = "expiredPayment";
1553
+ const ROLES_KEY = 'roles';
1554
+
1555
+ class IndexedDbService {
1556
+ indexDbStatus = false;
1557
+ iDb;
1558
+ constructor() {
1559
+ }
1560
+ // async dbAuthorization() {
1561
+ // // constant k = this.getLocalUser()
1562
+ // // if (k == null) return false
1563
+ // //
1564
+ // // constant db = await openDB(dbName, dbVersion)
1565
+ // // // utils store = db.transaction(dbUsersStore).objectStore(dbUsersStore)
1566
+ // // constant auth = await db.get(dbAuthStore, k)
1567
+ // // // utils auth = await store.get(k)
1568
+ // // db.close()
1569
+ //
1570
+ // let auth: any = null
1571
+ // return auth;
1572
+ //
1573
+ // }
1574
+ /****************** SIMPLE Transactional - CRUD *************************************/
1575
+ async dbGetObject(store, data) {
1576
+ if (!data)
1577
+ return data;
1578
+ const db = await openDB(dbName, dbVersion);
1579
+ return await db.get(store, data);
1580
+ }
1581
+ async dbGetAllByStore(store, index) {
1582
+ const db = await openDB(dbName, dbVersion);
1583
+ return await db.getAll(store);
1584
+ }
1585
+ async dbAddObject(store, data) {
1586
+ try {
1587
+ const db = await openDB(dbName, dbVersion);
1588
+ await db.put(store, data);
1589
+ return true;
1590
+ }
1591
+ catch (e) {
1592
+ return false;
1593
+ }
1594
+ }
1595
+ async dbRemoveObject(store, data) {
1596
+ const db = await openDB(dbName, dbVersion);
1597
+ return await db.delete(store, data);
1598
+ }
1599
+ /************************************* AUTH **************************************/
1600
+ async dbSignIn(store, data) {
1601
+ await this.iDb.put(store, data);
1602
+ const _data = data;
1603
+ this.setLocalStorage(keyUserID, _data.id);
1604
+ }
1605
+ async dbSignOut() {
1606
+ const k = this.getLocalUser();
1607
+ if (!k)
1608
+ return;
1609
+ await this.iDb.delete(dbAuthStore, k);
1610
+ this.removeLocalStorage(keyUserID);
1611
+ }
1612
+ async dbAuthorization() {
1613
+ const k = this.getLocalUser();
1614
+ if (k == null)
1615
+ return false;
1616
+ const db = await openDB(dbName, dbVersion);
1617
+ // utils store = db.transaction(dbUsersStore).objectStore(dbUsersStore)
1618
+ const auth = await db.get(dbAuthStore, k);
1619
+ // utils auth = await store.get(k)
1620
+ db.close();
1621
+ if (!auth)
1622
+ return false;
1623
+ else
1624
+ return true;
1625
+ }
1626
+ async dbGetToken() {
1627
+ const k = this.getLocalUser();
1628
+ if (k == null)
1629
+ return "";
1630
+ const db = await openDB(dbName, dbVersion);
1631
+ // utils store = db.transaction(dbUsersStore).objectStore(dbUsersStore)
1632
+ const auth = await db.get(dbAuthStore, k);
1633
+ // utils auth = await store.get(k)
1634
+ db.close();
1635
+ return auth.access_token != "" ? auth.access_token : "";
1636
+ }
1637
+ /******************************** Local Storage *************************************/
1638
+ setLocalStorage(k, v) {
1639
+ localStorage.setItem(k, v);
1640
+ }
1641
+ getLocalStorage(k) {
1642
+ return localStorage.getItem(k);
1643
+ }
1644
+ removeLocalStorage(k) {
1645
+ return localStorage.removeItem(k);
1646
+ }
1647
+ getLocalUser() {
1648
+ const k = localStorage.getItem(keyUserID);
1649
+ return (k);
1650
+ }
1651
+ /********************************************************************************* **/
1652
+ async getPlatformUser() {
1653
+ const k = this.getLocalStorage(keyUserID);
1654
+ if (k == null)
1655
+ return "";
1656
+ const db = await openDB(dbName, dbVersion);
1657
+ // utils store = db.transaction(dbUsersStore).objectStore(dbUsersStore)
1658
+ const auth = await db.get(dbAuthStore, k);
1659
+ // utils auth = await store.get(k)
1660
+ db.close();
1661
+ return auth.name != "" ? auth.name : "";
1662
+ }
1663
+ async getToken() {
1664
+ const k = this.getLocalUser();
1665
+ if (k == null)
1666
+ return "";
1667
+ const db = await openDB(dbName, dbVersion);
1668
+ // utils store = db.transaction(dbUsersStore).objectStore(dbUsersStore)
1669
+ const auth = await db.get(dbAuthStore, k);
1670
+ // utils auth = await store.get(k)
1671
+ db.close();
1672
+ return auth.access_token != "" ? auth.access_token : "";
1673
+ }
1674
+ async addObject(store, data) {
1675
+ try {
1676
+ const db = await openDB(dbName, dbVersion);
1677
+ await db.put(store, data);
1678
+ return true;
1679
+ }
1680
+ catch (e) {
1681
+ return false;
1682
+ }
1683
+ }
1684
+ async patchObject(store, data) {
1685
+ try {
1686
+ const db = await openDB(dbName, dbVersion);
1687
+ const txn = db.transaction(store, "readwrite");
1688
+ const obj = txn.objectStore(store);
1689
+ // constant index = obj.index(keyPathCurp)
1690
+ await obj.put(data);
1691
+ return data;
1692
+ }
1693
+ catch (e) {
1694
+ console.error(e);
1695
+ return {};
1696
+ }
1697
+ }
1698
+ async updateObjectByID(store, id, data) {
1699
+ try {
1700
+ const db = await openDB(dbName, dbVersion);
1701
+ const res = await db.get(store, id);
1702
+ if (res != undefined)
1703
+ await this.removeObject(dbClientsStore, id);
1704
+ return await this.addObject(store, data);
1705
+ }
1706
+ catch (e) {
1707
+ console.error("updateObjectByID Catch Error:", e);
1708
+ return false;
1709
+ }
1710
+ }
1711
+ async upsertObjectById(store, id, data) {
1712
+ const db = await openDB(dbName, dbVersion);
1713
+ const res = await db.get(store, id);
1714
+ if (res)
1715
+ await this.removeObject(store, id);
1716
+ return await db.add(store, data);
1717
+ }
1718
+ async removeObject(store, data) {
1719
+ const db = await openDB(dbName, dbVersion);
1720
+ return await db.delete(store, data);
1721
+ }
1722
+ async deleteObjectByID(store, id) {
1723
+ try {
1724
+ const db = await openDB(dbName, dbVersion);
1725
+ const txn = db.transaction(store, "readwrite");
1726
+ const obj = txn.objectStore(store);
1727
+ const index = obj.index(keyPathId);
1728
+ const va2 = index.openCursor(id);
1729
+ va2.then(async (cursor) => {
1730
+ while (cursor) {
1731
+ cursor.delete();
1732
+ cursor = await cursor.continue();
1733
+ }
1734
+ });
1735
+ return va2;
1736
+ }
1737
+ catch (e) {
1738
+ console.error(e);
1739
+ return {};
1740
+ }
1741
+ }
1742
+ async cleanAll(store) {
1743
+ const db = await openDB(dbName, dbVersion);
1744
+ return await db.clear(store);
1745
+ }
1746
+ async getObject(store, data) {
1747
+ if (!data)
1748
+ return data;
1749
+ const db = await openDB(dbName, dbVersion);
1750
+ return await db.get(store, data);
1751
+ }
1752
+ async addBuildByStore(store, data) {
1753
+ for (const o of data) {
1754
+ const exists = await this.getObject(store, o["id"]);
1755
+ if (!exists)
1756
+ await this.addObject(store, o);
1757
+ else
1758
+ await this.updateObject(store, o);
1759
+ }
1760
+ }
1761
+ async updateObject(store, data) {
1762
+ const db = await openDB(dbName, dbVersion);
1763
+ await db.put(store, data);
1764
+ }
1765
+ async getAllByStore(store, index) {
1766
+ const db = await openDB(dbName, dbVersion);
1767
+ return await db.getAll(store);
1768
+ }
1769
+ async getAuthUser() {
1770
+ const data = await this.getAllByStore(dbAuthStore);
1771
+ return data[0];
1772
+ }
1773
+ async getAuthName() {
1774
+ const data = await this.getAuthUser();
1775
+ return data.name;
1776
+ }
1777
+ async getAuthUsername() {
1778
+ const data = await this.getAuthUser();
1779
+ return data.username;
1780
+ }
1781
+ async saveDataLocally(contract, client, providerData) {
1782
+ try {
1783
+ await this.addObject(dbClientsStore, client);
1784
+ await this.addObject(dbContractsStore, contract);
1785
+ if (!providerData)
1786
+ return false;
1787
+ if (contract.financial.provider === eProvider.Conekta) {
1788
+ await this.addObject(dbConektaClientsStore, providerData);
1789
+ await this.addObject(dbConektaReferencesStore, providerData);
1790
+ }
1791
+ else if (contract.financial.provider === eProvider.Passport) {
1792
+ await this.addObject(dbPassportReferencesStore, providerData);
1793
+ }
1794
+ else if (contract.financial.provider === eProvider.DynamiCore) {
1795
+ await this.addObject(dbDynamicReferencesStore, providerData);
1796
+ }
1797
+ return true;
1798
+ }
1799
+ catch (e) {
1800
+ console.error(e);
1801
+ return false;
1802
+ }
1803
+ }
1804
+ /******************** MERGE **************************************/
1805
+ async getAllClientContracts() {
1806
+ const clientContract = [];
1807
+ const clients = await this.getAllByStore(dbClientsStore);
1808
+ if (clients.length == 0)
1809
+ return [];
1810
+ for (let client of clients) {
1811
+ const contract = await this.getObject(dbContractsStore, client.contract);
1812
+ const e = { ...client, ...contract };
1813
+ // preserve the id value over concat models
1814
+ e.id = client.id;
1815
+ e.status = client.status;
1816
+ clientContract.push(e);
1817
+ }
1818
+ return clientContract;
1819
+ }
1820
+ /******************** MERGE **************************************/
1821
+ async dbGetAllClientContracts() {
1822
+ const clientContract = [];
1823
+ const clients = await this.dbGetAllByStore(dbClientsStore);
1824
+ if (clients.length == 0)
1825
+ return [];
1826
+ for (let client of clients) {
1827
+ const contract = await this.dbGetObject(dbContractsStore, client.contract);
1828
+ const e = { ...client, ...contract };
1829
+ // preserve the id value over concat models
1830
+ e.id = client.id;
1831
+ e.status = client.status;
1832
+ clientContract.push(e);
1833
+ }
1834
+ return clientContract;
1835
+ }
1836
+ /****************** BUSINESS INFO *************************************/
1837
+ async getBusinessInfo() {
1838
+ const config = await this.dbGetAllByStore(dbBusinessInfo);
1839
+ if (!config)
1840
+ return null;
1841
+ return config[0];
1842
+ }
1843
+ /****************** BUSINESS CONFIG ************************************/
1844
+ async getBusinessConfig() {
1845
+ const config = await this.dbGetAllByStore(dbBusinessConfig);
1846
+ if (!config)
1847
+ return null;
1848
+ return config[0];
1849
+ }
1850
+ async updateBusinessConfig(config) {
1851
+ // config.version = "1.0"
1852
+ await this.dbRemoveObject(dbBusinessConfig, "1.0");
1853
+ await this.dbAddObject(dbBusinessConfig, config);
1854
+ }
1855
+ async updateBusinessInfo(config) {
1856
+ config.version = "v2024";
1857
+ await this.dbRemoveObject(dbBusinessInfo, "v2024");
1858
+ await this.dbAddObject(dbBusinessInfo, config);
1859
+ }
1860
+ /**************** NOTIFICATIONS *********************************/
1861
+ async getLocalNotifications() {
1862
+ const notifications = await this.dbGetAllByStore(dbNotificationsStore);
1863
+ if (!notifications)
1864
+ return null;
1865
+ return notifications;
1866
+ }
1867
+ async updateNotifications(notifications) {
1868
+ for (const o of notifications) {
1869
+ const exists = await this.dbGetObject(dbNotificationsStore, o.notification_id);
1870
+ if (!exists) {
1871
+ await this.dbAddObject(dbNotificationsStore, o);
1872
+ }
1873
+ }
1874
+ }
1875
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: IndexedDbService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1876
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: IndexedDbService, providedIn: 'root' });
1877
+ }
1878
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: IndexedDbService, decorators: [{
1879
+ type: Injectable,
1880
+ args: [{
1881
+ providedIn: 'root'
1882
+ }]
1883
+ }], ctorParameters: () => [] });
1884
+
1885
+ class UtilTime {
1886
+ localeFns = es;
1887
+ static IsExpired(time) {
1888
+ const dateInit = new Date(time);
1889
+ const dayInit = dateInit.getDate();
1890
+ const monthInit = dateInit.getMonth() + 1;
1891
+ const dateActual = new Date();
1892
+ const dayActual = dateActual.getDate();
1893
+ const monthActual = dateActual.getMonth() + 1;
1894
+ if (monthActual > monthInit)
1895
+ return true;
1896
+ return dayActual > dayInit;
1897
+ }
1898
+ static getDates(initial, weeks) {
1899
+ const dates = [];
1900
+ let prev = initial;
1901
+ for (let i = 0; i < weeks; i++) {
1902
+ const date = add(prev, { weeks: 1 });
1903
+ dates.push({
1904
+ week: i + 1,
1905
+ date: date.getTime()
1906
+ });
1907
+ prev = date.getTime();
1908
+ }
1909
+ return dates;
1910
+ }
1911
+ static getPreviousWeek() {
1912
+ const today = new Date().getTime();
1913
+ const week = ((3600 * 24) * 7) * 1000;
1914
+ return today - week;
1915
+ }
1916
+ static getDayNum(date) {
1917
+ return getDate(date);
1918
+ }
1919
+ static getDayName(date) {
1920
+ return format(date, "EEEE", { locale: es });
1921
+ }
1922
+ static getMonthName(date) {
1923
+ return format(date, "MMMM", { locale: es }).toUpperCase();
1924
+ }
1925
+ static getYear(date) {
1926
+ return format(date, "yyyy");
1927
+ }
1928
+ static GetNextPayment(time, provider) {
1929
+ let week = 0;
1930
+ if (provider == eProvider.Conekta) {
1931
+ week = (((3600 * 24) * 7));
1932
+ }
1933
+ else if (provider == eProvider.DynamiCore) {
1934
+ week = (((3600 * 24) * 7) * 1000);
1935
+ }
1936
+ return this.getLocalTimeFromLong(time + week, provider);
1937
+ }
1938
+ static getLocalTimeFromLong(time, provider) {
1939
+ if (time <= 0)
1940
+ return "";
1941
+ let factor = this.GetFactor(provider);
1942
+ let dateTime = time * factor;
1943
+ let parsedDate = format(new Date(dateTime), dateFormat, {
1944
+ locale: es
1945
+ });
1946
+ return parsedDate;
1947
+ }
1948
+ static DelayPaymentLast(lastPayment, provider, injector) {
1949
+ let factor = this.GetFactor(provider);
1950
+ let now = new Date().getTime();
1951
+ let last = 0;
1952
+ if (provider == eProvider.Conekta)
1953
+ last = ((((3600 * 24) * 7)) + lastPayment) * factor;
1954
+ else if (provider == eProvider.DynamiCore)
1955
+ last = ((((3600 * 24) * 7) * 1000) + lastPayment) * factor;
1956
+ runInInjectionContext(injector, () => {
1957
+ const idb = inject(IndexedDbService);
1958
+ // constant observable = inject(ObservablesService)
1959
+ idb.setLocalStorage(expiredPayment, String(now > last));
1960
+ // observable.isLate.next(now > last)
1961
+ });
1962
+ return now > last;
1963
+ }
1964
+ static GetFactor(provider) {
1965
+ let factor = 1;
1966
+ if (provider == eProvider.Conekta)
1967
+ factor = 1000;
1968
+ return factor;
1969
+ }
1970
+ static GetEpochFromFormatedDate(date) {
1971
+ if (date == "")
1972
+ return 0;
1973
+ const _date = new Date(date);
1974
+ if (isNaN(_date.getTime()))
1975
+ return 0;
1976
+ return _date.getTime();
1977
+ }
1978
+ static GetTimeFromString(date) {
1979
+ return format(new Date(date), timeFormat, {
1980
+ locale: es
1981
+ });
1982
+ }
1983
+ static GetDateFromString(date) {
1984
+ return format(new Date(date), dateCompleteFormat, {
1985
+ locale: es
1986
+ });
1987
+ }
1988
+ // Quick sort
1989
+ static SortingByTime(payments) {
1990
+ if (payments.length <= 1)
1991
+ return payments;
1992
+ const pivot = payments[payments.length - 1];
1993
+ const pivotDate = new Date(pivot.created).getTime();
1994
+ const left = [];
1995
+ const right = [];
1996
+ for (let i = 0; i < payments.length - 1; i++) {
1997
+ const actualDate = new Date(payments[i].created).getTime();
1998
+ if (actualDate > pivotDate)
1999
+ left.push(payments[i]);
2000
+ else
2001
+ right.push(payments[i]);
2002
+ }
2003
+ return [...this.SortingByTime(left), pivot, ...this.SortingByTime(right)];
2004
+ }
2005
+ static SortingByTimeConekta(payments) {
2006
+ if (payments.length <= 1)
2007
+ return payments;
2008
+ const pivot = payments[payments.length - 1];
2009
+ let pivotDate = 0;
2010
+ if (pivot.charges.data == undefined)
2011
+ return payments;
2012
+ if (pivot.charges.data[0].paid_at != undefined) {
2013
+ pivotDate = pivot.charges.data[0].paid_at;
2014
+ }
2015
+ else {
2016
+ pivot.charges.data[0].created_at;
2017
+ }
2018
+ if (pivotDate <= 0)
2019
+ return payments;
2020
+ const left = [];
2021
+ const right = [];
2022
+ for (let i = 0; i < payments.length - 1; i++) {
2023
+ const actual = payments[i].charges.data[0].paid_at;
2024
+ if (actual <= 0)
2025
+ continue;
2026
+ if (actual > pivotDate)
2027
+ left.push(payments[i]);
2028
+ else
2029
+ right.push(payments[i]);
2030
+ }
2031
+ return [...this.SortingByTimeConekta(left), pivot, ...this.SortingByTimeConekta(right)];
2032
+ }
2033
+ }
2034
+
2035
+ const cContractMetrics = {
2036
+ total: 0,
2037
+ activated: 0,
2038
+ paused: 0,
2039
+ completed: 0,
2040
+ canceled: 0,
2041
+ late: 0,
2042
+ conektaCount: 0,
2043
+ dynamicCount: 0,
2044
+ passportCount: 0,
2045
+ rateTotal: 0,
2046
+ rateActive: 0,
2047
+ ratePaused: 0,
2048
+ rateComplete: 0,
2049
+ rateCanceled: 0,
2050
+ rateLate: 0
2051
+ };
2052
+
2053
+ var ePassportTypes;
2054
+ (function (ePassportTypes) {
2055
+ ePassportTypes["CREATE"] = "create_references";
2056
+ ePassportTypes["SEND"] = "send_references";
2057
+ })(ePassportTypes || (ePassportTypes = {}));
2058
+
2059
+ class FactoryPassport {
2060
+ static CreatePassportReference(client, contract, dateTime) {
2061
+ const o = {
2062
+ passport: {
2063
+ type: ePassportTypes.CREATE,
2064
+ data: {
2065
+ name: client.name,
2066
+ email: client.email,
2067
+ amount: contract.financial.weeklyPayment,
2068
+ expirationDate: "",
2069
+ additional: {
2070
+ client: client.name,
2071
+ clientID: client.id,
2072
+ credit: client.status
2073
+ }
2074
+ }
2075
+ },
2076
+ contract: contract,
2077
+ date: dateTime
2078
+ };
2079
+ if (dateTime != undefined)
2080
+ o.date = dateTime;
2081
+ return o;
2082
+ }
2083
+ }
2084
+
2085
+ class FactoryPayment {
2086
+ static CreatePayment(data, provider) {
2087
+ const o = {};
2088
+ if (provider == eProvider.DynamiCore)
2089
+ o.dynamicPayment = data;
2090
+ if (provider == eProvider.Conekta)
2091
+ o.conektaPayment = data;
2092
+ return o;
2093
+ }
2094
+ }
2095
+
2096
+ const ErrorMessages = {
2097
+ NotFound: "Recurso no encontrado",
2098
+ Unauthorized: "Request without(or not valid) token",
2099
+ RandomError: "Something goes wrong, try again -> ",
2100
+ RandomErrorFirestore: "Something goes wrong in firestore",
2101
+ CreateUser: "Error: Something goes wrong",
2102
+ CreateFoundedUser: "Error: User already exists try with another username",
2103
+ FindAllNotFound: "Not users found",
2104
+ UserFindOne: "User with given ID not found",
2105
+ UserFindOneError: "Error getting user by ID",
2106
+ UserUpdate: "Error updating user by ID",
2107
+ DeleteUser: "Error deleting user",
2108
+ UsernameNotFound: "User with given username not found",
2109
+ IncorrectPassword: "Incorrect or not valid password",
2110
+ LastLogIn: "Last LogIn date not updated",
2111
+ authError: "Username or password incorrect",
2112
+ tokenRequired: "Token required",
2113
+ ClientDefined: "This user already registered: Update user's contracts instead",
2114
+ ClientsNotFound: "List of clients is empty",
2115
+ ClientNotFound: "Client with given ID, not found",
2116
+ ClientNotUpdated: "Client with given ID, not updated",
2117
+ DeleteClient: "Error deleting client",
2118
+ UsernameClientNotFound: "Client with given username not found",
2119
+ ContractsAllEmpty: "Contract list empty",
2120
+ ContractNotFound: "Contract not found",
2121
+ ContractUpdateError: "Something goes wrong updating contract, try again",
2122
+ ContractDeleteError: "Something goes wrong deleting contract, try again"
2123
+ };
2124
+
2125
+ var eAssetPeriod;
2126
+ (function (eAssetPeriod) {
2127
+ eAssetPeriod["MONTH"] = "MONTH";
2128
+ eAssetPeriod["WEEK"] = "WEEK";
2129
+ })(eAssetPeriod || (eAssetPeriod = {}));
2130
+
2131
+ var eLoginStatus;
2132
+ (function (eLoginStatus) {
2133
+ eLoginStatus["IDLE"] = "IDLE";
2134
+ eLoginStatus["ERROR"] = "ERROR";
2135
+ eLoginStatus["AUTHORIZED"] = "AUTHORIZED";
2136
+ eLoginStatus["CHECKING"] = "CHECKING";
2137
+ eLoginStatus["NOAUTHORIZED"] = "NOAUTHORIZED";
2138
+ eLoginStatus["NOTFOUND"] = "NOTFOUND";
2139
+ eLoginStatus["ERRORPASSWORD"] = "ERRORPASSWORD";
2140
+ })(eLoginStatus || (eLoginStatus = {}));
2141
+ var eAuthActions;
2142
+ (function (eAuthActions) {
2143
+ eAuthActions["delete"] = "delete";
2144
+ eAuthActions["auth"] = "auth";
2145
+ })(eAuthActions || (eAuthActions = {}));
2146
+ var eAuthType2;
2147
+ (function (eAuthType2) {
2148
+ eAuthType2["auth"] = "auth";
2149
+ eAuthType2["login"] = "login";
2150
+ eAuthType2["idle"] = "";
2151
+ })(eAuthType2 || (eAuthType2 = {}));
2152
+ var eAuthType;
2153
+ (function (eAuthType) {
2154
+ eAuthType["USER"] = "USER";
2155
+ eAuthType["ADMIN"] = "ADMIN";
2156
+ eAuthType["SELLER"] = "SELLER";
2157
+ eAuthType["CLIENT"] = "CLIENT";
2158
+ eAuthType["CONSULTANT"] = "CONSULTANT";
2159
+ eAuthType["FUNCTION"] = "FUNCTION";
2160
+ })(eAuthType || (eAuthType = {}));
2161
+
2162
+ var eConektaRes;
2163
+ (function (eConektaRes) {
2164
+ eConektaRes["CUSTOMER_CREATED"] = "customer.created";
2165
+ eConektaRes["ORDER_PENDING_PAYMENT"] = "order.pending_payment";
2166
+ eConektaRes["ORDER_CREATED"] = "order.created";
2167
+ eConektaRes["CHARGE_CREATED"] = "charge.created";
2168
+ eConektaRes["ORDER_PAID"] = "order.paid";
2169
+ eConektaRes["CHARGE_PAID"] = "charge.paid";
2170
+ })(eConektaRes || (eConektaRes = {}));
2171
+ var eConektaOrderStatus;
2172
+ (function (eConektaOrderStatus) {
2173
+ eConektaOrderStatus["expired"] = "expired";
2174
+ eConektaOrderStatus["paid"] = "paid";
2175
+ eConektaOrderStatus["pending_payment"] = "pending_payment";
2176
+ })(eConektaOrderStatus || (eConektaOrderStatus = {}));
2177
+ var eConektaOrderType;
2178
+ (function (eConektaOrderType) {
2179
+ eConektaOrderType["REFERENCE"] = "REFERENCE";
2180
+ eConektaOrderType["SPEI"] = "SPEI";
2181
+ })(eConektaOrderType || (eConektaOrderType = {}));
2182
+
2183
+ var EnumDynamicClientStatus;
2184
+ (function (EnumDynamicClientStatus) {
2185
+ EnumDynamicClientStatus["ACCEPTED"] = "Accepted";
2186
+ EnumDynamicClientStatus["PENDING"] = "Pending";
2187
+ EnumDynamicClientStatus["REJECTED"] = "Rejected";
2188
+ EnumDynamicClientStatus["ACTIVE"] = "Active";
2189
+ EnumDynamicClientStatus["INACTIVE"] = "Inactive";
2190
+ EnumDynamicClientStatus["CANCELED"] = "Cancelled";
2191
+ })(EnumDynamicClientStatus || (EnumDynamicClientStatus = {}));
2192
+
2193
+ var eNotificationType;
2194
+ (function (eNotificationType) {
2195
+ eNotificationType["GLOBAL"] = "global";
2196
+ eNotificationType["USER"] = "user";
2197
+ eNotificationType["PAYMENT"] = "payment";
2198
+ })(eNotificationType || (eNotificationType = {}));
2199
+
2200
+ var eProcessStatus;
2201
+ (function (eProcessStatus) {
2202
+ eProcessStatus["IDLE"] = "IDLE";
2203
+ eProcessStatus["ERROR"] = "ERROR";
2204
+ eProcessStatus["CANCELED"] = "CANCELED";
2205
+ eProcessStatus["COMPLETE"] = "COMPLETE";
2206
+ eProcessStatus["PROCESSING"] = "PROCESSING";
2207
+ eProcessStatus["WAITING"] = "WAITING";
2208
+ })(eProcessStatus || (eProcessStatus = {}));
2209
+ var eRequestVerb;
2210
+ (function (eRequestVerb) {
2211
+ eRequestVerb["POST"] = "POST";
2212
+ eRequestVerb["GET"] = "GET";
2213
+ eRequestVerb["PATCH"] = "PATCH";
2214
+ eRequestVerb["DELETE"] = "DELETE";
2215
+ })(eRequestVerb || (eRequestVerb = {}));
2216
+ var eGCActions;
2217
+ (function (eGCActions) {
2218
+ eGCActions["Create"] = "Create";
2219
+ eGCActions["Update"] = "Update";
2220
+ eGCActions["Remove"] = "Remove";
2221
+ eGCActions["LoginTime"] = "UpdateLogIn";
2222
+ })(eGCActions || (eGCActions = {}));
2223
+
2224
+ var eVerificationStep;
2225
+ (function (eVerificationStep) {
2226
+ eVerificationStep["IDLE"] = "IDLE";
2227
+ eVerificationStep["ERROR"] = "ERROR";
2228
+ eVerificationStep["COMPLETED"] = "COMPLETED";
2229
+ eVerificationStep["IN_PROGRESS"] = "IN_PROGRESS";
2230
+ eVerificationStep["INVALID"] = "INVALID";
2231
+ eVerificationStep["SUSPENDED"] = "SUSPENDED";
2232
+ eVerificationStep["CANCELLED"] = "CANCELLED";
2233
+ })(eVerificationStep || (eVerificationStep = {}));
2234
+ var eVerificationStatus;
2235
+ (function (eVerificationStatus) {
2236
+ eVerificationStatus["APPROVED"] = "approved";
2237
+ eVerificationStatus["CANCELLED"] = "cancelled";
2238
+ })(eVerificationStatus || (eVerificationStatus = {}));
2239
+ var eVerificationChannel;
2240
+ (function (eVerificationChannel) {
2241
+ eVerificationChannel["SMS"] = "sms";
2242
+ eVerificationChannel["WHATSAPP"] = "whatsapp";
2243
+ eVerificationChannel["CALL"] = "call";
2244
+ eVerificationChannel["EMAIL"] = "email";
2245
+ eVerificationChannel["SNA"] = "sna";
2246
+ })(eVerificationChannel || (eVerificationChannel = {}));
2247
+
2248
+ /*
2249
+ * Public API Surface of ravcredit-lib
2250
+ */
2251
+
2252
+ /**
2253
+ * Generated bundle index. Do not edit.
2254
+ */
2255
+
2256
+ export { EnumDynamicClientStatus, ErrorMessages, FactoryBusiness, FactoryClient, FactoryConekta, FactoryContract, FactoryDynamiCore, FactoryNotification, FactoryPassport, FactoryPayment, IndexedDbService, ROLES_KEY, ROUTE_GLOBAL_REFERENCE2, ROUTE_NOTIFICATIONS, RavcreditLibComponent, RavcreditLibService, UtilTime, UtilsHttp, cAddress, cAuthConfig, cBusinessConfig, cBusinessDeadlines, cBusinessInfo, cClient, cClientConekta, cClientContract, cClientDynamicStatus, cConektaRecurrent, cContract, cContractMetrics, cDaySchedule, cDefinedSchedule, cDevice, cEmptyDay, cFinancial, cIDCCharge, cIDCCustomer, cIDCDataPii, cIDCGeneratedReference, cIDCPayment, cNotification, cOptionsClientStatus, cOxxoRecurrentSources, cOxxoRecurrentSourcesData, cPaymentDelay, cResponse, cSchedule, cSingleOptionClientStatus, cTopic, cTyClientContract, cUserReference, dateCompleteFormat, dateFormat, dateFormatSimple, dbAuthStore, dbBusinessConfig, dbBusinessInfo, dbClientsStore, dbConektaClientsStore, dbConektaReferencesStore, dbContractsStore, dbDynamicAccountStore, dbDynamicReferencesStore, dbIndexAuth, dbIndexBusiness, dbIndexClients, dbIndexConektaClients, dbIndexConektaClientsRef, dbIndexContracts, dbIndexNotification, dbIndexPassportClientsRef, dbIndexPayments, dbIndexUsers, dbName, dbNotificationsStore, dbPassportReferencesStore, dbPaymentsStore, dbUsersStore, dbVersion, eAccountDynamicStatus, eAssetPeriod, eAuthActions, eAuthType, eAuthType2, eClientDynamicStatus, eClientStatus, eConektaOrderStatus, eConektaOrderType, eConektaRes, eContractStatus, eContractSteps, eGCActions, eIdentityTypes, eLoginStatus, eNotificationType, ePassportTypes, ePaymentType, eProcessStatus, eProvider, eReferenceStatusRav, eRequestVerb, eRoles, eRolesSelect, eVerificationChannel, eVerificationStatus, eVerificationStep, expiredPayment, keyPathId, keyUserID, ravCreditFunctions, snackBarConfigAction, snackBarConfigNoAction, snackBarConfigNoActionLong, timeFormat, week };
2257
+ //# sourceMappingURL=ravcredit-lib.mjs.map