law-common 10.22.1-beta.5 → 10.23.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 (26) hide show
  1. package/dist/src/api/index.d.ts +3 -3
  2. package/dist/src/api/index.js +3 -4
  3. package/dist/src/api/interface/expense_type.entity.api.d.ts +3 -0
  4. package/dist/src/api/interface/expense_type.entity.response.d.ts +3 -3
  5. package/dist/src/api/interface/office.location.entity.api.d.ts +3 -0
  6. package/dist/src/api/interface/office.location.entity.response.d.ts +3 -3
  7. package/dist/src/api/interface/project.entity.response.d.ts +4 -3
  8. package/dist/src/api/interface/rate.entity.response.d.ts +4 -0
  9. package/dist/src/entities/interface/country.entity.interface.d.ts +2 -2
  10. package/dist/src/entities/interface/designation.entity.interface.d.ts +2 -2
  11. package/dist/src/entities/interface/designation.entity.interface.js +1 -1
  12. package/dist/src/entities/interface/expense_type.entity.interface.d.ts +2 -2
  13. package/dist/src/entities/interface/industry.entity.interface.d.ts +2 -2
  14. package/dist/src/entities/interface/office.location.entity.d.ts +2 -2
  15. package/dist/src/entities/interface/rate.entity.interface.d.ts +2 -3
  16. package/dist/src/entities/model/designation.entity.model.d.ts +5 -5
  17. package/dist/src/entities/model/designation.entity.model.js +6 -6
  18. package/dist/src/utils/helper.fn.util.d.ts +0 -1
  19. package/dist/src/utils/helper.fn.util.js +0 -6
  20. package/package.json +35 -35
  21. package/dist/src/api/interface/country.entity.response.d.ts +0 -4
  22. package/dist/src/api/interface/designation.entity.response.d.ts +0 -4
  23. package/dist/src/api/interface/industry.entity.response.d.ts +0 -3
  24. /package/dist/src/api/interface/{country.entity.response.js → expense_type.entity.api.js} +0 -0
  25. /package/dist/src/api/interface/{designation.entity.response.js → office.location.entity.api.js} +0 -0
  26. /package/dist/src/api/interface/{industry.entity.response.js → rate.entity.response.js} +0 -0
@@ -7,10 +7,9 @@ export * from "./interface/user.create.dto.interace";
7
7
  export * from "./interface/login.response.interface";
8
8
  export * from "./interface/jwt.payload.interface";
9
9
  export * from "./interface/user.update.dto.interface";
10
- export * from "./interface/designation.entity.response";
11
10
  export * from "./interface/login.dto.interface";
12
- export * from "./interface/industry.entity.response";
13
11
  export * from "./interface/configuration.entity.response";
12
+ export * from "./interface/rate.entity.response";
14
13
  export * from "./interface/client.entity.response";
15
14
  export * from "./interface/project.entity.response";
16
15
  export * from "./interface/timesheet.entity.response.interface";
@@ -18,11 +17,13 @@ export * from "./interface/project.response.interface";
18
17
  export * from "./interface/reimbursement.entity.response";
19
18
  export * from "./interface/expense_type.create.dto.interface";
20
19
  export * from "./interface/task.create.dto.interface";
20
+ export * from "./interface/expense_type.entity.api";
21
21
  export * from "./interface/expense_type.update.dto";
22
22
  export * from "./interface/expense_type.entity.response";
23
23
  export * from "./interface/billing.create.dto.interface";
24
24
  export * from "./interface/billing.entity.response";
25
25
  export * from "./interface/office.location.create.dto.interface";
26
+ export * from "./interface/office.location.entity.api";
26
27
  export * from "./interface/office.Location.update.dto.interface";
27
28
  export * from "./interface/office.location.entity.response";
28
29
  export * from "./interface/billing.timesheet.entity.api";
@@ -67,7 +68,6 @@ export * from "./interface/work.from.home.api";
67
68
  export * from "./interface/work.from.home.create.dto.interface";
68
69
  export * from "./interface/work.from.home.update.interface";
69
70
  export * from "./interface/work_from_home_history.api";
70
- export * from "./interface/country.entity.response";
71
71
  export * from "./interface/organization.entity.api";
72
72
  export * from "./interface/intermediary.bank.entity.response";
73
73
  export * from "./interface/holiday.entity.response";
@@ -17,17 +17,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./interface/base.response.interface"), exports);
18
18
  __exportStar(require("./interface/task.create.dto.interface"), exports);
19
19
  __exportStar(require("./interface/task.update.dto.interface"), exports);
20
- // export * from "./interface/task.entity.api";
21
20
  __exportStar(require("./interface/user.entity.api"), exports);
22
21
  __exportStar(require("./interface/user.entity.response"), exports);
23
22
  __exportStar(require("./interface/user.create.dto.interace"), exports);
24
23
  __exportStar(require("./interface/login.response.interface"), exports);
25
24
  __exportStar(require("./interface/jwt.payload.interface"), exports);
26
25
  __exportStar(require("./interface/user.update.dto.interface"), exports);
27
- __exportStar(require("./interface/designation.entity.response"), exports);
28
26
  __exportStar(require("./interface/login.dto.interface"), exports);
29
- __exportStar(require("./interface/industry.entity.response"), exports);
30
27
  __exportStar(require("./interface/configuration.entity.response"), exports);
28
+ __exportStar(require("./interface/rate.entity.response"), exports);
31
29
  __exportStar(require("./interface/client.entity.response"), exports);
32
30
  __exportStar(require("./interface/project.entity.response"), exports);
33
31
  __exportStar(require("./interface/timesheet.entity.response.interface"), exports);
@@ -35,11 +33,13 @@ __exportStar(require("./interface/project.response.interface"), exports);
35
33
  __exportStar(require("./interface/reimbursement.entity.response"), exports);
36
34
  __exportStar(require("./interface/expense_type.create.dto.interface"), exports);
37
35
  __exportStar(require("./interface/task.create.dto.interface"), exports);
36
+ __exportStar(require("./interface/expense_type.entity.api"), exports);
38
37
  __exportStar(require("./interface/expense_type.update.dto"), exports);
39
38
  __exportStar(require("./interface/expense_type.entity.response"), exports);
40
39
  __exportStar(require("./interface/billing.create.dto.interface"), exports);
41
40
  __exportStar(require("./interface/billing.entity.response"), exports);
42
41
  __exportStar(require("./interface/office.location.create.dto.interface"), exports);
42
+ __exportStar(require("./interface/office.location.entity.api"), exports);
43
43
  __exportStar(require("./interface/office.Location.update.dto.interface"), exports);
44
44
  __exportStar(require("./interface/office.location.entity.response"), exports);
45
45
  __exportStar(require("./interface/billing.timesheet.entity.api"), exports);
@@ -84,7 +84,6 @@ __exportStar(require("./interface/work.from.home.api"), exports);
84
84
  __exportStar(require("./interface/work.from.home.create.dto.interface"), exports);
85
85
  __exportStar(require("./interface/work.from.home.update.interface"), exports);
86
86
  __exportStar(require("./interface/work_from_home_history.api"), exports);
87
- __exportStar(require("./interface/country.entity.response"), exports);
88
87
  __exportStar(require("./interface/organization.entity.api"), exports);
89
88
  __exportStar(require("./interface/intermediary.bank.entity.response"), exports);
90
89
  __exportStar(require("./interface/holiday.entity.response"), exports);
@@ -0,0 +1,3 @@
1
+ import { IApiEntity, IExpenseTypeEntity } from "../../entities";
2
+ export type IExpenseTypeApiEntity = IApiEntity<IExpenseTypeEntity>;
3
+ export type IExpenseTypeApiEntityArray = IExpenseTypeApiEntity[];
@@ -1,4 +1,4 @@
1
- import { IExpenseTypeEntity } from "../../entities";
2
1
  import { IBaseResponse } from "./base.response.interface";
3
- export type IExpenseTypeApiEntityResponse = IBaseResponse<IExpenseTypeEntity>;
4
- export type IExpenseTypeApiEntityResponseArray = IBaseResponse<IExpenseTypeEntity[]>;
2
+ import { IExpenseTypeApiEntity } from "./expense_type.entity.api";
3
+ export type IExpenseTypeApiEntityResponse = IBaseResponse<IExpenseTypeApiEntity>;
4
+ export type IExpenseTypeApiEntityResponseArray = IBaseResponse<IExpenseTypeApiEntity[]>;
@@ -0,0 +1,3 @@
1
+ import { IApiEntity, IOfficeLocationEntity } from "../../entities";
2
+ export type IOfficeLocationApiEntity = IApiEntity<IOfficeLocationEntity>;
3
+ export type IOfficeLocationApiEntityArray = IOfficeLocationApiEntity[];
@@ -1,4 +1,4 @@
1
- import { IOfficeLocationEntity } from "../../entities";
2
1
  import { IBaseResponse } from "./base.response.interface";
3
- export type IOfficeLocationApiEntityResponse = IBaseResponse<IOfficeLocationEntity>;
4
- export type IOfficeLocationApiEntityResponseArray = IBaseResponse<IOfficeLocationEntity[]>;
2
+ import { IOfficeLocationApiEntity } from "./office.location.entity.api";
3
+ export type IOfficeLocationApiEntityResponse = IBaseResponse<IOfficeLocationApiEntity>;
4
+ export type IOfficeLocationApiEntityResponseArray = IBaseResponse<IOfficeLocationApiEntity[]>;
@@ -1,4 +1,5 @@
1
- import { IApiEntity, IClientEntity, IDesignationApiEntity, IProjectCreateDtoExtra, IProjectEntity, IProjectUserDto, IRateEntity } from "../../entities";
1
+ import { IApiEntity, IClientEntity, IDesignationEntity, IProjectCreateDtoExtra, IProjectEntity, IProjectUserDto } from "../../entities";
2
+ import { IRateApiEntity } from "./rate.entity.response";
2
3
  import { IUserApiEntity } from "./user.entity.api";
3
4
  export type IProjectApiEntity = IApiEntity<IProjectEntity>;
4
5
  export type IProjectApiEntityArray = IProjectApiEntity[];
@@ -18,9 +19,9 @@ export type IProjectEntityGet = {
18
19
  [key: string]: IClientEntity;
19
20
  };
20
21
  designations?: {
21
- [key: string]: IDesignationApiEntity;
22
+ [key: string]: IDesignationEntity;
22
23
  };
23
24
  rates?: {
24
- [key: string]: IRateEntity;
25
+ [key: string]: IRateApiEntity;
25
26
  };
26
27
  };
@@ -0,0 +1,4 @@
1
+ import { IApiEntity } from "../../entities";
2
+ import { IRateEntity } from "../../entities/interface/rate.entity.interface";
3
+ export type IRateApiEntity = IApiEntity<IRateEntity>;
4
+ export type IRateApiEntityArray = IRateApiEntity[];
@@ -1,6 +1,6 @@
1
- import { IAuditColumnEntity } from "./audit-column.entity.interface";
1
+ import { IEntityAuditColumn } from "./entity-audit-columns.interface";
2
2
  import { IEntityCreateDto, IEntityFilterData, IEntityUpdateDto } from "./entity.utils.interface";
3
- export interface ICountryEntity extends IAuditColumnEntity {
3
+ export interface ICountryEntity extends IEntityAuditColumn {
4
4
  id: number;
5
5
  name: string;
6
6
  }
@@ -1,6 +1,6 @@
1
- import { IAuditColumnEntity } from "./audit-column.entity.interface";
1
+ import { IEntityAuditColumn } from "./entity-audit-columns.interface";
2
2
  import { IApiEntity, IEntityCreateDto, IEntityFilterData, IEntityUpdateDto } from "./entity.utils.interface";
3
- export interface IDesignationEntity extends IAuditColumnEntity {
3
+ export interface IDesignationEntity extends IEntityAuditColumn {
4
4
  id: number;
5
5
  name: string;
6
6
  description?: string;
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const createDto = {
4
- name: 'string',
4
+ name: "string",
5
5
  };
@@ -1,7 +1,7 @@
1
1
  import { ExpenseTypeEnum } from "../enums/expense_type.entity.enum";
2
- import { IEntityAuditColumn } from "./entity-audit-columns.interface";
2
+ import { IAuditColumnEntity } from "./audit-column.entity.interface";
3
3
  import { IEntityFilterData } from "./entity.utils.interface";
4
- export interface IExpenseTypeEntity extends IEntityAuditColumn {
4
+ export interface IExpenseTypeEntity extends IAuditColumnEntity {
5
5
  id: number;
6
6
  name: string;
7
7
  description?: string;
@@ -1,6 +1,6 @@
1
- import { IAuditColumnEntity } from "./audit-column.entity.interface";
1
+ import { IEntityAuditColumn } from "./entity-audit-columns.interface";
2
2
  import { IEntityCreateDto, IEntityFilterData, IEntityUpdateDto } from "./entity.utils.interface";
3
- export interface IIndustryEntity extends IAuditColumnEntity {
3
+ export interface IIndustryEntity extends IEntityAuditColumn {
4
4
  id: number;
5
5
  name: string;
6
6
  description?: string;
@@ -1,6 +1,6 @@
1
- import { IEntityAuditColumn } from "./entity-audit-columns.interface";
1
+ import { IAuditColumnEntity } from "../interface/audit-column.entity.interface";
2
2
  import { IEntityFilterData } from "./entity.utils.interface";
3
- export interface IOfficeLocationEntity extends IEntityAuditColumn {
3
+ export interface IOfficeLocationEntity extends IAuditColumnEntity {
4
4
  id: number;
5
5
  name: string;
6
6
  address: string;
@@ -1,9 +1,8 @@
1
1
  import { CurrencyEnum, TimeUnitEnum } from "../../enums";
2
2
  import { PartialBy } from "../../misc";
3
3
  import { IAuditColumnEntity } from "./audit-column.entity.interface";
4
- import { IEntityAuditColumn } from "./entity-audit-columns.interface";
5
4
  import { IEntityCreateDto, IEntityFilterData, IEntityUpdateDto } from "./entity.utils.interface";
6
- export interface IRateEntity extends IEntityAuditColumn {
5
+ export interface IRateEntity extends IAuditColumnEntity {
7
6
  id: number;
8
7
  designation: string;
9
8
  rate: number;
@@ -14,6 +13,6 @@ export interface IRateEntityCreateDto extends IEntityCreateDto<IRateEntity> {
14
13
  }
15
14
  export interface IRateEntityUpdateDto extends IEntityUpdateDto<IRateEntity> {
16
15
  }
17
- export interface IRateEntityUpdateByDesignationCurrencyDto extends PartialBy<Omit<IRateEntity, "id" | keyof IAuditColumnEntity>, "unit"> {
16
+ export interface IRateEntityUpdateByDesignationCurrencyDto extends PartialBy<Omit<IRateEntity, 'id' | keyof IAuditColumnEntity>, 'unit'> {
18
17
  }
19
18
  export type IRateEntityFilterData = IEntityFilterData<IRateEntity>;
@@ -1,14 +1,14 @@
1
- import { IDesignationApiEntity } from "../interface/designation.entity.interface";
1
+ import { IDesignationEntity } from "../interface/designation.entity.interface";
2
2
  import { EntityEnum } from "../interface/entity.utils.interface";
3
3
  import { BaseEntityModel } from "./base.entity.model";
4
- export declare class DesignationEntityModel extends BaseEntityModel<EntityEnum.DESIGNATION> implements IDesignationApiEntity {
4
+ export declare class DesignationEntityModel extends BaseEntityModel<EntityEnum.DESIGNATION> implements IDesignationEntity {
5
5
  id: number;
6
6
  name: string;
7
7
  description?: string;
8
8
  createdBy: number;
9
- createdOn: string;
9
+ createdOn: number;
10
10
  updatedBy: number;
11
- updatedOn: string;
12
- static fromApiEntity(apiEntity: IDesignationApiEntity): DesignationEntityModel;
11
+ updatedOn: number;
12
+ static fromEntity(entity: IDesignationEntity): DesignationEntityModel;
13
13
  getRelationConfigs(): any[];
14
14
  }
@@ -9,9 +9,9 @@ class DesignationEntityModel extends base_entity_model_1.BaseEntityModel {
9
9
  this.id = 0;
10
10
  this.name = "";
11
11
  this.createdBy = 0;
12
- this.createdOn = "";
12
+ this.createdOn = 0;
13
13
  this.updatedBy = 0;
14
- this.updatedOn = "";
14
+ this.updatedOn = 0;
15
15
  }
16
16
  // constructor(data: IDesignationApiEntity) {
17
17
  // this.id = data.id;
@@ -22,10 +22,10 @@ class DesignationEntityModel extends base_entity_model_1.BaseEntityModel {
22
22
  // this.updatedBy = data.updatedBy;
23
23
  // this.updatedOn = data.updatedOn;
24
24
  // }
25
- static fromApiEntity(apiEntity) {
26
- const entity = new DesignationEntityModel(entity_utils_interface_1.EntityEnum.DESIGNATION);
27
- Object.assign(entity, apiEntity);
28
- return entity;
25
+ static fromEntity(entity) {
26
+ const result = new DesignationEntityModel(entity_utils_interface_1.EntityEnum.DESIGNATION);
27
+ Object.assign(result, entity);
28
+ return result;
29
29
  }
30
30
  getRelationConfigs() {
31
31
  return this.constructor.prototype.constructor.relationConfigs || [];
@@ -269,4 +269,3 @@ export declare function hasProperty<T extends object>(obj: T | null | undefined,
269
269
  * convertToNumberType("abc"); // throws Error("Invalid number: abc")
270
270
  */
271
271
  export declare function convertToNumberType<T extends string | number>(value: T): number;
272
- export declare function epochToDateTime(epoch: number): string;
@@ -39,8 +39,6 @@ exports.findDuplicateIds = findDuplicateIds;
39
39
  exports.getDecimalNumberFromString = getDecimalNumberFromString;
40
40
  exports.hasProperty = hasProperty;
41
41
  exports.convertToNumberType = convertToNumberType;
42
- exports.epochToDateTime = epochToDateTime;
43
- const date_fns_1 = require("date-fns");
44
42
  const util_constants_1 = require("../constants/util.constants");
45
43
  const error_key_enum_1 = require("../enums/error.key.enum");
46
44
  const exceptions_1 = require("../exceptions");
@@ -566,7 +564,3 @@ function convertToNumberType(value) {
566
564
  }
567
565
  return num;
568
566
  }
569
- function epochToDateTime(epoch) {
570
- const date = new Date(epoch * 1000); // JS Date expects milliseconds
571
- return (0, date_fns_1.format)(date, "yyyy-MM-dd HH:mm:ss");
572
- }
package/package.json CHANGED
@@ -1,35 +1,35 @@
1
- {
2
- "name": "law-common",
3
- "version": "10.22.1-beta.5",
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.23.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
+ }
@@ -1,4 +0,0 @@
1
- import { IApiEntity } from "../../entities";
2
- import { ICountryEntity } from "../../entities/interface/country.entity.interface";
3
- export type ICountryApiEntity = IApiEntity<ICountryEntity>;
4
- export type ICountryApiEntityArray = ICountryApiEntity[];
@@ -1,4 +0,0 @@
1
- import { IDesignationApiEntity } from "../../entities";
2
- import { IBaseResponse } from "./base.response.interface";
3
- export type IDesignationApiEntityResponse = IBaseResponse<IDesignationApiEntity>;
4
- export type IDesignationApiEntityResponseArray = IBaseResponse<IDesignationApiEntity[]>;
@@ -1,3 +0,0 @@
1
- import { IApiEntity, IIndustryEntity } from "../../entities";
2
- export type IIndustryApiEntity = IApiEntity<IIndustryEntity>;
3
- export type IIndustryApiEntityArray = IIndustryApiEntity[];