@lendi/integrations-transform 1.1.6 → 1.2.1
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/lib/index.d.ts +2 -1
- package/lib/index.js +2 -1
- package/lib/schemas/public-asset-event.json +86 -93
- package/lib/transform-events/generate-asset-liability-link.js +2 -2
- package/lib/transform-events/generate-credit-report-rebuilt.js +1 -1
- package/lib/transform-events/generate-employment.js +17 -17
- package/lib/transform-events/generate-funding-position.js +6 -6
- package/lib/transform-events/generate-liability.js +15 -15
- package/lib/transform-events/generate-opportunity.js +2 -2
- package/lib/transform-events/generate-required-document.js +7 -7
- package/lib/transform-events/transform-applicant.js +26 -29
- package/lib/transform-events/transform-application.js +7 -8
- package/lib/transform-events/transform-asset.d.ts +44 -0
- package/lib/transform-events/transform-asset.js +271 -0
- package/lib/transform-events/transform-expenses.js +6 -7
- package/lib/transform-events/{generate-income.d.ts → transform-income.d.ts} +1 -1
- package/lib/transform-events/{generate-income.js → transform-income.js} +35 -31
- package/lib/transform-events/{generate-lixi-percentowned.d.ts → transform-percent-owned.d.ts} +1 -1
- package/lib/transform-events/{generate-lixi-percentowned.js → transform-percent-owned.js} +3 -3
- package/lib/types/enum-mappings/asset-type.d.ts +3 -0
- package/lib/types/enum-mappings/asset-type.js +18 -0
- package/lib/types/enum-mappings/index.d.ts +26 -0
- package/lib/types/enum-mappings/index.js +38 -0
- package/lib/types/enum-mappings/to-be-purchased.d.ts +5 -0
- package/lib/types/enum-mappings/to-be-purchased.js +8 -0
- package/lib/types/enum-mappings/to-be-used-as-security.d.ts +5 -0
- package/lib/types/enum-mappings/to-be-used-as-security.js +8 -0
- package/lib/types/events/public-asset.d.ts +16 -17
- package/lib/types/events/public-asset.js +3 -0
- package/lib/utils/address-tools.d.ts +14 -1
- package/lib/utils/address-tools.js +35 -3
- package/lib/utils/generate-address.d.ts +3 -4
- package/lib/utils/generate-address.js +8 -9
- package/lib/utils/is-asset-type.d.ts +25 -0
- package/lib/utils/is-asset-type.js +46 -0
- package/lib/utils/normalise-date.js +1 -1
- package/package.json +4 -4
- package/lib/transform-events/generate-asset.d.ts +0 -17
- package/lib/transform-events/generate-asset.js +0 -178
package/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './transform-events/transform-applicant';
|
|
2
2
|
export * from './transform-events/transform-application';
|
|
3
|
-
export * from './transform-events/
|
|
3
|
+
export * from './transform-events/transform-income';
|
|
4
|
+
export * from './transform-events/transform-asset';
|
|
4
5
|
export * from './transform-events/transform-expenses';
|
|
5
6
|
export * from './transform-events/generate-liability';
|
|
6
7
|
export * from './transform-events/generate-required-document';
|
package/lib/index.js
CHANGED
|
@@ -13,7 +13,8 @@ exports.__esModule = true;
|
|
|
13
13
|
/* istanbul ignore file */
|
|
14
14
|
__exportStar(require("./transform-events/transform-applicant"), exports);
|
|
15
15
|
__exportStar(require("./transform-events/transform-application"), exports);
|
|
16
|
-
__exportStar(require("./transform-events/
|
|
16
|
+
__exportStar(require("./transform-events/transform-income"), exports);
|
|
17
|
+
__exportStar(require("./transform-events/transform-asset"), exports);
|
|
17
18
|
__exportStar(require("./transform-events/transform-expenses"), exports);
|
|
18
19
|
__exportStar(require("./transform-events/generate-liability"), exports);
|
|
19
20
|
__exportStar(require("./transform-events/generate-required-document"), exports);
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"definitions": {
|
|
3
|
+
"payload": {
|
|
4
|
+
"type": "object",
|
|
5
|
+
"$ref": "#/definitions/createAssetDefinition"
|
|
6
|
+
},
|
|
7
|
+
"id": {
|
|
8
|
+
"type": "string"
|
|
9
|
+
},
|
|
3
10
|
"meta": {
|
|
4
11
|
"type": "object",
|
|
5
12
|
"additionalProperties": false,
|
|
@@ -16,22 +23,9 @@
|
|
|
16
23
|
},
|
|
17
24
|
"required": ["actionedBy", "actionedByRole"]
|
|
18
25
|
},
|
|
19
|
-
"Ownership": {
|
|
20
|
-
"type": "object",
|
|
21
|
-
"properties": {
|
|
22
|
-
"applicantId": {
|
|
23
|
-
"type": "string",
|
|
24
|
-
"format": "uuid"
|
|
25
|
-
},
|
|
26
|
-
"percent": {
|
|
27
|
-
"type": "number",
|
|
28
|
-
"description": "how much percent for the corresponding applicant",
|
|
29
|
-
"examples": [0.5]
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
26
|
"applicantOwnership": {
|
|
34
27
|
"type": "object",
|
|
28
|
+
"required": ["applicantId", "percent"],
|
|
35
29
|
"properties": {
|
|
36
30
|
"applicantId": {
|
|
37
31
|
"type": "string",
|
|
@@ -45,11 +39,11 @@
|
|
|
45
39
|
"description": "how much percent for the corresponding applicant",
|
|
46
40
|
"examples": [0.5]
|
|
47
41
|
}
|
|
48
|
-
}
|
|
49
|
-
"required": ["percent", "applicantId"]
|
|
42
|
+
}
|
|
50
43
|
},
|
|
51
44
|
"percentOwned": {
|
|
52
45
|
"type": "object",
|
|
46
|
+
"required": ["owners"],
|
|
53
47
|
"properties": {
|
|
54
48
|
"proportions": {
|
|
55
49
|
"enum": ["EQUAL", "SPECIFIED", "NOT_SPECIFIED"],
|
|
@@ -93,6 +87,33 @@
|
|
|
93
87
|
"type": "string",
|
|
94
88
|
"description": "Description of the entity."
|
|
95
89
|
},
|
|
90
|
+
"address": {
|
|
91
|
+
"type": "object",
|
|
92
|
+
"properties": {
|
|
93
|
+
"postcode": {
|
|
94
|
+
"description": "A 4 digit postcode",
|
|
95
|
+
"type": "string"
|
|
96
|
+
},
|
|
97
|
+
"state": {
|
|
98
|
+
"description": "One our great nation's states",
|
|
99
|
+
"type": "string"
|
|
100
|
+
},
|
|
101
|
+
"city": {
|
|
102
|
+
"description": "The suburb name",
|
|
103
|
+
"type": "string"
|
|
104
|
+
},
|
|
105
|
+
"country": {
|
|
106
|
+
"$ref": "#/definitions/countries"
|
|
107
|
+
},
|
|
108
|
+
"formatted": {
|
|
109
|
+
"description": "A formatted version of the address",
|
|
110
|
+
"type": "string"
|
|
111
|
+
},
|
|
112
|
+
"standard": {
|
|
113
|
+
"$ref": "#/definitions/addressStandard"
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
},
|
|
96
117
|
"countries": {
|
|
97
118
|
"type": "string",
|
|
98
119
|
"example": "Australia",
|
|
@@ -338,84 +359,36 @@
|
|
|
338
359
|
"Zimbabwe"
|
|
339
360
|
]
|
|
340
361
|
},
|
|
341
|
-
"address": {
|
|
342
|
-
"type": "object",
|
|
343
|
-
"additionalProperties": false,
|
|
344
|
-
"properties": {
|
|
345
|
-
"city": {
|
|
346
|
-
"description": "The city / suburb name",
|
|
347
|
-
"type": "string",
|
|
348
|
-
"example": "Sydney"
|
|
349
|
-
},
|
|
350
|
-
"country": {
|
|
351
|
-
"$ref": "#/definitions/countries"
|
|
352
|
-
},
|
|
353
|
-
"formatted": {
|
|
354
|
-
"description": "A formatted version of the address",
|
|
355
|
-
"type": "string",
|
|
356
|
-
"example": "L 9, 50 Pitt St, Sydney, NSW 2000, Australia"
|
|
357
|
-
},
|
|
358
|
-
"postcode": {
|
|
359
|
-
"description": "N digit postcode (for AU addresses, usually 4)",
|
|
360
|
-
"type": "string",
|
|
361
|
-
"example": "2000"
|
|
362
|
-
},
|
|
363
|
-
"standard": {
|
|
364
|
-
"$ref": "#/definitions/addressStandard"
|
|
365
|
-
},
|
|
366
|
-
"state": {
|
|
367
|
-
"description": "The state name",
|
|
368
|
-
"type": "string"
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
},
|
|
372
362
|
"addressStandard": {
|
|
373
363
|
"type": "object",
|
|
374
364
|
"properties": {
|
|
375
365
|
"buildingName": {
|
|
376
366
|
"description": "The building name",
|
|
377
|
-
"type": "string"
|
|
378
|
-
"example": "Opera House"
|
|
379
|
-
},
|
|
380
|
-
"deliveryAddress": {
|
|
381
|
-
"description": "Postal address, usually a PO Box or Locked Bag",
|
|
382
|
-
"type": "string",
|
|
383
|
-
"example": "PO Box 1"
|
|
367
|
+
"type": "string"
|
|
384
368
|
},
|
|
385
369
|
"level": {
|
|
386
370
|
"description": "The level of the unit/apartment",
|
|
387
|
-
"type": "string"
|
|
388
|
-
"example": "L 9"
|
|
371
|
+
"type": "string"
|
|
389
372
|
},
|
|
390
373
|
"lotSection": {
|
|
391
374
|
"description": "The lot number",
|
|
392
|
-
"type": "string"
|
|
393
|
-
"example": "Lot 1"
|
|
375
|
+
"type": "string"
|
|
394
376
|
},
|
|
395
377
|
"streetName": {
|
|
396
378
|
"description": "The street name",
|
|
397
|
-
"type": "string"
|
|
398
|
-
"example": "Pitt"
|
|
379
|
+
"type": "string"
|
|
399
380
|
},
|
|
400
381
|
"streetNumber": {
|
|
401
382
|
"description": "The street number",
|
|
402
|
-
"type": "string"
|
|
403
|
-
"example": "50"
|
|
404
|
-
},
|
|
405
|
-
"streetSuffix": {
|
|
406
|
-
"description": "The street suffix",
|
|
407
|
-
"type": "string",
|
|
408
|
-
"example": "North"
|
|
383
|
+
"type": "string"
|
|
409
384
|
},
|
|
410
385
|
"streetType": {
|
|
411
386
|
"description": "The type of the street i.e. road",
|
|
412
|
-
"type": "string"
|
|
413
|
-
"example": "St"
|
|
387
|
+
"type": "string"
|
|
414
388
|
},
|
|
415
389
|
"unit": {
|
|
416
390
|
"description": "The unit number",
|
|
417
|
-
"type": "string"
|
|
418
|
-
"example": "U 1"
|
|
391
|
+
"type": "string"
|
|
419
392
|
}
|
|
420
393
|
}
|
|
421
394
|
},
|
|
@@ -494,6 +467,25 @@
|
|
|
494
467
|
"financialInstitutionShortName": {
|
|
495
468
|
"type": "string"
|
|
496
469
|
},
|
|
470
|
+
"FinancialInstitutionBsb": {
|
|
471
|
+
"type": "string",
|
|
472
|
+
"pattern": "^\\d{6}$",
|
|
473
|
+
"description": "The BSB number identifying where the account is held within the Financial Institution",
|
|
474
|
+
"example": "123456"
|
|
475
|
+
},
|
|
476
|
+
"FinancialInstitutionAccountNumber": {
|
|
477
|
+
"type": "string",
|
|
478
|
+
"pattern": "^\\d{0,10}$",
|
|
479
|
+
"description": "The unique number assigned to the Financial Institution account",
|
|
480
|
+
"example": "999994"
|
|
481
|
+
},
|
|
482
|
+
"dataType": {
|
|
483
|
+
"type": "string"
|
|
484
|
+
},
|
|
485
|
+
"relationId": {
|
|
486
|
+
"$ref": "#/definitions/id",
|
|
487
|
+
"description": "uuid of relation"
|
|
488
|
+
},
|
|
497
489
|
"assetType": {
|
|
498
490
|
"enum": [
|
|
499
491
|
"GIFTS",
|
|
@@ -520,6 +512,9 @@
|
|
|
520
512
|
"description": {
|
|
521
513
|
"type": "string"
|
|
522
514
|
},
|
|
515
|
+
"dataType": {
|
|
516
|
+
"$ref": "#/definitions/dataType"
|
|
517
|
+
},
|
|
523
518
|
"type": {
|
|
524
519
|
"$ref": "#/definitions/assetType"
|
|
525
520
|
},
|
|
@@ -532,6 +527,12 @@
|
|
|
532
527
|
"financialInstitutionShortName": {
|
|
533
528
|
"$ref": "#/definitions/financialInstitutionShortName"
|
|
534
529
|
},
|
|
530
|
+
"financialInstitutionBsb": {
|
|
531
|
+
"$ref": "#/definitions/FinancialInstitutionBsb"
|
|
532
|
+
},
|
|
533
|
+
"financialInstitutionAccountNumber": {
|
|
534
|
+
"$ref": "#/definitions/FinancialInstitutionAccountNumber"
|
|
535
|
+
},
|
|
535
536
|
"toBeSold": {
|
|
536
537
|
"$ref": "#/definitions/toBeSold"
|
|
537
538
|
},
|
|
@@ -562,6 +563,9 @@
|
|
|
562
563
|
"propertyType": {
|
|
563
564
|
"$ref": "#/definitions/propertyType"
|
|
564
565
|
},
|
|
566
|
+
"relationId": {
|
|
567
|
+
"$ref": "#/definitions/relationId"
|
|
568
|
+
},
|
|
565
569
|
"contractDetails": {
|
|
566
570
|
"$ref": "#/definitions/contractDetails"
|
|
567
571
|
},
|
|
@@ -578,21 +582,14 @@
|
|
|
578
582
|
"$ref": "#/definitions/year"
|
|
579
583
|
}
|
|
580
584
|
},
|
|
585
|
+
"additionalProperties": true,
|
|
581
586
|
"required": ["type"]
|
|
582
587
|
},
|
|
583
|
-
"
|
|
584
|
-
"type": "string",
|
|
585
|
-
"enum": ["QLD", "NSW", "VIC", "WA", "SA", "TAS", "ACT", "NT"]
|
|
586
|
-
},
|
|
587
|
-
"otherState": {
|
|
588
|
-
"type": "string",
|
|
589
|
-
"example": "Ohio"
|
|
590
|
-
},
|
|
591
|
-
"AssetDefinition": {
|
|
588
|
+
"createAssetDefinition": {
|
|
592
589
|
"type": "object",
|
|
593
590
|
"properties": {
|
|
594
591
|
"id": {
|
|
595
|
-
"
|
|
592
|
+
"$ref": "#/definitions/id",
|
|
596
593
|
"description": "uuid of asset"
|
|
597
594
|
},
|
|
598
595
|
"meta": {
|
|
@@ -606,27 +603,23 @@
|
|
|
606
603
|
}
|
|
607
604
|
},
|
|
608
605
|
"required": ["id", "applicationId", "asset"],
|
|
609
|
-
"description": "create
|
|
610
|
-
},
|
|
611
|
-
"Amount": {
|
|
612
|
-
"type": "number",
|
|
613
|
-
"example": 100000
|
|
606
|
+
"description": "create Asset payload"
|
|
614
607
|
}
|
|
615
608
|
},
|
|
616
609
|
"type": "object",
|
|
617
|
-
"title": "The
|
|
618
|
-
"description": "Create
|
|
610
|
+
"title": "The asset event schema",
|
|
611
|
+
"description": "Create or update",
|
|
619
612
|
"properties": {
|
|
620
|
-
"
|
|
613
|
+
"type": {
|
|
621
614
|
"type": "string",
|
|
615
|
+
"enum": ["AssetUpdated", "AssetCreated"],
|
|
622
616
|
"description": "schema version"
|
|
623
617
|
},
|
|
624
|
-
"
|
|
625
|
-
"type": "string"
|
|
626
|
-
"enum": ["AssetCreated", "AssetUpdated"]
|
|
618
|
+
"version": {
|
|
619
|
+
"type": "string"
|
|
627
620
|
},
|
|
628
621
|
"payload": {
|
|
629
|
-
"$ref": "#/definitions/
|
|
622
|
+
"$ref": "#/definitions/payload"
|
|
630
623
|
}
|
|
631
624
|
},
|
|
632
625
|
"required": ["version", "payload", "type"]
|
|
@@ -14,8 +14,8 @@ function generateAssetLiabilityLink(_a) {
|
|
|
14
14
|
var partialApplication = {};
|
|
15
15
|
var assetLiabilityMapping = {
|
|
16
16
|
applicationId: application_paths_1.paths.ApplicationId,
|
|
17
|
-
liabilityId:
|
|
18
|
-
assetId:
|
|
17
|
+
liabilityId: application_paths_1.paths.Liability + ".@UniqueID",
|
|
18
|
+
assetId: application_paths_1.paths.Liability + ".Security[0].@x_Security"
|
|
19
19
|
};
|
|
20
20
|
(0, lodash_1.set)(partialApplication, assetLiabilityMapping.applicationId, applicationId);
|
|
21
21
|
for (var _i = 0, _b = Object.entries(relation); _i < _b.length; _i++) {
|
|
@@ -12,7 +12,7 @@ var application_paths_1 = require("@lendi/integrations-protocol/lib/utils/applic
|
|
|
12
12
|
*/
|
|
13
13
|
function generateCreditReportRebuilt(creditReport) {
|
|
14
14
|
var applicantId = creditReport.applicantId, raw = creditReport.raw, source = creditReport.source;
|
|
15
|
-
var id =
|
|
15
|
+
var id = applicantId + "-creditReport";
|
|
16
16
|
var attachment = {
|
|
17
17
|
'@Filename': 'Credit Report',
|
|
18
18
|
'@UniqueID': id,
|
|
@@ -29,7 +29,7 @@ function generateEmployment(employment) {
|
|
|
29
29
|
isEmployed = true;
|
|
30
30
|
employmentPath = application_paths_1.paths.PAYG;
|
|
31
31
|
// Setting default for onProbation. If field exists in event value will get overwritten.
|
|
32
|
-
(0, lodash_1.set)(partialApplication,
|
|
32
|
+
(0, lodash_1.set)(partialApplication, employmentPath + ".@OnProbation", lixi_internal_request_1.YesNoList.No);
|
|
33
33
|
break;
|
|
34
34
|
case public_employment_1.EmploymentType.SelfEmployed:
|
|
35
35
|
isEmployed = true;
|
|
@@ -37,24 +37,24 @@ function generateEmployment(employment) {
|
|
|
37
37
|
break;
|
|
38
38
|
case public_employment_1.EmploymentType.NotWorking:
|
|
39
39
|
employmentPath = application_paths_1.paths.NotEmployed;
|
|
40
|
-
(0, lodash_1.set)(partialApplication,
|
|
41
|
-
(0, lodash_1.set)(partialApplication,
|
|
40
|
+
(0, lodash_1.set)(partialApplication, employmentPath + ".Income.@OtherIncomeAmount", 0);
|
|
41
|
+
(0, lodash_1.set)(partialApplication, employmentPath + ".Income.@OtherIncomeFrequency", lixi_internal_request_1.List.Fortnightly);
|
|
42
42
|
break;
|
|
43
43
|
default:
|
|
44
|
-
logger_1.logger.warn({ message: "Unknown EmploymentType "
|
|
44
|
+
logger_1.logger.warn({ message: "Unknown EmploymentType " + employment.employmentType, applicationId: applicationId });
|
|
45
45
|
}
|
|
46
46
|
var employmentMapping = {
|
|
47
47
|
applicationId: application_paths_1.paths.ApplicationId,
|
|
48
|
-
applicantId:
|
|
49
|
-
id:
|
|
50
|
-
abn:
|
|
51
|
-
businessName:
|
|
52
|
-
type:
|
|
53
|
-
employmentBasis:
|
|
54
|
-
startDate:
|
|
55
|
-
endDate:
|
|
56
|
-
role:
|
|
57
|
-
onProbation:
|
|
48
|
+
applicantId: application_paths_1.paths.PersonApplicant + ".@UniqueID",
|
|
49
|
+
id: employmentPath + ".@UniqueID",
|
|
50
|
+
abn: application_paths_1.paths.RelatedCompany + ".@ABN",
|
|
51
|
+
businessName: application_paths_1.paths.RelatedCompany + ".@BusinessName",
|
|
52
|
+
type: employmentPath + ".@Status",
|
|
53
|
+
employmentBasis: employmentPath + ".@Basis",
|
|
54
|
+
startDate: employmentPath + ".@StartDate",
|
|
55
|
+
endDate: employmentPath + ".@EndDate",
|
|
56
|
+
role: employmentPath + ".@Occupation",
|
|
57
|
+
onProbation: employmentPath + ".@OnProbation"
|
|
58
58
|
};
|
|
59
59
|
for (var _i = 0, _a = Object.entries(employment); _i < _a.length; _i++) {
|
|
60
60
|
var _b = _a[_i], key = _b[0], value = _b[1];
|
|
@@ -76,8 +76,8 @@ function generateEmployment(employment) {
|
|
|
76
76
|
case 'id':
|
|
77
77
|
(0, lodash_1.set)(partialApplication, employmentMapping[key], value);
|
|
78
78
|
if (isEmployed) {
|
|
79
|
-
(0, lodash_1.set)(partialApplication,
|
|
80
|
-
(0, lodash_1.set)(partialApplication,
|
|
79
|
+
(0, lodash_1.set)(partialApplication, employmentPath + ".@x_Employer", value + "-businessName");
|
|
80
|
+
(0, lodash_1.set)(partialApplication, application_paths_1.paths.RelatedCompany + ".@UniqueID", value + "-businessName");
|
|
81
81
|
}
|
|
82
82
|
break;
|
|
83
83
|
case 'onProbation':
|
|
@@ -89,7 +89,7 @@ function generateEmployment(employment) {
|
|
|
89
89
|
case 'role':
|
|
90
90
|
var _c = value.anzsco, anzsco = _c === void 0 ? {} : _c;
|
|
91
91
|
if (anzsco.code) {
|
|
92
|
-
(0, lodash_1.set)(partialApplication,
|
|
92
|
+
(0, lodash_1.set)(partialApplication, employmentPath + ".@ANZSCOOccupationCode", anzsco.code.toString());
|
|
93
93
|
}
|
|
94
94
|
if (anzsco.occupation) {
|
|
95
95
|
(0, lodash_1.set)(partialApplication, employmentMapping[key], anzsco.occupation);
|
|
@@ -16,11 +16,11 @@ function generateFundingPosition(fundingPosition) {
|
|
|
16
16
|
var applicationId = fundingPosition.applicationId, id = fundingPosition.id;
|
|
17
17
|
var fundingPositionMapping = {
|
|
18
18
|
applicationId: application_paths_1.paths.ApplicationId,
|
|
19
|
-
fundsRequested:
|
|
20
|
-
lvr:
|
|
19
|
+
fundsRequested: application_paths_1.paths.RolledUpAmounts + ".@TotalNewFunds",
|
|
20
|
+
lvr: application_paths_1.paths.Summary + ".LoanToValuationRatio.@ApplicationLVR",
|
|
21
21
|
totalGovernmentContributions: application_paths_1.paths.ContributionFunds,
|
|
22
22
|
totalDeposit: application_paths_1.paths.ContributionFunds,
|
|
23
|
-
totalCashOut:
|
|
23
|
+
totalCashOut: application_paths_1.paths.EquityRelease + ".Amount.@LumpSum",
|
|
24
24
|
fundsRequiredBreakdown: application_paths_1.paths.SummaryFee
|
|
25
25
|
};
|
|
26
26
|
for (var _i = 0, _a = Object.entries(fundingPosition); _i < _a.length; _i++) {
|
|
@@ -32,7 +32,7 @@ function generateFundingPosition(fundingPosition) {
|
|
|
32
32
|
contributionFunds.push({
|
|
33
33
|
'@Amount': value,
|
|
34
34
|
'@Type': funding_position_1.contributionMapping[key],
|
|
35
|
-
'@UniqueID':
|
|
35
|
+
'@UniqueID': id + "-" + key
|
|
36
36
|
});
|
|
37
37
|
break;
|
|
38
38
|
case 'fundsRequiredBreakdown':
|
|
@@ -40,7 +40,7 @@ function generateFundingPosition(fundingPosition) {
|
|
|
40
40
|
break;
|
|
41
41
|
case 'totalCashOut':
|
|
42
42
|
(0, lodash_1.set)(partialApplication, fundingPositionMapping[key], value);
|
|
43
|
-
(0, lodash_1.set)(partialApplication,
|
|
43
|
+
(0, lodash_1.set)(partialApplication, application_paths_1.paths.LoanDetail + ".@UniqueID", applicationId + "-loanDetails");
|
|
44
44
|
break;
|
|
45
45
|
case 'fundsRequested':
|
|
46
46
|
(0, lodash_1.set)(partialApplication, fundingPositionMapping[key], Math.round(value));
|
|
@@ -71,7 +71,7 @@ function getFees(fundsRequiredBreakDown, id) {
|
|
|
71
71
|
'@Amount': value,
|
|
72
72
|
'@Category': funding_position_1.categoryMapping[key],
|
|
73
73
|
'@Type': funding_position_1.typeMapping[key],
|
|
74
|
-
'@UniqueID':
|
|
74
|
+
'@UniqueID': id + "-" + key
|
|
75
75
|
};
|
|
76
76
|
if (descriptionList.includes(key)) {
|
|
77
77
|
fee['@Description'] = funding_position_1.descriptionMapping[key];
|
|
@@ -8,7 +8,7 @@ var liability_payment_type_1 = require("../types/enum-mappings/liability-payment
|
|
|
8
8
|
var liability_type_1 = require("../types/enum-mappings/liability-type");
|
|
9
9
|
var get_financial_institution_1 = require("../utils/get-financial-institution");
|
|
10
10
|
var round_decimal_1 = require("../utils/round-decimal");
|
|
11
|
-
var
|
|
11
|
+
var transform_percent_owned_1 = require("./transform-percent-owned");
|
|
12
12
|
var lixi_internal_request_1 = require("@lendi/integrations-protocol/lib/types/lixi-internal-request");
|
|
13
13
|
/**
|
|
14
14
|
* Generates a partial internal request from a liability event payload.
|
|
@@ -21,19 +21,19 @@ function generateLiability(_a) {
|
|
|
21
21
|
var partialApplication = {};
|
|
22
22
|
var liabilityMapping = {
|
|
23
23
|
applicationId: application_paths_1.paths.ApplicationId,
|
|
24
|
-
annualInterestRate:
|
|
25
|
-
id:
|
|
26
|
-
clearingFromThisLoan:
|
|
27
|
-
description:
|
|
28
|
-
financialInstitution:
|
|
29
|
-
newLimit:
|
|
30
|
-
repaymentAmount:
|
|
31
|
-
repaymentFrequency:
|
|
32
|
-
remainingTermDuration:
|
|
33
|
-
repaymentTypeDetails:
|
|
34
|
-
outstandingBalance:
|
|
35
|
-
type:
|
|
36
|
-
percentOwned:
|
|
24
|
+
annualInterestRate: application_paths_1.paths.Liability + ".@AnnualInterestRate",
|
|
25
|
+
id: application_paths_1.paths.Liability + ".@UniqueID",
|
|
26
|
+
clearingFromThisLoan: application_paths_1.paths.Liability + ".@ClearingFromThisLoan",
|
|
27
|
+
description: application_paths_1.paths.Liability + ".@Description",
|
|
28
|
+
financialInstitution: application_paths_1.paths.Liability + ".AccountNumber.@FinancialInstitution",
|
|
29
|
+
newLimit: application_paths_1.paths.Liability + ".@CreditLimit",
|
|
30
|
+
repaymentAmount: application_paths_1.paths.Liability + ".Repayment[0].@RepaymentAmount",
|
|
31
|
+
repaymentFrequency: application_paths_1.paths.Liability + ".Repayment[0].@RepaymentFrequency",
|
|
32
|
+
remainingTermDuration: application_paths_1.paths.Liability + ".RemainingTerm.@Duration",
|
|
33
|
+
repaymentTypeDetails: application_paths_1.paths.Liability + ".Repayment[0].@PaymentType",
|
|
34
|
+
outstandingBalance: application_paths_1.paths.Liability + ".@OutstandingBalance",
|
|
35
|
+
type: application_paths_1.paths.Liability + ".@Type",
|
|
36
|
+
percentOwned: application_paths_1.paths.Liability + ".PercentOwned"
|
|
37
37
|
};
|
|
38
38
|
(0, lodash_1.set)(partialApplication, liabilityMapping.applicationId, applicationId);
|
|
39
39
|
(0, lodash_1.set)(partialApplication, liabilityMapping.id, id);
|
|
@@ -71,7 +71,7 @@ function generateLiability(_a) {
|
|
|
71
71
|
(0, lodash_1.set)(partialApplication, liabilityMapping[key], financialInstitution);
|
|
72
72
|
break;
|
|
73
73
|
case 'percentOwned':
|
|
74
|
-
var percentOwned = (0,
|
|
74
|
+
var percentOwned = (0, transform_percent_owned_1.transformPercentOwned)(value);
|
|
75
75
|
if (percentOwned) {
|
|
76
76
|
(0, lodash_1.set)(partialApplication, liabilityMapping[key], percentOwned);
|
|
77
77
|
}
|
|
@@ -19,8 +19,8 @@ function generateOpportunity(opportunity) {
|
|
|
19
19
|
var _b = _a[_i], key = _b[0], value = _b[1];
|
|
20
20
|
if (opportunityMapping[key]) {
|
|
21
21
|
if (key === 'stage') {
|
|
22
|
-
(0, lodash_1.set)(partialApplication,
|
|
23
|
-
(0, lodash_1.set)(partialApplication,
|
|
22
|
+
(0, lodash_1.set)(partialApplication, application_paths_1.paths.Instructions + ".@UniqueID", opportunity.id + "-stage");
|
|
23
|
+
(0, lodash_1.set)(partialApplication, opportunityMapping[key] + ".@Details", value || 'Unknown');
|
|
24
24
|
}
|
|
25
25
|
else {
|
|
26
26
|
(0, lodash_1.set)(partialApplication, opportunityMapping[key], value);
|
|
@@ -17,7 +17,7 @@ var public_required_document_1 = require("../types/events/public-required-docume
|
|
|
17
17
|
function generateRequiredDocument(requiredDocument) {
|
|
18
18
|
var partialApplication = {};
|
|
19
19
|
var requiredDocsMapping = {
|
|
20
|
-
applicantId:
|
|
20
|
+
applicantId: application_paths_1.paths.PersonApplicant + ".@UniqueID",
|
|
21
21
|
applicationId: application_paths_1.paths.ApplicationId,
|
|
22
22
|
eConsent: application_paths_1.paths.Privacy,
|
|
23
23
|
identification: application_paths_1.paths.ProofOfIdentity
|
|
@@ -28,20 +28,20 @@ function generateRequiredDocument(requiredDocument) {
|
|
|
28
28
|
switch (key) {
|
|
29
29
|
case 'identification':
|
|
30
30
|
var _c = value, idType = _c.idType, idNumber = _c.idNumber, _d = _c.idTitle, idTitle = _d === void 0 ? public_required_document_1.IDTitle.Unknown : _d, gender = _c.gender;
|
|
31
|
-
(0, lodash_1.set)(partialApplication,
|
|
32
|
-
(0, lodash_1.set)(partialApplication,
|
|
31
|
+
(0, lodash_1.set)(partialApplication, application_paths_1.paths.ProofOfIdentity + ".@DocumentType", proof_of_identity_1.proofOfIdentityMapping[idType]);
|
|
32
|
+
(0, lodash_1.set)(partialApplication, application_paths_1.paths.ProofOfIdentity + ".@DocumentNumber", idNumber);
|
|
33
33
|
if (gender) {
|
|
34
|
-
(0, lodash_1.set)(partialApplication,
|
|
34
|
+
(0, lodash_1.set)(partialApplication, application_paths_1.paths.PersonApplicant + ".@Gender", (0, lodash_1.capitalize)(gender));
|
|
35
35
|
}
|
|
36
36
|
else {
|
|
37
|
-
(0, lodash_1.set)(partialApplication,
|
|
37
|
+
(0, lodash_1.set)(partialApplication, application_paths_1.paths.PersonApplicant + ".@Gender", title_gender_1.titleGenderMapping[idTitle]);
|
|
38
38
|
}
|
|
39
39
|
break;
|
|
40
40
|
case 'eConsent':
|
|
41
41
|
var _e = requiredDocument.eConsent.consentedAt, consentedAt = _e === void 0 ? new Date() : _e;
|
|
42
42
|
var hasValidConsent = requiredDocument.status === public_required_document_1.Status.Verified ? lixi_internal_request_1.YesNoList.Yes : lixi_internal_request_1.YesNoList.No;
|
|
43
|
-
(0, lodash_1.set)(partialApplication,
|
|
44
|
-
(0, lodash_1.set)(partialApplication,
|
|
43
|
+
(0, lodash_1.set)(partialApplication, application_paths_1.paths.Privacy + ".@CreditAuthoritySigned", hasValidConsent);
|
|
44
|
+
(0, lodash_1.set)(partialApplication, application_paths_1.paths.Privacy + ".@DateSigned", (0, date_fns_1.format)(new Date(consentedAt), 'yyyy-MM-dd'));
|
|
45
45
|
break;
|
|
46
46
|
default:
|
|
47
47
|
(0, lodash_1.set)(partialApplication, requiredDocsMapping[key], value);
|