law-common 2.1.0 → 2.3.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.
Files changed (33) hide show
  1. package/dist/src/@constants.d.ts +1 -0
  2. package/dist/src/@constants.js +17 -0
  3. package/dist/src/api/index.d.ts +3 -0
  4. package/dist/src/api/index.js +3 -0
  5. package/dist/src/api/interface/billing.history.api.d.ts +3 -0
  6. package/dist/src/api/interface/billing.history.api.js +2 -0
  7. package/dist/src/api/interface/billing_timesheet_history.api.d.ts +3 -0
  8. package/dist/src/api/interface/billing_timesheet_history.api.js +2 -0
  9. package/dist/src/api/interface/timesheet.history.api.d.ts +3 -0
  10. package/dist/src/api/interface/timesheet.history.api.js +2 -0
  11. package/dist/src/constants/constants.d.ts +1 -0
  12. package/dist/src/constants/constants.js +9 -0
  13. package/dist/src/constants/index.d.ts +1 -0
  14. package/dist/src/constants/index.js +17 -0
  15. package/dist/src/entities/enums/billing_history_operation.enum.d.ts +9 -0
  16. package/dist/src/entities/enums/billing_history_operation.enum.js +22 -0
  17. package/dist/src/entities/enums/billing_timesheet_history_operation.enum.d.ts +9 -0
  18. package/dist/src/entities/enums/billing_timesheet_history_operation.enum.js +22 -0
  19. package/dist/src/entities/enums/timesheet.operation.enum.d.ts +9 -0
  20. package/dist/src/entities/enums/timesheet.operation.enum.js +22 -0
  21. package/dist/src/entities/index.d.ts +6 -0
  22. package/dist/src/entities/index.js +6 -0
  23. package/dist/src/entities/interface/billing_history.entity.interface.d.ts +14 -0
  24. package/dist/src/entities/interface/billing_history.entity.interface.js +5 -0
  25. package/dist/src/entities/interface/billing_timesheet_history.entity.interface.d.ts +14 -0
  26. package/dist/src/entities/interface/billing_timesheet_history.entity.interface.js +5 -0
  27. package/dist/src/entities/interface/timesheet_history.entity.interface.d.ts +16 -0
  28. package/dist/src/entities/interface/timesheet_history.entity.interface.js +5 -0
  29. package/dist/src/index.d.ts +5 -4
  30. package/dist/src/index.js +2 -1
  31. package/dist/src/utils/helper.fn.util.d.ts +1 -0
  32. package/dist/src/utils/helper.fn.util.js +10 -0
  33. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ export * from "./constants";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./constants"), exports);
@@ -58,3 +58,6 @@ export * from "./interface/billing.transaction.create.dto.interface";
58
58
  export * from "./interface/billing.transaction.update.dto.interface";
59
59
  export * from "./interface/billing.transaction.entity.response";
60
60
  export * from "./interface/billing.flow.update.dto";
61
+ export * from "./interface/timesheet.history.api";
62
+ export * from "./interface/billing.history.api";
63
+ export * from "./interface/billing_timesheet_history.api";
@@ -74,3 +74,6 @@ __exportStar(require("./interface/billing.transaction.create.dto.interface"), ex
74
74
  __exportStar(require("./interface/billing.transaction.update.dto.interface"), exports);
75
75
  __exportStar(require("./interface/billing.transaction.entity.response"), exports);
76
76
  __exportStar(require("./interface/billing.flow.update.dto"), exports);
77
+ __exportStar(require("./interface/timesheet.history.api"), exports);
78
+ __exportStar(require("./interface/billing.history.api"), exports);
79
+ __exportStar(require("./interface/billing_timesheet_history.api"), exports);
@@ -0,0 +1,3 @@
1
+ import { IApiEntity, IBillingHistoryEntity } from "../../entities";
2
+ export type IBillingHistoryApiEntity = IApiEntity<IBillingHistoryEntity>;
3
+ export type IBillingHistoryApiEntityArray = IBillingHistoryApiEntity[];
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ import { IApiEntity, IBillingTimesheetHistoryEntity } from "../../entities";
2
+ export type IBillingTimesheetHistoryApiEntity = IApiEntity<IBillingTimesheetHistoryEntity>;
3
+ export type IBillingTimesheetHistoryApiEntityArray = IBillingTimesheetHistoryApiEntity[];
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ import { IApiEntity, ITimesheetHistoryEntity } from "../../entities";
2
+ export type ITimesheetHistoryApiEntity = IApiEntity<ITimesheetHistoryEntity>;
3
+ export type ITimesheetHistoryApiEntityArray = ITimesheetHistoryApiEntity[];
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export declare const historyKeysToExclude: string[];
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.historyKeysToExclude = void 0;
4
+ exports.historyKeysToExclude = [
5
+ "createdOn",
6
+ "updatedOn",
7
+ "createdBy",
8
+ "updatedBy",
9
+ ];
@@ -0,0 +1 @@
1
+ export * from "./constants";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./constants"), exports);
@@ -0,0 +1,9 @@
1
+ export declare enum BillingOperationEnum {
2
+ CREATE = "create",
3
+ UPDATE = "update",
4
+ DELETE = "delete"
5
+ }
6
+ export declare namespace BillingOperationEnum {
7
+ function getNames(): string[];
8
+ function parse(value: string): BillingOperationEnum;
9
+ }
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BillingOperationEnum = void 0;
4
+ var BillingOperationEnum;
5
+ (function (BillingOperationEnum) {
6
+ BillingOperationEnum["CREATE"] = "create";
7
+ BillingOperationEnum["UPDATE"] = "update";
8
+ BillingOperationEnum["DELETE"] = "delete";
9
+ })(BillingOperationEnum || (exports.BillingOperationEnum = BillingOperationEnum = {}));
10
+ (function (BillingOperationEnum) {
11
+ function getNames() {
12
+ return Object.values(BillingOperationEnum).filter((value) => typeof value === "string");
13
+ }
14
+ BillingOperationEnum.getNames = getNames;
15
+ function parse(value) {
16
+ if (Object.values(BillingOperationEnum).includes(value)) {
17
+ return value;
18
+ }
19
+ throw new Error("Invalid Billing History operation");
20
+ }
21
+ BillingOperationEnum.parse = parse;
22
+ })(BillingOperationEnum || (exports.BillingOperationEnum = BillingOperationEnum = {}));
@@ -0,0 +1,9 @@
1
+ export declare enum BillingTimesheetOperationEnum {
2
+ CREATE = "create",
3
+ UPDATE = "update",
4
+ DELETE = "delete"
5
+ }
6
+ export declare namespace BillingTimesheetOperationEnum {
7
+ function getNames(): string[];
8
+ function parse(value: string): BillingTimesheetOperationEnum;
9
+ }
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BillingTimesheetOperationEnum = void 0;
4
+ var BillingTimesheetOperationEnum;
5
+ (function (BillingTimesheetOperationEnum) {
6
+ BillingTimesheetOperationEnum["CREATE"] = "create";
7
+ BillingTimesheetOperationEnum["UPDATE"] = "update";
8
+ BillingTimesheetOperationEnum["DELETE"] = "delete";
9
+ })(BillingTimesheetOperationEnum || (exports.BillingTimesheetOperationEnum = BillingTimesheetOperationEnum = {}));
10
+ (function (BillingTimesheetOperationEnum) {
11
+ function getNames() {
12
+ return Object.values(BillingTimesheetOperationEnum).filter((value) => typeof value === "string");
13
+ }
14
+ BillingTimesheetOperationEnum.getNames = getNames;
15
+ function parse(value) {
16
+ if (Object.values(BillingTimesheetOperationEnum).includes(value)) {
17
+ return value;
18
+ }
19
+ throw new Error("Invalid Billing Timesheet History operation");
20
+ }
21
+ BillingTimesheetOperationEnum.parse = parse;
22
+ })(BillingTimesheetOperationEnum || (exports.BillingTimesheetOperationEnum = BillingTimesheetOperationEnum = {}));
@@ -0,0 +1,9 @@
1
+ export declare enum TimesheetOperationEnum {
2
+ CREATE = "create",
3
+ UPDATE = "update",
4
+ DELETE = "delete"
5
+ }
6
+ export declare namespace TimesheetOperationEnum {
7
+ function getNames(): string[];
8
+ function parse(value: string): TimesheetOperationEnum;
9
+ }
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TimesheetOperationEnum = void 0;
4
+ var TimesheetOperationEnum;
5
+ (function (TimesheetOperationEnum) {
6
+ TimesheetOperationEnum["CREATE"] = "create";
7
+ TimesheetOperationEnum["UPDATE"] = "update";
8
+ TimesheetOperationEnum["DELETE"] = "delete";
9
+ })(TimesheetOperationEnum || (exports.TimesheetOperationEnum = TimesheetOperationEnum = {}));
10
+ (function (TimesheetOperationEnum) {
11
+ function getNames() {
12
+ return Object.values(TimesheetOperationEnum).filter((value) => typeof value === "string");
13
+ }
14
+ TimesheetOperationEnum.getNames = getNames;
15
+ function parse(value) {
16
+ if (Object.values(TimesheetOperationEnum).includes(value)) {
17
+ return value;
18
+ }
19
+ throw new Error("Invalid timesheet history operation");
20
+ }
21
+ TimesheetOperationEnum.parse = parse;
22
+ })(TimesheetOperationEnum || (exports.TimesheetOperationEnum = TimesheetOperationEnum = {}));
@@ -34,3 +34,9 @@ export * from "./interface/permission.entity.interface";
34
34
  export * from "./interface/role.permission.mapping.entity.interface";
35
35
  export * from "./interface/billing_transaction.entity.interface";
36
36
  export * from "./enums/billing.transaction.enum";
37
+ export * from "./interface/timesheet_history.entity.interface";
38
+ export * from "./enums/timesheet.operation.enum";
39
+ export * from "./enums/billing_history_operation.enum";
40
+ export * from "./enums/billing_timesheet_history_operation.enum";
41
+ export * from "./interface/billing_history.entity.interface";
42
+ export * from "./interface/billing_timesheet_history.entity.interface";
@@ -50,3 +50,9 @@ __exportStar(require("./interface/permission.entity.interface"), exports);
50
50
  __exportStar(require("./interface/role.permission.mapping.entity.interface"), exports);
51
51
  __exportStar(require("./interface/billing_transaction.entity.interface"), exports);
52
52
  __exportStar(require("./enums/billing.transaction.enum"), exports);
53
+ __exportStar(require("./interface/timesheet_history.entity.interface"), exports);
54
+ __exportStar(require("./enums/timesheet.operation.enum"), exports);
55
+ __exportStar(require("./enums/billing_history_operation.enum"), exports);
56
+ __exportStar(require("./enums/billing_timesheet_history_operation.enum"), exports);
57
+ __exportStar(require("./interface/billing_history.entity.interface"), exports);
58
+ __exportStar(require("./interface/billing_timesheet_history.entity.interface"), exports);
@@ -0,0 +1,14 @@
1
+ import { BillingOperationEnum } from "../enums/billing_history_operation.enum";
2
+ import { IAuditColumnEntity } from "./audit-column.entity.interface";
3
+ import { IEntityCreateDto, IEntityFilterData } from "./entity.utils.interface";
4
+ export interface IBillingHistoryEntity extends IAuditColumnEntity {
5
+ id: number;
6
+ billingId: number;
7
+ operation: BillingOperationEnum;
8
+ data: string;
9
+ }
10
+ export interface IBillingHistoryCreateDto extends IEntityCreateDto<IBillingHistoryEntity> {
11
+ }
12
+ export interface IBillingHistorySearchDto extends IEntityFilterData<IBillingHistoryEntity> {
13
+ }
14
+ export declare const billingHistoryExcludeKeys: string[];
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.billingHistoryExcludeKeys = void 0;
4
+ const constants_1 = require("../../constants");
5
+ exports.billingHistoryExcludeKeys = [...constants_1.historyKeysToExclude];
@@ -0,0 +1,14 @@
1
+ import { BillingTimesheetOperationEnum } from "../enums/billing_timesheet_history_operation.enum";
2
+ import { IAuditColumnEntity } from "./audit-column.entity.interface";
3
+ import { IEntityCreateDto, IEntityFilterData } from "./entity.utils.interface";
4
+ export interface IBillingTimesheetHistoryEntity extends IAuditColumnEntity {
5
+ id: number;
6
+ timesheetId: number;
7
+ operation: BillingTimesheetOperationEnum;
8
+ data: string;
9
+ }
10
+ export interface IBillingTimesheetHistoryCreateDto extends IEntityCreateDto<IBillingTimesheetHistoryEntity> {
11
+ }
12
+ export interface IBillingTimesheetHistorySearchDto extends IEntityFilterData<IBillingTimesheetHistoryEntity> {
13
+ }
14
+ export declare const billingTimesheetHistoryExcludeKeys: string[];
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.billingTimesheetHistoryExcludeKeys = void 0;
4
+ const constants_1 = require("../../constants");
5
+ exports.billingTimesheetHistoryExcludeKeys = [...constants_1.historyKeysToExclude];
@@ -0,0 +1,16 @@
1
+ import { TimesheetOperationEnum } from "../enums/timesheet.operation.enum";
2
+ import { IAuditColumnEntity } from "./audit-column.entity.interface";
3
+ import { IEntityCreateDto, IEntityFilterData } from "./entity.utils.interface";
4
+ export interface ITimesheetHistoryEntity extends IAuditColumnEntity {
5
+ id: number;
6
+ timesheetId: number;
7
+ operation: TimesheetOperationEnum;
8
+ data: string;
9
+ }
10
+ export interface ITimesheetHistoryCreateDto extends IEntityCreateDto<ITimesheetHistoryEntity> {
11
+ }
12
+ export interface ITimesheetHistoryUpdateDto extends IEntityCreateDto<ITimesheetHistoryEntity> {
13
+ }
14
+ export interface ITimesheetHistorySearchDto extends IEntityFilterData<ITimesheetHistoryEntity> {
15
+ }
16
+ export declare const timesheetHistoryExcludeKeys: string[];
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.timesheetHistoryExcludeKeys = void 0;
4
+ const constants_1 = require("../../constants");
5
+ exports.timesheetHistoryExcludeKeys = [...constants_1.historyKeysToExclude];
@@ -1,6 +1,7 @@
1
- export * as api from './@api';
2
- export * as exceptions from './@exceptions';
3
- export * as misc from './@misc';
4
- export * as utils from './@entities';
1
+ export * as api from "./@api";
2
+ export * as exceptions from "./@exceptions";
3
+ export * as misc from "./@misc";
4
+ export * as utils from "./@entities";
5
5
  export * as enums from "./enums";
6
6
  export * from "./utils";
7
+ export * as constant from "./@constants";
package/dist/src/index.js CHANGED
@@ -26,10 +26,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
26
26
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.enums = exports.utils = exports.misc = exports.exceptions = exports.api = void 0;
29
+ exports.constant = exports.enums = exports.utils = exports.misc = exports.exceptions = exports.api = void 0;
30
30
  exports.api = __importStar(require("./@api"));
31
31
  exports.exceptions = __importStar(require("./@exceptions"));
32
32
  exports.misc = __importStar(require("./@misc"));
33
33
  exports.utils = __importStar(require("./@entities"));
34
34
  exports.enums = __importStar(require("./enums"));
35
35
  __exportStar(require("./utils"), exports);
36
+ exports.constant = __importStar(require("./@constants"));
@@ -5,6 +5,7 @@ export declare function convertMapToObject<K, T>(map: Map<K, T>): {
5
5
  [key: string]: T;
6
6
  };
7
7
  export declare function removeSamePropertyValues(source: any, target: any): void;
8
+ export declare function getChangedProperties<T>(source: T, target: T): Partial<T>;
8
9
  /**
9
10
  * Removes elements from the target array that are present in the source array.
10
11
  *
@@ -13,6 +13,7 @@ exports.groupByFunction = groupByFunction;
13
13
  exports.groupByOneToOneFunction = groupByOneToOneFunction;
14
14
  exports.convertMapToObject = convertMapToObject;
15
15
  exports.removeSamePropertyValues = removeSamePropertyValues;
16
+ exports.getChangedProperties = getChangedProperties;
16
17
  exports.removeElementsFromArray = removeElementsFromArray;
17
18
  exports.arrayDifference = arrayDifference;
18
19
  exports.arrayIntersection = arrayIntersection;
@@ -60,6 +61,15 @@ function removeSamePropertyValues(source, target) {
60
61
  }
61
62
  }
62
63
  }
64
+ function getChangedProperties(source, target) {
65
+ const result = {};
66
+ for (let key in target) {
67
+ if (source[key] !== target[key]) {
68
+ result[key] = target[key];
69
+ }
70
+ }
71
+ return result;
72
+ }
63
73
  /**
64
74
  * Removes elements from the target array that are present in the source array.
65
75
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "law-common",
3
- "version": "2.1.0",
3
+ "version": "2.3.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [