@mody-park-cha-raja/finance_common 4.27.1-beta.0 → 4.27.1-beta.2

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
@@ -123,6 +123,7 @@ interface IDonationEntity extends IAuditColumnEntity {
123
123
  id: number;
124
124
  receiptNumber: string;
125
125
  flatNo: string;
126
+ flatId: number;
126
127
  amount: number;
127
128
  mobileNumber?: string;
128
129
  paymentType: PaymentType;
@@ -292,10 +293,69 @@ declare class UserModel extends BaseEntityModel implements IUserEntity {
292
293
  static populateFromEntity(entity: IUserEntity): UserModel;
293
294
  }
294
295
 
296
+ interface FlatDonationLike {
297
+ flatNo: string;
298
+ amount: number;
299
+ donationYear?: number;
300
+ createdOn?: number;
301
+ createdByUser?: Nullable<{
302
+ name?: string;
303
+ }>;
304
+ updatedByUser?: Nullable<{
305
+ name?: string;
306
+ }>;
307
+ }
308
+ type FlatCollectionStatus = "Paid" | "Pending";
309
+ interface FlatCollectionEntry {
310
+ flatNumber: string;
311
+ status: FlatCollectionStatus;
312
+ amount: number;
313
+ latestDonation?: Nullable<FlatDonationLike>;
314
+ }
315
+ interface FlatParseResult {
316
+ wing?: string;
317
+ num?: string;
318
+ isSpecial: boolean;
319
+ }
320
+ interface FlatOption {
321
+ label: string;
322
+ value: string;
323
+ }
324
+ declare class FlatModel {
325
+ id: number;
326
+ wing: string;
327
+ unitNumber: string;
328
+ status: EntityStatus;
329
+ createdOn: number;
330
+ updatedOn: number;
331
+ createdBy: number;
332
+ updatedBy: number;
333
+ static populateFromEntity(entity: IFlatEntity): FlatModel;
334
+ createdByUser?: UserModel;
335
+ updatedByUser?: UserModel;
336
+ donations?: DonationModel[];
337
+ static relations: Partial<Record<EntityList, IModelRelationConfig<EntityList>>>;
338
+ static readonly FLAT_NUMBERS: readonly string[];
339
+ static readonly FLATS_BY_WING: ReadonlyMap<string, readonly string[]>;
340
+ static readonly SPECIAL_FLATS: readonly string[];
341
+ static readonly WINGS: readonly string[];
342
+ static getDonationYear(): number;
343
+ static getTotalFlats(): number;
344
+ static buildFlatNumber(wing: string, num: string): string;
345
+ static isSpecialFlat(flatNo: string): boolean;
346
+ static parseFlatNumber(flatNo: string): FlatParseResult;
347
+ static getFlatOptions(wing: string): FlatOption[];
348
+ static getDisplayLabel(wing: string, flatNo: string): string;
349
+ static computeCollectionStatus(donations: FlatDonationLike[], year: number): FlatCollectionEntry[];
350
+ static compareFlatNumbers(a: string, b: string): number;
351
+ static convertNumberToWords(num: number): string;
352
+ }
353
+
295
354
  declare class DonationModel extends BaseEntityModel implements IDonationEntity {
296
355
  id: number;
297
356
  receiptNumber: string;
298
357
  flatNo: string;
358
+ flatId: number;
299
359
  amount: number;
300
360
  mobileNumber?: string;
301
361
  paymentType: PaymentType;
@@ -307,6 +367,7 @@ declare class DonationModel extends BaseEntityModel implements IDonationEntity {
307
367
  updatedBy: number;
308
368
  createdByUser?: UserModel;
309
369
  updatedByUser?: UserModel;
370
+ flat?: FlatModel;
310
371
  protected constructor();
311
372
  static relations: Partial<Record<EntityList, IModelRelationConfig<EntityList>>>;
312
373
  static populateFromEntity(entity: IDonationEntity): DonationModel;
@@ -385,60 +446,6 @@ declare class FlatHistoryModel extends BaseEntityModel implements IFlatHistoryEn
385
446
  static populateFromEntity(entity: IFlatHistoryEntity): FlatHistoryModel;
386
447
  }
387
448
 
388
- interface FlatDonationLike {
389
- flatNo: string;
390
- amount: number;
391
- donationYear?: number;
392
- createdOn?: number;
393
- createdByUser?: Nullable<{
394
- name?: string;
395
- }>;
396
- updatedByUser?: Nullable<{
397
- name?: string;
398
- }>;
399
- }
400
- type FlatCollectionStatus = "Paid" | "Pending";
401
- interface FlatCollectionEntry {
402
- flatNumber: string;
403
- status: FlatCollectionStatus;
404
- amount: number;
405
- latestDonation?: Nullable<FlatDonationLike>;
406
- }
407
- interface FlatParseResult {
408
- wing?: string;
409
- num?: string;
410
- isSpecial: boolean;
411
- }
412
- interface FlatOption {
413
- label: string;
414
- value: string;
415
- }
416
- declare class FlatModel {
417
- id: number;
418
- wing: string;
419
- unitNumber: string;
420
- status: EntityStatus;
421
- createdOn: number;
422
- updatedOn: number;
423
- createdBy: number;
424
- updatedBy: number;
425
- static populateFromEntity(entity: IFlatEntity): FlatModel;
426
- static readonly FLAT_NUMBERS: readonly string[];
427
- static readonly FLATS_BY_WING: ReadonlyMap<string, readonly string[]>;
428
- static readonly SPECIAL_FLATS: readonly string[];
429
- static readonly WINGS: readonly string[];
430
- static getDonationYear(): number;
431
- static getTotalFlats(): number;
432
- static buildFlatNumber(wing: string, num: string): string;
433
- static isSpecialFlat(flatNo: string): boolean;
434
- static parseFlatNumber(flatNo: string): FlatParseResult;
435
- static getFlatOptions(wing: string): FlatOption[];
436
- static getDisplayLabel(wing: string, flatNo: string): string;
437
- static computeCollectionStatus(donations: FlatDonationLike[], year: number): FlatCollectionEntry[];
438
- static compareFlatNumbers(a: string, b: string): number;
439
- static convertNumberToWords(num: number): string;
440
- }
441
-
442
449
  declare class SponsorHistoryModel extends BaseEntityModel implements ISponsorHistoryEntity {
443
450
  id: number;
444
451
  entityId: number;
package/dist/index.d.ts CHANGED
@@ -123,6 +123,7 @@ interface IDonationEntity extends IAuditColumnEntity {
123
123
  id: number;
124
124
  receiptNumber: string;
125
125
  flatNo: string;
126
+ flatId: number;
126
127
  amount: number;
127
128
  mobileNumber?: string;
128
129
  paymentType: PaymentType;
@@ -292,10 +293,69 @@ declare class UserModel extends BaseEntityModel implements IUserEntity {
292
293
  static populateFromEntity(entity: IUserEntity): UserModel;
293
294
  }
294
295
 
296
+ interface FlatDonationLike {
297
+ flatNo: string;
298
+ amount: number;
299
+ donationYear?: number;
300
+ createdOn?: number;
301
+ createdByUser?: Nullable<{
302
+ name?: string;
303
+ }>;
304
+ updatedByUser?: Nullable<{
305
+ name?: string;
306
+ }>;
307
+ }
308
+ type FlatCollectionStatus = "Paid" | "Pending";
309
+ interface FlatCollectionEntry {
310
+ flatNumber: string;
311
+ status: FlatCollectionStatus;
312
+ amount: number;
313
+ latestDonation?: Nullable<FlatDonationLike>;
314
+ }
315
+ interface FlatParseResult {
316
+ wing?: string;
317
+ num?: string;
318
+ isSpecial: boolean;
319
+ }
320
+ interface FlatOption {
321
+ label: string;
322
+ value: string;
323
+ }
324
+ declare class FlatModel {
325
+ id: number;
326
+ wing: string;
327
+ unitNumber: string;
328
+ status: EntityStatus;
329
+ createdOn: number;
330
+ updatedOn: number;
331
+ createdBy: number;
332
+ updatedBy: number;
333
+ static populateFromEntity(entity: IFlatEntity): FlatModel;
334
+ createdByUser?: UserModel;
335
+ updatedByUser?: UserModel;
336
+ donations?: DonationModel[];
337
+ static relations: Partial<Record<EntityList, IModelRelationConfig<EntityList>>>;
338
+ static readonly FLAT_NUMBERS: readonly string[];
339
+ static readonly FLATS_BY_WING: ReadonlyMap<string, readonly string[]>;
340
+ static readonly SPECIAL_FLATS: readonly string[];
341
+ static readonly WINGS: readonly string[];
342
+ static getDonationYear(): number;
343
+ static getTotalFlats(): number;
344
+ static buildFlatNumber(wing: string, num: string): string;
345
+ static isSpecialFlat(flatNo: string): boolean;
346
+ static parseFlatNumber(flatNo: string): FlatParseResult;
347
+ static getFlatOptions(wing: string): FlatOption[];
348
+ static getDisplayLabel(wing: string, flatNo: string): string;
349
+ static computeCollectionStatus(donations: FlatDonationLike[], year: number): FlatCollectionEntry[];
350
+ static compareFlatNumbers(a: string, b: string): number;
351
+ static convertNumberToWords(num: number): string;
352
+ }
353
+
295
354
  declare class DonationModel extends BaseEntityModel implements IDonationEntity {
296
355
  id: number;
297
356
  receiptNumber: string;
298
357
  flatNo: string;
358
+ flatId: number;
299
359
  amount: number;
300
360
  mobileNumber?: string;
301
361
  paymentType: PaymentType;
@@ -307,6 +367,7 @@ declare class DonationModel extends BaseEntityModel implements IDonationEntity {
307
367
  updatedBy: number;
308
368
  createdByUser?: UserModel;
309
369
  updatedByUser?: UserModel;
370
+ flat?: FlatModel;
310
371
  protected constructor();
311
372
  static relations: Partial<Record<EntityList, IModelRelationConfig<EntityList>>>;
312
373
  static populateFromEntity(entity: IDonationEntity): DonationModel;
@@ -385,60 +446,6 @@ declare class FlatHistoryModel extends BaseEntityModel implements IFlatHistoryEn
385
446
  static populateFromEntity(entity: IFlatHistoryEntity): FlatHistoryModel;
386
447
  }
387
448
 
388
- interface FlatDonationLike {
389
- flatNo: string;
390
- amount: number;
391
- donationYear?: number;
392
- createdOn?: number;
393
- createdByUser?: Nullable<{
394
- name?: string;
395
- }>;
396
- updatedByUser?: Nullable<{
397
- name?: string;
398
- }>;
399
- }
400
- type FlatCollectionStatus = "Paid" | "Pending";
401
- interface FlatCollectionEntry {
402
- flatNumber: string;
403
- status: FlatCollectionStatus;
404
- amount: number;
405
- latestDonation?: Nullable<FlatDonationLike>;
406
- }
407
- interface FlatParseResult {
408
- wing?: string;
409
- num?: string;
410
- isSpecial: boolean;
411
- }
412
- interface FlatOption {
413
- label: string;
414
- value: string;
415
- }
416
- declare class FlatModel {
417
- id: number;
418
- wing: string;
419
- unitNumber: string;
420
- status: EntityStatus;
421
- createdOn: number;
422
- updatedOn: number;
423
- createdBy: number;
424
- updatedBy: number;
425
- static populateFromEntity(entity: IFlatEntity): FlatModel;
426
- static readonly FLAT_NUMBERS: readonly string[];
427
- static readonly FLATS_BY_WING: ReadonlyMap<string, readonly string[]>;
428
- static readonly SPECIAL_FLATS: readonly string[];
429
- static readonly WINGS: readonly string[];
430
- static getDonationYear(): number;
431
- static getTotalFlats(): number;
432
- static buildFlatNumber(wing: string, num: string): string;
433
- static isSpecialFlat(flatNo: string): boolean;
434
- static parseFlatNumber(flatNo: string): FlatParseResult;
435
- static getFlatOptions(wing: string): FlatOption[];
436
- static getDisplayLabel(wing: string, flatNo: string): string;
437
- static computeCollectionStatus(donations: FlatDonationLike[], year: number): FlatCollectionEntry[];
438
- static compareFlatNumbers(a: string, b: string): number;
439
- static convertNumberToWords(num: number): string;
440
- }
441
-
442
449
  declare class SponsorHistoryModel extends BaseEntityModel implements ISponsorHistoryEntity {
443
450
  id: number;
444
451
  entityId: number;
package/dist/index.js CHANGED
@@ -789,6 +789,7 @@ var _DonationModel = class _DonationModel extends BaseEntityModel {
789
789
  this.id = 0;
790
790
  this.receiptNumber = "";
791
791
  this.flatNo = "";
792
+ this.flatId = 0;
792
793
  this.amount = 0;
793
794
  this.paymentType = "Cash" /* CASH */;
794
795
  this.status = "Active" /* ACTIVE */;
@@ -833,6 +834,12 @@ _DonationModel.relations = {
833
834
  ],
834
835
  searchProperty: "id",
835
836
  entity: "user" /* USER */
837
+ },
838
+ ["flat" /* FLAT */]: {
839
+ relationType: "ONE" /* ONE */,
840
+ mappingProperties: [{ sourceProperty: "flatId", targetProperty: "flat" }],
841
+ searchProperty: "id",
842
+ entity: "flat" /* FLAT */
836
843
  }
837
844
  };
838
845
  var DonationModel = _DonationModel;
@@ -1106,6 +1113,25 @@ var _FlatModel = class _FlatModel {
1106
1113
  return convertNumberToWords(num);
1107
1114
  }
1108
1115
  };
1116
+ _FlatModel.relations = {
1117
+ ["user" /* USER */]: {
1118
+ relationType: "ONE" /* ONE */,
1119
+ mappingProperties: [
1120
+ { sourceProperty: "createdBy", targetProperty: "createdByUser" },
1121
+ { sourceProperty: "updatedBy", targetProperty: "updatedByUser" }
1122
+ ],
1123
+ searchProperty: "id",
1124
+ entity: "user" /* USER */
1125
+ },
1126
+ ["donation" /* DONATION */]: {
1127
+ relationType: "MANY" /* MANY */,
1128
+ mappingProperties: [
1129
+ { sourceProperty: "id", targetProperty: "donations" }
1130
+ ],
1131
+ searchProperty: "flatId",
1132
+ entity: "donation" /* DONATION */
1133
+ }
1134
+ };
1109
1135
  _FlatModel.FLAT_NUMBERS = FLAT_NUMBERS;
1110
1136
  _FlatModel.FLATS_BY_WING = FLATS_BY_WING;
1111
1137
  _FlatModel.SPECIAL_FLATS = SPECIAL_FLATS;