law-common 10.10.0 → 10.11.1-beta.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/api/interface/project.entity.response.d.ts +8 -2
- package/dist/src/api/interface/timesheet.entity.response.interface.d.ts +7 -0
- package/dist/src/constants/entity_constants.d.ts +1 -0
- package/dist/src/constants/entity_constants.js +2 -1
- package/dist/src/utils/helper.fn.util.d.ts +6 -0
- package/dist/src/utils/helper.fn.util.js +4 -0
- package/dist/src/utils/models/date-code.model.util.d.ts +1 -0
- package/dist/src/utils/models/date-code.model.util.js +11 -0
- package/package.json +35 -35
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import { IApiEntity, IDesignationApiEntity, IProjectCreateDtoExtra, IProjectEntity,
|
|
1
|
+
import { IApiEntity, IDesignationApiEntity, IProjectCreateDtoExtra, IProjectEntity, IProjectUserDto } from "../../entities";
|
|
2
2
|
import { IClientApiEntity } from "./client.entity.response";
|
|
3
3
|
import { IRateApiEntity } from "./rate.entity.response";
|
|
4
4
|
import { IUserApiEntity } from "./user.entity.api";
|
|
5
5
|
export type IProjectApiEntity = IApiEntity<IProjectEntity>;
|
|
6
6
|
export type IProjectApiEntityArray = IProjectApiEntity[];
|
|
7
|
-
export
|
|
7
|
+
export interface IProjectUserDtoResponse extends IProjectUserDto {
|
|
8
|
+
updatedOn: string;
|
|
9
|
+
}
|
|
10
|
+
export interface IProjectEntityDependentResponse {
|
|
11
|
+
users: IProjectUserDtoResponse[];
|
|
12
|
+
}
|
|
13
|
+
export type IProjectApiEntityDependent = IProjectApiEntity & IProjectEntityDependentResponse & IProjectCreateDtoExtra;
|
|
8
14
|
export type IProjectEntityGet = {
|
|
9
15
|
projects: IProjectApiEntityDependent[];
|
|
10
16
|
users: {
|
|
@@ -25,6 +25,7 @@ export type ITimesheetFlowConfig = {
|
|
|
25
25
|
actions: {
|
|
26
26
|
[key in TimesheetActionEnum]?: {
|
|
27
27
|
permissions: string[];
|
|
28
|
+
isApplicable?: (data: ITimesheetFlowContextData) => boolean;
|
|
28
29
|
next: (data: ITimesheetFlowContextData) => TimesheetStatusEnum;
|
|
29
30
|
};
|
|
30
31
|
};
|
|
@@ -35,4 +36,10 @@ export type ITimesheetFlowContextData = {
|
|
|
35
36
|
projectUserMapping: IProjectUserMappingEntity;
|
|
36
37
|
buffer: number;
|
|
37
38
|
dto: ITimesheetEntityUpdateDto;
|
|
39
|
+
timesheetEnterThresholdValue: number;
|
|
40
|
+
};
|
|
41
|
+
export type ITimesheetFlowAfterTimesheetEnterThreshold = {
|
|
42
|
+
[key in TimesheetStatusEnum]?: {
|
|
43
|
+
validActions: TimesheetActionEnum[];
|
|
44
|
+
};
|
|
38
45
|
};
|
|
@@ -9,3 +9,4 @@ export declare const leaveImplicitDays: string[];
|
|
|
9
9
|
export declare const freezeTimesheetAfterBillingStatus: BillingStatusEnum;
|
|
10
10
|
export declare const usersToExcludeFromSearchResponse: string[];
|
|
11
11
|
export declare const systemUsers: string[];
|
|
12
|
+
export declare const reimbursementExpenseProjectUserInactiveBuffer: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.systemUsers = exports.usersToExcludeFromSearchResponse = exports.freezeTimesheetAfterBillingStatus = exports.leaveImplicitDays = exports.reimbursementPaymentProcessorPermissionName = exports.toDoListMinimumEstimatedDuration = exports.timesheetMinimumTotalDuration = exports.timesheetEnterThreshold = exports.timesheetThreshold = exports.timesheetViewThreshold = void 0;
|
|
3
|
+
exports.reimbursementExpenseProjectUserInactiveBuffer = exports.systemUsers = exports.usersToExcludeFromSearchResponse = exports.freezeTimesheetAfterBillingStatus = exports.leaveImplicitDays = exports.reimbursementPaymentProcessorPermissionName = exports.toDoListMinimumEstimatedDuration = exports.timesheetMinimumTotalDuration = exports.timesheetEnterThreshold = exports.timesheetThreshold = exports.timesheetViewThreshold = void 0;
|
|
4
4
|
const entities_1 = require("../entities");
|
|
5
5
|
exports.timesheetViewThreshold = "timesheetViewThreshold";
|
|
6
6
|
exports.timesheetThreshold = "timesheetThreshold";
|
|
@@ -12,3 +12,4 @@ exports.leaveImplicitDays = ["Saturday", "Sunday"];
|
|
|
12
12
|
exports.freezeTimesheetAfterBillingStatus = entities_1.BillingStatusEnum.PENDING_CLIENT_REVIEW;
|
|
13
13
|
exports.usersToExcludeFromSearchResponse = ["DB migration"];
|
|
14
14
|
exports.systemUsers = ["DB migration"];
|
|
15
|
+
exports.reimbursementExpenseProjectUserInactiveBuffer = 24 * 60;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { EntityEnum, EnumEntityType, IEntityFilterData } from "../entities";
|
|
2
|
+
import { Modify } from "../misc";
|
|
2
3
|
export declare function groupByFunction<T, K>(list: T[], keyGetter: (input: T) => K): Map<K, T[]>;
|
|
3
4
|
export declare function groupByOneToOneFunction<T, K>(list: T[], keyGetter: (input: T) => K): Map<K, T>;
|
|
4
5
|
export declare function convertMapToObject<K, T>(map: Map<K, T>): {
|
|
@@ -167,3 +168,8 @@ export declare function numberToWordsIndian(numStr: string): string;
|
|
|
167
168
|
*/
|
|
168
169
|
export declare function minutesToHoursMinutes(totalMinutes: number): string;
|
|
169
170
|
export declare function createKeyLabelMap<Entity>(): Record<keyof Entity, string>;
|
|
171
|
+
export declare function transformDate<T extends {
|
|
172
|
+
date: Date;
|
|
173
|
+
}>(obj: T): Modify<T, {
|
|
174
|
+
date: string;
|
|
175
|
+
}>;
|
|
@@ -30,6 +30,7 @@ exports.setResponseValue = setResponseValue;
|
|
|
30
30
|
exports.numberToWordsIndian = numberToWordsIndian;
|
|
31
31
|
exports.minutesToHoursMinutes = minutesToHoursMinutes;
|
|
32
32
|
exports.createKeyLabelMap = createKeyLabelMap;
|
|
33
|
+
exports.transformDate = transformDate;
|
|
33
34
|
const util_constants_1 = require("../constants/util.constants");
|
|
34
35
|
function groupByFunction(list, keyGetter) {
|
|
35
36
|
const map = new Map();
|
|
@@ -367,3 +368,6 @@ function createKeyLabelMap() {
|
|
|
367
368
|
},
|
|
368
369
|
});
|
|
369
370
|
}
|
|
371
|
+
function transformDate(obj) {
|
|
372
|
+
return Object.assign(Object.assign({}, obj), { date: obj.date.toISOString() });
|
|
373
|
+
}
|
|
@@ -74,5 +74,16 @@ class DateCodeModel {
|
|
|
74
74
|
endDate: new DateCodeModel(DateCodeModel.fromDate(end)),
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
|
+
getDateInIST() {
|
|
78
|
+
// Step 1: Get UTC midnight for dateCode
|
|
79
|
+
const baseDateUTC = this.getDate(); // already parses yyyyMMdd correctly
|
|
80
|
+
// Step 2: Convert to IST by adding 5.5 hours
|
|
81
|
+
const istOffset = 5.5 * 60 * 60 * 1000;
|
|
82
|
+
const baseDateIST = new Date(baseDateUTC.getTime() + istOffset);
|
|
83
|
+
// Step 3: Apply current IST time (hours/min/sec)
|
|
84
|
+
const now = new Date();
|
|
85
|
+
baseDateIST.setHours(now.getHours(), now.getMinutes(), now.getSeconds(), now.getMilliseconds());
|
|
86
|
+
return baseDateIST;
|
|
87
|
+
}
|
|
77
88
|
}
|
|
78
89
|
exports.DateCodeModel = DateCodeModel;
|
package/package.json
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "law-common",
|
|
3
|
-
"version": "10.
|
|
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": "10.11.1-beta.0",
|
|
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
|
+
}
|