law-common 10.23.0 → 10.23.1-beta.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.
@@ -1,8 +1,6 @@
1
1
  export * from "./interface/base.response.interface";
2
2
  export * from "./interface/task.create.dto.interface";
3
3
  export * from "./interface/task.update.dto.interface";
4
- export * from "./interface/user.entity.api";
5
- export * from "./interface/user.entity.response";
6
4
  export * from "./interface/user.create.dto.interace";
7
5
  export * from "./interface/login.response.interface";
8
6
  export * from "./interface/jwt.payload.interface";
@@ -17,8 +17,6 @@ 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
- __exportStar(require("./interface/user.entity.api"), exports);
21
- __exportStar(require("./interface/user.entity.response"), exports);
22
20
  __exportStar(require("./interface/user.create.dto.interace"), exports);
23
21
  __exportStar(require("./interface/login.response.interface"), exports);
24
22
  __exportStar(require("./interface/jwt.payload.interface"), exports);
@@ -1,17 +1,16 @@
1
- import { BillingActionsEnum, BillingStatusEnum, IBillingEntity } from "../../entities";
1
+ import { BillingActionsEnum, BillingStatusEnum, IBillingEntity, IUserEntity } from "../../entities";
2
2
  import { IBillingReimbursementExpenseApiEntity } from "./billing-reimbursement-expense.api";
3
3
  import { IBillingApiEntity } from "./billing.entity.api";
4
4
  import { IBillingTimesheetApiEntity } from "./billing.timesheet.entity.api";
5
5
  import { IUpdateBillingDto } from "./billing.update.dto.interface";
6
6
  import { IProjectApiEntity } from "./project.entity.response";
7
- import { IUserApiEntity } from "./user.entity.api";
8
7
  export type IBillingEntityResponse = {
9
8
  billing: IBillingApiEntity;
10
9
  billingTimesheets?: IBillingTimesheetApiEntity[];
11
10
  billingReimbursementExpenses?: IBillingReimbursementExpenseApiEntity[];
12
11
  };
13
12
  export interface IUserEntityRelation {
14
- users?: IUserApiEntity[];
13
+ users?: IUserEntity[];
15
14
  }
16
15
  export interface IProjectEntityRelation {
17
16
  projects?: IProjectApiEntity[];
@@ -1,12 +1,11 @@
1
- import { IClientEntity, IClientEntityChildren, IClientEntityDependent } from "../../entities";
2
- import { IUserApiEntity } from "./user.entity.api";
1
+ import { IClientEntity, IClientEntityChildren, IClientEntityDependent, IUserEntity } from "../../entities";
3
2
  export type IClientApiEntityDependent = IClientEntity & IClientEntityDependent & IClientEntityChildren;
4
3
  export type IClientEntityGet = {
5
4
  clients: IClientApiEntityDependent[];
6
5
  users: {
7
- [key: string]: IUserApiEntity;
6
+ [key: string]: IUserEntity;
8
7
  };
9
8
  introducingPartnerIds: {
10
- [key: string]: IUserApiEntity;
9
+ [key: string]: IUserEntity;
11
10
  };
12
11
  };
@@ -1,5 +1,5 @@
1
- import { IUserApiEntity } from "./user.entity.api";
1
+ import { IUserEntity } from "../../entities";
2
2
  export interface ILoginResponse {
3
3
  accessToken: string;
4
- user: IUserApiEntity;
4
+ user: IUserEntity;
5
5
  }
@@ -1,6 +1,5 @@
1
- import { IApiEntity, IClientEntity, IDesignationEntity, IProjectCreateDtoExtra, IProjectEntity, IProjectUserDto } from "../../entities";
1
+ import { IApiEntity, IClientEntity, IDesignationEntity, IProjectCreateDtoExtra, IProjectEntity, IProjectUserDto, IUserEntity } from "../../entities";
2
2
  import { IRateApiEntity } from "./rate.entity.response";
3
- import { IUserApiEntity } from "./user.entity.api";
4
3
  export type IProjectApiEntity = IApiEntity<IProjectEntity>;
5
4
  export type IProjectApiEntityArray = IProjectApiEntity[];
6
5
  export interface IProjectUserDtoResponse extends IProjectUserDto {
@@ -13,7 +12,7 @@ export type IProjectApiEntityDependent = IProjectApiEntity & IProjectEntityDepen
13
12
  export type IProjectEntityGet = {
14
13
  projects: IProjectApiEntityDependent[];
15
14
  users: {
16
- [key: string]: IUserApiEntity;
15
+ [key: string]: IUserEntity;
17
16
  };
18
17
  clients: {
19
18
  [key: string]: IClientEntity;
@@ -1,13 +1,12 @@
1
- import { IApiEntity, IReimbursementEntity, IReimbursementExpenseEntity, ReimbursementActionEnum, ReimbursementExpenseActionEnum, ReimbursementExpenseState, ReimbursementStatusEnum } from "../../entities";
1
+ import { IApiEntity, IReimbursementEntity, IReimbursementExpenseEntity, IUserEntity, ReimbursementActionEnum, ReimbursementExpenseActionEnum, ReimbursementExpenseState, ReimbursementStatusEnum } from "../../entities";
2
2
  import { IProjectEntityGet } from "./project.entity.response";
3
3
  import { IReimbursementExpenseApiEntityArray } from "./reimbursement_expense.api";
4
- import { IUserApiEntity } from "./user.entity.api";
5
4
  export type IReimbursementApiEntity = IApiEntity<IReimbursementEntity>;
6
5
  export type IReimbursementApiEntityArray = IReimbursementApiEntity[];
7
6
  export type IReimbursementEntityGet = {
8
7
  reimbursements: IReimbursementResponse[];
9
8
  users: {
10
- [key: string]: IUserApiEntity;
9
+ [key: string]: IUserEntity;
11
10
  };
12
11
  projects: IProjectEntityGet;
13
12
  };
@@ -1,8 +1,7 @@
1
- import { IApiEntity, IProjectUserMappingEntity, ITimesheetEntity, ITimesheetEntityUpdateDto, TimesheetActionEnum, TimesheetStatusEnum } from "../../entities";
1
+ import { IApiEntity, IProjectUserMappingEntity, ITimesheetEntity, ITimesheetEntityUpdateDto, IUserEntity, TimesheetActionEnum, TimesheetStatusEnum } from "../../entities";
2
2
  import { IBaseResponse } from "./base.response.interface";
3
3
  import { IClientApiEntityDependent } from "./client.entity.response";
4
4
  import { IProjectApiEntityDependent } from "./project.entity.response";
5
- import { IUserApiEntity } from "./user.entity.api";
6
5
  export type ITimesheetApiEntity = IApiEntity<ITimesheetEntity>;
7
6
  export type ITimesheetApiEntityArray = ITimesheetApiEntity[];
8
7
  export type ITimesheetApiEntityResponse = IBaseResponse<ITimesheetApiEntity>;
@@ -16,7 +15,7 @@ export type ITimesheetEntityGet = {
16
15
  [key: string]: IProjectApiEntityDependent;
17
16
  };
18
17
  users: {
19
- [key: string]: IUserApiEntity;
18
+ [key: string]: IUserEntity;
20
19
  };
21
20
  tasks: string[];
22
21
  };
@@ -1,5 +1,5 @@
1
- import { IUserApiEntity } from "./user.entity.api";
2
- export interface IUserCreateDto extends Omit<IUserApiEntity, "id" | "updatedOn" | "updatedBy" | "createdBy" | "createdOn" | "password" | "status" | "organizationId"> {
1
+ import { IUserEntity } from "../../entities";
2
+ export interface IUserCreateDto extends Omit<IUserEntity, "id" | "updatedOn" | "updatedBy" | "createdBy" | "createdOn" | "password" | "status" | "organizationId"> {
3
3
  panDocument?: File;
4
4
  aadharDocument?: File;
5
5
  passportDocument?: File;
@@ -1,5 +1,5 @@
1
- import { IUserApiEntity } from "./user.entity.api";
2
- export interface IUserUpdateDto extends Omit<IUserApiEntity, "createdOn" | "updatedOn" | "createdBy" | "updatedBy" | "id" | "organizationId"> {
1
+ import { IUserEntity } from "../../entities";
2
+ export interface IUserUpdateDto extends Omit<IUserEntity, "createdOn" | "updatedOn" | "createdBy" | "updatedBy" | "id" | "organizationId"> {
3
3
  panDocument?: File;
4
4
  aadharDocument?: File;
5
5
  }
@@ -1,7 +1,7 @@
1
1
  import { UserRoleEnum, UserStatusEnum } from "../enums/user.entity.enum";
2
- import { IAuditColumnEntity } from "./audit-column.entity.interface";
2
+ import { IEntityAuditColumn } from "./entity-audit-columns.interface";
3
3
  import { IEntityFilterData } from "./entity.utils.interface";
4
- export interface IUserEntity extends IAuditColumnEntity {
4
+ export interface IUserEntity extends IEntityAuditColumn {
5
5
  id: number;
6
6
  name: string;
7
7
  email: string;
@@ -5,4 +5,4 @@ export declare function getEntityIndexMap<T extends EntityEnum>(data: IBaseEntit
5
5
  enumEntities: EntityEnum[];
6
6
  }): EntityIndexMap;
7
7
  export declare function populateRelationsFor(entityIndexMap: EntityIndexMap, enumEntities: EntityEnum[]): void;
8
- export declare function parseEntities<T extends EnumEntityType<EntityEnum>>(json: IBaseEntityApiResponse<T>, baseEntity: EntityEnum, entityMap: EntityMap, epoch?: boolean): EntityMap;
8
+ export declare function parseEntities<T extends EnumEntityType<EntityEnum>>(json: IBaseEntityApiResponse<T>, baseEntity: EntityEnum, entityMap: EntityMap): EntityMap;
@@ -47,13 +47,13 @@ function populateRelationsFor(entityIndexMap, enumEntities) {
47
47
  base_entity_model_1.BaseEntityModel.populateRelationsForEntities(entityIndexMap, entity);
48
48
  });
49
49
  }
50
- function parseEntities(json, baseEntity, entityMap, epoch) {
50
+ function parseEntities(json, baseEntity, entityMap) {
51
51
  var _a;
52
52
  const entityFromJsonMappings = {
53
53
  [entity_utils_interface_1.EntityEnum.PROJECT]: project_entity_model_1.ProjectEntityModel.fromApiEntity,
54
54
  [entity_utils_interface_1.EntityEnum.CLIENT]: client_entity_model_1.ClientEntityModel.fromEntity,
55
55
  [entity_utils_interface_1.EntityEnum.BILLING]: billing_entity_model_1.BillingEntityModel.fromApiEntity,
56
- [entity_utils_interface_1.EntityEnum.USER]: user_entity_model_1.UserEntityModel.fromApiEntity,
56
+ [entity_utils_interface_1.EntityEnum.USER]: user_entity_model_1.UserEntityModel.fromEntity,
57
57
  [entity_utils_interface_1.EntityEnum.PROJECT_USER_MAPPING]: project_user_mapping_entity_model_1.ProjectUserMappingEntityModel.fromApiEntity,
58
58
  [entity_utils_interface_1.EntityEnum.REIMBURSEMENT]: reimbursement_entity_model_1.ReimbursementEntityModel.fromApiEntity,
59
59
  [entity_utils_interface_1.EntityEnum.REIMBURSEMENT_EXPENSE]: reimbursement_expense_entity_model_1.ReimbursementExpenseEntityModel.fromApiEntity,
@@ -1,8 +1,8 @@
1
- import { IUserApiEntity } from "../../api";
2
1
  import { UserRoleEnum, UserStatusEnum } from "../enums/user.entity.enum";
3
2
  import { EntityEnum } from "../interface/entity.utils.interface";
3
+ import { IUserEntity } from "../interface/user.entity.interface";
4
4
  import { BaseEntityModel } from "./base.entity.model";
5
- export declare class UserEntityModel extends BaseEntityModel<EntityEnum.USER> implements IUserApiEntity {
5
+ export declare class UserEntityModel extends BaseEntityModel<EntityEnum.USER> implements IUserEntity {
6
6
  id: number;
7
7
  name: string;
8
8
  email: string;
@@ -39,8 +39,8 @@ export declare class UserEntityModel extends BaseEntityModel<EntityEnum.USER> im
39
39
  permissions?: string[];
40
40
  createdBy: number;
41
41
  updatedBy: number;
42
- createdOn: string;
43
- updatedOn: string;
42
+ createdOn: number;
43
+ updatedOn: number;
44
44
  getRelationConfigs(): any[];
45
- static fromApiEntity(apiEntity: IUserApiEntity): UserEntityModel;
45
+ static fromEntity(entity: IUserEntity): UserEntityModel;
46
46
  }
@@ -21,16 +21,16 @@ class UserEntityModel extends base_entity_model_1.BaseEntityModel {
21
21
  this.emergencyContactRelation = "";
22
22
  this.createdBy = 0;
23
23
  this.updatedBy = 0;
24
- this.createdOn = "";
25
- this.updatedOn = "";
24
+ this.createdOn = 0;
25
+ this.updatedOn = 0;
26
26
  }
27
27
  getRelationConfigs() {
28
28
  return this.constructor.prototype.constructor.relationConfigs || [];
29
29
  }
30
- static fromApiEntity(apiEntity) {
31
- const entity = new UserEntityModel(entity_utils_interface_1.EntityEnum.USER);
32
- Object.assign(entity, apiEntity);
33
- return entity;
30
+ static fromEntity(entity) {
31
+ const result = new UserEntityModel(entity_utils_interface_1.EntityEnum.USER);
32
+ Object.assign(result, entity);
33
+ return result;
34
34
  }
35
35
  }
36
36
  exports.UserEntityModel = UserEntityModel;
@@ -14,8 +14,8 @@ const userDTO = {
14
14
  designation: "",
15
15
  role: entities_1.UserRoleEnum.employee,
16
16
  dateOfBirth: "",
17
- createdOn: new Date(),
18
- updatedOn: new Date(),
17
+ createdOn: 0,
18
+ updatedOn: 0,
19
19
  createdBy: 1,
20
20
  updatedBy: 1,
21
21
  panDocumentUrl: "",
package/package.json CHANGED
@@ -1,35 +1,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
+ {
2
+ "name": "law-common",
3
+ "version": "10.23.1-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 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,3 +0,0 @@
1
- import { IApiEntity, IUserEntity } from "../../entities";
2
- export type IUserApiEntity = IApiEntity<IUserEntity>;
3
- export type IUserApiEntityArray = IUserApiEntity[];
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +0,0 @@
1
- import { IBaseResponse } from "./base.response.interface";
2
- import { IUserApiEntity } from "./user.entity.api";
3
- export type IUserApiEntityResponse = IBaseResponse<IUserApiEntity>;
4
- export type IUserApiEntityResponseArray = IBaseResponse<IUserApiEntity[]>;
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });