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

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 (27) hide show
  1. package/dist/src/api/index.d.ts +0 -5
  2. package/dist/src/api/index.js +0 -5
  3. package/dist/src/api/interface/bank.entity.response.d.ts +3 -8
  4. package/dist/src/api/interface/expense_type.entity.response.d.ts +3 -3
  5. package/dist/src/api/interface/office.location.entity.response.d.ts +3 -3
  6. package/dist/src/api/interface/project.entity.response.d.ts +2 -3
  7. package/dist/src/entities/interface/bank.entity.interface.d.ts +2 -2
  8. package/dist/src/entities/interface/expense_type.entity.interface.d.ts +2 -2
  9. package/dist/src/entities/interface/intermediary_bank.entity.interface.d.ts +2 -2
  10. package/dist/src/entities/interface/office.location.entity.d.ts +2 -2
  11. package/dist/src/entities/interface/rate.entity.interface.d.ts +3 -2
  12. package/dist/src/entities/model/bank.entity.model.d.ts +5 -5
  13. package/dist/src/entities/model/bank.entity.model.js +6 -6
  14. package/dist/src/entities/model/entity.model.interface.js +1 -1
  15. package/dist/src/utils/helper.fn.util.d.ts +1 -0
  16. package/dist/src/utils/helper.fn.util.js +6 -0
  17. package/package.json +1 -1
  18. package/dist/src/api/interface/bank.entity.api.d.ts +0 -3
  19. package/dist/src/api/interface/bank.entity.api.js +0 -2
  20. package/dist/src/api/interface/expense_type.entity.api.d.ts +0 -3
  21. package/dist/src/api/interface/expense_type.entity.api.js +0 -2
  22. package/dist/src/api/interface/intermediary.bank.entity.response.d.ts +0 -3
  23. package/dist/src/api/interface/intermediary.bank.entity.response.js +0 -2
  24. package/dist/src/api/interface/office.location.entity.api.d.ts +0 -3
  25. package/dist/src/api/interface/office.location.entity.api.js +0 -2
  26. package/dist/src/api/interface/rate.entity.response.d.ts +0 -4
  27. package/dist/src/api/interface/rate.entity.response.js +0 -2
@@ -7,7 +7,6 @@ export * from "./interface/jwt.payload.interface";
7
7
  export * from "./interface/user.update.dto.interface";
8
8
  export * from "./interface/login.dto.interface";
9
9
  export * from "./interface/configuration.entity.response";
10
- export * from "./interface/rate.entity.response";
11
10
  export * from "./interface/client.entity.response";
12
11
  export * from "./interface/project.entity.response";
13
12
  export * from "./interface/timesheet.entity.response.interface";
@@ -15,13 +14,11 @@ export * from "./interface/project.response.interface";
15
14
  export * from "./interface/reimbursement.entity.response";
16
15
  export * from "./interface/expense_type.create.dto.interface";
17
16
  export * from "./interface/task.create.dto.interface";
18
- export * from "./interface/expense_type.entity.api";
19
17
  export * from "./interface/expense_type.update.dto";
20
18
  export * from "./interface/expense_type.entity.response";
21
19
  export * from "./interface/billing.create.dto.interface";
22
20
  export * from "./interface/billing.entity.response";
23
21
  export * from "./interface/office.location.create.dto.interface";
24
- export * from "./interface/office.location.entity.api";
25
22
  export * from "./interface/office.Location.update.dto.interface";
26
23
  export * from "./interface/office.location.entity.response";
27
24
  export * from "./interface/billing.timesheet.entity.api";
@@ -29,7 +26,6 @@ export * from "./interface/billing.entity.api";
29
26
  export * from "./interface/billing.update.dto.interface";
30
27
  export * from "./interface/bank.create.dto.interface";
31
28
  export * from "./interface/bank.update.dto.interface";
32
- export * from "./interface/bank.entity.api";
33
29
  export * from "./interface/bank.entity.response";
34
30
  export * from "./interface/billing.payment.create.dto.interface";
35
31
  export * from "./interface/billing.payment.entity.api";
@@ -67,7 +63,6 @@ export * from "./interface/work.from.home.create.dto.interface";
67
63
  export * from "./interface/work.from.home.update.interface";
68
64
  export * from "./interface/work_from_home_history.api";
69
65
  export * from "./interface/organization.entity.api";
70
- export * from "./interface/intermediary.bank.entity.response";
71
66
  export * from "./interface/holiday.entity.response";
72
67
  export * from "./interface/holiday-list.entity.response";
73
68
  export * from "./interface/cron-job-manual-trigger.dto.interface";
@@ -23,7 +23,6 @@ __exportStar(require("./interface/jwt.payload.interface"), exports);
23
23
  __exportStar(require("./interface/user.update.dto.interface"), exports);
24
24
  __exportStar(require("./interface/login.dto.interface"), exports);
25
25
  __exportStar(require("./interface/configuration.entity.response"), exports);
26
- __exportStar(require("./interface/rate.entity.response"), exports);
27
26
  __exportStar(require("./interface/client.entity.response"), exports);
28
27
  __exportStar(require("./interface/project.entity.response"), exports);
29
28
  __exportStar(require("./interface/timesheet.entity.response.interface"), exports);
@@ -31,13 +30,11 @@ __exportStar(require("./interface/project.response.interface"), exports);
31
30
  __exportStar(require("./interface/reimbursement.entity.response"), exports);
32
31
  __exportStar(require("./interface/expense_type.create.dto.interface"), exports);
33
32
  __exportStar(require("./interface/task.create.dto.interface"), exports);
34
- __exportStar(require("./interface/expense_type.entity.api"), exports);
35
33
  __exportStar(require("./interface/expense_type.update.dto"), exports);
36
34
  __exportStar(require("./interface/expense_type.entity.response"), exports);
37
35
  __exportStar(require("./interface/billing.create.dto.interface"), exports);
38
36
  __exportStar(require("./interface/billing.entity.response"), exports);
39
37
  __exportStar(require("./interface/office.location.create.dto.interface"), exports);
40
- __exportStar(require("./interface/office.location.entity.api"), exports);
41
38
  __exportStar(require("./interface/office.Location.update.dto.interface"), exports);
42
39
  __exportStar(require("./interface/office.location.entity.response"), exports);
43
40
  __exportStar(require("./interface/billing.timesheet.entity.api"), exports);
@@ -45,7 +42,6 @@ __exportStar(require("./interface/billing.entity.api"), exports);
45
42
  __exportStar(require("./interface/billing.update.dto.interface"), exports);
46
43
  __exportStar(require("./interface/bank.create.dto.interface"), exports);
47
44
  __exportStar(require("./interface/bank.update.dto.interface"), exports);
48
- __exportStar(require("./interface/bank.entity.api"), exports);
49
45
  __exportStar(require("./interface/bank.entity.response"), exports);
50
46
  __exportStar(require("./interface/billing.payment.create.dto.interface"), exports);
51
47
  __exportStar(require("./interface/billing.payment.entity.api"), exports);
@@ -83,7 +79,6 @@ __exportStar(require("./interface/work.from.home.create.dto.interface"), exports
83
79
  __exportStar(require("./interface/work.from.home.update.interface"), exports);
84
80
  __exportStar(require("./interface/work_from_home_history.api"), exports);
85
81
  __exportStar(require("./interface/organization.entity.api"), exports);
86
- __exportStar(require("./interface/intermediary.bank.entity.response"), exports);
87
82
  __exportStar(require("./interface/holiday.entity.response"), exports);
88
83
  __exportStar(require("./interface/holiday-list.entity.response"), exports);
89
84
  __exportStar(require("./interface/cron-job-manual-trigger.dto.interface"), exports);
@@ -1,9 +1,4 @@
1
- import { BankActionEnum, BankStatusEnum } from "../../entities";
2
- import { IBankApiEntity } from "./bank.entity.api";
3
- import { IBaseResponse } from "./base.response.interface";
4
- import { IIntermediaryBankApiEntityArray } from "./intermediary.bank.entity.response";
5
- export type IBankApiEntityResponse = IBaseResponse<IBankApiEntity>;
6
- export type IBankApiEntityResponseArray = IBaseResponse<IBankApiEntity[]>;
1
+ import { BankActionEnum, BankStatusEnum, IBankEntity, IIntermediaryBankEntity } from "../../entities";
7
2
  export type IBankFlowConfig = {
8
3
  [key in BankStatusEnum]?: {
9
4
  actions: {
@@ -14,7 +9,7 @@ export type IBankFlowConfig = {
14
9
  };
15
10
  };
16
11
  };
17
- export interface IBankEntityGet extends IBankApiEntity {
18
- intermediaryBankDetails?: IIntermediaryBankApiEntityArray;
12
+ export interface IBankEntityGet extends IBankEntity {
13
+ intermediaryBankDetails?: IIntermediaryBankEntity[];
19
14
  }
20
15
  export type IBankEntityGetArray = IBankEntityGet[];
@@ -1,4 +1,4 @@
1
+ import { IExpenseTypeEntity } from "../../entities";
1
2
  import { IBaseResponse } from "./base.response.interface";
2
- import { IExpenseTypeApiEntity } from "./expense_type.entity.api";
3
- export type IExpenseTypeApiEntityResponse = IBaseResponse<IExpenseTypeApiEntity>;
4
- export type IExpenseTypeApiEntityResponseArray = IBaseResponse<IExpenseTypeApiEntity[]>;
3
+ export type IExpenseTypeApiEntityResponse = IBaseResponse<IExpenseTypeEntity>;
4
+ export type IExpenseTypeApiEntityResponseArray = IBaseResponse<IExpenseTypeEntity[]>;
@@ -1,4 +1,4 @@
1
+ import { IOfficeLocationEntity } from "../../entities";
1
2
  import { IBaseResponse } from "./base.response.interface";
2
- import { IOfficeLocationApiEntity } from "./office.location.entity.api";
3
- export type IOfficeLocationApiEntityResponse = IBaseResponse<IOfficeLocationApiEntity>;
4
- export type IOfficeLocationApiEntityResponseArray = IBaseResponse<IOfficeLocationApiEntity[]>;
3
+ export type IOfficeLocationApiEntityResponse = IBaseResponse<IOfficeLocationEntity>;
4
+ export type IOfficeLocationApiEntityResponseArray = IBaseResponse<IOfficeLocationEntity[]>;
@@ -1,5 +1,4 @@
1
- import { IApiEntity, IClientEntity, IDesignationEntity, IProjectCreateDtoExtra, IProjectEntity, IProjectUserDto, IUserEntity } from "../../entities";
2
- import { IRateApiEntity } from "./rate.entity.response";
1
+ import { IApiEntity, IClientEntity, IDesignationEntity, IProjectCreateDtoExtra, IProjectEntity, IProjectUserDto, IRateEntity, IUserEntity } from "../../entities";
3
2
  export type IProjectApiEntity = IApiEntity<IProjectEntity>;
4
3
  export type IProjectApiEntityArray = IProjectApiEntity[];
5
4
  export interface IProjectUserDtoResponse extends IProjectUserDto {
@@ -21,6 +20,6 @@ export type IProjectEntityGet = {
21
20
  [key: string]: IDesignationEntity;
22
21
  };
23
22
  rates?: {
24
- [key: string]: IRateApiEntity;
23
+ [key: string]: IRateEntity;
25
24
  };
26
25
  };
@@ -1,8 +1,8 @@
1
1
  import { BankActionEnum } from "../enums/bank_action.enum";
2
2
  import { BankStatusEnum } from "../enums/bank_status.enum";
3
- import { IAuditColumnEntity } from "./audit-column.entity.interface";
3
+ import { IEntityAuditColumn } from "./entity-audit-columns.interface";
4
4
  import { IEntityFilterData } from "./entity.utils.interface";
5
- export interface IBankEntity extends IAuditColumnEntity {
5
+ export interface IBankEntity extends IEntityAuditColumn {
6
6
  id: number;
7
7
  accountName: string;
8
8
  organizationId: number;
@@ -1,7 +1,7 @@
1
1
  import { ExpenseTypeEnum } from "../enums/expense_type.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 IExpenseTypeEntity extends IAuditColumnEntity {
4
+ export interface IExpenseTypeEntity extends IEntityAuditColumn {
5
5
  id: number;
6
6
  name: string;
7
7
  description?: string;
@@ -1,7 +1,7 @@
1
1
  import { CurrencyEnum } from "../../enums";
2
- import { IAuditColumnEntity } from "./audit-column.entity.interface";
2
+ import { IEntityAuditColumn } from "./entity-audit-columns.interface";
3
3
  import { IEntityCreateDto, IEntityFilterData, IEntityUpdateDto } from "./entity.utils.interface";
4
- export interface IIntermediaryBankEntity extends IAuditColumnEntity {
4
+ export interface IIntermediaryBankEntity extends IEntityAuditColumn {
5
5
  id: number;
6
6
  name: string;
7
7
  bankId: number;
@@ -1,6 +1,6 @@
1
- import { IAuditColumnEntity } from "../interface/audit-column.entity.interface";
1
+ import { IEntityAuditColumn } from "./entity-audit-columns.interface";
2
2
  import { IEntityFilterData } from "./entity.utils.interface";
3
- export interface IOfficeLocationEntity extends IAuditColumnEntity {
3
+ export interface IOfficeLocationEntity extends IEntityAuditColumn {
4
4
  id: number;
5
5
  name: string;
6
6
  address: string;
@@ -1,8 +1,9 @@
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";
4
5
  import { IEntityCreateDto, IEntityFilterData, IEntityUpdateDto } from "./entity.utils.interface";
5
- export interface IRateEntity extends IAuditColumnEntity {
6
+ export interface IRateEntity extends IEntityAuditColumn {
6
7
  id: number;
7
8
  designation: string;
8
9
  rate: number;
@@ -13,6 +14,6 @@ export interface IRateEntityCreateDto extends IEntityCreateDto<IRateEntity> {
13
14
  }
14
15
  export interface IRateEntityUpdateDto extends IEntityUpdateDto<IRateEntity> {
15
16
  }
16
- export interface IRateEntityUpdateByDesignationCurrencyDto extends PartialBy<Omit<IRateEntity, 'id' | keyof IAuditColumnEntity>, 'unit'> {
17
+ export interface IRateEntityUpdateByDesignationCurrencyDto extends PartialBy<Omit<IRateEntity, "id" | keyof IAuditColumnEntity>, "unit"> {
17
18
  }
18
19
  export type IRateEntityFilterData = IEntityFilterData<IRateEntity>;
@@ -1,8 +1,8 @@
1
- import { IBankApiEntity } from "../../api";
2
1
  import { BankStatusEnum } from "../enums/bank_status.enum";
2
+ import { IBankEntity } from "../interface/bank.entity.interface";
3
3
  import { EntityEnum } from "../interface/entity.utils.interface";
4
4
  import { BaseEntityModel } from "./base.entity.model";
5
- export declare class BankEntityModel extends BaseEntityModel<EntityEnum.BANK> implements IBankApiEntity {
5
+ export declare class BankEntityModel extends BaseEntityModel<EntityEnum.BANK> implements IBankEntity {
6
6
  id: number;
7
7
  accountName: string;
8
8
  organizationId: number;
@@ -16,8 +16,8 @@ export declare class BankEntityModel extends BaseEntityModel<EntityEnum.BANK> im
16
16
  swiftAddress?: string;
17
17
  createdBy: number;
18
18
  updatedBy: number;
19
- createdOn: string;
20
- updatedOn: string;
21
- static fromApiEntity(apiEntity: IBankApiEntity): BankEntityModel;
19
+ createdOn: number;
20
+ updatedOn: number;
21
+ static fromEntity(entity: IBankEntity): BankEntityModel;
22
22
  getRelationConfigs(): any[];
23
23
  }
@@ -18,13 +18,13 @@ class BankEntityModel extends base_entity_model_1.BaseEntityModel {
18
18
  this.status = bank_status_enum_1.BankStatusEnum.CREATE_APPROVAL;
19
19
  this.createdBy = 0;
20
20
  this.updatedBy = 0;
21
- this.createdOn = "";
22
- this.updatedOn = "";
21
+ this.createdOn = 0;
22
+ this.updatedOn = 0;
23
23
  }
24
- static fromApiEntity(apiEntity) {
25
- const entity = new BankEntityModel(entity_utils_interface_1.EntityEnum.BANK);
26
- Object.assign(entity, apiEntity);
27
- return entity;
24
+ static fromEntity(entity) {
25
+ const result = new BankEntityModel(entity_utils_interface_1.EntityEnum.BANK);
26
+ Object.assign(result, entity);
27
+ return result;
28
28
  }
29
29
  getRelationConfigs() {
30
30
  return this.constructor.prototype.constructor.relationConfigs || [];
@@ -59,7 +59,7 @@ function parseEntities(json, baseEntity, entityMap) {
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,
61
61
  [entity_utils_interface_1.EntityEnum.CLIENT_AFFILIATE]: client_affiliate_entity_model_1.ClientAffiliateEntityModel.fromApiEntity,
62
- [entity_utils_interface_1.EntityEnum.BANK]: bank_entity_model_1.BankEntityModel.fromApiEntity,
62
+ [entity_utils_interface_1.EntityEnum.BANK]: bank_entity_model_1.BankEntityModel.fromEntity,
63
63
  [entity_utils_interface_1.EntityEnum.CONFIGURATION]: configuration_model_1.ConfigurationEntityModel.fromApiEntity,
64
64
  [entity_utils_interface_1.EntityEnum.TASK]: task_entity_model_1.TaskEntityModel.fromEntity,
65
65
  [entity_utils_interface_1.EntityEnum.BILLING_TIMESHEET]: billing_timesheet_entity_model_1.BillingTimesheetEntityModel.fromApiEntity,
@@ -269,3 +269,4 @@ 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,6 +39,8 @@ 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");
42
44
  const util_constants_1 = require("../constants/util.constants");
43
45
  const error_key_enum_1 = require("../enums/error.key.enum");
44
46
  const exceptions_1 = require("../exceptions");
@@ -564,3 +566,7 @@ function convertToNumberType(value) {
564
566
  }
565
567
  return num;
566
568
  }
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,6 +1,6 @@
1
1
  {
2
2
  "name": "law-common",
3
- "version": "10.23.1-beta.0",
3
+ "version": "10.23.1-beta.2",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [
@@ -1,3 +0,0 @@
1
- import { IApiEntity, IBankEntity } from "../../entities";
2
- export type IBankApiEntity = IApiEntity<IBankEntity>;
3
- export type IBankApiEntityArray = IBankApiEntity[];
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +0,0 @@
1
- import { IApiEntity, IExpenseTypeEntity } from "../../entities";
2
- export type IExpenseTypeApiEntity = IApiEntity<IExpenseTypeEntity>;
3
- export type IExpenseTypeApiEntityArray = IExpenseTypeApiEntity[];
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +0,0 @@
1
- import { IApiEntity, IIntermediaryBankEntity } from "../../entities";
2
- export type IIntermediaryBankApiEntity = IApiEntity<IIntermediaryBankEntity>;
3
- export type IIntermediaryBankApiEntityArray = IIntermediaryBankApiEntity[];
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +0,0 @@
1
- import { IApiEntity, IOfficeLocationEntity } from "../../entities";
2
- export type IOfficeLocationApiEntity = IApiEntity<IOfficeLocationEntity>;
3
- export type IOfficeLocationApiEntityArray = IOfficeLocationApiEntity[];
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +0,0 @@
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,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });