@lendi/act-credit-decisions-transform 2.0.18 → 2.0.20
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/schemas/public-required-document-event.json +19 -2
- package/lib/transform-events/transform-expenses.js +1 -1
- package/lib/types/events/public-required-document.d.ts +14 -0
- package/lib/types/events/public-required-document.js +8 -1
- package/lib/utils/uniqueid-tools.d.ts +2 -3
- package/lib/utils/uniqueid-tools.js +6 -6
- package/package.json +1 -1
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"applicationId": {
|
|
35
35
|
"description": "Application ID",
|
|
36
|
-
"type": "string"
|
|
36
|
+
"type": ["string"]
|
|
37
37
|
},
|
|
38
38
|
"applicantId": {
|
|
39
39
|
"description": "Application ID",
|
|
@@ -358,9 +358,26 @@
|
|
|
358
358
|
}
|
|
359
359
|
},
|
|
360
360
|
"required": ["idNumber", "idType"]
|
|
361
|
+
},
|
|
362
|
+
"entityId": {
|
|
363
|
+
"description": "Entity ID",
|
|
364
|
+
"type": ["string", "null"]
|
|
365
|
+
},
|
|
366
|
+
"entityType": {
|
|
367
|
+
"description": "Entity type - EAC only supports APPLICATION type",
|
|
368
|
+
"type": "string",
|
|
369
|
+
"enum": ["APPLICATION"]
|
|
361
370
|
}
|
|
362
371
|
},
|
|
363
|
-
"required": ["id", "
|
|
372
|
+
"required": ["id", "applicantId"],
|
|
373
|
+
"anyOf": [
|
|
374
|
+
{
|
|
375
|
+
"required": ["applicationId"]
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
"required": ["applicationId", "entityId", "entityType"]
|
|
379
|
+
}
|
|
380
|
+
]
|
|
364
381
|
}
|
|
365
382
|
}
|
|
366
383
|
}
|
|
@@ -77,7 +77,7 @@ function transformExpense(expense, applicantId, index, id) {
|
|
|
77
77
|
'@Category': enum_mappings_1.livingExpenseMapping[expense.type],
|
|
78
78
|
'@Description': expense.type,
|
|
79
79
|
// '@UniqueID': isOtherCommitment(expense) ? `${id}-commitment-${index}` : `${id}-living-expense-${index}`,
|
|
80
|
-
'@UniqueID':
|
|
80
|
+
'@UniqueID': id + '-' + (0, uniqueid_tools_1.generateUniqueExpenseId)(applicantId + '-' + expense.type),
|
|
81
81
|
'@Frequency': enum_mappings_1.frequencyMapping[expense.frequency],
|
|
82
82
|
PercentResponsible: {
|
|
83
83
|
Owner: [
|
|
@@ -23,6 +23,14 @@ export interface Payload {
|
|
|
23
23
|
*/
|
|
24
24
|
createdAt?: string;
|
|
25
25
|
eConsent?: EConsent;
|
|
26
|
+
/**
|
|
27
|
+
* Entity ID
|
|
28
|
+
*/
|
|
29
|
+
entityId?: null | string;
|
|
30
|
+
/**
|
|
31
|
+
* Entity type - EAC only supports APPLICATION type
|
|
32
|
+
*/
|
|
33
|
+
entityType?: EntityType;
|
|
26
34
|
/**
|
|
27
35
|
* Expiry Date (can be null if no expiry date set)
|
|
28
36
|
*/
|
|
@@ -47,6 +55,12 @@ export interface EConsent {
|
|
|
47
55
|
*/
|
|
48
56
|
hasConsented: boolean;
|
|
49
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Entity type - EAC only supports APPLICATION type
|
|
60
|
+
*/
|
|
61
|
+
export declare enum EntityType {
|
|
62
|
+
Application = "APPLICATION"
|
|
63
|
+
}
|
|
50
64
|
export interface Identification {
|
|
51
65
|
/**
|
|
52
66
|
* Australian State (can be null as it is an optional field)
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Type = exports.Status = exports.IssuingCountry = exports.IDType = exports.IDTitle = exports.Gender = exports.AustralianState = void 0;
|
|
3
|
+
exports.Type = exports.Status = exports.IssuingCountry = exports.IDType = exports.IDTitle = exports.Gender = exports.AustralianState = exports.EntityType = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Entity type - EAC only supports APPLICATION type
|
|
6
|
+
*/
|
|
7
|
+
var EntityType;
|
|
8
|
+
(function (EntityType) {
|
|
9
|
+
EntityType["Application"] = "APPLICATION";
|
|
10
|
+
})(EntityType || (exports.EntityType = EntityType = {}));
|
|
4
11
|
var AustralianState;
|
|
5
12
|
(function (AustralianState) {
|
|
6
13
|
AustralianState["Act"] = "ACT";
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Guarantee that the uniqueId
|
|
2
|
+
* Guarantee that the uniqueId of the expense by using md5 hashing
|
|
3
3
|
*
|
|
4
4
|
* @param id
|
|
5
|
-
* @param maxLength Maximum length limit. For ANZ it should be 100.
|
|
6
5
|
* @returns
|
|
7
6
|
*/
|
|
8
|
-
export declare const
|
|
7
|
+
export declare const generateUniqueExpenseId: (id: string) => string;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.generateUniqueExpenseId = void 0;
|
|
4
|
+
const crypto = require("crypto");
|
|
4
5
|
/**
|
|
5
|
-
* Guarantee that the uniqueId
|
|
6
|
+
* Guarantee that the uniqueId of the expense by using md5 hashing
|
|
6
7
|
*
|
|
7
8
|
* @param id
|
|
8
|
-
* @param maxLength Maximum length limit. For ANZ it should be 100.
|
|
9
9
|
* @returns
|
|
10
10
|
*/
|
|
11
|
-
const
|
|
12
|
-
return
|
|
11
|
+
const generateUniqueExpenseId = (id) => {
|
|
12
|
+
return crypto.createHash('md5').update(id).digest('hex');
|
|
13
13
|
};
|
|
14
|
-
exports.
|
|
14
|
+
exports.generateUniqueExpenseId = generateUniqueExpenseId;
|