@mody-park-cha-raja/finance_common 4.31.0 → 4.31.1-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/README.md +116 -11
- package/dist/index.d.mts +83 -3
- package/dist/index.d.ts +83 -3
- package/dist/index.js +108 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +105 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,18 +1,123 @@
|
|
|
1
|
-
#
|
|
2
|
-
### @mody-park-cha-raja/finance_common
|
|
1
|
+
# @mody-park-cha-raja/finance_common
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
Common interfaces, models, enums, and utilities for the Mody Park Cha Raja finance ecosystem
|
|
3
|
+
Common interfaces, models, enums, and utilities for the Mody Park Cha Raja finance ecosystem.
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
This is the **shared source of truth** for domain definitions used by the backend, web frontend, and mobile app. It is published to the npm registry as a private package and consumed by all three applications.
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
Part of the Finance workspace — see the [parent README](../README.md).
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
`npm install @mody-park-cha-raja/finance_common`
|
|
9
|
+
---
|
|
13
10
|
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
## What's Inside
|
|
12
|
+
|
|
13
|
+
The package ships TypeScript types and runtime enums/utilities organized by concern:
|
|
14
|
+
|
|
15
|
+
| Directory | Contents |
|
|
16
|
+
| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
17
|
+
| `interfaces/` | DTOs and shared interfaces |
|
|
18
|
+
| `models/` | Entity models (`base`, `donation`, `sponsor`, `expense`, `vendor`, `flat`, `transaction`, `user`, + history variants, etc.) |
|
|
19
|
+
| `enums/` | Enums (`PaymentType`, `TransactionType`, `ExpenseType`, `SponsorTier`, `SponsorFor`, `VendorType`, `EntityStatus`, `UserRole`, `ReferenceIdPrefix`, etc.) |
|
|
20
|
+
| `types/` | Shared types |
|
|
21
|
+
| `validators/` | Validation helpers / regexes |
|
|
22
|
+
| `utils/` | Utility functions |
|
|
23
|
+
| `helpers/` | Helper functions |
|
|
24
|
+
| `data/` | Static data / flow configs |
|
|
25
|
+
| `flow-configs/` | Flow configurations |
|
|
26
|
+
|
|
27
|
+
All public exports are re-exported from `src/index.ts`.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Installation
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npm install @mody-park-cha-raja/finance_common
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
> This is a private package — installers must have access to the npm registry scope it is published under.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Usage
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
import {
|
|
45
|
+
PaymentType,
|
|
46
|
+
SponsorTier,
|
|
47
|
+
DonationEntityModel,
|
|
48
|
+
TransactionType,
|
|
49
|
+
ISearchRequest,
|
|
50
|
+
} from "@mody-park-cha-raja/finance_common";
|
|
51
|
+
|
|
52
|
+
// Use enums / models throughout your feature code
|
|
53
|
+
const donation: Partial<DonationEntityModel> = {
|
|
54
|
+
paymentType: PaymentType.UPI,
|
|
55
|
+
amount: 1100,
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const tier: SponsorTier = SponsorTier.Gold;
|
|
59
|
+
|
|
60
|
+
// Reference DTO/interfaces for your API layer
|
|
61
|
+
function search(): ISearchRequest {
|
|
62
|
+
return { page: 1, limit: 20 };
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Build & Test
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
npm run build # bundle the package (tsup) → dist/
|
|
72
|
+
npm test # run tests
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
The build output is produced by **tsup**. `prepublishOnly` runs the build automatically before any publish.
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Publishing
|
|
80
|
+
|
|
81
|
+
> ⚠️ **Important:** This is a published npm package. Changes affect **all dependent repositories** (backend, frontend, mobile). Follow the full workflow in `docs/PUBLISHING.md` before publishing.
|
|
82
|
+
|
|
83
|
+
### Versioning & publish scripts
|
|
84
|
+
|
|
85
|
+
| Script | Description |
|
|
86
|
+
| ---------------- | --------------------------------------------------------------------------- |
|
|
87
|
+
| `build` | Build the package with tsup |
|
|
88
|
+
| `link` | Build + `npm link` for local development |
|
|
89
|
+
| `publish:beta` | Build → prerelease (`--preid=beta`) → push tags → publish with `--tag beta` |
|
|
90
|
+
| `full-publish` | Build → `npm version patch` → push tags → publish public |
|
|
91
|
+
| `minor-publish` | Build → minor version bump → publish |
|
|
92
|
+
| `major-publish` | Build → major version bump → publish |
|
|
93
|
+
| `prepublishOnly` | Automatically builds before publishing |
|
|
94
|
+
|
|
95
|
+
### Standard cross-repo flow
|
|
96
|
+
|
|
97
|
+
1. Modify `finance-common` first.
|
|
98
|
+
2. Build and test the package.
|
|
99
|
+
3. Publish the new version (`npm run minor-publish`, `publish:beta`, etc.).
|
|
100
|
+
4. Update the package in **all** affected repositories (`npm install @mody-park-cha-raja/finance_common@<new-version>`).
|
|
101
|
+
5. Run final validation against the published package.
|
|
102
|
+
|
|
103
|
+
The root `deploy-web.sh` automates publishing a minor version and propagating it across all apps.
|
|
104
|
+
|
|
105
|
+
### Version policy
|
|
106
|
+
|
|
107
|
+
- Maintain **backward compatibility** unless a version is explicitly breaking.
|
|
108
|
+
- Inform consumers of any breaking changes and provide a migration path where required.
|
|
109
|
+
- Do **not** remove existing exports without a migration path.
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## Contributing
|
|
114
|
+
|
|
115
|
+
- Read this repo's `AGENTS.md` and `docs/` (ARCHITECTURE, CONVENTIONS, AI-GUIDELINES, PUBLISHING) before making changes.
|
|
116
|
+
- Export only necessary types and utilities.
|
|
117
|
+
- Never commit `.env` / secret files or `.npmrc` credentials.
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## License
|
|
16
122
|
|
|
17
|
-
#License:
|
|
18
123
|
ISC
|
package/dist/index.d.mts
CHANGED
|
@@ -77,6 +77,14 @@ declare enum TransactionType {
|
|
|
77
77
|
EXPENSE = "Expense"
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
+
declare enum VendorBillStatus {
|
|
81
|
+
OPEN = "OPEN",
|
|
82
|
+
PARTIALLY_PAID = "PARTIALLY_PAID",
|
|
83
|
+
PAID = "PAID",
|
|
84
|
+
CLOSED = "CLOSED",
|
|
85
|
+
CANCELLED = "CANCELLED"
|
|
86
|
+
}
|
|
87
|
+
|
|
80
88
|
declare enum VendorType {
|
|
81
89
|
SUPPLIER = "Supplier",
|
|
82
90
|
SERVICE_PROVIDER = "Service Provider",
|
|
@@ -146,6 +154,7 @@ interface IExpenseEntity extends IAuditColumnEntity {
|
|
|
146
154
|
incurredBy: number;
|
|
147
155
|
vendorId: number;
|
|
148
156
|
expenseHeadId: number;
|
|
157
|
+
vendorBillId?: number;
|
|
149
158
|
billNumber?: string;
|
|
150
159
|
remarks?: string;
|
|
151
160
|
description?: string;
|
|
@@ -276,6 +285,23 @@ interface IVendorEntity extends IAuditColumnEntity {
|
|
|
276
285
|
type: string;
|
|
277
286
|
}
|
|
278
287
|
|
|
288
|
+
interface IVendorBillHistoryEntity extends IBaseHistoryEntity {
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
interface IVendorBillEntity extends IAuditColumnEntity {
|
|
292
|
+
id: number;
|
|
293
|
+
vendorId: number;
|
|
294
|
+
expenseHeadId: number;
|
|
295
|
+
description: string;
|
|
296
|
+
invoiceNumber?: string;
|
|
297
|
+
totalAmount: number;
|
|
298
|
+
balancePayable: number;
|
|
299
|
+
discountAmount?: number;
|
|
300
|
+
discountRemarks?: string;
|
|
301
|
+
billStatus: VendorBillStatus;
|
|
302
|
+
status?: EntityStatus;
|
|
303
|
+
}
|
|
304
|
+
|
|
279
305
|
declare class DonationHistoryModel extends BaseEntityModel implements IDonationHistoryEntity {
|
|
280
306
|
id: number;
|
|
281
307
|
entityId: number;
|
|
@@ -499,6 +525,33 @@ declare class VendorModel extends BaseEntityModel implements IVendorEntity {
|
|
|
499
525
|
static populateFromEntity(entity: IVendorEntity): VendorModel;
|
|
500
526
|
}
|
|
501
527
|
|
|
528
|
+
declare class VendorBillModel extends BaseEntityModel implements IVendorBillEntity {
|
|
529
|
+
id: number;
|
|
530
|
+
vendorId: number;
|
|
531
|
+
expenseHeadId: number;
|
|
532
|
+
description: string;
|
|
533
|
+
invoiceNumber?: string;
|
|
534
|
+
totalAmount: number;
|
|
535
|
+
balancePayable: number;
|
|
536
|
+
discountAmount?: number;
|
|
537
|
+
discountRemarks?: string;
|
|
538
|
+
billStatus: VendorBillStatus;
|
|
539
|
+
status: EntityStatus;
|
|
540
|
+
createdOn: number;
|
|
541
|
+
updatedOn: number;
|
|
542
|
+
createdBy: number;
|
|
543
|
+
updatedBy: number;
|
|
544
|
+
createdByUser?: UserModel;
|
|
545
|
+
updatedByUser?: UserModel;
|
|
546
|
+
vendor?: VendorModel;
|
|
547
|
+
expenseHead?: ExpenseHeadModel;
|
|
548
|
+
expenses?: ExpenseModel[];
|
|
549
|
+
protected constructor();
|
|
550
|
+
static relations: Partial<Record<EntityList, IModelRelationConfig<EntityList>>>;
|
|
551
|
+
static populateFromEntity(entity: IVendorBillEntity): VendorBillModel;
|
|
552
|
+
get totalAmountPaid(): number | undefined;
|
|
553
|
+
}
|
|
554
|
+
|
|
502
555
|
declare class ExpenseModel extends BaseEntityModel implements IExpenseEntity {
|
|
503
556
|
id: number;
|
|
504
557
|
name: string;
|
|
@@ -510,6 +563,7 @@ declare class ExpenseModel extends BaseEntityModel implements IExpenseEntity {
|
|
|
510
563
|
remarks?: string;
|
|
511
564
|
description?: string;
|
|
512
565
|
paymentType: PaymentType;
|
|
566
|
+
vendorBillId?: number;
|
|
513
567
|
status: EntityStatus;
|
|
514
568
|
createdOn: number;
|
|
515
569
|
updatedOn: number;
|
|
@@ -520,6 +574,7 @@ declare class ExpenseModel extends BaseEntityModel implements IExpenseEntity {
|
|
|
520
574
|
incurredByUser?: UserModel;
|
|
521
575
|
vendor?: VendorModel;
|
|
522
576
|
expenseHead?: ExpenseHeadModel;
|
|
577
|
+
vendorBill?: VendorBillModel;
|
|
523
578
|
protected constructor();
|
|
524
579
|
static relations: Partial<Record<EntityList, IModelRelationConfig<EntityList>>>;
|
|
525
580
|
static populateFromEntity(entity: IExpenseEntity): ExpenseModel;
|
|
@@ -678,6 +733,20 @@ declare class VendorHistoryModel extends BaseEntityModel implements IVendorHisto
|
|
|
678
733
|
static populateFromEntity(entity: IVendorHistoryEntity): VendorHistoryModel;
|
|
679
734
|
}
|
|
680
735
|
|
|
736
|
+
declare class VendorBillHistoryModel extends BaseEntityModel implements IVendorBillHistoryEntity {
|
|
737
|
+
id: number;
|
|
738
|
+
entityId: number;
|
|
739
|
+
data: string;
|
|
740
|
+
operation: EntityHistoryOperation;
|
|
741
|
+
createdOn: number;
|
|
742
|
+
updatedOn: number;
|
|
743
|
+
createdBy: number;
|
|
744
|
+
updatedBy: number;
|
|
745
|
+
protected constructor();
|
|
746
|
+
static relations: Partial<Record<EntityList, IModelRelationConfig<EntityList.VENDOR_BILL_HISTORY>>>;
|
|
747
|
+
static populateFromEntity(entity: IVendorBillHistoryEntity): VendorBillHistoryModel;
|
|
748
|
+
}
|
|
749
|
+
|
|
681
750
|
declare class ConfigurationModel extends BaseEntityModel implements IConfigurationEntity {
|
|
682
751
|
id: number;
|
|
683
752
|
key: string;
|
|
@@ -705,6 +774,8 @@ declare const entityListEntityModelMap: {
|
|
|
705
774
|
expense_head_history: typeof ExpenseHeadHistoryModel.populateFromEntity;
|
|
706
775
|
vendor: typeof VendorModel.populateFromEntity;
|
|
707
776
|
vendor_history: typeof VendorHistoryModel.populateFromEntity;
|
|
777
|
+
vendor_bill: typeof VendorBillModel.populateFromEntity;
|
|
778
|
+
vendor_bill_history: typeof VendorBillHistoryModel.populateFromEntity;
|
|
708
779
|
transaction: typeof TransactionModel.populateFromEntity;
|
|
709
780
|
transaction_history: typeof TransactionHistoryModel.populateFromEntity;
|
|
710
781
|
sponsor: typeof SponsorModel.populateFromEntity;
|
|
@@ -987,6 +1058,8 @@ declare enum EntityList {
|
|
|
987
1058
|
EXPENSE_HEAD_HISTORY = "expense_head_history",
|
|
988
1059
|
VENDOR = "vendor",
|
|
989
1060
|
VENDOR_HISTORY = "vendor_history",
|
|
1061
|
+
VENDOR_BILL = "vendor_bill",
|
|
1062
|
+
VENDOR_BILL_HISTORY = "vendor_bill_history",
|
|
990
1063
|
TRANSACTION = "transaction",
|
|
991
1064
|
TRANSACTION_HISTORY = "transaction_history",
|
|
992
1065
|
SPONSOR = "sponsor",
|
|
@@ -995,8 +1068,8 @@ declare enum EntityList {
|
|
|
995
1068
|
FLAT_HISTORY = "flat_history",
|
|
996
1069
|
CONFIGURATION = "configuration"
|
|
997
1070
|
}
|
|
998
|
-
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.EXPENSE_HEAD ? IExpenseHeadEntity : T extends EntityList.EXPENSE_HEAD_HISTORY ? IExpenseHeadHistoryEntity : 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 : T extends EntityList.FLAT ? IFlatEntity : T extends EntityList.FLAT_HISTORY ? IFlatHistoryEntity : T extends EntityList.CONFIGURATION ? IConfigurationEntity : never;
|
|
999
|
-
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.EXPENSE_HEAD ? ExpenseHeadModel : T extends EntityList.EXPENSE_HEAD_HISTORY ? ExpenseHeadHistoryModel : 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 : T extends EntityList.FLAT ? FlatModel : T extends EntityList.FLAT_HISTORY ? FlatHistoryModel : T extends EntityList.CONFIGURATION ? ConfigurationModel : never;
|
|
1071
|
+
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.EXPENSE_HEAD ? IExpenseHeadEntity : T extends EntityList.EXPENSE_HEAD_HISTORY ? IExpenseHeadHistoryEntity : T extends EntityList.VENDOR ? IVendorEntity : T extends EntityList.VENDOR_HISTORY ? IVendorHistoryEntity : T extends EntityList.VENDOR_BILL ? IVendorBillEntity : T extends EntityList.VENDOR_BILL_HISTORY ? IVendorBillHistoryEntity : T extends EntityList.TRANSACTION ? ITransactionEntity : T extends EntityList.TRANSACTION_HISTORY ? ITransactionHistoryEntity : T extends EntityList.SPONSOR ? ISponsorEntity : T extends EntityList.SPONSOR_HISTORY ? ISponsorHistoryEntity : T extends EntityList.FLAT ? IFlatEntity : T extends EntityList.FLAT_HISTORY ? IFlatHistoryEntity : T extends EntityList.CONFIGURATION ? IConfigurationEntity : never;
|
|
1072
|
+
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.EXPENSE_HEAD ? ExpenseHeadModel : T extends EntityList.EXPENSE_HEAD_HISTORY ? ExpenseHeadHistoryModel : T extends EntityList.VENDOR ? VendorModel : T extends EntityList.VENDOR_HISTORY ? VendorHistoryModel : T extends EntityList.VENDOR_BILL ? VendorBillModel : T extends EntityList.VENDOR_BILL_HISTORY ? VendorBillHistoryModel : T extends EntityList.TRANSACTION ? TransactionModel : T extends EntityList.TRANSACTION_HISTORY ? TransactionHistoryModel : T extends EntityList.SPONSOR ? SponsorModel : T extends EntityList.SPONSOR_HISTORY ? SponsorHistoryModel : T extends EntityList.FLAT ? FlatModel : T extends EntityList.FLAT_HISTORY ? FlatHistoryModel : T extends EntityList.CONFIGURATION ? ConfigurationModel : never;
|
|
1000
1073
|
type EntityListEntityModelMap = {
|
|
1001
1074
|
[T in EntityList]: EntityModelType<T>[];
|
|
1002
1075
|
};
|
|
@@ -1105,6 +1178,13 @@ interface IVendorUpdateDto extends IEntityUpdateDto<EntityType<EntityList.VENDOR
|
|
|
1105
1178
|
interface IVendorSearchDto extends IEntityFilterData<EntityType<EntityList.VENDOR>> {
|
|
1106
1179
|
}
|
|
1107
1180
|
|
|
1181
|
+
interface IVendorBillCreateDto extends Omit<IEntityCreateDto<EntityType<EntityList.VENDOR_BILL>>, 'invoiceNumber'> {
|
|
1182
|
+
}
|
|
1183
|
+
interface IVendorBillUpdateDto extends IEntityUpdateDto<EntityType<EntityList.VENDOR_BILL>> {
|
|
1184
|
+
}
|
|
1185
|
+
interface IVendorBillSearchDto extends IEntityFilterData<EntityType<EntityList.VENDOR_BILL>> {
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1108
1188
|
interface ITransactionCreateDto extends IEntityCreateDto<EntityType<EntityList.TRANSACTION>> {
|
|
1109
1189
|
}
|
|
1110
1190
|
interface ITransactionUpdateDto extends IEntityUpdateDto<EntityType<EntityList.TRANSACTION>> {
|
|
@@ -1147,4 +1227,4 @@ declare function isSpecialFlatLabel(label: string): boolean;
|
|
|
1147
1227
|
declare function getFlatValidationErrors(input: Partial<IFlatEntity>): FlatValidationError[];
|
|
1148
1228
|
declare function validateFlatOrThrow(input: Partial<IFlatEntity>): void;
|
|
1149
1229
|
|
|
1150
|
-
export { ALL_WINGS_SELECTION, BadRequestException, BaseEntityModel, ConfigurationKey, ConfigurationModel, ConfigurationType, DateCodeUtils, DateUtil, DonationHistoryModel, DonationModel, EntityFilterDataHelper, EntityHistoryOperation, EntityList, type EntityListEntityModelMap, type EntityModelType, EntityStatus, type EntityType, ExpenseHeadHistoryModel, ExpenseHeadModel, ExpenseHistoryModel, ExpenseModel, FLATS_BY_WING, FLAT_DONATION_RELATION_CONFIG, FLAT_NUMBERS, FLAT_UNIT_NUMBER_PATTERN, FLAT_WING_PATTERN, type FlatCollectionEntry, type FlatCollectionStatus, type FlatDonationLike, FlatHistoryModel, type FlatIdDonationLike, FlatModel, type FlatOption, type FlatParseResult, type FlatValidationError, 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 IExpenseHeadCreateDto, type IExpenseHeadEntity, type IExpenseHeadHistoryEntity, type IExpenseHeadSearchDto, type IExpenseHeadUpdateDto, type IExpenseHistoryEntity, type IExpenseSearchDto, type IExpenseUpdateDto, type IFlatCreateDto, type IFlatEntity, type IFlatHistoryEntity, type IFlatSearchDto, type IFlatUpdateDto, 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, SHOP_UNIT_NUMBER_PATTERN, SHOP_WING, SPECIAL_FLATS, SPECIAL_FLAT_LABELS, SponsorHistoryModel, SponsorModel, SponsorTier, TransactionEntityType, TransactionHistoryModel, TransactionModel, TransactionType, USER_RELATION_CONFIG, UnauthorizedException, type UserExpenseReport, type UserExpenseReportTotals, type UserExpenseRow, UserHistoryModel, UserModel, VendorHistoryModel, VendorModel, VendorType, WINGS, WING_ALPHABETS, type WingCollectionDonationByIdLike, type WingCollectionDonationLike, type WingCollectionReport, type WingCollectionRow, type WingCollectionTotals, type XlsxCellAddress, type XlsxMergeRange, type XlsxSerializationType, type XlsxSheetInput, type XlsxSheetOptions, buildUserExpenseReport, buildUserExpenseWorkbook, buildWingWiseCollectionReport, buildWingWiseCollectionReportByFlatId, buildWingWiseCollectionWorkbook, buildXlsxWorkbook, convertNumberToWords, definedValues, diffArrays, entityListEntityModelMap, epochToReadableDate, getFlatValidationErrors, getObjectDiffingKeys, getWingSelectionLabel, getWingSelectionSlug, groupBy, isSpecialFlatLabel, isValidFlatWing, roundToTwoDecimals, serializeXlsx, validateFlatOrThrow };
|
|
1230
|
+
export { ALL_WINGS_SELECTION, BadRequestException, BaseEntityModel, ConfigurationKey, ConfigurationModel, ConfigurationType, DateCodeUtils, DateUtil, DonationHistoryModel, DonationModel, EntityFilterDataHelper, EntityHistoryOperation, EntityList, type EntityListEntityModelMap, type EntityModelType, EntityStatus, type EntityType, ExpenseHeadHistoryModel, ExpenseHeadModel, ExpenseHistoryModel, ExpenseModel, FLATS_BY_WING, FLAT_DONATION_RELATION_CONFIG, FLAT_NUMBERS, FLAT_UNIT_NUMBER_PATTERN, FLAT_WING_PATTERN, type FlatCollectionEntry, type FlatCollectionStatus, type FlatDonationLike, FlatHistoryModel, type FlatIdDonationLike, FlatModel, type FlatOption, type FlatParseResult, type FlatValidationError, 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 IExpenseHeadCreateDto, type IExpenseHeadEntity, type IExpenseHeadHistoryEntity, type IExpenseHeadSearchDto, type IExpenseHeadUpdateDto, type IExpenseHistoryEntity, type IExpenseSearchDto, type IExpenseUpdateDto, type IFlatCreateDto, type IFlatEntity, type IFlatHistoryEntity, type IFlatSearchDto, type IFlatUpdateDto, 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 IVendorBillCreateDto, type IVendorBillEntity, type IVendorBillHistoryEntity, type IVendorBillSearchDto, type IVendorBillUpdateDto, type IVendorCreateDto, type IVendorEntity, type IVendorHistoryEntity, type IVendorSearchDto, type IVendorUpdateDto, NotFoundException, type Nullable, OrderByDirection, PAYMENT_OPTIONS, PaymentType, ReferenceIdPrefix, RelationType, SHOP_UNIT_NUMBER_PATTERN, SHOP_WING, SPECIAL_FLATS, SPECIAL_FLAT_LABELS, SponsorHistoryModel, SponsorModel, SponsorTier, TransactionEntityType, TransactionHistoryModel, TransactionModel, TransactionType, USER_RELATION_CONFIG, UnauthorizedException, type UserExpenseReport, type UserExpenseReportTotals, type UserExpenseRow, UserHistoryModel, UserModel, VendorBillHistoryModel, VendorBillModel, VendorBillStatus, VendorHistoryModel, VendorModel, VendorType, WINGS, WING_ALPHABETS, type WingCollectionDonationByIdLike, type WingCollectionDonationLike, type WingCollectionReport, type WingCollectionRow, type WingCollectionTotals, type XlsxCellAddress, type XlsxMergeRange, type XlsxSerializationType, type XlsxSheetInput, type XlsxSheetOptions, buildUserExpenseReport, buildUserExpenseWorkbook, buildWingWiseCollectionReport, buildWingWiseCollectionReportByFlatId, buildWingWiseCollectionWorkbook, buildXlsxWorkbook, convertNumberToWords, definedValues, diffArrays, entityListEntityModelMap, epochToReadableDate, getFlatValidationErrors, getObjectDiffingKeys, getWingSelectionLabel, getWingSelectionSlug, groupBy, isSpecialFlatLabel, isValidFlatWing, roundToTwoDecimals, serializeXlsx, validateFlatOrThrow };
|
package/dist/index.d.ts
CHANGED
|
@@ -77,6 +77,14 @@ declare enum TransactionType {
|
|
|
77
77
|
EXPENSE = "Expense"
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
+
declare enum VendorBillStatus {
|
|
81
|
+
OPEN = "OPEN",
|
|
82
|
+
PARTIALLY_PAID = "PARTIALLY_PAID",
|
|
83
|
+
PAID = "PAID",
|
|
84
|
+
CLOSED = "CLOSED",
|
|
85
|
+
CANCELLED = "CANCELLED"
|
|
86
|
+
}
|
|
87
|
+
|
|
80
88
|
declare enum VendorType {
|
|
81
89
|
SUPPLIER = "Supplier",
|
|
82
90
|
SERVICE_PROVIDER = "Service Provider",
|
|
@@ -146,6 +154,7 @@ interface IExpenseEntity extends IAuditColumnEntity {
|
|
|
146
154
|
incurredBy: number;
|
|
147
155
|
vendorId: number;
|
|
148
156
|
expenseHeadId: number;
|
|
157
|
+
vendorBillId?: number;
|
|
149
158
|
billNumber?: string;
|
|
150
159
|
remarks?: string;
|
|
151
160
|
description?: string;
|
|
@@ -276,6 +285,23 @@ interface IVendorEntity extends IAuditColumnEntity {
|
|
|
276
285
|
type: string;
|
|
277
286
|
}
|
|
278
287
|
|
|
288
|
+
interface IVendorBillHistoryEntity extends IBaseHistoryEntity {
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
interface IVendorBillEntity extends IAuditColumnEntity {
|
|
292
|
+
id: number;
|
|
293
|
+
vendorId: number;
|
|
294
|
+
expenseHeadId: number;
|
|
295
|
+
description: string;
|
|
296
|
+
invoiceNumber?: string;
|
|
297
|
+
totalAmount: number;
|
|
298
|
+
balancePayable: number;
|
|
299
|
+
discountAmount?: number;
|
|
300
|
+
discountRemarks?: string;
|
|
301
|
+
billStatus: VendorBillStatus;
|
|
302
|
+
status?: EntityStatus;
|
|
303
|
+
}
|
|
304
|
+
|
|
279
305
|
declare class DonationHistoryModel extends BaseEntityModel implements IDonationHistoryEntity {
|
|
280
306
|
id: number;
|
|
281
307
|
entityId: number;
|
|
@@ -499,6 +525,33 @@ declare class VendorModel extends BaseEntityModel implements IVendorEntity {
|
|
|
499
525
|
static populateFromEntity(entity: IVendorEntity): VendorModel;
|
|
500
526
|
}
|
|
501
527
|
|
|
528
|
+
declare class VendorBillModel extends BaseEntityModel implements IVendorBillEntity {
|
|
529
|
+
id: number;
|
|
530
|
+
vendorId: number;
|
|
531
|
+
expenseHeadId: number;
|
|
532
|
+
description: string;
|
|
533
|
+
invoiceNumber?: string;
|
|
534
|
+
totalAmount: number;
|
|
535
|
+
balancePayable: number;
|
|
536
|
+
discountAmount?: number;
|
|
537
|
+
discountRemarks?: string;
|
|
538
|
+
billStatus: VendorBillStatus;
|
|
539
|
+
status: EntityStatus;
|
|
540
|
+
createdOn: number;
|
|
541
|
+
updatedOn: number;
|
|
542
|
+
createdBy: number;
|
|
543
|
+
updatedBy: number;
|
|
544
|
+
createdByUser?: UserModel;
|
|
545
|
+
updatedByUser?: UserModel;
|
|
546
|
+
vendor?: VendorModel;
|
|
547
|
+
expenseHead?: ExpenseHeadModel;
|
|
548
|
+
expenses?: ExpenseModel[];
|
|
549
|
+
protected constructor();
|
|
550
|
+
static relations: Partial<Record<EntityList, IModelRelationConfig<EntityList>>>;
|
|
551
|
+
static populateFromEntity(entity: IVendorBillEntity): VendorBillModel;
|
|
552
|
+
get totalAmountPaid(): number | undefined;
|
|
553
|
+
}
|
|
554
|
+
|
|
502
555
|
declare class ExpenseModel extends BaseEntityModel implements IExpenseEntity {
|
|
503
556
|
id: number;
|
|
504
557
|
name: string;
|
|
@@ -510,6 +563,7 @@ declare class ExpenseModel extends BaseEntityModel implements IExpenseEntity {
|
|
|
510
563
|
remarks?: string;
|
|
511
564
|
description?: string;
|
|
512
565
|
paymentType: PaymentType;
|
|
566
|
+
vendorBillId?: number;
|
|
513
567
|
status: EntityStatus;
|
|
514
568
|
createdOn: number;
|
|
515
569
|
updatedOn: number;
|
|
@@ -520,6 +574,7 @@ declare class ExpenseModel extends BaseEntityModel implements IExpenseEntity {
|
|
|
520
574
|
incurredByUser?: UserModel;
|
|
521
575
|
vendor?: VendorModel;
|
|
522
576
|
expenseHead?: ExpenseHeadModel;
|
|
577
|
+
vendorBill?: VendorBillModel;
|
|
523
578
|
protected constructor();
|
|
524
579
|
static relations: Partial<Record<EntityList, IModelRelationConfig<EntityList>>>;
|
|
525
580
|
static populateFromEntity(entity: IExpenseEntity): ExpenseModel;
|
|
@@ -678,6 +733,20 @@ declare class VendorHistoryModel extends BaseEntityModel implements IVendorHisto
|
|
|
678
733
|
static populateFromEntity(entity: IVendorHistoryEntity): VendorHistoryModel;
|
|
679
734
|
}
|
|
680
735
|
|
|
736
|
+
declare class VendorBillHistoryModel extends BaseEntityModel implements IVendorBillHistoryEntity {
|
|
737
|
+
id: number;
|
|
738
|
+
entityId: number;
|
|
739
|
+
data: string;
|
|
740
|
+
operation: EntityHistoryOperation;
|
|
741
|
+
createdOn: number;
|
|
742
|
+
updatedOn: number;
|
|
743
|
+
createdBy: number;
|
|
744
|
+
updatedBy: number;
|
|
745
|
+
protected constructor();
|
|
746
|
+
static relations: Partial<Record<EntityList, IModelRelationConfig<EntityList.VENDOR_BILL_HISTORY>>>;
|
|
747
|
+
static populateFromEntity(entity: IVendorBillHistoryEntity): VendorBillHistoryModel;
|
|
748
|
+
}
|
|
749
|
+
|
|
681
750
|
declare class ConfigurationModel extends BaseEntityModel implements IConfigurationEntity {
|
|
682
751
|
id: number;
|
|
683
752
|
key: string;
|
|
@@ -705,6 +774,8 @@ declare const entityListEntityModelMap: {
|
|
|
705
774
|
expense_head_history: typeof ExpenseHeadHistoryModel.populateFromEntity;
|
|
706
775
|
vendor: typeof VendorModel.populateFromEntity;
|
|
707
776
|
vendor_history: typeof VendorHistoryModel.populateFromEntity;
|
|
777
|
+
vendor_bill: typeof VendorBillModel.populateFromEntity;
|
|
778
|
+
vendor_bill_history: typeof VendorBillHistoryModel.populateFromEntity;
|
|
708
779
|
transaction: typeof TransactionModel.populateFromEntity;
|
|
709
780
|
transaction_history: typeof TransactionHistoryModel.populateFromEntity;
|
|
710
781
|
sponsor: typeof SponsorModel.populateFromEntity;
|
|
@@ -987,6 +1058,8 @@ declare enum EntityList {
|
|
|
987
1058
|
EXPENSE_HEAD_HISTORY = "expense_head_history",
|
|
988
1059
|
VENDOR = "vendor",
|
|
989
1060
|
VENDOR_HISTORY = "vendor_history",
|
|
1061
|
+
VENDOR_BILL = "vendor_bill",
|
|
1062
|
+
VENDOR_BILL_HISTORY = "vendor_bill_history",
|
|
990
1063
|
TRANSACTION = "transaction",
|
|
991
1064
|
TRANSACTION_HISTORY = "transaction_history",
|
|
992
1065
|
SPONSOR = "sponsor",
|
|
@@ -995,8 +1068,8 @@ declare enum EntityList {
|
|
|
995
1068
|
FLAT_HISTORY = "flat_history",
|
|
996
1069
|
CONFIGURATION = "configuration"
|
|
997
1070
|
}
|
|
998
|
-
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.EXPENSE_HEAD ? IExpenseHeadEntity : T extends EntityList.EXPENSE_HEAD_HISTORY ? IExpenseHeadHistoryEntity : 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 : T extends EntityList.FLAT ? IFlatEntity : T extends EntityList.FLAT_HISTORY ? IFlatHistoryEntity : T extends EntityList.CONFIGURATION ? IConfigurationEntity : never;
|
|
999
|
-
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.EXPENSE_HEAD ? ExpenseHeadModel : T extends EntityList.EXPENSE_HEAD_HISTORY ? ExpenseHeadHistoryModel : 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 : T extends EntityList.FLAT ? FlatModel : T extends EntityList.FLAT_HISTORY ? FlatHistoryModel : T extends EntityList.CONFIGURATION ? ConfigurationModel : never;
|
|
1071
|
+
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.EXPENSE_HEAD ? IExpenseHeadEntity : T extends EntityList.EXPENSE_HEAD_HISTORY ? IExpenseHeadHistoryEntity : T extends EntityList.VENDOR ? IVendorEntity : T extends EntityList.VENDOR_HISTORY ? IVendorHistoryEntity : T extends EntityList.VENDOR_BILL ? IVendorBillEntity : T extends EntityList.VENDOR_BILL_HISTORY ? IVendorBillHistoryEntity : T extends EntityList.TRANSACTION ? ITransactionEntity : T extends EntityList.TRANSACTION_HISTORY ? ITransactionHistoryEntity : T extends EntityList.SPONSOR ? ISponsorEntity : T extends EntityList.SPONSOR_HISTORY ? ISponsorHistoryEntity : T extends EntityList.FLAT ? IFlatEntity : T extends EntityList.FLAT_HISTORY ? IFlatHistoryEntity : T extends EntityList.CONFIGURATION ? IConfigurationEntity : never;
|
|
1072
|
+
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.EXPENSE_HEAD ? ExpenseHeadModel : T extends EntityList.EXPENSE_HEAD_HISTORY ? ExpenseHeadHistoryModel : T extends EntityList.VENDOR ? VendorModel : T extends EntityList.VENDOR_HISTORY ? VendorHistoryModel : T extends EntityList.VENDOR_BILL ? VendorBillModel : T extends EntityList.VENDOR_BILL_HISTORY ? VendorBillHistoryModel : T extends EntityList.TRANSACTION ? TransactionModel : T extends EntityList.TRANSACTION_HISTORY ? TransactionHistoryModel : T extends EntityList.SPONSOR ? SponsorModel : T extends EntityList.SPONSOR_HISTORY ? SponsorHistoryModel : T extends EntityList.FLAT ? FlatModel : T extends EntityList.FLAT_HISTORY ? FlatHistoryModel : T extends EntityList.CONFIGURATION ? ConfigurationModel : never;
|
|
1000
1073
|
type EntityListEntityModelMap = {
|
|
1001
1074
|
[T in EntityList]: EntityModelType<T>[];
|
|
1002
1075
|
};
|
|
@@ -1105,6 +1178,13 @@ interface IVendorUpdateDto extends IEntityUpdateDto<EntityType<EntityList.VENDOR
|
|
|
1105
1178
|
interface IVendorSearchDto extends IEntityFilterData<EntityType<EntityList.VENDOR>> {
|
|
1106
1179
|
}
|
|
1107
1180
|
|
|
1181
|
+
interface IVendorBillCreateDto extends Omit<IEntityCreateDto<EntityType<EntityList.VENDOR_BILL>>, 'invoiceNumber'> {
|
|
1182
|
+
}
|
|
1183
|
+
interface IVendorBillUpdateDto extends IEntityUpdateDto<EntityType<EntityList.VENDOR_BILL>> {
|
|
1184
|
+
}
|
|
1185
|
+
interface IVendorBillSearchDto extends IEntityFilterData<EntityType<EntityList.VENDOR_BILL>> {
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1108
1188
|
interface ITransactionCreateDto extends IEntityCreateDto<EntityType<EntityList.TRANSACTION>> {
|
|
1109
1189
|
}
|
|
1110
1190
|
interface ITransactionUpdateDto extends IEntityUpdateDto<EntityType<EntityList.TRANSACTION>> {
|
|
@@ -1147,4 +1227,4 @@ declare function isSpecialFlatLabel(label: string): boolean;
|
|
|
1147
1227
|
declare function getFlatValidationErrors(input: Partial<IFlatEntity>): FlatValidationError[];
|
|
1148
1228
|
declare function validateFlatOrThrow(input: Partial<IFlatEntity>): void;
|
|
1149
1229
|
|
|
1150
|
-
export { ALL_WINGS_SELECTION, BadRequestException, BaseEntityModel, ConfigurationKey, ConfigurationModel, ConfigurationType, DateCodeUtils, DateUtil, DonationHistoryModel, DonationModel, EntityFilterDataHelper, EntityHistoryOperation, EntityList, type EntityListEntityModelMap, type EntityModelType, EntityStatus, type EntityType, ExpenseHeadHistoryModel, ExpenseHeadModel, ExpenseHistoryModel, ExpenseModel, FLATS_BY_WING, FLAT_DONATION_RELATION_CONFIG, FLAT_NUMBERS, FLAT_UNIT_NUMBER_PATTERN, FLAT_WING_PATTERN, type FlatCollectionEntry, type FlatCollectionStatus, type FlatDonationLike, FlatHistoryModel, type FlatIdDonationLike, FlatModel, type FlatOption, type FlatParseResult, type FlatValidationError, 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 IExpenseHeadCreateDto, type IExpenseHeadEntity, type IExpenseHeadHistoryEntity, type IExpenseHeadSearchDto, type IExpenseHeadUpdateDto, type IExpenseHistoryEntity, type IExpenseSearchDto, type IExpenseUpdateDto, type IFlatCreateDto, type IFlatEntity, type IFlatHistoryEntity, type IFlatSearchDto, type IFlatUpdateDto, 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, SHOP_UNIT_NUMBER_PATTERN, SHOP_WING, SPECIAL_FLATS, SPECIAL_FLAT_LABELS, SponsorHistoryModel, SponsorModel, SponsorTier, TransactionEntityType, TransactionHistoryModel, TransactionModel, TransactionType, USER_RELATION_CONFIG, UnauthorizedException, type UserExpenseReport, type UserExpenseReportTotals, type UserExpenseRow, UserHistoryModel, UserModel, VendorHistoryModel, VendorModel, VendorType, WINGS, WING_ALPHABETS, type WingCollectionDonationByIdLike, type WingCollectionDonationLike, type WingCollectionReport, type WingCollectionRow, type WingCollectionTotals, type XlsxCellAddress, type XlsxMergeRange, type XlsxSerializationType, type XlsxSheetInput, type XlsxSheetOptions, buildUserExpenseReport, buildUserExpenseWorkbook, buildWingWiseCollectionReport, buildWingWiseCollectionReportByFlatId, buildWingWiseCollectionWorkbook, buildXlsxWorkbook, convertNumberToWords, definedValues, diffArrays, entityListEntityModelMap, epochToReadableDate, getFlatValidationErrors, getObjectDiffingKeys, getWingSelectionLabel, getWingSelectionSlug, groupBy, isSpecialFlatLabel, isValidFlatWing, roundToTwoDecimals, serializeXlsx, validateFlatOrThrow };
|
|
1230
|
+
export { ALL_WINGS_SELECTION, BadRequestException, BaseEntityModel, ConfigurationKey, ConfigurationModel, ConfigurationType, DateCodeUtils, DateUtil, DonationHistoryModel, DonationModel, EntityFilterDataHelper, EntityHistoryOperation, EntityList, type EntityListEntityModelMap, type EntityModelType, EntityStatus, type EntityType, ExpenseHeadHistoryModel, ExpenseHeadModel, ExpenseHistoryModel, ExpenseModel, FLATS_BY_WING, FLAT_DONATION_RELATION_CONFIG, FLAT_NUMBERS, FLAT_UNIT_NUMBER_PATTERN, FLAT_WING_PATTERN, type FlatCollectionEntry, type FlatCollectionStatus, type FlatDonationLike, FlatHistoryModel, type FlatIdDonationLike, FlatModel, type FlatOption, type FlatParseResult, type FlatValidationError, 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 IExpenseHeadCreateDto, type IExpenseHeadEntity, type IExpenseHeadHistoryEntity, type IExpenseHeadSearchDto, type IExpenseHeadUpdateDto, type IExpenseHistoryEntity, type IExpenseSearchDto, type IExpenseUpdateDto, type IFlatCreateDto, type IFlatEntity, type IFlatHistoryEntity, type IFlatSearchDto, type IFlatUpdateDto, 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 IVendorBillCreateDto, type IVendorBillEntity, type IVendorBillHistoryEntity, type IVendorBillSearchDto, type IVendorBillUpdateDto, type IVendorCreateDto, type IVendorEntity, type IVendorHistoryEntity, type IVendorSearchDto, type IVendorUpdateDto, NotFoundException, type Nullable, OrderByDirection, PAYMENT_OPTIONS, PaymentType, ReferenceIdPrefix, RelationType, SHOP_UNIT_NUMBER_PATTERN, SHOP_WING, SPECIAL_FLATS, SPECIAL_FLAT_LABELS, SponsorHistoryModel, SponsorModel, SponsorTier, TransactionEntityType, TransactionHistoryModel, TransactionModel, TransactionType, USER_RELATION_CONFIG, UnauthorizedException, type UserExpenseReport, type UserExpenseReportTotals, type UserExpenseRow, UserHistoryModel, UserModel, VendorBillHistoryModel, VendorBillModel, VendorBillStatus, VendorHistoryModel, VendorModel, VendorType, WINGS, WING_ALPHABETS, type WingCollectionDonationByIdLike, type WingCollectionDonationLike, type WingCollectionReport, type WingCollectionRow, type WingCollectionTotals, type XlsxCellAddress, type XlsxMergeRange, type XlsxSerializationType, type XlsxSheetInput, type XlsxSheetOptions, buildUserExpenseReport, buildUserExpenseWorkbook, buildWingWiseCollectionReport, buildWingWiseCollectionReportByFlatId, buildWingWiseCollectionWorkbook, buildXlsxWorkbook, convertNumberToWords, definedValues, diffArrays, entityListEntityModelMap, epochToReadableDate, getFlatValidationErrors, getObjectDiffingKeys, getWingSelectionLabel, getWingSelectionSlug, groupBy, isSpecialFlatLabel, isValidFlatWing, roundToTwoDecimals, serializeXlsx, validateFlatOrThrow };
|
package/dist/index.js
CHANGED
|
@@ -78,6 +78,9 @@ __export(index_exports, {
|
|
|
78
78
|
UnauthorizedException: () => UnauthorizedException,
|
|
79
79
|
UserHistoryModel: () => UserHistoryModel,
|
|
80
80
|
UserModel: () => UserModel,
|
|
81
|
+
VendorBillHistoryModel: () => VendorBillHistoryModel,
|
|
82
|
+
VendorBillModel: () => VendorBillModel,
|
|
83
|
+
VendorBillStatus: () => VendorBillStatus,
|
|
81
84
|
VendorHistoryModel: () => VendorHistoryModel,
|
|
82
85
|
VendorModel: () => VendorModel,
|
|
83
86
|
VendorType: () => VendorType,
|
|
@@ -520,6 +523,16 @@ var TransactionType = /* @__PURE__ */ ((TransactionType2) => {
|
|
|
520
523
|
return TransactionType2;
|
|
521
524
|
})(TransactionType || {});
|
|
522
525
|
|
|
526
|
+
// src/enums/vendor-bill-status.enum.ts
|
|
527
|
+
var VendorBillStatus = /* @__PURE__ */ ((VendorBillStatus2) => {
|
|
528
|
+
VendorBillStatus2["OPEN"] = "OPEN";
|
|
529
|
+
VendorBillStatus2["PARTIALLY_PAID"] = "PARTIALLY_PAID";
|
|
530
|
+
VendorBillStatus2["PAID"] = "PAID";
|
|
531
|
+
VendorBillStatus2["CLOSED"] = "CLOSED";
|
|
532
|
+
VendorBillStatus2["CANCELLED"] = "CANCELLED";
|
|
533
|
+
return VendorBillStatus2;
|
|
534
|
+
})(VendorBillStatus || {});
|
|
535
|
+
|
|
523
536
|
// src/enums/vendor-type.enum.ts
|
|
524
537
|
var VendorType = /* @__PURE__ */ ((VendorType2) => {
|
|
525
538
|
VendorType2["SUPPLIER"] = "Supplier";
|
|
@@ -1286,6 +1299,14 @@ _ExpenseModel.relations = {
|
|
|
1286
1299
|
],
|
|
1287
1300
|
searchProperty: "id",
|
|
1288
1301
|
entity: "expense_head" /* EXPENSE_HEAD */
|
|
1302
|
+
},
|
|
1303
|
+
["vendor_bill" /* VENDOR_BILL */]: {
|
|
1304
|
+
relationType: "ONE" /* ONE */,
|
|
1305
|
+
mappingProperties: [
|
|
1306
|
+
{ sourceProperty: "vendorBillId", targetProperty: "vendorBill" }
|
|
1307
|
+
],
|
|
1308
|
+
searchProperty: "id",
|
|
1309
|
+
entity: "vendor_bill" /* VENDOR_BILL */
|
|
1289
1310
|
}
|
|
1290
1311
|
};
|
|
1291
1312
|
var ExpenseModel = _ExpenseModel;
|
|
@@ -1552,6 +1573,86 @@ _VendorModel.relations = {
|
|
|
1552
1573
|
};
|
|
1553
1574
|
var VendorModel = _VendorModel;
|
|
1554
1575
|
|
|
1576
|
+
// src/models/vendor-bill-history.entity.model.ts
|
|
1577
|
+
var _VendorBillHistoryModel = class _VendorBillHistoryModel extends BaseEntityModel {
|
|
1578
|
+
constructor() {
|
|
1579
|
+
super();
|
|
1580
|
+
this.id = 0;
|
|
1581
|
+
this.entityId = 0;
|
|
1582
|
+
this.data = "";
|
|
1583
|
+
this.operation = "CREATE" /* CREATE */;
|
|
1584
|
+
this.createdOn = 0;
|
|
1585
|
+
this.updatedOn = 0;
|
|
1586
|
+
this.createdBy = 0;
|
|
1587
|
+
this.updatedBy = 0;
|
|
1588
|
+
}
|
|
1589
|
+
static populateFromEntity(entity) {
|
|
1590
|
+
return Object.assign(new _VendorBillHistoryModel(), entity);
|
|
1591
|
+
}
|
|
1592
|
+
};
|
|
1593
|
+
_VendorBillHistoryModel.relations = {};
|
|
1594
|
+
var VendorBillHistoryModel = _VendorBillHistoryModel;
|
|
1595
|
+
|
|
1596
|
+
// src/models/vendor-bill.entity.model.ts
|
|
1597
|
+
var _VendorBillModel = class _VendorBillModel extends BaseEntityModel {
|
|
1598
|
+
constructor() {
|
|
1599
|
+
super();
|
|
1600
|
+
this.id = 0;
|
|
1601
|
+
this.vendorId = 0;
|
|
1602
|
+
this.expenseHeadId = 0;
|
|
1603
|
+
this.description = "";
|
|
1604
|
+
this.totalAmount = 0;
|
|
1605
|
+
this.balancePayable = 0;
|
|
1606
|
+
this.discountAmount = 0;
|
|
1607
|
+
this.billStatus = "OPEN" /* OPEN */;
|
|
1608
|
+
this.status = "Active" /* ACTIVE */;
|
|
1609
|
+
this.createdOn = 0;
|
|
1610
|
+
this.updatedOn = 0;
|
|
1611
|
+
this.createdBy = 0;
|
|
1612
|
+
this.updatedBy = 0;
|
|
1613
|
+
}
|
|
1614
|
+
static populateFromEntity(entity) {
|
|
1615
|
+
return Object.assign(new _VendorBillModel(), entity);
|
|
1616
|
+
}
|
|
1617
|
+
get totalAmountPaid() {
|
|
1618
|
+
return this.expenses?.reduce((total, expense) => total + expense.amount, 0);
|
|
1619
|
+
}
|
|
1620
|
+
};
|
|
1621
|
+
_VendorBillModel.relations = {
|
|
1622
|
+
["user" /* USER */]: {
|
|
1623
|
+
relationType: "ONE" /* ONE */,
|
|
1624
|
+
mappingProperties: [
|
|
1625
|
+
{ sourceProperty: "createdBy", targetProperty: "createdByUser" },
|
|
1626
|
+
{ sourceProperty: "updatedBy", targetProperty: "updatedByUser" }
|
|
1627
|
+
],
|
|
1628
|
+
searchProperty: "id",
|
|
1629
|
+
entity: "user" /* USER */
|
|
1630
|
+
},
|
|
1631
|
+
["vendor" /* VENDOR */]: {
|
|
1632
|
+
relationType: "ONE" /* ONE */,
|
|
1633
|
+
mappingProperties: [
|
|
1634
|
+
{ sourceProperty: "vendorId", targetProperty: "vendor" }
|
|
1635
|
+
],
|
|
1636
|
+
searchProperty: "id",
|
|
1637
|
+
entity: "vendor" /* VENDOR */
|
|
1638
|
+
},
|
|
1639
|
+
["expense_head" /* EXPENSE_HEAD */]: {
|
|
1640
|
+
relationType: "ONE" /* ONE */,
|
|
1641
|
+
mappingProperties: [
|
|
1642
|
+
{ sourceProperty: "expenseHeadId", targetProperty: "expenseHead" }
|
|
1643
|
+
],
|
|
1644
|
+
searchProperty: "id",
|
|
1645
|
+
entity: "expense_head" /* EXPENSE_HEAD */
|
|
1646
|
+
},
|
|
1647
|
+
["expense" /* EXPENSE */]: {
|
|
1648
|
+
relationType: "MANY" /* MANY */,
|
|
1649
|
+
mappingProperties: [{ sourceProperty: "id", targetProperty: "expenses" }],
|
|
1650
|
+
searchProperty: "vendorBillId",
|
|
1651
|
+
entity: "expense" /* EXPENSE */
|
|
1652
|
+
}
|
|
1653
|
+
};
|
|
1654
|
+
var VendorBillModel = _VendorBillModel;
|
|
1655
|
+
|
|
1555
1656
|
// src/models/configuration.entity.model.ts
|
|
1556
1657
|
var ConfigurationModel = class _ConfigurationModel extends BaseEntityModel {
|
|
1557
1658
|
constructor() {
|
|
@@ -1589,6 +1690,8 @@ var EntityList = /* @__PURE__ */ ((EntityList2) => {
|
|
|
1589
1690
|
EntityList2["EXPENSE_HEAD_HISTORY"] = "expense_head_history";
|
|
1590
1691
|
EntityList2["VENDOR"] = "vendor";
|
|
1591
1692
|
EntityList2["VENDOR_HISTORY"] = "vendor_history";
|
|
1693
|
+
EntityList2["VENDOR_BILL"] = "vendor_bill";
|
|
1694
|
+
EntityList2["VENDOR_BILL_HISTORY"] = "vendor_bill_history";
|
|
1592
1695
|
EntityList2["TRANSACTION"] = "transaction";
|
|
1593
1696
|
EntityList2["TRANSACTION_HISTORY"] = "transaction_history";
|
|
1594
1697
|
EntityList2["SPONSOR"] = "sponsor";
|
|
@@ -1611,6 +1714,8 @@ var entityListEntityModelMap = {
|
|
|
1611
1714
|
["expense_head_history" /* EXPENSE_HEAD_HISTORY */]: ExpenseHeadHistoryModel.populateFromEntity,
|
|
1612
1715
|
["vendor" /* VENDOR */]: VendorModel.populateFromEntity,
|
|
1613
1716
|
["vendor_history" /* VENDOR_HISTORY */]: VendorHistoryModel.populateFromEntity,
|
|
1717
|
+
["vendor_bill" /* VENDOR_BILL */]: VendorBillModel.populateFromEntity,
|
|
1718
|
+
["vendor_bill_history" /* VENDOR_BILL_HISTORY */]: VendorBillHistoryModel.populateFromEntity,
|
|
1614
1719
|
["transaction" /* TRANSACTION */]: TransactionModel.populateFromEntity,
|
|
1615
1720
|
["transaction_history" /* TRANSACTION_HISTORY */]: TransactionHistoryModel.populateFromEntity,
|
|
1616
1721
|
["sponsor" /* SPONSOR */]: SponsorModel.populateFromEntity,
|
|
@@ -2361,6 +2466,9 @@ function validateFlatOrThrow(input) {
|
|
|
2361
2466
|
UnauthorizedException,
|
|
2362
2467
|
UserHistoryModel,
|
|
2363
2468
|
UserModel,
|
|
2469
|
+
VendorBillHistoryModel,
|
|
2470
|
+
VendorBillModel,
|
|
2471
|
+
VendorBillStatus,
|
|
2364
2472
|
VendorHistoryModel,
|
|
2365
2473
|
VendorModel,
|
|
2366
2474
|
VendorType,
|