ravcredit-lib 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -31,6 +31,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
31
31
  ` }]
32
32
  }] });
33
33
 
34
+ const cAddress = {
35
+ street: "",
36
+ city: "",
37
+ neighbor: "",
38
+ zip: "",
39
+ ext: "",
40
+ int: "",
41
+ state: ""
42
+ };
43
+
34
44
  var eConektaRes;
35
45
  (function (eConektaRes) {
36
46
  eConektaRes["CUSTOMER_CREATED"] = "customer.created";
@@ -351,17 +361,6 @@ class FactoryClient {
351
361
  }
352
362
  }
353
363
 
354
- // TODO **************************************** DELETE
355
- const cAddress$1 = {
356
- street: "",
357
- city: "",
358
- neighbor: "",
359
- zip: "",
360
- ext: "",
361
- int: "",
362
- state: ""
363
- };
364
- // TODO **************************************** DELETE
365
364
  const cSchedule = {
366
365
  day: "",
367
366
  open: 0,
@@ -385,7 +384,7 @@ const cDefinedSchedule = [
385
384
  const cBusinessInfo = {
386
385
  version: "v2024",
387
386
  name: "",
388
- address: cAddress$1,
387
+ address: cAddress,
389
388
  phones: [],
390
389
  email: "",
391
390
  };
@@ -413,7 +412,7 @@ class FactoryBusiness {
413
412
  if (info)
414
413
  data = info;
415
414
  if (!info?.address)
416
- data.address = cAddress$1;
415
+ data.address = cAddress;
417
416
  return {
418
417
  name: new UntypedFormControl(data.name, Validators.required),
419
418
  email: new UntypedFormControl(data.email, [Validators.required, Validators.email]),
@@ -443,7 +442,7 @@ class FactoryBusiness {
443
442
  };
444
443
  }
445
444
  static CreateBusinessInfoObj(data) {
446
- const address = cAddress$1;
445
+ const address = cAddress;
447
446
  const schedule = {
448
447
  monday: {},
449
448
  tuesday: {},
@@ -563,15 +562,6 @@ const cFinancial = {
563
562
  commission_opening: 0,
564
563
  interest_arrears: 0,
565
564
  };
566
- const cAddress = {
567
- street: "",
568
- city: "",
569
- neighbor: "",
570
- zip: "",
571
- ext: "",
572
- int: "",
573
- state: ""
574
- };
575
565
  const cContract = {
576
566
  id: "",
577
567
  client: "",
@@ -991,6 +981,297 @@ var ePassportTypes;
991
981
  })(ePassportTypes || (ePassportTypes = {}));
992
982
  /** ******************************** */
993
983
 
984
+ var eReferenceStatusRav;
985
+ (function (eReferenceStatusRav) {
986
+ eReferenceStatusRav["Disponible"] = "Disponible";
987
+ eReferenceStatusRav["Active"] = "Activo con credito vigente";
988
+ eReferenceStatusRav["ActiveEnded"] = "Activo sin credito vigente";
989
+ eReferenceStatusRav["Registered"] = "Registrado";
990
+ eReferenceStatusRav["NonRegistered"] = "No registrado";
991
+ eReferenceStatusRav["NonVerified"] = "No verificado";
992
+ eReferenceStatusRav["Rejected"] = "Rechazado";
993
+ eReferenceStatusRav["Pending"] = "Pendiente";
994
+ })(eReferenceStatusRav || (eReferenceStatusRav = {}));
995
+ var eAccountDynamicStatus;
996
+ (function (eAccountDynamicStatus) {
997
+ eAccountDynamicStatus["OK"] = "Con cuenta activa";
998
+ eAccountDynamicStatus["NOK"] = "Sin cuenta activa";
999
+ })(eAccountDynamicStatus || (eAccountDynamicStatus = {}));
1000
+ //
1001
+ // export enum eAccountDynamicRegister {
1002
+ // "Active" = "Activo", // Ok
1003
+ // "NonAuthorized" = "No autorizado",
1004
+ // "Authorized" = "Autorizado", // Non ref
1005
+ // "Accepted" = "Aceptado", // Non ref
1006
+ // "Rejected" = "Rechazado", // Non ref
1007
+ // "Pending" = "Pendiente", // Non ref
1008
+ // "NotFound" = "No registrado"
1009
+ // }
1010
+ var eClientDynamicStatus;
1011
+ (function (eClientDynamicStatus) {
1012
+ eClientDynamicStatus["Active"] = "Active";
1013
+ eClientDynamicStatus["Pending"] = "Pending";
1014
+ eClientDynamicStatus["Accepted"] = "Accepted";
1015
+ eClientDynamicStatus["Rejected"] = "Rejected";
1016
+ eClientDynamicStatus["approved"] = "Aprobado";
1017
+ })(eClientDynamicStatus || (eClientDynamicStatus = {}));
1018
+ const cClientDynamicStatus = {
1019
+ Active: {
1020
+ value: "Active",
1021
+ viewValue: "Activo"
1022
+ },
1023
+ Pending: {
1024
+ value: "Pending",
1025
+ viewValue: "Pendiente"
1026
+ },
1027
+ Accepted: {
1028
+ value: "Accepted",
1029
+ viewValue: "Pre autorizado"
1030
+ },
1031
+ Rejected: {
1032
+ value: "Rejected",
1033
+ viewValue: "Rechazado"
1034
+ },
1035
+ Idle: {
1036
+ value: "Idle",
1037
+ viewValue: ""
1038
+ },
1039
+ };
1040
+ var eContractSteps;
1041
+ (function (eContractSteps) {
1042
+ eContractSteps["idle"] = "idle";
1043
+ eContractSteps["general"] = "General";
1044
+ eContractSteps["address"] = "Address";
1045
+ eContractSteps["device"] = "Device";
1046
+ eContractSteps["financial"] = "Financial";
1047
+ eContractSteps["app"] = "App";
1048
+ })(eContractSteps || (eContractSteps = {}));
1049
+ const cIDCDataPii = {
1050
+ icc: "",
1051
+ rfc: "",
1052
+ sex: "",
1053
+ city: "",
1054
+ curp: "",
1055
+ days: "",
1056
+ imei: "",
1057
+ name: "",
1058
+ step: "",
1059
+ term: "",
1060
+ brand: "",
1061
+ email: "",
1062
+ model: "",
1063
+ phone: "",
1064
+ score: "",
1065
+ state: "",
1066
+ amount: "",
1067
+ colony: "",
1068
+ period: "",
1069
+ street: "",
1070
+ ticket: "",
1071
+ num_ext: "",
1072
+ num_int: "",
1073
+ zipcode: "",
1074
+ evidence: "",
1075
+ financed: "",
1076
+ house_is: "",
1077
+ lastname: "",
1078
+ type_job: "",
1079
+ birthdate: "",
1080
+ birthstate: "",
1081
+ dicio_data: "",
1082
+ dicio_step: "",
1083
+ secondname: "",
1084
+ nationality: "",
1085
+ seller_name: "",
1086
+ down_payment: "",
1087
+ municipality: "",
1088
+ score_no_hit: "",
1089
+ study_degree: "",
1090
+ branch_office: "",
1091
+ identity_data: "",
1092
+ interest_rate: "",
1093
+ score_interno: "",
1094
+ marital_status: "",
1095
+ monthly_income: "",
1096
+ motherlastname: "",
1097
+ score_rcc_fico: "",
1098
+ identity_selfie: "",
1099
+ amount_by_period: "",
1100
+ identity_id_back: "",
1101
+ proof_of_address: "",
1102
+ identity_id_front: "",
1103
+ economic_dependents: "",
1104
+ identity_id_request: "",
1105
+ identity_verification: "",
1106
+ is_address_ine_currently_live: "",
1107
+ fotografia_del_cliente_con_el_equipo: "",
1108
+ estado: "",
1109
+ gender: ""
1110
+ };
1111
+ /**
1112
+ * Base customer for create customer with DynamiCore provider
1113
+ * */
1114
+ const cIDCCustomer = {
1115
+ pii: cIDCDataPii,
1116
+ client_type: 662
1117
+ };
1118
+ const cIDCPayment = {
1119
+ operation: 98,
1120
+ account: "",
1121
+ date: "",
1122
+ amount: 0,
1123
+ dst_account: "",
1124
+ reference: ""
1125
+ };
1126
+ const cIDCCharge = {
1127
+ barcode_url: "",
1128
+ currency: "",
1129
+ expires_at: 0,
1130
+ object: "",
1131
+ quantity: 0,
1132
+ reference: "",
1133
+ service_name: "",
1134
+ store_name: "",
1135
+ type: "",
1136
+ unit_price: 0
1137
+ };
1138
+ const cIDCGeneratedReference = {
1139
+ account: 0,
1140
+ active: 0,
1141
+ amount: 0,
1142
+ channel: "",
1143
+ charge: cIDCCharge,
1144
+ company: 0,
1145
+ id: "",
1146
+ operation: 0
1147
+ };
1148
+ /**
1149
+ * Common Factory Dynamic
1150
+ * */
1151
+ class FactoryDynamiCore {
1152
+ static CreateReferenceBody(client, contract, dateTime) {
1153
+ const customerInfo = {
1154
+ name: client.name,
1155
+ email: client.email,
1156
+ phone: client.phone,
1157
+ };
1158
+ const customerItems = {
1159
+ name: "Referencia Oxxo",
1160
+ unit_price: contract.financial.weeklyPayment,
1161
+ quantity: 1
1162
+ };
1163
+ const paymentMethod = {
1164
+ type: "oxxo_cash"
1165
+ };
1166
+ if (!client.dynamic_account)
1167
+ return null;
1168
+ const body = {
1169
+ id: client.id,
1170
+ data: {
1171
+ account: Number(client.dynamic_account),
1172
+ operation: 98,
1173
+ customer_info: customerInfo,
1174
+ items: customerItems,
1175
+ payment_method: paymentMethod
1176
+ }
1177
+ };
1178
+ if (dateTime != undefined)
1179
+ body.date = dateTime;
1180
+ return body;
1181
+ }
1182
+ static CreateEmptyCustomer() {
1183
+ return cIDCCustomer;
1184
+ }
1185
+ static CreateCustomerFromOClient(client, contract) {
1186
+ const o = cIDCCustomer;
1187
+ o.pii.email = client.email;
1188
+ o.pii.name = client.name;
1189
+ o.pii.curp = client.curp;
1190
+ o.pii.phone = client.phone;
1191
+ o.pii.amount = String(contract.financial.total);
1192
+ o.pii.financed = String(contract.financial.financed);
1193
+ o.pii.amount_by_period = String(contract.financial.weeklyPayment);
1194
+ o.pii.zipcode = contract.address.zip;
1195
+ o.pii.street = contract.address.street;
1196
+ o.pii.city = contract.address.city;
1197
+ o.pii.state = contract.address.state;
1198
+ o.pii.colony = contract.address.neighbor;
1199
+ o.pii.num_ext = contract.address.ext;
1200
+ return o;
1201
+ }
1202
+ static CreateDynamicCredit(client, contract, clientDynamic) {
1203
+ const properties = {
1204
+ start_date: "",
1205
+ principal_disbursed: 0,
1206
+ expected_disbursed: 0,
1207
+ amount_commission_opening: 0
1208
+ };
1209
+ const config = {
1210
+ contract: `FP-${client.name}`,
1211
+ credit_type: "Arrendamiento",
1212
+ interest_rate: 528,
1213
+ installments: 0,
1214
+ periodicity: "WEEK",
1215
+ interest_base: "ACT/ACT",
1216
+ commission_opening: 40,
1217
+ financed_amount: contract.financial.financed,
1218
+ interest_arrears: 0
1219
+ };
1220
+ if (!client.dynamic_account)
1221
+ return null;
1222
+ return {
1223
+ id: Number(client.dynamic_account),
1224
+ group: clientDynamic.group,
1225
+ company: clientDynamic.company,
1226
+ client: clientDynamic.id,
1227
+ created_at: "",
1228
+ currency: "484",
1229
+ status: "pending",
1230
+ properties: properties,
1231
+ product: 1756,
1232
+ enabled: "1",
1233
+ config: config,
1234
+ amount: 0,
1235
+ type: "liabilities",
1236
+ identifier: null,
1237
+ start_at: null
1238
+ };
1239
+ }
1240
+ static CreatePayment(contract, clientDynamic) {
1241
+ return {
1242
+ account: String(clientDynamic.id),
1243
+ amount: contract.financial.weeklyPayment,
1244
+ date: "",
1245
+ dst_account: String(clientDynamic.id),
1246
+ external_id: "",
1247
+ extras: {},
1248
+ operation: 98,
1249
+ reference: ""
1250
+ };
1251
+ }
1252
+ static getNextDateTime() {
1253
+ const now = new Date();
1254
+ const nextDateTime = new Date(now.getTime() + 1000); // Add 1 second as an example
1255
+ const year = nextDateTime.getFullYear();
1256
+ const month = String(nextDateTime.getMonth() + 1).padStart(2, '0');
1257
+ const day = String(nextDateTime.getDate()).padStart(2, '0');
1258
+ const hours = String(nextDateTime.getHours()).padStart(2, '0');
1259
+ const minutes = String(nextDateTime.getMinutes()).padStart(2, '0');
1260
+ const seconds = String(nextDateTime.getSeconds()).padStart(2, '0');
1261
+ return `${year}-${month}-${day}T${hours}:${minutes}:${seconds}`;
1262
+ }
1263
+ static getIsoDate() {
1264
+ const now = new Date();
1265
+ return now.toISOString();
1266
+ }
1267
+ static FormPayment(contract, account) {
1268
+ let data = FactoryDynamiCore.CreatePayment(contract, account);
1269
+ return {
1270
+ amount: new UntypedFormControl(data.amount, [Validators.required, Validators.min(0)]),
1271
+ };
1272
+ }
1273
+ }
1274
+
994
1275
  /*
995
1276
  * Public API Surface of ravcredit-lib
996
1277
  */
@@ -999,5 +1280,5 @@ var ePassportTypes;
999
1280
  * Generated bundle index. Do not edit.
1000
1281
  */
1001
1282
 
1002
- export { RavcreditLibComponent, RavcreditLibService, cAuthConfig, cConektaRecurrent, cNotification, cOptionsClientStatus, cOxxoRecurrentSources, cOxxorecurrentSourcesData, cPaymentDalay, cSingleOptionClientStatus, cTopic, cTyClientContract, eAuthActions, eAuthType, eClientStatus, eConektaOrderStatus, eConektaRes, eLoginStatus, eNotificationType, ePassportTypes, eProcessStatus, eRoles, eRolesSelect, snackBarConfigAction, snackBarConfigNoAction };
1283
+ export { FactoryBusiness, FactoryClient, FactoryContract, FactoryDynamiCore, RavcreditLibComponent, RavcreditLibService, cAddress, cAuthConfig, cBusinessConfig, cBusinessDeadlines, cBusinessInfo, cClient, cClientConekta, cClientContract, cClientDynamicStatus, cConektaRecurrent, cContract, cDefinedSchedule, cDevice, cEmptyDay, cFinancial, cIDCCharge, cIDCCustomer, cIDCDataPii, cIDCGeneratedReference, cIDCPayment, cNotification, cOptionsClientStatus, cOxxoRecurrentSources, cOxxorecurrentSourcesData, cPaymentDalay, cSchedule, cSingleOptionClientStatus, cTopic, cTyClientContract, cUserReference, eAccountDynamicStatus, eAuthActions, eAuthType, eClientDynamicStatus, eClientStatus, eConektaOrderStatus, eConektaRes, eContractSteps, eLoginStatus, eNotificationType, ePassportTypes, eProcessStatus, eProvider, eReferenceStatusRav, eRoles, eRolesSelect, snackBarConfigAction, snackBarConfigNoAction, week };
1003
1284
  //# sourceMappingURL=ravcredit-lib.mjs.map