law-common 9.0.3-beta.6 → 9.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/constants/entity_constants.d.ts +1 -0
- package/dist/src/constants/entity_constants.js +2 -1
- package/dist/src/entities/interface/entity.utils.interface.d.ts +21 -57
- package/dist/src/entities/interface/entity.utils.interface.js +0 -14
- package/dist/src/utils/helper.fn.util.d.ts +4 -4
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.timesheetEnterThreshold = exports.timesheetThreshold = exports.timesheetViewThreshold = void 0;
|
|
3
|
+
exports.timesheetMinimumTotalDuration = exports.timesheetEnterThreshold = exports.timesheetThreshold = exports.timesheetViewThreshold = void 0;
|
|
4
4
|
exports.timesheetViewThreshold = "timesheetViewThreshold";
|
|
5
5
|
exports.timesheetThreshold = "timesheetThreshold";
|
|
6
6
|
exports.timesheetEnterThreshold = "timesheetEnterThreshold";
|
|
7
|
+
exports.timesheetMinimumTotalDuration = 15;
|
|
@@ -3,34 +3,12 @@ import { Modify } from "../../misc/interface/modify.interface";
|
|
|
3
3
|
import { EntitySearchConstraintTypeEnum } from "../enums/entity_search_constraint_type.enum";
|
|
4
4
|
import { HistoryOperationEnum } from "../enums/history_operation.enum";
|
|
5
5
|
import { IAuditColumnEntity } from "./audit-column.entity.interface";
|
|
6
|
-
import { IBankEntity } from "./bank.entity.interface";
|
|
7
|
-
import { IBankHistoryEntity } from "./bank_history.entity.interface";
|
|
8
6
|
import { IBillingEntity } from "./billing.entity.interface";
|
|
9
|
-
import { IBillingPaymentEntity } from "./billing_payment.entity.interface";
|
|
10
7
|
import { IBillingTimesheetEntity } from "./billing_timesheet.entity.interface";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { IClientAffiliateEntity } from "./client_affiliate_entity.interface";
|
|
14
|
-
import { IConfigurationEntity } from "./configuration.entity.interface";
|
|
15
|
-
import { ICountryEntity } from "./country.entity.interface";
|
|
16
|
-
import { IDesignationEntity } from "./designation.entity.interface";
|
|
17
|
-
import { IExpenseTypeEntity } from "./expense_type.entity.interface";
|
|
18
|
-
import { IIndustryEntity } from "./industry.entity.interface";
|
|
19
|
-
import { IIntermediaryBankEntity } from "./intermediary_bank.entity.interface";
|
|
20
|
-
import { ILeaveEntity } from "./leave.entity.interface";
|
|
21
|
-
import { IOfficeLocationEntity } from "./office.location.entity";
|
|
22
|
-
import { IOrganizationEntity } from "./organization.entity.interface";
|
|
23
|
-
import { IPermissionEntity } from "./permission.entity.interface";
|
|
24
|
-
import { IProjectEntity, IProjectUserMappingEntity } from "./project.entity.interface";
|
|
25
|
-
import { IRateEntity } from "./rate.entity.interface";
|
|
26
|
-
import { IReimbursementEntity } from "./reimbursement.entity.interface";
|
|
27
|
-
import { IReimbursementExpenseEntity } from "./reimbursement_expense.entity.interface";
|
|
28
|
-
import { IRoleEntity } from "./role.entity.interface";
|
|
29
|
-
import { IRolePermissionMappingEntity } from "./role.permission.mapping.entity.interface";
|
|
30
|
-
import { ITaskEntity } from "./task.entity.interface";
|
|
8
|
+
import { IClientEntity } from "./client.entity.interface";
|
|
9
|
+
import { IProjectEntity } from "./project.entity.interface";
|
|
31
10
|
import { ITimesheetEntity } from "./timesheet.entity.interface";
|
|
32
11
|
import { IUserEntity } from "./user.entity.interface";
|
|
33
|
-
import { IWorkFromHomeEntity } from "./work_from_home.entity.interface";
|
|
34
12
|
export type IApiEntity<T extends {
|
|
35
13
|
createdOn: Date;
|
|
36
14
|
updatedOn: Date;
|
|
@@ -56,32 +34,21 @@ export declare enum EntityEnum {
|
|
|
56
34
|
LEAVE = "leave",
|
|
57
35
|
ORGANIZATION = "organization",
|
|
58
36
|
BANK = "bank",
|
|
59
|
-
CLIENT_AFFILIATE = "client_affiliate"
|
|
60
|
-
BANK_HISTORY = "bank_history",
|
|
61
|
-
BILLING_PAYMENT = "billing_payment",
|
|
62
|
-
BILLING_TRANSACTION = "billing_transaction",
|
|
63
|
-
CONFIGURATION = "configuration",
|
|
64
|
-
COUNTRY = "country",
|
|
65
|
-
EXPENSE_TYPE = "expense_type",
|
|
66
|
-
INDUSTRY = "industry",
|
|
67
|
-
INTERMEDIARY_BANK = "intermediary_bank",
|
|
68
|
-
OFFICE_LOCATION = "office_location",
|
|
69
|
-
PERMISSION = "permission",
|
|
70
|
-
ROLE = "role",
|
|
71
|
-
PROJECT_USER_MAPPING = "project_user_mapping",
|
|
72
|
-
CLIENT_USER_MAPPING = "client_user_mapping",
|
|
73
|
-
ROLE_PERMISSION_MAPPING = "role_permission_mapping"
|
|
37
|
+
CLIENT_AFFILIATE = "client_affiliate"
|
|
74
38
|
}
|
|
75
|
-
export type ISearchIncludeEntity
|
|
76
|
-
name:
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
searchProperty?: EntityKeyType<T>;
|
|
39
|
+
export type ISearchIncludeEntity = {
|
|
40
|
+
name: EntityEnum;
|
|
41
|
+
mappingProperties?: string[];
|
|
42
|
+
searchProperty?: string;
|
|
43
|
+
relations?: ISearchIncludeEntity[];
|
|
44
|
+
entities?: ISearchIncludeEntity[];
|
|
82
45
|
};
|
|
83
46
|
export type IEntityServiceResponse = {
|
|
84
|
-
[
|
|
47
|
+
[EntityEnum.BILLING]?: IBaseEntityServiceResponse<IBillingEntity>;
|
|
48
|
+
[EntityEnum.BILLING_TIMESHEET]?: IBaseEntityServiceResponse<IBillingTimesheetEntity>;
|
|
49
|
+
[EntityEnum.TIMESHEET]?: IBaseEntityServiceResponse<ITimesheetEntity>;
|
|
50
|
+
[EntityEnum.USER]?: IBaseEntityServiceResponse<IUserEntity>;
|
|
51
|
+
[EntityEnum.PROJECT]?: IBaseEntityServiceResponse<IProjectEntity>;
|
|
85
52
|
};
|
|
86
53
|
export type IBaseEntityServiceResponse<T> = {
|
|
87
54
|
baseEntities: T[];
|
|
@@ -96,22 +63,19 @@ export type IBaseEntityApiResponse<T extends {
|
|
|
96
63
|
[K in EntityEnum]?: K extends EntityEnum.BILLING ? IBaseEntityApiResponse<IBillingEntity> : K extends EntityEnum.BILLING_TIMESHEET ? IBaseEntityApiResponse<IBillingTimesheetEntity> : K extends EntityEnum.TIMESHEET ? IBaseEntityApiResponse<ITimesheetEntity> : K extends EntityEnum.USER ? IBaseEntityApiResponse<IUserEntity> : K extends EntityEnum.PROJECT ? IBaseEntityApiResponse<IProjectEntity> : K extends EntityEnum.CLIENT ? IBaseEntityApiResponse<IClientEntity> : never;
|
|
97
64
|
};
|
|
98
65
|
};
|
|
99
|
-
export type
|
|
100
|
-
id: number;
|
|
101
|
-
};
|
|
102
|
-
export type EntityRelationConfig<T extends EntityEnum> = {
|
|
66
|
+
export type EntityRelationConfig<T> = {
|
|
103
67
|
[K in EntityEnum]?: {
|
|
104
|
-
mappingProperties:
|
|
68
|
+
mappingProperties: (keyof T)[];
|
|
105
69
|
searchProperty: EntityKeyType<K>;
|
|
106
70
|
projectProperties?: EntityKeyType<K>[];
|
|
107
71
|
};
|
|
108
72
|
};
|
|
109
|
-
export type EntityKeyType<K extends EntityEnum> = K extends EntityEnum.USER ? keyof IUserEntity : K extends EntityEnum.PROJECT ? keyof IProjectEntity : K extends EntityEnum.BILLING_TIMESHEET ? keyof IBillingTimesheetEntity :
|
|
73
|
+
export type EntityKeyType<K extends EntityEnum> = K extends EntityEnum.USER ? keyof IUserEntity : K extends EntityEnum.PROJECT ? keyof IProjectEntity : K extends EntityEnum.BILLING_TIMESHEET ? keyof IBillingTimesheetEntity : never;
|
|
110
74
|
export type IEntityApiResponse<T extends {
|
|
111
75
|
createdOn: Date;
|
|
112
76
|
updatedOn: Date;
|
|
113
77
|
}> = IApiEntity<T>;
|
|
114
|
-
export type IEntityFilterData<T
|
|
78
|
+
export type IEntityFilterData<T> = ConvertToArray<IEntityUpdateDto<T>> & {
|
|
115
79
|
id?: number[];
|
|
116
80
|
range?: {
|
|
117
81
|
[key in keyof T]?: [T[key], T[key]];
|
|
@@ -125,9 +89,9 @@ export type IEntityFilterData<T extends EnumEntityType<EntityEnum>> = ConvertToA
|
|
|
125
89
|
lessThan?: {
|
|
126
90
|
[key in keyof T]?: T[key];
|
|
127
91
|
};
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
92
|
+
[key: string]: any;
|
|
93
|
+
relations?: ISearchIncludeEntity[];
|
|
94
|
+
entities?: ISearchIncludeEntity[];
|
|
131
95
|
};
|
|
132
96
|
export type IEntityHistoryParsed = {
|
|
133
97
|
parsedData: any;
|
|
@@ -19,18 +19,4 @@ var EntityEnum;
|
|
|
19
19
|
EntityEnum["ORGANIZATION"] = "organization";
|
|
20
20
|
EntityEnum["BANK"] = "bank";
|
|
21
21
|
EntityEnum["CLIENT_AFFILIATE"] = "client_affiliate";
|
|
22
|
-
EntityEnum["BANK_HISTORY"] = "bank_history";
|
|
23
|
-
EntityEnum["BILLING_PAYMENT"] = "billing_payment";
|
|
24
|
-
EntityEnum["BILLING_TRANSACTION"] = "billing_transaction";
|
|
25
|
-
EntityEnum["CONFIGURATION"] = "configuration";
|
|
26
|
-
EntityEnum["COUNTRY"] = "country";
|
|
27
|
-
EntityEnum["EXPENSE_TYPE"] = "expense_type";
|
|
28
|
-
EntityEnum["INDUSTRY"] = "industry";
|
|
29
|
-
EntityEnum["INTERMEDIARY_BANK"] = "intermediary_bank";
|
|
30
|
-
EntityEnum["OFFICE_LOCATION"] = "office_location";
|
|
31
|
-
EntityEnum["PERMISSION"] = "permission";
|
|
32
|
-
EntityEnum["ROLE"] = "role";
|
|
33
|
-
EntityEnum["PROJECT_USER_MAPPING"] = "project_user_mapping";
|
|
34
|
-
EntityEnum["CLIENT_USER_MAPPING"] = "client_user_mapping";
|
|
35
|
-
EntityEnum["ROLE_PERMISSION_MAPPING"] = "role_permission_mapping";
|
|
36
22
|
})(EntityEnum || (exports.EntityEnum = EntityEnum = {}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IEntityFilterData } from "../entities";
|
|
2
2
|
export declare function groupByFunction<T, K>(list: T[], keyGetter: (input: T) => K): Map<K, T[]>;
|
|
3
3
|
export declare function groupByOneToOneFunction<T, K>(list: T[], keyGetter: (input: T) => K): Map<K, T>;
|
|
4
4
|
export declare function convertMapToObject<K, T>(map: Map<K, T>): {
|
|
@@ -104,17 +104,17 @@ export declare function newRemoved<T>(existing: T[], incoming: T[]): {
|
|
|
104
104
|
present: T[];
|
|
105
105
|
};
|
|
106
106
|
export declare function getEnumNames(enumType: object): string[];
|
|
107
|
-
export declare function getFilterByPermission<T
|
|
107
|
+
export declare function getFilterByPermission<T>(permissionFilterConfig: {
|
|
108
108
|
[key: string]: IEntityFilterData<T>;
|
|
109
109
|
}, propertyName: keyof T, userPermission: string, filterDto: IEntityFilterData<T>, emptyValue?: any): {
|
|
110
110
|
[x: string]: any;
|
|
111
111
|
};
|
|
112
|
-
export declare function getFilterByPermissionFn<T
|
|
112
|
+
export declare function getFilterByPermissionFn<T>(permissionFilterConfig: {
|
|
113
113
|
[key: string]: () => Promise<IEntityFilterData<T>>;
|
|
114
114
|
}, propertyName: keyof T, userPermission: string, filterDto: IEntityFilterData<T>, emptyValue?: any): Promise<{
|
|
115
115
|
[x: string]: any;
|
|
116
116
|
}>;
|
|
117
|
-
export declare function getPropertyFilterByPermissionFn<T
|
|
117
|
+
export declare function getPropertyFilterByPermissionFn<T>(permissionFilterConfig: {
|
|
118
118
|
[key: string]: () => Promise<IEntityFilterData<T>>;
|
|
119
119
|
}, propertyNames: (keyof T)[], userPermission: string, filterDto: IEntityFilterData<T>, emptyValue?: any): Promise<IEntityFilterData<T>>;
|
|
120
120
|
/**
|