law-common 4.0.1-beta.0 → 4.0.1-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.
@@ -67,3 +67,4 @@ export * from "./interface/bank_history.api";
67
67
  export * from "./interface/leave.create.dto.interface";
68
68
  export * from "./interface/leave.update.dto.interface";
69
69
  export * from "./interface/leave.api";
70
+ export * from "./interface/leave_history.api";
@@ -83,3 +83,4 @@ __exportStar(require("./interface/bank_history.api"), exports);
83
83
  __exportStar(require("./interface/leave.create.dto.interface"), exports);
84
84
  __exportStar(require("./interface/leave.update.dto.interface"), exports);
85
85
  __exportStar(require("./interface/leave.api"), exports);
86
+ __exportStar(require("./interface/leave_history.api"), exports);
@@ -1,3 +1,18 @@
1
- import { IApiEntity, ILeaveEntity } from "../../entities";
1
+ import { IApiEntity, ILeaveEntity, LeaveActionEnum, LeaveStatusEnum } from "../../entities";
2
+ import { ILeaveUpdateDto } from "./leave.update.dto.interface";
2
3
  export type ILeaveApiEntity = IApiEntity<ILeaveEntity>;
3
4
  export type ILeaveApiEntityArray = ILeaveApiEntity[];
5
+ export type ILeaveFlowContextData = {
6
+ currentTimesheet?: ILeaveEntity;
7
+ dto?: ILeaveUpdateDto;
8
+ };
9
+ export type ILeaveFlowConfig = {
10
+ [key in LeaveStatusEnum]?: {
11
+ actions: {
12
+ [key in LeaveActionEnum]?: {
13
+ permissions: string[];
14
+ next: () => LeaveStatusEnum;
15
+ };
16
+ };
17
+ };
18
+ };
@@ -0,0 +1,3 @@
1
+ import { IApiEntity, ILeaveHistoryEntity } from "../../entities";
2
+ export type ILeaveHistoryApiEntity = IApiEntity<ILeaveHistoryEntity>;
3
+ export type ILeaveHistoryApiEntityArray = ILeaveHistoryApiEntity[];
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -3,7 +3,8 @@ export declare enum LeaveActionEnum {
3
3
  EDIT = "edit",
4
4
  APPROVE = "approve",
5
5
  REJECT = "reject",
6
- DELETE = "delete"
6
+ DELETE = "delete",
7
+ RECALL = "recall"
7
8
  }
8
9
  export declare namespace LeaveActionEnum {
9
10
  function getLabel(action: LeaveActionEnum): string;
@@ -10,6 +10,7 @@ var LeaveActionEnum;
10
10
  LeaveActionEnum["APPROVE"] = "approve";
11
11
  LeaveActionEnum["REJECT"] = "reject";
12
12
  LeaveActionEnum["DELETE"] = "delete";
13
+ LeaveActionEnum["RECALL"] = "recall";
13
14
  })(LeaveActionEnum || (exports.LeaveActionEnum = LeaveActionEnum = {}));
14
15
  (function (LeaveActionEnum) {
15
16
  const actionLabelMap = {
@@ -18,6 +19,7 @@ var LeaveActionEnum;
18
19
  [LeaveActionEnum.APPROVE]: "Approve",
19
20
  [LeaveActionEnum.REJECT]: "Reject",
20
21
  [LeaveActionEnum.DELETE]: "Delete",
22
+ [LeaveActionEnum.RECALL]: "Recall",
21
23
  };
22
24
  function getLabel(action) {
23
25
  if (!Object.values(LeaveActionEnum).includes(action)) {
@@ -1,5 +1,5 @@
1
1
  export declare enum LeaveStatusEnum {
2
- PENDING_APPROVAL = "pending",
2
+ PENDING_APPROVAL = "pending_approval",
3
3
  EDIT_APPROVAL = "edit_approval",
4
4
  DELETE_APPROVAL = "delete_approval",
5
5
  RESOLVE_REJECTED = "resolve_rejected",
@@ -5,7 +5,7 @@ const error_key_enum_1 = require("../../enums/error.key.enum");
5
5
  const exceptions_1 = require("../../exceptions");
6
6
  var LeaveStatusEnum;
7
7
  (function (LeaveStatusEnum) {
8
- LeaveStatusEnum["PENDING_APPROVAL"] = "pending";
8
+ LeaveStatusEnum["PENDING_APPROVAL"] = "pending_approval";
9
9
  LeaveStatusEnum["EDIT_APPROVAL"] = "edit_approval";
10
10
  LeaveStatusEnum["DELETE_APPROVAL"] = "delete_approval";
11
11
  LeaveStatusEnum["RESOLVE_REJECTED"] = "resolve_rejected";
@@ -55,3 +55,4 @@ export * from "./enums/bank_entity_keys.enum";
55
55
  export * from "./enums/leave.action.enum";
56
56
  export * from "./enums/leave.status.enum";
57
57
  export * from "./interface/leave.entity.interface";
58
+ export * from "./interface/leave_history.entity.interface";
@@ -71,3 +71,4 @@ __exportStar(require("./enums/bank_entity_keys.enum"), exports);
71
71
  __exportStar(require("./enums/leave.action.enum"), exports);
72
72
  __exportStar(require("./enums/leave.status.enum"), exports);
73
73
  __exportStar(require("./interface/leave.entity.interface"), exports);
74
+ __exportStar(require("./interface/leave_history.entity.interface"), exports);
@@ -0,0 +1,14 @@
1
+ import { HistoryOperationEnum } from "../enums/history_operation.enum";
2
+ import { IAuditColumnEntity } from "./audit-column.entity.interface";
3
+ import { IEntityCreateDto, IEntityFilterData } from "./entity.utils.interface";
4
+ export interface ILeaveHistoryEntity extends IAuditColumnEntity {
5
+ id: number;
6
+ entityId: number;
7
+ operation: HistoryOperationEnum;
8
+ data: string;
9
+ }
10
+ export interface ILeaveHistoryCreateDto extends IEntityCreateDto<ILeaveHistoryEntity> {
11
+ }
12
+ export interface ILeaveHistorySearchDto extends IEntityFilterData<ILeaveHistoryEntity> {
13
+ }
14
+ export declare const leaveHistoryExcludeKeys: string[];
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.leaveHistoryExcludeKeys = void 0;
4
+ const constants_1 = require("../../constants");
5
+ exports.leaveHistoryExcludeKeys = [...constants_1.historyKeysToExclude];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "law-common",
3
- "version": "4.0.1-beta.0",
3
+ "version": "4.0.1-beta.1",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [