@mody-park-cha-raja/finance_common 4.18.0 → 4.19.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
@@ -1,3 +1,8 @@
1
+ declare const SPECIAL_FLATS: readonly string[];
2
+ declare const FLAT_NUMBERS: readonly string[];
3
+ declare const FLATS_BY_WING: ReadonlyMap<string, readonly string[]>;
4
+ declare const WINGS: readonly string[];
5
+
1
6
  declare enum ConfigurationKey {
2
7
  OPENING_BALANCE = "opening_balance",
3
8
  EDIT_ALLOWANCE_PERIOD = "edit_allowance_period",
@@ -312,6 +317,50 @@ declare class ExpenseModel extends BaseEntityModel implements IExpenseEntity {
312
317
  get incurredByUserName(): string | undefined;
313
318
  }
314
319
 
320
+ interface FlatDonationLike {
321
+ flatNo: string;
322
+ amount: number;
323
+ donationYear?: number;
324
+ createdOn?: number;
325
+ createdByUser?: {
326
+ name?: string;
327
+ } | null;
328
+ updatedByUser?: {
329
+ name?: string;
330
+ } | null;
331
+ }
332
+ type FlatCollectionStatus = "Paid" | "Pending";
333
+ interface FlatCollectionEntry {
334
+ flatNumber: string;
335
+ status: FlatCollectionStatus;
336
+ amount: number;
337
+ latestDonation?: FlatDonationLike | null;
338
+ }
339
+ interface FlatParseResult {
340
+ wing?: string;
341
+ num?: string;
342
+ isSpecial: boolean;
343
+ }
344
+ interface FlatOption {
345
+ label: string;
346
+ value: string;
347
+ }
348
+ declare class FlatModel {
349
+ static readonly FLAT_NUMBERS: readonly string[];
350
+ static readonly FLATS_BY_WING: ReadonlyMap<string, readonly string[]>;
351
+ static readonly SPECIAL_FLATS: readonly string[];
352
+ static readonly WINGS: readonly string[];
353
+ static getDonationYear(): number;
354
+ static buildFlatNumber(wing: string, num: string): string;
355
+ static isSpecialFlat(flatNo: string): boolean;
356
+ static parseFlatNumber(flatNo: string): FlatParseResult;
357
+ static getFlatOptions(wing: string): FlatOption[];
358
+ static getDisplayLabel(wing: string, flatNo: string): string;
359
+ static computeCollectionStatus(donations: FlatDonationLike[], year: number): FlatCollectionEntry[];
360
+ static compareFlatNumbers(a: string, b: string): number;
361
+ static convertNumberToWords(num: number): string;
362
+ }
363
+
315
364
  declare class SponsorHistoryModel extends BaseEntityModel implements ISponsorHistoryEntity {
316
365
  id: number;
317
366
  entityId: number;
@@ -563,6 +612,8 @@ declare function definedValues<T>(arr: Array<T | undefined | null>): T[];
563
612
  */
564
613
  declare function epochToReadableDate(epoch: number | string, format?: 'short' | 'long' | 'short-dt' | 'iso'): string;
565
614
 
615
+ declare function convertNumberToWords(num: number): string;
616
+
566
617
  declare enum RelationType {
567
618
  ONE = "ONE",
568
619
  MANY = "MANY"
@@ -737,4 +788,4 @@ interface IConfigurationUpdateDto extends IEntityUpdateDto<EntityType<EntityList
737
788
  interface IConfigurationSearchDto extends IEntityFilterData<EntityType<EntityList.CONFIGURATION>> {
738
789
  }
739
790
 
740
- export { BadRequestException, BaseEntityModel, ConfigurationKey, ConfigurationModel, ConfigurationType, DateCodeUtils, DateUtil, DonationHistoryModel, DonationModel, EntityFilterDataHelper, EntityHistoryOperation, EntityList, type EntityListEntityModelMap, type EntityModelType, EntityStatus, type EntityType, ExpenseHistoryModel, ExpenseModel, ExpenseType, 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, PaymentType, ReferenceIdPrefix, RelationType, SponsorHistoryModel, SponsorModel, SponsorTier, TransactionHistoryModel, TransactionModel, TransactionType, USER_RELATION_CONFIG, UnauthorizedException, UserHistoryModel, UserModel, VendorHistoryModel, VendorModel, VendorType, definedValues, diffArrays, entityListEntityModelMap, epochToReadableDate, getObjectDiffingKeys, groupBy };
791
+ 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, 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 };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,8 @@
1
+ declare const SPECIAL_FLATS: readonly string[];
2
+ declare const FLAT_NUMBERS: readonly string[];
3
+ declare const FLATS_BY_WING: ReadonlyMap<string, readonly string[]>;
4
+ declare const WINGS: readonly string[];
5
+
1
6
  declare enum ConfigurationKey {
2
7
  OPENING_BALANCE = "opening_balance",
3
8
  EDIT_ALLOWANCE_PERIOD = "edit_allowance_period",
@@ -312,6 +317,50 @@ declare class ExpenseModel extends BaseEntityModel implements IExpenseEntity {
312
317
  get incurredByUserName(): string | undefined;
313
318
  }
314
319
 
320
+ interface FlatDonationLike {
321
+ flatNo: string;
322
+ amount: number;
323
+ donationYear?: number;
324
+ createdOn?: number;
325
+ createdByUser?: {
326
+ name?: string;
327
+ } | null;
328
+ updatedByUser?: {
329
+ name?: string;
330
+ } | null;
331
+ }
332
+ type FlatCollectionStatus = "Paid" | "Pending";
333
+ interface FlatCollectionEntry {
334
+ flatNumber: string;
335
+ status: FlatCollectionStatus;
336
+ amount: number;
337
+ latestDonation?: FlatDonationLike | null;
338
+ }
339
+ interface FlatParseResult {
340
+ wing?: string;
341
+ num?: string;
342
+ isSpecial: boolean;
343
+ }
344
+ interface FlatOption {
345
+ label: string;
346
+ value: string;
347
+ }
348
+ declare class FlatModel {
349
+ static readonly FLAT_NUMBERS: readonly string[];
350
+ static readonly FLATS_BY_WING: ReadonlyMap<string, readonly string[]>;
351
+ static readonly SPECIAL_FLATS: readonly string[];
352
+ static readonly WINGS: readonly string[];
353
+ static getDonationYear(): number;
354
+ static buildFlatNumber(wing: string, num: string): string;
355
+ static isSpecialFlat(flatNo: string): boolean;
356
+ static parseFlatNumber(flatNo: string): FlatParseResult;
357
+ static getFlatOptions(wing: string): FlatOption[];
358
+ static getDisplayLabel(wing: string, flatNo: string): string;
359
+ static computeCollectionStatus(donations: FlatDonationLike[], year: number): FlatCollectionEntry[];
360
+ static compareFlatNumbers(a: string, b: string): number;
361
+ static convertNumberToWords(num: number): string;
362
+ }
363
+
315
364
  declare class SponsorHistoryModel extends BaseEntityModel implements ISponsorHistoryEntity {
316
365
  id: number;
317
366
  entityId: number;
@@ -563,6 +612,8 @@ declare function definedValues<T>(arr: Array<T | undefined | null>): T[];
563
612
  */
564
613
  declare function epochToReadableDate(epoch: number | string, format?: 'short' | 'long' | 'short-dt' | 'iso'): string;
565
614
 
615
+ declare function convertNumberToWords(num: number): string;
616
+
566
617
  declare enum RelationType {
567
618
  ONE = "ONE",
568
619
  MANY = "MANY"
@@ -737,4 +788,4 @@ interface IConfigurationUpdateDto extends IEntityUpdateDto<EntityType<EntityList
737
788
  interface IConfigurationSearchDto extends IEntityFilterData<EntityType<EntityList.CONFIGURATION>> {
738
789
  }
739
790
 
740
- export { BadRequestException, BaseEntityModel, ConfigurationKey, ConfigurationModel, ConfigurationType, DateCodeUtils, DateUtil, DonationHistoryModel, DonationModel, EntityFilterDataHelper, EntityHistoryOperation, EntityList, type EntityListEntityModelMap, type EntityModelType, EntityStatus, type EntityType, ExpenseHistoryModel, ExpenseModel, ExpenseType, 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, PaymentType, ReferenceIdPrefix, RelationType, SponsorHistoryModel, SponsorModel, SponsorTier, TransactionHistoryModel, TransactionModel, TransactionType, USER_RELATION_CONFIG, UnauthorizedException, UserHistoryModel, UserModel, VendorHistoryModel, VendorModel, VendorType, definedValues, diffArrays, entityListEntityModelMap, epochToReadableDate, getObjectDiffingKeys, groupBy };
791
+ 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, 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 };