law-common 10.27.0 → 10.28.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/src/api/interface/billing.transaction.create.dto.interface.d.ts +7 -2
- package/dist/src/api/interface/billing.transaction.entity.response.d.ts +24 -1
- package/dist/src/api/interface/billing.transaction.update.dto.interface.d.ts +13 -2
- package/dist/src/constants/entity_constants.d.ts +1 -0
- package/dist/src/constants/entity_constants.js +2 -1
- package/dist/src/entities/enums/billing-transaction-action.enum.d.ts +5 -0
- package/dist/src/entities/enums/billing-transaction-action.enum.js +15 -0
- package/dist/src/entities/enums/billing-transaction-status.enum.d.ts +6 -0
- package/dist/src/entities/enums/billing-transaction-status.enum.js +10 -0
- package/dist/src/entities/index.d.ts +5 -1
- package/dist/src/entities/index.js +5 -2
- package/dist/src/entities/interface/billing-transaction-history.entity.d.ts +7 -0
- package/dist/src/entities/interface/billing-transaction-history.entity.js +2 -0
- package/dist/src/entities/interface/billing.entity.interface.d.ts +1 -0
- package/dist/src/entities/interface/billing_transaction.entity.interface.d.ts +7 -0
- package/dist/src/entities/interface/entity.utils.interface.d.ts +14 -5
- package/dist/src/entities/interface/entity.utils.interface.js +1 -0
- package/dist/src/entities/model/base.entity.model.d.ts +8 -2
- package/dist/src/entities/model/base.entity.model.js +53 -34
- package/dist/src/entities/model/billing-reimbursement-expense.entity.model.d.ts +1 -1
- package/dist/src/entities/model/billing-reimbursement-expense.entity.model.js +1 -1
- package/dist/src/entities/model/billing-timesheet.entity.model.d.ts +1 -1
- package/dist/src/entities/model/billing-timesheet.entity.model.js +1 -1
- package/dist/src/entities/model/billing-transaction.model.d.ts +38 -0
- package/dist/src/entities/model/billing-transaction.model.js +71 -0
- package/dist/src/entities/model/billing.entity.model.d.ts +4 -1
- package/dist/src/entities/model/billing.entity.model.js +9 -0
- package/dist/src/entities/model/entity.model.interface.d.ts +12 -1
- package/dist/src/entities/model/entity.model.interface.js +46 -2
- package/dist/src/entities/model/holiday.entity.model.d.ts +14 -1
- package/dist/src/entities/model/holiday.entity.model.js +26 -42
- package/dist/src/entities/model/leave.entity.model.d.ts +50 -3
- package/dist/src/entities/model/leave.entity.model.js +169 -21
- package/dist/src/entities/model/leave_count.entity.model.d.ts +19 -0
- package/dist/src/entities/model/leave_count.entity.model.js +60 -0
- package/dist/src/utils/entity.flow.util.d.ts +32 -0
- package/dist/src/utils/entity.flow.util.js +83 -0
- package/dist/src/utils/helper.fn.util.d.ts +37 -1
- package/dist/src/utils/helper.fn.util.js +53 -0
- package/dist/src/utils/index.d.ts +2 -0
- package/dist/src/utils/index.js +2 -0
- package/dist/src/utils/string.util.d.ts +1 -0
- package/dist/src/utils/string.util.js +14 -0
- package/package.json +1 -1
- package/dist/src/entities/func/convert-to-common-entity.func.d.ts +0 -15
- package/dist/src/entities/func/convert-to-common-entity.func.js +0 -24
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
import { IBillingTransactionEntity, IEntityCreateDto } from "../../entities";
|
|
2
|
-
export
|
|
1
|
+
import { BillingTransactionStatusEnum, IBillingEntity, IBillingTransactionEntity, IEntityCreateDto } from "../../entities";
|
|
2
|
+
export type IBillingTransactionExclude = "status";
|
|
3
|
+
export interface IBillingTransactionCreateDto extends Omit<IEntityCreateDto<IBillingTransactionEntity>, IBillingTransactionExclude> {
|
|
4
|
+
status?: BillingTransactionStatusEnum;
|
|
5
|
+
}
|
|
6
|
+
export interface IBillingTransactionCreateDtoValidationData {
|
|
7
|
+
billingEntity: IBillingEntity;
|
|
3
8
|
}
|
|
@@ -1,5 +1,28 @@
|
|
|
1
|
-
import { IBillingEntity, IBillingTransactionEntity } from "../../entities";
|
|
1
|
+
import { BillingTransactionActionEnum, BillingTransactionStatusEnum, IBillingEntity, IBillingTransactionEntity } from "../../entities";
|
|
2
|
+
import { IBillingTransactionUpdateDto } from "./billing.transaction.update.dto.interface";
|
|
2
3
|
export type IBillingTransactionEntityGet = {
|
|
3
4
|
billingTransaction: IBillingTransactionEntity;
|
|
4
5
|
billing: IBillingEntity;
|
|
5
6
|
};
|
|
7
|
+
export interface IBillingTransactionContextFlowData {
|
|
8
|
+
currentBillingTransactionEntity: IBillingTransactionEntity;
|
|
9
|
+
dto: IBillingTransactionUpdateDto;
|
|
10
|
+
}
|
|
11
|
+
export interface IBillingTransactionContextFlowData {
|
|
12
|
+
currentBillingTransactionEntity: IBillingTransactionEntity;
|
|
13
|
+
dto: IBillingTransactionUpdateDto;
|
|
14
|
+
}
|
|
15
|
+
export type IBillingTransactionFlowConfig = {
|
|
16
|
+
[key in BillingTransactionStatusEnum]?: {
|
|
17
|
+
actions: {
|
|
18
|
+
[key in BillingTransactionActionEnum]?: {
|
|
19
|
+
permissions: string[];
|
|
20
|
+
next: (data: IBillingTransactionContextFlowData) => BillingTransactionStatusEnum;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export interface IBillingTransactionContextFlowData {
|
|
26
|
+
currentBillingTransactionEntity: IBillingTransactionEntity;
|
|
27
|
+
dto: IBillingTransactionUpdateDto;
|
|
28
|
+
}
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
-
import { IBillingTransactionEntity, IEntityUpdateDto } from "../../entities";
|
|
2
|
-
export interface
|
|
1
|
+
import { BillingTransactionActionEnum, IBillingEntity, IBillingTransactionEntity, IEntityUpdateDto } from "../../entities";
|
|
2
|
+
export interface IBillingTransactionSupportingDocsDetails {
|
|
3
|
+
supportingDocsDetails?: string[];
|
|
4
|
+
}
|
|
5
|
+
export interface IBillingTransactionActionDataDto {
|
|
6
|
+
action: BillingTransactionActionEnum;
|
|
7
|
+
}
|
|
8
|
+
export interface IBillingTransactionUpdateDto extends IEntityUpdateDto<IBillingTransactionEntity>, IBillingTransactionSupportingDocsDetails {
|
|
9
|
+
actionData?: IBillingTransactionActionDataDto;
|
|
10
|
+
}
|
|
11
|
+
export interface IBillingTransactionUpdateDtoValidationResult {
|
|
12
|
+
billingTransactionEntity: IBillingTransactionEntity;
|
|
13
|
+
billingEntity: IBillingEntity;
|
|
3
14
|
}
|
|
@@ -13,3 +13,4 @@ export declare const reimbursementExpenseProjectUserInactiveBuffer: number;
|
|
|
13
13
|
export declare const annualPaidLeaves = 24;
|
|
14
14
|
export declare const designationPriorityOrder: Record<string, number>;
|
|
15
15
|
export declare const allowedProjectUpdateBillingStatuses: BillingStatusEnum[];
|
|
16
|
+
export declare const invalidFileNameCharacter: string[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.allowedProjectUpdateBillingStatuses = exports.designationPriorityOrder = exports.annualPaidLeaves = exports.reimbursementExpenseProjectUserInactiveBuffer = exports.systemUsers = exports.usersToExcludeFromSearchResponse = exports.freezeTimesheetAfterBillingStatus = exports.leaveImplicitDays = exports.reimbursementPaymentProcessorPermissionName = exports.toDoListMinimumEstimatedDuration = exports.timesheetMinimumTotalDuration = exports.timesheetEnterThreshold = exports.timesheetThreshold = exports.timesheetViewThreshold = void 0;
|
|
3
|
+
exports.invalidFileNameCharacter = exports.allowedProjectUpdateBillingStatuses = exports.designationPriorityOrder = exports.annualPaidLeaves = exports.reimbursementExpenseProjectUserInactiveBuffer = exports.systemUsers = exports.usersToExcludeFromSearchResponse = exports.freezeTimesheetAfterBillingStatus = exports.leaveImplicitDays = exports.reimbursementPaymentProcessorPermissionName = exports.toDoListMinimumEstimatedDuration = exports.timesheetMinimumTotalDuration = exports.timesheetEnterThreshold = exports.timesheetThreshold = exports.timesheetViewThreshold = void 0;
|
|
4
4
|
const entities_1 = require("../entities");
|
|
5
5
|
exports.timesheetViewThreshold = "timesheetViewThreshold";
|
|
6
6
|
exports.timesheetThreshold = "timesheetThreshold";
|
|
@@ -24,3 +24,4 @@ exports.allowedProjectUpdateBillingStatuses = [
|
|
|
24
24
|
entities_1.BillingStatusEnum.SETTLED,
|
|
25
25
|
entities_1.BillingStatusEnum.CANCELLED,
|
|
26
26
|
];
|
|
27
|
+
exports.invalidFileNameCharacter = [","];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BillingTransactionActionEnum = void 0;
|
|
4
|
+
var BillingTransactionActionEnum;
|
|
5
|
+
(function (BillingTransactionActionEnum) {
|
|
6
|
+
// UPDATE_PAYMENT = "updatePayment",
|
|
7
|
+
// WRITE_OFF = "writeOff",
|
|
8
|
+
// CREDIT_NOTE = "creditNote",
|
|
9
|
+
// TDS = "tds",
|
|
10
|
+
// WRITE_OFF_APPROVAL = "writeOffApproval",
|
|
11
|
+
// CREDIT_NOTE_APPROVAL = "creditNoteApproval",
|
|
12
|
+
BillingTransactionActionEnum["APPROVE"] = "approve";
|
|
13
|
+
BillingTransactionActionEnum["REJECT"] = "reject";
|
|
14
|
+
BillingTransactionActionEnum["EDIT"] = "edit";
|
|
15
|
+
})(BillingTransactionActionEnum || (exports.BillingTransactionActionEnum = BillingTransactionActionEnum = {}));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BillingTransactionStatusEnum = void 0;
|
|
4
|
+
var BillingTransactionStatusEnum;
|
|
5
|
+
(function (BillingTransactionStatusEnum) {
|
|
6
|
+
BillingTransactionStatusEnum["APPROVED"] = "approved";
|
|
7
|
+
BillingTransactionStatusEnum["REJECTED"] = "rejected";
|
|
8
|
+
BillingTransactionStatusEnum["WRITEOFF_APPROVAL_PENDING"] = "writeoff_approval_pending";
|
|
9
|
+
BillingTransactionStatusEnum["CREDITNOTE_APPROVAL_PENDING"] = "creditnote_approval_pending";
|
|
10
|
+
})(BillingTransactionStatusEnum || (exports.BillingTransactionStatusEnum = BillingTransactionStatusEnum = {}));
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export * from "./enums/task.entity.enum";
|
|
2
2
|
export * from "./enums/user.entity.enum";
|
|
3
3
|
export * from "./enums/organization.entity.enum";
|
|
4
|
-
export * from "./func/convert-to-common-entity.func";
|
|
5
4
|
export * from "./interface/audit-column.entity.interface";
|
|
6
5
|
export * from "./interface/entity.utils.interface";
|
|
7
6
|
export * from "./interface/organization.entity.interface";
|
|
@@ -66,6 +65,7 @@ export * from "./interface/intermediary_bank.entity.interface";
|
|
|
66
65
|
export * from "./interface/holiday-list.entity.interface";
|
|
67
66
|
export * from "./interface/holiday.entity.interface";
|
|
68
67
|
export * from "./model/leave.entity.model";
|
|
68
|
+
export * from "./model/leave_count.entity.model";
|
|
69
69
|
export * from "./model/holiday.entity.model";
|
|
70
70
|
export * from "./enums/cron-jobs-name.enum";
|
|
71
71
|
export * from "./enums/cron-jobs-status.enum";
|
|
@@ -98,3 +98,7 @@ export * from "./model/user.entity.model";
|
|
|
98
98
|
export * from "./model/client-affiliate.entity.model";
|
|
99
99
|
export * from "./model/billing-timesheet.entity.model";
|
|
100
100
|
export * from "./interface/entity-audit-columns.interface";
|
|
101
|
+
export * from "./enums/billing-transaction-action.enum";
|
|
102
|
+
export * from "./enums/billing-transaction-status.enum";
|
|
103
|
+
export * from "./interface/billing-transaction-history.entity";
|
|
104
|
+
export * from "./model/billing-transaction.model";
|
|
@@ -16,9 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./enums/task.entity.enum"), exports);
|
|
18
18
|
__exportStar(require("./enums/user.entity.enum"), exports);
|
|
19
|
-
// export * from "./enums/country.entity.enum";
|
|
20
19
|
__exportStar(require("./enums/organization.entity.enum"), exports);
|
|
21
|
-
__exportStar(require("./func/convert-to-common-entity.func"), exports);
|
|
22
20
|
__exportStar(require("./interface/audit-column.entity.interface"), exports);
|
|
23
21
|
__exportStar(require("./interface/entity.utils.interface"), exports);
|
|
24
22
|
__exportStar(require("./interface/organization.entity.interface"), exports);
|
|
@@ -83,6 +81,7 @@ __exportStar(require("./interface/intermediary_bank.entity.interface"), exports)
|
|
|
83
81
|
__exportStar(require("./interface/holiday-list.entity.interface"), exports);
|
|
84
82
|
__exportStar(require("./interface/holiday.entity.interface"), exports);
|
|
85
83
|
__exportStar(require("./model/leave.entity.model"), exports);
|
|
84
|
+
__exportStar(require("./model/leave_count.entity.model"), exports);
|
|
86
85
|
__exportStar(require("./model/holiday.entity.model"), exports);
|
|
87
86
|
__exportStar(require("./enums/cron-jobs-name.enum"), exports);
|
|
88
87
|
__exportStar(require("./enums/cron-jobs-status.enum"), exports);
|
|
@@ -115,3 +114,7 @@ __exportStar(require("./model/user.entity.model"), exports);
|
|
|
115
114
|
__exportStar(require("./model/client-affiliate.entity.model"), exports);
|
|
116
115
|
__exportStar(require("./model/billing-timesheet.entity.model"), exports);
|
|
117
116
|
__exportStar(require("./interface/entity-audit-columns.interface"), exports);
|
|
117
|
+
__exportStar(require("./enums/billing-transaction-action.enum"), exports);
|
|
118
|
+
__exportStar(require("./enums/billing-transaction-status.enum"), exports);
|
|
119
|
+
__exportStar(require("./interface/billing-transaction-history.entity"), exports);
|
|
120
|
+
__exportStar(require("./model/billing-transaction.model"), exports);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IBaseHistoryEntity, IEntityCreateDto, IEntityFilterData } from "./entity.utils.interface";
|
|
2
|
+
export interface IBillingTransactionHistoryEntity extends IBaseHistoryEntity {
|
|
3
|
+
}
|
|
4
|
+
export interface IBillingTransactionHistoryCreateDto extends IEntityCreateDto<IBillingTransactionHistoryEntity> {
|
|
5
|
+
}
|
|
6
|
+
export interface IBillingTransactionHistorySearchDto extends IEntityFilterData<IBillingTransactionHistoryEntity> {
|
|
7
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BillingTransactionStatusEnum } from "../enums/billing-transaction-status.enum";
|
|
1
2
|
import { BillingTransactionType } from "../enums/billing.transaction.enum";
|
|
2
3
|
import { IEntityAuditColumn } from "./entity-audit-columns.interface";
|
|
3
4
|
import { IEntityFilterData } from "./entity.utils.interface";
|
|
@@ -7,5 +8,11 @@ export interface IBillingTransactionEntity extends IEntityAuditColumn {
|
|
|
7
8
|
type: BillingTransactionType;
|
|
8
9
|
amount: number;
|
|
9
10
|
details: string;
|
|
11
|
+
bankCharges?: number;
|
|
12
|
+
bankId?: number;
|
|
13
|
+
paymentDate?: string;
|
|
14
|
+
referenceNo?: string;
|
|
15
|
+
supportingDocsUrls?: string;
|
|
16
|
+
status: BillingTransactionStatusEnum;
|
|
10
17
|
}
|
|
11
18
|
export type IBillingTransactionEntityFilterData = IEntityFilterData<IBillingTransactionEntity>;
|
|
@@ -6,10 +6,14 @@ import { HistoryOperationEnum } from "../enums/history_operation.enum";
|
|
|
6
6
|
import { BankEntityModel } from "../model/bank.entity.model";
|
|
7
7
|
import { BillingReimbursementExpneseEntityModel } from "../model/billing-reimbursement-expense.entity.model";
|
|
8
8
|
import { BillingTimesheetEntityModel } from "../model/billing-timesheet.entity.model";
|
|
9
|
+
import { BillingTransactionEntityModel } from "../model/billing-transaction.model";
|
|
9
10
|
import { BillingEntityModel } from "../model/billing.entity.model";
|
|
10
11
|
import { ClientAffiliateEntityModel } from "../model/client-affiliate.entity.model";
|
|
11
12
|
import { ClientEntityModel } from "../model/client.entity.model";
|
|
12
13
|
import { ConfigurationEntityModel } from "../model/configuration.model";
|
|
14
|
+
import { HolidayEntityModel } from "../model/holiday.entity.model";
|
|
15
|
+
import { LeaveEntityModel } from "../model/leave.entity.model";
|
|
16
|
+
import { LeaveCountVirtualEntityModel } from "../model/leave_count.entity.model";
|
|
13
17
|
import { ProjectUserMappingEntityModel } from "../model/project-user-mapping.entity.model";
|
|
14
18
|
import { ProjectEntityModel } from "../model/project.entity.model";
|
|
15
19
|
import { ReimbursementExpenseEntityModel } from "../model/reimbursement-expense.entity.model";
|
|
@@ -21,6 +25,7 @@ import { IAuditColumnEntity } from "./audit-column.entity.interface";
|
|
|
21
25
|
import { IBankEntity } from "./bank.entity.interface";
|
|
22
26
|
import { IBankHistoryEntity } from "./bank_history.entity.interface";
|
|
23
27
|
import { IBillingReimbursementExpenseEntity } from "./billing-reimbursement-expense.entity.interface";
|
|
28
|
+
import { IBillingTransactionHistoryEntity } from "./billing-transaction-history.entity";
|
|
24
29
|
import { IBillingEntity } from "./billing.entity.interface";
|
|
25
30
|
import { IBillingPaymentEntity } from "./billing_payment.entity.interface";
|
|
26
31
|
import { IBillingTimesheetEntity } from "./billing_timesheet.entity.interface";
|
|
@@ -119,6 +124,7 @@ export declare enum EntityEnum {
|
|
|
119
124
|
BANK_HISTORY = "bank_history",
|
|
120
125
|
BILLING_PAYMENT = "billing_payment",
|
|
121
126
|
BILLING_TRANSACTION = "billing_transaction",
|
|
127
|
+
BILLING_TRANSACTION_HISTORY = "billing_transaction_history",
|
|
122
128
|
CONFIGURATION = "configuration",
|
|
123
129
|
COUNTRY = "country",
|
|
124
130
|
EXPENSE_TYPE = "expense_type",
|
|
@@ -148,12 +154,12 @@ export type IBaseEntityServiceResponse<T> = {
|
|
|
148
154
|
virtualEntities?: IEntityServiceResponse;
|
|
149
155
|
};
|
|
150
156
|
export type IBaseEntityApiResponse<T> = {
|
|
151
|
-
baseEntities:
|
|
157
|
+
baseEntities: T[];
|
|
152
158
|
relatedEntities?: {
|
|
153
159
|
[K in EntityEnum | VirtualEntityEnum]?: IBaseEntityApiResponse<EnumEntityType<K>>;
|
|
154
160
|
};
|
|
155
161
|
};
|
|
156
|
-
export type EnumEntityType<T extends EntityEnum | VirtualEntityEnum> = (T extends EntityEnum.BILLING ? IBillingEntity : T extends EntityEnum.BILLING_TIMESHEET ? IBillingTimesheetEntity : T extends EntityEnum.BILLING_REIMBURSEMENT_EXPENSE ? IBillingReimbursementExpenseEntity : T extends EntityEnum.TIMESHEET ? ITimesheetEntity : T extends EntityEnum.USER ? IUserEntity : T extends EntityEnum.PROJECT ? IProjectEntity : T extends EntityEnum.CLIENT ? IClientEntity : T extends EntityEnum.LEAVE ? ILeaveEntity : T extends EntityEnum.BANK ? IBankEntity : T extends EntityEnum.BILLING_PAYMENT ? IBillingPaymentEntity : T extends EntityEnum.BILLING_TRANSACTION ? IBillingTransactionEntity : T extends EntityEnum.CLIENT_AFFILIATE ? IClientAffiliateEntity : T extends EntityEnum.CONFIGURATION ? IConfigurationEntity : T extends EntityEnum.HOLIDAY ? IHolidayEntity : T extends EntityEnum.HOLIDAY_LIST ? IHolidayListEntity : T extends EntityEnum.COUNTRY ? ICountryEntity : T extends EntityEnum.EXPENSE_TYPE ? IExpenseTypeEntity : T extends EntityEnum.INDUSTRY ? IIndustryEntity : T extends EntityEnum.INTERMEDIARY_BANK ? IIntermediaryBankEntity : T extends EntityEnum.OFFICE_LOCATION ? IOfficeLocationEntity : T extends EntityEnum.PERMISSION ? IPermissionEntity : T extends EntityEnum.ROLE ? IRoleEntity : T extends EntityEnum.TASK ? ITaskEntity : T extends EntityEnum.DESIGNATION ? IDesignationEntity : T extends EntityEnum.RATE ? IRateEntity : T extends EntityEnum.REIMBURSEMENT ? IReimbursementEntity : T extends EntityEnum.REIMBURSEMENT_EXPENSE ? IReimbursementExpenseEntity : T extends EntityEnum.WORK_FROM_HOME ? IWorkFromHomeEntity : T extends EntityEnum.ORGANIZATION ? IOrganizationEntity : T extends EntityEnum.PROJECT_USER_MAPPING ? IProjectUserMappingEntity : T extends EntityEnum.CLIENT_USER_MAPPING ? IClientUserMappingEntity : T extends EntityEnum.TO_DO_LIST ? IToDoListEntity : T extends EntityEnum.CRON_JOBS ? ICronJobsEntity : T extends EntityEnum.ROLE_PERMISSION_MAPPING ? IRolePermissionMappingEntity : T extends EntityEnum.BANK_HISTORY ? IBankHistoryEntity : T extends VirtualEntityEnum.LEAVE_COUNT ? ILeaveCountVirtualEntity : T extends EntityEnum.LEAVE_HISTORY ? ILeaveHistoryEntity : T extends EntityEnum.WORK_FROM_HOME_HISTORY ? IWorkFromHomeHistoryEntity : T extends EntityEnum.TIMESHEET_HISTORY ? ITimesheetHistoryEntity : never) & {
|
|
162
|
+
export type EnumEntityType<T extends EntityEnum | VirtualEntityEnum> = (T extends EntityEnum.BILLING ? IBillingEntity : T extends EntityEnum.BILLING_TIMESHEET ? IBillingTimesheetEntity : T extends EntityEnum.BILLING_REIMBURSEMENT_EXPENSE ? IBillingReimbursementExpenseEntity : T extends EntityEnum.TIMESHEET ? ITimesheetEntity : T extends EntityEnum.USER ? IUserEntity : T extends EntityEnum.PROJECT ? IProjectEntity : T extends EntityEnum.CLIENT ? IClientEntity : T extends EntityEnum.LEAVE ? ILeaveEntity : T extends EntityEnum.BANK ? IBankEntity : T extends EntityEnum.BILLING_PAYMENT ? IBillingPaymentEntity : T extends EntityEnum.BILLING_TRANSACTION ? IBillingTransactionEntity : T extends EntityEnum.BILLING_TRANSACTION_HISTORY ? IBillingTransactionHistoryEntity : T extends EntityEnum.CLIENT_AFFILIATE ? IClientAffiliateEntity : T extends EntityEnum.CONFIGURATION ? IConfigurationEntity : T extends EntityEnum.HOLIDAY ? IHolidayEntity : T extends EntityEnum.HOLIDAY_LIST ? IHolidayListEntity : T extends EntityEnum.COUNTRY ? ICountryEntity : T extends EntityEnum.EXPENSE_TYPE ? IExpenseTypeEntity : T extends EntityEnum.INDUSTRY ? IIndustryEntity : T extends EntityEnum.INTERMEDIARY_BANK ? IIntermediaryBankEntity : T extends EntityEnum.OFFICE_LOCATION ? IOfficeLocationEntity : T extends EntityEnum.PERMISSION ? IPermissionEntity : T extends EntityEnum.ROLE ? IRoleEntity : T extends EntityEnum.TASK ? ITaskEntity : T extends EntityEnum.DESIGNATION ? IDesignationEntity : T extends EntityEnum.RATE ? IRateEntity : T extends EntityEnum.REIMBURSEMENT ? IReimbursementEntity : T extends EntityEnum.REIMBURSEMENT_EXPENSE ? IReimbursementExpenseEntity : T extends EntityEnum.WORK_FROM_HOME ? IWorkFromHomeEntity : T extends EntityEnum.ORGANIZATION ? IOrganizationEntity : T extends EntityEnum.PROJECT_USER_MAPPING ? IProjectUserMappingEntity : T extends EntityEnum.CLIENT_USER_MAPPING ? IClientUserMappingEntity : T extends EntityEnum.TO_DO_LIST ? IToDoListEntity : T extends EntityEnum.CRON_JOBS ? ICronJobsEntity : T extends EntityEnum.ROLE_PERMISSION_MAPPING ? IRolePermissionMappingEntity : T extends EntityEnum.BANK_HISTORY ? IBankHistoryEntity : T extends VirtualEntityEnum.LEAVE_COUNT ? ILeaveCountVirtualEntity : T extends EntityEnum.LEAVE_HISTORY ? ILeaveHistoryEntity : T extends EntityEnum.WORK_FROM_HOME_HISTORY ? IWorkFromHomeHistoryEntity : T extends EntityEnum.TIMESHEET_HISTORY ? ITimesheetHistoryEntity : never) & {
|
|
157
163
|
id: number;
|
|
158
164
|
};
|
|
159
165
|
export type EntityRelationConfig<T extends EntityEnum | VirtualEntityEnum> = {
|
|
@@ -276,12 +282,15 @@ export declare enum VirtualEntityEnum {
|
|
|
276
282
|
}
|
|
277
283
|
export type IHistoryConstraintSearchResponse<T> = IBaseResponse<IHistoryEntitySearchByConstraintResponse<T>[]>;
|
|
278
284
|
export type IHistoryConstraintSearchServiceResponse<T> = IHistoryEntitySearchByConstraintResponse<T>[];
|
|
279
|
-
export type EnumToModel<T extends EntityEnum | VirtualEntityEnum> = T extends EntityEnum.BILLING ? BillingEntityModel : T extends EntityEnum.CLIENT ? ClientEntityModel : T extends EntityEnum.PROJECT ? ProjectEntityModel : T extends EntityEnum.PROJECT_USER_MAPPING ? ProjectUserMappingEntityModel : T extends EntityEnum.REIMBURSEMENT ? ReimbursementEntityModel : T extends EntityEnum.REIMBURSEMENT_EXPENSE ? ReimbursementExpenseEntityModel : T extends EntityEnum.BILLING_REIMBURSEMENT_EXPENSE ? BillingReimbursementExpneseEntityModel : T extends EntityEnum.CLIENT_AFFILIATE ? ClientAffiliateEntityModel : T extends EntityEnum.BANK ? BankEntityModel : T extends EntityEnum.CONFIGURATION ? ConfigurationEntityModel : T extends EntityEnum.TASK ? TaskEntityModel : T extends EntityEnum.BILLING_TIMESHEET ? BillingTimesheetEntityModel : T extends EntityEnum.TIMESHEET ? TimesheetEntityModel : UserEntityModel;
|
|
285
|
+
export type EnumToModel<T extends EntityEnum | VirtualEntityEnum> = T extends EntityEnum.BILLING ? BillingEntityModel : T extends EntityEnum.CLIENT ? ClientEntityModel : T extends EntityEnum.PROJECT ? ProjectEntityModel : T extends EntityEnum.PROJECT_USER_MAPPING ? ProjectUserMappingEntityModel : T extends EntityEnum.REIMBURSEMENT ? ReimbursementEntityModel : T extends EntityEnum.REIMBURSEMENT_EXPENSE ? ReimbursementExpenseEntityModel : T extends EntityEnum.BILLING_REIMBURSEMENT_EXPENSE ? BillingReimbursementExpneseEntityModel : T extends EntityEnum.LEAVE ? LeaveEntityModel : T extends EntityEnum.HOLIDAY ? HolidayEntityModel : T extends VirtualEntityEnum.LEAVE_COUNT ? LeaveCountVirtualEntityModel : T extends EntityEnum.CLIENT_AFFILIATE ? ClientAffiliateEntityModel : T extends EntityEnum.BANK ? BankEntityModel : T extends EntityEnum.CONFIGURATION ? ConfigurationEntityModel : T extends EntityEnum.TASK ? TaskEntityModel : T extends EntityEnum.BILLING_TIMESHEET ? BillingTimesheetEntityModel : T extends EntityEnum.TIMESHEET ? TimesheetEntityModel : T extends EntityEnum.BILLING_TRANSACTION ? BillingTransactionEntityModel : UserEntityModel;
|
|
280
286
|
export type EntityMap = {
|
|
281
|
-
[key in EntityEnum]: EnumToModel<key>[];
|
|
287
|
+
[key in EntityEnum | VirtualEntityEnum]: EnumToModel<key>[];
|
|
282
288
|
};
|
|
283
289
|
export type EntityIndexMap = {
|
|
284
|
-
[key in EntityEnum]: {
|
|
290
|
+
[key in EntityEnum | VirtualEntityEnum]: {
|
|
285
291
|
[id: number]: EnumToModel<key>;
|
|
286
292
|
};
|
|
287
293
|
};
|
|
294
|
+
export type IPremissionFilterConfig<T extends EntityEnum | VirtualEntityEnum> = {
|
|
295
|
+
[key: string]: () => Promise<IEntityFilterData<EnumEntityType<T>>>;
|
|
296
|
+
};
|
|
@@ -60,6 +60,7 @@ var EntityEnum;
|
|
|
60
60
|
EntityEnum["BANK_HISTORY"] = "bank_history";
|
|
61
61
|
EntityEnum["BILLING_PAYMENT"] = "billing_payment";
|
|
62
62
|
EntityEnum["BILLING_TRANSACTION"] = "billing_transaction";
|
|
63
|
+
EntityEnum["BILLING_TRANSACTION_HISTORY"] = "billing_transaction_history";
|
|
63
64
|
EntityEnum["CONFIGURATION"] = "configuration";
|
|
64
65
|
EntityEnum["COUNTRY"] = "country";
|
|
65
66
|
EntityEnum["EXPENSE_TYPE"] = "expense_type";
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import { EntityEnum, EntityIndexMap } from "../interface/entity.utils.interface";
|
|
2
|
-
export declare
|
|
1
|
+
import { EntityEnum, EntityIndexMap, VirtualEntityEnum } from "../interface/entity.utils.interface";
|
|
2
|
+
export declare enum RelationType {
|
|
3
|
+
ONE = "one",
|
|
4
|
+
MANY = "many"
|
|
5
|
+
}
|
|
6
|
+
export declare abstract class BaseEntityModel<T extends EntityEnum | VirtualEntityEnum> {
|
|
3
7
|
protected entityName: T;
|
|
4
8
|
constructor(entityName: T);
|
|
5
9
|
abstract getRelationConfigs(): any[];
|
|
6
10
|
populateRelationsByIndex(entityIndexMap: EntityIndexMap): void;
|
|
7
11
|
static populateRelationsForEntities(entityIndexMap: EntityIndexMap, entityType: EntityEnum): void;
|
|
12
|
+
populateRelations(entityIndexMap: EntityIndexMap): void;
|
|
13
|
+
overwrite(entityIndexMap: EntityIndexMap, indexKey?: string): this;
|
|
8
14
|
}
|
|
@@ -1,58 +1,67 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BaseEntityModel = void 0;
|
|
4
|
-
|
|
3
|
+
exports.BaseEntityModel = exports.RelationType = void 0;
|
|
4
|
+
var RelationType;
|
|
5
|
+
(function (RelationType) {
|
|
6
|
+
RelationType["ONE"] = "one";
|
|
7
|
+
RelationType["MANY"] = "many";
|
|
8
|
+
})(RelationType || (exports.RelationType = RelationType = {}));
|
|
5
9
|
class BaseEntityModel {
|
|
6
10
|
constructor(entityName) {
|
|
7
11
|
this.entityName = entityName;
|
|
8
12
|
}
|
|
9
13
|
populateRelationsByIndex(entityIndexMap) {
|
|
10
14
|
for (const relationConfig of this.getRelationConfigs() || []) {
|
|
11
|
-
|
|
12
|
-
|
|
15
|
+
const thisMappingKey = relationConfig.mapKeyConfig.key;
|
|
16
|
+
const relatedMappingKey = relationConfig.mapKeyConfig.relationKey;
|
|
17
|
+
const thisKey = relationConfig.key;
|
|
18
|
+
// console.log('Populating relation for', relationConfig.name, 'on', this.entityName, relationConfig);
|
|
19
|
+
// debugger;
|
|
20
|
+
if (relationConfig.relation === RelationType.ONE) {
|
|
13
21
|
const relatedEntities = entityIndexMap[relationConfig.name] || {};
|
|
14
|
-
|
|
22
|
+
if (Object.is(relatedEntities, null))
|
|
23
|
+
continue;
|
|
15
24
|
let foundRelatedEntities = [];
|
|
16
|
-
if (
|
|
17
|
-
const [parentKey, childKey] =
|
|
18
|
-
|
|
19
|
-
if (this[parentKey]
|
|
20
|
-
|
|
21
|
-
|
|
25
|
+
if (thisMappingKey.includes(".")) {
|
|
26
|
+
const [parentKey, childKey] = thisMappingKey.split(".");
|
|
27
|
+
console.log(`[populateRelationsByIndex] Checking nested relation "${relationConfig.name}" on entity "${this.entityName}" → parentKey="${parentKey}", childKey="${childKey}"`);
|
|
28
|
+
if (!this[parentKey]) {
|
|
29
|
+
console.warn(`[populateRelationsByIndex] Missing parent key "${parentKey}" on entity "${this.entityName}". Current entity:`, this);
|
|
30
|
+
continue;
|
|
22
31
|
}
|
|
32
|
+
if (!this[parentKey][childKey]) {
|
|
33
|
+
console.warn(`[populateRelationsByIndex] Missing child key "${childKey}" in parent "${parentKey}" on entity "${this.entityName}". Parent value:`, this[parentKey]);
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
foundRelatedEntities = [relatedEntities[this[parentKey][childKey]]];
|
|
23
37
|
}
|
|
24
38
|
else {
|
|
25
|
-
foundRelatedEntities = relatedEntities[
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
39
|
+
// foundRelatedEntities = relatedEntities[this[thisKey]] ? [relatedEntities[this[thisKey]]] : [];
|
|
40
|
+
const relatedEntity = relatedEntities[this[thisMappingKey]];
|
|
41
|
+
if (relatedEntity) {
|
|
42
|
+
foundRelatedEntities = [relatedEntity];
|
|
43
|
+
}
|
|
44
|
+
else if (relatedMappingKey !== "id") {
|
|
45
|
+
foundRelatedEntities = Object.values(relatedEntities).filter((entity) => entity[relatedMappingKey] === this[thisMappingKey]);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
foundRelatedEntities = [];
|
|
49
|
+
}
|
|
31
50
|
}
|
|
32
51
|
if (foundRelatedEntities.length > 1) {
|
|
33
52
|
throw new Error(`Expected one related entity for ${relationConfig.name} but found ${foundRelatedEntities.length}`);
|
|
34
53
|
}
|
|
35
54
|
if (foundRelatedEntities.length === 0) {
|
|
36
|
-
console.warn(`No related entity found for ${relationConfig.name} with ${relationConfig.mapKeyConfig.
|
|
37
|
-
// @ts-ignore
|
|
38
|
-
}=${this[relationConfig.mapKeyConfig.foreignKey]}`);
|
|
55
|
+
console.warn(`No related entity found for ${relationConfig.name} with ${thisMappingKey}=${this[relationConfig.mapKeyConfig.foreignKey]}`);
|
|
39
56
|
}
|
|
40
|
-
|
|
41
|
-
this[relationConfig.key] = foundRelatedEntities[0];
|
|
57
|
+
this[thisKey] = foundRelatedEntities[0];
|
|
42
58
|
}
|
|
43
|
-
else if (relationConfig.relation ===
|
|
44
|
-
|
|
45
|
-
this[relationConfig.key] = [];
|
|
46
|
-
// @ts-ignore
|
|
59
|
+
else if (relationConfig.relation === RelationType.MANY) {
|
|
60
|
+
this[thisKey] = [];
|
|
47
61
|
const relatedEntities = entityIndexMap[relationConfig.name] || {};
|
|
48
62
|
for (const relatedEntity of Object.values(relatedEntities)) {
|
|
49
|
-
if (
|
|
50
|
-
|
|
51
|
-
relatedEntity[relationConfig.mapKeyConfig.relationKey] ===
|
|
52
|
-
// @ts-ignore
|
|
53
|
-
this[relationConfig.mapKeyConfig.key]) {
|
|
54
|
-
// @ts-ignore
|
|
55
|
-
this[relationConfig.key].push(relatedEntity);
|
|
63
|
+
if (relatedEntity[relatedMappingKey] === this[thisMappingKey]) {
|
|
64
|
+
this[thisKey].push(relatedEntity);
|
|
56
65
|
}
|
|
57
66
|
}
|
|
58
67
|
}
|
|
@@ -60,10 +69,20 @@ class BaseEntityModel {
|
|
|
60
69
|
}
|
|
61
70
|
static populateRelationsForEntities(entityIndexMap, entityType) {
|
|
62
71
|
for (const key of Object.keys(entityIndexMap[entityType] || {})) {
|
|
63
|
-
// @ts-ignore
|
|
64
72
|
const entity = entityIndexMap[entityType][key];
|
|
65
73
|
entity.populateRelationsByIndex(entityIndexMap);
|
|
66
74
|
}
|
|
67
75
|
}
|
|
76
|
+
populateRelations(entityIndexMap) {
|
|
77
|
+
this.populateRelationsByIndex(entityIndexMap);
|
|
78
|
+
}
|
|
79
|
+
overwrite(entityIndexMap, indexKey = "id") {
|
|
80
|
+
if (this[indexKey] === undefined) {
|
|
81
|
+
console.warn(`Entity of type ${this.entityName} does not have ${indexKey}, cannot merge`);
|
|
82
|
+
return this;
|
|
83
|
+
}
|
|
84
|
+
entityIndexMap[this.entityName][this[indexKey]] = this;
|
|
85
|
+
return this;
|
|
86
|
+
}
|
|
68
87
|
}
|
|
69
88
|
exports.BaseEntityModel = BaseEntityModel;
|
|
@@ -21,5 +21,5 @@ export declare class BillingReimbursementExpneseEntityModel extends BaseEntityMo
|
|
|
21
21
|
updatedOn: number;
|
|
22
22
|
static relationConfigs: never[];
|
|
23
23
|
getRelationConfigs(): any[];
|
|
24
|
-
static
|
|
24
|
+
static fromEntity(entity: IBillingReimbursementExpenseEntity): BillingReimbursementExpneseEntityModel;
|
|
25
25
|
}
|
|
@@ -25,7 +25,7 @@ class BillingReimbursementExpneseEntityModel extends base_entity_model_1.BaseEnt
|
|
|
25
25
|
getRelationConfigs() {
|
|
26
26
|
return this.constructor.prototype.constructor.relationConfigs || [];
|
|
27
27
|
}
|
|
28
|
-
static
|
|
28
|
+
static fromEntity(entity) {
|
|
29
29
|
const result = new BillingReimbursementExpneseEntityModel(entity_utils_interface_1.EntityEnum.BILLING_REIMBURSEMENT_EXPENSE);
|
|
30
30
|
Object.assign(result, entity);
|
|
31
31
|
return result;
|
|
@@ -22,5 +22,5 @@ export declare class BillingTimesheetEntityModel extends BaseEntityModel<EntityE
|
|
|
22
22
|
createdBy: number;
|
|
23
23
|
updatedBy: number;
|
|
24
24
|
getRelationConfigs(): any;
|
|
25
|
-
static
|
|
25
|
+
static fromEntity(entity: IBillingTimesheetEntity): BillingTimesheetEntityModel;
|
|
26
26
|
}
|
|
@@ -27,7 +27,7 @@ class BillingTimesheetEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
27
27
|
getRelationConfigs() {
|
|
28
28
|
return this.constructor.prototype.constructor.relationConfigs;
|
|
29
29
|
}
|
|
30
|
-
static
|
|
30
|
+
static fromEntity(entity) {
|
|
31
31
|
const result = new BillingTimesheetEntityModel(entity_utils_interface_1.EntityEnum.BILLING_TIMESHEET);
|
|
32
32
|
Object.assign(result, entity);
|
|
33
33
|
return result;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { BillingTransactionStatusEnum } from "../enums/billing-transaction-status.enum";
|
|
2
|
+
import { BillingTransactionType } from "../enums/billing.transaction.enum";
|
|
3
|
+
import { IBillingTransactionEntity } from "../interface/billing_transaction.entity.interface";
|
|
4
|
+
import { EntityEnum, EnumEntityType } from "../interface/entity.utils.interface";
|
|
5
|
+
import { RelationConfigs } from "../interface/relation-config.interface";
|
|
6
|
+
import { BankEntityModel } from "./bank.entity.model";
|
|
7
|
+
import { BaseEntityModel } from "./base.entity.model";
|
|
8
|
+
import { BillingEntityModel } from "./billing.entity.model";
|
|
9
|
+
import { UserEntityModel } from "./user.entity.model";
|
|
10
|
+
export declare class BillingTransactionEntityModel extends BaseEntityModel<EntityEnum.BILLING_TRANSACTION> implements IBillingTransactionEntity {
|
|
11
|
+
id: number;
|
|
12
|
+
billingId: number;
|
|
13
|
+
type: BillingTransactionType;
|
|
14
|
+
amount: number;
|
|
15
|
+
details: string;
|
|
16
|
+
bankCharges?: number;
|
|
17
|
+
bankId?: number;
|
|
18
|
+
paymentDate?: string;
|
|
19
|
+
referenceNo?: string;
|
|
20
|
+
supportingDocsUrls?: string;
|
|
21
|
+
status: BillingTransactionStatusEnum;
|
|
22
|
+
createdOn: number;
|
|
23
|
+
updatedOn: number;
|
|
24
|
+
createdBy: number;
|
|
25
|
+
updatedBy: number;
|
|
26
|
+
createdByUser?: UserEntityModel;
|
|
27
|
+
updatedByUser?: UserEntityModel;
|
|
28
|
+
bank?: BankEntityModel;
|
|
29
|
+
billing?: BillingEntityModel;
|
|
30
|
+
getRelationConfigs(): any;
|
|
31
|
+
static relationConfigs: RelationConfigs<[
|
|
32
|
+
EntityEnum.USER,
|
|
33
|
+
EntityEnum.USER,
|
|
34
|
+
EntityEnum.BANK,
|
|
35
|
+
EntityEnum.BILLING
|
|
36
|
+
], EnumEntityType<EntityEnum.BILLING_TRANSACTION>>;
|
|
37
|
+
static fromEntity(entity: IBillingTransactionEntity): BillingTransactionEntityModel;
|
|
38
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BillingTransactionEntityModel = void 0;
|
|
4
|
+
const billing_transaction_status_enum_1 = require("../enums/billing-transaction-status.enum");
|
|
5
|
+
const billing_transaction_enum_1 = require("../enums/billing.transaction.enum");
|
|
6
|
+
const entity_utils_interface_1 = require("../interface/entity.utils.interface");
|
|
7
|
+
const base_entity_model_1 = require("./base.entity.model");
|
|
8
|
+
class BillingTransactionEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
this.id = 0;
|
|
12
|
+
this.billingId = 0;
|
|
13
|
+
this.type = billing_transaction_enum_1.BillingTransactionType.PAYMENT;
|
|
14
|
+
this.amount = 0;
|
|
15
|
+
this.details = "";
|
|
16
|
+
this.status = billing_transaction_status_enum_1.BillingTransactionStatusEnum.APPROVED;
|
|
17
|
+
this.createdOn = 0;
|
|
18
|
+
this.updatedOn = 0;
|
|
19
|
+
this.createdBy = 0;
|
|
20
|
+
this.updatedBy = 0;
|
|
21
|
+
}
|
|
22
|
+
// billing?: BillingEntityModel;
|
|
23
|
+
// bank?: BankEntityModel;
|
|
24
|
+
getRelationConfigs() {
|
|
25
|
+
return this.constructor.prototype.constructor.relationConfigs;
|
|
26
|
+
}
|
|
27
|
+
static fromEntity(entity) {
|
|
28
|
+
const result = new BillingTransactionEntityModel(entity_utils_interface_1.EntityEnum.BILLING_TRANSACTION);
|
|
29
|
+
Object.assign(result, entity);
|
|
30
|
+
return result;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.BillingTransactionEntityModel = BillingTransactionEntityModel;
|
|
34
|
+
BillingTransactionEntityModel.relationConfigs = [
|
|
35
|
+
{
|
|
36
|
+
name: entity_utils_interface_1.EntityEnum.USER,
|
|
37
|
+
relation: base_entity_model_1.RelationType.ONE,
|
|
38
|
+
key: "createdByUser",
|
|
39
|
+
mapKeyConfig: {
|
|
40
|
+
relationKey: "id",
|
|
41
|
+
key: "createdBy",
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: entity_utils_interface_1.EntityEnum.USER,
|
|
46
|
+
relation: base_entity_model_1.RelationType.ONE,
|
|
47
|
+
key: "updatedByUser",
|
|
48
|
+
mapKeyConfig: {
|
|
49
|
+
relationKey: "id",
|
|
50
|
+
key: "updatedBy",
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: entity_utils_interface_1.EntityEnum.BANK,
|
|
55
|
+
relation: base_entity_model_1.RelationType.ONE,
|
|
56
|
+
key: "bank",
|
|
57
|
+
mapKeyConfig: {
|
|
58
|
+
relationKey: "id",
|
|
59
|
+
key: "bankId",
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: entity_utils_interface_1.EntityEnum.BILLING,
|
|
64
|
+
relation: base_entity_model_1.RelationType.ONE,
|
|
65
|
+
key: "billing",
|
|
66
|
+
mapKeyConfig: {
|
|
67
|
+
relationKey: "id",
|
|
68
|
+
key: "billingId",
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
];
|
|
@@ -12,6 +12,7 @@ import { BankEntityModel } from "./bank.entity.model";
|
|
|
12
12
|
import { BaseEntityModel } from "./base.entity.model";
|
|
13
13
|
import { BillingReimbursementExpneseEntityModel } from "./billing-reimbursement-expense.entity.model";
|
|
14
14
|
import { BillingTimesheetEntityModel } from "./billing-timesheet.entity.model";
|
|
15
|
+
import { BillingTransactionEntityModel } from "./billing-transaction.model";
|
|
15
16
|
import { ClientEntityModel } from "./client.entity.model";
|
|
16
17
|
import { ProjectEntityModel } from "./project.entity.model";
|
|
17
18
|
import { ReimbursementExpenseEntityModel } from "./reimbursement-expense.entity.model";
|
|
@@ -60,6 +61,7 @@ export declare class BillingEntityModel extends BaseEntityModel<EntityEnum.BILLI
|
|
|
60
61
|
reimbursementExpense?: ReimbursementExpenseEntityModel[];
|
|
61
62
|
bank?: BankEntityModel[];
|
|
62
63
|
billingTimesheets?: BillingTimesheetEntityModel[];
|
|
64
|
+
billingTransactions?: BillingTransactionEntityModel[];
|
|
63
65
|
static relationConfigs: RelationConfigs<[
|
|
64
66
|
EntityEnum.PROJECT,
|
|
65
67
|
EntityEnum.CLIENT,
|
|
@@ -67,7 +69,8 @@ export declare class BillingEntityModel extends BaseEntityModel<EntityEnum.BILLI
|
|
|
67
69
|
EntityEnum.REIMBURSEMENT_EXPENSE,
|
|
68
70
|
EntityEnum.BILLING_REIMBURSEMENT_EXPENSE,
|
|
69
71
|
EntityEnum.BILLING_TIMESHEET,
|
|
70
|
-
EntityEnum.BANK
|
|
72
|
+
EntityEnum.BANK,
|
|
73
|
+
EntityEnum.BILLING_TRANSACTION
|
|
71
74
|
], EnumEntityType<EntityEnum.BILLING>>;
|
|
72
75
|
static fromEntity(entity: IBillingEntity): BillingEntityModel;
|
|
73
76
|
getStatusCategory(): BillingStatusCategoryEnumForUI;
|
|
@@ -244,4 +244,13 @@ BillingEntityModel.relationConfigs = [
|
|
|
244
244
|
key: "bankId",
|
|
245
245
|
},
|
|
246
246
|
},
|
|
247
|
+
{
|
|
248
|
+
name: entity_utils_interface_1.EntityEnum.BILLING_TRANSACTION,
|
|
249
|
+
relation: relation_type_enum_1.RelationType.MANY,
|
|
250
|
+
key: "billingTransactions",
|
|
251
|
+
mapKeyConfig: {
|
|
252
|
+
relationKey: "billingId",
|
|
253
|
+
key: "id",
|
|
254
|
+
},
|
|
255
|
+
},
|
|
247
256
|
];
|