ravcredit-lib 0.0.59 → 0.0.61
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/fesm2022/ravcredit-lib.mjs +139 -41
- package/fesm2022/ravcredit-lib.mjs.map +1 -1
- package/index.d.ts +43 -14
- package/package.json +1 -1
|
@@ -361,6 +361,17 @@ const cClientConekta = {
|
|
|
361
361
|
conekta: cConektaRecurrent,
|
|
362
362
|
ravcredit: cClient
|
|
363
363
|
};
|
|
364
|
+
const cResponseErrorData = {
|
|
365
|
+
epochTime: new Date().getTime(), statusCode: 202,
|
|
366
|
+
data: []
|
|
367
|
+
};
|
|
368
|
+
const emailContact = "contact@ravcredit.com";
|
|
369
|
+
const cResponseError = {
|
|
370
|
+
path: "",
|
|
371
|
+
statusCode: 400,
|
|
372
|
+
epochTime: new Date().getTime(),
|
|
373
|
+
data: cResponseErrorData
|
|
374
|
+
};
|
|
364
375
|
const cTyClientContract = { ...cClient, ...cContract };
|
|
365
376
|
|
|
366
377
|
const cSchedule = {
|
|
@@ -939,7 +950,8 @@ class FactoryClient {
|
|
|
939
950
|
phone: String(data["client"][0].phone),
|
|
940
951
|
curp: data["client"][0].curp,
|
|
941
952
|
userReferences: data["client"][0].userReferences,
|
|
942
|
-
status: eClientStatus.ACTIVE
|
|
953
|
+
status: eClientStatus.ACTIVE,
|
|
954
|
+
score: cScore,
|
|
943
955
|
};
|
|
944
956
|
if (client != undefined) {
|
|
945
957
|
if (client.dynamic_id)
|
|
@@ -978,6 +990,7 @@ class FactoryClient {
|
|
|
978
990
|
}
|
|
979
991
|
static MapperTypeContCli_Client(_client) {
|
|
980
992
|
const client = {
|
|
993
|
+
score: cScore,
|
|
981
994
|
id: _client.id,
|
|
982
995
|
name: _client.name,
|
|
983
996
|
username: _client.username,
|
|
@@ -1001,7 +1014,7 @@ class FactoryClient {
|
|
|
1001
1014
|
contractUrl: _client.contractUrl,
|
|
1002
1015
|
dynamic_ref: _client.dynamic_ref,
|
|
1003
1016
|
exists: _client.exists,
|
|
1004
|
-
passport_id: _client.passport_id
|
|
1017
|
+
passport_id: _client.passport_id
|
|
1005
1018
|
};
|
|
1006
1019
|
return client;
|
|
1007
1020
|
}
|
|
@@ -1412,6 +1425,38 @@ class FactoryDynamiCore {
|
|
|
1412
1425
|
}
|
|
1413
1426
|
}
|
|
1414
1427
|
|
|
1428
|
+
var eProcessStatus;
|
|
1429
|
+
(function (eProcessStatus) {
|
|
1430
|
+
eProcessStatus["IDLE"] = "IDLE";
|
|
1431
|
+
eProcessStatus["ERROR"] = "ERROR";
|
|
1432
|
+
eProcessStatus["CANCELED"] = "CANCELED";
|
|
1433
|
+
eProcessStatus["COMPLETE"] = "COMPLETE";
|
|
1434
|
+
eProcessStatus["PROCESSING"] = "PROCESSING";
|
|
1435
|
+
eProcessStatus["WAITING"] = "WAITING";
|
|
1436
|
+
})(eProcessStatus || (eProcessStatus = {}));
|
|
1437
|
+
var eRequestVerb;
|
|
1438
|
+
(function (eRequestVerb) {
|
|
1439
|
+
eRequestVerb["POST"] = "POST";
|
|
1440
|
+
eRequestVerb["GET"] = "GET";
|
|
1441
|
+
eRequestVerb["PATCH"] = "PATCH";
|
|
1442
|
+
eRequestVerb["DELETE"] = "DELETE";
|
|
1443
|
+
})(eRequestVerb || (eRequestVerb = {}));
|
|
1444
|
+
var eGCActions;
|
|
1445
|
+
(function (eGCActions) {
|
|
1446
|
+
eGCActions["Create"] = "Create";
|
|
1447
|
+
eGCActions["Update"] = "Update";
|
|
1448
|
+
eGCActions["Remove"] = "Remove";
|
|
1449
|
+
eGCActions["LoginTime"] = "UpdateLogIn";
|
|
1450
|
+
})(eGCActions || (eGCActions = {}));
|
|
1451
|
+
var eOrderType;
|
|
1452
|
+
(function (eOrderType) {
|
|
1453
|
+
eOrderType["DYNAMIC_REFERENCE"] = "DYNAMIC_REFERENCE";
|
|
1454
|
+
eOrderType["DYNAMIC_SPEI"] = "DYNAMIC_SPEI";
|
|
1455
|
+
eOrderType["CONEKTA_REFERENCE"] = "CONEKTA_REFERENCE";
|
|
1456
|
+
eOrderType["CONEKTA_SPEI"] = "CONEKTA_SPEI";
|
|
1457
|
+
eOrderType["PASSPORT_REFERENCE"] = "PASSPORT_REFERENCE";
|
|
1458
|
+
})(eOrderType || (eOrderType = {}));
|
|
1459
|
+
|
|
1415
1460
|
var ePaymentType;
|
|
1416
1461
|
(function (ePaymentType) {
|
|
1417
1462
|
ePaymentType["OXXO"] = "OXXO";
|
|
@@ -1469,6 +1514,71 @@ class FactoryConekta {
|
|
|
1469
1514
|
order.date = dateTime;
|
|
1470
1515
|
return order;
|
|
1471
1516
|
}
|
|
1517
|
+
static _createOrder(client, contract, dateTime, type) {
|
|
1518
|
+
console.log("CONEKTAID", client);
|
|
1519
|
+
if (client.conekta_id == undefined)
|
|
1520
|
+
return {
|
|
1521
|
+
charges: [], currency: '', customer_info: {}, line_items: []
|
|
1522
|
+
};
|
|
1523
|
+
let typeDef = "cash";
|
|
1524
|
+
const customer_info = {};
|
|
1525
|
+
if (type == eOrderType.CONEKTA_SPEI) {
|
|
1526
|
+
typeDef = "spei";
|
|
1527
|
+
customer_info.name = client.name;
|
|
1528
|
+
customer_info.email = client.email;
|
|
1529
|
+
customer_info.phone = client.phone;
|
|
1530
|
+
}
|
|
1531
|
+
else {
|
|
1532
|
+
customer_info.customer_id = client.conekta_id;
|
|
1533
|
+
}
|
|
1534
|
+
const week = ((3600 * 24) * 30) * 1000;
|
|
1535
|
+
let next = new Date().getTime() + week;
|
|
1536
|
+
next = Math.floor(next / 1000);
|
|
1537
|
+
const method = {
|
|
1538
|
+
type: typeDef,
|
|
1539
|
+
expires_at: next,
|
|
1540
|
+
};
|
|
1541
|
+
const charge = {
|
|
1542
|
+
amount: contract.financial.weeklyPayment * 100,
|
|
1543
|
+
payment_method: method
|
|
1544
|
+
};
|
|
1545
|
+
const charges = [charge];
|
|
1546
|
+
const antifraud_info = {
|
|
1547
|
+
newKey: "Key"
|
|
1548
|
+
};
|
|
1549
|
+
const lineItem = {
|
|
1550
|
+
antifraud_info: antifraud_info,
|
|
1551
|
+
name: `Referencia credito ${client.name}`,
|
|
1552
|
+
quantity: 1,
|
|
1553
|
+
unit_price: contract.financial.weeklyPayment * 100,
|
|
1554
|
+
};
|
|
1555
|
+
const lineItems = [lineItem];
|
|
1556
|
+
const orderData = {
|
|
1557
|
+
customer_info: customer_info,
|
|
1558
|
+
charges: charges,
|
|
1559
|
+
currency: "MXN",
|
|
1560
|
+
line_items: lineItems
|
|
1561
|
+
};
|
|
1562
|
+
return orderData;
|
|
1563
|
+
}
|
|
1564
|
+
static defineObject(client, type, order, dateTime) {
|
|
1565
|
+
let o;
|
|
1566
|
+
if (type == eOrderType.CONEKTA_SPEI) {
|
|
1567
|
+
o = {
|
|
1568
|
+
data: order,
|
|
1569
|
+
client: client
|
|
1570
|
+
};
|
|
1571
|
+
}
|
|
1572
|
+
else {
|
|
1573
|
+
o = {
|
|
1574
|
+
data: order,
|
|
1575
|
+
id: client.id
|
|
1576
|
+
};
|
|
1577
|
+
}
|
|
1578
|
+
if (dateTime != undefined)
|
|
1579
|
+
o.date = dateTime;
|
|
1580
|
+
return o;
|
|
1581
|
+
}
|
|
1472
1582
|
}
|
|
1473
1583
|
// '
|
|
1474
1584
|
// {
|
|
@@ -2147,9 +2257,30 @@ const ErrorMessages = {
|
|
|
2147
2257
|
ContractsAllEmpty: "Contract list empty",
|
|
2148
2258
|
ContractNotFound: "Contract not found",
|
|
2149
2259
|
ContractUpdateError: "Something goes wrong updating contract, try again",
|
|
2150
|
-
ContractDeleteError: "Something goes wrong deleting contract, try again"
|
|
2260
|
+
ContractDeleteError: "Something goes wrong deleting contract, try again",
|
|
2261
|
+
cNotUserFound: "Usuario no encontrado",
|
|
2262
|
+
cIncorrectPassword: "Contraseña incorrecta",
|
|
2263
|
+
dbUsernameNotFound: "User with given username not found",
|
|
2264
|
+
dbIncorrectPassword: "Incorrect or not valid password",
|
|
2265
|
+
dbUsernameClientNotFound: "Client with given username not found",
|
|
2151
2266
|
};
|
|
2152
2267
|
|
|
2268
|
+
var RouteData;
|
|
2269
|
+
(function (RouteData) {
|
|
2270
|
+
RouteData[RouteData["CLIENT"] = 0] = "CLIENT";
|
|
2271
|
+
RouteData[RouteData["CONTRACT"] = 1] = "CONTRACT";
|
|
2272
|
+
RouteData[RouteData["REFERENCE"] = 2] = "REFERENCE";
|
|
2273
|
+
RouteData[RouteData["ID"] = 3] = "ID";
|
|
2274
|
+
RouteData[RouteData["EXTERNAL_ID"] = 4] = "EXTERNAL_ID";
|
|
2275
|
+
RouteData[RouteData["PAYMENT_DYNAMIC"] = 5] = "PAYMENT_DYNAMIC";
|
|
2276
|
+
RouteData[RouteData["PAYMENT_CONEKTA"] = 6] = "PAYMENT_CONEKTA";
|
|
2277
|
+
})(RouteData || (RouteData = {}));
|
|
2278
|
+
var eEmailType;
|
|
2279
|
+
(function (eEmailType) {
|
|
2280
|
+
eEmailType["register"] = "register";
|
|
2281
|
+
eEmailType["update"] = "update";
|
|
2282
|
+
})(eEmailType || (eEmailType = {}));
|
|
2283
|
+
|
|
2153
2284
|
var eAssetPeriod;
|
|
2154
2285
|
(function (eAssetPeriod) {
|
|
2155
2286
|
eAssetPeriod["MONTH"] = "MONTH";
|
|
@@ -2203,11 +2334,10 @@ var eConektaOrderStatus;
|
|
|
2203
2334
|
eConektaOrderStatus["paid"] = "paid";
|
|
2204
2335
|
eConektaOrderStatus["pending_payment"] = "pending_payment";
|
|
2205
2336
|
})(eConektaOrderStatus || (eConektaOrderStatus = {}));
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
})(eConektaOrderType || (eConektaOrderType = {}));
|
|
2337
|
+
// export enum eConektaOrderType {
|
|
2338
|
+
// REFERENCE = "REFERENCE",
|
|
2339
|
+
// SPEI = "SPEI",
|
|
2340
|
+
// }
|
|
2211
2341
|
|
|
2212
2342
|
var EnumDynamicClientStatus;
|
|
2213
2343
|
(function (EnumDynamicClientStatus) {
|
|
@@ -2226,38 +2356,6 @@ var eNotificationType;
|
|
|
2226
2356
|
eNotificationType["PAYMENT"] = "payment";
|
|
2227
2357
|
})(eNotificationType || (eNotificationType = {}));
|
|
2228
2358
|
|
|
2229
|
-
var eProcessStatus;
|
|
2230
|
-
(function (eProcessStatus) {
|
|
2231
|
-
eProcessStatus["IDLE"] = "IDLE";
|
|
2232
|
-
eProcessStatus["ERROR"] = "ERROR";
|
|
2233
|
-
eProcessStatus["CANCELED"] = "CANCELED";
|
|
2234
|
-
eProcessStatus["COMPLETE"] = "COMPLETE";
|
|
2235
|
-
eProcessStatus["PROCESSING"] = "PROCESSING";
|
|
2236
|
-
eProcessStatus["WAITING"] = "WAITING";
|
|
2237
|
-
})(eProcessStatus || (eProcessStatus = {}));
|
|
2238
|
-
var eRequestVerb;
|
|
2239
|
-
(function (eRequestVerb) {
|
|
2240
|
-
eRequestVerb["POST"] = "POST";
|
|
2241
|
-
eRequestVerb["GET"] = "GET";
|
|
2242
|
-
eRequestVerb["PATCH"] = "PATCH";
|
|
2243
|
-
eRequestVerb["DELETE"] = "DELETE";
|
|
2244
|
-
})(eRequestVerb || (eRequestVerb = {}));
|
|
2245
|
-
var eGCActions;
|
|
2246
|
-
(function (eGCActions) {
|
|
2247
|
-
eGCActions["Create"] = "Create";
|
|
2248
|
-
eGCActions["Update"] = "Update";
|
|
2249
|
-
eGCActions["Remove"] = "Remove";
|
|
2250
|
-
eGCActions["LoginTime"] = "UpdateLogIn";
|
|
2251
|
-
})(eGCActions || (eGCActions = {}));
|
|
2252
|
-
var eOrderType;
|
|
2253
|
-
(function (eOrderType) {
|
|
2254
|
-
eOrderType["DYNAMIC_REFERENCE"] = "DYNAMIC_REFERENCE";
|
|
2255
|
-
eOrderType["DYNAMIC_SPEI"] = "DYNAMIC_SPEI";
|
|
2256
|
-
eOrderType["CONEKTA_REFERENCE"] = "CONEKTA_REFERENCE";
|
|
2257
|
-
eOrderType["CONEKTA_SPEI"] = "CONEKTA_SPEI";
|
|
2258
|
-
eOrderType["PASSPORT_REFERENCE"] = "PASSPORT_REFERENCE";
|
|
2259
|
-
})(eOrderType || (eOrderType = {}));
|
|
2260
|
-
|
|
2261
2359
|
var eVerificationStep;
|
|
2262
2360
|
(function (eVerificationStep) {
|
|
2263
2361
|
eVerificationStep["IDLE"] = "IDLE";
|
|
@@ -2290,5 +2388,5 @@ var eVerificationChannel;
|
|
|
2290
2388
|
* Generated bundle index. Do not edit.
|
|
2291
2389
|
*/
|
|
2292
2390
|
|
|
2293
|
-
export { EnumDynamicClientStatus, ErrorMessages, FactoryBusiness, FactoryClient, FactoryConekta, FactoryContract, FactoryDynamiCore, FactoryNotification, FactoryPassport, FactoryPayment, IndexedDbService, ROLES_KEY, ROUTE_GLOBAL_REFERENCE2, ROUTE_NOTIFICATIONS, RavcreditLibComponent, RavcreditLibService, TIME_FORMAT_TABLE, UtilGeneral, UtilTime, UtilsHttp, cAddress, cAuthConfig, cBusinessConfig, cBusinessDeadlines, cBusinessInfo, cClient, cClientBase, cClientConekta, cClientContract, cClientDynamicStatus, cConektaRecurrent, cContract, cContractMetrics, cDaySchedule, cDefinedSchedule, cDevice, cEmptyDay, cFinancial, cIDCCharge, cIDCCustomer, cIDCDataPii, cIDCGeneratedReference, cIDCPayment, cMediaIdentity, cNotification, cOptionsClientStatus, cOxxoRecurrentSources, cOxxoRecurrentSourcesData, cPaymentDelay, cResponse, cSchedule, cScore, cScoreAddress, cScoreGeneral, cScoreHit, cSingleOptionClientStatus, cTopic, cTyClientContract, cUserReference, dateCompleteFormat, dateFormat, dateFormatSimple, dbAuthStore, dbBusinessConfig, dbBusinessInfo, dbClientsStore, dbConektaClientsStore, dbConektaReferencesStore, dbConektaSpeiStore, 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,
|
|
2391
|
+
export { EnumDynamicClientStatus, ErrorMessages, FactoryBusiness, FactoryClient, FactoryConekta, FactoryContract, FactoryDynamiCore, FactoryNotification, FactoryPassport, FactoryPayment, IndexedDbService, ROLES_KEY, ROUTE_GLOBAL_REFERENCE2, ROUTE_NOTIFICATIONS, RavcreditLibComponent, RavcreditLibService, RouteData, TIME_FORMAT_TABLE, UtilGeneral, UtilTime, UtilsHttp, cAddress, cAuthConfig, cBusinessConfig, cBusinessDeadlines, cBusinessInfo, cClient, cClientBase, cClientConekta, cClientContract, cClientDynamicStatus, cConektaRecurrent, cContract, cContractMetrics, cDaySchedule, cDefinedSchedule, cDevice, cEmptyDay, cFinancial, cIDCCharge, cIDCCustomer, cIDCDataPii, cIDCGeneratedReference, cIDCPayment, cMediaIdentity, cNotification, cOptionsClientStatus, cOxxoRecurrentSources, cOxxoRecurrentSourcesData, cPaymentDelay, cResponse, cResponseError, cResponseErrorData, cSchedule, cScore, cScoreAddress, cScoreGeneral, cScoreHit, cSingleOptionClientStatus, cTopic, cTyClientContract, cUserReference, dateCompleteFormat, dateFormat, dateFormatSimple, dbAuthStore, dbBusinessConfig, dbBusinessInfo, dbClientsStore, dbConektaClientsStore, dbConektaReferencesStore, dbConektaSpeiStore, 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, eConektaRes, eContractStatus, eContractSteps, eDestinationType, eEmailType, eGCActions, eIdentityTypes, eLoginStatus, eNotificationType, eOrderType, ePassportTypes, ePaymentType, eProcessStatus, eProvider, eReferenceStatusRav, eRequestVerb, eRoles, eRolesSelect, eVerificationChannel, eVerificationStatus, eVerificationStep, emailContact, expiredPayment, keyPathId, keyUserID, ravCreditFunctions, snackBarConfigAction, snackBarConfigNoAction, snackBarConfigNoActionLong, timeFormat, timeFormatTable, week };
|
|
2294
2392
|
//# sourceMappingURL=ravcredit-lib.mjs.map
|