ravcredit-lib 0.0.7 → 0.0.9
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 +13 -24
- 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 +35 -0
- package/src/lib/v1/dto/AddressDto.ts +27 -0
- package/src/lib/v1/dto/BusinessDeadlineDto.ts +9 -0
- package/src/lib/v1/dto/ConektaDto.ts +386 -0
- package/src/lib/v1/dto/ContractDto.ts +46 -0
- package/src/lib/v1/dto/CustomerDto.ts +47 -0
- package/src/lib/v1/dto/DeviceDto.ts +13 -0
- package/src/lib/v1/dto/DynamiCoreDto.ts +1017 -0
- package/src/lib/v1/dto/FinancialDto.ts +156 -0
- package/src/lib/v1/dto/PassportDto.ts +143 -0
- package/src/lib/v1/dto/PayLinkResDto.ts +144 -0
- package/src/lib/v1/dto/PayOrderResAlternaDto.ts +348 -0
- package/src/lib/v1/dto/PayOrderResOxxoDto.ts +254 -0
- package/src/lib/v1/dto/PaymentLinkDto.ts +161 -0
- package/src/lib/v1/dto/ScheduleDto.ts +17 -0
- package/src/lib/v1/dto/UserDto.ts +27 -0
- package/src/lib/v1/dto/WeekScheduleDTO.ts +46 -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 +19 -0
- package/src/lib/v1/objects/oBusiness.ts +112 -0
- package/src/lib/v1/objects/oClient.ts +46 -0
- package/src/lib/v1/objects/oConekta.ts +408 -0
- package/src/lib/v1/objects/oContract.ts +30 -0
- package/src/lib/v1/objects/oContractAll.ts +38 -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/oGlobal.ts +186 -0
- package/src/lib/v1/objects/oLogIn.ts +43 -0
- package/src/lib/v1/objects/oNewPayment.ts +18 -0
- package/src/lib/v1/objects/oNotification.ts +34 -0
- package/src/lib/v1/objects/oPassport.ts +65 -0
- package/src/lib/v1/objects/oUser.ts +35 -0
- package/src/lib/v1/objects/oVerification.ts +48 -0
- package/src/lib/v1/util/UtilBusiness.ts +186 -0
- package/src/lib/v1/util/UtilClient.ts +285 -0
- package/src/lib/v1/util/UtilConekta.ts +97 -0
- package/src/lib/v1/util/UtilContract.ts +386 -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 +32 -0
- package/src/lib/v1/util/UtilPayment.ts +22 -0
- package/src/lib/v1/util/UtilTime.ts +181 -0
- package/src/lib/v1/util/UtilsHttp.ts +11 -0
- package/src/lib/v2/const/constants.ts +38 -0
- package/src/lib/v2/messaging/messaging.ts +10 -0
- package/src/public-api.ts +36 -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 -1982
- package/fesm2022/ravcredit-lib.mjs.map +0 -1
- package/index.d.ts +0 -1601
package/ng-package.json
ADDED
package/package.json
CHANGED
|
@@ -1,24 +1,13 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "ravcredit-lib",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"peerDependencies": {
|
|
5
|
-
"@angular/common": "^20.0.0",
|
|
6
|
-
"@angular/core": "^20.0.0",
|
|
7
|
-
"idb": "^8.0.3"
|
|
8
|
-
},
|
|
9
|
-
"dependencies": {
|
|
10
|
-
"tslib": "^2.3.0"
|
|
11
|
-
},
|
|
12
|
-
"sideEffects": false
|
|
13
|
-
|
|
14
|
-
"typings": "index.d.ts",
|
|
15
|
-
"exports": {
|
|
16
|
-
"./package.json": {
|
|
17
|
-
"default": "./package.json"
|
|
18
|
-
},
|
|
19
|
-
".": {
|
|
20
|
-
"types": "./index.d.ts",
|
|
21
|
-
"default": "./fesm2022/ravcredit-lib.mjs"
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "ravcredit-lib",
|
|
3
|
+
"version": "0.0.9",
|
|
4
|
+
"peerDependencies": {
|
|
5
|
+
"@angular/common": "^20.0.0",
|
|
6
|
+
"@angular/core": "^20.0.0",
|
|
7
|
+
"idb": "^8.0.3"
|
|
8
|
+
},
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"tslib": "^2.3.0"
|
|
11
|
+
},
|
|
12
|
+
"sideEffects": false
|
|
13
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { RavcreditLibComponent } from './ravcredit-lib.component';
|
|
4
|
+
|
|
5
|
+
describe('RavcreditLibComponent', () => {
|
|
6
|
+
let component: RavcreditLibComponent;
|
|
7
|
+
let fixture: ComponentFixture<RavcreditLibComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
imports: [RavcreditLibComponent]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
|
|
15
|
+
fixture = TestBed.createComponent(RavcreditLibComponent);
|
|
16
|
+
component = fixture.componentInstance;
|
|
17
|
+
fixture.detectChanges();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should create', () => {
|
|
21
|
+
expect(component).toBeTruthy();
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Component({
|
|
4
|
+
selector: 'lib-ravcredit-lib',
|
|
5
|
+
standalone: true,
|
|
6
|
+
imports: [],
|
|
7
|
+
template: `
|
|
8
|
+
<p>
|
|
9
|
+
ravcredit-lib works!
|
|
10
|
+
</p>
|
|
11
|
+
`,
|
|
12
|
+
styles: ``
|
|
13
|
+
})
|
|
14
|
+
export class RavcreditLibComponent {
|
|
15
|
+
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { RavcreditLibService } from './ravcredit-lib.service';
|
|
4
|
+
|
|
5
|
+
describe('RavcreditLibService', () => {
|
|
6
|
+
let service: RavcreditLibService;
|
|
7
|
+
|
|
8
|
+
beforeEach(() => {
|
|
9
|
+
TestBed.configureTestingModule({});
|
|
10
|
+
service = TestBed.inject(RavcreditLibService);
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it('should be created', () => {
|
|
14
|
+
expect(service).toBeTruthy();
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export const keyUserID: string = "rc_uid"
|
|
2
|
+
export const dbVersion: number = 1
|
|
3
|
+
export const dbName: string = "RavCreditDB"
|
|
4
|
+
export const keyPathId: string = "id"
|
|
5
|
+
|
|
6
|
+
export const dbAuthStore: string = "authStore"
|
|
7
|
+
export const dbUsersStore: string = "usersStore"
|
|
8
|
+
export const dbContractsStore: string = "contractsStore"
|
|
9
|
+
export const dbClientsStore: string = "clientsStore"
|
|
10
|
+
export const dbBusinessInfo: string = "businessInfo"
|
|
11
|
+
export const dbBusinessConfig: string = "businessConfig"
|
|
12
|
+
export const dbConektaClientsStore: string = "conektaClientsStore"
|
|
13
|
+
export const dbConektaReferencesStore: string = "conektaReferencesStore"
|
|
14
|
+
export const dbPassportReferencesStore: string = "passportReferencesStore"
|
|
15
|
+
export const dbDynamicReferencesStore: string = "dynamicReferencesStore"
|
|
16
|
+
export const dbDynamicAccountStore: string = "dynamicAccountStore"
|
|
17
|
+
export const dbNotificationsStore: string = "notificationsStore"
|
|
18
|
+
export const dbPaymentsStore: string = "paymentsStore"
|
|
19
|
+
|
|
20
|
+
export const dbIndexAuth: string = "iAuth"
|
|
21
|
+
export const dbIndexUsers: string = "iUsers"
|
|
22
|
+
export const dbIndexContracts: string = "iContracts"
|
|
23
|
+
export const dbIndexClients: string = "iClients"
|
|
24
|
+
export const dbIndexBusiness: string = "iBusiness"
|
|
25
|
+
export const dbIndexConektaClients: string = "iConecktaClients"
|
|
26
|
+
export const dbIndexConektaClientsRef: string = "iConecktaClientsRef"
|
|
27
|
+
export const dbIndexPassportClientsRef: string = "iPassportClientsRef"
|
|
28
|
+
export const dbIndexNotification: string = "iNotification"
|
|
29
|
+
export const dbIndexPayments: string = "iNotification"
|
|
30
|
+
|
|
31
|
+
export const dateFormat = "EEEE, dd MMM yyyy"
|
|
32
|
+
export const dateCompleteFormat = "EEEE, dd MMM yyyy hh:mm aaaa"
|
|
33
|
+
export const timeFormat = "hh:mm aaaa"
|
|
34
|
+
|
|
35
|
+
export const expiredPayment = "expiredPayment"
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { IsOptional, IsString, MinLength } from 'class-validator';
|
|
2
|
+
|
|
3
|
+
export class AddressDto {
|
|
4
|
+
|
|
5
|
+
@IsString()
|
|
6
|
+
@MinLength(1)
|
|
7
|
+
street: string;
|
|
8
|
+
|
|
9
|
+
@IsString()
|
|
10
|
+
city: string;
|
|
11
|
+
|
|
12
|
+
@IsString()
|
|
13
|
+
neighbor: string;
|
|
14
|
+
|
|
15
|
+
@IsString()
|
|
16
|
+
zip: string;
|
|
17
|
+
|
|
18
|
+
@IsString()
|
|
19
|
+
ext: string;
|
|
20
|
+
|
|
21
|
+
@IsString()
|
|
22
|
+
@IsOptional()
|
|
23
|
+
int: string;
|
|
24
|
+
|
|
25
|
+
@IsString()
|
|
26
|
+
state: string;
|
|
27
|
+
}
|
|
@@ -0,0 +1,386 @@
|
|
|
1
|
+
import { IsArray, IsBoolean, IsNumber, IsObject, IsOptional, IsString, ValidateNested } from 'class-validator';
|
|
2
|
+
import { Type } from 'class-transformer';
|
|
3
|
+
|
|
4
|
+
export class ConektaResObjChargePaidDto {
|
|
5
|
+
@IsString()
|
|
6
|
+
id: string;
|
|
7
|
+
|
|
8
|
+
@IsBoolean()
|
|
9
|
+
livemode: boolean;
|
|
10
|
+
|
|
11
|
+
@IsNumber()
|
|
12
|
+
created_at: number;
|
|
13
|
+
|
|
14
|
+
@IsString()
|
|
15
|
+
currency: string;
|
|
16
|
+
|
|
17
|
+
@IsObject()
|
|
18
|
+
payment_method: any;
|
|
19
|
+
|
|
20
|
+
@IsString()
|
|
21
|
+
object: string;
|
|
22
|
+
|
|
23
|
+
@IsString()
|
|
24
|
+
description: string;
|
|
25
|
+
|
|
26
|
+
@IsString()
|
|
27
|
+
status: string;
|
|
28
|
+
|
|
29
|
+
@IsNumber()
|
|
30
|
+
amount: number;
|
|
31
|
+
|
|
32
|
+
@IsNumber()
|
|
33
|
+
paid_at: number;
|
|
34
|
+
|
|
35
|
+
@IsNumber()
|
|
36
|
+
fee: number;
|
|
37
|
+
|
|
38
|
+
@IsString()
|
|
39
|
+
customer_id: string;
|
|
40
|
+
|
|
41
|
+
@IsString()
|
|
42
|
+
order_id: string;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export class ConektaResObjOrderPaidDto {
|
|
46
|
+
@IsBoolean()
|
|
47
|
+
livemode: boolean;
|
|
48
|
+
|
|
49
|
+
@IsNumber()
|
|
50
|
+
amount: number;
|
|
51
|
+
|
|
52
|
+
@IsString()
|
|
53
|
+
currency: string;
|
|
54
|
+
|
|
55
|
+
@IsString()
|
|
56
|
+
payment_status: string;
|
|
57
|
+
|
|
58
|
+
@IsNumber()
|
|
59
|
+
amount_refunded: number;
|
|
60
|
+
|
|
61
|
+
@IsObject()
|
|
62
|
+
customer_info: any;
|
|
63
|
+
|
|
64
|
+
@IsString()
|
|
65
|
+
object: string;
|
|
66
|
+
|
|
67
|
+
@IsString()
|
|
68
|
+
id: string;
|
|
69
|
+
|
|
70
|
+
@IsObject()
|
|
71
|
+
metadata: any;
|
|
72
|
+
|
|
73
|
+
@IsBoolean()
|
|
74
|
+
is_refundable: boolean;
|
|
75
|
+
|
|
76
|
+
@IsNumber()
|
|
77
|
+
created_at: number;
|
|
78
|
+
|
|
79
|
+
@IsNumber()
|
|
80
|
+
updated_at: number;
|
|
81
|
+
|
|
82
|
+
@IsObject()
|
|
83
|
+
line_items: any;
|
|
84
|
+
|
|
85
|
+
@IsObject()
|
|
86
|
+
charges: any;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export class ConektaResPrevAttrDto {
|
|
90
|
+
@IsString()
|
|
91
|
+
status: string;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export class ConektaResDataDto {
|
|
95
|
+
@ValidateNested()
|
|
96
|
+
@Type(() => ConektaResObjChargePaidDto)
|
|
97
|
+
object: ConektaResObjChargePaidDto;
|
|
98
|
+
|
|
99
|
+
@ValidateNested()
|
|
100
|
+
@Type(() => ConektaResPrevAttrDto)
|
|
101
|
+
previous_attributes: ConektaResPrevAttrDto;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export class ConektaResDto {
|
|
105
|
+
@IsOptional()
|
|
106
|
+
@IsString()
|
|
107
|
+
client_id?: string;
|
|
108
|
+
|
|
109
|
+
@ValidateNested()
|
|
110
|
+
@Type(() => ConektaResDataDto)
|
|
111
|
+
data: ConektaResDataDto;
|
|
112
|
+
|
|
113
|
+
@IsBoolean()
|
|
114
|
+
livemode: boolean;
|
|
115
|
+
|
|
116
|
+
@IsString()
|
|
117
|
+
webhook_status: string;
|
|
118
|
+
|
|
119
|
+
@IsArray()
|
|
120
|
+
@IsOptional()
|
|
121
|
+
webhook_logs: any[];
|
|
122
|
+
|
|
123
|
+
@IsString()
|
|
124
|
+
id: string;
|
|
125
|
+
|
|
126
|
+
@IsString()
|
|
127
|
+
object: string;
|
|
128
|
+
|
|
129
|
+
@IsString()
|
|
130
|
+
type: string; // Assuming eConektaRes is a string
|
|
131
|
+
|
|
132
|
+
@IsNumber()
|
|
133
|
+
created_at: number;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export class ConektaSourcesDto {
|
|
137
|
+
@IsString()
|
|
138
|
+
type: string;
|
|
139
|
+
|
|
140
|
+
@IsNumber()
|
|
141
|
+
expires_at: number;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export class ConektaDto {
|
|
145
|
+
@IsString()
|
|
146
|
+
name: string;
|
|
147
|
+
|
|
148
|
+
@IsString()
|
|
149
|
+
email: string;
|
|
150
|
+
|
|
151
|
+
@IsString()
|
|
152
|
+
phone: string;
|
|
153
|
+
|
|
154
|
+
@IsArray()
|
|
155
|
+
@ValidateNested({ each: true })
|
|
156
|
+
@Type(() => ConektaSourcesDto)
|
|
157
|
+
payment_sources: ConektaSourcesDto[];
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export class OxxoRecurrentSourcesDataDto {
|
|
161
|
+
@IsString()
|
|
162
|
+
id: string;
|
|
163
|
+
|
|
164
|
+
@IsString()
|
|
165
|
+
object: string;
|
|
166
|
+
|
|
167
|
+
@IsString()
|
|
168
|
+
type: string;
|
|
169
|
+
|
|
170
|
+
@IsString()
|
|
171
|
+
provider: string;
|
|
172
|
+
|
|
173
|
+
@IsString()
|
|
174
|
+
reference: string;
|
|
175
|
+
|
|
176
|
+
@IsString()
|
|
177
|
+
barcode: string;
|
|
178
|
+
|
|
179
|
+
@IsString()
|
|
180
|
+
barcode_url: string;
|
|
181
|
+
|
|
182
|
+
@IsNumber()
|
|
183
|
+
expires_at: number;
|
|
184
|
+
|
|
185
|
+
@IsNumber()
|
|
186
|
+
created_at: number;
|
|
187
|
+
|
|
188
|
+
@IsString()
|
|
189
|
+
parent_id: string;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export class OxxoRecurrentSourcesDto {
|
|
193
|
+
@IsString()
|
|
194
|
+
object: string;
|
|
195
|
+
|
|
196
|
+
@IsBoolean()
|
|
197
|
+
has_more: boolean;
|
|
198
|
+
|
|
199
|
+
@IsNumber()
|
|
200
|
+
total: number;
|
|
201
|
+
|
|
202
|
+
@IsArray()
|
|
203
|
+
@ValidateNested({ each: true })
|
|
204
|
+
@Type(() => OxxoRecurrentSourcesDataDto)
|
|
205
|
+
data: OxxoRecurrentSourcesDataDto[];
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export class ConektaRecurrentDto {
|
|
209
|
+
@IsBoolean()
|
|
210
|
+
corporate: boolean;
|
|
211
|
+
|
|
212
|
+
@IsNumber()
|
|
213
|
+
created_at: number;
|
|
214
|
+
|
|
215
|
+
@IsBoolean()
|
|
216
|
+
livemode: boolean;
|
|
217
|
+
|
|
218
|
+
@IsString()
|
|
219
|
+
name: string;
|
|
220
|
+
|
|
221
|
+
@IsString()
|
|
222
|
+
email: string;
|
|
223
|
+
|
|
224
|
+
@IsString()
|
|
225
|
+
phone: string;
|
|
226
|
+
|
|
227
|
+
@IsString()
|
|
228
|
+
id: string;
|
|
229
|
+
|
|
230
|
+
@IsString()
|
|
231
|
+
object: string;
|
|
232
|
+
|
|
233
|
+
@IsString()
|
|
234
|
+
custom_id: string;
|
|
235
|
+
|
|
236
|
+
@ValidateNested()
|
|
237
|
+
@Type(() => OxxoRecurrentSourcesDto)
|
|
238
|
+
payment_sources: OxxoRecurrentSourcesDto;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Constants
|
|
243
|
+
* */
|
|
244
|
+
|
|
245
|
+
export enum eConektaRes {
|
|
246
|
+
CUSTOMER_CREATED = 'customer.created',
|
|
247
|
+
ORDER_PENDING_PAYMENT = 'order.pending_payment',
|
|
248
|
+
ORDER_CREATED = 'order.created',
|
|
249
|
+
CHARGE_CREATED = 'charge.created',
|
|
250
|
+
ORDER_PAID = 'order.paid',
|
|
251
|
+
CHARGE_PAID = 'charge.paid',
|
|
252
|
+
REVERSE = 'inbound_payment.reverse',
|
|
253
|
+
PAYMENT_ATTEMPT = 'inbound_payment.payment_attempt',
|
|
254
|
+
LOOK_UP = 'inbound_payment.lookup',
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
export const cConektaResPrevAttr: ConektaResPrevAttrDto = {
|
|
258
|
+
status: '',
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
export const cConektaResObjChargePaid: ConektaResObjChargePaidDto = {
|
|
262
|
+
id: '',
|
|
263
|
+
livemode: false,
|
|
264
|
+
created_at: 0,
|
|
265
|
+
currency: '',
|
|
266
|
+
payment_method: {},
|
|
267
|
+
object: '',
|
|
268
|
+
description: '',
|
|
269
|
+
status: '',
|
|
270
|
+
amount: 0,
|
|
271
|
+
paid_at: 0,
|
|
272
|
+
fee: 0,
|
|
273
|
+
customer_id: '',
|
|
274
|
+
order_id: '',
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
export const cConektaResData: ConektaResDataDto = {
|
|
278
|
+
object: cConektaResObjChargePaid,
|
|
279
|
+
previous_attributes: cConektaResPrevAttr,
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
export const cConektaRes: ConektaResDto = {
|
|
283
|
+
data: cConektaResData,
|
|
284
|
+
livemode: false,
|
|
285
|
+
webhook_status: '',
|
|
286
|
+
webhook_logs: [],
|
|
287
|
+
id: '',
|
|
288
|
+
object: '',
|
|
289
|
+
type: eConektaRes.PAYMENT_ATTEMPT,
|
|
290
|
+
created_at: 0,
|
|
291
|
+
};
|
|
292
|
+
|
|
293
|
+
/** Payment from Conekta */
|
|
294
|
+
// export interface iConektaPaymentMethod {
|
|
295
|
+
// barcode: string,
|
|
296
|
+
// reference: string,
|
|
297
|
+
// barcode_url: string,
|
|
298
|
+
// object: string
|
|
299
|
+
// type: string,
|
|
300
|
+
// expires_at: number,
|
|
301
|
+
// store_name: string
|
|
302
|
+
// }
|
|
303
|
+
//
|
|
304
|
+
// export interface iConektaPaymentDetail {
|
|
305
|
+
// name: string,
|
|
306
|
+
// phone: any,
|
|
307
|
+
// email: string,
|
|
308
|
+
// line_items: any[],
|
|
309
|
+
// coupons: any[],
|
|
310
|
+
// object: string
|
|
311
|
+
// }
|
|
312
|
+
//
|
|
313
|
+
// export interface iConektaPaymentObject {
|
|
314
|
+
// id: string,
|
|
315
|
+
// livemode: true,
|
|
316
|
+
// created_at: number,
|
|
317
|
+
// currency: string,
|
|
318
|
+
// description: any,
|
|
319
|
+
// reference_id: any,
|
|
320
|
+
// failure_code: any,
|
|
321
|
+
// failure_message: any,
|
|
322
|
+
// monthly_installments: any,
|
|
323
|
+
// device_fingerprint: any,
|
|
324
|
+
// refunds: any[],
|
|
325
|
+
// payment_method: iConektaPaymentMethod,
|
|
326
|
+
// details: iConektaPaymentDetail,
|
|
327
|
+
// object: string,
|
|
328
|
+
// status: string,
|
|
329
|
+
// amount: number,
|
|
330
|
+
// paid_at: number,
|
|
331
|
+
// fee: number,
|
|
332
|
+
// customer_id: string,
|
|
333
|
+
// subscription_id: string,
|
|
334
|
+
// amount_refunded: any
|
|
335
|
+
// }
|
|
336
|
+
//
|
|
337
|
+
// export interface iConektaPaymentData {
|
|
338
|
+
// object: iConektaPaymentObject,
|
|
339
|
+
// previous_attributes: any
|
|
340
|
+
// }
|
|
341
|
+
//
|
|
342
|
+
// export interface iConektaPayment2 {
|
|
343
|
+
// data: iConektaPaymentData,
|
|
344
|
+
// livemode: boolean,
|
|
345
|
+
// webhook_status: string,
|
|
346
|
+
// webhook_logs: any[],
|
|
347
|
+
// id: string,
|
|
348
|
+
// object: string,
|
|
349
|
+
// type: string,
|
|
350
|
+
// created_at: number
|
|
351
|
+
// }
|
|
352
|
+
|
|
353
|
+
// {
|
|
354
|
+
// data: {
|
|
355
|
+
// object: {
|
|
356
|
+
// payment_method: [Object],
|
|
357
|
+
// charge_id: '66cae42aa61765001bca475a',
|
|
358
|
+
// livemode: false,
|
|
359
|
+
// created_at: 1724572714,
|
|
360
|
+
// object: 'inbound_payment',
|
|
361
|
+
// amount: 30000,
|
|
362
|
+
// currency: 'MXN',
|
|
363
|
+
// fee: 1357,
|
|
364
|
+
// customer_id: 'cus_2wVzz4TNt2wpKHmZJ'
|
|
365
|
+
// },
|
|
366
|
+
// previous_attributes: {}
|
|
367
|
+
// },
|
|
368
|
+
// livemode: false,
|
|
369
|
+
// webhook_status: 'not_applicable',
|
|
370
|
+
// webhook_logs: [
|
|
371
|
+
// {
|
|
372
|
+
// id: 'webhl_2wWS72J95wmQwT8W4',
|
|
373
|
+
// url: 'https://996c-2806-230-2610-b3ed-81a5-83f3-8828-6624.ngrok-free.app/api/v1/webhook/conekta',
|
|
374
|
+
// failed_attempts: 0,
|
|
375
|
+
// last_http_response_status: -1,
|
|
376
|
+
// response_data: null,
|
|
377
|
+
// object: 'webhook_log',
|
|
378
|
+
// last_attempted_at: 0
|
|
379
|
+
// }
|
|
380
|
+
// ],
|
|
381
|
+
// id: '66cae42aa61765001bca4760',
|
|
382
|
+
// object: 'event',
|
|
383
|
+
// type: 'inbound_payment.payment_attempt',
|
|
384
|
+
// created_at: 1724572714
|
|
385
|
+
// }
|
|
386
|
+
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { IsBoolean, IsNumber, IsOptional, IsString, Validate, ValidateNested } from 'class-validator';
|
|
2
|
+
import { Type } from 'class-transformer';
|
|
3
|
+
import { AddressDto } from './AddressDto';
|
|
4
|
+
import { DeviceDto } from './DeviceDto';
|
|
5
|
+
import { FinancialDto } from './FinancialDto';
|
|
6
|
+
import { IsStringOrNumber } from '../core/Validators';
|
|
7
|
+
|
|
8
|
+
export class ContractDto {
|
|
9
|
+
@IsString()
|
|
10
|
+
id: string;
|
|
11
|
+
|
|
12
|
+
@IsString()
|
|
13
|
+
client: string;
|
|
14
|
+
|
|
15
|
+
@ValidateNested()
|
|
16
|
+
@Type(() => AddressDto)
|
|
17
|
+
address: AddressDto;
|
|
18
|
+
|
|
19
|
+
@ValidateNested()
|
|
20
|
+
@Type(() => DeviceDto)
|
|
21
|
+
device: DeviceDto;
|
|
22
|
+
|
|
23
|
+
@ValidateNested()
|
|
24
|
+
@Type(() => FinancialDto)
|
|
25
|
+
financial: FinancialDto;
|
|
26
|
+
|
|
27
|
+
@IsNumber()
|
|
28
|
+
createdAt: number;
|
|
29
|
+
|
|
30
|
+
@IsNumber()
|
|
31
|
+
lastPayment: number;
|
|
32
|
+
|
|
33
|
+
@IsString()
|
|
34
|
+
by: string;
|
|
35
|
+
|
|
36
|
+
@IsBoolean()
|
|
37
|
+
@IsOptional()
|
|
38
|
+
status?: boolean;
|
|
39
|
+
|
|
40
|
+
@IsBoolean()
|
|
41
|
+
active: boolean;
|
|
42
|
+
|
|
43
|
+
@IsOptional()
|
|
44
|
+
@Validate(IsStringOrNumber)
|
|
45
|
+
dynamicAccount?: string | number;
|
|
46
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { IsBoolean, IsNumber, IsOptional, IsString } from 'class-validator';
|
|
2
|
+
|
|
3
|
+
export class CustomerDto {
|
|
4
|
+
@IsBoolean()
|
|
5
|
+
livemode: boolean;
|
|
6
|
+
|
|
7
|
+
@IsString()
|
|
8
|
+
name: string;
|
|
9
|
+
|
|
10
|
+
@IsString()
|
|
11
|
+
email: string;
|
|
12
|
+
|
|
13
|
+
@IsString()
|
|
14
|
+
phone: string;
|
|
15
|
+
|
|
16
|
+
@IsString()
|
|
17
|
+
id: string;
|
|
18
|
+
|
|
19
|
+
@IsString()
|
|
20
|
+
object: string;
|
|
21
|
+
|
|
22
|
+
@IsNumber()
|
|
23
|
+
created_at: number;
|
|
24
|
+
|
|
25
|
+
@IsBoolean()
|
|
26
|
+
corporate: boolean;
|
|
27
|
+
|
|
28
|
+
@IsString()
|
|
29
|
+
custom_reference: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export class CustomerInfoDto {
|
|
33
|
+
@IsString()
|
|
34
|
+
customer_id: string;
|
|
35
|
+
|
|
36
|
+
@IsOptional()
|
|
37
|
+
@IsString()
|
|
38
|
+
name?: string;
|
|
39
|
+
|
|
40
|
+
@IsOptional()
|
|
41
|
+
@IsString()
|
|
42
|
+
email?: string;
|
|
43
|
+
|
|
44
|
+
@IsOptional()
|
|
45
|
+
@IsString()
|
|
46
|
+
phone?: string;
|
|
47
|
+
}
|