@cuenca-mx/cuenca-js 0.0.14-dev9 → 1.0.0

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.
@@ -1,26 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var errors_index = require('./errors/index.cjs');
4
- var data = require('./data-92aab1cc.cjs');
5
-
6
- class PageSize {
7
- constructor(size) {
8
- this.maxSize = 100;
9
- this._ps = size;
10
- }
11
-
12
- get size() {
13
- return this._pageSize;
14
- }
15
-
16
- set _ps(value) {
17
- let validatedPageSize = this.maxSize;
18
- if (value && value > 0 && value <= this.maxSize) {
19
- validatedPageSize = value;
20
- }
21
- this._pageSize = validatedPageSize;
22
- }
23
- }
4
+ var data = require('./data-6c2897da.cjs');
24
5
 
25
6
  class QueryParams {
26
7
  constructor({
@@ -45,10 +26,9 @@ class QueryParams {
45
26
  return this._limit;
46
27
  }
47
28
 
48
- // Validator for limit
49
29
  set _lmt(value) {
50
30
  let validatedValue = null;
51
- if (value && value >= 0) {
31
+ if (typeof value === 'number' && value >= 0) {
52
32
  validatedValue = value;
53
33
  }
54
34
  this._limit = validatedValue;
@@ -92,162 +72,150 @@ class AccountQuery extends QueryParams {
92
72
  }
93
73
  }
94
74
 
95
- class ApiKeyQuery extends QueryParams {
96
- constructor({ active, ...args }) {
75
+ class AlertQuery extends QueryParams {
76
+ constructor({
77
+ agent,
78
+ comments,
79
+ committeeMeetingDate,
80
+ count,
81
+ hasQuestionnaire,
82
+ inProcess,
83
+ status,
84
+ typeOfFilter,
85
+ transactionDate,
86
+ ...args
87
+ }) {
97
88
  super(args);
98
- this.active = active;
89
+ this.agent = agent;
90
+ this.comments = comments;
91
+ this.committeeMeetingDate = committeeMeetingDate;
92
+ this.count = count;
93
+ this.hasQuestionnaire = hasQuestionnaire;
94
+ this.inProcess = inProcess;
95
+ this.status = status;
96
+ this.typeOfFilter = typeOfFilter;
97
+ this.transactionDate = transactionDate;
99
98
  }
100
99
 
101
100
  toObject() {
102
101
  return Object.assign(super.toObject(), {
103
- active: this.active,
102
+ agent: this.agent,
103
+ comments: this.comments,
104
+ committee_meeting_date: this.committeeMeetingDate,
105
+ count: this.count,
106
+ has_questionnaire: this.hasQuestionnaire,
107
+ in_process: this.inProcess,
108
+ status: this.status,
109
+ transaction_date: this.transactionDate,
110
+ type_of_filter: this.typeOfFilter,
104
111
  });
105
112
  }
106
113
  }
107
114
 
108
- class TransactionQuery extends QueryParams {
109
- constructor({ status, ...args }) {
115
+ class ApiKeyQuery extends QueryParams {
116
+ constructor({ active, ...args }) {
110
117
  super(args);
111
- this.status = status;
118
+ this.active = active;
112
119
  }
113
120
 
114
121
  toObject() {
115
122
  return Object.assign(super.toObject(), {
116
- status: this.status,
123
+ active: this.active,
117
124
  });
118
125
  }
119
126
  }
120
127
 
121
- class DepositQuery extends TransactionQuery {
122
- constructor({ trackingKey, network, ...args }) {
128
+ class BalanceEntryQuery extends QueryParams {
129
+ constructor({
130
+ fundingInstrumentUri,
131
+ count = false,
132
+ walletId = 'default',
133
+ ...args
134
+ }) {
123
135
  super(args);
124
- this.trackingKey = trackingKey;
125
- this.network = network;
136
+ this.fundingInstrumentUri = fundingInstrumentUri;
137
+ this.count = count;
138
+ this.walletId = walletId;
126
139
  }
127
140
 
128
141
  toObject() {
129
142
  return Object.assign(super.toObject(), {
130
- tracking_key: this.trackingKey,
131
- network: this.network,
143
+ wallet_id: this.walletId,
144
+ funding_instrument_uri: this.fundingInstrumentUri,
145
+ count: this.count,
132
146
  });
133
147
  }
134
148
  }
135
149
 
136
- class TransferQuery extends TransactionQuery {
137
- constructor({
138
- accountNumber,
139
- idempotencyKey,
140
- trackingKey,
141
- network,
142
- ...args
143
- }) {
150
+ class BillPaymentQuery extends QueryParams {
151
+ constructor({ accountNumber, ...args }) {
144
152
  super(args);
145
153
  this.accountNumber = accountNumber;
146
- this.idempotencyKey = idempotencyKey;
147
- this.trackingKey = trackingKey;
148
- this.network = network;
149
154
  }
150
155
 
151
156
  toObject() {
152
157
  return Object.assign(super.toObject(), {
153
158
  account_number: this.accountNumber,
154
- idempotency_key: this.idempotencyKey,
155
- tracking_key: this.trackingKey,
156
- network: this.network,
157
159
  });
158
160
  }
159
161
  }
160
162
 
161
- class BalanceEntryQuery extends QueryParams {
162
- constructor({
163
- fundingInstrumentUri,
164
- count = false,
165
- walletId = 'default',
166
- ...args
167
- }) {
163
+ class BridgeAccountQuery extends QueryParams {
164
+ constructor({ emailAddress, ...args }) {
168
165
  super(args);
169
- this.fundingInstrumentUri = fundingInstrumentUri;
170
- this.count = count;
171
- this.walletId = walletId;
166
+ this.emailAddress = emailAddress;
172
167
  }
173
168
 
174
169
  toObject() {
175
170
  return Object.assign(super.toObject(), {
176
- wallet_id: this.walletId,
177
- funding_instrument_uri: this.fundingInstrumentUri,
178
- count: this.count,
171
+ email_address: this.emailAddress,
179
172
  });
180
173
  }
181
174
  }
182
175
 
183
- class AlertQuery extends QueryParams {
184
- constructor({
185
- aggent,
186
- comments,
187
- committeeMeetingDate,
188
- count,
189
- hasQuestionnaire,
190
- inProcess,
191
- status,
192
- typeOfFilter,
193
- transactionDate,
194
- ...args
195
- }) {
176
+ class BridgeBankAccountQuery extends QueryParams {
177
+ constructor({ accountId, ...args }) {
196
178
  super(args);
197
- this.aggent = aggent;
198
- this.comments = comments;
199
- this.committeeMeetingDate = committeeMeetingDate;
200
- this.count = count;
201
- this.hasQuestionnaire = hasQuestionnaire;
202
- this.inProcess = inProcess;
203
- this.status = status;
204
- this.typeOfFilter = typeOfFilter;
205
- this.transactionDate = transactionDate;
179
+ this.accountId = accountId;
206
180
  }
207
181
 
208
182
  toObject() {
209
183
  return Object.assign(super.toObject(), {
210
- aggent: this.aggent,
211
- comments: this.comments,
212
- committee_meeting_date: this.committeeMeetingDate,
213
- count: this.count,
214
- has_questionnaire: this.hasQuestionnaire,
215
- in_process: this.inProcess,
216
- status: this.status,
217
- transaction_date: this.transactionDate,
218
- type_of_filter: this.typeOfFilter,
184
+ account_id: this.accountId,
219
185
  });
220
186
  }
221
187
  }
222
188
 
223
- class BillPaymentQuery extends QueryParams {
224
- constructor({ accountNumber, ...args }) {
189
+ class BridgeQuery extends QueryParams {
190
+ constructor({ accountId, ...args }) {
225
191
  super(args);
226
- this.accountNumber = accountNumber;
192
+ this.accountId = accountId;
227
193
  }
228
194
 
229
195
  toObject() {
230
196
  return Object.assign(super.toObject(), {
231
- account_number: this.accountNumber,
197
+ account: this.accountId,
232
198
  });
233
199
  }
234
200
  }
235
201
 
236
- class CardTransactionQuery extends QueryParams {
237
- constructor({ cardUri, ...args }) {
202
+ class BridgeTransactionQuery extends BridgeQuery {
203
+ constructor({ status, type, ...args }) {
238
204
  super(args);
239
- this.cardUri = cardUri;
205
+ this.status = status;
206
+ this.type = type;
240
207
  }
241
208
 
242
209
  toObject() {
243
210
  return Object.assign(super.toObject(), {
244
- card_uri: this.cardUri,
211
+ status: this.status,
212
+ type: this.type,
245
213
  });
246
214
  }
247
215
  }
248
216
 
249
217
  class CardsQuery extends QueryParams {
250
- constructor({ cardUri, count = false, ...args }) {
218
+ constructor({ cardUri, count = false, ...args } = {}) {
251
219
  super(args);
252
220
  this.cardUri = cardUri;
253
221
  this.count = count;
@@ -261,75 +229,98 @@ class CardsQuery extends QueryParams {
261
229
  }
262
230
  }
263
231
 
264
- class WalletTransactionQuery extends QueryParams {
265
- constructor({ walletUri, ...args }) {
232
+ class CardTransactionQuery extends QueryParams {
233
+ constructor({ cardUri, ...args }) {
266
234
  super(args);
267
- this.walletUri = walletUri;
235
+ this.cardUri = cardUri;
268
236
  }
269
237
 
270
238
  toObject() {
271
239
  return Object.assign(super.toObject(), {
272
- wallet_uri: this.walletUri,
240
+ card_uri: this.cardUri,
273
241
  });
274
242
  }
275
243
  }
276
244
 
277
- class UserQuery extends QueryParams {
278
- constructor({ emailAddress, hasCurpDocument, phoneNumber, status, ...args }) {
245
+ class TransactionQuery extends QueryParams {
246
+ constructor({ status, ...args }) {
279
247
  super(args);
280
- this.emailAddress = emailAddress;
281
- this.hasCurpDocument = hasCurpDocument;
282
- this.phoneNumber = phoneNumber;
283
248
  this.status = status;
284
249
  }
285
250
 
286
251
  toObject() {
287
252
  return Object.assign(super.toObject(), {
288
- email_address: this.emailAddress,
289
- has_curp_document: this.hasCurpDocument,
290
- phone_number: this.phoneNumber,
291
253
  status: this.status,
292
254
  });
293
255
  }
294
256
  }
295
257
 
296
- class WalletQuery extends QueryParams {
297
- constructor({ active, ...args }) {
258
+ class DepositQuery extends TransactionQuery {
259
+ constructor({ trackingKey, network, ...args }) {
298
260
  super(args);
299
- this.active = active;
261
+ this.trackingKey = trackingKey;
262
+ this.network = network;
300
263
  }
301
264
 
302
265
  toObject() {
303
266
  return Object.assign(super.toObject(), {
304
- active: this.active,
267
+ tracking_key: this.trackingKey,
268
+ network: this.network,
269
+ });
270
+ }
271
+ }
272
+
273
+ class PartnerQuery extends QueryParams {
274
+ constructor({ emailAddress, ...args }) {
275
+ super(args);
276
+ this.emailAddress = emailAddress;
277
+ }
278
+
279
+ toObject() {
280
+ return Object.assign(super.toObject(), {
281
+ email_address: this.emailAddress,
305
282
  });
306
283
  }
307
284
  }
308
285
 
309
286
  class StatementQuery extends QueryParams {
310
- constructor({ month, year, ...args }) {
287
+ constructor({ month, year, ...args } = {}) {
311
288
  super(args);
312
- this.d = { month, year };
289
+ if (month !== undefined && year !== undefined) {
290
+ this.d = { month, year };
291
+ }
313
292
  }
314
293
 
315
294
  get month() {
316
- return this._date.month;
295
+ return this._date?.month;
317
296
  }
318
297
 
319
298
  get year() {
320
- return this._date.year;
299
+ return this._date?.year;
321
300
  }
322
301
 
323
302
  set d({ month, year }) {
324
- const now = data.dateToUTC(Date.now());
325
- now.setUTCDate(1);
326
- const date = data.dateToUTC(`${year}-${month}-01`);
327
- if (date.getTime() >= now.getTime()) {
303
+ const m = Number(month);
304
+ const y = Number(year);
305
+ if (!Number.isInteger(m) || m < 1 || m > 12) {
306
+ throw new errors_index.ValidationError('month must be an integer between 1 and 12');
307
+ }
308
+ if (!Number.isInteger(y) || y < 1900 || y > 9999) {
328
309
  throw new errors_index.ValidationError(
329
- `${year}-${month} is not a valid year-month pair`,
310
+ 'year must be an integer between 1900 and 9999',
330
311
  );
331
312
  }
332
- this._date = { month, year };
313
+ const candidate = new Date(Date.UTC(y, m - 1, 1));
314
+ const nowUtc = new Date();
315
+ const currentMonthStart = new Date(
316
+ Date.UTC(nowUtc.getUTCFullYear(), nowUtc.getUTCMonth(), 1),
317
+ );
318
+ if (candidate.getTime() >= currentMonthStart.getTime()) {
319
+ const mm = String(m).padStart(2, '0');
320
+ throw new errors_index.ValidationError(`${y}-${mm} is not a valid year-month pair`);
321
+ }
322
+
323
+ this._date = { month: m, year: y };
333
324
  }
334
325
 
335
326
  toObject() {
@@ -340,74 +331,191 @@ class StatementQuery extends QueryParams {
340
331
  }
341
332
  }
342
333
 
343
- class BridgeAccountQuery extends QueryParams {
344
- constructor({ emailAddress, ...args }) {
334
+ class TransferQuery extends TransactionQuery {
335
+ constructor({
336
+ accountNumber,
337
+ idempotencyKey,
338
+ trackingKey,
339
+ network,
340
+ ...args
341
+ }) {
345
342
  super(args);
346
- this.emailAddress = emailAddress;
343
+ this.accountNumber = accountNumber;
344
+ this.idempotencyKey = idempotencyKey;
345
+ this.trackingKey = trackingKey;
346
+ this.network = network;
347
347
  }
348
348
 
349
349
  toObject() {
350
350
  return Object.assign(super.toObject(), {
351
- email_address: this.emailAddress,
351
+ account_number: this.accountNumber,
352
+ idempotency_key: this.idempotencyKey,
353
+ tracking_key: this.trackingKey,
354
+ network: this.network,
352
355
  });
353
356
  }
354
357
  }
355
358
 
356
- class BridgeQuery extends QueryParams {
357
- constructor({ accountId, ...args }) {
359
+ class UserQuery extends QueryParams {
360
+ constructor({
361
+ emailAddress,
362
+ hasCurpDocument,
363
+ phoneNumber,
364
+ status,
365
+ ...args
366
+ } = {}) {
358
367
  super(args);
359
- this.accountId = accountId;
368
+ this.emailAddress = emailAddress;
369
+ this.hasCurpDocument = hasCurpDocument;
370
+ this.phoneNumber = phoneNumber;
371
+ this.status = status;
360
372
  }
361
373
 
362
374
  toObject() {
363
375
  return Object.assign(super.toObject(), {
364
- account: this.accountId,
376
+ email_address: this.emailAddress,
377
+ has_curp_document: this.hasCurpDocument,
378
+ phone_number: this.phoneNumber,
379
+ status: this.status,
365
380
  });
366
381
  }
367
382
  }
368
383
 
369
- class BridgeBankAccountQuery extends QueryParams {
370
- constructor({ accountId, ...args }) {
384
+ class WalletQuery extends QueryParams {
385
+ constructor({ active, ...args }) {
371
386
  super(args);
372
- this.accountId = accountId;
387
+ this.active = active;
373
388
  }
374
389
 
375
390
  toObject() {
376
391
  return Object.assign(super.toObject(), {
377
- account_id: this.accountId,
392
+ active: this.active,
378
393
  });
379
394
  }
380
395
  }
381
396
 
382
- class BridgeTransactionQuery extends BridgeQuery {
383
- constructor({ status, type, ...args }) {
397
+ class WalletTransactionQuery extends QueryParams {
398
+ constructor({ walletUri, ...args }) {
384
399
  super(args);
385
- this.status = status;
386
- this.type = type;
400
+ this.walletUri = walletUri;
387
401
  }
388
402
 
389
403
  toObject() {
390
404
  return Object.assign(super.toObject(), {
391
- status: this.status,
392
- type: this.type,
405
+ wallet_uri: this.walletUri,
393
406
  });
394
407
  }
395
408
  }
396
409
 
397
- class TOSAgreements {
398
- constructor({ ip, location, type, version }) {
399
- this.ip = ip;
400
- this.location = location;
401
- this.type = type;
402
- this.version = version;
410
+ class Address {
411
+ constructor({
412
+ city,
413
+ colonia,
414
+ country,
415
+ createdAt,
416
+ extNumber,
417
+ fullName,
418
+ intNumber,
419
+ postalCode,
420
+ state,
421
+ street,
422
+ }) {
423
+ this.city = city;
424
+ this.colonia = colonia;
425
+ this.country = country;
426
+ this.createdAt = data.dateToUTC(createdAt);
427
+ this.extNumber = extNumber;
428
+ this.fullName = fullName;
429
+ this.intNumber = intNumber;
430
+ this.postalCode = postalCode;
431
+ this.state = state;
432
+ this.street = street;
403
433
  }
404
434
 
405
- static fromObject = ({ ip, location, type, version }) =>
406
- new TOSAgreements({
407
- ip,
408
- location,
409
- type,
410
- version,
435
+ static fromObject = ({ city, colonia, country, state, street, ...obj }) =>
436
+ new Address({
437
+ city,
438
+ colonia,
439
+ country,
440
+ state,
441
+ street,
442
+ createdAt: obj.created_at,
443
+ extNumber: obj.ext_number,
444
+ fullName: obj.full_name,
445
+ intNumber: obj.int_number,
446
+ postalCode: obj.postal_code,
447
+ });
448
+ }
449
+
450
+ class AlertLog {
451
+ constructor({ agent, createdAt, status, updatedAt, comments }) {
452
+ this.agent = agent;
453
+ this.comments = comments;
454
+ this.createdAt = data.dateToUTC(createdAt);
455
+ this.updatedAt = data.dateToUTC(updatedAt);
456
+ this.status = data.enumValueFromString(data.AlertStatus, status);
457
+ }
458
+
459
+ static fromObject = ({ agent, comments, status, ...obj }) =>
460
+ new AlertLog({
461
+ agent,
462
+ comments,
463
+ status,
464
+ createdAt: obj.created_at,
465
+ updatedAt: obj.updated_at,
466
+ });
467
+ }
468
+
469
+ class Audit {
470
+ constructor({ hasAudit, auditProvider, auditDate, auditComments }) {
471
+ this.hasAudit = hasAudit;
472
+ this.auditProvider = auditProvider;
473
+ this.auditDate = data.dateToUTC(auditDate);
474
+ this.auditComments = auditComments;
475
+ }
476
+
477
+ static fromObject = ({ ...obj }) =>
478
+ new Audit({
479
+ hasAudit: obj.has_audit,
480
+ auditProvider: obj.audit_provider,
481
+ auditDate: obj.audit_date,
482
+ auditComments: obj.audit_comments,
483
+ });
484
+ }
485
+
486
+ class BusinessDetails {
487
+ constructor({
488
+ accountUsageDescription = null,
489
+ businessDescription = null,
490
+ } = {}) {
491
+ this.accountUsageDescription = accountUsageDescription;
492
+ this.businessDescription = businessDescription;
493
+ }
494
+
495
+ static fromObject = ({ ...obj } = {}) =>
496
+ new BusinessDetails({
497
+ accountUsageDescription: obj.account_usage_description,
498
+ businessDescription: obj.business_description,
499
+ });
500
+
501
+ toObject() {
502
+ return {
503
+ account_usage_description: this.accountUsageDescription,
504
+ business_description: this.businessDescription,
505
+ };
506
+ }
507
+ }
508
+
509
+ class ExternalAccount {
510
+ constructor({ bank, account }) {
511
+ this.bank = bank;
512
+ this.account = account;
513
+ }
514
+
515
+ static fromObject = ({ account, bank }) =>
516
+ new ExternalAccount({
517
+ bank,
518
+ account,
411
519
  });
412
520
  }
413
521
 
@@ -454,100 +562,252 @@ class KYCFile {
454
562
  });
455
563
  }
456
564
 
457
- class Address {
565
+ class License {
458
566
  constructor({
459
- city,
460
- colonia,
461
- country,
462
- createdAt,
463
- extNumber,
464
- fullName,
465
- intNumber,
466
- postalCode,
467
- state,
468
- street,
567
+ licenseRequired = false,
568
+ supervisoryEntity = null,
569
+ licenseType = null,
570
+ licenseDate = null,
571
+ } = {}) {
572
+ this.licenseRequired = licenseRequired;
573
+ this.supervisoryEntity = supervisoryEntity;
574
+ this.licenseType = licenseType;
575
+ this.licenseDate = licenseDate ? data.dateToUTC(licenseDate) : null;
576
+ }
577
+
578
+ static fromObject = ({ ...obj } = {}) =>
579
+ new License({
580
+ licenseRequired: obj.license_required,
581
+ supervisoryEntity: obj.supervisory_entity,
582
+ licenseType: obj.license_type,
583
+ licenseDate: obj.license_date,
584
+ });
585
+ }
586
+
587
+ class PhysicalPerson {
588
+ constructor({ names, curp, rfc, firstSurname, secondSurname }) {
589
+ this.names = names;
590
+ this.curp = curp;
591
+ this.rfc = rfc;
592
+ this.firstSurname = firstSurname;
593
+ this.secondSurname = secondSurname;
594
+ }
595
+
596
+ static fromObject = ({ names, curp, rfc, ...obj }) => {
597
+ return new PhysicalPerson({
598
+ names,
599
+ curp,
600
+ rfc,
601
+ firstSurname: obj.first_surname,
602
+ secondSurname: obj.second_surname,
603
+ });
604
+ };
605
+
606
+ toObject() {
607
+ return {
608
+ names: this.names,
609
+ curp: this.curp,
610
+ rfc: this.rfc,
611
+ first_surname: this.firstSurname,
612
+ second_surname: this.secondSurname,
613
+ };
614
+ }
615
+ }
616
+
617
+ class LegalRepresentatives extends PhysicalPerson {
618
+ constructor({
619
+ names,
620
+ curp,
621
+ rfc,
622
+ firstSurname,
623
+ secondSurname,
624
+ job,
625
+ phoneNumber,
626
+ emailAddress,
627
+ address,
469
628
  }) {
470
- this.city = city;
471
- this.colonia = colonia;
472
- this.country = country;
473
- this.createdAt = data.dateToUTC(createdAt);
474
- this.extNumber = extNumber;
475
- this.fullName = fullName;
476
- this.intNumber = intNumber;
477
- this.postalCode = postalCode;
478
- this.state = state;
479
- this.street = street;
629
+ super({ names, curp, rfc, firstSurname, secondSurname });
630
+ this.job = job;
631
+ this.phoneNumber = phoneNumber;
632
+ this.emailAddress = emailAddress;
633
+ this.address = address;
480
634
  }
481
635
 
482
- static fromObject = ({ city, colonia, country, state, street, ...obj }) =>
483
- new Address({
484
- city,
485
- colonia,
486
- country,
487
- state,
488
- street,
489
- createdAt: obj.created_at,
490
- extNumber: obj.ext_number,
491
- fullName: obj.full_name,
492
- intNumber: obj.int_number,
493
- postalCode: obj.postal_code,
636
+ get address() {
637
+ return this._address;
638
+ }
639
+
640
+ set address(value) {
641
+ if (!value) return;
642
+ this._address = Address.fromObject(value);
643
+ }
644
+
645
+ static fromObject = ({ job, address, ...obj }) =>
646
+ new LegalRepresentatives({
647
+ address,
648
+ job,
649
+ phoneNumber: obj.phone_number,
650
+ emailAddress: obj.email_address,
651
+ ...PhysicalPerson.fromObject(obj),
494
652
  });
495
653
  }
496
654
 
497
- class AlertLog {
498
- constructor({ aggent, createdAt, status, updatedAt, comments }) {
499
- this.aggent = aggent;
500
- this.comments = comments;
501
- this.createdAt = data.dateToUTC(createdAt);
502
- this.updatedAt = data.dateToUTC(updatedAt);
503
- this.status = data.enumValueFromString(data.AlertStatus, status);
655
+ class ShareholderPhysical extends PhysicalPerson {
656
+ constructor({
657
+ names,
658
+ curp,
659
+ rfc,
660
+ firstSurname,
661
+ secondSurname,
662
+ shareCapital,
663
+ percentage,
664
+ }) {
665
+ super({ names, curp, rfc, firstSurname, secondSurname });
666
+ this.shareCapital = shareCapital;
667
+ this.percentage = percentage;
504
668
  }
505
669
 
506
- static fromObject = ({ aggent, comments, status, ...obj }) =>
507
- new AlertLog({
508
- aggent,
509
- comments,
510
- status,
511
- createdAt: obj.created_at,
512
- updatedAt: obj.updated_at,
670
+ static fromObject = ({ percentage, ...obj }) => {
671
+ return new ShareholderPhysical({
672
+ percentage,
673
+ shareCapital: obj.share_capital,
674
+ ...PhysicalPerson.fromObject(obj),
513
675
  });
676
+ };
514
677
  }
515
678
 
516
- class AlertLogs {
517
- constructor(value) {
518
- this.changeLog = value.changeLog.map((log) => {
519
- return new AlertLog(log);
679
+ class ShareholderMoral {
680
+ constructor({ name, percentage, shareholders, legalRepresentatives }) {
681
+ this.name = name;
682
+ this.percentage = percentage;
683
+ this.shareholders = shareholders;
684
+ this.legalRepresentatives = legalRepresentatives;
685
+ }
686
+
687
+ get shareholders() {
688
+ return this._shareholders;
689
+ }
690
+
691
+ set shareholders(value) {
692
+ if (!value) return;
693
+ this._shareholders = value.map((sh) => ShareholderPhysical.fromObject(sh));
694
+ }
695
+
696
+ get legalRepresentatives() {
697
+ return this._legalRepresentatives;
698
+ }
699
+
700
+ set legalRepresentatives(value) {
701
+ if (!value) return;
702
+ this._legalRepresentatives = value.map((lr) =>
703
+ LegalRepresentatives.fromObject(lr),
704
+ );
705
+ }
706
+
707
+ static fromObject = ({ name, percentage, shareholders, ...obj }) => {
708
+ return new ShareholderMoral({
709
+ name,
710
+ percentage,
711
+ shareholders: shareholders || [],
712
+ legalRepresentatives: obj.legal_representatives || [],
520
713
  });
714
+ };
715
+ }
716
+
717
+ class TransactionalProfileServices {
718
+ constructor({
719
+ speiTransfersNum,
720
+ speiTransfersAmount,
721
+ internalTransfersNum,
722
+ internalTransfersAmount,
723
+ } = {}) {
724
+ this.speiTransfersNum = speiTransfersNum;
725
+ this.speiTransfersAmount = speiTransfersAmount;
726
+ this.internalTransfersNum = internalTransfersNum;
727
+ this.internalTransfersAmount = internalTransfersAmount;
728
+ }
729
+
730
+ static fromObject = ({ ...obj } = {}) => {
731
+ const response = new TransactionalProfileServices({
732
+ speiTransfersNum: obj.spei_transfers_num,
733
+ speiTransfersAmount: obj.spei_transfers_amount,
734
+ internalTransfersNum: obj.internal_transfers_num,
735
+ internalTransfersAmount: obj.internal_transfers_amount,
736
+ });
737
+
738
+ return response;
739
+ };
740
+ }
741
+
742
+ class TOSAgreements {
743
+ constructor({ ip, location, type, version }) {
744
+ this.ip = ip;
745
+ this.location = location;
746
+ this.type = type;
747
+ this.version = version;
521
748
  }
522
749
 
523
- static fromObject = (value) =>
524
- new AlertLogs({
525
- changeLog: value.map((log) => AlertLog.fromObject(log)),
750
+ static fromObject = ({ ip, location, type, version }) =>
751
+ new TOSAgreements({
752
+ ip,
753
+ location,
754
+ type,
755
+ version,
756
+ });
757
+ }
758
+
759
+ class VulnerableActivity {
760
+ constructor({
761
+ isVulnerableActivity,
762
+ hasSatRegister,
763
+ satRegisteredDate,
764
+ isInCompliance,
765
+ }) {
766
+ this.isVulnerableActivity = isVulnerableActivity;
767
+ this.hasSatRegister = hasSatRegister;
768
+ this.satRegisteredDate = data.dateToUTC(satRegisteredDate);
769
+ this.isInCompliance = isInCompliance;
770
+ }
771
+
772
+ static fromObject = ({ ...obj }) =>
773
+ new VulnerableActivity({
774
+ isVulnerableActivity: obj.is_vulnerable_activity,
775
+ hasSatRegister: obj.has_sat_register,
776
+ satRegisteredDate: obj.sat_registered_date,
777
+ isInCompliance: obj.is_in_compliance,
526
778
  });
527
779
  }
528
780
 
529
781
  exports.AccountQuery = AccountQuery;
530
782
  exports.Address = Address;
531
783
  exports.AlertLog = AlertLog;
532
- exports.AlertLogs = AlertLogs;
533
784
  exports.AlertQuery = AlertQuery;
534
785
  exports.ApiKeyQuery = ApiKeyQuery;
786
+ exports.Audit = Audit;
535
787
  exports.BalanceEntryQuery = BalanceEntryQuery;
536
788
  exports.BillPaymentQuery = BillPaymentQuery;
537
789
  exports.BridgeAccountQuery = BridgeAccountQuery;
538
790
  exports.BridgeBankAccountQuery = BridgeBankAccountQuery;
539
791
  exports.BridgeQuery = BridgeQuery;
540
792
  exports.BridgeTransactionQuery = BridgeTransactionQuery;
793
+ exports.BusinessDetails = BusinessDetails;
541
794
  exports.CardTransactionQuery = CardTransactionQuery;
542
795
  exports.CardsQuery = CardsQuery;
543
796
  exports.DepositQuery = DepositQuery;
797
+ exports.ExternalAccount = ExternalAccount;
544
798
  exports.KYCFile = KYCFile;
545
- exports.PageSize = PageSize;
799
+ exports.LegalRepresentatives = LegalRepresentatives;
800
+ exports.License = License;
801
+ exports.PartnerQuery = PartnerQuery;
546
802
  exports.QueryParams = QueryParams;
803
+ exports.ShareholderMoral = ShareholderMoral;
547
804
  exports.StatementQuery = StatementQuery;
548
805
  exports.TOSAgreements = TOSAgreements;
549
806
  exports.TransactionQuery = TransactionQuery;
807
+ exports.TransactionalProfileServices = TransactionalProfileServices;
550
808
  exports.TransferQuery = TransferQuery;
551
809
  exports.UserQuery = UserQuery;
810
+ exports.VerificationError = VerificationError;
811
+ exports.VulnerableActivity = VulnerableActivity;
552
812
  exports.WalletQuery = WalletQuery;
553
813
  exports.WalletTransactionQuery = WalletTransactionQuery;