ravcredit-lib 0.0.26 → 0.0.27
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/ng-package.json +7 -0
- package/package.json +14 -25
- package/src/index.d.ts +60 -0
- package/src/lib/ravcredit-lib.component.spec.ts +23 -0
- package/src/lib/ravcredit-lib.component.ts +16 -0
- package/src/lib/ravcredit-lib.service.spec.ts +16 -0
- package/src/lib/ravcredit-lib.service.ts +9 -0
- package/src/lib/v1/const/constants.ts +37 -0
- package/src/lib/v1/idb/idb.service.spec.ts +16 -0
- package/src/lib/v1/idb/indexed-db.service.ts +396 -0
- package/src/lib/v1/objects/oAddress.ts +9 -0
- package/src/lib/v1/objects/oBusiness.ts +93 -0
- package/src/lib/v1/objects/oClient.ts +46 -0
- package/src/lib/v1/objects/oConekta.ts +361 -0
- package/src/lib/v1/objects/oContract.ts +31 -0
- package/src/lib/v1/objects/oContractAll.ts +37 -0
- package/src/lib/v1/objects/oCustomer.ts +36 -0
- package/src/lib/v1/objects/oDevice.ts +5 -0
- package/src/lib/v1/objects/oFinancial.ts +32 -0
- package/src/lib/v1/objects/oLogIn.ts +26 -0
- package/src/lib/v1/objects/oNewPayment.ts +18 -0
- package/src/lib/v1/objects/oNotification.ts +33 -0
- package/src/lib/v1/objects/oPassport.ts +60 -0
- package/src/lib/v1/objects/oUser.ts +35 -0
- package/src/lib/v1/objects/oVerification.ts +79 -0
- package/src/lib/v1/util/UtilBusiness.ts +187 -0
- package/src/lib/v1/util/UtilClient.ts +300 -0
- package/src/lib/v1/util/UtilConekta.ts +97 -0
- package/src/lib/v1/util/UtilContract.ts +430 -0
- package/src/lib/v1/util/UtilDashboard.ts +19 -0
- package/src/lib/v1/util/UtilDynamiCore.ts +752 -0
- package/src/lib/v1/util/UtilNotification.ts +46 -0
- package/src/lib/v1/util/UtilPassport.ts +33 -0
- package/src/lib/v1/util/UtilPayment.ts +22 -0
- package/src/lib/v1/util/UtilTime.ts +179 -0
- package/src/lib/v1/util/UtilsHttp.ts +25 -0
- package/src/lib/v2/constant/constants.ts +125 -0
- package/src/lib/v2/constant/messages.ts +28 -0
- package/src/lib/v2/enum/EnumAsset.ts +4 -0
- package/src/lib/v2/enum/EnumAuth.ts +29 -0
- package/src/lib/v2/enum/EnumClient.ts +7 -0
- package/src/lib/v2/enum/EnumConekta.ts +14 -0
- package/src/lib/v2/enum/EnumDynamic.ts +8 -0
- package/src/lib/v2/enum/EnumNotification.ts +1 -0
- package/src/lib/v2/enum/EnumPassport.ts +4 -0
- package/src/lib/v2/enum/EnumPayment.ts +5 -0
- package/src/lib/v2/enum/EnumRoles.ts +7 -0
- package/src/lib/v2/enum/EnumToken.ts +11 -0
- package/src/lib/v2/enum/EnumUtil.ts +22 -0
- package/src/lib/v2/enum/EnumVerification.ts +22 -0
- package/src/lib/v2/objects/oAsset.ts +44 -0
- package/src/lib/v2/objects/oAws.ts +8 -0
- package/src/lib/v2/objects/oCatalog.ts +6 -0
- package/src/lib/v2/objects/oClient.ts +36 -0
- package/src/lib/v2/objects/oCompany.ts +10 -0
- package/src/lib/v2/objects/oContract.ts +10 -0
- package/src/lib/v2/objects/oHttp.ts +33 -0
- package/src/lib/v2/objects/oMediaDto.ts +10 -0
- package/src/lib/v2/objects/oMessaging.ts +10 -0
- package/src/lib/v2/objects/oScoreDto.ts +38 -0
- package/src/lib/v2/objects/oUtil.ts +68 -0
- package/src/public-api.ts +66 -0
- package/tsconfig.lib.json +15 -0
- package/tsconfig.lib.prod.json +11 -0
- package/tsconfig.spec.json +15 -0
- package/fesm2022/ravcredit-lib.mjs +0 -2182
- package/fesm2022/ravcredit-lib.mjs.map +0 -1
- package/index.d.ts +0 -1881
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import {cNotification, oNotification} from '../objects/oNotification';
|
|
2
|
+
import {UntypedFormControl, Validators} from '@angular/forms';
|
|
3
|
+
|
|
4
|
+
export const ROUTE_NOTIFICATIONS = "notifications"
|
|
5
|
+
export const ROUTE_GLOBAL_REFERENCE2 = "/contract-reference"
|
|
6
|
+
|
|
7
|
+
const prodFunction = "https://us-central1-ravcredit-2b079.cloudfunctions.net/CustomerNotification"
|
|
8
|
+
const prodFunction2 = "https://customernotification-2imgfxveka-uc.a.run.app"
|
|
9
|
+
const localTest = "http://127.0.0.1:5001/ravcredit-2b079/us-central1/CustomerNotification"
|
|
10
|
+
export const ravCreditFunctions = prodFunction
|
|
11
|
+
|
|
12
|
+
export class FactoryNotification {
|
|
13
|
+
|
|
14
|
+
public static FormNotification(notification?: oNotification) {
|
|
15
|
+
let data = cNotification
|
|
16
|
+
|
|
17
|
+
if (notification) data = notification
|
|
18
|
+
|
|
19
|
+
return {
|
|
20
|
+
title: new UntypedFormControl(data.notification.title, [Validators.required, Validators.min(1)]),
|
|
21
|
+
body: new UntypedFormControl(data.notification.body, [Validators.required, Validators.min(1)]),
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
public static CreateGlobalNotificationObj(data: oNotification) {
|
|
26
|
+
const o: any = {}
|
|
27
|
+
|
|
28
|
+
if (data.notification) {
|
|
29
|
+
const not: any = {}
|
|
30
|
+
if (data.notification.body) not["body"] = data.notification.body
|
|
31
|
+
if (data.notification.title) not["title"] = data.notification.title
|
|
32
|
+
|
|
33
|
+
if (data.ids) not["ids"] = data.ids
|
|
34
|
+
|
|
35
|
+
if (data.tokens) not["tokens"] = data.tokens
|
|
36
|
+
|
|
37
|
+
if (data.type) not["type"] = data.type
|
|
38
|
+
|
|
39
|
+
if (data.data) if (data.data.route) not["route"] = data.data.route
|
|
40
|
+
|
|
41
|
+
o["data"] = not
|
|
42
|
+
}
|
|
43
|
+
return o
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {oContract} from '../objects/oContract';
|
|
2
|
+
import {oClient} from '../objects/oClient';
|
|
3
|
+
import {iGlobalPassport} from '../objects/oPassport';
|
|
4
|
+
import {ePassportTypes} from '../../v2/enum/EnumPassport';
|
|
5
|
+
|
|
6
|
+
export class FactoryPassport {
|
|
7
|
+
public static CreatePassportReference(
|
|
8
|
+
client: oClient,
|
|
9
|
+
contract: oContract,
|
|
10
|
+
dateTime?: number
|
|
11
|
+
): iGlobalPassport {
|
|
12
|
+
const o = {
|
|
13
|
+
passport: {
|
|
14
|
+
type: ePassportTypes.CREATE,
|
|
15
|
+
data: {
|
|
16
|
+
name: client.name,
|
|
17
|
+
email: client.email,
|
|
18
|
+
amount: contract.financial.weeklyPayment,
|
|
19
|
+
expirationDate: "",
|
|
20
|
+
additional: {
|
|
21
|
+
client: client.name,
|
|
22
|
+
clientID: client.id,
|
|
23
|
+
credit: client.status
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
contract: contract,
|
|
28
|
+
date: dateTime
|
|
29
|
+
}
|
|
30
|
+
if (dateTime != undefined) o.date = dateTime
|
|
31
|
+
return o
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {oConektaRes} from '../objects/oConekta';
|
|
2
|
+
import {IDCTxnRow} from './UtilDynamiCore';
|
|
3
|
+
import {eProvider} from './UtilContract';
|
|
4
|
+
|
|
5
|
+
export interface oPaymentGlobal {
|
|
6
|
+
conektaPayment?: oConektaRes,
|
|
7
|
+
dynamicPayment?: IDCTxnRow[],
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export class FactoryPayment {
|
|
11
|
+
public static CreatePayment(data: oConektaRes | IDCTxnRow[], provider: eProvider): oPaymentGlobal {
|
|
12
|
+
const o: oPaymentGlobal = {}
|
|
13
|
+
|
|
14
|
+
if (provider == eProvider.DynamiCore)
|
|
15
|
+
o.dynamicPayment = data as IDCTxnRow[];
|
|
16
|
+
|
|
17
|
+
if (provider == eProvider.Conekta)
|
|
18
|
+
o.conektaPayment = data as oConektaRes
|
|
19
|
+
|
|
20
|
+
return o
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import {add, format, getDate} from "date-fns";
|
|
2
|
+
import {es} from 'date-fns/locale/es';
|
|
3
|
+
import {eProvider} from './UtilContract';
|
|
4
|
+
import {inject, Injector, runInInjectionContext} from '@angular/core';
|
|
5
|
+
import {IDCTxnRow} from './UtilDynamiCore';
|
|
6
|
+
import {oConektaOrder} from '../objects/oConekta';
|
|
7
|
+
import {dateCompleteFormat, dateFormat, expiredPayment, timeFormat} from '../const/constants';
|
|
8
|
+
import {IndexedDbService} from '../idb/indexed-db.service';
|
|
9
|
+
import { oPaymentDates } from "../../v2/objects/oUtil";
|
|
10
|
+
|
|
11
|
+
export class UtilTime {
|
|
12
|
+
private localeFns = es
|
|
13
|
+
|
|
14
|
+
public static IsExpired(time: number): boolean {
|
|
15
|
+
const dateInit = new Date(time)
|
|
16
|
+
const dayInit = dateInit.getDate()
|
|
17
|
+
const monthInit = dateInit.getMonth() + 1
|
|
18
|
+
|
|
19
|
+
const dateActual = new Date()
|
|
20
|
+
const dayActual = dateActual.getDate()
|
|
21
|
+
const monthActual = dateActual.getMonth() + 1
|
|
22
|
+
|
|
23
|
+
if (monthActual > monthInit) return true
|
|
24
|
+
|
|
25
|
+
return dayActual > dayInit;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
public static getDates(initial: number, weeks: number): oPaymentDates[] {
|
|
29
|
+
const dates: oPaymentDates[] = []
|
|
30
|
+
let prev = initial
|
|
31
|
+
for (let i = 0; i < weeks; i++) {
|
|
32
|
+
const date = add(prev, {weeks: 1})
|
|
33
|
+
dates.push(
|
|
34
|
+
{
|
|
35
|
+
week: i + 1,
|
|
36
|
+
date: date.getTime()
|
|
37
|
+
}
|
|
38
|
+
)
|
|
39
|
+
prev = date.getTime()
|
|
40
|
+
}
|
|
41
|
+
return dates
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
public static getPreviousWeek() {
|
|
45
|
+
const today = new Date().getTime()
|
|
46
|
+
const week = ((3600 * 24) * 7) * 1000
|
|
47
|
+
return today - week
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
public static getDayNum(date: Date | number): number {
|
|
51
|
+
return getDate(date)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
public static getDayName(date: Date | number): string {
|
|
55
|
+
return format(date, "EEEE", {locale: es})
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
public static getMonthName(date: Date | number): string {
|
|
59
|
+
return format(date, "MMMM", {locale: es}).toUpperCase();
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
public static getYear(date: Date | number): string {
|
|
63
|
+
return format(date, "yyyy")
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
public static GetNextPayment(time: number, provider: string) {
|
|
67
|
+
let week = 0
|
|
68
|
+
if (provider == eProvider.Conekta) {
|
|
69
|
+
week = (((3600 * 24) * 7))
|
|
70
|
+
} else if (provider == eProvider.DynamiCore) {
|
|
71
|
+
week = (((3600 * 24) * 7) * 1000)
|
|
72
|
+
}
|
|
73
|
+
return this.getLocalTimeFromLong(time + week, provider)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
public static getLocalTimeFromLong(time: number, provider: string) {
|
|
77
|
+
if (time <= 0) return ""
|
|
78
|
+
let factor = this.GetFactor(provider)
|
|
79
|
+
let dateTime = time * factor
|
|
80
|
+
let parsedDate = format(new Date(dateTime), dateFormat, {
|
|
81
|
+
locale: es
|
|
82
|
+
})
|
|
83
|
+
return parsedDate
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
public static DelayPaymentLast(
|
|
87
|
+
lastPayment: number, provider: string, injector: Injector
|
|
88
|
+
): boolean {
|
|
89
|
+
let factor = this.GetFactor(provider)
|
|
90
|
+
let now = new Date().getTime()
|
|
91
|
+
let last = 0
|
|
92
|
+
|
|
93
|
+
if (provider == eProvider.Conekta)
|
|
94
|
+
last = ((((3600 * 24) * 7)) + lastPayment) * factor
|
|
95
|
+
else if (provider == eProvider.DynamiCore)
|
|
96
|
+
last = ((((3600 * 24) * 7) * 1000) + lastPayment) * factor
|
|
97
|
+
|
|
98
|
+
runInInjectionContext(injector, () => {
|
|
99
|
+
const idb = inject(IndexedDbService)
|
|
100
|
+
// constant observable = inject(ObservablesService)
|
|
101
|
+
idb.setLocalStorage(expiredPayment, String(now > last))
|
|
102
|
+
// observable.isLate.next(now > last)
|
|
103
|
+
})
|
|
104
|
+
return now > last
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
public static GetFactor(provider: string) {
|
|
108
|
+
let factor = 1
|
|
109
|
+
if (provider == eProvider.Conekta)
|
|
110
|
+
factor = 1000
|
|
111
|
+
return factor
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
public static GetEpochFromFormatedDate(date: string): number {
|
|
115
|
+
if (date == "") return 0
|
|
116
|
+
|
|
117
|
+
const _date = new Date(date)
|
|
118
|
+
if (isNaN(_date.getTime())) return 0
|
|
119
|
+
return _date.getTime()
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
public static GetTimeFromString(date: string) {
|
|
123
|
+
return format(new Date(date), timeFormat, {
|
|
124
|
+
locale: es
|
|
125
|
+
})
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
public static GetDateFromString(date: string) {
|
|
129
|
+
return format(new Date(date), dateCompleteFormat, {
|
|
130
|
+
locale: es
|
|
131
|
+
})
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// Quick sort
|
|
135
|
+
public static SortingByTime(payments: IDCTxnRow[]): IDCTxnRow[] {
|
|
136
|
+
if (payments.length <= 1) return payments
|
|
137
|
+
|
|
138
|
+
const pivot = payments[payments.length - 1]
|
|
139
|
+
const pivotDate = new Date(pivot.created).getTime()
|
|
140
|
+
const left: IDCTxnRow[] = []
|
|
141
|
+
const right: IDCTxnRow[] = []
|
|
142
|
+
|
|
143
|
+
for (let i = 0; i < payments.length - 1; i++) {
|
|
144
|
+
const actualDate = new Date(payments[i].created).getTime()
|
|
145
|
+
if (actualDate > pivotDate) left.push(payments[i])
|
|
146
|
+
else right.push(payments[i])
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
return [...this.SortingByTime(left), pivot, ...this.SortingByTime(right)]
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
public static SortingByTimeConekta(payments: oConektaOrder []): oConektaOrder[] {
|
|
153
|
+
if (payments.length <= 1) return payments;
|
|
154
|
+
|
|
155
|
+
const pivot = payments[payments.length - 1]
|
|
156
|
+
let pivotDate = 0;
|
|
157
|
+
if (pivot.charges.data == undefined) return payments
|
|
158
|
+
|
|
159
|
+
if (pivot.charges.data[0].paid_at != undefined) {
|
|
160
|
+
pivotDate = pivot.charges.data[0].paid_at
|
|
161
|
+
} else {
|
|
162
|
+
pivot.charges.data[0].created_at
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
if (pivotDate <= 0) return payments;
|
|
166
|
+
|
|
167
|
+
const left: oConektaOrder[] = []
|
|
168
|
+
const right: oConektaOrder [] = []
|
|
169
|
+
|
|
170
|
+
for (let i = 0; i < payments.length - 1; i++) {
|
|
171
|
+
const actual = payments[i].charges.data[0].paid_at;
|
|
172
|
+
if (actual <= 0) continue
|
|
173
|
+
if (actual > pivotDate) left.push(payments[i])
|
|
174
|
+
else right.push(payments[i])
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
return [...this.SortingByTimeConekta(left), pivot, ...this.SortingByTimeConekta(right)]
|
|
178
|
+
}
|
|
179
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export class UtilsHttp {
|
|
2
|
+
|
|
3
|
+
public static CreateHeadersRavcreditApi(token: string) {
|
|
4
|
+
return {
|
|
5
|
+
'Content-Type': 'application/json',
|
|
6
|
+
'Accept': 'application/json',
|
|
7
|
+
'Access-Control-Allow-Headers': 'Content-Type',
|
|
8
|
+
'Authorization': `Bearer ${token}`
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
public static CreateSimpleHeadersApi() {
|
|
13
|
+
return {
|
|
14
|
+
'Content-Type': 'application/json',
|
|
15
|
+
'Accept': 'application/json',
|
|
16
|
+
'Access-Control-Allow-Headers': 'Content-Type',
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
public static CreateAwsHeadersApi() {
|
|
21
|
+
return {
|
|
22
|
+
'Content-Type': 'application/json'
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import {iOptionsSelect, iPaymentDelay, iSelect} from '../objects/oUtil';
|
|
2
|
+
import {MatSnackBarConfig} from '@angular/material/snack-bar';
|
|
3
|
+
import {cContract} from '../../v1/util/UtilContract';
|
|
4
|
+
import {cClient} from '../../v1/util/UtilClient';
|
|
5
|
+
import {oAddress} from '../../v1/objects/oAddress';
|
|
6
|
+
import {iConektaRecurrent, iOxxoRecurrentSources, iOxxorecurrentSourcesData} from "../../v1/objects/oConekta";
|
|
7
|
+
import {iAuthConfig} from '../../v1/objects/oLogIn';
|
|
8
|
+
import {eClientStatus} from '../enum/EnumClient';
|
|
9
|
+
import { eRoles } from "../enum/EnumRoles";
|
|
10
|
+
import {oDaySchedule} from '../../v1/objects/oBusiness';
|
|
11
|
+
|
|
12
|
+
export const cSingleOptionClientStatus: iOptionsSelect = {
|
|
13
|
+
viewValue: "",
|
|
14
|
+
value: ""
|
|
15
|
+
}
|
|
16
|
+
export const cOptionsClientStatus: iOptionsSelect[] = [
|
|
17
|
+
{
|
|
18
|
+
value: eClientStatus.ACTIVE,
|
|
19
|
+
viewValue: "Activar"
|
|
20
|
+
}, {
|
|
21
|
+
value: eClientStatus.COMPLETED,
|
|
22
|
+
viewValue: "Completar"
|
|
23
|
+
}, {
|
|
24
|
+
value: eClientStatus.PAUSED,
|
|
25
|
+
viewValue: "Pausar"
|
|
26
|
+
}, {
|
|
27
|
+
value: eClientStatus.LATE,
|
|
28
|
+
viewValue: "Marcar con atraso"
|
|
29
|
+
}, {
|
|
30
|
+
value: eClientStatus.CANCELED,
|
|
31
|
+
viewValue: "Cancelar"
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
export const eRolesSelect: iSelect[] = [
|
|
36
|
+
{
|
|
37
|
+
value: eRoles.Administrator,
|
|
38
|
+
viewValue: eRoles.Administrator
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
value: eRoles.Consultant,
|
|
42
|
+
viewValue: eRoles.Consultant
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
value: eRoles.Seller,
|
|
46
|
+
viewValue: eRoles.Seller
|
|
47
|
+
},
|
|
48
|
+
]
|
|
49
|
+
|
|
50
|
+
export const cPaymentDelay: iPaymentDelay = {
|
|
51
|
+
today: 0,
|
|
52
|
+
nextPayment: 0,
|
|
53
|
+
daysDelay: 0,
|
|
54
|
+
late: false,
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export const snackBarConfigAction: MatSnackBarConfig = {
|
|
58
|
+
horizontalPosition: "start"
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export const snackBarConfigNoAction: MatSnackBarConfig = {
|
|
62
|
+
duration: 4000,
|
|
63
|
+
horizontalPosition: "start"
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export const snackBarConfigNoActionLong: MatSnackBarConfig = {
|
|
67
|
+
duration: 8000,
|
|
68
|
+
horizontalPosition: "start"
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export const cTyClientContract = {...cClient, ...cContract}
|
|
72
|
+
|
|
73
|
+
export const cAddress: oAddress = {
|
|
74
|
+
street: "",
|
|
75
|
+
city: "",
|
|
76
|
+
neighbor: "",
|
|
77
|
+
zip: "",
|
|
78
|
+
ext: "",
|
|
79
|
+
int: "",
|
|
80
|
+
state: ""
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export const cOxxoRecurrentSourcesData: iOxxorecurrentSourcesData = {
|
|
84
|
+
id: "",
|
|
85
|
+
object: "",
|
|
86
|
+
type: "",
|
|
87
|
+
provider: "",
|
|
88
|
+
reference: "",
|
|
89
|
+
barcode: "",
|
|
90
|
+
barcode_url: "",
|
|
91
|
+
expires_at: 0,
|
|
92
|
+
created_at: 0,
|
|
93
|
+
parent_id: ""
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export const cOxxoRecurrentSources: iOxxoRecurrentSources = {
|
|
97
|
+
object: "",
|
|
98
|
+
has_more: false,
|
|
99
|
+
total: 0,
|
|
100
|
+
data: []
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export const cConektaRecurrent: iConektaRecurrent = {
|
|
104
|
+
livemode: false,
|
|
105
|
+
name: "",
|
|
106
|
+
email: "",
|
|
107
|
+
phone: "",
|
|
108
|
+
id: "",
|
|
109
|
+
object: "",
|
|
110
|
+
created_at: 0,
|
|
111
|
+
corporate: false,
|
|
112
|
+
custom_id: "",
|
|
113
|
+
payment_sources: cOxxoRecurrentSources
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export const cAuthConfig: iAuthConfig = {
|
|
117
|
+
title: "",
|
|
118
|
+
desc: "",
|
|
119
|
+
data: true,
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export const cDaySchedule: oDaySchedule = {
|
|
123
|
+
open: 0,
|
|
124
|
+
close: 0
|
|
125
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export const ErrorMessages = {
|
|
2
|
+
NotFound: "Recurso no encontrado",
|
|
3
|
+
Unauthorized: "Request without(or not valid) token",
|
|
4
|
+
RandomError: "Something goes wrong, try again -> ",
|
|
5
|
+
RandomErrorFirestore: "Something goes wrong in firestore",
|
|
6
|
+
CreateUser: "Error: Something goes wrong",
|
|
7
|
+
CreateFoundedUser: "Error: User already exists try with another username",
|
|
8
|
+
FindAllNotFound: "Not users found",
|
|
9
|
+
UserFindOne: "User with given ID not found",
|
|
10
|
+
UserFindOneError: "Error getting user by ID",
|
|
11
|
+
UserUpdate: "Error updating user by ID",
|
|
12
|
+
DeleteUser: "Error deleting user",
|
|
13
|
+
UsernameNotFound: "User with given username not found",
|
|
14
|
+
IncorrectPassword: "Incorrect or not valid password",
|
|
15
|
+
LastLogIn: "Last LogIn date not updated",
|
|
16
|
+
authError: "Username or password incorrect",
|
|
17
|
+
tokenRequired: "Token required",
|
|
18
|
+
ClientDefined: "This user already registered: Update user's contracts instead",
|
|
19
|
+
ClientsNotFound: "List of clients is empty",
|
|
20
|
+
ClientNotFound: "Client with given ID, not found",
|
|
21
|
+
ClientNotUpdated: "Client with given ID, not updated",
|
|
22
|
+
DeleteClient: "Error deleting client",
|
|
23
|
+
UsernameClientNotFound: "Client with given username not found",
|
|
24
|
+
ContractsAllEmpty: "Contract list empty",
|
|
25
|
+
ContractNotFound: "Contract not found",
|
|
26
|
+
ContractUpdateError: "Something goes wrong updating contract, try again",
|
|
27
|
+
ContractDeleteError: "Something goes wrong deleting contract, try again"
|
|
28
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export enum eLoginStatus {
|
|
2
|
+
IDLE = "IDLE",
|
|
3
|
+
ERROR = "ERROR",
|
|
4
|
+
AUTHORIZED = "AUTHORIZED",
|
|
5
|
+
CHECKING = "CHECKING",
|
|
6
|
+
NOAUTHORIZED = "NOAUTHORIZED",
|
|
7
|
+
NOTFOUND = "NOTFOUND",
|
|
8
|
+
ERRORPASSWORD = "ERRORPASSWORD"
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export enum eAuthActions {
|
|
12
|
+
delete = "delete",
|
|
13
|
+
auth = "auth"
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export enum eAuthType2 {
|
|
17
|
+
auth = "auth",
|
|
18
|
+
login = "login",
|
|
19
|
+
idle = ""
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export enum eAuthType {
|
|
23
|
+
USER = 'USER', // Used for user of Ravcredit platform user, employee
|
|
24
|
+
ADMIN = "ADMIN",
|
|
25
|
+
SELLER = 'SELLER',
|
|
26
|
+
CLIENT = 'CLIENT', // Used for clients of Ravcredit
|
|
27
|
+
CONSULTANT = 'CONSULTANT',
|
|
28
|
+
FUNCTION = 'FUNCTION',
|
|
29
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export enum eConektaRes {
|
|
2
|
+
CUSTOMER_CREATED = 'customer.created',
|
|
3
|
+
ORDER_PENDING_PAYMENT = 'order.pending_payment',
|
|
4
|
+
ORDER_CREATED = 'order.created',
|
|
5
|
+
CHARGE_CREATED = 'charge.created',
|
|
6
|
+
ORDER_PAID = 'order.paid',
|
|
7
|
+
CHARGE_PAID = 'charge.paid',
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export enum eConektaOrderStatus {
|
|
11
|
+
expired = 'expired',
|
|
12
|
+
paid = 'paid',
|
|
13
|
+
pending_payment = 'pending_payment',
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export enum eNotificationType { GLOBAL = "global", USER = "user", PAYMENT = "payment" }
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export enum eProcessStatus {
|
|
2
|
+
IDLE = "IDLE",
|
|
3
|
+
ERROR = "ERROR",
|
|
4
|
+
CANCELED = "CANCELED",
|
|
5
|
+
COMPLETE = "COMPLETE",
|
|
6
|
+
PROCESSING = "PROCESSING",
|
|
7
|
+
WAITING = "WAITING",
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export enum eRequestVerb {
|
|
11
|
+
POST = 'POST',
|
|
12
|
+
GET = 'GET',
|
|
13
|
+
PATCH = 'PATCH',
|
|
14
|
+
DELETE = 'DELETE',
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export enum eGCActions {
|
|
18
|
+
Create = 'Create',
|
|
19
|
+
Update = 'Update',
|
|
20
|
+
Remove = 'Remove',
|
|
21
|
+
LoginTime = 'UpdateLogIn'
|
|
22
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export enum eVerificationStep {
|
|
2
|
+
IDLE = "IDLE",
|
|
3
|
+
ERROR = "ERROR",
|
|
4
|
+
COMPLETED = "COMPLETED",
|
|
5
|
+
IN_PROGRESS = "IN_PROGRESS",
|
|
6
|
+
INVALID = "INVALID",
|
|
7
|
+
SUSPENDED = "SUSPENDED",
|
|
8
|
+
CANCELLED = "CANCELLED",
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export enum eVerificationStatus {
|
|
12
|
+
APPROVED = "approved",
|
|
13
|
+
CANCELLED = "cancelled",
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export enum eVerificationChannel {
|
|
17
|
+
SMS = "sms",
|
|
18
|
+
WHATSAPP = "whatsapp",
|
|
19
|
+
CALL = "call",
|
|
20
|
+
EMAIL = "email",
|
|
21
|
+
SNA = "sna",
|
|
22
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import {oCatalog} from './oCatalog';
|
|
2
|
+
import {oScoreNoHit, oScoreReference} from './oScoreDto';
|
|
3
|
+
import {eAssetPeriod} from '../enum/EnumAsset';
|
|
4
|
+
|
|
5
|
+
export interface oAssetCategory {
|
|
6
|
+
name: string
|
|
7
|
+
id: string
|
|
8
|
+
createAt: number
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface oAssetBrand{
|
|
12
|
+
name: string
|
|
13
|
+
id: string
|
|
14
|
+
description: string
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface oAssetOffer {
|
|
18
|
+
name: string
|
|
19
|
+
id: string
|
|
20
|
+
createAt: number
|
|
21
|
+
description: string
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface oPaymentOption {
|
|
25
|
+
deadline: number,
|
|
26
|
+
score: oScoreNoHit
|
|
27
|
+
period: eAssetPeriod,
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface oAsset {
|
|
31
|
+
name: string
|
|
32
|
+
id: string
|
|
33
|
+
createAt: number
|
|
34
|
+
category: oAssetCategory
|
|
35
|
+
brand: oAssetBrand
|
|
36
|
+
price: number
|
|
37
|
+
model: string
|
|
38
|
+
imageUrl: string []
|
|
39
|
+
paymentOption: oPaymentOption[]
|
|
40
|
+
catalog: oCatalog
|
|
41
|
+
offers: oAssetOffer[]
|
|
42
|
+
score: oScoreReference
|
|
43
|
+
IMEI: string
|
|
44
|
+
}
|