ravcredit-core 0.0.5 → 0.0.7

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/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ export * from "./lib/v1/objects/oAddress.js";
2
2
  export * from "./lib/v1/objects/oBusiness.js";
3
3
  export * from "./lib/v1/objects/oClientBase.js";
4
4
  export * from "./lib/v1/objects/oConekta.js";
5
- export * from "./lib/v1/objects/oContract.js";
5
+ export * from "./lib/v1/objects/oContractBase.js";
6
6
  export * from "./lib/v1/objects/oContractAll.js";
7
7
  export * from "./lib/v1/objects/oDevice.js";
8
8
  export * from "./lib/v1/objects/oFinancial.js";
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ export * from "./lib/v1/objects/oAddress.js";
3
3
  export * from "./lib/v1/objects/oBusiness.js";
4
4
  export * from "./lib/v1/objects/oClientBase.js";
5
5
  export * from "./lib/v1/objects/oConekta.js";
6
- export * from "./lib/v1/objects/oContract.js";
6
+ export * from "./lib/v1/objects/oContractBase.js";
7
7
  export * from "./lib/v1/objects/oContractAll.js";
8
8
  export * from "./lib/v1/objects/oDevice.js";
9
9
  export * from "./lib/v1/objects/oFinancial.js";
@@ -0,0 +1,23 @@
1
+ import { oAddress } from "./oAddress.js";
2
+ import { oDevice } from "./oDevice.js";
3
+ import { oFinancial } from "./oFinancial.js";
4
+ export interface iContract {
5
+ createContract(data: any, monthlyPay: number, finalPayment: number): Promise<void>;
6
+ editContract(): void;
7
+ verifyClient(clientCurp: string): Promise<void>;
8
+ dataClient(client: string): void;
9
+ referenceAdded(reference: number): Promise<void>;
10
+ }
11
+ export interface oContractBase {
12
+ id: string;
13
+ dynamicAccount?: number;
14
+ client: string;
15
+ address: oAddress;
16
+ device: oDevice;
17
+ financial: oFinancial;
18
+ createdAt?: number;
19
+ lastPayment?: number;
20
+ by: string;
21
+ active: boolean;
22
+ photo?: string;
23
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,10 +1,10 @@
1
- import { oContract } from "./oContract.js";
1
+ import { oContractBase } from "./oContractBase.js";
2
2
  import { oClientBase } from "./oClientBase.js";
3
3
  export interface iNewPayment {
4
4
  getContract(): Promise<void>;
5
- getContractApi(): Promise<oContract>;
6
- getClient(contract: oContract): Promise<void>;
7
- getClientApi(contract: oContract): Promise<oClientBase>;
5
+ getContractApi(): Promise<oContractBase>;
6
+ getClient(contract: oContractBase): Promise<void>;
7
+ getClientApi(contract: oContractBase): Promise<oClientBase>;
8
8
  getParams(): Promise<void>;
9
9
  getAccount(): Promise<boolean>;
10
10
  createPayment(): Promise<string>;
@@ -1,4 +1,4 @@
1
- import { oContract } from "./oContract.js";
1
+ import { oContractBase } from "./oContractBase.js";
2
2
  export interface iPassportAdditional {
3
3
  client?: string;
4
4
  clientID?: string;
@@ -19,7 +19,7 @@ export interface iPassportReference {
19
19
  /** Global passport reference aPI */
20
20
  export interface iGlobalPassport {
21
21
  passport: iPassportReference;
22
- contract: oContract;
22
+ contract: oContractBase;
23
23
  date?: number;
24
24
  }
25
25
  /** ******************************** */
@@ -1,12 +1,12 @@
1
1
  import { oClient } from "../objects/oClient.js";
2
2
  import { iConektaRecurrent } from "../../v1/objects/oConekta.js";
3
- import { oContract } from "../../v1/objects/oContract.js";
3
+ import { oContractBase } from "../../v1/objects/oContractBase.js";
4
4
  export interface oClientConekta {
5
5
  ravcredit: oClient;
6
6
  conekta: iConektaRecurrent;
7
7
  }
8
8
  export interface iClientContract {
9
9
  client: oClient;
10
- contract: oContract;
10
+ contract: oContractBase;
11
11
  }
12
12
  export declare const cClientContract: iClientContract;
@@ -1,5 +1,4 @@
1
- import { cClient } from "./constants.js";
2
- import { cContract } from "./cContract.js";
1
+ import { cClient, cContract } from "./constants.js";
3
2
  export const cClientContract = {
4
3
  client: cClient,
5
4
  contract: cContract,
@@ -1,6 +1,5 @@
1
1
  import { oFinancial } from "../../v1/objects/oFinancial.js";
2
2
  import { oDevice } from "../../v1/objects/oDevice.js";
3
- import { oContract } from "../../v1/objects/oContract.js";
4
3
  export declare enum eProvider {
5
4
  none = "",
6
5
  Conekta = "Conekta",
@@ -9,4 +8,3 @@ export declare enum eProvider {
9
8
  }
10
9
  export declare const cDevice: oDevice;
11
10
  export declare const cFinancial: oFinancial;
12
- export declare const cContract: oContract;
@@ -1,4 +1,3 @@
1
- import { cAddress } from "./cAddress.js";
2
1
  import { cBusinessDeadlines } from "./cBusiness.js";
3
2
  export var eProvider;
4
3
  (function (eProvider) {
@@ -32,12 +31,13 @@ export const cFinancial = {
32
31
  commission_opening: 0,
33
32
  interest_arrears: 0,
34
33
  };
35
- export const cContract = {
36
- id: "",
37
- client: "",
38
- address: cAddress,
39
- device: cDevice,
40
- financial: cFinancial,
41
- by: "",
42
- active: true
43
- };
34
+ //
35
+ // export const cContract: oContractBase = {
36
+ // id: "",
37
+ // client: "",
38
+ // address: cAddress,
39
+ // device: cDevice,
40
+ // financial: cFinancial,
41
+ // by: "",
42
+ // active: true
43
+ // }
@@ -4,11 +4,16 @@ import { iAuthConfig } from "../../v1/objects/oLogIn.js";
4
4
  import { oDaySchedule } from "../../v1/objects/oBusiness.js";
5
5
  import { oResponse } from "../objects/oHttp.js";
6
6
  import { oClientBase } from "../../v1/objects/oClientBase.js";
7
- import { oScore, oScoreAddress, oScoreGeneral, oScoreHit } from "../objects/oScore.js";
7
+ import { oScore, oScoreAddress, oScoreGeneral, oScoreHit, oScoreReference } from "../objects/oScore.js";
8
8
  import { oClient, oUserReference } from "../objects/oClient.js";
9
9
  import { oMediaIdentity } from "../objects/oMedia.js";
10
10
  import { oClientConekta } from "./cClient.js";
11
11
  import { cAddress } from "./cAddress.js";
12
+ import { oContract } from "../objects/oContract.js";
13
+ import { oAsset, oAssetBrand, oAssetCategory } from "../objects/oAsset.js";
14
+ import { oCatalog } from "../objects/oCatalog.js";
15
+ import { oCompany } from "../objects/oCompany.js";
16
+ import { eContractStatus } from "../enum/EnumContract.js";
12
17
  export { cAddress };
13
18
  export declare const cSingleOptionClientStatus: iOptionsSelect;
14
19
  export declare const cOptionsClientStatus: iOptionsSelect[];
@@ -27,12 +32,28 @@ export declare const cScoreGeneral: oScoreGeneral;
27
32
  export declare const cScore: oScore;
28
33
  export declare const cMediaIdentity: oMediaIdentity;
29
34
  export declare const cClient: oClient;
35
+ export declare const cAssetCategory: oAssetCategory;
36
+ export declare const cAssetBrand: oAssetBrand;
37
+ export declare const cCatalog: oCatalog;
38
+ export declare const cScoreReference: oScoreReference;
39
+ export declare const cAsset: oAsset;
40
+ export declare const cCompany: oCompany;
41
+ export declare const cContract: oContract;
30
42
  export declare const cUserReference: oUserReference;
31
43
  export declare const cClientConekta: oClientConekta;
32
44
  export declare const cResponseErrorData: oResponse;
33
45
  export declare const emailContact = "contact@ravcredit.com";
34
46
  export declare const cResponseError: oResponse;
35
47
  export declare const cTyClientContract: {
48
+ company: oCompany;
49
+ status: eContractStatus;
50
+ asset: oAsset;
51
+ amortization_id?: string;
52
+ mediaSelfie?: oMediaIdentity;
53
+ mediaAddress?: oMediaIdentity;
54
+ mediaWithDevice?: oMediaIdentity;
55
+ mediaSelfieBack?: oMediaIdentity;
56
+ identityVerification?: import("../enum/EnumVerification.js").eVerificationStep;
36
57
  id: string;
37
58
  dynamicAccount?: number;
38
59
  client: string;
@@ -46,13 +67,8 @@ export declare const cTyClientContract: {
46
67
  photo?: string;
47
68
  score: oScore;
48
69
  seller_id?: string;
49
- scoreNoHit?: import("../objects/oScore.js").oScoreNoHit;
50
70
  study_degree?: string;
51
- mediaSelfie?: oMediaIdentity;
52
- mediaAddress?: oMediaIdentity;
53
- mediaWithDevice?: oMediaIdentity;
54
- mediaSelfieBack?: oMediaIdentity;
55
- identityVerification?: import("../enum/EnumVerification.js").eVerificationStep;
71
+ scoreNoHit?: import("../objects/oScore.js").oScoreNoHit;
56
72
  name: string;
57
73
  username: string;
58
74
  password?: string;
@@ -74,5 +90,4 @@ export declare const cTyClientContract: {
74
90
  token?: string;
75
91
  userReferences: import("../../v1/objects/oClientBase.js").oUserReferenceBase[];
76
92
  contractUrl?: string;
77
- status: string;
78
93
  };
@@ -1,8 +1,9 @@
1
1
  import { eClientStatus, eIdentityTypes } from "../enum/EnumClient.js";
2
2
  import { eRoles } from "../enum/EnumRoles.js";
3
3
  import { HttpStatus } from "../enum/EnumHttpStatus.js";
4
- import { cContract } from "./cContract.js";
5
4
  import { cAddress } from "./cAddress.js";
5
+ import { cDevice, cFinancial } from "./cContract.js";
6
+ import { eContractStatus } from "../enum/EnumContract.js";
6
7
  export { cAddress };
7
8
  export const cSingleOptionClientStatus = {
8
9
  viewValue: "",
@@ -131,7 +132,6 @@ export const cMediaIdentity = {
131
132
  };
132
133
  export const cClient = {
133
134
  score: cScore,
134
- mediaAddress: cMediaIdentity,
135
135
  id: "",
136
136
  name: "",
137
137
  username: "",
@@ -143,6 +143,60 @@ export const cClient = {
143
143
  userReferences: [],
144
144
  status: ""
145
145
  };
146
+ export const cAssetCategory = {
147
+ name: "",
148
+ id: "",
149
+ createAt: 0
150
+ };
151
+ export const cAssetBrand = {
152
+ name: "",
153
+ id: "",
154
+ description: ""
155
+ };
156
+ export const cCatalog = {
157
+ name: "",
158
+ description: "",
159
+ id: "",
160
+ createdAt: 0
161
+ };
162
+ export const cScoreReference = {
163
+ name: "",
164
+ score: 0
165
+ };
166
+ export const cAsset = {
167
+ name: "",
168
+ id: "",
169
+ createAt: 0,
170
+ category: cAssetCategory,
171
+ brand: cAssetBrand,
172
+ price: 0,
173
+ model: "",
174
+ imageUrl: [],
175
+ paymentOption: [],
176
+ catalog: cCatalog,
177
+ offers: [],
178
+ score: cScoreReference,
179
+ IMEI: ""
180
+ };
181
+ export const cCompany = {
182
+ name: "",
183
+ id: "",
184
+ rfc: "",
185
+ taxRegime: "",
186
+ address: cAddress
187
+ };
188
+ export const cContract = {
189
+ active: false,
190
+ address: cAddress,
191
+ asset: cAsset,
192
+ by: "",
193
+ client: "",
194
+ company: cCompany,
195
+ device: cDevice,
196
+ financial: cFinancial,
197
+ id: "",
198
+ status: eContractStatus.STARTING
199
+ };
146
200
  export const cUserReference = {
147
201
  name: "",
148
202
  phone: "",
@@ -3,5 +3,6 @@ export declare enum eContractStatus {
3
3
  DENIED = "DENIED",
4
4
  CANCELED = "CANCELED",
5
5
  PENDING = "PENDING",
6
- CHECKING = "CHECKING"
6
+ CHECKING = "CHECKING",
7
+ STARTING = "STARTING"
7
8
  }
@@ -5,4 +5,5 @@ export var eContractStatus;
5
5
  eContractStatus["CANCELED"] = "CANCELED";
6
6
  eContractStatus["PENDING"] = "PENDING";
7
7
  eContractStatus["CHECKING"] = "CHECKING";
8
+ eContractStatus["STARTING"] = "STARTING";
8
9
  })(eContractStatus || (eContractStatus = {}));
@@ -19,3 +19,7 @@ export interface AmortizationItem {
19
19
  finalBalance: number;
20
20
  status: AmortizationStatus;
21
21
  }
22
+ export interface oAmortization {
23
+ id: string;
24
+ items: AmortizationItem[];
25
+ }
@@ -1,8 +1,6 @@
1
1
  import { eOrderType } from "../enum/EnumUtil.js";
2
2
  import { oClientBase } from "../../v1/objects/oClientBase.js";
3
3
  import { oScore, oScoreNoHit } from "./oScore.js";
4
- import { oMediaIdentity } from "./oMedia.js";
5
- import { eVerificationStep } from "../enum/EnumVerification.js";
6
4
  export interface oClientPayments {
7
5
  date: number;
8
6
  dayPayment: number;
@@ -24,11 +22,6 @@ export interface oClientReferences {
24
22
  export interface oClient extends oClientBase {
25
23
  score: oScore;
26
24
  seller_id?: string;
27
- scoreNoHit?: oScoreNoHit;
28
25
  study_degree?: string;
29
- mediaSelfie?: oMediaIdentity;
30
- mediaAddress?: oMediaIdentity;
31
- mediaWithDevice?: oMediaIdentity;
32
- mediaSelfieBack?: oMediaIdentity;
33
- identityVerification?: eVerificationStep;
26
+ scoreNoHit?: oScoreNoHit;
34
27
  }
@@ -1,9 +1,17 @@
1
- import { oContract } from "../../v1/objects/oContract.js";
1
+ import { oContractBase } from "../../v1/objects/oContractBase.js";
2
2
  import { oCompany } from "./oCompany.js";
3
3
  import { oAsset } from "./oAsset.js";
4
4
  import { eContractStatus } from "../enum/EnumContract.js";
5
- export interface oContractV2 extends oContract {
5
+ import { oMediaIdentity } from "./oMedia.js";
6
+ import { eVerificationStep } from "../enum/EnumVerification.js";
7
+ export interface oContract extends oContractBase {
6
8
  company: oCompany;
7
9
  status: eContractStatus;
8
10
  asset: oAsset;
11
+ amortization_id?: string;
12
+ mediaSelfie?: oMediaIdentity;
13
+ mediaAddress?: oMediaIdentity;
14
+ mediaWithDevice?: oMediaIdentity;
15
+ mediaSelfieBack?: oMediaIdentity;
16
+ identityVerification?: eVerificationStep;
9
17
  }
@@ -1,9 +1,9 @@
1
- import { oContract } from "../../v1/objects/oContract.js";
1
+ import { oContractBase } from "../../v1/objects/oContractBase.js";
2
2
  import { oClient } from "./oClient.js";
3
3
  import { oConektaOrder } from "../../v1/objects/oConekta.js";
4
4
  import { IDCTxnRow } from "../constant/cDynamic.js";
5
5
  export type RoutingParams = {
6
- contract?: oContract;
6
+ contract?: oContractBase;
7
7
  client?: oClient;
8
8
  id?: string;
9
9
  external_id?: string;
@@ -1,7 +1,7 @@
1
1
  import { oClient } from "./oClient.js";
2
- import { oContract } from "../../v1/objects/oContract.js";
2
+ import { oContractBase } from "../../v1/objects/oContractBase.js";
3
3
  import { eRoles } from "../enum/EnumRoles.js";
4
- export type tyClientContract = oClient & oContract;
4
+ export type tyClientContract = oClient & oContractBase;
5
5
  export interface oContractMetrics {
6
6
  total: number;
7
7
  activated: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ravcredit-core",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {