law-common 11.3.15-beta.0 → 11.3.15-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/README.md CHANGED
@@ -1 +1 @@
1
- # law-common
1
+ # law-common
@@ -12,7 +12,8 @@ export declare enum BillingActionsEnum {
12
12
  CREDIT_NOTE = "creditNote",
13
13
  WRITE_OFF = "writeOff",
14
14
  TDS = "tds",
15
- PDF_VIEW = "pdfView"
15
+ PDF_VIEW = "pdfView",
16
+ REGENERATE = "regenerate"
16
17
  }
17
18
  export declare namespace BillingActionsEnum {
18
19
  function getLabel(action: BillingActionsEnum): string;
@@ -19,6 +19,7 @@ var BillingActionsEnum;
19
19
  BillingActionsEnum["WRITE_OFF"] = "writeOff";
20
20
  BillingActionsEnum["TDS"] = "tds";
21
21
  BillingActionsEnum["PDF_VIEW"] = "pdfView";
22
+ BillingActionsEnum["REGENERATE"] = "regenerate";
22
23
  // ADJUST_AGAINST_CREDIT_NOTE = "adjustAgainstCreditNote",
23
24
  // PDF_GENERATE = "pdfGenerate",
24
25
  // PDF_DELETE = "pdfDelete",
@@ -41,6 +42,7 @@ var BillingActionsEnum;
41
42
  // [BillingActionsEnum.PDF_DELETE]: "Pdf Delete",
42
43
  // [BillingActionsEnum.PDF_GENERATE]: "Pdf Generate",
43
44
  [BillingActionsEnum.PDF_VIEW]: "Pdf View",
45
+ [BillingActionsEnum.REGENERATE]: "Regenerate",
44
46
  // [BillingActionsEnum.ADJUST_AGAINST_CREDIT_NOTE]: "Adjust Against Credit Note",
45
47
  };
46
48
  function getLabel(action) {
@@ -8,10 +8,6 @@ export declare enum ConfigurationKeyEnum {
8
8
  ORGANIZATION_BILLING_OVERDUE_THRESHOLD = "organization_billing_overdue_threshold",
9
9
  PROJECT_ENTITY_USAGE_NOTIFICATION_SENT_PERCENTAGE_RESET = "projectEntityUsageNotificationSentPercentageReset",
10
10
  LEAVE_ESCALATION = "leaveEscalation",
11
- BOARD_MEMBER_EMAIL = "boardMemberEmail",
12
- WEEKLY_ESCALATED_LEAVE_REMINDER = "weeklyEscalatedLeaveReminder",
13
- WEEKLY_ESCALATED_REIMBURSEMENT_REMINDER = "weeklyEscalatedReimbursementReminder",
14
- TIMESHEET_WEEKLY_REMINDER = "timesheetWeeklyReminder",
15
11
  TIMESHEET_AUTO_CLASSIFICATION = "timesheetAutoClassification",
16
12
  TIMESHEET_CLASSIFICATION_NOTIFICATION = "timesheetClassificationNotification",
17
13
  TIMESHEET_CLASSIFICATION_BUFFER_DAYS = "timesheetClassificationBufferDays",
@@ -14,10 +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["BOARD_MEMBER_EMAIL"] = "boardMemberEmail";
18
- ConfigurationKeyEnum["WEEKLY_ESCALATED_LEAVE_REMINDER"] = "weeklyEscalatedLeaveReminder";
19
- ConfigurationKeyEnum["WEEKLY_ESCALATED_REIMBURSEMENT_REMINDER"] = "weeklyEscalatedReimbursementReminder";
20
- ConfigurationKeyEnum["TIMESHEET_WEEKLY_REMINDER"] = "timesheetWeeklyReminder";
21
17
  ConfigurationKeyEnum["TIMESHEET_AUTO_CLASSIFICATION"] = "timesheetAutoClassification";
22
18
  ConfigurationKeyEnum["TIMESHEET_CLASSIFICATION_NOTIFICATION"] = "timesheetClassificationNotification";
23
19
  ConfigurationKeyEnum["TIMESHEET_CLASSIFICATION_BUFFER_DAYS"] = "timesheetClassificationBufferDays";
@@ -49,9 +45,6 @@ var ConfigurationKeyEnum;
49
45
  [ConfigurationKeyEnum.PENDING_APPROVAL_TIMESHEET_REMINDER]: cron_jobs_name_enum_1.CronJobNames.PENDING_APPROVAL_TIMESHEET_REMINDER,
50
46
  [ConfigurationKeyEnum.PROJECT_ENTITY_USAGE_NOTIFICATION_SENT_PERCENTAGE_RESET]: cron_jobs_name_enum_1.CronJobNames.PROJECT_ENTITY_USAGE_NOTIFICATION_SENT_PERCENTAGE_RESET,
51
47
  [ConfigurationKeyEnum.LEAVE_ESCALATION]: cron_jobs_name_enum_1.CronJobNames.LEAVE_ESCALATION,
52
- [ConfigurationKeyEnum.WEEKLY_ESCALATED_LEAVE_REMINDER]: cron_jobs_name_enum_1.CronJobNames.WEEKLY_ESCALATED_LEAVE_REMINDER,
53
- [ConfigurationKeyEnum.WEEKLY_ESCALATED_REIMBURSEMENT_REMINDER]: cron_jobs_name_enum_1.CronJobNames.WEEKLY_ESCALATED_REIMBURSEMENT_REMINDER,
54
- [ConfigurationKeyEnum.TIMESHEET_WEEKLY_REMINDER]: cron_jobs_name_enum_1.CronJobNames.TIMESHEET_WEEKLY_REMINDER,
55
48
  [ConfigurationKeyEnum.TIMESHEET_AUTO_CLASSIFICATION]: cron_jobs_name_enum_1.CronJobNames.TIMESHEET_AUTO_CLASSIFICATION,
56
49
  [ConfigurationKeyEnum.TIMESHEET_CLASSIFICATION_NOTIFICATION]: cron_jobs_name_enum_1.CronJobNames.TIMESHEET_CLASSIFICATION_NOTIFICATION,
57
50
  };
@@ -2,9 +2,6 @@ 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
4
  LEAVE_ESCALATION = "leave_escalation",
5
- WEEKLY_ESCALATED_LEAVE_REMINDER = "weekly_escalated_leave_reminder",
6
- WEEKLY_ESCALATED_REIMBURSEMENT_REMINDER = "weekly_escalated_reimbursement_reminder",
7
- TIMESHEET_WEEKLY_REMINDER = "timesheet_weekly_reminder",
8
5
  TIMESHEET_AUTO_CLASSIFICATION = "timesheet_auto_classification",
9
6
  TIMESHEET_CLASSIFICATION_NOTIFICATION = "timesheet_classification_notification"
10
7
  }
@@ -6,9 +6,6 @@ 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["WEEKLY_ESCALATED_LEAVE_REMINDER"] = "weekly_escalated_leave_reminder";
10
- CronJobNames["WEEKLY_ESCALATED_REIMBURSEMENT_REMINDER"] = "weekly_escalated_reimbursement_reminder";
11
- CronJobNames["TIMESHEET_WEEKLY_REMINDER"] = "timesheet_weekly_reminder";
12
9
  CronJobNames["TIMESHEET_AUTO_CLASSIFICATION"] = "timesheet_auto_classification";
13
10
  CronJobNames["TIMESHEET_CLASSIFICATION_NOTIFICATION"] = "timesheet_classification_notification";
14
11
  })(CronJobNames || (exports.CronJobNames = CronJobNames = {}));
@@ -139,6 +139,11 @@ exports.billingFlowConfig = {
139
139
  next: () => billing_status_enum_1.BillingStatusEnum.PENDING_PAYMENT,
140
140
  description: "Allows stakeholders to edit the Proforma Invoice while keeping it in Pending Payment status.",
141
141
  },
142
+ [billing_action_enum_1.BillingActionsEnum.REGENERATE]: {
143
+ permissions: ["BILLING_UPDATE"],
144
+ next: () => billing_status_enum_1.BillingStatusEnum.CANCELLED,
145
+ description: "Regenerates the billing by cancelling the current one and creating a replacement",
146
+ },
142
147
  },
143
148
  },
144
149
  [billing_status_enum_1.BillingStatusEnum.SETTLED]: {
@@ -3,9 +3,7 @@ import { EntityEnum } from "../interface/entity.utils.interface";
3
3
  import { IReimbursementExpenseEntity } from "../interface/reimbursement_expense.entity.interface";
4
4
  import { RelationConfigs } from "../interface/relation-config.interface";
5
5
  import { BaseEntityModel } from "./base.entity.model";
6
- import { ProjectEntityModel } from "./project.entity.model";
7
6
  import { ReimbursementEntityModel } from "./reimbursement.entity.model";
8
- import { UserEntityModel } from "./user.entity.model";
9
7
  export declare class ReimbursementExpenseEntityModel extends BaseEntityModel<EntityEnum.REIMBURSEMENT_EXPENSE> implements IReimbursementExpenseEntity {
10
8
  id: number;
11
9
  reimbursementId: number;
@@ -21,9 +19,7 @@ export declare class ReimbursementExpenseEntityModel extends BaseEntityModel<Ent
21
19
  createdOn: number;
22
20
  updatedOn: number;
23
21
  reimbursement?: ReimbursementEntityModel;
24
- user?: UserEntityModel;
25
- project?: ProjectEntityModel;
26
22
  static fromEntity(apiEntity: IReimbursementExpenseEntity): ReimbursementExpenseEntityModel;
27
- static relationConfigs: RelationConfigs<[EntityEnum.REIMBURSEMENT, EntityEnum.USER, EntityEnum.PROJECT], EntityEnum.REIMBURSEMENT_EXPENSE>;
23
+ static relationConfigs: RelationConfigs<[EntityEnum.REIMBURSEMENT], EntityEnum.REIMBURSEMENT_EXPENSE>;
28
24
  getRelationConfigs(): any;
29
25
  }
@@ -40,22 +40,4 @@ ReimbursementExpenseEntityModel.relationConfigs = [
40
40
  key: "reimbursementId",
41
41
  },
42
42
  },
43
- {
44
- name: entity_utils_interface_1.EntityEnum.USER,
45
- key: "user",
46
- relation: relation_type_enum_1.RelationType.ONE,
47
- mapKeyConfig: {
48
- relationKey: "id",
49
- key: "userId",
50
- },
51
- },
52
- {
53
- name: entity_utils_interface_1.EntityEnum.PROJECT,
54
- key: "project",
55
- relation: relation_type_enum_1.RelationType.ONE,
56
- mapKeyConfig: {
57
- relationKey: "id",
58
- key: "projectId",
59
- },
60
- },
61
43
  ];
@@ -43,7 +43,6 @@ export declare class TimesheetEntityModel extends BaseEntityModel<EntityEnum.TIM
43
43
  getTimesheetAmount(projectCurrency: CurrencyEnum): number;
44
44
  get formattedDate(): string;
45
45
  get userName(): string | undefined;
46
- get approvers(): UserEntityModel[];
47
46
  get latestStatusFromHistory(): TimesheetStatusEnum | undefined;
48
47
  getDateCodeDay(): number;
49
48
  getClassificationDeadline(config: IClassificationWindowConfig): Date;
@@ -45,10 +45,6 @@ class TimesheetEntityModel extends base_entity_model_1.BaseEntityModel {
45
45
  var _a;
46
46
  return (_a = this.user) === null || _a === void 0 ? void 0 : _a.name;
47
47
  }
48
- get approvers() {
49
- var _a, _b, _c;
50
- return (_c = (_b = (_a = this.project) === null || _a === void 0 ? void 0 : _a.partnersOwnerUsersOfProject) === null || _b === void 0 ? void 0 : _b.filter((u) => u.email)) !== null && _c !== void 0 ? _c : [];
51
- }
52
48
  get latestStatusFromHistory() {
53
49
  var _a;
54
50
  const sorted = [...(this.history || [])].sort((a, b) => b.id - a.id);
package/package.json CHANGED
@@ -1,47 +1,47 @@
1
- {
2
- "name": "law-common",
3
- "version": "11.3.15-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 run build && npm version prerelease --preid beta && git push && npm publish --tag beta",
13
- "publish:beta:link": "npm run build && npm version prerelease --preid beta && git push && npm publish --tag beta && npm run link",
14
- "publish:patch": "npm version patch && git push && npm run build && npm publish",
15
- "publish:minor": "npm version minor && git push && npm run build && npm publish",
16
- "publish:major": "npm verYsion major && git push && npm run build && npm publish",
17
- "link": "npm run build && npm link",
18
- "test": "jest",
19
- "format": "prettier --write .",
20
- "check-format": "prettier --check .",
21
- "pull:link": "git pull && npm run link",
22
- "check-version": "npm view law-common versions --json | jq -r '.[-1]'",
23
- "script:publish": "node scripts/publish.js",
24
- "script:publish:latest:beta": "npm run build && node scripts/publish.js prerelease beta && git push",
25
- "script:publish:latest:patch": "npm run build && node scripts/publish.js patch && git push"
26
- },
27
- "keywords": [],
28
- "author": "",
29
- "license": "ISC",
30
- "devDependencies": {
31
- "@types/jest": "^29.5.13",
32
- "@types/lodash": "^4.17.21",
33
- "@types/node": "^22.6.1",
34
- "jest": "^29.7.0",
35
- "prettier": "3.8.1",
36
- "semver": "^7.8.1",
37
- "ts-jest": "^29.2.5",
38
- "ts-node": "^10.9.2",
39
- "typescript": "^5.6.2"
40
- },
41
- "dependencies": {
42
- "@types/express": "^5.0.0",
43
- "@types/multer": "^1.4.12",
44
- "date-fns": "^4.1.0",
45
- "lodash": "4.17.21"
46
- }
47
- }
1
+ {
2
+ "name": "law-common",
3
+ "version": "11.3.15-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 run build && npm version prerelease --preid beta && git push && npm publish --tag beta",
13
+ "publish:beta:link": "npm run build && npm version prerelease --preid beta && git push && npm publish --tag beta && npm run link",
14
+ "publish:patch": "npm version patch && git push && npm run build && npm publish",
15
+ "publish:minor": "npm version minor && git push && npm run build && npm publish",
16
+ "publish:major": "npm verYsion major && git push && npm run build && npm publish",
17
+ "link": "npm run build && npm link",
18
+ "test": "jest",
19
+ "format": "prettier --write .",
20
+ "check-format": "prettier --check .",
21
+ "pull:link": "git pull && npm run link",
22
+ "check-version": "npm view law-common versions --json | jq -r '.[-1]'",
23
+ "script:publish": "node scripts/publish.js",
24
+ "script:publish:latest:beta": "npm run build && node scripts/publish.js prerelease beta && git push",
25
+ "script:publish:latest:patch": "npm run build && node scripts/publish.js patch && git push"
26
+ },
27
+ "keywords": [],
28
+ "author": "",
29
+ "license": "ISC",
30
+ "devDependencies": {
31
+ "@types/jest": "^29.5.13",
32
+ "@types/lodash": "^4.17.21",
33
+ "@types/node": "^22.6.1",
34
+ "jest": "^29.7.0",
35
+ "prettier": "3.8.1",
36
+ "semver": "^7.8.1",
37
+ "ts-jest": "^29.2.5",
38
+ "ts-node": "^10.9.2",
39
+ "typescript": "^5.6.2"
40
+ },
41
+ "dependencies": {
42
+ "@types/express": "^5.0.0",
43
+ "@types/multer": "^1.4.12",
44
+ "date-fns": "^4.1.0",
45
+ "lodash": "4.17.21"
46
+ }
47
+ }