@mody-park-cha-raja/finance_common 1.0.3 → 1.0.6-beta.0

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/dist/index.d.mts CHANGED
@@ -17,12 +17,6 @@ interface IAuditColumnEntity {
17
17
  updatedBy: number;
18
18
  }
19
19
 
20
- interface IDonationEntity extends IAuditColumnEntity {
21
- id: number;
22
- flatNo: string;
23
- amount: number;
24
- }
25
-
26
20
  interface IBaseHistoryEntity extends IAuditColumnEntity {
27
21
  id: number;
28
22
  entityId: number;
@@ -33,19 +27,32 @@ interface IBaseHistoryEntity extends IAuditColumnEntity {
33
27
  interface IDonationHistoryEntity extends IBaseHistoryEntity {
34
28
  }
35
29
 
30
+ interface IDonationEntity extends IAuditColumnEntity {
31
+ id: number;
32
+ receiptNumber: string;
33
+ flatNo: string;
34
+ amount: number;
35
+ mobileNumber?: string;
36
+ }
37
+
38
+ interface IExpenseHistoryEntity extends IBaseHistoryEntity {
39
+ }
40
+
36
41
  interface IExpenseEntity extends IAuditColumnEntity {
37
42
  id: number;
38
43
  name: string;
39
44
  type: string;
40
45
  vendorName: string;
41
46
  amount: number;
47
+ billNumber?: string;
42
48
  }
43
49
 
44
- interface IExpenseHistoryEntity extends IBaseHistoryEntity {
50
+ interface ISponsorHistoryEntity extends IBaseHistoryEntity {
45
51
  }
46
52
 
47
53
  interface ISponsorEntity extends IAuditColumnEntity {
48
54
  id: number;
55
+ sponsorName: string;
49
56
  contactName: string;
50
57
  contactNo: string;
51
58
  sponsorFor: SponsorFor;
@@ -53,7 +60,7 @@ interface ISponsorEntity extends IAuditColumnEntity {
53
60
  amount: number;
54
61
  }
55
62
 
56
- interface ISponsorHistoryEntity extends IBaseHistoryEntity {
63
+ interface ITransactionHistoryEntity extends IBaseHistoryEntity {
57
64
  }
58
65
 
59
66
  type TransactionType = 'Income' | 'Expense' | 'Sponsor';
@@ -67,7 +74,7 @@ interface ITransactionEntity extends IAuditColumnEntity {
67
74
  referenceId: string;
68
75
  }
69
76
 
70
- interface ITransactionHistoryEntity extends IBaseHistoryEntity {
77
+ interface IUserHistoryEntity extends IBaseHistoryEntity {
71
78
  }
72
79
 
73
80
  interface IUserEntity extends IAuditColumnEntity {
@@ -78,15 +85,15 @@ interface IUserEntity extends IAuditColumnEntity {
78
85
  phone: string;
79
86
  }
80
87
 
88
+ interface IVendorHistoryEntity extends IBaseHistoryEntity {
89
+ }
90
+
81
91
  interface IVendorEntity extends IAuditColumnEntity {
82
92
  id: number;
83
93
  name: string;
84
94
  type: string;
85
95
  }
86
96
 
87
- interface IVendorHistoryEntity extends IBaseHistoryEntity {
88
- }
89
-
90
97
  /**
91
98
  * Utility class for validating date codes in `YYYYMMDD` format.
92
99
  *
@@ -126,7 +133,26 @@ declare class DateUtil {
126
133
  static isFuture(epoch: number): boolean;
127
134
  }
128
135
 
129
- declare class DonationHistoryModel extends BaseEntityModel implements IDonationHistoryEntity {
136
+ declare abstract class BaseEntityModel {
137
+ static relations: Partial<Record<EntityList, IModelRelationConfig<EntityList>>>;
138
+ populateRelations(searchResponse: ISearchV2Response, visited?: Set<string>): this;
139
+ }
140
+
141
+ declare class DonationModel extends BaseEntityModel implements IDonationEntity {
142
+ id: number;
143
+ receiptNumber: string;
144
+ flatNo: string;
145
+ amount: number;
146
+ mobileNumber?: string;
147
+ createdOn: number;
148
+ updatedOn: number;
149
+ createdBy: number;
150
+ updatedBy: number;
151
+ protected constructor();
152
+ static populateFromEntity(entity: IDonationEntity): DonationModel;
153
+ }
154
+
155
+ declare class ExpenseHistoryModel extends BaseEntityModel implements IExpenseHistoryEntity {
130
156
  id: number;
131
157
  entityId: number;
132
158
  data: string;
@@ -136,8 +162,8 @@ declare class DonationHistoryModel extends BaseEntityModel implements IDonationH
136
162
  createdBy: number;
137
163
  updatedBy: number;
138
164
  protected constructor();
139
- static relations: Partial<Record<EntityList, IModelRelationConfig<EntityList.DONATION_HISTORY>>>;
140
- static populateFromEntity(entity: IDonationHistoryEntity): DonationHistoryModel;
165
+ static relations: Partial<Record<EntityList, IModelRelationConfig<EntityList.EXPENSE_HISTORY>>>;
166
+ static populateFromEntity(entity: IExpenseHistoryEntity): ExpenseHistoryModel;
141
167
  }
142
168
 
143
169
  declare class ExpenseModel extends BaseEntityModel implements IExpenseEntity {
@@ -146,6 +172,7 @@ declare class ExpenseModel extends BaseEntityModel implements IExpenseEntity {
146
172
  type: string;
147
173
  vendorName: string;
148
174
  amount: number;
175
+ billNumber?: string;
149
176
  createdOn: number;
150
177
  updatedOn: number;
151
178
  createdBy: number;
@@ -154,7 +181,7 @@ declare class ExpenseModel extends BaseEntityModel implements IExpenseEntity {
154
181
  static populateFromEntity(entity: IExpenseEntity): ExpenseModel;
155
182
  }
156
183
 
157
- declare class ExpenseHistoryModel extends BaseEntityModel implements IExpenseHistoryEntity {
184
+ declare class SponsorHistoryModel extends BaseEntityModel implements ISponsorHistoryEntity {
158
185
  id: number;
159
186
  entityId: number;
160
187
  data: string;
@@ -164,12 +191,13 @@ declare class ExpenseHistoryModel extends BaseEntityModel implements IExpenseHis
164
191
  createdBy: number;
165
192
  updatedBy: number;
166
193
  protected constructor();
167
- static relations: Partial<Record<EntityList, IModelRelationConfig<EntityList.EXPENSE_HISTORY>>>;
168
- static populateFromEntity(entity: IExpenseHistoryEntity): ExpenseHistoryModel;
194
+ static relations: Partial<Record<EntityList, IModelRelationConfig<EntityList.SPONSOR_HISTORY>>>;
195
+ static populateFromEntity(entity: ISponsorHistoryEntity): SponsorHistoryModel;
169
196
  }
170
197
 
171
198
  declare class SponsorModel extends BaseEntityModel implements ISponsorEntity {
172
199
  id: number;
200
+ sponsorName: string;
173
201
  contactName: string;
174
202
  contactNo: string;
175
203
  sponsorFor: SponsorFor;
@@ -183,7 +211,7 @@ declare class SponsorModel extends BaseEntityModel implements ISponsorEntity {
183
211
  static populateFromEntity(entity: ISponsorEntity): SponsorModel;
184
212
  }
185
213
 
186
- declare class SponsorHistoryModel extends BaseEntityModel implements ISponsorHistoryEntity {
214
+ declare class TransactionHistoryModel extends BaseEntityModel implements ITransactionHistoryEntity {
187
215
  id: number;
188
216
  entityId: number;
189
217
  data: string;
@@ -193,8 +221,8 @@ declare class SponsorHistoryModel extends BaseEntityModel implements ISponsorHis
193
221
  createdBy: number;
194
222
  updatedBy: number;
195
223
  protected constructor();
196
- static relations: Partial<Record<EntityList, IModelRelationConfig<EntityList.SPONSOR_HISTORY>>>;
197
- static populateFromEntity(entity: ISponsorHistoryEntity): SponsorHistoryModel;
224
+ static relations: Partial<Record<EntityList, IModelRelationConfig<EntityList.TRANSACTION_HISTORY>>>;
225
+ static populateFromEntity(entity: ITransactionHistoryEntity): TransactionHistoryModel;
198
226
  }
199
227
 
200
228
  declare class TransactionModel extends BaseEntityModel implements ITransactionEntity {
@@ -213,7 +241,7 @@ declare class TransactionModel extends BaseEntityModel implements ITransactionEn
213
241
  static populateFromEntity(entity: ITransactionEntity): TransactionModel;
214
242
  }
215
243
 
216
- declare class TransactionHistoryModel extends BaseEntityModel implements ITransactionHistoryEntity {
244
+ declare class UserHistoryModel extends BaseEntityModel implements IUserHistoryEntity {
217
245
  id: number;
218
246
  entityId: number;
219
247
  data: string;
@@ -223,8 +251,8 @@ declare class TransactionHistoryModel extends BaseEntityModel implements ITransa
223
251
  createdBy: number;
224
252
  updatedBy: number;
225
253
  protected constructor();
226
- static relations: Partial<Record<EntityList, IModelRelationConfig<EntityList.TRANSACTION_HISTORY>>>;
227
- static populateFromEntity(entity: ITransactionHistoryEntity): TransactionHistoryModel;
254
+ static relations: Partial<Record<EntityList, IModelRelationConfig<EntityList.USER_HISTORY>>>;
255
+ static populateFromEntity(entity: IUserHistoryEntity): UserHistoryModel;
228
256
  }
229
257
 
230
258
  declare class UserModel extends BaseEntityModel implements IUserEntity {
@@ -241,36 +269,37 @@ declare class UserModel extends BaseEntityModel implements IUserEntity {
241
269
  static populateFromEntity(entity: IUserEntity): UserModel;
242
270
  }
243
271
 
244
- declare class VendorModel extends BaseEntityModel implements IVendorEntity {
272
+ declare class VendorHistoryModel extends BaseEntityModel implements IVendorHistoryEntity {
245
273
  id: number;
246
- name: string;
247
- type: string;
274
+ entityId: number;
275
+ data: string;
276
+ operation: EntityHistoryOperation;
248
277
  createdOn: number;
249
278
  updatedOn: number;
250
279
  createdBy: number;
251
280
  updatedBy: number;
252
281
  protected constructor();
253
- static populateFromEntity(entity: IVendorEntity): VendorModel;
282
+ static relations: Partial<Record<EntityList, IModelRelationConfig<EntityList.VENDOR_HISTORY>>>;
283
+ static populateFromEntity(entity: IVendorHistoryEntity): VendorHistoryModel;
254
284
  }
255
285
 
256
- declare class VendorHistoryModel extends BaseEntityModel implements IVendorHistoryEntity {
286
+ declare class VendorModel extends BaseEntityModel implements IVendorEntity {
257
287
  id: number;
258
- entityId: number;
259
- data: string;
260
- operation: EntityHistoryOperation;
288
+ name: string;
289
+ type: string;
261
290
  createdOn: number;
262
291
  updatedOn: number;
263
292
  createdBy: number;
264
293
  updatedBy: number;
265
294
  protected constructor();
266
- static relations: Partial<Record<EntityList, IModelRelationConfig<EntityList.VENDOR_HISTORY>>>;
267
- static populateFromEntity(entity: IVendorHistoryEntity): VendorHistoryModel;
295
+ static populateFromEntity(entity: IVendorEntity): VendorModel;
268
296
  }
269
297
 
270
298
  declare const entityListEntityModelMap: {
271
299
  donation: typeof DonationModel.populateFromEntity;
272
300
  donation_history: typeof DonationHistoryModel.populateFromEntity;
273
301
  user: typeof UserModel.populateFromEntity;
302
+ user_history: typeof UserHistoryModel.populateFromEntity;
274
303
  expense: typeof ExpenseModel.populateFromEntity;
275
304
  expense_history: typeof ExpenseHistoryModel.populateFromEntity;
276
305
  vendor: typeof VendorModel.populateFromEntity;
@@ -365,6 +394,22 @@ declare function diffArrays<T>(arr1: T[], arr2: T[]): {
365
394
  */
366
395
  declare function groupBy<T>(items: T[], key: keyof T): Map<string, T[]>;
367
396
  declare function definedValues<T>(arr: Array<T | undefined | null>): T[];
397
+ /**
398
+ * Converts an epoch timestamp (milliseconds) into a human-readable date string.
399
+ *
400
+ * @param epoch - The epoch timestamp in milliseconds
401
+ * @param format - Optional output format:
402
+ * - `'short'` — locale-specific short date (e.g. "25/12/2026")
403
+ * - `'long'` — locale-specific long date (e.g. "25 December 2026")
404
+ * - `'iso'` — ISO 8601 string (default)
405
+ * @returns The formatted date string
406
+ *
407
+ * @example
408
+ * epochToReadableDate(1700000000000, 'long'); // "14 November 2023"
409
+ * epochToReadableDate(1700000000000, 'short'); // "14/11/2023"
410
+ * epochToReadableDate(1700000000000); // "2023-11-14T18:13:20.000Z"
411
+ */
412
+ declare function epochToReadableDate(epoch: number, format?: 'short' | 'long' | 'iso'): string;
368
413
 
369
414
  declare enum RelationType {
370
415
  ONE = "ONE",
@@ -382,27 +427,25 @@ declare enum OrderByDirection {
382
427
  DESC = "DESC"
383
428
  }
384
429
 
385
- declare abstract class BaseEntityModel {
386
- static relations: Partial<Record<EntityList, IModelRelationConfig<EntityList>>>;
387
- populateRelations(searchResponse: ISearchV2Response, visited?: Set<string>): this;
388
- }
389
-
390
- declare class DonationModel extends BaseEntityModel implements IDonationEntity {
430
+ declare class DonationHistoryModel extends BaseEntityModel implements IDonationHistoryEntity {
391
431
  id: number;
392
- flatNo: string;
393
- amount: number;
432
+ entityId: number;
433
+ data: string;
434
+ operation: EntityHistoryOperation;
394
435
  createdOn: number;
395
436
  updatedOn: number;
396
437
  createdBy: number;
397
438
  updatedBy: number;
398
439
  protected constructor();
399
- static populateFromEntity(entity: IDonationEntity): DonationModel;
440
+ static relations: Partial<Record<EntityList, IModelRelationConfig<EntityList.DONATION_HISTORY>>>;
441
+ static populateFromEntity(entity: IDonationHistoryEntity): DonationHistoryModel;
400
442
  }
401
443
 
402
444
  declare enum EntityList {
403
445
  DONATION = "donation",
404
446
  DONATION_HISTORY = "donation_history",
405
447
  USER = "user",
448
+ USER_HISTORY = "user_history",
406
449
  EXPENSE = "expense",
407
450
  EXPENSE_HISTORY = "expense_history",
408
451
  VENDOR = "vendor",
@@ -412,8 +455,8 @@ declare enum EntityList {
412
455
  SPONSOR = "sponsor",
413
456
  SPONSOR_HISTORY = "sponsor_history"
414
457
  }
415
- type EntityType<T extends EntityList> = T extends EntityList.DONATION ? IDonationEntity : T extends EntityList.DONATION_HISTORY ? IDonationHistoryEntity : T extends EntityList.USER ? IUserEntity : T extends EntityList.EXPENSE ? IExpenseEntity : T extends EntityList.EXPENSE_HISTORY ? IExpenseHistoryEntity : T extends EntityList.VENDOR ? IVendorEntity : T extends EntityList.VENDOR_HISTORY ? IVendorHistoryEntity : T extends EntityList.TRANSACTION ? ITransactionEntity : T extends EntityList.TRANSACTION_HISTORY ? ITransactionHistoryEntity : T extends EntityList.SPONSOR ? ISponsorEntity : T extends EntityList.SPONSOR_HISTORY ? ISponsorHistoryEntity : never;
416
- type EntityModelType<T extends EntityList> = T extends EntityList.DONATION ? DonationModel : T extends EntityList.DONATION_HISTORY ? DonationHistoryModel : T extends EntityList.USER ? UserModel : T extends EntityList.EXPENSE ? ExpenseModel : T extends EntityList.EXPENSE_HISTORY ? ExpenseHistoryModel : T extends EntityList.VENDOR ? VendorModel : T extends EntityList.VENDOR_HISTORY ? VendorHistoryModel : T extends EntityList.TRANSACTION ? TransactionModel : T extends EntityList.TRANSACTION_HISTORY ? TransactionHistoryModel : T extends EntityList.SPONSOR ? SponsorModel : T extends EntityList.SPONSOR_HISTORY ? SponsorHistoryModel : never;
458
+ type EntityType<T extends EntityList> = T extends EntityList.DONATION ? IDonationEntity : T extends EntityList.DONATION_HISTORY ? IDonationHistoryEntity : T extends EntityList.USER ? IUserEntity : T extends EntityList.USER_HISTORY ? IUserHistoryEntity : T extends EntityList.EXPENSE ? IExpenseEntity : T extends EntityList.EXPENSE_HISTORY ? IExpenseHistoryEntity : T extends EntityList.VENDOR ? IVendorEntity : T extends EntityList.VENDOR_HISTORY ? IVendorHistoryEntity : T extends EntityList.TRANSACTION ? ITransactionEntity : T extends EntityList.TRANSACTION_HISTORY ? ITransactionHistoryEntity : T extends EntityList.SPONSOR ? ISponsorEntity : T extends EntityList.SPONSOR_HISTORY ? ISponsorHistoryEntity : never;
459
+ type EntityModelType<T extends EntityList> = T extends EntityList.DONATION ? DonationModel : T extends EntityList.DONATION_HISTORY ? DonationHistoryModel : T extends EntityList.USER ? UserModel : T extends EntityList.USER_HISTORY ? UserHistoryModel : T extends EntityList.EXPENSE ? ExpenseModel : T extends EntityList.EXPENSE_HISTORY ? ExpenseHistoryModel : T extends EntityList.VENDOR ? VendorModel : T extends EntityList.VENDOR_HISTORY ? VendorHistoryModel : T extends EntityList.TRANSACTION ? TransactionModel : T extends EntityList.TRANSACTION_HISTORY ? TransactionHistoryModel : T extends EntityList.SPONSOR ? SponsorModel : T extends EntityList.SPONSOR_HISTORY ? SponsorHistoryModel : never;
417
460
  type EntityListEntityModelMap = {
418
461
  [T in EntityList]: EntityModelType<T>[];
419
462
  };
@@ -485,4 +528,4 @@ interface IDtoValidationError {
485
528
 
486
529
  type Nullable<T> = T | null;
487
530
 
488
- export { BadRequestException, BaseEntityModel, DateCodeUtils, DateUtil, DonationHistoryModel, DonationModel, EntityFilterDataHelper, EntityHistoryOperation, EntityList, type EntityListEntityModelMap, type EntityModelType, type EntityType, ExpenseHistoryModel, ExpenseModel, ForbiddenException, HttpException, type IAuditColumnEntity, type IBaseHistoryEntity, type IDonationEntity, type IDonationHistoryEntity, type IDtoValidationError, type IEntityCreateDto, type IEntityFilterData, type IEntityFilterSearchData, type IEntityFilterSearchDataV2, type IEntityUpdateDto, type IExpenseEntity, type IExpenseHistoryEntity, type IModelRelationConfig, type ISearchV2Response, type ISponsorEntity, type ISponsorHistoryEntity, type ITransactionEntity, type ITransactionHistoryEntity, type IUserEntity, type IVendorEntity, type IVendorHistoryEntity, NotFoundException, type Nullable, OrderByDirection, RelationType, SponsorFor, SponsorHistoryModel, SponsorModel, TransactionHistoryModel, TransactionModel, type TransactionType, UnauthorizedException, UserModel, VendorHistoryModel, VendorModel, definedValues, diffArrays, entityListEntityModelMap, getObjectDiffingKeys, groupBy };
531
+ export { BadRequestException, BaseEntityModel, DateCodeUtils, DateUtil, DonationHistoryModel, DonationModel, EntityFilterDataHelper, EntityHistoryOperation, EntityList, type EntityListEntityModelMap, type EntityModelType, type EntityType, ExpenseHistoryModel, ExpenseModel, ForbiddenException, HttpException, type IAuditColumnEntity, type IBaseHistoryEntity, type IDonationEntity, type IDonationHistoryEntity, type IDtoValidationError, type IEntityCreateDto, type IEntityFilterData, type IEntityFilterSearchData, type IEntityFilterSearchDataV2, type IEntityUpdateDto, type IExpenseEntity, type IExpenseHistoryEntity, type IModelRelationConfig, type ISearchV2Response, type ISponsorEntity, type ISponsorHistoryEntity, type ITransactionEntity, type ITransactionHistoryEntity, type IUserEntity, type IUserHistoryEntity, type IVendorEntity, type IVendorHistoryEntity, NotFoundException, type Nullable, OrderByDirection, RelationType, SponsorFor, SponsorHistoryModel, SponsorModel, TransactionHistoryModel, TransactionModel, type TransactionType, UnauthorizedException, UserHistoryModel, UserModel, VendorHistoryModel, VendorModel, definedValues, diffArrays, entityListEntityModelMap, epochToReadableDate, getObjectDiffingKeys, groupBy };
package/dist/index.d.ts CHANGED
@@ -17,12 +17,6 @@ interface IAuditColumnEntity {
17
17
  updatedBy: number;
18
18
  }
19
19
 
20
- interface IDonationEntity extends IAuditColumnEntity {
21
- id: number;
22
- flatNo: string;
23
- amount: number;
24
- }
25
-
26
20
  interface IBaseHistoryEntity extends IAuditColumnEntity {
27
21
  id: number;
28
22
  entityId: number;
@@ -33,19 +27,32 @@ interface IBaseHistoryEntity extends IAuditColumnEntity {
33
27
  interface IDonationHistoryEntity extends IBaseHistoryEntity {
34
28
  }
35
29
 
30
+ interface IDonationEntity extends IAuditColumnEntity {
31
+ id: number;
32
+ receiptNumber: string;
33
+ flatNo: string;
34
+ amount: number;
35
+ mobileNumber?: string;
36
+ }
37
+
38
+ interface IExpenseHistoryEntity extends IBaseHistoryEntity {
39
+ }
40
+
36
41
  interface IExpenseEntity extends IAuditColumnEntity {
37
42
  id: number;
38
43
  name: string;
39
44
  type: string;
40
45
  vendorName: string;
41
46
  amount: number;
47
+ billNumber?: string;
42
48
  }
43
49
 
44
- interface IExpenseHistoryEntity extends IBaseHistoryEntity {
50
+ interface ISponsorHistoryEntity extends IBaseHistoryEntity {
45
51
  }
46
52
 
47
53
  interface ISponsorEntity extends IAuditColumnEntity {
48
54
  id: number;
55
+ sponsorName: string;
49
56
  contactName: string;
50
57
  contactNo: string;
51
58
  sponsorFor: SponsorFor;
@@ -53,7 +60,7 @@ interface ISponsorEntity extends IAuditColumnEntity {
53
60
  amount: number;
54
61
  }
55
62
 
56
- interface ISponsorHistoryEntity extends IBaseHistoryEntity {
63
+ interface ITransactionHistoryEntity extends IBaseHistoryEntity {
57
64
  }
58
65
 
59
66
  type TransactionType = 'Income' | 'Expense' | 'Sponsor';
@@ -67,7 +74,7 @@ interface ITransactionEntity extends IAuditColumnEntity {
67
74
  referenceId: string;
68
75
  }
69
76
 
70
- interface ITransactionHistoryEntity extends IBaseHistoryEntity {
77
+ interface IUserHistoryEntity extends IBaseHistoryEntity {
71
78
  }
72
79
 
73
80
  interface IUserEntity extends IAuditColumnEntity {
@@ -78,15 +85,15 @@ interface IUserEntity extends IAuditColumnEntity {
78
85
  phone: string;
79
86
  }
80
87
 
88
+ interface IVendorHistoryEntity extends IBaseHistoryEntity {
89
+ }
90
+
81
91
  interface IVendorEntity extends IAuditColumnEntity {
82
92
  id: number;
83
93
  name: string;
84
94
  type: string;
85
95
  }
86
96
 
87
- interface IVendorHistoryEntity extends IBaseHistoryEntity {
88
- }
89
-
90
97
  /**
91
98
  * Utility class for validating date codes in `YYYYMMDD` format.
92
99
  *
@@ -126,7 +133,26 @@ declare class DateUtil {
126
133
  static isFuture(epoch: number): boolean;
127
134
  }
128
135
 
129
- declare class DonationHistoryModel extends BaseEntityModel implements IDonationHistoryEntity {
136
+ declare abstract class BaseEntityModel {
137
+ static relations: Partial<Record<EntityList, IModelRelationConfig<EntityList>>>;
138
+ populateRelations(searchResponse: ISearchV2Response, visited?: Set<string>): this;
139
+ }
140
+
141
+ declare class DonationModel extends BaseEntityModel implements IDonationEntity {
142
+ id: number;
143
+ receiptNumber: string;
144
+ flatNo: string;
145
+ amount: number;
146
+ mobileNumber?: string;
147
+ createdOn: number;
148
+ updatedOn: number;
149
+ createdBy: number;
150
+ updatedBy: number;
151
+ protected constructor();
152
+ static populateFromEntity(entity: IDonationEntity): DonationModel;
153
+ }
154
+
155
+ declare class ExpenseHistoryModel extends BaseEntityModel implements IExpenseHistoryEntity {
130
156
  id: number;
131
157
  entityId: number;
132
158
  data: string;
@@ -136,8 +162,8 @@ declare class DonationHistoryModel extends BaseEntityModel implements IDonationH
136
162
  createdBy: number;
137
163
  updatedBy: number;
138
164
  protected constructor();
139
- static relations: Partial<Record<EntityList, IModelRelationConfig<EntityList.DONATION_HISTORY>>>;
140
- static populateFromEntity(entity: IDonationHistoryEntity): DonationHistoryModel;
165
+ static relations: Partial<Record<EntityList, IModelRelationConfig<EntityList.EXPENSE_HISTORY>>>;
166
+ static populateFromEntity(entity: IExpenseHistoryEntity): ExpenseHistoryModel;
141
167
  }
142
168
 
143
169
  declare class ExpenseModel extends BaseEntityModel implements IExpenseEntity {
@@ -146,6 +172,7 @@ declare class ExpenseModel extends BaseEntityModel implements IExpenseEntity {
146
172
  type: string;
147
173
  vendorName: string;
148
174
  amount: number;
175
+ billNumber?: string;
149
176
  createdOn: number;
150
177
  updatedOn: number;
151
178
  createdBy: number;
@@ -154,7 +181,7 @@ declare class ExpenseModel extends BaseEntityModel implements IExpenseEntity {
154
181
  static populateFromEntity(entity: IExpenseEntity): ExpenseModel;
155
182
  }
156
183
 
157
- declare class ExpenseHistoryModel extends BaseEntityModel implements IExpenseHistoryEntity {
184
+ declare class SponsorHistoryModel extends BaseEntityModel implements ISponsorHistoryEntity {
158
185
  id: number;
159
186
  entityId: number;
160
187
  data: string;
@@ -164,12 +191,13 @@ declare class ExpenseHistoryModel extends BaseEntityModel implements IExpenseHis
164
191
  createdBy: number;
165
192
  updatedBy: number;
166
193
  protected constructor();
167
- static relations: Partial<Record<EntityList, IModelRelationConfig<EntityList.EXPENSE_HISTORY>>>;
168
- static populateFromEntity(entity: IExpenseHistoryEntity): ExpenseHistoryModel;
194
+ static relations: Partial<Record<EntityList, IModelRelationConfig<EntityList.SPONSOR_HISTORY>>>;
195
+ static populateFromEntity(entity: ISponsorHistoryEntity): SponsorHistoryModel;
169
196
  }
170
197
 
171
198
  declare class SponsorModel extends BaseEntityModel implements ISponsorEntity {
172
199
  id: number;
200
+ sponsorName: string;
173
201
  contactName: string;
174
202
  contactNo: string;
175
203
  sponsorFor: SponsorFor;
@@ -183,7 +211,7 @@ declare class SponsorModel extends BaseEntityModel implements ISponsorEntity {
183
211
  static populateFromEntity(entity: ISponsorEntity): SponsorModel;
184
212
  }
185
213
 
186
- declare class SponsorHistoryModel extends BaseEntityModel implements ISponsorHistoryEntity {
214
+ declare class TransactionHistoryModel extends BaseEntityModel implements ITransactionHistoryEntity {
187
215
  id: number;
188
216
  entityId: number;
189
217
  data: string;
@@ -193,8 +221,8 @@ declare class SponsorHistoryModel extends BaseEntityModel implements ISponsorHis
193
221
  createdBy: number;
194
222
  updatedBy: number;
195
223
  protected constructor();
196
- static relations: Partial<Record<EntityList, IModelRelationConfig<EntityList.SPONSOR_HISTORY>>>;
197
- static populateFromEntity(entity: ISponsorHistoryEntity): SponsorHistoryModel;
224
+ static relations: Partial<Record<EntityList, IModelRelationConfig<EntityList.TRANSACTION_HISTORY>>>;
225
+ static populateFromEntity(entity: ITransactionHistoryEntity): TransactionHistoryModel;
198
226
  }
199
227
 
200
228
  declare class TransactionModel extends BaseEntityModel implements ITransactionEntity {
@@ -213,7 +241,7 @@ declare class TransactionModel extends BaseEntityModel implements ITransactionEn
213
241
  static populateFromEntity(entity: ITransactionEntity): TransactionModel;
214
242
  }
215
243
 
216
- declare class TransactionHistoryModel extends BaseEntityModel implements ITransactionHistoryEntity {
244
+ declare class UserHistoryModel extends BaseEntityModel implements IUserHistoryEntity {
217
245
  id: number;
218
246
  entityId: number;
219
247
  data: string;
@@ -223,8 +251,8 @@ declare class TransactionHistoryModel extends BaseEntityModel implements ITransa
223
251
  createdBy: number;
224
252
  updatedBy: number;
225
253
  protected constructor();
226
- static relations: Partial<Record<EntityList, IModelRelationConfig<EntityList.TRANSACTION_HISTORY>>>;
227
- static populateFromEntity(entity: ITransactionHistoryEntity): TransactionHistoryModel;
254
+ static relations: Partial<Record<EntityList, IModelRelationConfig<EntityList.USER_HISTORY>>>;
255
+ static populateFromEntity(entity: IUserHistoryEntity): UserHistoryModel;
228
256
  }
229
257
 
230
258
  declare class UserModel extends BaseEntityModel implements IUserEntity {
@@ -241,36 +269,37 @@ declare class UserModel extends BaseEntityModel implements IUserEntity {
241
269
  static populateFromEntity(entity: IUserEntity): UserModel;
242
270
  }
243
271
 
244
- declare class VendorModel extends BaseEntityModel implements IVendorEntity {
272
+ declare class VendorHistoryModel extends BaseEntityModel implements IVendorHistoryEntity {
245
273
  id: number;
246
- name: string;
247
- type: string;
274
+ entityId: number;
275
+ data: string;
276
+ operation: EntityHistoryOperation;
248
277
  createdOn: number;
249
278
  updatedOn: number;
250
279
  createdBy: number;
251
280
  updatedBy: number;
252
281
  protected constructor();
253
- static populateFromEntity(entity: IVendorEntity): VendorModel;
282
+ static relations: Partial<Record<EntityList, IModelRelationConfig<EntityList.VENDOR_HISTORY>>>;
283
+ static populateFromEntity(entity: IVendorHistoryEntity): VendorHistoryModel;
254
284
  }
255
285
 
256
- declare class VendorHistoryModel extends BaseEntityModel implements IVendorHistoryEntity {
286
+ declare class VendorModel extends BaseEntityModel implements IVendorEntity {
257
287
  id: number;
258
- entityId: number;
259
- data: string;
260
- operation: EntityHistoryOperation;
288
+ name: string;
289
+ type: string;
261
290
  createdOn: number;
262
291
  updatedOn: number;
263
292
  createdBy: number;
264
293
  updatedBy: number;
265
294
  protected constructor();
266
- static relations: Partial<Record<EntityList, IModelRelationConfig<EntityList.VENDOR_HISTORY>>>;
267
- static populateFromEntity(entity: IVendorHistoryEntity): VendorHistoryModel;
295
+ static populateFromEntity(entity: IVendorEntity): VendorModel;
268
296
  }
269
297
 
270
298
  declare const entityListEntityModelMap: {
271
299
  donation: typeof DonationModel.populateFromEntity;
272
300
  donation_history: typeof DonationHistoryModel.populateFromEntity;
273
301
  user: typeof UserModel.populateFromEntity;
302
+ user_history: typeof UserHistoryModel.populateFromEntity;
274
303
  expense: typeof ExpenseModel.populateFromEntity;
275
304
  expense_history: typeof ExpenseHistoryModel.populateFromEntity;
276
305
  vendor: typeof VendorModel.populateFromEntity;
@@ -365,6 +394,22 @@ declare function diffArrays<T>(arr1: T[], arr2: T[]): {
365
394
  */
366
395
  declare function groupBy<T>(items: T[], key: keyof T): Map<string, T[]>;
367
396
  declare function definedValues<T>(arr: Array<T | undefined | null>): T[];
397
+ /**
398
+ * Converts an epoch timestamp (milliseconds) into a human-readable date string.
399
+ *
400
+ * @param epoch - The epoch timestamp in milliseconds
401
+ * @param format - Optional output format:
402
+ * - `'short'` — locale-specific short date (e.g. "25/12/2026")
403
+ * - `'long'` — locale-specific long date (e.g. "25 December 2026")
404
+ * - `'iso'` — ISO 8601 string (default)
405
+ * @returns The formatted date string
406
+ *
407
+ * @example
408
+ * epochToReadableDate(1700000000000, 'long'); // "14 November 2023"
409
+ * epochToReadableDate(1700000000000, 'short'); // "14/11/2023"
410
+ * epochToReadableDate(1700000000000); // "2023-11-14T18:13:20.000Z"
411
+ */
412
+ declare function epochToReadableDate(epoch: number, format?: 'short' | 'long' | 'iso'): string;
368
413
 
369
414
  declare enum RelationType {
370
415
  ONE = "ONE",
@@ -382,27 +427,25 @@ declare enum OrderByDirection {
382
427
  DESC = "DESC"
383
428
  }
384
429
 
385
- declare abstract class BaseEntityModel {
386
- static relations: Partial<Record<EntityList, IModelRelationConfig<EntityList>>>;
387
- populateRelations(searchResponse: ISearchV2Response, visited?: Set<string>): this;
388
- }
389
-
390
- declare class DonationModel extends BaseEntityModel implements IDonationEntity {
430
+ declare class DonationHistoryModel extends BaseEntityModel implements IDonationHistoryEntity {
391
431
  id: number;
392
- flatNo: string;
393
- amount: number;
432
+ entityId: number;
433
+ data: string;
434
+ operation: EntityHistoryOperation;
394
435
  createdOn: number;
395
436
  updatedOn: number;
396
437
  createdBy: number;
397
438
  updatedBy: number;
398
439
  protected constructor();
399
- static populateFromEntity(entity: IDonationEntity): DonationModel;
440
+ static relations: Partial<Record<EntityList, IModelRelationConfig<EntityList.DONATION_HISTORY>>>;
441
+ static populateFromEntity(entity: IDonationHistoryEntity): DonationHistoryModel;
400
442
  }
401
443
 
402
444
  declare enum EntityList {
403
445
  DONATION = "donation",
404
446
  DONATION_HISTORY = "donation_history",
405
447
  USER = "user",
448
+ USER_HISTORY = "user_history",
406
449
  EXPENSE = "expense",
407
450
  EXPENSE_HISTORY = "expense_history",
408
451
  VENDOR = "vendor",
@@ -412,8 +455,8 @@ declare enum EntityList {
412
455
  SPONSOR = "sponsor",
413
456
  SPONSOR_HISTORY = "sponsor_history"
414
457
  }
415
- type EntityType<T extends EntityList> = T extends EntityList.DONATION ? IDonationEntity : T extends EntityList.DONATION_HISTORY ? IDonationHistoryEntity : T extends EntityList.USER ? IUserEntity : T extends EntityList.EXPENSE ? IExpenseEntity : T extends EntityList.EXPENSE_HISTORY ? IExpenseHistoryEntity : T extends EntityList.VENDOR ? IVendorEntity : T extends EntityList.VENDOR_HISTORY ? IVendorHistoryEntity : T extends EntityList.TRANSACTION ? ITransactionEntity : T extends EntityList.TRANSACTION_HISTORY ? ITransactionHistoryEntity : T extends EntityList.SPONSOR ? ISponsorEntity : T extends EntityList.SPONSOR_HISTORY ? ISponsorHistoryEntity : never;
416
- type EntityModelType<T extends EntityList> = T extends EntityList.DONATION ? DonationModel : T extends EntityList.DONATION_HISTORY ? DonationHistoryModel : T extends EntityList.USER ? UserModel : T extends EntityList.EXPENSE ? ExpenseModel : T extends EntityList.EXPENSE_HISTORY ? ExpenseHistoryModel : T extends EntityList.VENDOR ? VendorModel : T extends EntityList.VENDOR_HISTORY ? VendorHistoryModel : T extends EntityList.TRANSACTION ? TransactionModel : T extends EntityList.TRANSACTION_HISTORY ? TransactionHistoryModel : T extends EntityList.SPONSOR ? SponsorModel : T extends EntityList.SPONSOR_HISTORY ? SponsorHistoryModel : never;
458
+ type EntityType<T extends EntityList> = T extends EntityList.DONATION ? IDonationEntity : T extends EntityList.DONATION_HISTORY ? IDonationHistoryEntity : T extends EntityList.USER ? IUserEntity : T extends EntityList.USER_HISTORY ? IUserHistoryEntity : T extends EntityList.EXPENSE ? IExpenseEntity : T extends EntityList.EXPENSE_HISTORY ? IExpenseHistoryEntity : T extends EntityList.VENDOR ? IVendorEntity : T extends EntityList.VENDOR_HISTORY ? IVendorHistoryEntity : T extends EntityList.TRANSACTION ? ITransactionEntity : T extends EntityList.TRANSACTION_HISTORY ? ITransactionHistoryEntity : T extends EntityList.SPONSOR ? ISponsorEntity : T extends EntityList.SPONSOR_HISTORY ? ISponsorHistoryEntity : never;
459
+ type EntityModelType<T extends EntityList> = T extends EntityList.DONATION ? DonationModel : T extends EntityList.DONATION_HISTORY ? DonationHistoryModel : T extends EntityList.USER ? UserModel : T extends EntityList.USER_HISTORY ? UserHistoryModel : T extends EntityList.EXPENSE ? ExpenseModel : T extends EntityList.EXPENSE_HISTORY ? ExpenseHistoryModel : T extends EntityList.VENDOR ? VendorModel : T extends EntityList.VENDOR_HISTORY ? VendorHistoryModel : T extends EntityList.TRANSACTION ? TransactionModel : T extends EntityList.TRANSACTION_HISTORY ? TransactionHistoryModel : T extends EntityList.SPONSOR ? SponsorModel : T extends EntityList.SPONSOR_HISTORY ? SponsorHistoryModel : never;
417
460
  type EntityListEntityModelMap = {
418
461
  [T in EntityList]: EntityModelType<T>[];
419
462
  };
@@ -485,4 +528,4 @@ interface IDtoValidationError {
485
528
 
486
529
  type Nullable<T> = T | null;
487
530
 
488
- export { BadRequestException, BaseEntityModel, DateCodeUtils, DateUtil, DonationHistoryModel, DonationModel, EntityFilterDataHelper, EntityHistoryOperation, EntityList, type EntityListEntityModelMap, type EntityModelType, type EntityType, ExpenseHistoryModel, ExpenseModel, ForbiddenException, HttpException, type IAuditColumnEntity, type IBaseHistoryEntity, type IDonationEntity, type IDonationHistoryEntity, type IDtoValidationError, type IEntityCreateDto, type IEntityFilterData, type IEntityFilterSearchData, type IEntityFilterSearchDataV2, type IEntityUpdateDto, type IExpenseEntity, type IExpenseHistoryEntity, type IModelRelationConfig, type ISearchV2Response, type ISponsorEntity, type ISponsorHistoryEntity, type ITransactionEntity, type ITransactionHistoryEntity, type IUserEntity, type IVendorEntity, type IVendorHistoryEntity, NotFoundException, type Nullable, OrderByDirection, RelationType, SponsorFor, SponsorHistoryModel, SponsorModel, TransactionHistoryModel, TransactionModel, type TransactionType, UnauthorizedException, UserModel, VendorHistoryModel, VendorModel, definedValues, diffArrays, entityListEntityModelMap, getObjectDiffingKeys, groupBy };
531
+ export { BadRequestException, BaseEntityModel, DateCodeUtils, DateUtil, DonationHistoryModel, DonationModel, EntityFilterDataHelper, EntityHistoryOperation, EntityList, type EntityListEntityModelMap, type EntityModelType, type EntityType, ExpenseHistoryModel, ExpenseModel, ForbiddenException, HttpException, type IAuditColumnEntity, type IBaseHistoryEntity, type IDonationEntity, type IDonationHistoryEntity, type IDtoValidationError, type IEntityCreateDto, type IEntityFilterData, type IEntityFilterSearchData, type IEntityFilterSearchDataV2, type IEntityUpdateDto, type IExpenseEntity, type IExpenseHistoryEntity, type IModelRelationConfig, type ISearchV2Response, type ISponsorEntity, type ISponsorHistoryEntity, type ITransactionEntity, type ITransactionHistoryEntity, type IUserEntity, type IUserHistoryEntity, type IVendorEntity, type IVendorHistoryEntity, NotFoundException, type Nullable, OrderByDirection, RelationType, SponsorFor, SponsorHistoryModel, SponsorModel, TransactionHistoryModel, TransactionModel, type TransactionType, UnauthorizedException, UserHistoryModel, UserModel, VendorHistoryModel, VendorModel, definedValues, diffArrays, entityListEntityModelMap, epochToReadableDate, getObjectDiffingKeys, groupBy };