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