@lendi/act-credit-decisions-transform 2.0.18 → 2.0.19
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.
|
@@ -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: [
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* Guarantee that the uniqueId is no more than maxLength length
|
|
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
6
|
* Guarantee that the uniqueId is no more than maxLength length
|
|
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;
|