law-common 10.28.1 → 10.28.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,6 +1,7 @@
1
1
  import { IEntityAuditColumn } from "./entity-audit-columns.interface";
2
2
  export interface IAddressBookEntity extends IEntityAuditColumn {
3
3
  id: number;
4
+ organizationName: string;
4
5
  contactDetails: string;
5
6
  address?: string;
6
7
  country: string;
@@ -3,6 +3,7 @@ import { ConvertToArray } from "../../misc";
3
3
  import { Modify } from "../../misc/interface/modify.interface";
4
4
  import { EntitySearchConstraintTypeEnum } from "../enums/entity_search_constraint_type.enum";
5
5
  import { HistoryOperationEnum } from "../enums/history_operation.enum";
6
+ import { AddressBookEntityModel } from "../model/address_book.model";
6
7
  import { BankEntityModel } from "../model/bank.entity.model";
7
8
  import { BillingReimbursementExpneseEntityModel } from "../model/billing-reimbursement-expense.entity.model";
8
9
  import { BillingTimesheetEntityModel } from "../model/billing-timesheet.entity.model";
@@ -285,7 +286,7 @@ export declare enum VirtualEntityEnum {
285
286
  }
286
287
  export type IHistoryConstraintSearchResponse<T> = IBaseResponse<IHistoryEntitySearchByConstraintResponse<T>[]>;
287
288
  export type IHistoryConstraintSearchServiceResponse<T> = IHistoryEntitySearchByConstraintResponse<T>[];
288
- export type EnumToModel<T extends EntityEnum | VirtualEntityEnum> = T extends EntityEnum.BILLING ? BillingEntityModel : T extends EntityEnum.CLIENT ? ClientEntityModel : T extends EntityEnum.PROJECT ? ProjectEntityModel : T extends EntityEnum.PROJECT_USER_MAPPING ? ProjectUserMappingEntityModel : T extends EntityEnum.REIMBURSEMENT ? ReimbursementEntityModel : T extends EntityEnum.REIMBURSEMENT_EXPENSE ? ReimbursementExpenseEntityModel : T extends EntityEnum.BILLING_REIMBURSEMENT_EXPENSE ? BillingReimbursementExpneseEntityModel : T extends EntityEnum.LEAVE ? LeaveEntityModel : T extends EntityEnum.HOLIDAY ? HolidayEntityModel : T extends VirtualEntityEnum.LEAVE_COUNT ? LeaveCountVirtualEntityModel : T extends EntityEnum.CLIENT_AFFILIATE ? ClientAffiliateEntityModel : T extends EntityEnum.BANK ? BankEntityModel : T extends EntityEnum.CONFIGURATION ? ConfigurationEntityModel : T extends EntityEnum.TASK ? TaskEntityModel : T extends EntityEnum.BILLING_TIMESHEET ? BillingTimesheetEntityModel : T extends EntityEnum.TIMESHEET ? TimesheetEntityModel : T extends EntityEnum.COUNTRY ? CountryEntityModel : T extends EntityEnum.BILLING_TRANSACTION ? BillingTransactionEntityModel : UserEntityModel;
289
+ export type EnumToModel<T extends EntityEnum | VirtualEntityEnum> = T extends EntityEnum.BILLING ? BillingEntityModel : T extends EntityEnum.CLIENT ? ClientEntityModel : T extends EntityEnum.PROJECT ? ProjectEntityModel : T extends EntityEnum.PROJECT_USER_MAPPING ? ProjectUserMappingEntityModel : T extends EntityEnum.REIMBURSEMENT ? ReimbursementEntityModel : T extends EntityEnum.REIMBURSEMENT_EXPENSE ? ReimbursementExpenseEntityModel : T extends EntityEnum.BILLING_REIMBURSEMENT_EXPENSE ? BillingReimbursementExpneseEntityModel : T extends EntityEnum.LEAVE ? LeaveEntityModel : T extends EntityEnum.HOLIDAY ? HolidayEntityModel : T extends VirtualEntityEnum.LEAVE_COUNT ? LeaveCountVirtualEntityModel : T extends EntityEnum.CLIENT_AFFILIATE ? ClientAffiliateEntityModel : T extends EntityEnum.BANK ? BankEntityModel : T extends EntityEnum.CONFIGURATION ? ConfigurationEntityModel : T extends EntityEnum.TASK ? TaskEntityModel : T extends EntityEnum.BILLING_TIMESHEET ? BillingTimesheetEntityModel : T extends EntityEnum.TIMESHEET ? TimesheetEntityModel : T extends EntityEnum.COUNTRY ? CountryEntityModel : T extends EntityEnum.BILLING_TRANSACTION ? BillingTransactionEntityModel : T extends EntityEnum.ADDRESS_BOOK ? AddressBookEntityModel : UserEntityModel;
289
290
  export type EntityMap = {
290
291
  [key in EntityEnum | VirtualEntityEnum]: EnumToModel<key>[];
291
292
  };
@@ -0,0 +1,31 @@
1
+ import { RelationType } from "../enums/relation-type.enum";
2
+ import { IAddressBookEntity } from "../interface/address-book.entity.interface";
3
+ import { EntityEnum } from "../interface/entity.utils.interface";
4
+ import { BaseEntityModel } from "./base.entity.model";
5
+ import { UserEntityModel } from "./user.entity.model";
6
+ export declare class AddressBookEntityModel extends BaseEntityModel<EntityEnum.ADDRESS_BOOK> implements IAddressBookEntity {
7
+ id: number;
8
+ organizationName: string;
9
+ contactDetails: string;
10
+ address?: string | undefined;
11
+ country: string;
12
+ notes?: string | undefined;
13
+ organizationId: number;
14
+ introducedBy?: number | undefined;
15
+ createdOn: number;
16
+ updatedOn: number;
17
+ createdBy: number;
18
+ updatedBy: number;
19
+ introducedByUser?: UserEntityModel | undefined;
20
+ static fromEntity(entity: IAddressBookEntity): AddressBookEntityModel;
21
+ static relationConfigs: {
22
+ name: EntityEnum;
23
+ relation: RelationType;
24
+ key: string;
25
+ mapKeyConfig: {
26
+ relationKey: string;
27
+ key: string;
28
+ };
29
+ }[];
30
+ getRelationConfigs(): any[];
31
+ }
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AddressBookEntityModel = void 0;
4
+ const relation_type_enum_1 = require("../enums/relation-type.enum");
5
+ const entity_utils_interface_1 = require("../interface/entity.utils.interface");
6
+ const base_entity_model_1 = require("./base.entity.model");
7
+ class AddressBookEntityModel extends base_entity_model_1.BaseEntityModel {
8
+ constructor() {
9
+ super(...arguments);
10
+ this.id = 0;
11
+ this.organizationName = "";
12
+ this.contactDetails = "";
13
+ this.address = "";
14
+ this.country = "";
15
+ this.notes = "";
16
+ this.organizationId = 0;
17
+ this.introducedBy = 0;
18
+ this.createdOn = 0;
19
+ this.updatedOn = 0;
20
+ this.createdBy = 0;
21
+ this.updatedBy = 0;
22
+ }
23
+ static fromEntity(entity) {
24
+ const result = new AddressBookEntityModel(entity_utils_interface_1.EntityEnum.ADDRESS_BOOK);
25
+ Object.assign(result, entity);
26
+ return result;
27
+ }
28
+ getRelationConfigs() {
29
+ return this.constructor.prototype.constructor.relationConfigs || [];
30
+ }
31
+ }
32
+ exports.AddressBookEntityModel = AddressBookEntityModel;
33
+ AddressBookEntityModel.relationConfigs = [
34
+ {
35
+ name: entity_utils_interface_1.EntityEnum.USER,
36
+ relation: relation_type_enum_1.RelationType.ONE,
37
+ key: "introducedByUser",
38
+ mapKeyConfig: {
39
+ relationKey: "id",
40
+ key: "introducedBy",
41
+ },
42
+ }
43
+ ];
@@ -28,6 +28,7 @@ const task_entity_model_1 = require("./task.entity.model");
28
28
  const timesheet_entity_model_1 = require("./timesheet.entity.model");
29
29
  const user_entity_model_1 = require("./user.entity.model");
30
30
  const country_entity_model_1 = require("./country.entity.model");
31
+ const address_book_model_1 = require("./address_book.model");
31
32
  function mapToIndex(entityMap) {
32
33
  return Object.keys(entityMap).reduce((acc, key) => {
33
34
  // @ts-ignore
@@ -75,6 +76,7 @@ exports.entityEnumToEntityModel = {
75
76
  [entity_utils_interface_1.EntityEnum.BILLING_TIMESHEET]: billing_timesheet_entity_model_1.BillingTimesheetEntityModel.fromEntity,
76
77
  [entity_utils_interface_1.EntityEnum.TIMESHEET]: timesheet_entity_model_1.TimesheetEntityModel.fromEntity,
77
78
  [entity_utils_interface_1.EntityEnum.COUNTRY]: country_entity_model_1.CountryEntityModel.fromApiEntity,
79
+ [entity_utils_interface_1.EntityEnum.ADDRESS_BOOK]: address_book_model_1.AddressBookEntityModel.fromEntity,
78
80
  };
79
81
  function entityMapToModels(entityMap) {
80
82
  for (const entityName in entityMap) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "law-common",
3
- "version": "10.28.1",
3
+ "version": "10.28.2-beta.1",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [