law-common 11.3.6-beta.0 → 11.3.6-beta.1

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.
@@ -18,6 +18,7 @@ export interface IBillingParticulars {
18
18
  includeGSTNumber: 0 | 1;
19
19
  poNumber: Nullable<string>;
20
20
  name: string;
21
+ showINRAmount?: boolean;
21
22
  }
22
23
  export interface IBillingCreateDtoExtra {
23
24
  particulars: IBillingParticulars[];
@@ -7,9 +7,7 @@ export declare enum ConfigurationKeyEnum {
7
7
  TIMESHEET_ENTER_THRESHOLD = "timesheetEnterThreshold",
8
8
  ORGANIZATION_BILLING_OVERDUE_THRESHOLD = "organization_billing_overdue_threshold",
9
9
  PROJECT_ENTITY_USAGE_NOTIFICATION_SENT_PERCENTAGE_RESET = "projectEntityUsageNotificationSentPercentageReset",
10
- LEAVE_ESCALATION = "leaveEscalation",
11
- TIMESHEET_AUTO_CLASSIFICATION = "timesheetAutoClassification",
12
- TIMESHEET_CLASSIFICATION_NOTIFICATION = "timesheetClassificationNotification"
10
+ LEAVE_ESCALATION = "leaveEscalation"
13
11
  }
14
12
  export declare namespace ConfigurationKeyEnum {
15
13
  function getNames(): string[];
@@ -14,8 +14,6 @@ var ConfigurationKeyEnum;
14
14
  ConfigurationKeyEnum["ORGANIZATION_BILLING_OVERDUE_THRESHOLD"] = "organization_billing_overdue_threshold";
15
15
  ConfigurationKeyEnum["PROJECT_ENTITY_USAGE_NOTIFICATION_SENT_PERCENTAGE_RESET"] = "projectEntityUsageNotificationSentPercentageReset";
16
16
  ConfigurationKeyEnum["LEAVE_ESCALATION"] = "leaveEscalation";
17
- ConfigurationKeyEnum["TIMESHEET_AUTO_CLASSIFICATION"] = "timesheetAutoClassification";
18
- ConfigurationKeyEnum["TIMESHEET_CLASSIFICATION_NOTIFICATION"] = "timesheetClassificationNotification";
19
17
  })(ConfigurationKeyEnum || (exports.ConfigurationKeyEnum = ConfigurationKeyEnum = {}));
20
18
  (function (ConfigurationKeyEnum) {
21
19
  function getNames() {
@@ -43,8 +41,6 @@ var ConfigurationKeyEnum;
43
41
  [ConfigurationKeyEnum.PENDING_APPROVAL_TIMESHEET_REMINDER]: cron_jobs_name_enum_1.CronJobNames.PENDING_APPROVAL_TIMESHEET_REMINDER,
44
42
  [ConfigurationKeyEnum.PROJECT_ENTITY_USAGE_NOTIFICATION_SENT_PERCENTAGE_RESET]: cron_jobs_name_enum_1.CronJobNames.PROJECT_ENTITY_USAGE_NOTIFICATION_SENT_PERCENTAGE_RESET,
45
43
  [ConfigurationKeyEnum.LEAVE_ESCALATION]: cron_jobs_name_enum_1.CronJobNames.LEAVE_ESCALATION,
46
- [ConfigurationKeyEnum.TIMESHEET_AUTO_CLASSIFICATION]: cron_jobs_name_enum_1.CronJobNames.TIMESHEET_AUTO_CLASSIFICATION,
47
- [ConfigurationKeyEnum.TIMESHEET_CLASSIFICATION_NOTIFICATION]: cron_jobs_name_enum_1.CronJobNames.TIMESHEET_CLASSIFICATION_NOTIFICATION,
48
44
  };
49
45
  return cronJobConfigurationKeyMapping[configurationKey];
50
46
  }
@@ -1,7 +1,5 @@
1
1
  export declare enum CronJobNames {
2
2
  PENDING_APPROVAL_TIMESHEET_REMINDER = "pending_approval_timesheet_reminder",
3
3
  PROJECT_ENTITY_USAGE_NOTIFICATION_SENT_PERCENTAGE_RESET = "project_entity_usage_notification_sent_percentage_reset",
4
- LEAVE_ESCALATION = "leave_escalation",
5
- TIMESHEET_AUTO_CLASSIFICATION = "timesheet_auto_classification",
6
- TIMESHEET_CLASSIFICATION_NOTIFICATION = "timesheet_classification_notification"
4
+ LEAVE_ESCALATION = "leave_escalation"
7
5
  }
@@ -6,6 +6,4 @@ var CronJobNames;
6
6
  CronJobNames["PENDING_APPROVAL_TIMESHEET_REMINDER"] = "pending_approval_timesheet_reminder";
7
7
  CronJobNames["PROJECT_ENTITY_USAGE_NOTIFICATION_SENT_PERCENTAGE_RESET"] = "project_entity_usage_notification_sent_percentage_reset";
8
8
  CronJobNames["LEAVE_ESCALATION"] = "leave_escalation";
9
- CronJobNames["TIMESHEET_AUTO_CLASSIFICATION"] = "timesheet_auto_classification";
10
- CronJobNames["TIMESHEET_CLASSIFICATION_NOTIFICATION"] = "timesheet_classification_notification";
11
9
  })(CronJobNames || (exports.CronJobNames = CronJobNames = {}));
@@ -7,9 +7,7 @@ export declare enum TimesheetActionEnum {
7
7
  REJECT = "reject",
8
8
  RECALL = "recall",
9
9
  BILLING_UPDATE = "billing_update",
10
- MOVE_TIMESHEET = "move_timesheet",
11
- CLASSIFY = "classify",
12
- AUTO_CLASSIFY = "auto_classify"
10
+ MOVE_TIMESHEET = "move_timesheet"
13
11
  }
14
12
  export declare namespace TimesheetActionEnum {
15
13
  function getLabel(action: TimesheetActionEnum): string;
@@ -14,8 +14,6 @@ var TimesheetActionEnum;
14
14
  TimesheetActionEnum["RECALL"] = "recall";
15
15
  TimesheetActionEnum["BILLING_UPDATE"] = "billing_update";
16
16
  TimesheetActionEnum["MOVE_TIMESHEET"] = "move_timesheet";
17
- TimesheetActionEnum["CLASSIFY"] = "classify";
18
- TimesheetActionEnum["AUTO_CLASSIFY"] = "auto_classify";
19
17
  })(TimesheetActionEnum || (exports.TimesheetActionEnum = TimesheetActionEnum = {}));
20
18
  (function (TimesheetActionEnum) {
21
19
  const actionLabelMap = {
@@ -28,8 +26,6 @@ var TimesheetActionEnum;
28
26
  [TimesheetActionEnum.RECALL]: "Recall",
29
27
  [TimesheetActionEnum.BILLING_UPDATE]: "Billing Update",
30
28
  [TimesheetActionEnum.MOVE_TIMESHEET]: "Move Timesheet",
31
- [TimesheetActionEnum.CLASSIFY]: "Classify",
32
- [TimesheetActionEnum.AUTO_CLASSIFY]: "Auto Classify",
33
29
  };
34
30
  function getLabel(action) {
35
31
  if (!Object.values(TimesheetActionEnum).includes(action)) {
@@ -39,7 +39,6 @@ export * from "./interface/billing_timesheet_history.entity.interface";
39
39
  export * from "./enums/history_operation.enum";
40
40
  export * from "./enums/timesheet.action.enum";
41
41
  export * from "./enums/timesheet.status.enum";
42
- export * from "./enums/timesheet.classification.status.enum";
43
42
  export * from "./enums/billing.action.enum";
44
43
  export * from "./enums/configuration.type.enum";
45
44
  export * from "./enums/project_user_status.enum";
@@ -55,7 +55,6 @@ __exportStar(require("./interface/billing_timesheet_history.entity.interface"),
55
55
  __exportStar(require("./enums/history_operation.enum"), exports);
56
56
  __exportStar(require("./enums/timesheet.action.enum"), exports);
57
57
  __exportStar(require("./enums/timesheet.status.enum"), exports);
58
- __exportStar(require("./enums/timesheet.classification.status.enum"), exports);
59
58
  __exportStar(require("./enums/billing.action.enum"), exports);
60
59
  __exportStar(require("./enums/configuration.type.enum"), exports);
61
60
  __exportStar(require("./enums/project_user_status.enum"), exports);
@@ -1,5 +1,4 @@
1
1
  import { TimesheetActionEnum } from "../enums/timesheet.action.enum";
2
- import { TimesheetClassificationStatusEnum } from "../enums/timesheet.classification.status.enum";
3
2
  import { TimesheetStatusEnum } from "../enums/timesheet.status.enum";
4
3
  import { ProjectUserMappingEntityModel } from "../model/project-user-mapping.entity.model";
5
4
  import { TimesheetEntityModel } from "../model/timesheet.entity.model";
@@ -17,15 +16,10 @@ export interface ITimesheetEntity extends IEntityAuditColumn {
17
16
  status: TimesheetStatusEnum;
18
17
  remark?: string;
19
18
  billingId?: number;
20
- billedDuration?: number;
21
- notBilledDuration?: number;
22
- classificationStatus: TimesheetClassificationStatusEnum;
23
- classifiedBy?: number;
24
19
  }
25
- export type ITimesheetEntityExclude = "status" | "billedDuration" | "notBilledDuration" | "classificationStatus" | "classifiedBy";
20
+ export type ITimesheetEntityExclude = "status";
26
21
  export interface ITimesheetEntityCreateDto extends Omit<IEntityCreateDto<ITimesheetEntity>, ITimesheetEntityExclude> {
27
22
  status?: TimesheetStatusEnum;
28
- classificationStatus?: TimesheetClassificationStatusEnum;
29
23
  }
30
24
  export interface ITimesheetEntityCreateDtoValidationData {
31
25
  projectUserMappingEntities: ProjectUserMappingEntityModel[];
@@ -7,7 +7,6 @@ import { RelationConfigs } from "../interface/relation-config.interface";
7
7
  import { BaseEntityModel } from "./base.entity.model";
8
8
  import { ClientEntityModel } from "./client.entity.model";
9
9
  import { ProjectUserMappingEntityModel } from "./project-user-mapping.entity.model";
10
- import { TimesheetEntityModel } from "./timesheet.entity.model";
11
10
  import { UserEntityModel } from "./user.entity.model";
12
11
  export declare class ProjectEntityModel extends BaseEntityModel<EntityEnum.PROJECT> implements IProjectEntity {
13
12
  id: number;
@@ -35,11 +34,10 @@ export declare class ProjectEntityModel extends BaseEntityModel<EntityEnum.PROJE
35
34
  userMappings?: (UserEntityModel & ProjectUserMappingEntityModel)[];
36
35
  projectUserMappings?: ProjectUserMappingEntityModel[];
37
36
  client: ClientEntityModel;
38
- timesheets: TimesheetEntityModel[];
39
37
  static fromEntity(entity: IProjectEntity): ProjectEntityModel;
40
- static relationConfigs: RelationConfigs<[EntityEnum.PROJECT_USER_MAPPING, EntityEnum.CLIENT, EntityEnum.TIMESHEET], EntityEnum.PROJECT>;
38
+ static relationConfigs: RelationConfigs<[EntityEnum.PROJECT_USER_MAPPING, EntityEnum.CLIENT], EntityEnum.PROJECT>;
41
39
  populateUsers(users: UserEntityModel[], projectUserMapping: ProjectUserMappingEntityModel[]): void;
42
- getRelationConfigs(): [import("../interface/relation-config.interface").IRelationConfig<EntityEnum.PROJECT_USER_MAPPING, EntityEnum.PROJECT>, import("../interface/relation-config.interface").IRelationConfig<EntityEnum.CLIENT, EntityEnum.PROJECT>, import("../interface/relation-config.interface").IRelationConfig<EntityEnum.TIMESHEET, EntityEnum.PROJECT>];
40
+ getRelationConfigs(): [import("../interface/relation-config.interface").IRelationConfig<EntityEnum.PROJECT_USER_MAPPING, EntityEnum.PROJECT>, import("../interface/relation-config.interface").IRelationConfig<EntityEnum.CLIENT, EntityEnum.PROJECT>];
43
41
  isForeignCurrencyProject(): boolean;
44
42
  get parsedBillingRate(): any;
45
43
  isHourlyProject(): boolean;
@@ -47,16 +45,4 @@ export declare class ProjectEntityModel extends BaseEntityModel<EntityEnum.PROJE
47
45
  isAdhocProject(): boolean;
48
46
  get partnersOwnerUsersOfProject(): UserEntityModel[];
49
47
  get clientName(): string;
50
- get timesheetsOfProject(): TimesheetEntityModel[];
51
- getTimesheetsGroupedByUserId(): Map<number, TimesheetEntityModel[]>;
52
- getAllPartnersClassificationData(): Map<number, {
53
- resourceCounts: {
54
- resourceName: string;
55
- timesheetCount: number;
56
- }[];
57
- resources: {
58
- resourceName: string;
59
- timesheets: TimesheetEntityModel[];
60
- }[];
61
- }>;
62
48
  }
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ProjectEntityModel = void 0;
4
4
  const enums_1 = require("../../enums");
5
- const helper_fn_util_1 = require("../../utils/helper.fn.util");
6
5
  const project_revenue_split_enum_1 = require("../enums/project-revenue-split.enum");
7
6
  const project_entity_enum_1 = require("../enums/project.entity.enum");
8
7
  const relation_type_enum_1 = require("../enums/relation-type.enum");
@@ -30,7 +29,6 @@ class ProjectEntityModel extends base_entity_model_1.BaseEntityModel {
30
29
  this.clientQuoteId = null;
31
30
  this.users = [];
32
31
  this.client = {};
33
- this.timesheets = [];
34
32
  }
35
33
  static fromEntity(entity) {
36
34
  const result = new ProjectEntityModel(entity_utils_interface_1.EntityEnum.PROJECT);
@@ -114,35 +112,6 @@ class ProjectEntityModel extends base_entity_model_1.BaseEntityModel {
114
112
  get clientName() {
115
113
  return this.client.name;
116
114
  }
117
- get timesheetsOfProject() {
118
- return this.timesheets;
119
- }
120
- getTimesheetsGroupedByUserId() {
121
- return (0, helper_fn_util_1.groupByFunction)(this.timesheets, (t) => t.userId);
122
- }
123
- getAllPartnersClassificationData() {
124
- var _a, _b, _c;
125
- const result = new Map();
126
- const timesheetsGroupedByUserId = this.getTimesheetsGroupedByUserId();
127
- const partnerMappings = (_b = (_a = this.projectUserMappings) === null || _a === void 0 ? void 0 : _a.filter((m) => m.isMappingOfPartnerOwner())) !== null && _b !== void 0 ? _b : [];
128
- for (const pm of partnerMappings) {
129
- result.set(pm.userId, { resourceCounts: [], resources: [] });
130
- }
131
- for (const mapping of (_c = this.projectUserMappings) !== null && _c !== void 0 ? _c : []) {
132
- if (!mapping.user)
133
- continue;
134
- const userTimesheets = timesheetsGroupedByUserId.get(mapping.userId);
135
- if (!(userTimesheets === null || userTimesheets === void 0 ? void 0 : userTimesheets.length))
136
- continue;
137
- for (const pm of partnerMappings) {
138
- const entry = result.get(pm.userId);
139
- const resourceName = mapping.userId === pm.userId ? "You" : mapping.user.name;
140
- entry.resourceCounts.push({ resourceName, timesheetCount: userTimesheets.length });
141
- entry.resources.push({ resourceName, timesheets: userTimesheets });
142
- }
143
- }
144
- return result;
145
- }
146
115
  }
147
116
  exports.ProjectEntityModel = ProjectEntityModel;
148
117
  ProjectEntityModel.relationConfigs = [
@@ -164,13 +133,4 @@ ProjectEntityModel.relationConfigs = [
164
133
  key: "clientId",
165
134
  },
166
135
  },
167
- {
168
- name: entity_utils_interface_1.EntityEnum.TIMESHEET,
169
- relation: relation_type_enum_1.RelationType.MANY,
170
- key: "timesheets",
171
- mapKeyConfig: {
172
- relationKey: "projectId",
173
- key: "id",
174
- },
175
- },
176
136
  ];
@@ -1,11 +1,9 @@
1
1
  import { CurrencyEnum } from "../../enums";
2
- import { TimesheetClassificationStatusEnum } from "../enums/timesheet.classification.status.enum";
3
2
  import { TimesheetStatusEnum } from "../enums/timesheet.status.enum";
4
3
  import { EntityEnum } from "../interface/entity.utils.interface";
5
4
  import { RelationConfigs } from "../interface/relation-config.interface";
6
5
  import { ITimesheetEntity } from "../interface/timesheet.entity.interface";
7
6
  import { BaseEntityModel } from "./base.entity.model";
8
- import { ProjectEntityModel } from "./project.entity.model";
9
7
  import { TimesheetHistoryEntityModel } from "./timesheet_history.entity.model";
10
8
  import { UserEntityModel } from "./user.entity.model";
11
9
  export declare class TimesheetEntityModel extends BaseEntityModel<EntityEnum.TIMESHEET> implements ITimesheetEntity {
@@ -19,38 +17,17 @@ export declare class TimesheetEntityModel extends BaseEntityModel<EntityEnum.TIM
19
17
  status: TimesheetStatusEnum;
20
18
  remark?: string;
21
19
  billingId?: number;
22
- billedDuration?: number;
23
- notBilledDuration?: number;
24
- classificationStatus: TimesheetClassificationStatusEnum;
25
- classifiedBy?: number;
26
20
  createdBy: number;
27
21
  updatedBy: number;
28
22
  createdOn: number;
29
23
  updatedOn: number;
30
24
  user?: UserEntityModel;
31
25
  history?: TimesheetHistoryEntityModel[];
32
- project?: ProjectEntityModel;
33
26
  static fromEntity(entity: ITimesheetEntity): TimesheetEntityModel;
34
27
  getRelationConfigs(): any[];
35
- static relationConfigs: RelationConfigs<[EntityEnum.USER, EntityEnum.TIMESHEET_HISTORY, EntityEnum.PROJECT], EntityEnum.TIMESHEET>;
28
+ static relationConfigs: RelationConfigs<[EntityEnum.USER, EntityEnum.TIMESHEET_HISTORY], EntityEnum.TIMESHEET>;
36
29
  getTimesheetAmount(projectCurrency: CurrencyEnum): number;
37
30
  get formattedDate(): string;
38
31
  get userName(): string | undefined;
39
32
  get latestStatusFromHistory(): TimesheetStatusEnum | undefined;
40
- getDateCodeDay(): number;
41
- getClassificationDeadline(): Date;
42
- static readonly CLASSIFICATION_WINDOW_CONFIG: {
43
- bufferDays: number;
44
- windows: ({
45
- startDay: number;
46
- endDay: number;
47
- } | {
48
- startDay: number;
49
- endDay: null;
50
- })[];
51
- };
52
- static getTimesheetAutoClassificationDateCodeRange(): {
53
- windowStart: string;
54
- windowEnd: string;
55
- } | null;
56
33
  }
@@ -1,14 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TimesheetEntityModel = void 0;
4
- const date_fns_1 = require("date-fns");
5
4
  const utils_1 = require("../../utils");
6
5
  const relation_type_enum_1 = require("../enums/relation-type.enum");
7
- const timesheet_classification_status_enum_1 = require("../enums/timesheet.classification.status.enum");
8
6
  const timesheet_status_enum_1 = require("../enums/timesheet.status.enum");
9
7
  const entity_utils_interface_1 = require("../interface/entity.utils.interface");
10
8
  const base_entity_model_1 = require("./base.entity.model");
11
- // Use this mdoel for UI & BACKEND
12
9
  class TimesheetEntityModel extends base_entity_model_1.BaseEntityModel {
13
10
  constructor() {
14
11
  super(...arguments);
@@ -19,11 +16,17 @@ class TimesheetEntityModel extends base_entity_model_1.BaseEntityModel {
19
16
  this.dateCode = "";
20
17
  this.totalDuration = 0;
21
18
  this.status = timesheet_status_enum_1.TimesheetStatusEnum.CREATE_APPROVAL;
22
- this.classificationStatus = timesheet_classification_status_enum_1.TimesheetClassificationStatusEnum.PENDING;
23
19
  this.createdBy = 0;
24
20
  this.updatedBy = 0;
25
21
  this.createdOn = 0;
26
22
  this.updatedOn = 0;
23
+ // get latestStatusFromHistory(): TimesheetStatusEnum | undefined {
24
+ // const allHistoryModelSortedByIdInDesc = [...(this.history || [])].sort((a, b) => b.id - a.id);
25
+ // for (const model of allHistoryModelSortedByIdInDesc) {
26
+ // if (model.hasStatusKeyInData()) return model.status;
27
+ // }
28
+ // return undefined;
29
+ // }
27
30
  }
28
31
  static fromEntity(entity) {
29
32
  const result = new TimesheetEntityModel(entity_utils_interface_1.EntityEnum.TIMESHEET);
@@ -50,52 +53,6 @@ class TimesheetEntityModel extends base_entity_model_1.BaseEntityModel {
50
53
  const sorted = [...(this.history || [])].sort((a, b) => b.id - a.id);
51
54
  return (_a = sorted[1]) === null || _a === void 0 ? void 0 : _a.status;
52
55
  }
53
- // get latestStatusFromHistory(): TimesheetStatusEnum | undefined {
54
- // const allHistoryModelSortedByIdInDesc = [...(this.history || [])].sort((a, b) => b.id - a.id);
55
- // for (const model of allHistoryModelSortedByIdInDesc) {
56
- // if (model.hasStatusKeyInData()) return model.status;
57
- // }
58
- // return undefined;
59
- // }
60
- getDateCodeDay() {
61
- const normalized = this.dateCode.length === 6 ? `20${this.dateCode}` : this.dateCode;
62
- return parseInt(normalized.substring(6, 8), 10);
63
- }
64
- getClassificationDeadline() {
65
- const normalized = this.dateCode.length === 6 ? `20${this.dateCode}` : this.dateCode;
66
- const year = parseInt(normalized.substring(0, 4), 10);
67
- const month = parseInt(normalized.substring(4, 6), 10);
68
- const day = this.getDateCodeDay();
69
- const { bufferDays, windows } = TimesheetEntityModel.CLASSIFICATION_WINDOW_CONFIG;
70
- const window = windows.find((w) => day >= w.startDay && (w.endDay === null || day <= w.endDay));
71
- if (!window) {
72
- return new Date(year, month - 1, day + bufferDays);
73
- }
74
- if (window.endDay === null) {
75
- return new Date(year, month, 3);
76
- }
77
- return new Date(year, month - 1, window.endDay + bufferDays);
78
- }
79
- static getTimesheetAutoClassificationDateCodeRange() {
80
- var _a;
81
- const { bufferDays, windows } = TimesheetEntityModel.CLASSIFICATION_WINDOW_CONFIG;
82
- const today = new Date();
83
- for (const window of windows) {
84
- // Last window (endDay === null) belongs to the previous month
85
- const targetDate = window.endDay === null ? (0, date_fns_1.subMonths)(today, 1) : today;
86
- const year = targetDate.getFullYear();
87
- const month = targetDate.getMonth();
88
- const actualEndDay = (_a = window.endDay) !== null && _a !== void 0 ? _a : (0, date_fns_1.lastDayOfMonth)(targetDate).getDate();
89
- const triggerDate = (0, date_fns_1.addDays)(new Date(year, month, actualEndDay), bufferDays);
90
- if (triggerDate.getFullYear() === today.getFullYear() && triggerDate.getMonth() === today.getMonth() && triggerDate.getDate() === today.getDate()) {
91
- return {
92
- windowStart: (0, date_fns_1.format)(new Date(year, month, window.startDay), "yyyyMMdd"),
93
- windowEnd: (0, date_fns_1.format)(new Date(year, month, actualEndDay), "yyyyMMdd"),
94
- };
95
- }
96
- }
97
- return null;
98
- }
99
56
  }
100
57
  exports.TimesheetEntityModel = TimesheetEntityModel;
101
58
  TimesheetEntityModel.relationConfigs = [
@@ -117,21 +74,4 @@ TimesheetEntityModel.relationConfigs = [
117
74
  key: "id",
118
75
  },
119
76
  },
120
- {
121
- name: entity_utils_interface_1.EntityEnum.PROJECT,
122
- relation: relation_type_enum_1.RelationType.ONE,
123
- key: "project",
124
- mapKeyConfig: {
125
- relationKey: "id",
126
- key: "projectId",
127
- },
128
- },
129
77
  ];
130
- TimesheetEntityModel.CLASSIFICATION_WINDOW_CONFIG = {
131
- bufferDays: 3,
132
- windows: [
133
- { startDay: 1, endDay: 10 },
134
- { startDay: 11, endDay: 20 },
135
- { startDay: 21, endDay: null },
136
- ],
137
- };
@@ -3,9 +3,9 @@ import { EntityEnum, Nullable } from "../interface/entity.utils.interface";
3
3
  import { RelationConfigs } from "../interface/relation-config.interface";
4
4
  import { IUserEntity } from "../interface/user.entity.interface";
5
5
  import { BaseEntityModel } from "./base.entity.model";
6
- import { DesignationEntityModel } from "./designation.entity.model";
7
6
  import { ProjectUserMappingEntityModel } from "./project-user-mapping.entity.model";
8
7
  import { ProjectEntityModel } from "./project.entity.model";
8
+ import { DesignationEntityModel } from "./designation.entity.model";
9
9
  import { RoleEntityModel } from "./role.entity.model";
10
10
  export declare class UserEntityModel extends BaseEntityModel<EntityEnum.USER> implements IUserEntity {
11
11
  id: number;
@@ -56,5 +56,4 @@ export declare class UserEntityModel extends BaseEntityModel<EntityEnum.USER> im
56
56
  get roleEntityModel(): RoleEntityModel;
57
57
  hasPermission(permissionName: string): boolean;
58
58
  get projects(): ProjectEntityModel[];
59
- get isOwnerPartnerRoleUser(): boolean;
60
59
  }
@@ -51,9 +51,6 @@ class UserEntityModel extends base_entity_model_1.BaseEntityModel {
51
51
  get projects() {
52
52
  return this.projecUserMappings.map((mapping) => mapping.project).filter((project) => !!project);
53
53
  }
54
- get isOwnerPartnerRoleUser() {
55
- return [user_entity_enum_1.UserRoleEnum.owner, user_entity_enum_1.UserRoleEnum.partner].includes(this.role);
56
- }
57
54
  }
58
55
  exports.UserEntityModel = UserEntityModel;
59
56
  UserEntityModel.relationConfigs = [
@@ -1,4 +1,4 @@
1
- import { ITimesheetEntity, TimesheetClassificationStatusEnum, TimesheetStatusEnum } 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;
@@ -14,10 +14,6 @@ export declare class TimesheetEntityModel implements ITimesheetEntityModel {
14
14
  updatedOn: number;
15
15
  status: TimesheetStatusEnum;
16
16
  billingId?: number;
17
- billedDuration?: number;
18
- notBilledDuration?: number;
19
- classificationStatus: TimesheetClassificationStatusEnum;
20
- classifiedBy?: number;
21
17
  /**
22
18
  * @param timesheets - Array of TimesheetModel instances
23
19
  * @return - Array of Timesheet Model
@@ -17,7 +17,6 @@ class TimesheetEntityModel {
17
17
  this.updatedOn = 0;
18
18
  this.status = entities_1.TimesheetStatusEnum.CREATE_APPROVAL;
19
19
  this.billingId = 0;
20
- this.classificationStatus = entities_1.TimesheetClassificationStatusEnum.PENDING;
21
20
  }
22
21
  /**
23
22
  * @param timesheets - Array of TimesheetModel instances
@@ -67,10 +67,6 @@ export declare class DateCodeModel {
67
67
  currFY: string;
68
68
  };
69
69
  static getCurrentTimestampCode(): string;
70
- static getTodayISTEpochRange(): {
71
- epochStartTime: number;
72
- epochEndTime: number;
73
- };
74
70
  /**
75
71
  * Creates a DateCodeModel instance directly from a JavaScript Date object.
76
72
  * Internally formats the date to "yyyyMMdd" and constructs the model.
@@ -331,19 +331,6 @@ class DateCodeModel {
331
331
  const minutes = String(nowIST.getUTCMinutes()).padStart(2, "0");
332
332
  return `${year}${month}${day} ${hours}${minutes}`;
333
333
  }
334
- static getTodayISTEpochRange() {
335
- const istOffsetMs = 5.5 * 60 * 60 * 1000;
336
- const nowUTC = new Date();
337
- const nowIST = new Date(nowUTC.getTime() + istOffsetMs);
338
- const year = nowIST.getUTCFullYear();
339
- const month = nowIST.getUTCMonth();
340
- const date = nowIST.getUTCDate();
341
- const startOfTodayUTC = new Date(Date.UTC(year, month, date, 0, 0, 0, 0));
342
- const epochStartTime = Math.floor((startOfTodayUTC.getTime() - istOffsetMs) / 1000);
343
- const endOfTodayUTC = new Date(Date.UTC(year, month, date, 23, 59, 59, 999));
344
- const epochEndTime = Math.floor((endOfTodayUTC.getTime() - istOffsetMs) / 1000);
345
- return { epochStartTime, epochEndTime };
346
- }
347
334
  /**
348
335
  * Creates a DateCodeModel instance directly from a JavaScript Date object.
349
336
  * Internally formats the date to "yyyyMMdd" and constructs the model.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "law-common",
3
- "version": "11.3.6-beta.0",
3
+ "version": "11.3.6-beta.1",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [
@@ -1,10 +0,0 @@
1
- export declare enum TimesheetClassificationStatusEnum {
2
- PENDING = "pending",
3
- CLASSIFIED = "classified",
4
- AUTO_CLASSIFIED = "auto_classified",
5
- CORRECTED = "corrected"
6
- }
7
- export declare namespace TimesheetClassificationStatusEnum {
8
- function getNames(): string[];
9
- function parse(value: string): TimesheetClassificationStatusEnum;
10
- }
@@ -1,28 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TimesheetClassificationStatusEnum = void 0;
4
- const error_key_enum_1 = require("../../enums/error.key.enum");
5
- const exceptions_1 = require("../../exceptions");
6
- var TimesheetClassificationStatusEnum;
7
- (function (TimesheetClassificationStatusEnum) {
8
- TimesheetClassificationStatusEnum["PENDING"] = "pending";
9
- TimesheetClassificationStatusEnum["CLASSIFIED"] = "classified";
10
- TimesheetClassificationStatusEnum["AUTO_CLASSIFIED"] = "auto_classified";
11
- TimesheetClassificationStatusEnum["CORRECTED"] = "corrected";
12
- })(TimesheetClassificationStatusEnum || (exports.TimesheetClassificationStatusEnum = TimesheetClassificationStatusEnum = {}));
13
- (function (TimesheetClassificationStatusEnum) {
14
- function getNames() {
15
- return Object.values(TimesheetClassificationStatusEnum).filter((value) => typeof value === "string");
16
- }
17
- TimesheetClassificationStatusEnum.getNames = getNames;
18
- function parse(value) {
19
- if (Object.values(TimesheetClassificationStatusEnum).includes(value)) {
20
- return value;
21
- }
22
- throw new exceptions_1.AppBadRequestException({
23
- key: error_key_enum_1.ErrorKeyEnum.TIMESHEET_STATUS,
24
- message: ["Invalid timesheet classification status"],
25
- });
26
- }
27
- TimesheetClassificationStatusEnum.parse = parse;
28
- })(TimesheetClassificationStatusEnum || (exports.TimesheetClassificationStatusEnum = TimesheetClassificationStatusEnum = {}));