law-common 2.5.0 → 2.5.1-beta.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.
- package/dist/src/entities/enums/timesheet.status.enum.d.ts +20 -0
- package/dist/src/entities/enums/timesheet.status.enum.js +34 -0
- package/dist/src/entities/index.d.ts +1 -0
- package/dist/src/entities/index.js +1 -0
- package/dist/src/entities/interface/timesheet.entity.interface.d.ts +8 -0
- package/dist/src/model/entities/timesheet.model.d.ts +2 -1
- package/dist/src/model/entities/timesheet.model.js +2 -0
- package/package.json +35 -35
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare enum TimesheetStatusEnum {
|
|
2
|
+
ONTIME = "ontime",
|
|
3
|
+
PENDING_APPROVAL = "pending_approval",
|
|
4
|
+
RESOLVED_REJECTED = "resolved_rejected",
|
|
5
|
+
REJECTED = "rejected",
|
|
6
|
+
APPROVED = "approved",
|
|
7
|
+
DELETED = "deleted"
|
|
8
|
+
}
|
|
9
|
+
export declare enum TimesheetActionEnum {
|
|
10
|
+
VIEW = "view",
|
|
11
|
+
EDIT = "edit",
|
|
12
|
+
DELETE = "delete",
|
|
13
|
+
CREATE = "create",
|
|
14
|
+
APPROVE = "approve",
|
|
15
|
+
REJECT = "reject"
|
|
16
|
+
}
|
|
17
|
+
export declare namespace TimesheetStatusEnum {
|
|
18
|
+
function getNames(): string[];
|
|
19
|
+
function parse(value: string): TimesheetStatusEnum;
|
|
20
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TimesheetActionEnum = exports.TimesheetStatusEnum = void 0;
|
|
4
|
+
var TimesheetStatusEnum;
|
|
5
|
+
(function (TimesheetStatusEnum) {
|
|
6
|
+
TimesheetStatusEnum["ONTIME"] = "ontime";
|
|
7
|
+
TimesheetStatusEnum["PENDING_APPROVAL"] = "pending_approval";
|
|
8
|
+
TimesheetStatusEnum["RESOLVED_REJECTED"] = "resolved_rejected";
|
|
9
|
+
TimesheetStatusEnum["REJECTED"] = "rejected";
|
|
10
|
+
TimesheetStatusEnum["APPROVED"] = "approved";
|
|
11
|
+
TimesheetStatusEnum["DELETED"] = "deleted";
|
|
12
|
+
})(TimesheetStatusEnum || (exports.TimesheetStatusEnum = TimesheetStatusEnum = {}));
|
|
13
|
+
var TimesheetActionEnum;
|
|
14
|
+
(function (TimesheetActionEnum) {
|
|
15
|
+
TimesheetActionEnum["VIEW"] = "view";
|
|
16
|
+
TimesheetActionEnum["EDIT"] = "edit";
|
|
17
|
+
TimesheetActionEnum["DELETE"] = "delete";
|
|
18
|
+
TimesheetActionEnum["CREATE"] = "create";
|
|
19
|
+
TimesheetActionEnum["APPROVE"] = "approve";
|
|
20
|
+
TimesheetActionEnum["REJECT"] = "reject";
|
|
21
|
+
})(TimesheetActionEnum || (exports.TimesheetActionEnum = TimesheetActionEnum = {}));
|
|
22
|
+
(function (TimesheetStatusEnum) {
|
|
23
|
+
function getNames() {
|
|
24
|
+
return Object.values(TimesheetStatusEnum).filter((value) => typeof value === "string");
|
|
25
|
+
}
|
|
26
|
+
TimesheetStatusEnum.getNames = getNames;
|
|
27
|
+
function parse(value) {
|
|
28
|
+
if (Object.values(TimesheetStatusEnum).includes(value)) {
|
|
29
|
+
return value;
|
|
30
|
+
}
|
|
31
|
+
throw new Error("Invalid timesheet status");
|
|
32
|
+
}
|
|
33
|
+
TimesheetStatusEnum.parse = parse;
|
|
34
|
+
})(TimesheetStatusEnum || (exports.TimesheetStatusEnum = TimesheetStatusEnum = {}));
|
|
@@ -39,3 +39,4 @@ export * from "./enums/history_operation.enum";
|
|
|
39
39
|
export * from "./interface/billing_history.entity.interface";
|
|
40
40
|
export * from "./interface/billing_timesheet_history.entity.interface";
|
|
41
41
|
export * from "./enums/history_operation.enum";
|
|
42
|
+
export * from "./enums/timesheet.status.enum";
|
|
@@ -55,3 +55,4 @@ __exportStar(require("./enums/history_operation.enum"), exports);
|
|
|
55
55
|
__exportStar(require("./interface/billing_history.entity.interface"), exports);
|
|
56
56
|
__exportStar(require("./interface/billing_timesheet_history.entity.interface"), exports);
|
|
57
57
|
__exportStar(require("./enums/history_operation.enum"), exports);
|
|
58
|
+
__exportStar(require("./enums/timesheet.status.enum"), exports);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TimesheetActionEnum, TimesheetStatusEnum } from "../enums/timesheet.status.enum";
|
|
1
2
|
import { IAuditColumnEntity } from "./audit-column.entity.interface";
|
|
2
3
|
import { IEntityCreateDto, IEntityFilterData, IEntityUpdateDto } from "./entity.utils.interface";
|
|
3
4
|
export interface ITimesheetEntity extends IAuditColumnEntity {
|
|
@@ -8,10 +9,17 @@ export interface ITimesheetEntity extends IAuditColumnEntity {
|
|
|
8
9
|
description?: string;
|
|
9
10
|
dateCode: string;
|
|
10
11
|
totalDuration: number;
|
|
12
|
+
status?: TimesheetStatusEnum;
|
|
11
13
|
}
|
|
12
14
|
export interface ITimesheetEntityCreateDto extends IEntityCreateDto<ITimesheetEntity> {
|
|
15
|
+
status?: TimesheetStatusEnum;
|
|
16
|
+
}
|
|
17
|
+
export interface IActionDataDto {
|
|
18
|
+
action: TimesheetActionEnum;
|
|
19
|
+
remark?: string;
|
|
13
20
|
}
|
|
14
21
|
export interface ITimesheetEntityUpdateDto extends IEntityUpdateDto<ITimesheetEntity> {
|
|
22
|
+
actionData?: IActionDataDto;
|
|
15
23
|
}
|
|
16
24
|
export interface ITimesheetEntityFilterData extends IEntityFilterData<ITimesheetEntity> {
|
|
17
25
|
createdBy?: number[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ITimesheetEntity } from "../../entities";
|
|
1
|
+
import { ITimesheetEntity, TimesheetStatusEnum } from "../../entities";
|
|
2
2
|
import { ITimesheetEntityModel } from "./interface/timesheet.model.interface";
|
|
3
3
|
export declare class TimesheetEntityModel implements ITimesheetEntityModel {
|
|
4
4
|
id: number;
|
|
@@ -12,6 +12,7 @@ export declare class TimesheetEntityModel implements ITimesheetEntityModel {
|
|
|
12
12
|
createdOn: Date;
|
|
13
13
|
updatedBy: number;
|
|
14
14
|
updatedOn: Date;
|
|
15
|
+
status: TimesheetStatusEnum;
|
|
15
16
|
/**
|
|
16
17
|
* @param timesheets - Array of TimesheetModel instances
|
|
17
18
|
* @return - Array of Timesheet Model
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TimesheetEntityModel = void 0;
|
|
4
|
+
const entities_1 = require("../../entities");
|
|
4
5
|
class TimesheetEntityModel {
|
|
5
6
|
constructor() {
|
|
6
7
|
this.id = 0;
|
|
@@ -14,6 +15,7 @@ class TimesheetEntityModel {
|
|
|
14
15
|
this.createdOn = new Date();
|
|
15
16
|
this.updatedBy = 1;
|
|
16
17
|
this.updatedOn = new Date();
|
|
18
|
+
this.status = entities_1.TimesheetStatusEnum.PENDING_APPROVAL;
|
|
17
19
|
}
|
|
18
20
|
/**
|
|
19
21
|
* @param timesheets - Array of TimesheetModel instances
|
package/package.json
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "law-common",
|
|
3
|
-
"version": "2.5.
|
|
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.5.1-beta.2",
|
|
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
|
+
}
|