law-common 10.46.1-beta.8 → 10.46.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/src/api/index.d.ts +2 -0
  2. package/dist/src/api/index.js +2 -0
  3. package/dist/src/api/interface/tds_rate.create.dto.interface.autocode.d.ts +0 -0
  4. package/dist/src/api/interface/tds_rate.create.dto.interface.autocode.js +6 -0
  5. package/dist/src/api/interface/tds_rate.create.dto.interface.d.ts +6 -0
  6. package/dist/src/api/interface/tds_rate.create.dto.interface.js +2 -0
  7. package/dist/src/api/interface/tds_rate.update.dto.interface.autocode.d.ts +0 -0
  8. package/dist/src/api/interface/tds_rate.update.dto.interface.autocode.js +3 -0
  9. package/dist/src/api/interface/tds_rate.update.dto.interface.d.ts +3 -0
  10. package/dist/src/api/interface/tds_rate.update.dto.interface.js +2 -0
  11. package/dist/src/entities/enums/tds_rate_status_enum.autocode.d.ts +0 -0
  12. package/dist/src/entities/enums/tds_rate_status_enum.autocode.js +6 -0
  13. package/dist/src/entities/enums/tds_rate_status_enum.d.ts +5 -0
  14. package/dist/src/entities/enums/tds_rate_status_enum.js +9 -0
  15. package/dist/src/entities/index.d.ts +5 -1
  16. package/dist/src/entities/index.js +5 -1
  17. package/dist/src/entities/interface/entity-audit-columns.interface.d.ts +2 -0
  18. package/dist/src/entities/interface/entity.utils.interface.d.ts +12 -4
  19. package/dist/src/entities/interface/entity.utils.interface.js +2 -0
  20. package/dist/src/entities/interface/organization_type_tds_rate_mapping.entity.interface.autocode.d.ts +0 -0
  21. package/dist/src/entities/interface/organization_type_tds_rate_mapping.entity.interface.autocode.js +7 -0
  22. package/dist/src/entities/interface/organization_type_tds_rate_mapping.entity.interface.d.ts +6 -0
  23. package/dist/src/entities/interface/organization_type_tds_rate_mapping.entity.interface.js +2 -0
  24. package/dist/src/entities/interface/tds_rate.entity.interface.autocode.d.ts +0 -0
  25. package/dist/src/entities/interface/tds_rate.entity.interface.autocode.js +12 -0
  26. package/dist/src/entities/interface/tds_rate.entity.interface.d.ts +12 -0
  27. package/dist/src/entities/interface/tds_rate.entity.interface.js +2 -0
  28. package/dist/src/entities/model/entity.model.interface.d.ts +3 -0
  29. package/dist/src/entities/model/entity.model.interface.js +20 -0
  30. package/dist/src/entities/model/leave.entity.model.d.ts +0 -15
  31. package/dist/src/entities/model/leave.entity.model.js +0 -28
  32. package/dist/src/entities/model/organization_type_tds_rate_mapping.entity.model.autocode.d.ts +0 -0
  33. package/dist/src/entities/model/organization_type_tds_rate_mapping.entity.model.autocode.js +24 -0
  34. package/dist/src/entities/model/organization_type_tds_rate_mapping.entity.model.d.ts +20 -0
  35. package/dist/src/entities/model/organization_type_tds_rate_mapping.entity.model.js +47 -0
  36. package/dist/src/entities/model/tds_rate.entity.model.autocode.d.ts +0 -0
  37. package/dist/src/entities/model/tds_rate.entity.model.autocode.js +37 -0
  38. package/dist/src/entities/model/tds_rate.entity.model.d.ts +25 -0
  39. package/dist/src/entities/model/tds_rate.entity.model.js +47 -0
  40. package/dist/src/utils/entity.flow.util.d.ts +0 -25
  41. package/dist/src/utils/entity.flow.util.js +0 -39
  42. package/package.json +1 -1
  43. package/dist/src/entities/flow-configs/leave.flow.config.d.ts +0 -2
  44. package/dist/src/entities/flow-configs/leave.flow.config.js +0 -127
@@ -58,3 +58,5 @@ export * from "./interface/gst_rate.create.dto.interface";
58
58
  export * from "./interface/gst_rate.update.dto.interface";
59
59
  export * from "./interface/organization_type.create.dto.interface";
60
60
  export * from "./interface/organization_type.update.dto.interface";
61
+ export * from "./interface/tds_rate.create.dto.interface";
62
+ export * from "./interface/tds_rate.update.dto.interface";
@@ -78,3 +78,5 @@ __exportStar(require("./interface/gst_rate.create.dto.interface"), exports);
78
78
  __exportStar(require("./interface/gst_rate.update.dto.interface"), exports);
79
79
  __exportStar(require("./interface/organization_type.create.dto.interface"), exports);
80
80
  __exportStar(require("./interface/organization_type.update.dto.interface"), exports);
81
+ __exportStar(require("./interface/tds_rate.create.dto.interface"), exports);
82
+ __exportStar(require("./interface/tds_rate.update.dto.interface"), exports);
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ // import { IEntityCreateDto } from "../../entities";
3
+ // export type ITdsRateCreateExclude = "status";
4
+ // export interface ITdsRateCreateDto extends Omit<IEntityCreateDto<ITdsRateEntity>, ITdsRateCreateExclude> {
5
+ // organizationTypeIds: number[];
6
+ // }
@@ -0,0 +1,6 @@
1
+ import { IEntityCreateDto } from "../../entities";
2
+ import { ITdsRateEntity } from "../../entities/interface/tds_rate.entity.interface";
3
+ export type ITdsRateCreateExclude = "status";
4
+ export interface ITdsRateCreateDto extends Omit<IEntityCreateDto<ITdsRateEntity>, ITdsRateCreateExclude> {
5
+ organizationTypeIds: number[];
6
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // import { DeepPartialButRequired } from "./api.utils.interface";
3
+ // export type ITdsRateUpdateDto = DeepPartialButRequired<ITdsRateCreateDto, never>;
@@ -0,0 +1,3 @@
1
+ import { DeepPartialButRequired } from "./api.utils.interface";
2
+ import { ITdsRateCreateDto } from "./tds_rate.create.dto.interface";
3
+ export type ITdsRateUpdateDto = DeepPartialButRequired<ITdsRateCreateDto, never>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ // export enum TdsRateStatusEnum {
3
+ // ACTIVE = "ACTIVE",
4
+ // INACTIVE = "INACTIVE",
5
+ // DEACTIVE = "DEACTIVE",
6
+ // }
@@ -0,0 +1,5 @@
1
+ export declare enum TdsRateStatusEnum {
2
+ ACTIVE = "ACTIVE",
3
+ INACTIVE = "INACTIVE",
4
+ DEACTIVE = "DEACTIVE"
5
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TdsRateStatusEnum = void 0;
4
+ var TdsRateStatusEnum;
5
+ (function (TdsRateStatusEnum) {
6
+ TdsRateStatusEnum["ACTIVE"] = "ACTIVE";
7
+ TdsRateStatusEnum["INACTIVE"] = "INACTIVE";
8
+ TdsRateStatusEnum["DEACTIVE"] = "DEACTIVE";
9
+ })(TdsRateStatusEnum || (exports.TdsRateStatusEnum = TdsRateStatusEnum = {}));
@@ -113,5 +113,9 @@ export * from "./model/gst_rate.entity.model";
113
113
  export * from "./enums/organization_type_status_enum";
114
114
  export * from "./interface/organization_type.entity.interface";
115
115
  export * from "./model/organization_type.entity.model";
116
+ export * from "./interface/organization_type_tds_rate_mapping.entity.interface";
117
+ export * from "./model/organization_type_tds_rate_mapping.entity.model";
118
+ export * from "./enums/tds_rate_status_enum";
119
+ export * from "./interface/tds_rate.entity.interface";
120
+ export * from "./model/tds_rate.entity.model";
116
121
  export * from "./model/interface/billing.model.interface";
117
- export * from "./flow-configs/leave.flow.config";
@@ -129,5 +129,9 @@ __exportStar(require("./model/gst_rate.entity.model"), exports);
129
129
  __exportStar(require("./enums/organization_type_status_enum"), exports);
130
130
  __exportStar(require("./interface/organization_type.entity.interface"), exports);
131
131
  __exportStar(require("./model/organization_type.entity.model"), exports);
132
+ __exportStar(require("./interface/organization_type_tds_rate_mapping.entity.interface"), exports);
133
+ __exportStar(require("./model/organization_type_tds_rate_mapping.entity.model"), exports);
134
+ __exportStar(require("./enums/tds_rate_status_enum"), exports);
135
+ __exportStar(require("./interface/tds_rate.entity.interface"), exports);
136
+ __exportStar(require("./model/tds_rate.entity.model"), exports);
132
137
  __exportStar(require("./model/interface/billing.model.interface"), exports);
133
- __exportStar(require("./flow-configs/leave.flow.config"), exports);
@@ -1,6 +1,8 @@
1
+ import { EntityMap } from "./entity.utils.interface";
1
2
  export interface IEntityAuditColumn {
2
3
  createdOn: number;
3
4
  updatedOn: number;
4
5
  createdBy: number;
5
6
  updatedBy: number;
7
+ entityMap?: EntityMap;
6
8
  }
@@ -18,12 +18,14 @@ import { HolidayEntityModel } from "../model/holiday.entity.model";
18
18
  import { LeaveEntityModel } from "../model/leave.entity.model";
19
19
  import { LeaveCountVirtualEntityModel } from "../model/leave_count.entity.model";
20
20
  import { OrganizationTypeEntityModel } from "../model/organization_type.entity.model";
21
+ import { OrganizationTypeTdsRateMappingEntityModel } from "../model/organization_type_tds_rate_mapping.entity.model";
21
22
  import { ProjectUserMappingEntityModel } from "../model/project-user-mapping.entity.model";
22
23
  import { ProjectEntityModel } from "../model/project.entity.model";
23
24
  import { ReimbursementExpenseEntityModel } from "../model/reimbursement-expense.entity.model";
24
25
  import { ReimbursementEntityModel } from "../model/reimbursement.entity.model";
25
26
  import { StateEntityModel } from "../model/state.entity.model";
26
27
  import { TaskEntityModel } from "../model/task.entity.model";
28
+ import { TdsRateEntityModel } from "../model/tds_rate.entity.model";
27
29
  import { TimesheetEntityModel } from "../model/timesheet.entity.model";
28
30
  import { UserEntityModel } from "../model/user.entity.model";
29
31
  import { IAddressBookEntity } from "./address-book.entity.interface";
@@ -53,6 +55,7 @@ import { ILeaveHistoryEntity } from "./leave_history.entity.interface";
53
55
  import { IOfficeLocationEntity } from "./office.location.entity";
54
56
  import { IOrganizationEntity } from "./organization.entity.interface";
55
57
  import { IOrganizationTypeEntity } from "./organization_type.entity.interface";
58
+ import { IOrganizationTypeTdsRateMappingEntity } from "./organization_type_tds_rate_mapping.entity.interface";
56
59
  import { IPermissionEntity } from "./permission.entity.interface";
57
60
  import { IProjectEntity, IProjectUserMappingEntity } from "./project.entity.interface";
58
61
  import { IRateEntity } from "./rate.entity.interface";
@@ -62,6 +65,7 @@ import { IRoleEntity } from "./role.entity.interface";
62
65
  import { IRolePermissionMappingEntity } from "./role.permission.mapping.entity.interface";
63
66
  import { IStateEntity } from "./state.entity.interface";
64
67
  import { ITaskEntity } from "./task.entity.interface";
68
+ import { ITdsRateEntity } from "./tds_rate.entity.interface";
65
69
  import { ITimesheetEntity } from "./timesheet.entity.interface";
66
70
  import { ITimesheetHistoryEntity } from "./timesheet_history.entity.interface";
67
71
  import { IToDoListEntity } from "./to-do.entity.interface";
@@ -72,7 +76,9 @@ export type IApiEntity<T> = Modify<T, {
72
76
  createdOn: string;
73
77
  updatedOn: string;
74
78
  }>;
75
- export type IEntityCreateDto<T> = Omit<T, "id" | keyof IEntityAuditColumn>;
79
+ export type IEntityCreateDto<T> = Omit<T, "id" | keyof IEntityAuditColumn> & {
80
+ fetch?: EntityEnum[];
81
+ };
76
82
  export type IEntityUpdateDto<T> = Omit<Partial<T>, "id" | keyof IEntityAuditColumn>;
77
83
  /**
78
84
  * EntityEnum
@@ -152,7 +158,9 @@ export declare enum EntityEnum {
152
158
  ADDRESS_BOOK = "address_book",
153
159
  STATE = "state",
154
160
  GST_RATE = "gst_rate",
155
- ORGANIZATION_TYPE = "organization_type"
161
+ ORGANIZATION_TYPE = "organization_type",
162
+ TDS_RATE = "tds_rate",
163
+ ORGANIZATION_TYPE_TDS_RATE_MAPPING = "organization_type_tds_rate_mapping"
156
164
  }
157
165
  export type EntityRelations = {
158
166
  [K in EntityEnum | VirtualEntityEnum]: K;
@@ -171,7 +179,7 @@ export type IBaseEntityApiResponse<T> = {
171
179
  [K in EntityEnum | VirtualEntityEnum]?: IBaseEntityApiResponse<EnumEntityType<K>>;
172
180
  };
173
181
  };
174
- 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.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 : never) & {
182
+ 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.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 : never) & {
175
183
  id: number;
176
184
  };
177
185
  export type EntityRelationConfig<T extends EntityEnum | VirtualEntityEnum> = {
@@ -294,7 +302,7 @@ export declare enum VirtualEntityEnum {
294
302
  }
295
303
  export type IHistoryConstraintSearchResponse<T> = IBaseResponse<IHistoryEntitySearchByConstraintResponse<T>[]>;
296
304
  export type IHistoryConstraintSearchServiceResponse<T> = IHistoryEntitySearchByConstraintResponse<T>[];
297
- 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.COUNTRY ? CountryEntityModel : T extends EntityEnum.BILLING_TRANSACTION ? BillingTransactionEntityModel : T extends EntityEnum.ADDRESS_BOOK ? AddressBookEntityModel : T extends EntityEnum.STATE ? StateEntityModel : T extends EntityEnum.GST_RATE ? GstRateEntityModel : T extends EntityEnum.ORGANIZATION_TYPE ? OrganizationTypeEntityModel : UserEntityModel;
305
+ 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.COUNTRY ? CountryEntityModel : T extends EntityEnum.BILLING_TRANSACTION ? BillingTransactionEntityModel : 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.ORGANIZATION_TYPE_TDS_RATE_MAPPING ? OrganizationTypeTdsRateMappingEntityModel : T extends EntityEnum.TDS_RATE ? TdsRateEntityModel : UserEntityModel;
298
306
  export type EntityMap = {
299
307
  [key in EntityEnum | VirtualEntityEnum]: EnumToModel<key>[];
300
308
  };
@@ -81,6 +81,8 @@ var EntityEnum;
81
81
  EntityEnum["STATE"] = "state";
82
82
  EntityEnum["GST_RATE"] = "gst_rate";
83
83
  EntityEnum["ORGANIZATION_TYPE"] = "organization_type";
84
+ EntityEnum["TDS_RATE"] = "tds_rate";
85
+ EntityEnum["ORGANIZATION_TYPE_TDS_RATE_MAPPING"] = "organization_type_tds_rate_mapping";
84
86
  })(EntityEnum || (exports.EntityEnum = EntityEnum = {}));
85
87
  var VirtualEntityEnum;
86
88
  (function (VirtualEntityEnum) {
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ // import { IEntityAuditColumn } from "./entity-audit-columns.interface";
3
+ // export interface IOrganizationTypeTdsRateMappingEntity extends IEntityAuditColumn {
4
+ // id: number;
5
+ // organizationTypeId: number;
6
+ // tdsRateId: number;
7
+ // }
@@ -0,0 +1,6 @@
1
+ import { IEntityAuditColumn } from "./entity-audit-columns.interface";
2
+ export interface IOrganizationTypeTdsRateMappingEntity extends IEntityAuditColumn {
3
+ id: number;
4
+ organizationTypeId: number;
5
+ tdsRateId: number;
6
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ // import { IEntityAuditColumn } from "./entity-audit-columns.interface";
3
+ // export interface ITdsRateEntity extends IEntityAuditColumn {
4
+ // id: number;
5
+ // section: string;
6
+ // code: string;
7
+ // description?: string;
8
+ // panAvailableRate: number;
9
+ // panNotAvailableRate: number;
10
+ // effectiveFrom: number;
11
+ // status: TdsRateStatusEnum;
12
+ // }
@@ -0,0 +1,12 @@
1
+ import { TdsRateStatusEnum } from "../enums/tds_rate_status_enum";
2
+ import { IEntityAuditColumn } from "./entity-audit-columns.interface";
3
+ export interface ITdsRateEntity extends IEntityAuditColumn {
4
+ id: number;
5
+ section: string;
6
+ code: string;
7
+ description?: string;
8
+ panAvailableRate: number;
9
+ panNotAvailableRate: number;
10
+ effectiveFrom: number;
11
+ status: TdsRateStatusEnum;
12
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -34,6 +34,9 @@ export declare class EntityModelRelationHelper {
34
34
  addEntityModel<T extends EntityEnum | VirtualEntityEnum>(entityModel: BaseEntityModel<T>, config?: {
35
35
  populateRelations?: boolean;
36
36
  }): EntityModelRelationHelper;
37
+ mergeEntityMap(entityMap: EntityMap, config?: {
38
+ populateRelations?: boolean;
39
+ }): EntityModelRelationHelper;
37
40
  addEntity<T extends EntityEnum | VirtualEntityEnum>(entity: EnumEntityType<T>, entityEnum: T, config?: {
38
41
  populateRelations?: boolean;
39
42
  }): EntityModelRelationHelper;
@@ -26,12 +26,14 @@ const holiday_entity_model_1 = require("./holiday.entity.model");
26
26
  const leave_entity_model_1 = require("./leave.entity.model");
27
27
  const leave_count_entity_model_1 = require("./leave_count.entity.model");
28
28
  const organization_type_entity_model_1 = require("./organization_type.entity.model");
29
+ const organization_type_tds_rate_mapping_entity_model_1 = require("./organization_type_tds_rate_mapping.entity.model");
29
30
  const project_user_mapping_entity_model_1 = require("./project-user-mapping.entity.model");
30
31
  const project_entity_model_1 = require("./project.entity.model");
31
32
  const reimbursement_expense_entity_model_1 = require("./reimbursement-expense.entity.model");
32
33
  const reimbursement_entity_model_1 = require("./reimbursement.entity.model");
33
34
  const state_entity_model_1 = require("./state.entity.model");
34
35
  const task_entity_model_1 = require("./task.entity.model");
36
+ const tds_rate_entity_model_1 = require("./tds_rate.entity.model");
35
37
  const timesheet_entity_model_1 = require("./timesheet.entity.model");
36
38
  const user_entity_model_1 = require("./user.entity.model");
37
39
  function mapToIndex(entityMap) {
@@ -86,6 +88,8 @@ exports.entityEnumToEntityModel = {
86
88
  [entity_utils_interface_1.EntityEnum.STATE]: state_entity_model_1.StateEntityModel.fromEntity,
87
89
  [entity_utils_interface_1.EntityEnum.GST_RATE]: gst_rate_entity_model_1.GstRateEntityModel.fromEntity,
88
90
  [entity_utils_interface_1.EntityEnum.ORGANIZATION_TYPE]: organization_type_entity_model_1.OrganizationTypeEntityModel.fromEntity,
91
+ [entity_utils_interface_1.EntityEnum.TDS_RATE]: tds_rate_entity_model_1.TdsRateEntityModel.fromEntity,
92
+ [entity_utils_interface_1.EntityEnum.ORGANIZATION_TYPE_TDS_RATE_MAPPING]: organization_type_tds_rate_mapping_entity_model_1.OrganizationTypeTdsRateMappingEntityModel.fromEntity,
89
93
  };
90
94
  function entityMapToModels(entityMap) {
91
95
  for (const entityName in entityMap) {
@@ -216,6 +220,22 @@ class EntityModelRelationHelper {
216
220
  }
217
221
  return EntityModelRelationHelper.getClone(this);
218
222
  }
223
+ mergeEntityMap(entityMap, config = { populateRelations: false }) {
224
+ const models = [];
225
+ for (const entityName in entityMap) {
226
+ if (!(entityName in exports.entityEnumToEntityModel)) {
227
+ throw new Error(`Unknown entity: ${entityName}`);
228
+ }
229
+ const entityModels = entityMap[entityName].map((entity) => exports.entityEnumToEntityModel[entityName
230
+ // @ts-ignore
231
+ ](entity));
232
+ models.push(...entityModels);
233
+ }
234
+ for (const model of models) {
235
+ this.populateRelationsByEntityModel(model);
236
+ }
237
+ return EntityModelRelationHelper.getClone(this);
238
+ }
219
239
  addEntity(entity, entityEnum, config = { populateRelations: false }) {
220
240
  if (!(entityEnum in exports.entityEnumToEntityModel)) {
221
241
  throw new Error(`Unknown entity: ${entityEnum}`);
@@ -1,7 +1,6 @@
1
1
  import { DateCodeModel, Weekday } from "../../utils";
2
2
  import { DurationTypeEnum } from "../enums/duration-type.enum";
3
3
  import { LeaveTypeEnum } from "../enums/leave-type.enum";
4
- import { LeaveActionEnum } from "../enums/leave.action.enum";
5
4
  import { LeaveStatusEnum } from "../enums/leave.status.enum";
6
5
  import { RelationType } from "../enums/relation-type.enum";
7
6
  import { EntityEnum, VirtualEntityEnum } from "../interface/entity.utils.interface";
@@ -74,18 +73,4 @@ export declare class LeaveEntityModel extends BaseEntityModel<EntityEnum.LEAVE>
74
73
  approved: number;
75
74
  rejected: number;
76
75
  };
77
- getAvailableActions(currentUser: UserEntityModel, config?: {
78
- combinedActions?: Record<string, {
79
- combineActions: LeaveActionEnum[];
80
- label: string;
81
- }>;
82
- customLabels?: Partial<Record<LeaveActionEnum, string>>;
83
- }): Map<LeaveActionEnum | string, string>;
84
- getUpdateActionVisibility(currentUser: UserEntityModel): {
85
- [key: string]: () => boolean;
86
- };
87
- getAvailableActionsLavelValue(availableActionsFromModel: Map<LeaveActionEnum | string, string>): {
88
- label: string;
89
- value: string;
90
- }[];
91
76
  }
@@ -7,7 +7,6 @@ const duration_type_enum_1 = require("../enums/duration-type.enum");
7
7
  const leave_type_enum_1 = require("../enums/leave-type.enum");
8
8
  const leave_status_enum_1 = require("../enums/leave.status.enum");
9
9
  const relation_type_enum_1 = require("../enums/relation-type.enum");
10
- const leave_flow_config_1 = require("../flow-configs/leave.flow.config");
11
10
  const entity_utils_interface_1 = require("../interface/entity.utils.interface");
12
11
  const base_entity_model_1 = require("./base.entity.model");
13
12
  class LeaveEntityModel extends base_entity_model_1.BaseEntityModel {
@@ -191,33 +190,6 @@ class LeaveEntityModel extends base_entity_model_1.BaseEntityModel {
191
190
  [leave_status_enum_1.LeaveStatusEnum.REJECTED]: 5,
192
191
  };
193
192
  }
194
- getAvailableActions(currentUser, config) {
195
- var _a;
196
- const combinedActions = (_a = config === null || config === void 0 ? void 0 : config.combinedActions) !== null && _a !== void 0 ? _a : {};
197
- if (!currentUser.permissions || !this.status) {
198
- return new Map();
199
- }
200
- // get permitted action values
201
- const permittedActions = (0, utils_1.getPermittedActionsV2)(leave_flow_config_1.leaveFlowConfig, this.status, currentUser.permissions, this.getUpdateActionVisibility.bind(this, currentUser));
202
- // combine + label
203
- return (0, utils_1.combinePermittedActionsV2)(permittedActions, combinedActions, config === null || config === void 0 ? void 0 : config.customLabels);
204
- }
205
- getUpdateActionVisibility(currentUser) {
206
- return {
207
- LEAVE_UPDATE_SELF: () => currentUser.id === this.createdBy,
208
- LEAVE_DELETE_SELF: () => currentUser.id === this.createdBy,
209
- };
210
- }
211
- getAvailableActionsLavelValue(availableActionsFromModel) {
212
- const availableActionsForRes = [];
213
- for (const [value, label] of availableActionsFromModel.entries()) {
214
- availableActionsForRes.push({
215
- label,
216
- value: value.toString(),
217
- });
218
- }
219
- return availableActionsForRes;
220
- }
221
193
  }
222
194
  exports.LeaveEntityModel = LeaveEntityModel;
223
195
  LeaveEntityModel.relationConfigs = [
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ // import { EntityEnum } from "../interface/entity.utils.interface";
3
+ // import { BaseEntityModel } from "./base.entity.model";
4
+ // export class OrganizationTypeTdsRateMappingEntityModel
5
+ // extends BaseEntityModel<EntityEnum.ORGANIZATION_TYPE_TDS_RATE_MAPPING>
6
+ // implements IOrganizationTypeTdsRateMappingEntity
7
+ // {
8
+ // id: number = 0;
9
+ // organizationTypeId: number = 0;
10
+ // tdsRateId: number = 0;
11
+ // createdOn: number = 0;
12
+ // updatedOn: number = 0;
13
+ // createdBy: number = 0;
14
+ // updatedBy: number = 0;
15
+ // static relationConfigs = [];
16
+ // static fromEntity(entity: IOrganizationTypeTdsRateMappingEntity): OrganizationTypeTdsRateMappingEntityModel {
17
+ // const result = new OrganizationTypeTdsRateMappingEntityModel(EntityEnum.ORGANIZATION_TYPE_TDS_RATE_MAPPING);
18
+ // Object.assign(result, entity);
19
+ // return result;
20
+ // }
21
+ // getRelationConfigs(): any[] {
22
+ // return this.constructor.prototype.constructor.relationConfigs || [];
23
+ // }
24
+ // }
@@ -0,0 +1,20 @@
1
+ import { EntityEnum, EnumEntityType } from "../interface/entity.utils.interface";
2
+ import { IOrganizationTypeTdsRateMappingEntity } from "../interface/organization_type_tds_rate_mapping.entity.interface";
3
+ import { RelationConfigs } from "../interface/relation-config.interface";
4
+ import { BaseEntityModel } from "./base.entity.model";
5
+ import { OrganizationTypeEntityModel } from "./organization_type.entity.model";
6
+ import { TdsRateEntityModel } from "./tds_rate.entity.model";
7
+ export declare class OrganizationTypeTdsRateMappingEntityModel extends BaseEntityModel<EntityEnum.ORGANIZATION_TYPE_TDS_RATE_MAPPING> implements IOrganizationTypeTdsRateMappingEntity {
8
+ id: number;
9
+ organizationTypeId: number;
10
+ tdsRateId: number;
11
+ createdOn: number;
12
+ updatedOn: number;
13
+ createdBy: number;
14
+ updatedBy: number;
15
+ tdsRate?: TdsRateEntityModel;
16
+ organizationType?: OrganizationTypeEntityModel;
17
+ static relationConfigs: RelationConfigs<[EntityEnum.TDS_RATE, EntityEnum.ORGANIZATION_TYPE], EnumEntityType<EntityEnum.ORGANIZATION_TYPE_TDS_RATE_MAPPING>>;
18
+ static fromEntity(entity: IOrganizationTypeTdsRateMappingEntity): OrganizationTypeTdsRateMappingEntityModel;
19
+ getRelationConfigs(): any[];
20
+ }
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OrganizationTypeTdsRateMappingEntityModel = void 0;
4
+ const relation_type_enum_1 = require("../enums/relation-type.enum");
5
+ const entity_utils_interface_1 = require("../interface/entity.utils.interface");
6
+ const base_entity_model_1 = require("./base.entity.model");
7
+ class OrganizationTypeTdsRateMappingEntityModel extends base_entity_model_1.BaseEntityModel {
8
+ constructor() {
9
+ super(...arguments);
10
+ this.id = 0;
11
+ this.organizationTypeId = 0;
12
+ this.tdsRateId = 0;
13
+ this.createdOn = 0;
14
+ this.updatedOn = 0;
15
+ this.createdBy = 0;
16
+ this.updatedBy = 0;
17
+ }
18
+ static fromEntity(entity) {
19
+ const result = new OrganizationTypeTdsRateMappingEntityModel(entity_utils_interface_1.EntityEnum.ORGANIZATION_TYPE_TDS_RATE_MAPPING);
20
+ Object.assign(result, entity);
21
+ return result;
22
+ }
23
+ getRelationConfigs() {
24
+ return this.constructor.prototype.constructor.relationConfigs || [];
25
+ }
26
+ }
27
+ exports.OrganizationTypeTdsRateMappingEntityModel = OrganizationTypeTdsRateMappingEntityModel;
28
+ OrganizationTypeTdsRateMappingEntityModel.relationConfigs = [
29
+ {
30
+ name: entity_utils_interface_1.EntityEnum.TDS_RATE,
31
+ relation: relation_type_enum_1.RelationType.ONE,
32
+ key: "tdsRate",
33
+ mapKeyConfig: {
34
+ relationKey: "id",
35
+ key: "tdsRateId",
36
+ },
37
+ },
38
+ {
39
+ name: entity_utils_interface_1.EntityEnum.ORGANIZATION_TYPE,
40
+ relation: relation_type_enum_1.RelationType.ONE,
41
+ key: "organizationType",
42
+ mapKeyConfig: {
43
+ relationKey: "id",
44
+ key: "organizationTypeId",
45
+ },
46
+ },
47
+ ];
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ // import { EntityEnum } from "../interface/entity.utils.interface";
3
+ // import { BaseEntityModel } from "./base.entity.model";
4
+ // export class TdsRateEntityModel extends BaseEntityModel<EntityEnum.TDS_RATE> implements ITdsRateEntity {
5
+ // id: number = 0;
6
+ // section: string = "";
7
+ // code: string = "";
8
+ // description?: string;
9
+ // panAvailableRate: number = 0;
10
+ // panNotAvailableRate: number = 0;
11
+ // effectiveFrom: number = 0;
12
+ // status: TdsRateStatusEnum = TdsRateStatusEnum.ACTIVE;
13
+ // createdOn: number = 0;
14
+ // updatedOn: number = 0;
15
+ // createdBy: number = 0;
16
+ // updatedBy: number = 0;
17
+ // organizationTypeTdsRateMappings?: OrganizationTypeTdsRateMappingEntityModel[];
18
+ // static relationConfigs: RelationConfigs<[EntityEnum.ORGANIZATION_TYPE_TDS_RATE_MAPPING], EnumEntityType<EntityEnum.TDS_RATE>> = [
19
+ // {
20
+ // name: EntityEnum.ORGANIZATION_TYPE_TDS_RATE_MAPPING,
21
+ // relation: RelationType.MANY,
22
+ // key: "organizationTypeTdsRateMappings",
23
+ // mapKeyConfig: {
24
+ // relationKey: "tdsRateId",
25
+ // key: "id",
26
+ // },
27
+ // },
28
+ // ];
29
+ // static fromEntity(entity: ITdsRateEntity): TdsRateEntityModel {
30
+ // const result = new TdsRateEntityModel(EntityEnum.TDS_RATE);
31
+ // Object.assign(result, entity);
32
+ // return result;
33
+ // }
34
+ // getRelationConfigs(): any[] {
35
+ // return this.constructor.prototype.constructor.relationConfigs || [];
36
+ // }
37
+ // }
@@ -0,0 +1,25 @@
1
+ import { TdsRateStatusEnum } from "../enums/tds_rate_status_enum";
2
+ import { EntityEnum, EnumEntityType } from "../interface/entity.utils.interface";
3
+ import { RelationConfigs } from "../interface/relation-config.interface";
4
+ import { ITdsRateEntity } from "../interface/tds_rate.entity.interface";
5
+ import { BaseEntityModel } from "./base.entity.model";
6
+ import { OrganizationTypeTdsRateMappingEntityModel } from "./organization_type_tds_rate_mapping.entity.model";
7
+ export declare class TdsRateEntityModel extends BaseEntityModel<EntityEnum.TDS_RATE> implements ITdsRateEntity {
8
+ id: number;
9
+ section: string;
10
+ code: string;
11
+ description?: string;
12
+ panAvailableRate: number;
13
+ panNotAvailableRate: number;
14
+ effectiveFrom: number;
15
+ status: TdsRateStatusEnum;
16
+ createdOn: number;
17
+ updatedOn: number;
18
+ createdBy: number;
19
+ updatedBy: number;
20
+ organizationTypeTdsRateMappings?: OrganizationTypeTdsRateMappingEntityModel[];
21
+ static relationConfigs: RelationConfigs<[EntityEnum.ORGANIZATION_TYPE_TDS_RATE_MAPPING], EnumEntityType<EntityEnum.TDS_RATE>>;
22
+ static fromEntity(entity: ITdsRateEntity): TdsRateEntityModel;
23
+ getRelationConfigs(): any[];
24
+ get organizationTypeIds(): number[];
25
+ }
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TdsRateEntityModel = void 0;
4
+ const relation_type_enum_1 = require("../enums/relation-type.enum");
5
+ const tds_rate_status_enum_1 = require("../enums/tds_rate_status_enum");
6
+ const entity_utils_interface_1 = require("../interface/entity.utils.interface");
7
+ const base_entity_model_1 = require("./base.entity.model");
8
+ class TdsRateEntityModel extends base_entity_model_1.BaseEntityModel {
9
+ constructor() {
10
+ super(...arguments);
11
+ this.id = 0;
12
+ this.section = "";
13
+ this.code = "";
14
+ this.panAvailableRate = 0;
15
+ this.panNotAvailableRate = 0;
16
+ this.effectiveFrom = 0;
17
+ this.status = tds_rate_status_enum_1.TdsRateStatusEnum.ACTIVE;
18
+ this.createdOn = 0;
19
+ this.updatedOn = 0;
20
+ this.createdBy = 0;
21
+ this.updatedBy = 0;
22
+ }
23
+ static fromEntity(entity) {
24
+ const result = new TdsRateEntityModel(entity_utils_interface_1.EntityEnum.TDS_RATE);
25
+ Object.assign(result, entity);
26
+ return result;
27
+ }
28
+ getRelationConfigs() {
29
+ return this.constructor.prototype.constructor.relationConfigs || [];
30
+ }
31
+ get organizationTypeIds() {
32
+ var _a;
33
+ return ((_a = this.organizationTypeTdsRateMappings) === null || _a === void 0 ? void 0 : _a.map((mapping) => mapping.organizationTypeId)) || [];
34
+ }
35
+ }
36
+ exports.TdsRateEntityModel = TdsRateEntityModel;
37
+ TdsRateEntityModel.relationConfigs = [
38
+ {
39
+ name: entity_utils_interface_1.EntityEnum.ORGANIZATION_TYPE_TDS_RATE_MAPPING,
40
+ relation: relation_type_enum_1.RelationType.MANY,
41
+ key: "organizationTypeTdsRateMappings",
42
+ mapKeyConfig: {
43
+ relationKey: "tdsRateId",
44
+ key: "id",
45
+ },
46
+ },
47
+ ];
@@ -30,28 +30,3 @@ export declare function getPermittedActions<T extends LeaveStatusActionPair, E>(
30
30
  label: string;
31
31
  value: T["action"] | string;
32
32
  }[];
33
- /**
34
- * Combines permitted action values into grouped actions where applicable.
35
- * Returns a map of action keys (enum values or combined string keys) to labels.
36
- */
37
- export declare function combinePermittedActionsV2<T extends string>(actions: readonly T[], combinedActions: Record<string, {
38
- combineActions: readonly T[];
39
- label: string;
40
- }>, customLabels?: Partial<Record<T, string>>): Map<T | string, string>;
41
- /**
42
- * Returns raw permitted action values for the given status and user permissions.
43
- * This function performs permission and visibility filtering only.
44
- * It does not apply action combination or labeling.
45
- */
46
- export declare function getPermittedActionsV2<T extends LeaveStatusActionPair, E>(entityFlowConfig: {
47
- [key in T["status"]]?: {
48
- actions: {
49
- [key in T["action"]]?: {
50
- permissions: string[];
51
- next: () => T["status"];
52
- };
53
- };
54
- };
55
- }, currentStatus: T["status"] | null, userPermissions: string[], data?: (a: E) => {
56
- [key: string]: () => boolean;
57
- }): T["action"][];
@@ -1,9 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getPermittedActions = getPermittedActions;
4
- exports.combinePermittedActionsV2 = combinePermittedActionsV2;
5
- exports.getPermittedActionsV2 = getPermittedActionsV2;
6
- const string_util_1 = require("./string.util");
7
4
  /**
8
5
  * Converts an action or combined action to a value-label pair
9
6
  * @param action - The action or combined action key
@@ -52,8 +49,6 @@ function combinePermittedActions(permittedActions, combineActions) {
52
49
  }
53
50
  const isCombinedActionPresent = combineActions.every((action) => permittedActions.includes(action));
54
51
  if (isCombinedActionPresent) {
55
- // if combinedActions requested are present then join them
56
- // return them along with permissted actions
57
52
  const combinedValue = combineActions.join("_");
58
53
  return [
59
54
  ...permittedActions.filter((action) => !combineActions.includes(action)),
@@ -86,37 +81,3 @@ function getPermittedActions(entityFlowConfig, currentStatus, userPermissions, c
86
81
  // Convert to value-label pairs
87
82
  return finalActions.map((action) => convertToValueLabel(action, actionLabels));
88
83
  }
89
- /**
90
- * Combines permitted action values into grouped actions where applicable.
91
- * Returns a map of action keys (enum values or combined string keys) to labels.
92
- */
93
- function combinePermittedActionsV2(actions, combinedActions, customLabels) {
94
- let remaining = [...actions];
95
- const result = new Map();
96
- for (const [combinedKey, config] of Object.entries(combinedActions)) {
97
- if (config.combineActions.every((a) => remaining.includes(a))) {
98
- remaining = remaining.filter((a) => !config.combineActions.includes(a));
99
- result.set(combinedKey, config.label);
100
- }
101
- }
102
- for (const action of remaining) {
103
- result.set(action, customLabels && customLabels[action]
104
- ? customLabels[action]
105
- : (0, string_util_1.formatString)(action.toString()));
106
- }
107
- return result;
108
- }
109
- /**
110
- * Returns raw permitted action values for the given status and user permissions.
111
- * This function performs permission and visibility filtering only.
112
- * It does not apply action combination or labeling.
113
- */
114
- function getPermittedActionsV2(entityFlowConfig, currentStatus, userPermissions, data = (_) => ({})) {
115
- var _a, _b;
116
- if (!currentStatus || !entityFlowConfig[currentStatus]) {
117
- return [];
118
- }
119
- const actionConfig = (_b = (_a = entityFlowConfig[currentStatus]) === null || _a === void 0 ? void 0 : _a.actions) !== null && _b !== void 0 ? _b : {};
120
- // @ts-ignore
121
- return _getPermittedActions(actionConfig, userPermissions, data);
122
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "law-common",
3
- "version": "10.46.1-beta.8",
3
+ "version": "10.46.2",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [
@@ -1,2 +0,0 @@
1
- import { ILeaveFlowConfig } from "../../api";
2
- export declare const leaveFlowConfig: ILeaveFlowConfig;
@@ -1,127 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.leaveFlowConfig = void 0;
4
- const leave_action_enum_1 = require("../enums/leave.action.enum");
5
- const leave_status_enum_1 = require("../enums/leave.status.enum");
6
- exports.leaveFlowConfig = {
7
- [leave_status_enum_1.LeaveStatusEnum.PENDING_APPROVAL]: {
8
- actions: {
9
- // [LeaveActionEnum.READ]: {
10
- // permissions: ["LEAVE_READ_ORG"],
11
- // next: () => LeaveStatusEnum.PENDING_APPROVAL,
12
- // },
13
- [leave_action_enum_1.LeaveActionEnum.EDIT]: {
14
- permissions: ["LEAVE_UPDATE_SELF", "LEAVE_UPDATE_ORG"],
15
- next: () => leave_status_enum_1.LeaveStatusEnum.PENDING_APPROVAL,
16
- },
17
- [leave_action_enum_1.LeaveActionEnum.APPROVE]: {
18
- permissions: ["LEAVE_APPROVER_ORG"],
19
- next: () => leave_status_enum_1.LeaveStatusEnum.APPROVED,
20
- },
21
- [leave_action_enum_1.LeaveActionEnum.REJECT]: {
22
- permissions: ["LEAVE_APPROVER_ORG"],
23
- next: () => leave_status_enum_1.LeaveStatusEnum.REJECTED,
24
- },
25
- [leave_action_enum_1.LeaveActionEnum.DELETE]: {
26
- permissions: ["LEAVE_DELETE_SELF"],
27
- next: () => leave_status_enum_1.LeaveStatusEnum.DELETED,
28
- },
29
- },
30
- },
31
- [leave_status_enum_1.LeaveStatusEnum.EDIT_APPROVAL]: {
32
- actions: {
33
- // [LeaveActionEnum.READ]: {
34
- // permissions: ["LEAVE_CREATOR", "LEAVE_APPROVER_ORG"],
35
- // next: () => LeaveStatusEnum.EDIT_APPROVAL,
36
- // },
37
- [leave_action_enum_1.LeaveActionEnum.EDIT]: {
38
- permissions: ["LEAVE_UPDATE_SELF", "LEAVE_UPDATE_ORG"],
39
- next: () => leave_status_enum_1.LeaveStatusEnum.EDIT_APPROVAL,
40
- },
41
- [leave_action_enum_1.LeaveActionEnum.RECALL]: {
42
- permissions: ["LEAVE_UPDATE_SELF", "LEAVE_UPDATE_ORG"],
43
- next: () => leave_status_enum_1.LeaveStatusEnum.DELETE_APPROVAL, // Rolls back to previous state
44
- },
45
- [leave_action_enum_1.LeaveActionEnum.REJECT]: {
46
- permissions: ["LEAVE_APPROVER_ORG"],
47
- next: () => leave_status_enum_1.LeaveStatusEnum.RESOLVE_REJECTED,
48
- },
49
- [leave_action_enum_1.LeaveActionEnum.APPROVE]: {
50
- permissions: ["LEAVE_APPROVER_ORG"],
51
- next: () => leave_status_enum_1.LeaveStatusEnum.APPROVED,
52
- },
53
- },
54
- },
55
- [leave_status_enum_1.LeaveStatusEnum.DELETE_APPROVAL]: {
56
- actions: {
57
- // [LeaveActionEnum.READ]: {
58
- // permissions: ["LEAVE_CREATOR"],
59
- // next: () => LeaveStatusEnum.DELETE_APPROVAL,
60
- // },
61
- [leave_action_enum_1.LeaveActionEnum.EDIT]: {
62
- permissions: ["LEAVE_UPDATE_SELF", "LEAVE_UPDATE_ORG"],
63
- next: () => leave_status_enum_1.LeaveStatusEnum.DELETE_APPROVAL,
64
- },
65
- [leave_action_enum_1.LeaveActionEnum.RECALL]: {
66
- permissions: ["LEAVE_UPDATE_SELF", "LEAVE_UPDATE_ORG"],
67
- next: () => leave_status_enum_1.LeaveStatusEnum.DELETED, // Rolls back to previous state
68
- },
69
- [leave_action_enum_1.LeaveActionEnum.REJECT]: {
70
- permissions: ["LEAVE_APPROVER_ORG"],
71
- next: () => leave_status_enum_1.LeaveStatusEnum.RESOLVE_REJECTED,
72
- },
73
- [leave_action_enum_1.LeaveActionEnum.APPROVE]: {
74
- permissions: ["LEAVE_APPROVER_ORG"],
75
- next: () => leave_status_enum_1.LeaveStatusEnum.DELETED,
76
- },
77
- },
78
- },
79
- [leave_status_enum_1.LeaveStatusEnum.APPROVED]: {
80
- actions: {
81
- // [LeaveActionEnum.READ]: {
82
- // permissions: ["LEAVE_CREATOR", "LEAVE_APPROVER_ORG"],
83
- // next: () => LeaveStatusEnum.APPROVED,
84
- // },
85
- [leave_action_enum_1.LeaveActionEnum.EDIT]: {
86
- permissions: ["LEAVE_UPDATE_SELF", "LEAVE_UPDATE_ORG"],
87
- next: () => leave_status_enum_1.LeaveStatusEnum.EDIT_APPROVAL,
88
- },
89
- [leave_action_enum_1.LeaveActionEnum.DELETE]: {
90
- permissions: ["LEAVE_DELETE_SELF"],
91
- next: () => leave_status_enum_1.LeaveStatusEnum.DELETE_APPROVAL,
92
- },
93
- },
94
- },
95
- // [LeaveStatusEnum.DELETED]: {
96
- // actions: {
97
- // [LeaveActionEnum.READ]: {
98
- // permissions: ["LEAVE_CREATOR", "LEAVE_APPROVER_ORG"],
99
- // next: () => LeaveStatusEnum.DELETED,
100
- // },
101
- // },
102
- // },
103
- [leave_status_enum_1.LeaveStatusEnum.RESOLVE_REJECTED]: {
104
- actions: {
105
- // [LeaveActionEnum.READ]: {
106
- // permissions: ["LEAVE_CREATOR", "LEAVE_APPROVER_ORG"],
107
- // next: () => LeaveStatusEnum.RESOLVE_REJECTED,
108
- // },
109
- [leave_action_enum_1.LeaveActionEnum.EDIT]: {
110
- permissions: ["LEAVE_UPDATE_SELF", "LEAVE_UPDATE_ORG"],
111
- next: () => leave_status_enum_1.LeaveStatusEnum.EDIT_APPROVAL,
112
- },
113
- [leave_action_enum_1.LeaveActionEnum.DELETE]: {
114
- permissions: ["LEAVE_DELETE_SELF"],
115
- next: () => leave_status_enum_1.LeaveStatusEnum.DELETE_APPROVAL,
116
- },
117
- },
118
- },
119
- // [LeaveStatusEnum.REJECTED]: {
120
- // actions: {
121
- // [LeaveActionEnum.READ]: {
122
- // permissions: ["LEAVE_CREATOR", "LEAVE_APPROVER_ORG"],
123
- // next: () => LeaveStatusEnum.REJECTED,
124
- // },
125
- // },
126
- // },
127
- };