law-common 10.64.2-beta.0 → 10.64.2-beta.1

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,18 +1,5 @@
1
- import { HistoryOperationEnum } from "../enums/history_operation.enum";
2
- import { EntityEnum } from "../interface/entity.utils.interface";
3
- import { IBankHistoryEntity } from "../interface/bank_history.entity.interface";
4
- import { RelationConfigs } from "../interface/relation-config.interface";
5
- import { BaseEntityModel } from "./base.entity.model";
6
- export declare class BankHistoryEntityModel extends BaseEntityModel<EntityEnum.BANK_HISTORY> implements IBankHistoryEntity {
7
- id: number;
8
- entityId: number;
9
- operation: HistoryOperationEnum;
10
- data: string;
11
- createdOn: number;
12
- updatedOn: number;
13
- createdBy: number;
14
- updatedBy: number;
15
- static relationConfigs: RelationConfigs<[], EntityEnum.BANK_HISTORY>;
16
- static fromEntity(entity: IBankHistoryEntity): BankHistoryEntityModel;
17
- getRelationConfigs(): [];
1
+ import { EntityEnum, IBaseHistoryEntity } from "../interface/entity.utils.interface";
2
+ import { HistoryEntityModel } from "./timesheet_history.entity.model";
3
+ export declare class BankHistoryEntityModel extends HistoryEntityModel<EntityEnum.BANK_HISTORY> {
4
+ static fromEntity(entity: IBaseHistoryEntity): BankHistoryEntityModel;
18
5
  }
@@ -1,29 +1,35 @@
1
1
  "use strict";
2
+ // import { HistoryOperationEnum } from "../enums/history_operation.enum";
3
+ // import { EntityEnum } from "../interface/entity.utils.interface";
4
+ // import { IBankHistoryEntity } from "../interface/bank_history.entity.interface";
5
+ // import { RelationConfigs } from "../interface/relation-config.interface";
6
+ // import { BaseEntityModel } from "./base.entity.model";
2
7
  Object.defineProperty(exports, "__esModule", { value: true });
3
8
  exports.BankHistoryEntityModel = void 0;
4
- const history_operation_enum_1 = require("../enums/history_operation.enum");
5
9
  const entity_utils_interface_1 = require("../interface/entity.utils.interface");
6
- const base_entity_model_1 = require("./base.entity.model");
7
- class BankHistoryEntityModel extends base_entity_model_1.BaseEntityModel {
8
- constructor() {
9
- super(...arguments);
10
- this.id = 0;
11
- this.entityId = 0;
12
- this.operation = history_operation_enum_1.HistoryOperationEnum.CREATE;
13
- this.data = "";
14
- this.createdOn = 0;
15
- this.updatedOn = 0;
16
- this.createdBy = 0;
17
- this.updatedBy = 0;
18
- }
10
+ const timesheet_history_entity_model_1 = require("./timesheet_history.entity.model");
11
+ // export class BankHistoryEntityModel extends BaseEntityModel<EntityEnum.BANK_HISTORY> implements IBankHistoryEntity {
12
+ // id: number = 0;
13
+ // entityId: number = 0;
14
+ // operation: HistoryOperationEnum = HistoryOperationEnum.CREATE;
15
+ // data: string = "";
16
+ // createdOn: number = 0;
17
+ // updatedOn: number = 0;
18
+ // createdBy: number = 0;
19
+ // updatedBy: number = 0;
20
+ // static relationConfigs: RelationConfigs<[], EntityEnum.BANK_HISTORY> = [];
21
+ // static fromEntity(entity: IBankHistoryEntity): BankHistoryEntityModel {
22
+ // const result = new BankHistoryEntityModel(EntityEnum.BANK_HISTORY);
23
+ // Object.assign(result, entity);
24
+ // return result;
25
+ // }
26
+ // getRelationConfigs() {
27
+ // return BankHistoryEntityModel.relationConfigs;
28
+ // }
29
+ // }
30
+ class BankHistoryEntityModel extends timesheet_history_entity_model_1.HistoryEntityModel {
19
31
  static fromEntity(entity) {
20
- const result = new BankHistoryEntityModel(entity_utils_interface_1.EntityEnum.BANK_HISTORY);
21
- Object.assign(result, entity);
22
- return result;
23
- }
24
- getRelationConfigs() {
25
- return BankHistoryEntityModel.relationConfigs;
32
+ return timesheet_history_entity_model_1.HistoryEntityModel.createFromEntity(entity_utils_interface_1.EntityEnum.BANK_HISTORY, entity);
26
33
  }
27
34
  }
28
35
  exports.BankHistoryEntityModel = BankHistoryEntityModel;
29
- BankHistoryEntityModel.relationConfigs = [];
@@ -1,7 +1,7 @@
1
1
  import { HistoryOperationEnum } from "../enums/history_operation.enum";
2
- import { EntityEnum } from "../interface/entity.utils.interface";
3
- import { ITimesheetHistoryEntity } from "../interface/timesheet_history.entity.interface";
2
+ import { EntityEnum, IBaseHistoryEntity } from "../interface/entity.utils.interface";
4
3
  import { RelationConfigs } from "../interface/relation-config.interface";
4
+ import { ITimesheetHistoryEntity } from "../interface/timesheet_history.entity.interface";
5
5
  import { BaseEntityModel } from "./base.entity.model";
6
6
  export declare class TimesheetHistoryEntityModel extends BaseEntityModel<EntityEnum.TIMESHEET_HISTORY> implements ITimesheetHistoryEntity {
7
7
  id: number;
@@ -16,3 +16,16 @@ export declare class TimesheetHistoryEntityModel extends BaseEntityModel<EntityE
16
16
  static fromEntity(entity: ITimesheetHistoryEntity): TimesheetHistoryEntityModel;
17
17
  getRelationConfigs(): [];
18
18
  }
19
+ export declare class HistoryEntityModel<E extends EntityEnum> extends BaseEntityModel<E> implements IBaseHistoryEntity {
20
+ id: number;
21
+ entityId: number;
22
+ operation: HistoryOperationEnum;
23
+ data: string;
24
+ createdOn: number;
25
+ updatedOn: number;
26
+ createdBy: number;
27
+ updatedBy: number;
28
+ static relationConfigs: RelationConfigs<[], EntityEnum>;
29
+ static createFromEntity<E extends EntityEnum>(entityEnum: E, entity: IBaseHistoryEntity): HistoryEntityModel<E>;
30
+ getRelationConfigs(): [];
31
+ }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TimesheetHistoryEntityModel = void 0;
3
+ exports.HistoryEntityModel = exports.TimesheetHistoryEntityModel = void 0;
4
4
  const history_operation_enum_1 = require("../enums/history_operation.enum");
5
5
  const entity_utils_interface_1 = require("../interface/entity.utils.interface");
6
6
  const base_entity_model_1 = require("./base.entity.model");
@@ -27,3 +27,27 @@ class TimesheetHistoryEntityModel extends base_entity_model_1.BaseEntityModel {
27
27
  }
28
28
  exports.TimesheetHistoryEntityModel = TimesheetHistoryEntityModel;
29
29
  TimesheetHistoryEntityModel.relationConfigs = [];
30
+ class HistoryEntityModel extends base_entity_model_1.BaseEntityModel {
31
+ constructor() {
32
+ super(...arguments);
33
+ this.id = 0;
34
+ this.entityId = 0;
35
+ this.operation = history_operation_enum_1.HistoryOperationEnum.CREATE;
36
+ this.data = "";
37
+ this.createdOn = 0;
38
+ this.updatedOn = 0;
39
+ this.createdBy = 0;
40
+ this.updatedBy = 0;
41
+ }
42
+ // Renamed to avoid collision with subclass overrides
43
+ static createFromEntity(entityEnum, entity) {
44
+ const result = new HistoryEntityModel(entityEnum);
45
+ Object.assign(result, entity);
46
+ return result;
47
+ }
48
+ getRelationConfigs() {
49
+ return HistoryEntityModel.relationConfigs;
50
+ }
51
+ }
52
+ exports.HistoryEntityModel = HistoryEntityModel;
53
+ HistoryEntityModel.relationConfigs = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "law-common",
3
- "version": "10.64.2-beta.0",
3
+ "version": "10.64.2-beta.1",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [