law-common 9.0.3-beta.4 → 9.0.3-beta.6
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.
|
@@ -3,12 +3,34 @@ 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";
|
|
6
8
|
import { IBillingEntity } from "./billing.entity.interface";
|
|
9
|
+
import { IBillingPaymentEntity } from "./billing_payment.entity.interface";
|
|
7
10
|
import { IBillingTimesheetEntity } from "./billing_timesheet.entity.interface";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
11
|
+
import { IBillingTransactionEntity } from "./billing_transaction.entity.interface";
|
|
12
|
+
import { IClientEntity, IClientUserMappingEntity } from "./client.entity.interface";
|
|
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";
|
|
10
31
|
import { ITimesheetEntity } from "./timesheet.entity.interface";
|
|
11
32
|
import { IUserEntity } from "./user.entity.interface";
|
|
33
|
+
import { IWorkFromHomeEntity } from "./work_from_home.entity.interface";
|
|
12
34
|
export type IApiEntity<T extends {
|
|
13
35
|
createdOn: Date;
|
|
14
36
|
updatedOn: Date;
|
|
@@ -34,14 +56,28 @@ export declare enum EntityEnum {
|
|
|
34
56
|
LEAVE = "leave",
|
|
35
57
|
ORGANIZATION = "organization",
|
|
36
58
|
BANK = "bank",
|
|
37
|
-
CLIENT_AFFILIATE = "client_affiliate"
|
|
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"
|
|
38
74
|
}
|
|
39
75
|
export type ISearchIncludeEntity<T extends EntityEnum> = {
|
|
40
76
|
name: T;
|
|
41
77
|
relations?: ISearchIncludeEntity<T>[];
|
|
42
78
|
entities?: ISearchIncludeEntity<T>[];
|
|
43
79
|
columnkeys?: EntityKeyType<T>[];
|
|
44
|
-
mappingProperties?:
|
|
80
|
+
mappingProperties?: EntityKeyType<T>[];
|
|
45
81
|
searchProperty?: EntityKeyType<T>;
|
|
46
82
|
};
|
|
47
83
|
export type IEntityServiceResponse = {
|
|
@@ -60,20 +96,22 @@ export type IBaseEntityApiResponse<T extends {
|
|
|
60
96
|
[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;
|
|
61
97
|
};
|
|
62
98
|
};
|
|
63
|
-
export type EnumEntityType<T extends EntityEnum> = T extends EntityEnum.BILLING ? IBillingEntity : T extends EntityEnum.BILLING_TIMESHEET ? IBillingTimesheetEntity : T extends EntityEnum.TIMESHEET ? ITimesheetEntity : T extends EntityEnum.USER ? IUserEntity : T extends EntityEnum.PROJECT ? IProjectEntity : T extends EntityEnum.CLIENT ? IClientEntity : never
|
|
64
|
-
|
|
99
|
+
export type EnumEntityType<T extends EntityEnum> = (T extends EntityEnum.BILLING ? IBillingEntity : T extends EntityEnum.BILLING_TIMESHEET ? IBillingTimesheetEntity : 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.BANK_HISTORY ? IBankHistoryEntity : T extends EntityEnum.BILLING_PAYMENT ? IBillingPaymentEntity : T extends EntityEnum.BILLING_TRANSACTION ? IBillingTransactionEntity : T extends EntityEnum.CLIENT_AFFILIATE ? IClientAffiliateEntity : T extends EntityEnum.CONFIGURATION ? IConfigurationEntity : T extends EntityEnum.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.ROLE_PERMISSION_MAPPING ? IRolePermissionMappingEntity : never) & {
|
|
100
|
+
id: number;
|
|
101
|
+
};
|
|
102
|
+
export type EntityRelationConfig<T extends EntityEnum> = {
|
|
65
103
|
[K in EntityEnum]?: {
|
|
66
|
-
mappingProperties:
|
|
104
|
+
mappingProperties: EntityKeyType<T>[];
|
|
67
105
|
searchProperty: EntityKeyType<K>;
|
|
68
106
|
projectProperties?: EntityKeyType<K>[];
|
|
69
107
|
};
|
|
70
108
|
};
|
|
71
|
-
export type EntityKeyType<K extends EntityEnum> = K extends
|
|
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 : K extends EntityEnum.BILLING ? keyof IBillingEntity : K extends EntityEnum.TIMESHEET ? keyof ITimesheetEntity : K extends EntityEnum.CLIENT ? keyof IClientEntity : never;
|
|
72
110
|
export type IEntityApiResponse<T extends {
|
|
73
111
|
createdOn: Date;
|
|
74
112
|
updatedOn: Date;
|
|
75
113
|
}> = IApiEntity<T>;
|
|
76
|
-
export type IEntityFilterData<T
|
|
114
|
+
export type IEntityFilterData<T extends EnumEntityType<EntityEnum>> = ConvertToArray<IEntityUpdateDto<T>> & {
|
|
77
115
|
id?: number[];
|
|
78
116
|
range?: {
|
|
79
117
|
[key in keyof T]?: [T[key], T[key]];
|
|
@@ -87,7 +125,6 @@ export type IEntityFilterData<T> = ConvertToArray<IEntityUpdateDto<T>> & {
|
|
|
87
125
|
lessThan?: {
|
|
88
126
|
[key in keyof T]?: T[key];
|
|
89
127
|
};
|
|
90
|
-
[key: string]: any;
|
|
91
128
|
relations?: ISearchIncludeEntity<EntityEnum>[];
|
|
92
129
|
entities?: ISearchIncludeEntity<EntityEnum>[];
|
|
93
130
|
columnKeys?: (keyof T)[];
|
|
@@ -19,4 +19,18 @@ 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";
|
|
22
36
|
})(EntityEnum || (exports.EntityEnum = EntityEnum = {}));
|
|
@@ -2,7 +2,7 @@ import { OrganizationStatusEnum } from "../enums/organization.entity.enum";
|
|
|
2
2
|
import { IAuditColumnEntity } from "./audit-column.entity.interface";
|
|
3
3
|
import { IEntityFilterData } from "./entity.utils.interface";
|
|
4
4
|
export interface IOrganizationEntity extends IAuditColumnEntity {
|
|
5
|
-
id:
|
|
5
|
+
id: number;
|
|
6
6
|
name: string;
|
|
7
7
|
email: string;
|
|
8
8
|
contact: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IEntityFilterData } from "../entities";
|
|
1
|
+
import { EntityEnum, EnumEntityType, 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 extends EnumEntityType<EntityEnum>>(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 extends EnumEntityType<EntityEnum>>(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 extends EnumEntityType<EntityEnum>>(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
|
/**
|