gemcap-be-common 1.4.233 → 1.4.235

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.
@@ -12,8 +12,7 @@ const extractReferenceValue = (reference, key) => {
12
12
  return '';
13
13
  }
14
14
  let value = match[1].trim();
15
- // Remove trailing account markers like /AC- or /BC-
16
- value = value.split('/')[0].trim();
15
+ value = value.trim();
17
16
  // Remove NOTPROVIDED if present
18
17
  value = value.replace(/NOTPROVIDED/gi, '').trim();
19
18
  // Collapse multiple spaces (incl. tabs) into a single space
@@ -14,8 +14,7 @@ const extractReferenceValue = (reference: string, key: string): string => {
14
14
 
15
15
  let value = match[1].trim();
16
16
 
17
- // Remove trailing account markers like /AC- or /BC-
18
- value = value.split('/')[0].trim();
17
+ value = value.trim();
19
18
 
20
19
  // Remove NOTPROVIDED if present
21
20
  value = value.replace(/NOTPROVIDED/gi, '').trim();
@@ -52,6 +52,7 @@ export interface ILoanTransaction {
52
52
  amount: number;
53
53
  description: string;
54
54
  reference: string;
55
+ referenceRaw?: string;
55
56
  customerId: string;
56
57
  bankId: mongoose.Types.ObjectId;
57
58
  transactionType: ELoanTransactionTypes;
@@ -81,6 +81,11 @@ exports.LoanTransactionSchema = new mongoose_1.default.Schema({
81
81
  type: String,
82
82
  trim: true,
83
83
  },
84
+ referenceRaw: {
85
+ type: String,
86
+ trim: true,
87
+ required: false,
88
+ },
84
89
  customerId: {
85
90
  type: String,
86
91
  trim: true,
@@ -61,6 +61,7 @@ export interface ILoanTransaction {
61
61
  amount: number;
62
62
  description: string;
63
63
  reference: string;
64
+ referenceRaw?: string;
64
65
  customerId: string;
65
66
  bankId: mongoose.Types.ObjectId;
66
67
  transactionType: ELoanTransactionTypes;
@@ -159,6 +160,11 @@ export const LoanTransactionSchema = new mongoose.Schema<ILoanTransactionDoc, IL
159
160
  type: String,
160
161
  trim: true,
161
162
  },
163
+ referenceRaw: {
164
+ type: String,
165
+ trim: true,
166
+ required: false,
167
+ },
162
168
  customerId: {
163
169
  type: String,
164
170
  trim: true,
@@ -31,10 +31,10 @@ export declare const allSchemas: {
31
31
  createdAt: NativeDate;
32
32
  updatedAt: NativeDate;
33
33
  } & {
34
- bbcSheetId: import("mongoose").Types.ObjectId;
34
+ amount: number;
35
35
  order: number;
36
+ bbcSheetId: import("mongoose").Types.ObjectId;
36
37
  apDate: Date;
37
- amount: number;
38
38
  __v?: number;
39
39
  poNumber?: string;
40
40
  customerName?: string;
@@ -45,10 +45,10 @@ export declare const allSchemas: {
45
45
  createdAt: NativeDate;
46
46
  updatedAt: NativeDate;
47
47
  } & {
48
- bbcSheetId: import("mongoose").Types.ObjectId;
48
+ amount: number;
49
49
  order: number;
50
+ bbcSheetId: import("mongoose").Types.ObjectId;
50
51
  apDate: Date;
51
- amount: number;
52
52
  __v?: number;
53
53
  poNumber?: string;
54
54
  customerName?: string;
@@ -59,10 +59,10 @@ export declare const allSchemas: {
59
59
  createdAt: NativeDate;
60
60
  updatedAt: NativeDate;
61
61
  } & {
62
- bbcSheetId: import("mongoose").Types.ObjectId;
62
+ amount: number;
63
63
  order: number;
64
+ bbcSheetId: import("mongoose").Types.ObjectId;
64
65
  apDate: Date;
65
- amount: number;
66
66
  __v?: number;
67
67
  poNumber?: string;
68
68
  customerName?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gemcap-be-common",
3
- "version": "1.4.233",
3
+ "version": "1.4.235",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -316,6 +316,7 @@ class BankUploadedTransactionsService {
316
316
  effectiveDate: null,
317
317
  productId: foundCashAllocationProduct.productId,
318
318
  reference: splitTransaction ? splitTransaction.memo : (0, bank_reference_helper_1.convertBankReferenceToTransactionReference)(transactionToConvert.reference),
319
+ referenceRaw: splitTransaction ? splitTransaction.memo : transactionToConvert.reference,
319
320
  transactionType: transaction.amount > 0 ? LoanTransaction_model_1.ELoanTransactionTypes.COLLECTION : LoanTransaction_model_1.ELoanTransactionTypes.DISBURSEMENT,
320
321
  balance: 0,
321
322
  floatedBalance: 0,
@@ -354,6 +354,7 @@ export class BankUploadedTransactionsService {
354
354
  effectiveDate: null,
355
355
  productId: foundCashAllocationProduct.productId,
356
356
  reference: splitTransaction ? splitTransaction.memo : convertBankReferenceToTransactionReference(transactionToConvert.reference),
357
+ referenceRaw: splitTransaction ? splitTransaction.memo : transactionToConvert.reference,
357
358
  transactionType: transaction.amount > 0 ? ELoanTransactionTypes.COLLECTION : ELoanTransactionTypes.DISBURSEMENT,
358
359
  balance: 0,
359
360
  floatedBalance: 0,
@@ -155,7 +155,7 @@ export declare class LoanTransactionsService {
155
155
  getTransactionReport(transactionIds: string[], borrowerId: string, effectiveDate: Date): Promise<{
156
156
  transactionIdsToMark: string[];
157
157
  transactions: {
158
- [x: string]: (string | number | Date | string[])[];
158
+ [x: string]: (string | number | string[] | Date)[];
159
159
  }[];
160
160
  }>;
161
161
  getBorrowerIdsForFile(transactionFileId: string): Promise<{