@mody-park-cha-raja/finance_common 4.20.1-beta.2 → 4.20.1-beta.3

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
@@ -119,9 +119,10 @@ interface IExpenseEntity extends IAuditColumnEntity {
119
119
  name: string;
120
120
  type: ExpenseType;
121
121
  incurredBy: number;
122
- vendorName: string;
122
+ vendorId: number;
123
123
  billNumber?: string;
124
124
  remarks?: string;
125
+ description?: string;
125
126
  amount: number;
126
127
  paymentType: PaymentType;
127
128
  status?: EntityStatus;
@@ -228,6 +229,13 @@ interface IVendorEntity extends IAuditColumnEntity {
228
229
  name: string;
229
230
  type: string;
230
231
  }
232
+ /**
233
+ * Common config for vendor entity
234
+ * used on the expense entity as a vendorId -> vendor relation
235
+ *
236
+ * Adding column keys reduce the bandwidth that is used
237
+ */
238
+ declare const VENDOR_RELATION_CONFIG: IEntityFilterSearchData<EntityList.VENDOR>;
231
239
 
232
240
  declare class DonationHistoryModel extends BaseEntityModel implements IDonationHistoryEntity {
233
241
  id: number;
@@ -298,15 +306,31 @@ declare class ExpenseHistoryModel extends BaseEntityModel implements IExpenseHis
298
306
  static populateFromEntity(entity: IExpenseHistoryEntity): ExpenseHistoryModel;
299
307
  }
300
308
 
309
+ declare class VendorModel extends BaseEntityModel implements IVendorEntity {
310
+ id: number;
311
+ name: string;
312
+ type: string;
313
+ createdOn: number;
314
+ updatedOn: number;
315
+ createdBy: number;
316
+ updatedBy: number;
317
+ createdByUser?: UserModel;
318
+ updatedByUser?: UserModel;
319
+ protected constructor();
320
+ static relations: Partial<Record<EntityList, IModelRelationConfig<EntityList>>>;
321
+ static populateFromEntity(entity: IVendorEntity): VendorModel;
322
+ }
323
+
301
324
  declare class ExpenseModel extends BaseEntityModel implements IExpenseEntity {
302
325
  id: number;
303
326
  name: string;
304
327
  type: ExpenseType;
305
- vendorName: string;
328
+ vendorId: number;
306
329
  incurredBy: number;
307
330
  amount: number;
308
331
  billNumber?: string;
309
332
  remarks?: string;
333
+ description?: string;
310
334
  paymentType: PaymentType;
311
335
  status: EntityStatus;
312
336
  createdOn: number;
@@ -316,10 +340,12 @@ declare class ExpenseModel extends BaseEntityModel implements IExpenseEntity {
316
340
  createdByUser?: UserModel;
317
341
  updatedByUser?: UserModel;
318
342
  incurredByUser?: UserModel;
343
+ vendor?: VendorModel;
319
344
  protected constructor();
320
345
  static relations: Partial<Record<EntityList, IModelRelationConfig<EntityList>>>;
321
346
  static populateFromEntity(entity: IExpenseEntity): ExpenseModel;
322
347
  get incurredByUserName(): string | undefined;
348
+ get vendorName(): string;
323
349
  }
324
350
 
325
351
  interface FlatDonationLike {
@@ -467,21 +493,6 @@ declare class VendorHistoryModel extends BaseEntityModel implements IVendorHisto
467
493
  static populateFromEntity(entity: IVendorHistoryEntity): VendorHistoryModel;
468
494
  }
469
495
 
470
- declare class VendorModel extends BaseEntityModel implements IVendorEntity {
471
- id: number;
472
- name: string;
473
- type: string;
474
- createdOn: number;
475
- updatedOn: number;
476
- createdBy: number;
477
- updatedBy: number;
478
- createdByUser?: UserModel;
479
- updatedByUser?: UserModel;
480
- protected constructor();
481
- static relations: Partial<Record<EntityList, IModelRelationConfig<EntityList>>>;
482
- static populateFromEntity(entity: IVendorEntity): VendorModel;
483
- }
484
-
485
496
  declare class ConfigurationModel extends BaseEntityModel implements IConfigurationEntity {
486
497
  id: number;
487
498
  key: string;
@@ -793,4 +804,4 @@ interface IConfigurationUpdateDto extends IEntityUpdateDto<EntityType<EntityList
793
804
  interface IConfigurationSearchDto extends IEntityFilterData<EntityType<EntityList.CONFIGURATION>> {
794
805
  }
795
806
 
796
- export { BadRequestException, BaseEntityModel, ConfigurationKey, ConfigurationModel, ConfigurationType, DateCodeUtils, DateUtil, DonationHistoryModel, DonationModel, EntityFilterDataHelper, EntityHistoryOperation, EntityList, type EntityListEntityModelMap, type EntityModelType, EntityStatus, type EntityType, ExpenseHistoryModel, ExpenseModel, ExpenseType, FLATS_BY_WING, FLAT_NUMBERS, type FlatCollectionEntry, type FlatCollectionStatus, type FlatDonationLike, FlatModel, type FlatOption, type FlatParseResult, ForbiddenException, HttpException, type IAuditColumnEntity, type IBaseHistoryEntity, type ICashBookEntry, type IConfigurationCreateDto, type IConfigurationEntity, type IConfigurationSearchDto, type IConfigurationUpdateDto, type IDonationCreateDto, type IDonationEntity, type IDonationHistoryEntity, type IDonationSearchDto, type IDonationUpdateDto, type IDtoValidationError, type IEntityCreateDto, type IEntityFilterData, type IEntityFilterSearchData, type IEntityFilterSearchDataV2, type IEntityUpdateDto, type IExpenseCreateDto, type IExpenseEntity, type IExpenseHistoryEntity, type IExpenseSearchDto, type IExpenseUpdateDto, type IMappingPropertyEntry, type IModelRelationConfig, type ISearchV2Response, type ISponsorCreateDto, type ISponsorEntity, type ISponsorHistoryEntity, type ISponsorSearchDto, type ISponsorUpdateDto, type ITransactionCreateDto, type ITransactionEntity, type ITransactionHistoryEntity, type ITransactionSearchDto, type ITransactionUpdateDto, type IUserCreateDto, type IUserEntity, type IUserHistoryEntity, type IUserSearchDto, type IUserUpdateDto, type IVendorCreateDto, type IVendorEntity, type IVendorHistoryEntity, type IVendorSearchDto, type IVendorUpdateDto, NotFoundException, type Nullable, OrderByDirection, PAYMENT_OPTIONS, PaymentType, ReferenceIdPrefix, RelationType, SPECIAL_FLATS, SponsorHistoryModel, SponsorModel, SponsorTier, TransactionHistoryModel, TransactionModel, TransactionType, USER_RELATION_CONFIG, UnauthorizedException, UserHistoryModel, UserModel, VendorHistoryModel, VendorModel, VendorType, WINGS, convertNumberToWords, definedValues, diffArrays, entityListEntityModelMap, epochToReadableDate, getObjectDiffingKeys, groupBy };
807
+ export { BadRequestException, BaseEntityModel, ConfigurationKey, ConfigurationModel, ConfigurationType, DateCodeUtils, DateUtil, DonationHistoryModel, DonationModel, EntityFilterDataHelper, EntityHistoryOperation, EntityList, type EntityListEntityModelMap, type EntityModelType, EntityStatus, type EntityType, ExpenseHistoryModel, ExpenseModel, ExpenseType, FLATS_BY_WING, FLAT_NUMBERS, type FlatCollectionEntry, type FlatCollectionStatus, type FlatDonationLike, FlatModel, type FlatOption, type FlatParseResult, ForbiddenException, HttpException, type IAuditColumnEntity, type IBaseHistoryEntity, type ICashBookEntry, type IConfigurationCreateDto, type IConfigurationEntity, type IConfigurationSearchDto, type IConfigurationUpdateDto, type IDonationCreateDto, type IDonationEntity, type IDonationHistoryEntity, type IDonationSearchDto, type IDonationUpdateDto, type IDtoValidationError, type IEntityCreateDto, type IEntityFilterData, type IEntityFilterSearchData, type IEntityFilterSearchDataV2, type IEntityUpdateDto, type IExpenseCreateDto, type IExpenseEntity, type IExpenseHistoryEntity, type IExpenseSearchDto, type IExpenseUpdateDto, type IMappingPropertyEntry, type IModelRelationConfig, type ISearchV2Response, type ISponsorCreateDto, type ISponsorEntity, type ISponsorHistoryEntity, type ISponsorSearchDto, type ISponsorUpdateDto, type ITransactionCreateDto, type ITransactionEntity, type ITransactionHistoryEntity, type ITransactionSearchDto, type ITransactionUpdateDto, type IUserCreateDto, type IUserEntity, type IUserHistoryEntity, type IUserSearchDto, type IUserUpdateDto, type IVendorCreateDto, type IVendorEntity, type IVendorHistoryEntity, type IVendorSearchDto, type IVendorUpdateDto, NotFoundException, type Nullable, OrderByDirection, PAYMENT_OPTIONS, PaymentType, ReferenceIdPrefix, RelationType, SPECIAL_FLATS, SponsorHistoryModel, SponsorModel, SponsorTier, TransactionHistoryModel, TransactionModel, TransactionType, USER_RELATION_CONFIG, UnauthorizedException, UserHistoryModel, UserModel, VENDOR_RELATION_CONFIG, VendorHistoryModel, VendorModel, VendorType, WINGS, convertNumberToWords, definedValues, diffArrays, entityListEntityModelMap, epochToReadableDate, getObjectDiffingKeys, groupBy };
package/dist/index.d.ts CHANGED
@@ -119,9 +119,10 @@ interface IExpenseEntity extends IAuditColumnEntity {
119
119
  name: string;
120
120
  type: ExpenseType;
121
121
  incurredBy: number;
122
- vendorName: string;
122
+ vendorId: number;
123
123
  billNumber?: string;
124
124
  remarks?: string;
125
+ description?: string;
125
126
  amount: number;
126
127
  paymentType: PaymentType;
127
128
  status?: EntityStatus;
@@ -228,6 +229,13 @@ interface IVendorEntity extends IAuditColumnEntity {
228
229
  name: string;
229
230
  type: string;
230
231
  }
232
+ /**
233
+ * Common config for vendor entity
234
+ * used on the expense entity as a vendorId -> vendor relation
235
+ *
236
+ * Adding column keys reduce the bandwidth that is used
237
+ */
238
+ declare const VENDOR_RELATION_CONFIG: IEntityFilterSearchData<EntityList.VENDOR>;
231
239
 
232
240
  declare class DonationHistoryModel extends BaseEntityModel implements IDonationHistoryEntity {
233
241
  id: number;
@@ -298,15 +306,31 @@ declare class ExpenseHistoryModel extends BaseEntityModel implements IExpenseHis
298
306
  static populateFromEntity(entity: IExpenseHistoryEntity): ExpenseHistoryModel;
299
307
  }
300
308
 
309
+ declare class VendorModel extends BaseEntityModel implements IVendorEntity {
310
+ id: number;
311
+ name: string;
312
+ type: string;
313
+ createdOn: number;
314
+ updatedOn: number;
315
+ createdBy: number;
316
+ updatedBy: number;
317
+ createdByUser?: UserModel;
318
+ updatedByUser?: UserModel;
319
+ protected constructor();
320
+ static relations: Partial<Record<EntityList, IModelRelationConfig<EntityList>>>;
321
+ static populateFromEntity(entity: IVendorEntity): VendorModel;
322
+ }
323
+
301
324
  declare class ExpenseModel extends BaseEntityModel implements IExpenseEntity {
302
325
  id: number;
303
326
  name: string;
304
327
  type: ExpenseType;
305
- vendorName: string;
328
+ vendorId: number;
306
329
  incurredBy: number;
307
330
  amount: number;
308
331
  billNumber?: string;
309
332
  remarks?: string;
333
+ description?: string;
310
334
  paymentType: PaymentType;
311
335
  status: EntityStatus;
312
336
  createdOn: number;
@@ -316,10 +340,12 @@ declare class ExpenseModel extends BaseEntityModel implements IExpenseEntity {
316
340
  createdByUser?: UserModel;
317
341
  updatedByUser?: UserModel;
318
342
  incurredByUser?: UserModel;
343
+ vendor?: VendorModel;
319
344
  protected constructor();
320
345
  static relations: Partial<Record<EntityList, IModelRelationConfig<EntityList>>>;
321
346
  static populateFromEntity(entity: IExpenseEntity): ExpenseModel;
322
347
  get incurredByUserName(): string | undefined;
348
+ get vendorName(): string;
323
349
  }
324
350
 
325
351
  interface FlatDonationLike {
@@ -467,21 +493,6 @@ declare class VendorHistoryModel extends BaseEntityModel implements IVendorHisto
467
493
  static populateFromEntity(entity: IVendorHistoryEntity): VendorHistoryModel;
468
494
  }
469
495
 
470
- declare class VendorModel extends BaseEntityModel implements IVendorEntity {
471
- id: number;
472
- name: string;
473
- type: string;
474
- createdOn: number;
475
- updatedOn: number;
476
- createdBy: number;
477
- updatedBy: number;
478
- createdByUser?: UserModel;
479
- updatedByUser?: UserModel;
480
- protected constructor();
481
- static relations: Partial<Record<EntityList, IModelRelationConfig<EntityList>>>;
482
- static populateFromEntity(entity: IVendorEntity): VendorModel;
483
- }
484
-
485
496
  declare class ConfigurationModel extends BaseEntityModel implements IConfigurationEntity {
486
497
  id: number;
487
498
  key: string;
@@ -793,4 +804,4 @@ interface IConfigurationUpdateDto extends IEntityUpdateDto<EntityType<EntityList
793
804
  interface IConfigurationSearchDto extends IEntityFilterData<EntityType<EntityList.CONFIGURATION>> {
794
805
  }
795
806
 
796
- export { BadRequestException, BaseEntityModel, ConfigurationKey, ConfigurationModel, ConfigurationType, DateCodeUtils, DateUtil, DonationHistoryModel, DonationModel, EntityFilterDataHelper, EntityHistoryOperation, EntityList, type EntityListEntityModelMap, type EntityModelType, EntityStatus, type EntityType, ExpenseHistoryModel, ExpenseModel, ExpenseType, FLATS_BY_WING, FLAT_NUMBERS, type FlatCollectionEntry, type FlatCollectionStatus, type FlatDonationLike, FlatModel, type FlatOption, type FlatParseResult, ForbiddenException, HttpException, type IAuditColumnEntity, type IBaseHistoryEntity, type ICashBookEntry, type IConfigurationCreateDto, type IConfigurationEntity, type IConfigurationSearchDto, type IConfigurationUpdateDto, type IDonationCreateDto, type IDonationEntity, type IDonationHistoryEntity, type IDonationSearchDto, type IDonationUpdateDto, type IDtoValidationError, type IEntityCreateDto, type IEntityFilterData, type IEntityFilterSearchData, type IEntityFilterSearchDataV2, type IEntityUpdateDto, type IExpenseCreateDto, type IExpenseEntity, type IExpenseHistoryEntity, type IExpenseSearchDto, type IExpenseUpdateDto, type IMappingPropertyEntry, type IModelRelationConfig, type ISearchV2Response, type ISponsorCreateDto, type ISponsorEntity, type ISponsorHistoryEntity, type ISponsorSearchDto, type ISponsorUpdateDto, type ITransactionCreateDto, type ITransactionEntity, type ITransactionHistoryEntity, type ITransactionSearchDto, type ITransactionUpdateDto, type IUserCreateDto, type IUserEntity, type IUserHistoryEntity, type IUserSearchDto, type IUserUpdateDto, type IVendorCreateDto, type IVendorEntity, type IVendorHistoryEntity, type IVendorSearchDto, type IVendorUpdateDto, NotFoundException, type Nullable, OrderByDirection, PAYMENT_OPTIONS, PaymentType, ReferenceIdPrefix, RelationType, SPECIAL_FLATS, SponsorHistoryModel, SponsorModel, SponsorTier, TransactionHistoryModel, TransactionModel, TransactionType, USER_RELATION_CONFIG, UnauthorizedException, UserHistoryModel, UserModel, VendorHistoryModel, VendorModel, VendorType, WINGS, convertNumberToWords, definedValues, diffArrays, entityListEntityModelMap, epochToReadableDate, getObjectDiffingKeys, groupBy };
807
+ export { BadRequestException, BaseEntityModel, ConfigurationKey, ConfigurationModel, ConfigurationType, DateCodeUtils, DateUtil, DonationHistoryModel, DonationModel, EntityFilterDataHelper, EntityHistoryOperation, EntityList, type EntityListEntityModelMap, type EntityModelType, EntityStatus, type EntityType, ExpenseHistoryModel, ExpenseModel, ExpenseType, FLATS_BY_WING, FLAT_NUMBERS, type FlatCollectionEntry, type FlatCollectionStatus, type FlatDonationLike, FlatModel, type FlatOption, type FlatParseResult, ForbiddenException, HttpException, type IAuditColumnEntity, type IBaseHistoryEntity, type ICashBookEntry, type IConfigurationCreateDto, type IConfigurationEntity, type IConfigurationSearchDto, type IConfigurationUpdateDto, type IDonationCreateDto, type IDonationEntity, type IDonationHistoryEntity, type IDonationSearchDto, type IDonationUpdateDto, type IDtoValidationError, type IEntityCreateDto, type IEntityFilterData, type IEntityFilterSearchData, type IEntityFilterSearchDataV2, type IEntityUpdateDto, type IExpenseCreateDto, type IExpenseEntity, type IExpenseHistoryEntity, type IExpenseSearchDto, type IExpenseUpdateDto, type IMappingPropertyEntry, type IModelRelationConfig, type ISearchV2Response, type ISponsorCreateDto, type ISponsorEntity, type ISponsorHistoryEntity, type ISponsorSearchDto, type ISponsorUpdateDto, type ITransactionCreateDto, type ITransactionEntity, type ITransactionHistoryEntity, type ITransactionSearchDto, type ITransactionUpdateDto, type IUserCreateDto, type IUserEntity, type IUserHistoryEntity, type IUserSearchDto, type IUserUpdateDto, type IVendorCreateDto, type IVendorEntity, type IVendorHistoryEntity, type IVendorSearchDto, type IVendorUpdateDto, NotFoundException, type Nullable, OrderByDirection, PAYMENT_OPTIONS, PaymentType, ReferenceIdPrefix, RelationType, SPECIAL_FLATS, SponsorHistoryModel, SponsorModel, SponsorTier, TransactionHistoryModel, TransactionModel, TransactionType, USER_RELATION_CONFIG, UnauthorizedException, UserHistoryModel, UserModel, VENDOR_RELATION_CONFIG, VendorHistoryModel, VendorModel, VendorType, WINGS, convertNumberToWords, definedValues, diffArrays, entityListEntityModelMap, epochToReadableDate, getObjectDiffingKeys, groupBy };
package/dist/index.js CHANGED
@@ -58,6 +58,7 @@ __export(index_exports, {
58
58
  UnauthorizedException: () => UnauthorizedException,
59
59
  UserHistoryModel: () => UserHistoryModel,
60
60
  UserModel: () => UserModel,
61
+ VENDOR_RELATION_CONFIG: () => VENDOR_RELATION_CONFIG,
61
62
  VendorHistoryModel: () => VendorHistoryModel,
62
63
  VendorModel: () => VendorModel,
63
64
  VendorType: () => VendorType,
@@ -820,7 +821,7 @@ var _ExpenseModel = class _ExpenseModel extends BaseEntityModel {
820
821
  this.id = 0;
821
822
  this.name = "";
822
823
  this.type = "Miscellaneous" /* MISCELLANEOUS */;
823
- this.vendorName = "";
824
+ this.vendorId = 0;
824
825
  this.incurredBy = 0;
825
826
  this.amount = 0;
826
827
  this.paymentType = "Cash" /* CASH */;
@@ -838,6 +839,9 @@ var _ExpenseModel = class _ExpenseModel extends BaseEntityModel {
838
839
  get incurredByUserName() {
839
840
  return this.incurredByUser?.name;
840
841
  }
842
+ get vendorName() {
843
+ return this.vendor?.name ?? "";
844
+ }
841
845
  };
842
846
  _ExpenseModel.relations = {
843
847
  ["user" /* USER */]: {
@@ -849,6 +853,14 @@ _ExpenseModel.relations = {
849
853
  ],
850
854
  searchProperty: "id",
851
855
  entity: "user" /* USER */
856
+ },
857
+ ["vendor" /* VENDOR */]: {
858
+ relationType: "ONE" /* ONE */,
859
+ mappingProperties: [
860
+ { sourceProperty: "vendorId", targetProperty: "vendor" }
861
+ ],
862
+ searchProperty: "id",
863
+ entity: "vendor" /* VENDOR */
852
864
  }
853
865
  };
854
866
  var ExpenseModel = _ExpenseModel;
@@ -1571,6 +1583,12 @@ var USER_RELATION_CONFIG = {
1571
1583
  name: "user" /* USER */,
1572
1584
  columnKeys: ["id", "name"]
1573
1585
  };
1586
+
1587
+ // src/interfaces/entities/vendor.entity.interface.ts
1588
+ var VENDOR_RELATION_CONFIG = {
1589
+ name: "vendor" /* VENDOR */,
1590
+ columnKeys: ["id", "name"]
1591
+ };
1574
1592
  // Annotate the CommonJS export names for ESM import in node:
1575
1593
  0 && (module.exports = {
1576
1594
  BadRequestException,
@@ -1611,6 +1629,7 @@ var USER_RELATION_CONFIG = {
1611
1629
  UnauthorizedException,
1612
1630
  UserHistoryModel,
1613
1631
  UserModel,
1632
+ VENDOR_RELATION_CONFIG,
1614
1633
  VendorHistoryModel,
1615
1634
  VendorModel,
1616
1635
  VendorType,