law-common 2.8.1-beta.26 → 2.8.1-beta.32

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.
@@ -63,3 +63,4 @@ export * from "./interface/billing.history.api";
63
63
  export * from "./interface/billing_timesheet_history.api";
64
64
  export * from "./interface/reimbursement_history.api";
65
65
  export * from "./interface/reimbursement_expense.api";
66
+ export * from "./interface/timesheet_history_entity.response";
@@ -79,3 +79,4 @@ __exportStar(require("./interface/billing.history.api"), exports);
79
79
  __exportStar(require("./interface/billing_timesheet_history.api"), exports);
80
80
  __exportStar(require("./interface/reimbursement_history.api"), exports);
81
81
  __exportStar(require("./interface/reimbursement_expense.api"), exports);
82
+ __exportStar(require("./interface/timesheet_history_entity.response"), exports);
@@ -0,0 +1,10 @@
1
+ export type ITimesheetHistoryEntitySearchByConstraintResponse = {
2
+ id: number;
3
+ createdBy: number;
4
+ changedLogs: {
5
+ key: string;
6
+ newValue: any;
7
+ oldValue: any;
8
+ timestamp: string;
9
+ }[];
10
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ export declare enum EntitySearchConstraintTypeEnum {
2
+ COLUMN_DEPTH = "column_depth"
3
+ }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EntitySearchConstraintTypeEnum = void 0;
4
+ var EntitySearchConstraintTypeEnum;
5
+ (function (EntitySearchConstraintTypeEnum) {
6
+ EntitySearchConstraintTypeEnum["COLUMN_DEPTH"] = "column_depth";
7
+ })(EntitySearchConstraintTypeEnum || (exports.EntitySearchConstraintTypeEnum = EntitySearchConstraintTypeEnum = {}));
@@ -0,0 +1,14 @@
1
+ export declare enum TimesheetEntityKeysEnum {
2
+ userId = "userId",
3
+ projectId = "projectId",
4
+ task = "task",
5
+ description = "description",
6
+ dateCode = "dateCode",
7
+ totalDuration = "totalDuration",
8
+ status = "status",
9
+ remark = "remark"
10
+ }
11
+ export declare namespace TimesheetEntityKeysEnum {
12
+ const keyLabelMap: Record<TimesheetEntityKeysEnum, string>;
13
+ function getLabel(key: TimesheetEntityKeysEnum): string;
14
+ }
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TimesheetEntityKeysEnum = void 0;
4
+ const error_key_enum_1 = require("../../enums/error.key.enum");
5
+ const exceptions_1 = require("../../exceptions");
6
+ var TimesheetEntityKeysEnum;
7
+ (function (TimesheetEntityKeysEnum) {
8
+ TimesheetEntityKeysEnum["userId"] = "userId";
9
+ TimesheetEntityKeysEnum["projectId"] = "projectId";
10
+ TimesheetEntityKeysEnum["task"] = "task";
11
+ TimesheetEntityKeysEnum["description"] = "description";
12
+ TimesheetEntityKeysEnum["dateCode"] = "dateCode";
13
+ TimesheetEntityKeysEnum["totalDuration"] = "totalDuration";
14
+ TimesheetEntityKeysEnum["status"] = "status";
15
+ TimesheetEntityKeysEnum["remark"] = "remark";
16
+ })(TimesheetEntityKeysEnum || (exports.TimesheetEntityKeysEnum = TimesheetEntityKeysEnum = {}));
17
+ (function (TimesheetEntityKeysEnum) {
18
+ TimesheetEntityKeysEnum.keyLabelMap = {
19
+ [TimesheetEntityKeysEnum.userId]: "User ID",
20
+ [TimesheetEntityKeysEnum.projectId]: "Project ID",
21
+ [TimesheetEntityKeysEnum.task]: "Task",
22
+ [TimesheetEntityKeysEnum.description]: "Description",
23
+ [TimesheetEntityKeysEnum.dateCode]: "Record Code",
24
+ [TimesheetEntityKeysEnum.totalDuration]: "Total Duration",
25
+ [TimesheetEntityKeysEnum.status]: "Status",
26
+ [TimesheetEntityKeysEnum.remark]: "Remark",
27
+ };
28
+ function getLabel(key) {
29
+ if (!Object.values(TimesheetEntityKeysEnum).includes(key)) {
30
+ throw new exceptions_1.AppBadRequestException({
31
+ key: error_key_enum_1.ErrorKeyEnum.TIMESHEET_KEY,
32
+ message: ["Invalid key name"],
33
+ });
34
+ }
35
+ const label = TimesheetEntityKeysEnum.keyLabelMap[key];
36
+ if (!label) {
37
+ throw new exceptions_1.AppBadRequestException({
38
+ key: error_key_enum_1.ErrorKeyEnum.TIMESHEET_KEY,
39
+ message: ["Invalid key name"],
40
+ });
41
+ }
42
+ return label;
43
+ }
44
+ TimesheetEntityKeysEnum.getLabel = getLabel;
45
+ })(TimesheetEntityKeysEnum || (exports.TimesheetEntityKeysEnum = TimesheetEntityKeysEnum = {}));
@@ -46,3 +46,5 @@ export * from "./enums/configuration.type.enum";
46
46
  export * from "./enums/project_user_status.enum";
47
47
  export * from "./interface/reimbursement_history.entity.interface";
48
48
  export * from "./interface/reimbursement_expense.entity.interface";
49
+ export * from "./enums/entity_search_constraint_type.enum";
50
+ export * from "./enums/timesheet_entity_keys.enum";
@@ -62,3 +62,5 @@ __exportStar(require("./enums/configuration.type.enum"), exports);
62
62
  __exportStar(require("./enums/project_user_status.enum"), exports);
63
63
  __exportStar(require("./interface/reimbursement_history.entity.interface"), exports);
64
64
  __exportStar(require("./interface/reimbursement_expense.entity.interface"), exports);
65
+ __exportStar(require("./enums/entity_search_constraint_type.enum"), exports);
66
+ __exportStar(require("./enums/timesheet_entity_keys.enum"), exports);
@@ -1,3 +1,4 @@
1
+ import { EntitySearchConstraintTypeEnum } from "../enums/entity_search_constraint_type.enum";
1
2
  import { HistoryOperationEnum } from "../enums/history_operation.enum";
2
3
  import { IAuditColumnEntity } from "./audit-column.entity.interface";
3
4
  import { IEntityCreateDto, IEntityFilterData } from "./entity.utils.interface";
@@ -14,3 +15,13 @@ export interface ITimesheetHistoryUpdateDto extends IEntityCreateDto<ITimesheetH
14
15
  export interface ITimesheetHistorySearchDto extends IEntityFilterData<ITimesheetHistoryEntity> {
15
16
  }
16
17
  export declare const timesheetHistoryExcludeKeys: string[];
18
+ export type IEntitySearchConstraint = {
19
+ entityId: number[];
20
+ constraint: {
21
+ since: {
22
+ type: EntitySearchConstraintTypeEnum;
23
+ columnKey: string;
24
+ value: number;
25
+ };
26
+ };
27
+ };
@@ -4,5 +4,6 @@ export declare enum ErrorKeyEnum {
4
4
  TIMESHEET_FLOW_ACTION = "TIMESHEET_FLOW_ACTION",
5
5
  BILLING_FLOW_ACTION = "BILLING_FLOW_ACTION",
6
6
  REIMBURSEMENT_FLOW_ACTION = "REIMBURSEMENT_FLOW_ACTION",
7
- REIMBURSEMENT_EXPENSE_FLOW_ACTION = "REIMBURSEMENT_EXPENSE_FLOW_ACTION"
7
+ REIMBURSEMENT_EXPENSE_FLOW_ACTION = "REIMBURSEMENT_EXPENSE_FLOW_ACTION",
8
+ TIMESHEET_KEY = "TIMESHEET_KEY"
8
9
  }
@@ -9,4 +9,5 @@ var ErrorKeyEnum;
9
9
  ErrorKeyEnum["BILLING_FLOW_ACTION"] = "BILLING_FLOW_ACTION";
10
10
  ErrorKeyEnum["REIMBURSEMENT_FLOW_ACTION"] = "REIMBURSEMENT_FLOW_ACTION";
11
11
  ErrorKeyEnum["REIMBURSEMENT_EXPENSE_FLOW_ACTION"] = "REIMBURSEMENT_EXPENSE_FLOW_ACTION";
12
+ ErrorKeyEnum["TIMESHEET_KEY"] = "TIMESHEET_KEY";
12
13
  })(ErrorKeyEnum || (exports.ErrorKeyEnum = ErrorKeyEnum = {}));
package/package.json CHANGED
@@ -1,35 +1,35 @@
1
- {
2
- "name": "law-common",
3
- "version": "2.8.1-beta.26",
4
- "description": "",
5
- "main": "dist/index.js",
6
- "files": [
7
- "dist/**/*"
8
- ],
9
- "scripts": {
10
- "clean": "rm -rf dist",
11
- "build": "npm run clean && tsc",
12
- "publish:beta": "npm version prerelease --preid beta && git push && npm run build && npm publish --tag beta",
13
- "publish:patch": "npm version patch && git push && npm run build && npm publish",
14
- "publish:minor": "npm version minor && git push && npm run build && npm publish",
15
- "publish:major": "npm version major && git push && npm run build && npm publish",
16
- "link": "npm run build && npm link",
17
- "test": "jest"
18
- },
19
- "keywords": [],
20
- "author": "",
21
- "license": "ISC",
22
- "devDependencies": {
23
- "@types/jest": "^29.5.13",
24
- "@types/node": "^22.6.1",
25
- "jest": "^29.7.0",
26
- "ts-jest": "^29.2.5",
27
- "ts-node": "^10.9.2",
28
- "typescript": "^5.6.2"
29
- },
30
- "dependencies": {
31
- "@types/express": "^5.0.0",
32
- "@types/multer": "^1.4.12",
33
- "date-fns": "^4.1.0"
34
- }
35
- }
1
+ {
2
+ "name": "law-common",
3
+ "version": "2.8.1-beta.32",
4
+ "description": "",
5
+ "main": "dist/index.js",
6
+ "files": [
7
+ "dist/**/*"
8
+ ],
9
+ "scripts": {
10
+ "clean": "rm -rf dist",
11
+ "build": "npm run clean && tsc",
12
+ "publish:beta": "npm version prerelease --preid beta && git push && npm run build && npm publish --tag beta",
13
+ "publish:patch": "npm version patch && git push && npm run build && npm publish",
14
+ "publish:minor": "npm version minor && git push && npm run build && npm publish",
15
+ "publish:major": "npm version major && git push && npm run build && npm publish",
16
+ "link": "npm run build && npm link",
17
+ "test": "jest"
18
+ },
19
+ "keywords": [],
20
+ "author": "",
21
+ "license": "ISC",
22
+ "devDependencies": {
23
+ "@types/jest": "^29.5.13",
24
+ "@types/node": "^22.6.1",
25
+ "jest": "^29.7.0",
26
+ "ts-jest": "^29.2.5",
27
+ "ts-node": "^10.9.2",
28
+ "typescript": "^5.6.2"
29
+ },
30
+ "dependencies": {
31
+ "@types/express": "^5.0.0",
32
+ "@types/multer": "^1.4.12",
33
+ "date-fns": "^4.1.0"
34
+ }
35
+ }