law-common 10.72.14-beta.2 → 10.72.14
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/index.d.ts +2 -0
- package/dist/src/api/index.js +2 -0
- package/dist/src/api/interface/entity_history.create.dto.interface.d.ts +5 -0
- package/dist/src/api/interface/entity_history.create.dto.interface.js +2 -0
- package/dist/src/api/interface/entity_history.update.dto.interface.d.ts +10 -0
- package/dist/src/api/interface/entity_history.update.dto.interface.js +2 -0
- package/dist/src/entities/enums/entity_history_action.enum.d.ts +5 -0
- package/dist/src/entities/enums/entity_history_action.enum.js +9 -0
- package/dist/src/entities/enums/entity_history_operation_enum.d.ts +5 -0
- package/dist/src/entities/enums/entity_history_operation_enum.js +9 -0
- package/dist/src/entities/enums/entity_history_status_enum.d.ts +5 -0
- package/dist/src/entities/enums/entity_history_status_enum.js +9 -0
- package/dist/src/entities/flow-configs/entity_history_flow.config.d.ts +6 -0
- package/dist/src/entities/flow-configs/entity_history_flow.config.js +88 -0
- package/dist/src/entities/index.d.ts +6 -0
- package/dist/src/entities/index.js +6 -0
- package/dist/src/entities/interface/entity.utils.interface.d.ts +6 -3
- package/dist/src/entities/interface/entity.utils.interface.js +1 -0
- package/dist/src/entities/interface/entity_history.entity.interface.d.ts +11 -0
- package/dist/src/entities/interface/entity_history.entity.interface.js +2 -0
- package/dist/src/entities/model/entity.model.interface.js +2 -0
- package/dist/src/entities/model/entity_history.entity.model.d.ts +37 -0
- package/dist/src/entities/model/entity_history.entity.model.js +94 -0
- package/package.json +1 -1
package/dist/src/api/index.d.ts
CHANGED
|
@@ -95,3 +95,5 @@ export * from "./interface/client_quote.update.dto.interface";
|
|
|
95
95
|
export * from "./interface/client_quote_rate.create.dto.interface";
|
|
96
96
|
export * from "./interface/client_quote_rate.update.dto.interface";
|
|
97
97
|
export * from "./interface/project-revenue-split.create.dto";
|
|
98
|
+
export * from "./interface/entity_history.create.dto.interface";
|
|
99
|
+
export * from "./interface/entity_history.update.dto.interface";
|
package/dist/src/api/index.js
CHANGED
|
@@ -115,3 +115,5 @@ __exportStar(require("./interface/client_quote.update.dto.interface"), exports);
|
|
|
115
115
|
__exportStar(require("./interface/client_quote_rate.create.dto.interface"), exports);
|
|
116
116
|
__exportStar(require("./interface/client_quote_rate.update.dto.interface"), exports);
|
|
117
117
|
__exportStar(require("./interface/project-revenue-split.create.dto"), exports);
|
|
118
|
+
__exportStar(require("./interface/entity_history.create.dto.interface"), exports);
|
|
119
|
+
__exportStar(require("./interface/entity_history.update.dto.interface"), exports);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IEntityCreateDto } from "../../entities";
|
|
2
|
+
import { IEntityHistoryEntity } from "../../entities/interface/entity_history.entity.interface";
|
|
3
|
+
export type IEntityHistoryCreateExclude = never;
|
|
4
|
+
export interface IEntityHistoryCreateDto extends Omit<IEntityCreateDto<IEntityHistoryEntity>, IEntityHistoryCreateExclude> {
|
|
5
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DeepPartialButRequired } from "./api.utils.interface";
|
|
2
|
+
import { IEntityHistoryCreateDto } from "./entity_history.create.dto.interface";
|
|
3
|
+
import { EntityHistoryActionEnum } from "../../entities/enums/entity_history_action.enum";
|
|
4
|
+
export type IEntityHistoryUpdateDto = DeepPartialButRequired<IEntityHistoryCreateDto, never> & {
|
|
5
|
+
actionData: IEntityHistoryActionDataDto;
|
|
6
|
+
};
|
|
7
|
+
export interface IEntityHistoryActionDataDto {
|
|
8
|
+
action: EntityHistoryActionEnum;
|
|
9
|
+
remark?: string;
|
|
10
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EntityHistoryActionEnum = void 0;
|
|
4
|
+
var EntityHistoryActionEnum;
|
|
5
|
+
(function (EntityHistoryActionEnum) {
|
|
6
|
+
EntityHistoryActionEnum["CREATE"] = "CREATE";
|
|
7
|
+
EntityHistoryActionEnum["UPDATE"] = "UPDATE";
|
|
8
|
+
EntityHistoryActionEnum["DELETE"] = "DELETE";
|
|
9
|
+
})(EntityHistoryActionEnum || (exports.EntityHistoryActionEnum = EntityHistoryActionEnum = {}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EntityHistoryOperationEnum = void 0;
|
|
4
|
+
var EntityHistoryOperationEnum;
|
|
5
|
+
(function (EntityHistoryOperationEnum) {
|
|
6
|
+
EntityHistoryOperationEnum["CREATE"] = "CREATE";
|
|
7
|
+
EntityHistoryOperationEnum["UPDATE"] = "UPDATE";
|
|
8
|
+
EntityHistoryOperationEnum["DELETE"] = "DELETE";
|
|
9
|
+
})(EntityHistoryOperationEnum || (exports.EntityHistoryOperationEnum = EntityHistoryOperationEnum = {}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EntityHistoryStatusEnum = void 0;
|
|
4
|
+
var EntityHistoryStatusEnum;
|
|
5
|
+
(function (EntityHistoryStatusEnum) {
|
|
6
|
+
EntityHistoryStatusEnum["CREATED"] = "CREATED";
|
|
7
|
+
EntityHistoryStatusEnum["UPDATED"] = "UPDATED";
|
|
8
|
+
EntityHistoryStatusEnum["DELETED"] = "DELETED";
|
|
9
|
+
})(EntityHistoryStatusEnum || (exports.EntityHistoryStatusEnum = EntityHistoryStatusEnum = {}));
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { EntityHistoryActionEnum } from "../enums/entity_history_action.enum";
|
|
2
|
+
import { EntityHistoryStatusEnum } from "../enums/entity_history_status_enum";
|
|
3
|
+
import { FlowConfig } from "./flow-config.type";
|
|
4
|
+
export interface IEntityHistoryFlowConfigContextData {
|
|
5
|
+
}
|
|
6
|
+
export declare const entityHistoryFlowConfig: FlowConfig<EntityHistoryStatusEnum, EntityHistoryActionEnum, IEntityHistoryFlowConfigContextData>;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.entityHistoryFlowConfig = void 0;
|
|
4
|
+
// import { EntityHistoryActionEnum } from "../../api";
|
|
5
|
+
// import { EntityHistoryStatusEnum } from "../enums/ENTITY_HISTORY_status_enum";
|
|
6
|
+
const entity_history_action_enum_1 = require("../enums/entity_history_action.enum");
|
|
7
|
+
const entity_history_status_enum_1 = require("../enums/entity_history_status_enum");
|
|
8
|
+
/**
|
|
9
|
+
* State Flow Configuration - Status transition rules for state master.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* // Simple transition (fixed target status)
|
|
13
|
+
* createActionConfig(EntityHistoryStatusEnum.INACTIVE, EntityHistoryActionEnum.DELETE)
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* // Function-based transition (choose one of possible statuses via context data)
|
|
17
|
+
* // Note: this example uses an extended context shape for illustration.
|
|
18
|
+
* type IExtendedContext = IEntityHistoryFlowConfigContextData & { nextStatus?: EntityHistoryStatusEnum };
|
|
19
|
+
* const transitionWithContext = (context: IExtendedContext) =>
|
|
20
|
+
* context.nextStatus === EntityHistoryStatusEnum.DEACTIVE ? EntityHistoryStatusEnum.DEACTIVE : EntityHistoryStatusEnum.ACTIVE;
|
|
21
|
+
* createActionConfig(transitionWithContext, EntityHistoryActionEnum.EDIT)
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* // Subset transition — restricts the valid next statuses for a specific (currentStatus, action) pair.
|
|
25
|
+
* //
|
|
26
|
+
* // EntityHistoryActionStatusMap says EDIT can go to: ACTIVE | DEACTIVE | INACTIVE (globally).
|
|
27
|
+
* // But from ACTIVE status, EDIT should only allow ACTIVE or DEACTIVE (not INACTIVE).
|
|
28
|
+
* // The Subset type parameter enforces this narrowing at compile time.
|
|
29
|
+
* //
|
|
30
|
+
* // TypeScript will reject any value outside the declared Subset:
|
|
31
|
+
* // createActionConfig<EntityHistoryActionEnum.EDIT, EntityHistoryStatusEnum.ACTIVE | EntityHistoryStatusEnum.DEACTIVE>(
|
|
32
|
+
* // EntityHistoryStatusEnum.INACTIVE, // ❌ compile error — INACTIVE not in Subset
|
|
33
|
+
* // EntityHistoryActionEnum.EDIT
|
|
34
|
+
* // )
|
|
35
|
+
* //
|
|
36
|
+
* // Correct usage with a fixed subset value:
|
|
37
|
+
* createActionConfig<EntityHistoryActionEnum.EDIT, EntityHistoryStatusEnum.ACTIVE | EntityHistoryStatusEnum.DEACTIVE>(
|
|
38
|
+
* EntityHistoryStatusEnum.ACTIVE,
|
|
39
|
+
* EntityHistoryActionEnum.EDIT
|
|
40
|
+
* )
|
|
41
|
+
* //
|
|
42
|
+
* // Correct usage with a context-driven subset function:
|
|
43
|
+
* type IExtendedContext2 = IEntityHistoryFlowConfigContextData & { deactivate?: boolean };
|
|
44
|
+
* createActionConfig<EntityHistoryActionEnum.EDIT, EntityHistoryStatusEnum.ACTIVE | EntityHistoryStatusEnum.DEACTIVE>(
|
|
45
|
+
* (context: IExtendedContext2) =>
|
|
46
|
+
* context.deactivate ? EntityHistoryStatusEnum.DEACTIVE : EntityHistoryStatusEnum.ACTIVE,
|
|
47
|
+
* EntityHistoryActionEnum.EDIT
|
|
48
|
+
* )
|
|
49
|
+
*/
|
|
50
|
+
const ENTITY_HISTORY_CREATE_PERMISSION = ["ENTITY_HISTORY_CREATE"];
|
|
51
|
+
const ENTITY_HISTORY_UPDATE_PERMISSION = ["ENTITY_HISTORY_UPDATE"];
|
|
52
|
+
const ENTITY_HISTORY_DELETE_PERMISSION = ["ENTITY_HISTORY_DELETE"];
|
|
53
|
+
const createTransition = (transition) => (context) => {
|
|
54
|
+
if (typeof transition === "function") {
|
|
55
|
+
return transition(context);
|
|
56
|
+
}
|
|
57
|
+
return transition;
|
|
58
|
+
};
|
|
59
|
+
const actionPermissionMap = {
|
|
60
|
+
[entity_history_action_enum_1.EntityHistoryActionEnum.CREATE]: ENTITY_HISTORY_CREATE_PERMISSION,
|
|
61
|
+
[entity_history_action_enum_1.EntityHistoryActionEnum.UPDATE]: ENTITY_HISTORY_UPDATE_PERMISSION,
|
|
62
|
+
[entity_history_action_enum_1.EntityHistoryActionEnum.DELETE]: ENTITY_HISTORY_DELETE_PERMISSION,
|
|
63
|
+
};
|
|
64
|
+
const createActionConfig = (nextStatus, action, overridePermissions) => ({
|
|
65
|
+
permissions: overridePermissions !== null && overridePermissions !== void 0 ? overridePermissions : actionPermissionMap[action],
|
|
66
|
+
next: createTransition(nextStatus),
|
|
67
|
+
});
|
|
68
|
+
// const transitionActiveStatusEditAction = (context: IEntityHistoryFlowConfigContextData): EntityHistoryStatusEnum.DEACTIVE | EntityHistoryStatusEnum.ACTIVE =>
|
|
69
|
+
// EntityHistoryStatusEnum.DEACTIVE;
|
|
70
|
+
exports.entityHistoryFlowConfig = {
|
|
71
|
+
[entity_history_status_enum_1.EntityHistoryStatusEnum.CREATED]: {
|
|
72
|
+
actions: {
|
|
73
|
+
[entity_history_action_enum_1.EntityHistoryActionEnum.UPDATE]: createActionConfig(entity_history_status_enum_1.EntityHistoryStatusEnum.UPDATED, entity_history_action_enum_1.EntityHistoryActionEnum.UPDATE),
|
|
74
|
+
[entity_history_action_enum_1.EntityHistoryActionEnum.DELETE]: createActionConfig(entity_history_status_enum_1.EntityHistoryStatusEnum.DELETED, entity_history_action_enum_1.EntityHistoryActionEnum.DELETE),
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
[entity_history_status_enum_1.EntityHistoryStatusEnum.UPDATED]: {
|
|
78
|
+
actions: {
|
|
79
|
+
[entity_history_action_enum_1.EntityHistoryActionEnum.UPDATE]: createActionConfig(entity_history_status_enum_1.EntityHistoryStatusEnum.UPDATED, entity_history_action_enum_1.EntityHistoryActionEnum.UPDATE),
|
|
80
|
+
[entity_history_action_enum_1.EntityHistoryActionEnum.DELETE]: createActionConfig(entity_history_status_enum_1.EntityHistoryStatusEnum.DELETED, entity_history_action_enum_1.EntityHistoryActionEnum.DELETE),
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
[entity_history_status_enum_1.EntityHistoryStatusEnum.DELETED]: {
|
|
84
|
+
actions: {
|
|
85
|
+
[entity_history_action_enum_1.EntityHistoryActionEnum.UPDATE]: createActionConfig(entity_history_status_enum_1.EntityHistoryStatusEnum.UPDATED, entity_history_action_enum_1.EntityHistoryActionEnum.UPDATE),
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
};
|
|
@@ -211,3 +211,9 @@ export * from "./enums/project-revenue-split.enum";
|
|
|
211
211
|
export * from "./interface/project-revenue-split-mapping.entity";
|
|
212
212
|
export * from "./model/project-revenue-split-mapping.model";
|
|
213
213
|
export * from "./flow-configs/billing-transaction.flow.config";
|
|
214
|
+
export * from "./enums/entity_history_action.enum";
|
|
215
|
+
export * from "./enums/entity_history_operation_enum";
|
|
216
|
+
export * from "./enums/entity_history_status_enum";
|
|
217
|
+
export * from "./interface/entity_history.entity.interface";
|
|
218
|
+
export * from "./flow-configs/entity_history_flow.config";
|
|
219
|
+
export * from "./model/entity_history.entity.model";
|
|
@@ -227,3 +227,9 @@ __exportStar(require("./enums/project-revenue-split.enum"), exports);
|
|
|
227
227
|
__exportStar(require("./interface/project-revenue-split-mapping.entity"), exports);
|
|
228
228
|
__exportStar(require("./model/project-revenue-split-mapping.model"), exports);
|
|
229
229
|
__exportStar(require("./flow-configs/billing-transaction.flow.config"), exports);
|
|
230
|
+
__exportStar(require("./enums/entity_history_action.enum"), exports);
|
|
231
|
+
__exportStar(require("./enums/entity_history_operation_enum"), exports);
|
|
232
|
+
__exportStar(require("./enums/entity_history_status_enum"), exports);
|
|
233
|
+
__exportStar(require("./interface/entity_history.entity.interface"), exports);
|
|
234
|
+
__exportStar(require("./flow-configs/entity_history_flow.config"), exports);
|
|
235
|
+
__exportStar(require("./model/entity_history.entity.model"), exports);
|
|
@@ -27,6 +27,7 @@ import { CountryEntityModel } from "../model/country.entity.model";
|
|
|
27
27
|
import { CronJobsEntityModel } from "../model/cron_jobs.entity.model";
|
|
28
28
|
import { DesignationEntityModel } from "../model/designation.entity.model";
|
|
29
29
|
import { DocumentUploadEntityModel } from "../model/document_upload.entity.model";
|
|
30
|
+
import { EntityHistoryEntityModel } from "../model/entity_history.entity.model";
|
|
30
31
|
import { ExpenseHeadEntityModel } from "../model/expense_head.entity.model";
|
|
31
32
|
import { ExpenseTypeEntityModel } from "../model/expense_type.entity.model";
|
|
32
33
|
import { GstRateEntityModel } from "../model/gst_rate.entity.model";
|
|
@@ -93,6 +94,7 @@ import { ICronJobsEntity } from "./cron-job.entity.interface";
|
|
|
93
94
|
import { IDesignationEntity } from "./designation.entity.interface";
|
|
94
95
|
import { IDocumentUploadEntity } from "./document_upload.entity.interface";
|
|
95
96
|
import { IEntityAuditColumn } from "./entity-audit-columns.interface";
|
|
97
|
+
import { IEntityHistoryEntity } from "./entity_history.entity.interface";
|
|
96
98
|
import { IExpenseHeadEntity } from "./expense_head.entity.interface";
|
|
97
99
|
import { IExpenseTypeEntity } from "./expense_type.entity.interface";
|
|
98
100
|
import { IGstRateEntity } from "./gst_rate.entity.interface";
|
|
@@ -237,7 +239,8 @@ export declare enum EntityEnum {
|
|
|
237
239
|
VENDOR_INVOICE_ITEM_HISTORY = "vendor_invoice_item_history",
|
|
238
240
|
VENDOR_HISTORY = "vendor_history",
|
|
239
241
|
CLIENT_QUOTE = "client_quote",
|
|
240
|
-
CLIENT_QUOTE_RATE = "client_quote_rate"
|
|
242
|
+
CLIENT_QUOTE_RATE = "client_quote_rate",
|
|
243
|
+
ENTITY_HISTORY = "entity_history"
|
|
241
244
|
}
|
|
242
245
|
export type EntityRelations = {
|
|
243
246
|
[K in EntityEnum | VirtualEntityEnum]: K;
|
|
@@ -262,7 +265,7 @@ export type IBaseEntityApiResponse<T> = {
|
|
|
262
265
|
[key in EntityEnum | VirtualEntityEnum]?: AggregationFields<EnumToModel<key>>[];
|
|
263
266
|
};
|
|
264
267
|
};
|
|
265
|
-
export type EnumEntityType<T extends EntityEnum | VirtualEntityEnum> = (T extends EntityEnum.BILLING ? IBillingEntity : T extends EntityEnum.BILLING_HISTORY ? IBillingHistoryEntity : T extends EntityEnum.BILLING_TIMESHEET ? IBillingTimesheetEntity : T extends EntityEnum.BILLING_REIMBURSEMENT_EXPENSE ? IBillingReimbursementExpenseEntity : T extends EntityEnum.BILLING_TIMESHEET_HISTORY ? IBillingTimesheetHistoryEntity : T extends EntityEnum.BILLING_REIMBURESMENT_EXPENSE_HISTORY ? IBillingReimbursementExpenseHistoryEntity : 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_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.REIMBURSEMENT_HISTORY ? IReimbursementHistoryEntity : 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.CLIENT_INTRODUCING_MAPPING ? IClientIntroducingMappingEntity : 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 : T extends EntityEnum.ADDRESS_BOOK ? IAddressBookEntity : T extends EntityEnum.STATE ? IStateEntity : T extends EntityEnum.GST_RATE ? IGstRateEntity : T extends EntityEnum.ORGANIZATION_TYPE ? IOrganizationTypeEntity : T extends EntityEnum.TDS_RATE ? ITdsRateEntity : T extends EntityEnum.ORGANIZATION_TYPE_TDS_RATE_MAPPING ? IOrganizationTypeTdsRateMappingEntity : T extends EntityEnum.VOUCHER_TYPE ? IVoucherTypeEntity : T extends EntityEnum.TDS_RATE_VOUCHER_TYPE_MAPPING ? ITdsRateVoucherTypeMappingEntity : T extends EntityEnum.EXPENSE_HEAD ? IExpenseHeadEntity : T extends EntityEnum.DOCUMENT_UPLOAD ? IDocumentUploadEntity : T extends EntityEnum.VENDOR ? IVendorEntity : T extends EntityEnum.VENDOR_INVOICE ? IVendorInvoiceEntity : T extends EntityEnum.VENDOR_INVOICE_HISTORY ? IVendorInvoiceHistoryEntity : T extends EntityEnum.VENDOR_INVOICE_HISTORY ? IVendorInvoiceHistoryEntity : T extends EntityEnum.VENDOR_INVOICE_ITEM ? IVendorInvoiceItemEntity : T extends EntityEnum.VENDOR_INVOICE_ITEM_HISTORY ? IVendorInvoiceItemHistoryEntity : T extends EntityEnum.VENDOR_HISTORY ? IVendorHistoryEntity : T extends EntityEnum.WEBSITE_LEAD ? IWebsiteLeadEntity : T extends EntityEnum.WEBSITE_NEWSLETTER_SUBSCRIPTION ? IWebsiteNewsletterSubscriptionEntity : T extends EntityEnum.CLIENT_QUOTE ? IClientQuoteEntity : T extends EntityEnum.CLIENT_QUOTE_RATE ? IClientQuoteRateEntity : T extends EntityEnum.BILLING_PROFILE ? IBillingProfileEntity : T extends EntityEnum.PROJECT_REVENUE_SPLIT_MAPPING ? IProjectRevenueSplitMappingEntity : T extends EntityEnum.VENDOR_INVOICE_ITEM_HISTORY ? IVendorInvoiceItemHistoryEntity : T extends EntityEnum.VENDOR_HISTORY ? IVendorHistoryEntity : T extends EntityEnum.WEBSITE_LEAD ? IWebsiteLeadEntity : T extends EntityEnum.WEBSITE_NEWSLETTER_SUBSCRIPTION ? IWebsiteNewsletterSubscriptionEntity : T extends EntityEnum.CLIENT_QUOTE ? IClientQuoteEntity : T extends EntityEnum.CLIENT_QUOTE_RATE ? IClientQuoteRateEntity : never) & {
|
|
268
|
+
export type EnumEntityType<T extends EntityEnum | VirtualEntityEnum> = (T extends EntityEnum.BILLING ? IBillingEntity : T extends EntityEnum.BILLING_HISTORY ? IBillingHistoryEntity : T extends EntityEnum.BILLING_TIMESHEET ? IBillingTimesheetEntity : T extends EntityEnum.BILLING_REIMBURSEMENT_EXPENSE ? IBillingReimbursementExpenseEntity : T extends EntityEnum.BILLING_TIMESHEET_HISTORY ? IBillingTimesheetHistoryEntity : T extends EntityEnum.BILLING_REIMBURESMENT_EXPENSE_HISTORY ? IBillingReimbursementExpenseHistoryEntity : 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_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.REIMBURSEMENT_HISTORY ? IReimbursementHistoryEntity : 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.CLIENT_INTRODUCING_MAPPING ? IClientIntroducingMappingEntity : 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 : T extends EntityEnum.ADDRESS_BOOK ? IAddressBookEntity : T extends EntityEnum.STATE ? IStateEntity : T extends EntityEnum.GST_RATE ? IGstRateEntity : T extends EntityEnum.ORGANIZATION_TYPE ? IOrganizationTypeEntity : T extends EntityEnum.TDS_RATE ? ITdsRateEntity : T extends EntityEnum.ORGANIZATION_TYPE_TDS_RATE_MAPPING ? IOrganizationTypeTdsRateMappingEntity : T extends EntityEnum.VOUCHER_TYPE ? IVoucherTypeEntity : T extends EntityEnum.TDS_RATE_VOUCHER_TYPE_MAPPING ? ITdsRateVoucherTypeMappingEntity : T extends EntityEnum.EXPENSE_HEAD ? IExpenseHeadEntity : T extends EntityEnum.DOCUMENT_UPLOAD ? IDocumentUploadEntity : T extends EntityEnum.VENDOR ? IVendorEntity : T extends EntityEnum.VENDOR_INVOICE ? IVendorInvoiceEntity : T extends EntityEnum.VENDOR_INVOICE_HISTORY ? IVendorInvoiceHistoryEntity : T extends EntityEnum.VENDOR_INVOICE_HISTORY ? IVendorInvoiceHistoryEntity : T extends EntityEnum.VENDOR_INVOICE_ITEM ? IVendorInvoiceItemEntity : T extends EntityEnum.VENDOR_INVOICE_ITEM_HISTORY ? IVendorInvoiceItemHistoryEntity : T extends EntityEnum.VENDOR_HISTORY ? IVendorHistoryEntity : T extends EntityEnum.WEBSITE_LEAD ? IWebsiteLeadEntity : T extends EntityEnum.WEBSITE_NEWSLETTER_SUBSCRIPTION ? IWebsiteNewsletterSubscriptionEntity : T extends EntityEnum.CLIENT_QUOTE ? IClientQuoteEntity : T extends EntityEnum.CLIENT_QUOTE_RATE ? IClientQuoteRateEntity : T extends EntityEnum.BILLING_PROFILE ? IBillingProfileEntity : T extends EntityEnum.PROJECT_REVENUE_SPLIT_MAPPING ? IProjectRevenueSplitMappingEntity : T extends EntityEnum.VENDOR_INVOICE_ITEM_HISTORY ? IVendorInvoiceItemHistoryEntity : T extends EntityEnum.VENDOR_HISTORY ? IVendorHistoryEntity : T extends EntityEnum.WEBSITE_LEAD ? IWebsiteLeadEntity : T extends EntityEnum.WEBSITE_NEWSLETTER_SUBSCRIPTION ? IWebsiteNewsletterSubscriptionEntity : T extends EntityEnum.CLIENT_QUOTE ? IClientQuoteEntity : T extends EntityEnum.CLIENT_QUOTE_RATE ? IClientQuoteRateEntity : T extends EntityEnum.ENTITY_HISTORY ? IEntityHistoryEntity : never) & {
|
|
266
269
|
id: number;
|
|
267
270
|
};
|
|
268
271
|
export type EntityRelationConfig<T extends EntityEnum | VirtualEntityEnum> = {
|
|
@@ -388,7 +391,7 @@ export declare enum VirtualEntityEnum {
|
|
|
388
391
|
}
|
|
389
392
|
export type IHistoryConstraintSearchResponse<T> = IBaseResponse<IHistoryEntitySearchByConstraintResponse<T>[]>;
|
|
390
393
|
export type IHistoryConstraintSearchServiceResponse<T> = IHistoryEntitySearchByConstraintResponse<T>[];
|
|
391
|
-
export type EnumToModel<T extends EntityEnum | VirtualEntityEnum> = T extends EntityEnum.BILLING ? BillingEntityModel : T extends EntityEnum.BILLING_HISTORY ? BillingHistoryEntityModel : T extends EntityEnum.CLIENT ? ClientEntityModel : T extends EntityEnum.INTERMEDIARY_BANK ? IntermediaryBankEntityModel : 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.BILLING_REIMBURESMENT_EXPENSE_HISTORY ? BillingReimbursementExpenseHistoryEntityModel : T extends EntityEnum.LEAVE ? LeaveEntityModel : T extends EntityEnum.WORK_FROM_HOME ? WorkFromHomeEntityModel : 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.BILLING_TIMESHEET_HISTORY ? BillingTimesheetHistoryEntityModel : T extends EntityEnum.TIMESHEET ? TimesheetEntityModel : T extends EntityEnum.TIMESHEET_HISTORY ? TimesheetHistoryEntityModel : T extends EntityEnum.COUNTRY ? CountryEntityModel : T extends EntityEnum.BILLING_TRANSACTION ? BillingTransactionEntityModel : T extends EntityEnum.BILLING_TRANSACTION_HISTORY ? BillingTransactionHistoryEntityModel : T extends EntityEnum.ADDRESS_BOOK ? AddressBookEntityModel : T extends EntityEnum.STATE ? StateEntityModel : T extends EntityEnum.GST_RATE ? GstRateEntityModel : T extends EntityEnum.ORGANIZATION_TYPE ? OrganizationTypeEntityModel : T extends EntityEnum.TDS_RATE ? TdsRateEntityModel : T extends EntityEnum.ORGANIZATION_TYPE_TDS_RATE_MAPPING ? OrganizationTypeTdsRateMappingEntityModel : T extends EntityEnum.VOUCHER_TYPE ? VoucherTypeEntityModel : T extends EntityEnum.TDS_RATE_VOUCHER_TYPE_MAPPING ? TdsRateVoucherTypeMappingEntityModel : T extends EntityEnum.ORGANIZATION ? OrganizationEntityModel : T extends EntityEnum.INDUSTRY ? IndustryEntityModel : T extends EntityEnum.EXPENSE_TYPE ? ExpenseTypeEntityModel : T extends EntityEnum.DESIGNATION ? DesignationEntityModel : T extends EntityEnum.RATE ? RateEntityModel : T extends EntityEnum.ROLE ? RoleEntityModel : T extends EntityEnum.ROLE_PERMISSION_MAPPING ? RolePermissionMappingEntityModel : T extends EntityEnum.PERMISSION ? PermissionEntityModel : T extends EntityEnum.EXPENSE_HEAD ? ExpenseHeadEntityModel : T extends EntityEnum.DOCUMENT_UPLOAD ? DocumentUploadEntityModel : T extends EntityEnum.VENDOR ? VendorEntityModel : T extends EntityEnum.VENDOR_INVOICE ? VendorInvoiceEntityModel : T extends EntityEnum.VENDOR_INVOICE_HISTORY ? VendorInvoiceHistoryEntityModel : T extends EntityEnum.OFFICE_LOCATION ? OfficeLocationEntityModel : T extends EntityEnum.VENDOR_INVOICE_ITEM ? VendorInvoiceItemEntityModel : T extends EntityEnum.VENDOR_INVOICE_ITEM_HISTORY ? VendorInvoiceItemHistoryEntityModel : T extends EntityEnum.VENDOR_HISTORY ? VendorHistoryEntityModel : T extends EntityEnum.WEBSITE_LEAD ? WebsiteLeadEntityModel : T extends EntityEnum.WEBSITE_NEWSLETTER_SUBSCRIPTION ? WebsiteNewsletterSubscriptionEntityModel : T extends EntityEnum.WORK_FROM_HOME_HISTORY ? WorkFromHomeHistoryEntityModel : T extends EntityEnum.LEAVE_HISTORY ? LeaveHistoryEntityModel : T extends EntityEnum.BANK_HISTORY ? BankHistoryEntityModel : T extends EntityEnum.REIMBURSEMENT_HISTORY ? ReimbursementHistoryEntityModel : T extends EntityEnum.CLIENT_USER_MAPPING ? ClientUserMappingEntityModel : T extends EntityEnum.CLIENT_INTRODUCING_MAPPING ? ClientIntroducingMappingEntityModel : T extends EntityEnum.HOLIDAY_LIST ? HolidayListEntityModel : T extends EntityEnum.CRON_JOBS ? CronJobsEntityModel : T extends EntityEnum.TO_DO_LIST ? ToDoListEntityModel : T extends EntityEnum.CLIENT_QUOTE ? ClientQuoteEntityModel : T extends EntityEnum.CLIENT_QUOTE_RATE ? ClientQuoteRateEntityModel : T extends EntityEnum.BILLING_PROFILE ? BillingProfileEntityModel : T extends EntityEnum.PROJECT_REVENUE_SPLIT_MAPPING ? ProjectRevenueSplitMappingEntityModel : T extends EntityEnum.WEBSITE_LEAD ? WebsiteLeadEntityModel : T extends EntityEnum.WEBSITE_NEWSLETTER_SUBSCRIPTION ? WebsiteNewsletterSubscriptionEntityModel : T extends EntityEnum.CLIENT_QUOTE ? ClientQuoteEntityModel : T extends EntityEnum.CLIENT_QUOTE_RATE ? ClientQuoteRateEntityModel : T extends EntityEnum.DESIGNATION ? DesignationEntityModel : T extends EntityEnum.RATE ? RateEntityModel : UserEntityModel;
|
|
394
|
+
export type EnumToModel<T extends EntityEnum | VirtualEntityEnum> = T extends EntityEnum.BILLING ? BillingEntityModel : T extends EntityEnum.BILLING_HISTORY ? BillingHistoryEntityModel : T extends EntityEnum.CLIENT ? ClientEntityModel : T extends EntityEnum.INTERMEDIARY_BANK ? IntermediaryBankEntityModel : 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.BILLING_REIMBURESMENT_EXPENSE_HISTORY ? BillingReimbursementExpenseHistoryEntityModel : T extends EntityEnum.LEAVE ? LeaveEntityModel : T extends EntityEnum.WORK_FROM_HOME ? WorkFromHomeEntityModel : 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.BILLING_TIMESHEET_HISTORY ? BillingTimesheetHistoryEntityModel : T extends EntityEnum.TIMESHEET ? TimesheetEntityModel : T extends EntityEnum.TIMESHEET_HISTORY ? TimesheetHistoryEntityModel : T extends EntityEnum.COUNTRY ? CountryEntityModel : T extends EntityEnum.BILLING_TRANSACTION ? BillingTransactionEntityModel : T extends EntityEnum.BILLING_TRANSACTION_HISTORY ? BillingTransactionHistoryEntityModel : T extends EntityEnum.ADDRESS_BOOK ? AddressBookEntityModel : T extends EntityEnum.STATE ? StateEntityModel : T extends EntityEnum.GST_RATE ? GstRateEntityModel : T extends EntityEnum.ORGANIZATION_TYPE ? OrganizationTypeEntityModel : T extends EntityEnum.TDS_RATE ? TdsRateEntityModel : T extends EntityEnum.ORGANIZATION_TYPE_TDS_RATE_MAPPING ? OrganizationTypeTdsRateMappingEntityModel : T extends EntityEnum.VOUCHER_TYPE ? VoucherTypeEntityModel : T extends EntityEnum.TDS_RATE_VOUCHER_TYPE_MAPPING ? TdsRateVoucherTypeMappingEntityModel : T extends EntityEnum.ORGANIZATION ? OrganizationEntityModel : T extends EntityEnum.INDUSTRY ? IndustryEntityModel : T extends EntityEnum.EXPENSE_TYPE ? ExpenseTypeEntityModel : T extends EntityEnum.DESIGNATION ? DesignationEntityModel : T extends EntityEnum.RATE ? RateEntityModel : T extends EntityEnum.ROLE ? RoleEntityModel : T extends EntityEnum.ROLE_PERMISSION_MAPPING ? RolePermissionMappingEntityModel : T extends EntityEnum.PERMISSION ? PermissionEntityModel : T extends EntityEnum.EXPENSE_HEAD ? ExpenseHeadEntityModel : T extends EntityEnum.DOCUMENT_UPLOAD ? DocumentUploadEntityModel : T extends EntityEnum.VENDOR ? VendorEntityModel : T extends EntityEnum.VENDOR_INVOICE ? VendorInvoiceEntityModel : T extends EntityEnum.VENDOR_INVOICE_HISTORY ? VendorInvoiceHistoryEntityModel : T extends EntityEnum.OFFICE_LOCATION ? OfficeLocationEntityModel : T extends EntityEnum.VENDOR_INVOICE_ITEM ? VendorInvoiceItemEntityModel : T extends EntityEnum.VENDOR_INVOICE_ITEM_HISTORY ? VendorInvoiceItemHistoryEntityModel : T extends EntityEnum.VENDOR_HISTORY ? VendorHistoryEntityModel : T extends EntityEnum.WEBSITE_LEAD ? WebsiteLeadEntityModel : T extends EntityEnum.WEBSITE_NEWSLETTER_SUBSCRIPTION ? WebsiteNewsletterSubscriptionEntityModel : T extends EntityEnum.WORK_FROM_HOME_HISTORY ? WorkFromHomeHistoryEntityModel : T extends EntityEnum.LEAVE_HISTORY ? LeaveHistoryEntityModel : T extends EntityEnum.BANK_HISTORY ? BankHistoryEntityModel : T extends EntityEnum.REIMBURSEMENT_HISTORY ? ReimbursementHistoryEntityModel : T extends EntityEnum.CLIENT_USER_MAPPING ? ClientUserMappingEntityModel : T extends EntityEnum.CLIENT_INTRODUCING_MAPPING ? ClientIntroducingMappingEntityModel : T extends EntityEnum.HOLIDAY_LIST ? HolidayListEntityModel : T extends EntityEnum.CRON_JOBS ? CronJobsEntityModel : T extends EntityEnum.TO_DO_LIST ? ToDoListEntityModel : T extends EntityEnum.CLIENT_QUOTE ? ClientQuoteEntityModel : T extends EntityEnum.CLIENT_QUOTE_RATE ? ClientQuoteRateEntityModel : T extends EntityEnum.BILLING_PROFILE ? BillingProfileEntityModel : T extends EntityEnum.PROJECT_REVENUE_SPLIT_MAPPING ? ProjectRevenueSplitMappingEntityModel : T extends EntityEnum.WEBSITE_LEAD ? WebsiteLeadEntityModel : T extends EntityEnum.WEBSITE_NEWSLETTER_SUBSCRIPTION ? WebsiteNewsletterSubscriptionEntityModel : T extends EntityEnum.CLIENT_QUOTE ? ClientQuoteEntityModel : T extends EntityEnum.CLIENT_QUOTE_RATE ? ClientQuoteRateEntityModel : T extends EntityEnum.DESIGNATION ? DesignationEntityModel : T extends EntityEnum.RATE ? RateEntityModel : T extends EntityEnum.ENTITY_HISTORY ? EntityHistoryEntityModel : UserEntityModel;
|
|
392
395
|
export type EntityMap = {
|
|
393
396
|
[key in EntityEnum | VirtualEntityEnum]: EnumToModel<key>[];
|
|
394
397
|
} & {
|
|
@@ -98,6 +98,7 @@ var EntityEnum;
|
|
|
98
98
|
EntityEnum["VENDOR_HISTORY"] = "vendor_history";
|
|
99
99
|
EntityEnum["CLIENT_QUOTE"] = "client_quote";
|
|
100
100
|
EntityEnum["CLIENT_QUOTE_RATE"] = "client_quote_rate";
|
|
101
|
+
EntityEnum["ENTITY_HISTORY"] = "entity_history";
|
|
101
102
|
})(EntityEnum || (exports.EntityEnum = EntityEnum = {}));
|
|
102
103
|
var VirtualEntityEnum;
|
|
103
104
|
(function (VirtualEntityEnum) {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IEntityAuditColumn } from "./entity-audit-columns.interface";
|
|
2
|
+
import { EntityHistoryOperationEnum } from "../enums/entity_history_operation_enum";
|
|
3
|
+
import { EntityHistoryStatusEnum } from "../enums/entity_history_status_enum";
|
|
4
|
+
export interface IEntityHistoryEntity extends IEntityAuditColumn {
|
|
5
|
+
id: number;
|
|
6
|
+
entity: string;
|
|
7
|
+
entityId: number;
|
|
8
|
+
data: string;
|
|
9
|
+
operation: EntityHistoryOperationEnum;
|
|
10
|
+
status: EntityHistoryStatusEnum;
|
|
11
|
+
}
|
|
@@ -34,6 +34,7 @@ const country_entity_model_1 = require("./country.entity.model");
|
|
|
34
34
|
const cron_jobs_entity_model_1 = require("./cron_jobs.entity.model");
|
|
35
35
|
const designation_entity_model_1 = require("./designation.entity.model");
|
|
36
36
|
const document_upload_entity_model_1 = require("./document_upload.entity.model");
|
|
37
|
+
const entity_history_entity_model_1 = require("./entity_history.entity.model");
|
|
37
38
|
const expense_head_entity_model_1 = require("./expense_head.entity.model");
|
|
38
39
|
const expense_type_entity_model_1 = require("./expense_type.entity.model");
|
|
39
40
|
const gst_rate_entity_model_1 = require("./gst_rate.entity.model");
|
|
@@ -172,6 +173,7 @@ exports.entityEnumToEntityModel = {
|
|
|
172
173
|
[entity_utils_interface_1.EntityEnum.TO_DO_LIST]: to_do_list_entity_model_1.ToDoListEntityModel.fromEntity,
|
|
173
174
|
[entity_utils_interface_1.EntityEnum.PROJECT_REVENUE_SPLIT_MAPPING]: project_revenue_split_mapping_model_1.ProjectRevenueSplitMappingEntityModel.fromEntity,
|
|
174
175
|
[entity_utils_interface_1.EntityEnum.BILLING_PROFILE]: billing_profile_entity_model_1.BillingProfileEntityModel.fromEntity,
|
|
176
|
+
[entity_utils_interface_1.EntityEnum.ENTITY_HISTORY]: entity_history_entity_model_1.EntityHistoryEntityModel.fromEntity,
|
|
175
177
|
};
|
|
176
178
|
function entityMapToModels(entityMap) {
|
|
177
179
|
for (const entityName in entityMap) {
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { EntityEnum } from "../interface/entity.utils.interface";
|
|
2
|
+
import { BaseEntityModel } from "./base.entity.model";
|
|
3
|
+
import { RelationConfigs } from "../interface/relation-config.interface";
|
|
4
|
+
import { IUserEntity } from "../interface/user.entity.interface";
|
|
5
|
+
import { UserEntityModel } from "./user.entity.model";
|
|
6
|
+
import { IRowActions } from "./interface/row-actions.interface";
|
|
7
|
+
import { IEntityHistoryEntity } from "../interface/entity_history.entity.interface";
|
|
8
|
+
import { EntityHistoryOperationEnum } from "../enums/entity_history_operation_enum";
|
|
9
|
+
import { EntityHistoryStatusEnum } from "../enums/entity_history_status_enum";
|
|
10
|
+
import { EntityHistoryActionEnum } from "../enums/entity_history_action.enum";
|
|
11
|
+
import { IEntityHistoryFlowConfigContextData } from "../flow-configs/entity_history_flow.config";
|
|
12
|
+
export declare class EntityHistoryEntityModel extends BaseEntityModel<EntityEnum.ENTITY_HISTORY> implements IEntityHistoryEntity {
|
|
13
|
+
id: number;
|
|
14
|
+
entity: string;
|
|
15
|
+
entityId: number;
|
|
16
|
+
data: string;
|
|
17
|
+
operation: EntityHistoryOperationEnum;
|
|
18
|
+
status: EntityHistoryStatusEnum;
|
|
19
|
+
createdOn: number;
|
|
20
|
+
updatedOn: number;
|
|
21
|
+
createdBy: number;
|
|
22
|
+
updatedBy: number;
|
|
23
|
+
static relationConfigs: RelationConfigs<[], EntityEnum.ENTITY_HISTORY>;
|
|
24
|
+
static fromEntity(entity: IEntityHistoryEntity): EntityHistoryEntityModel;
|
|
25
|
+
getRelationConfigs(): any[];
|
|
26
|
+
getNextStatus(currentUser: IUserEntity, action: EntityHistoryActionEnum, entityHistoryFlowConfigContextData: IEntityHistoryFlowConfigContextData): EntityHistoryStatusEnum;
|
|
27
|
+
getAvailableActions(currentUser: UserEntityModel, config?: {
|
|
28
|
+
combinedActions?: Record<string, {
|
|
29
|
+
combineActions: EntityHistoryActionEnum[];
|
|
30
|
+
label: string;
|
|
31
|
+
}>;
|
|
32
|
+
customLabels?: Partial<Record<EntityHistoryActionEnum, string>>;
|
|
33
|
+
}): IRowActions<EntityEnum.ENTITY_HISTORY>[];
|
|
34
|
+
getUpdateActionVisibility(currentUser: UserEntityModel): {
|
|
35
|
+
[key: string]: () => boolean;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EntityHistoryEntityModel = void 0;
|
|
4
|
+
const entity_utils_interface_1 = require("../interface/entity.utils.interface");
|
|
5
|
+
const base_entity_model_1 = require("./base.entity.model");
|
|
6
|
+
const exceptions_1 = require("../../exceptions");
|
|
7
|
+
const error_key_enum_1 = require("../../enums/error.key.enum");
|
|
8
|
+
const utils_1 = require("../../utils");
|
|
9
|
+
const entity_history_operation_enum_1 = require("../enums/entity_history_operation_enum");
|
|
10
|
+
const entity_history_status_enum_1 = require("../enums/entity_history_status_enum");
|
|
11
|
+
const entity_history_flow_config_1 = require("../flow-configs/entity_history_flow.config");
|
|
12
|
+
class EntityHistoryEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this.id = 0;
|
|
16
|
+
this.entity = "";
|
|
17
|
+
this.entityId = 0;
|
|
18
|
+
this.data = "";
|
|
19
|
+
this.operation = entity_history_operation_enum_1.EntityHistoryOperationEnum.CREATE;
|
|
20
|
+
this.status = entity_history_status_enum_1.EntityHistoryStatusEnum.CREATED;
|
|
21
|
+
this.createdOn = 0;
|
|
22
|
+
this.updatedOn = 0;
|
|
23
|
+
this.createdBy = 0;
|
|
24
|
+
this.updatedBy = 0;
|
|
25
|
+
}
|
|
26
|
+
static fromEntity(entity) {
|
|
27
|
+
const result = new EntityHistoryEntityModel(entity_utils_interface_1.EntityEnum.ENTITY_HISTORY);
|
|
28
|
+
Object.assign(result, entity);
|
|
29
|
+
return result;
|
|
30
|
+
}
|
|
31
|
+
getRelationConfigs() {
|
|
32
|
+
return this.constructor.prototype.constructor.relationConfigs || [];
|
|
33
|
+
}
|
|
34
|
+
getNextStatus(currentUser, action, entityHistoryFlowConfigContextData) {
|
|
35
|
+
if (!this.status) {
|
|
36
|
+
throw new exceptions_1.AppBadRequestException({
|
|
37
|
+
key: error_key_enum_1.ErrorKeyEnum.STATUS,
|
|
38
|
+
message: [`Status not found: ${this.status}`],
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
const flowForStatus = entity_history_flow_config_1.entityHistoryFlowConfig[this.status];
|
|
42
|
+
if (!flowForStatus) {
|
|
43
|
+
throw new exceptions_1.AppBadRequestException({
|
|
44
|
+
key: error_key_enum_1.ErrorKeyEnum.STATUS,
|
|
45
|
+
message: [`No flow configuration found for status: ${this.status}`],
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
if (!action) {
|
|
49
|
+
throw new exceptions_1.AppBadRequestException({
|
|
50
|
+
key: error_key_enum_1.ErrorKeyEnum.ACTION_DATA,
|
|
51
|
+
message: ["actionData is required"],
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
const matchingPermissionConfig = flowForStatus.actions[action];
|
|
55
|
+
if (!matchingPermissionConfig) {
|
|
56
|
+
throw new exceptions_1.AppBadRequestException({
|
|
57
|
+
key: error_key_enum_1.ErrorKeyEnum.ACTION,
|
|
58
|
+
message: [`Action '${action}' is not valid for the current status.`],
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
if (!currentUser.permissions || currentUser.permissions.length === 0) {
|
|
62
|
+
throw new exceptions_1.AppBadRequestException({
|
|
63
|
+
key: error_key_enum_1.ErrorKeyEnum.PERMISSIONS,
|
|
64
|
+
message: ["Permission not available for currentUser"],
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
const hasPermission = matchingPermissionConfig.permissions.some((permission) => currentUser.permissions.includes(permission));
|
|
68
|
+
if (!hasPermission) {
|
|
69
|
+
throw new exceptions_1.AppBadRequestException({
|
|
70
|
+
key: error_key_enum_1.ErrorKeyEnum.PERMISSION,
|
|
71
|
+
message: [`Current user does not have permission to ${action} entityHistory`],
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
const nextStatus = matchingPermissionConfig.next(entityHistoryFlowConfigContextData);
|
|
75
|
+
return nextStatus;
|
|
76
|
+
}
|
|
77
|
+
getAvailableActions(currentUser, config) {
|
|
78
|
+
var _a;
|
|
79
|
+
const params = {
|
|
80
|
+
flowConfig: entity_history_flow_config_1.entityHistoryFlowConfig,
|
|
81
|
+
currentStatus: this.status,
|
|
82
|
+
userPermissions: (_a = currentUser.permissions) !== null && _a !== void 0 ? _a : [],
|
|
83
|
+
visibilityData: this.getUpdateActionVisibility.bind(this, currentUser),
|
|
84
|
+
combinedActions: config === null || config === void 0 ? void 0 : config.combinedActions,
|
|
85
|
+
customLabels: config === null || config === void 0 ? void 0 : config.customLabels,
|
|
86
|
+
};
|
|
87
|
+
return utils_1.EntityActionFlowResolverV2.getAvailableActionsData(params);
|
|
88
|
+
}
|
|
89
|
+
getUpdateActionVisibility(currentUser) {
|
|
90
|
+
return {};
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
exports.EntityHistoryEntityModel = EntityHistoryEntityModel;
|
|
94
|
+
EntityHistoryEntityModel.relationConfigs = [];
|