@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': (0, uniqueid_tools_1.truncateUniqueId)(id + '-' + applicantId + '-' + expense.type),
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 truncateUniqueId: (id: string, maxLength?: number) => string;
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.truncateUniqueId = void 0;
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 truncateUniqueId = (id, maxLength = 100) => {
12
- return id.length > maxLength ? id.substring(0, maxLength - 1) : id;
11
+ const generateUniqueExpenseId = (id) => {
12
+ return crypto.createHash('md5').update(id).digest('hex');
13
13
  };
14
- exports.truncateUniqueId = truncateUniqueId;
14
+ exports.generateUniqueExpenseId = generateUniqueExpenseId;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lendi/act-credit-decisions-transform",
3
- "version": "2.0.18",
3
+ "version": "2.0.19",
4
4
  "private": false,
5
5
  "description": "Library for kafka event data transforming",
6
6
  "author": "Integrations <integrations@lendi.com.au>",