law-common 10.23.1-beta.2 → 10.23.1-beta.3

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.
@@ -70,4 +70,3 @@ export * from "./interface/cron-job.entity.response";
70
70
  export * from "./interface/to-do.entity.api";
71
71
  export * from "./interface/billing-reimbursement-expense.api";
72
72
  export * from "./interface/billing-reimbursement-expense-history.api";
73
- export * from "./interface/project-user-mapping.entity.api";
@@ -86,4 +86,4 @@ __exportStar(require("./interface/cron-job.entity.response"), exports);
86
86
  __exportStar(require("./interface/to-do.entity.api"), exports);
87
87
  __exportStar(require("./interface/billing-reimbursement-expense.api"), exports);
88
88
  __exportStar(require("./interface/billing-reimbursement-expense-history.api"), exports);
89
- __exportStar(require("./interface/project-user-mapping.entity.api"), exports);
89
+ // export * from "./interface/project-user-mapping.entity.api";
@@ -1,9 +1,8 @@
1
- import { BillingActionsEnum, BillingStatusEnum, IBillingEntity, IUserEntity } from "../../entities";
1
+ import { BillingActionsEnum, BillingStatusEnum, IBillingEntity, IProjectEntity, 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
- import { IProjectApiEntity } from "./project.entity.response";
7
6
  export type IBillingEntityResponse = {
8
7
  billing: IBillingApiEntity;
9
8
  billingTimesheets?: IBillingTimesheetApiEntity[];
@@ -13,7 +12,7 @@ export interface IUserEntityRelation {
13
12
  users?: IUserEntity[];
14
13
  }
15
14
  export interface IProjectEntityRelation {
16
- projects?: IProjectApiEntity[];
15
+ projects?: IProjectEntity[];
17
16
  }
18
17
  export interface IBillingRelatedEntities extends IUserEntityRelation, IProjectEntityRelation {
19
18
  }
@@ -1,13 +1,11 @@
1
- import { IApiEntity, IClientEntity, IDesignationEntity, IProjectCreateDtoExtra, IProjectEntity, IProjectUserDto, IRateEntity, IUserEntity } from "../../entities";
2
- export type IProjectApiEntity = IApiEntity<IProjectEntity>;
3
- export type IProjectApiEntityArray = IProjectApiEntity[];
1
+ import { IClientEntity, IDesignationEntity, IProjectCreateDtoExtra, IProjectEntity, IProjectUserDto, IRateEntity, IUserEntity } from "../../entities";
4
2
  export interface IProjectUserDtoResponse extends IProjectUserDto {
5
3
  updatedOn: string;
6
4
  }
7
5
  export interface IProjectEntityDependentResponse {
8
6
  users: IProjectUserDtoResponse[];
9
7
  }
10
- export type IProjectApiEntityDependent = IProjectApiEntity & IProjectEntityDependentResponse & IProjectCreateDtoExtra;
8
+ export type IProjectApiEntityDependent = IProjectEntity & IProjectEntityDependentResponse & IProjectCreateDtoExtra;
11
9
  export type IProjectEntityGet = {
12
10
  projects: IProjectApiEntityDependent[];
13
11
  users: {
@@ -2,11 +2,11 @@ import { CurrencyEnum, TimeUnitEnum } from "../../enums";
2
2
  import { ProjectBillingTypeEnum, ProjectStatusEnum } from "../enums/project.entity.enum";
3
3
  import { ProjectUserStatusEnum } from "../enums/project_user_status.enum";
4
4
  import { UserRoleEnum } from "../enums/user.entity.enum";
5
- import { IAuditColumnEntity } from "./audit-column.entity.interface";
6
5
  import { IClientEntity } from "./client.entity.interface";
6
+ import { IEntityAuditColumn } from "./entity-audit-columns.interface";
7
7
  import { IEntityCreateDto, IEntityFilterData, IEntityUpdateDto } from "./entity.utils.interface";
8
8
  import { IUserEntity } from "./user.entity.interface";
9
- export interface IProjectEntity extends IAuditColumnEntity {
9
+ export interface IProjectEntity extends IEntityAuditColumn {
10
10
  id: number;
11
11
  name: string;
12
12
  clientId: number;
@@ -57,7 +57,7 @@ export interface IProjectEntityUpdateDto extends Omit<IEntityUpdateDto<IProjectE
57
57
  }
58
58
  export interface IProjectEntityFilterDto extends IEntityFilterData<IProjectEntity> {
59
59
  }
60
- export interface IProjectUserMappingEntity extends IAuditColumnEntity {
60
+ export interface IProjectUserMappingEntity extends IEntityAuditColumn {
61
61
  id: number;
62
62
  projectId: number;
63
63
  userId: number;
@@ -50,11 +50,11 @@ function populateRelationsFor(entityIndexMap, enumEntities) {
50
50
  function parseEntities(json, baseEntity, entityMap) {
51
51
  var _a;
52
52
  const entityFromJsonMappings = {
53
- [entity_utils_interface_1.EntityEnum.PROJECT]: project_entity_model_1.ProjectEntityModel.fromApiEntity,
53
+ [entity_utils_interface_1.EntityEnum.PROJECT]: project_entity_model_1.ProjectEntityModel.fromEntity,
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
56
  [entity_utils_interface_1.EntityEnum.USER]: user_entity_model_1.UserEntityModel.fromEntity,
57
- [entity_utils_interface_1.EntityEnum.PROJECT_USER_MAPPING]: project_user_mapping_entity_model_1.ProjectUserMappingEntityModel.fromApiEntity,
57
+ [entity_utils_interface_1.EntityEnum.PROJECT_USER_MAPPING]: project_user_mapping_entity_model_1.ProjectUserMappingEntityModel.fromEntity,
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,
60
60
  [entity_utils_interface_1.EntityEnum.BILLING_REIMBURSEMENT_EXPENSE]: billing_reimbursement_expense_entity_model_1.BillingReimbursementExpneseEntityModel.fromApiEntity,
@@ -1,23 +1,22 @@
1
- import { IProjectUserMappingApiEntity } from "../../api";
2
1
  import { ProjectUserStatusEnum } from "../enums/project_user_status.enum";
3
- import { EntityEnum, EnumEntityType, IEntityApiResponse } from "../interface/entity.utils.interface";
2
+ import { EntityEnum, EnumEntityType } from "../interface/entity.utils.interface";
4
3
  import { IProjectUserMappingEntity } from "../interface/project.entity.interface";
5
4
  import { RelationConfigs } from "../interface/relation-config.interface";
6
5
  import { BaseEntityModel } from "./base.entity.model";
7
6
  import { ProjectEntityModel } from "./project.entity.model";
8
7
  import { UserEntityModel } from "./user.entity.model";
9
- export declare class ProjectUserMappingEntityModel extends BaseEntityModel<EntityEnum.PROJECT_USER_MAPPING> implements IProjectUserMappingApiEntity {
8
+ export declare class ProjectUserMappingEntityModel extends BaseEntityModel<EntityEnum.PROJECT_USER_MAPPING> implements IProjectUserMappingEntity {
10
9
  id: number;
11
10
  projectId: number;
12
11
  userId: number;
13
12
  status: ProjectUserStatusEnum;
14
- createdOn: string;
15
- updatedOn: string;
13
+ createdOn: number;
14
+ updatedOn: number;
16
15
  createdBy: number;
17
16
  updatedBy: number;
18
17
  user?: UserEntityModel;
19
18
  project?: ProjectEntityModel;
20
- static fromApiEntity(apiEntity: IEntityApiResponse<IProjectUserMappingEntity>): ProjectUserMappingEntityModel;
19
+ static fromEntity(entity: IProjectUserMappingEntity): ProjectUserMappingEntityModel;
21
20
  static relationConfigs: RelationConfigs<[
22
21
  EntityEnum.USER,
23
22
  EntityEnum.PROJECT
@@ -12,15 +12,15 @@ class ProjectUserMappingEntityModel extends base_entity_model_1.BaseEntityModel
12
12
  this.projectId = 0;
13
13
  this.userId = 0;
14
14
  this.status = project_user_status_enum_1.ProjectUserStatusEnum.ACTIVE;
15
- this.createdOn = "";
16
- this.updatedOn = "";
15
+ this.createdOn = 0;
16
+ this.updatedOn = 0;
17
17
  this.createdBy = 0;
18
18
  this.updatedBy = 0;
19
19
  }
20
- static fromApiEntity(apiEntity) {
21
- const entity = new ProjectUserMappingEntityModel(entity_utils_interface_1.EntityEnum.PROJECT_USER_MAPPING);
22
- Object.assign(entity, apiEntity);
23
- return entity;
20
+ static fromEntity(entity) {
21
+ const result = new ProjectUserMappingEntityModel(entity_utils_interface_1.EntityEnum.PROJECT_USER_MAPPING);
22
+ Object.assign(result, entity);
23
+ return result;
24
24
  }
25
25
  getRelationConfigs() {
26
26
  return ProjectUserMappingEntityModel.relationConfigs;
@@ -1,14 +1,13 @@
1
- import { IProjectApiEntity } from "../../api";
2
1
  import { CurrencyEnum } from "../../enums";
3
2
  import { ProjectBillingTypeEnum, ProjectStatusEnum } from "../enums/project.entity.enum";
4
3
  import { EntityEnum, EnumEntityType } from "../interface/entity.utils.interface";
5
- import { IProjectUserDto } from "../interface/project.entity.interface";
4
+ import { IProjectEntity, IProjectUserDto } from "../interface/project.entity.interface";
6
5
  import { RelationConfigs } from "../interface/relation-config.interface";
7
6
  import { BaseEntityModel } from "./base.entity.model";
8
7
  import { ClientEntityModel } from "./client.entity.model";
9
8
  import { ProjectUserMappingEntityModel } from "./project-user-mapping.entity.model";
10
9
  import { UserEntityModel } from "./user.entity.model";
11
- export declare class ProjectEntityModel extends BaseEntityModel<EntityEnum.PROJECT> implements IProjectApiEntity {
10
+ export declare class ProjectEntityModel extends BaseEntityModel<EntityEnum.PROJECT> implements IProjectEntity {
12
11
  id: number;
13
12
  name: string;
14
13
  clientId: number;
@@ -23,14 +22,14 @@ export declare class ProjectEntityModel extends BaseEntityModel<EntityEnum.PROJE
23
22
  actualEndDate?: string;
24
23
  createdBy: number;
25
24
  updatedBy: number;
26
- createdOn: string;
27
- updatedOn: string;
25
+ createdOn: number;
26
+ updatedOn: number;
28
27
  users?: IProjectUserDto[];
29
28
  billingOverdueDays?: number;
30
29
  userMappings?: (UserEntityModel & ProjectUserMappingEntityModel)[];
31
30
  projectUserMappings?: ProjectUserMappingEntityModel[];
32
31
  client: ClientEntityModel;
33
- static fromApiEntity(apiEntity: IProjectApiEntity): ProjectEntityModel;
32
+ static fromEntity(entity: IProjectEntity): ProjectEntityModel;
34
33
  static relationConfigs: RelationConfigs<[
35
34
  EntityEnum.PROJECT_USER_MAPPING,
36
35
  EntityEnum.CLIENT
@@ -20,31 +20,31 @@ class ProjectEntityModel extends base_entity_model_1.BaseEntityModel {
20
20
  this.organizationId = 0;
21
21
  this.createdBy = 0;
22
22
  this.updatedBy = 0;
23
- this.createdOn = "";
24
- this.updatedOn = "";
23
+ this.createdOn = 0;
24
+ this.updatedOn = 0;
25
25
  this.users = [];
26
26
  this.client = {};
27
27
  }
28
- static fromApiEntity(apiEntity) {
29
- const entity = new ProjectEntityModel(entity_utils_interface_1.EntityEnum.PROJECT);
30
- entity.id = apiEntity.id;
31
- entity.name = apiEntity.name;
32
- entity.clientId = apiEntity.clientId;
33
- entity.startDate = apiEntity.startDate;
34
- entity.currency = apiEntity.currency;
35
- entity.billingType = apiEntity.billingType;
36
- entity.billingRate = apiEntity.billingRate;
37
- entity.status = apiEntity.status;
38
- entity.organizationId = apiEntity.organizationId;
39
- entity.description = apiEntity.description;
40
- entity.expectedEndDate = apiEntity.expectedEndDate;
41
- entity.actualEndDate = apiEntity.actualEndDate;
42
- entity.createdBy = apiEntity.createdBy;
43
- entity.updatedBy = apiEntity.updatedBy;
44
- entity.createdOn = apiEntity.createdOn;
45
- entity.updatedOn = apiEntity.updatedOn;
46
- entity.billingOverdueDays = apiEntity.billingOverdueDays;
47
- return entity;
28
+ static fromEntity(entity) {
29
+ const result = new ProjectEntityModel(entity_utils_interface_1.EntityEnum.PROJECT);
30
+ result.id = entity.id;
31
+ result.name = entity.name;
32
+ result.clientId = entity.clientId;
33
+ result.startDate = entity.startDate;
34
+ result.currency = entity.currency;
35
+ result.billingType = entity.billingType;
36
+ result.billingRate = entity.billingRate;
37
+ result.status = entity.status;
38
+ result.organizationId = entity.organizationId;
39
+ result.description = entity.description;
40
+ result.expectedEndDate = entity.expectedEndDate;
41
+ result.actualEndDate = entity.actualEndDate;
42
+ result.createdBy = entity.createdBy;
43
+ result.updatedBy = entity.updatedBy;
44
+ result.createdOn = entity.createdOn;
45
+ result.updatedOn = entity.updatedOn;
46
+ result.billingOverdueDays = entity.billingOverdueDays;
47
+ return result;
48
48
  }
49
49
  populateUsers(users, projectUserMapping) {
50
50
  // const projectUserDto = projectUserMapping
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "law-common",
3
- "version": "10.23.1-beta.2",
3
+ "version": "10.23.1-beta.3",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [
@@ -1,3 +0,0 @@
1
- import { IApiEntity, IProjectUserMappingEntity } from "../../entities";
2
- export type IProjectUserMappingApiEntity = IApiEntity<IProjectUserMappingEntity>;
3
- export type IProjectUserMappingApiEntityArray = IProjectUserMappingApiEntity[];
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });