law-common 1.2.19 → 1.2.21
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/api/index.d.ts +1 -0
- package/dist/api/index.js +1 -0
- package/dist/api/interface/project.entity.response.d.ts +22 -0
- package/dist/api/interface/project.entity.response.js +2 -0
- package/dist/entities/enums/project.entity.enum.d.ts +15 -0
- package/dist/entities/enums/project.entity.enum.js +20 -0
- package/dist/entities/index.d.ts +1 -0
- package/dist/entities/index.js +1 -0
- package/dist/entities/interface/project.entity.interface.d.ts +53 -0
- package/dist/entities/interface/project.entity.interface.js +2 -0
- package/dist/utils/helper.fn.util.d.ts +1 -0
- package/dist/utils/helper.fn.util.js +4 -0
- package/package.json +1 -1
package/dist/api/index.d.ts
CHANGED
|
@@ -15,3 +15,4 @@ export * from "./interface/industry.entity.response";
|
|
|
15
15
|
export * from "./interface/configuration.entity.response";
|
|
16
16
|
export * from "./interface/rate.entity.response";
|
|
17
17
|
export * from "./interface/client.entity.response";
|
|
18
|
+
export * from "./interface/project.entity.response";
|
package/dist/api/index.js
CHANGED
|
@@ -31,3 +31,4 @@ __exportStar(require("./interface/industry.entity.response"), exports);
|
|
|
31
31
|
__exportStar(require("./interface/configuration.entity.response"), exports);
|
|
32
32
|
__exportStar(require("./interface/rate.entity.response"), exports);
|
|
33
33
|
__exportStar(require("./interface/client.entity.response"), exports);
|
|
34
|
+
__exportStar(require("./interface/project.entity.response"), exports);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { IApiEntity, IDesignationApiEntity, IProjectCreateDtoExtra, IProjectEntity, IProjectEntityDependent } from "../../entities";
|
|
2
|
+
import { IClientApiEntity } from "./client.entity.response";
|
|
3
|
+
import { IRateApiEntity } from "./rate.entity.response";
|
|
4
|
+
import { IUserApiEntity } from "./user.entity.api";
|
|
5
|
+
export type IProjectApiEntity = IApiEntity<IProjectEntity>;
|
|
6
|
+
export type IProjectApiEntityArray = IProjectApiEntity[];
|
|
7
|
+
export type IProjectApiEntityDependent = IProjectApiEntity & IProjectEntityDependent & IProjectCreateDtoExtra;
|
|
8
|
+
export type IProjectEntityGet = {
|
|
9
|
+
projects: IProjectApiEntityDependent[];
|
|
10
|
+
users: {
|
|
11
|
+
[key: string]: IUserApiEntity;
|
|
12
|
+
};
|
|
13
|
+
clients: {
|
|
14
|
+
[key: string]: IClientApiEntity;
|
|
15
|
+
};
|
|
16
|
+
designations?: {
|
|
17
|
+
[key: string]: IDesignationApiEntity;
|
|
18
|
+
};
|
|
19
|
+
rates?: {
|
|
20
|
+
[key: string]: IRateApiEntity;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare enum ProjectBillingTypeEnum {
|
|
2
|
+
HOURLY = "HOURLY",
|
|
3
|
+
FIXED = "FIXED",
|
|
4
|
+
ADHOC = "ADHOC"
|
|
5
|
+
}
|
|
6
|
+
export declare enum ProjectStatusEnum {
|
|
7
|
+
ACTIVE = "ACTIVE",
|
|
8
|
+
INACTIVE = "INACTIVE",
|
|
9
|
+
DELETED = "DELETED",
|
|
10
|
+
COMPLETED = "COMPLETED",
|
|
11
|
+
ON_HOLD = "ON_HOLD",
|
|
12
|
+
SUSPENDED = "SUSPENDED",
|
|
13
|
+
CANCELLED = "CANCELLED",
|
|
14
|
+
ARCHIVED = "ARCHIVED"
|
|
15
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProjectStatusEnum = exports.ProjectBillingTypeEnum = void 0;
|
|
4
|
+
var ProjectBillingTypeEnum;
|
|
5
|
+
(function (ProjectBillingTypeEnum) {
|
|
6
|
+
ProjectBillingTypeEnum["HOURLY"] = "HOURLY";
|
|
7
|
+
ProjectBillingTypeEnum["FIXED"] = "FIXED";
|
|
8
|
+
ProjectBillingTypeEnum["ADHOC"] = "ADHOC";
|
|
9
|
+
})(ProjectBillingTypeEnum || (exports.ProjectBillingTypeEnum = ProjectBillingTypeEnum = {}));
|
|
10
|
+
var ProjectStatusEnum;
|
|
11
|
+
(function (ProjectStatusEnum) {
|
|
12
|
+
ProjectStatusEnum["ACTIVE"] = "ACTIVE";
|
|
13
|
+
ProjectStatusEnum["INACTIVE"] = "INACTIVE";
|
|
14
|
+
ProjectStatusEnum["DELETED"] = "DELETED";
|
|
15
|
+
ProjectStatusEnum["COMPLETED"] = "COMPLETED";
|
|
16
|
+
ProjectStatusEnum["ON_HOLD"] = "ON_HOLD";
|
|
17
|
+
ProjectStatusEnum["SUSPENDED"] = "SUSPENDED";
|
|
18
|
+
ProjectStatusEnum["CANCELLED"] = "CANCELLED";
|
|
19
|
+
ProjectStatusEnum["ARCHIVED"] = "ARCHIVED";
|
|
20
|
+
})(ProjectStatusEnum || (exports.ProjectStatusEnum = ProjectStatusEnum = {}));
|
package/dist/entities/index.d.ts
CHANGED
|
@@ -13,3 +13,4 @@ export * from "./interface/industry.entity.interface";
|
|
|
13
13
|
export * from "./interface/configuration.entity.interface";
|
|
14
14
|
export * from "./interface/rate.entity.interface";
|
|
15
15
|
export * from "./interface/client.entity.interface";
|
|
16
|
+
export * from "./interface/project.entity.interface";
|
package/dist/entities/index.js
CHANGED
|
@@ -29,3 +29,4 @@ __exportStar(require("./interface/industry.entity.interface"), exports);
|
|
|
29
29
|
__exportStar(require("./interface/configuration.entity.interface"), exports);
|
|
30
30
|
__exportStar(require("./interface/rate.entity.interface"), exports);
|
|
31
31
|
__exportStar(require("./interface/client.entity.interface"), exports);
|
|
32
|
+
__exportStar(require("./interface/project.entity.interface"), exports);
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { CurrencyEnum, TimeUnitEnum } from "../../enums";
|
|
2
|
+
import { ProjectBillingTypeEnum, ProjectStatusEnum } from "../enums/project.entity.enum";
|
|
3
|
+
import { UserRoleEnum } from "../enums/user.entity.enum";
|
|
4
|
+
import { IAuditColumnEntity } from "./audit-column.entity.interface";
|
|
5
|
+
import { IEntityCreateDto, IEntityFilterData, IEntityUpdateDto } from "./entity.utils.interface";
|
|
6
|
+
export interface IProjectEntity extends IAuditColumnEntity {
|
|
7
|
+
id: number;
|
|
8
|
+
name: string;
|
|
9
|
+
clientId: number;
|
|
10
|
+
startDate: string;
|
|
11
|
+
currency: CurrencyEnum;
|
|
12
|
+
billingType: ProjectBillingTypeEnum;
|
|
13
|
+
billingRate: string;
|
|
14
|
+
status: ProjectStatusEnum;
|
|
15
|
+
organizationId: number;
|
|
16
|
+
description?: string;
|
|
17
|
+
expectedEndDate?: string;
|
|
18
|
+
actualEndDate?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface IProjectEntityDependent {
|
|
21
|
+
partnerIds: number[];
|
|
22
|
+
resourceIds: number[];
|
|
23
|
+
}
|
|
24
|
+
export type IProjectExclude = "organizationId" | "billingRate";
|
|
25
|
+
export interface IProjectHourlyRate {
|
|
26
|
+
id: number;
|
|
27
|
+
rate: number;
|
|
28
|
+
unit: TimeUnitEnum.HOUR;
|
|
29
|
+
}
|
|
30
|
+
export interface IProjectCreateDtoExtra {
|
|
31
|
+
projectBillingRate: IProjectHourlyRate[] | IProjectFixedMonthlyRate | IProjectAdhocRate;
|
|
32
|
+
}
|
|
33
|
+
export interface IProjectFixedMonthlyRate {
|
|
34
|
+
rate: number;
|
|
35
|
+
unit: TimeUnitEnum.MONTH;
|
|
36
|
+
maxEstimatedHours: number;
|
|
37
|
+
}
|
|
38
|
+
export interface IProjectAdhocRate {
|
|
39
|
+
rate: number;
|
|
40
|
+
maxEstimatedHours: number;
|
|
41
|
+
}
|
|
42
|
+
export interface IProjectEntityCreateDto extends Omit<IEntityCreateDto<IProjectEntity>, IProjectExclude>, IProjectEntityDependent, IProjectCreateDtoExtra {
|
|
43
|
+
}
|
|
44
|
+
export interface IProjectEntityUpdateDto extends Omit<IEntityUpdateDto<IProjectEntity>, IProjectExclude>, Partial<IProjectEntityDependent> {
|
|
45
|
+
}
|
|
46
|
+
export interface IProjectEntityFilterDto extends IEntityFilterData<IProjectEntity> {
|
|
47
|
+
}
|
|
48
|
+
export interface IProjectUserMappingEntity extends IAuditColumnEntity {
|
|
49
|
+
id: number;
|
|
50
|
+
projectId: number;
|
|
51
|
+
userId: number;
|
|
52
|
+
role: UserRoleEnum;
|
|
53
|
+
}
|
|
@@ -10,6 +10,7 @@ exports.arrayIntersection = arrayIntersection;
|
|
|
10
10
|
exports.arrayIntersectionWith = arrayIntersectionWith;
|
|
11
11
|
exports.arrayUnion = arrayUnion;
|
|
12
12
|
exports.newRemoved = newRemoved;
|
|
13
|
+
exports.getEnumNames = getEnumNames;
|
|
13
14
|
function groupByFunction(list, keyGetter) {
|
|
14
15
|
const map = new Map();
|
|
15
16
|
list.forEach((item) => {
|
|
@@ -137,3 +138,6 @@ function newRemoved(existing, incoming) {
|
|
|
137
138
|
const present = arrayUnion(arrayIntersection(existing, incoming), added);
|
|
138
139
|
return { added, deleted, present };
|
|
139
140
|
}
|
|
141
|
+
function getEnumNames(enumType) {
|
|
142
|
+
return Object.values(enumType).filter((value) => typeof value === "string");
|
|
143
|
+
}
|