law-common 10.21.1-beta.3 → 10.21.1-beta.4

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.
@@ -83,3 +83,4 @@ export * from "./interface/to-do.entity.api";
83
83
  export * from "./interface/billing-reimbursement-expense.api";
84
84
  export * from "./interface/billing-reimbursement-expense-history.api";
85
85
  export * from "./interface/project-user-mapping.entity.api";
86
+ export * from "./interface/address-book.create.dto.interface";
@@ -99,3 +99,4 @@ __exportStar(require("./interface/to-do.entity.api"), exports);
99
99
  __exportStar(require("./interface/billing-reimbursement-expense.api"), exports);
100
100
  __exportStar(require("./interface/billing-reimbursement-expense-history.api"), exports);
101
101
  __exportStar(require("./interface/project-user-mapping.entity.api"), exports);
102
+ __exportStar(require("./interface/address-book.create.dto.interface"), exports);
@@ -0,0 +1,19 @@
1
+ import { IAddressBookEntity, IEntityCreateDto } from "../../entities";
2
+ export type IAddressBookCreateExclude = "contactDetails" | "address" | "organizationId";
3
+ export interface IAddressBookContactDetail {
4
+ id?: number;
5
+ name: string;
6
+ email?: string;
7
+ phone?: string;
8
+ }
9
+ export interface IAddressBookAddress {
10
+ addressLine1?: string;
11
+ addressLine2?: string;
12
+ city?: string;
13
+ state?: string;
14
+ zipCode?: string;
15
+ }
16
+ export interface IAddressBookCreateDto extends Omit<IEntityCreateDto<IAddressBookEntity>, IAddressBookCreateExclude> {
17
+ contactDetails: IAddressBookContactDetail[];
18
+ address?: IAddressBookAddress;
19
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -65,6 +65,7 @@ export * from "./interface/billing_timesheet.entity.interface";
65
65
  export * from "./interface/intermediary_bank.entity.interface";
66
66
  export * from "./interface/holiday-list.entity.interface";
67
67
  export * from "./interface/holiday.entity.interface";
68
+ export * from "./interface/address-book.entity.interface";
68
69
  export * from "./model/leave.entity.model";
69
70
  export * from "./model/leave_count.entity.model";
70
71
  export * from "./model/holiday.entity.model";
@@ -98,3 +99,4 @@ export * from "./model/timesheet.entity.model";
98
99
  export * from "./model/user.entity.model";
99
100
  export * from "./model/client-affiliate.entity.model";
100
101
  export * from "./model/billing-timesheet.entity.model";
102
+ export * from "./model/country.entity.model";
@@ -82,6 +82,7 @@ __exportStar(require("./interface/billing_timesheet.entity.interface"), exports)
82
82
  __exportStar(require("./interface/intermediary_bank.entity.interface"), exports);
83
83
  __exportStar(require("./interface/holiday-list.entity.interface"), exports);
84
84
  __exportStar(require("./interface/holiday.entity.interface"), exports);
85
+ __exportStar(require("./interface/address-book.entity.interface"), exports);
85
86
  __exportStar(require("./model/leave.entity.model"), exports);
86
87
  __exportStar(require("./model/leave_count.entity.model"), exports);
87
88
  __exportStar(require("./model/holiday.entity.model"), exports);
@@ -115,3 +116,4 @@ __exportStar(require("./model/timesheet.entity.model"), exports);
115
116
  __exportStar(require("./model/user.entity.model"), exports);
116
117
  __exportStar(require("./model/client-affiliate.entity.model"), exports);
117
118
  __exportStar(require("./model/billing-timesheet.entity.model"), exports);
119
+ __exportStar(require("./model/country.entity.model"), exports);
@@ -0,0 +1,10 @@
1
+ import { IAuditColumnEntity } from "./audit-column.entity.interface";
2
+ export interface IAddressBookEntity extends IAuditColumnEntity {
3
+ id: number;
4
+ contactDetails: string;
5
+ address?: string;
6
+ country: string;
7
+ notes?: string;
8
+ organizationId: number;
9
+ introducedBy?: number;
10
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -10,6 +10,7 @@ import { BillingEntityModel } from "../model/billing.entity.model";
10
10
  import { ClientAffiliateEntityModel } from "../model/client-affiliate.entity.model";
11
11
  import { ClientEntityModel } from "../model/client.entity.model";
12
12
  import { ConfigurationEntityModel } from "../model/configuration.model";
13
+ import { CountryEntityModel } from "../model/country.entity.model";
13
14
  import { HolidayEntityModel } from "../model/holiday.entity.model";
14
15
  import { LeaveEntityModel } from "../model/leave.entity.model";
15
16
  import { LeaveCountVirtualEntityModel } from "../model/leave_count.entity.model";
@@ -20,6 +21,7 @@ import { ReimbursementEntityModel } from "../model/reimbursement.entity.model";
20
21
  import { TaskEntityModel } from "../model/task.entity.model";
21
22
  import { TimesheetEntityModel } from "../model/timesheet.entity.model";
22
23
  import { UserEntityModel } from "../model/user.entity.model";
24
+ import { IAddressBookEntity } from "./address-book.entity.interface";
23
25
  import { IAuditColumnEntity } from "./audit-column.entity.interface";
24
26
  import { IBankEntity } from "./bank.entity.interface";
25
27
  import { IBankHistoryEntity } from "./bank_history.entity.interface";
@@ -139,7 +141,8 @@ export declare enum EntityEnum {
139
141
  HOLIDAY = "holiday",
140
142
  HOLIDAY_LIST = "holiday_list",
141
143
  CRON_JOBS = "cron_jobs",
142
- TO_DO_LIST = "to_do_list"
144
+ TO_DO_LIST = "to_do_list",
145
+ ADDRESS_BOOK = "address_book"
143
146
  }
144
147
  export type EntityRelations = {
145
148
  [K in EntityEnum | VirtualEntityEnum]: K;
@@ -161,7 +164,7 @@ export type IBaseEntityApiResponse<T extends {
161
164
  [K in EntityEnum | VirtualEntityEnum]?: IBaseEntityApiResponse<EnumEntityType<K>>;
162
165
  };
163
166
  };
164
- export type EnumEntityType<T extends EntityEnum | VirtualEntityEnum> = (T extends EntityEnum.BILLING ? IBillingEntity : T extends EntityEnum.BILLING_TIMESHEET ? IBillingTimesheetEntity : T extends EntityEnum.BILLING_REIMBURSEMENT_EXPENSE ? IBillingReimbursementExpenseEntity : T extends EntityEnum.TIMESHEET ? ITimesheetEntity : T extends EntityEnum.USER ? IUserEntity : T extends EntityEnum.PROJECT ? IProjectEntity : T extends EntityEnum.CLIENT ? IClientEntity : T extends EntityEnum.LEAVE ? ILeaveEntity : T extends EntityEnum.BANK ? IBankEntity : T extends EntityEnum.BILLING_PAYMENT ? IBillingPaymentEntity : T extends EntityEnum.BILLING_TRANSACTION ? IBillingTransactionEntity : T extends EntityEnum.CLIENT_AFFILIATE ? IClientAffiliateEntity : T extends EntityEnum.CONFIGURATION ? IConfigurationEntity : T extends EntityEnum.HOLIDAY ? IHolidayEntity : T extends EntityEnum.HOLIDAY_LIST ? IHolidayListEntity : T extends EntityEnum.COUNTRY ? ICountryEntity : T extends EntityEnum.EXPENSE_TYPE ? IExpenseTypeEntity : T extends EntityEnum.INDUSTRY ? IIndustryEntity : T extends EntityEnum.INTERMEDIARY_BANK ? IIntermediaryBankEntity : T extends EntityEnum.OFFICE_LOCATION ? IOfficeLocationEntity : T extends EntityEnum.PERMISSION ? IPermissionEntity : T extends EntityEnum.ROLE ? IRoleEntity : T extends EntityEnum.TASK ? ITaskEntity : T extends EntityEnum.DESIGNATION ? IDesignationEntity : T extends EntityEnum.RATE ? IRateEntity : T extends EntityEnum.REIMBURSEMENT ? IReimbursementEntity : T extends EntityEnum.REIMBURSEMENT_EXPENSE ? IReimbursementExpenseEntity : T extends EntityEnum.WORK_FROM_HOME ? IWorkFromHomeEntity : T extends EntityEnum.ORGANIZATION ? IOrganizationEntity : T extends EntityEnum.PROJECT_USER_MAPPING ? IProjectUserMappingEntity : T extends EntityEnum.CLIENT_USER_MAPPING ? IClientUserMappingEntity : T extends EntityEnum.TO_DO_LIST ? IToDoListEntity : T extends EntityEnum.CRON_JOBS ? ICronJobsEntity : T extends EntityEnum.ROLE_PERMISSION_MAPPING ? IRolePermissionMappingEntity : T extends VirtualEntityEnum.USER_LEAVE ? IUserLeaveVirtualEntity : T extends VirtualEntityEnum.LEAVE_COUNT ? ILeaveCountVirtualEntity : T extends EntityEnum.BANK_HISTORY ? IBankHistoryEntity : T extends EntityEnum.LEAVE_HISTORY ? ILeaveHistoryEntity : T extends EntityEnum.WORK_FROM_HOME_HISTORY ? IWorkFromHomeHistoryEntity : T extends EntityEnum.TIMESHEET_HISTORY ? ITimesheetHistoryEntity : never) & {
167
+ export type EnumEntityType<T extends EntityEnum | VirtualEntityEnum> = (T extends EntityEnum.BILLING ? IBillingEntity : T extends EntityEnum.BILLING_TIMESHEET ? IBillingTimesheetEntity : T extends EntityEnum.BILLING_REIMBURSEMENT_EXPENSE ? IBillingReimbursementExpenseEntity : T extends EntityEnum.TIMESHEET ? ITimesheetEntity : T extends EntityEnum.USER ? IUserEntity : T extends EntityEnum.PROJECT ? IProjectEntity : T extends EntityEnum.CLIENT ? IClientEntity : T extends EntityEnum.LEAVE ? ILeaveEntity : T extends EntityEnum.BANK ? IBankEntity : T extends EntityEnum.BILLING_PAYMENT ? IBillingPaymentEntity : T extends EntityEnum.BILLING_TRANSACTION ? IBillingTransactionEntity : T extends EntityEnum.CLIENT_AFFILIATE ? IClientAffiliateEntity : T extends EntityEnum.CONFIGURATION ? IConfigurationEntity : T extends EntityEnum.HOLIDAY ? IHolidayEntity : T extends EntityEnum.HOLIDAY_LIST ? IHolidayListEntity : T extends EntityEnum.COUNTRY ? ICountryEntity : T extends EntityEnum.EXPENSE_TYPE ? IExpenseTypeEntity : T extends EntityEnum.INDUSTRY ? IIndustryEntity : T extends EntityEnum.INTERMEDIARY_BANK ? IIntermediaryBankEntity : T extends EntityEnum.OFFICE_LOCATION ? IOfficeLocationEntity : T extends EntityEnum.PERMISSION ? IPermissionEntity : T extends EntityEnum.ROLE ? IRoleEntity : T extends EntityEnum.TASK ? ITaskEntity : T extends EntityEnum.DESIGNATION ? IDesignationEntity : T extends EntityEnum.RATE ? IRateEntity : T extends EntityEnum.REIMBURSEMENT ? IReimbursementEntity : T extends EntityEnum.REIMBURSEMENT_EXPENSE ? IReimbursementExpenseEntity : T extends EntityEnum.WORK_FROM_HOME ? IWorkFromHomeEntity : T extends EntityEnum.ORGANIZATION ? IOrganizationEntity : T extends EntityEnum.PROJECT_USER_MAPPING ? IProjectUserMappingEntity : T extends EntityEnum.CLIENT_USER_MAPPING ? IClientUserMappingEntity : T extends EntityEnum.TO_DO_LIST ? IToDoListEntity : T extends EntityEnum.CRON_JOBS ? ICronJobsEntity : T extends EntityEnum.ROLE_PERMISSION_MAPPING ? IRolePermissionMappingEntity : T extends VirtualEntityEnum.USER_LEAVE ? IUserLeaveVirtualEntity : T extends VirtualEntityEnum.LEAVE_COUNT ? ILeaveCountVirtualEntity : T extends EntityEnum.BANK_HISTORY ? IBankHistoryEntity : T extends EntityEnum.LEAVE_HISTORY ? ILeaveHistoryEntity : T extends EntityEnum.WORK_FROM_HOME_HISTORY ? IWorkFromHomeHistoryEntity : T extends EntityEnum.TIMESHEET_HISTORY ? ITimesheetHistoryEntity : T extends EntityEnum.ADDRESS_BOOK ? IAddressBookEntity : never) & {
165
168
  id: number;
166
169
  };
167
170
  export type EntityRelationConfig<T extends EntityEnum | VirtualEntityEnum> = {
@@ -284,7 +287,7 @@ export declare enum VirtualEntityEnum {
284
287
  }
285
288
  export type IHistoryConstraintSearchResponse<T> = IBaseResponse<IHistoryEntitySearchByConstraintResponse<T>[]>;
286
289
  export type IHistoryConstraintSearchServiceResponse<T> = IHistoryEntitySearchByConstraintResponse<T>[];
287
- 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 : UserEntityModel;
290
+ 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 : UserEntityModel;
288
291
  export type EntityMap = {
289
292
  [key in EntityEnum | VirtualEntityEnum]: EnumToModel<key>[];
290
293
  };
@@ -76,6 +76,7 @@ var EntityEnum;
76
76
  EntityEnum["HOLIDAY_LIST"] = "holiday_list";
77
77
  EntityEnum["CRON_JOBS"] = "cron_jobs";
78
78
  EntityEnum["TO_DO_LIST"] = "to_do_list";
79
+ EntityEnum["ADDRESS_BOOK"] = "address_book";
79
80
  })(EntityEnum || (exports.EntityEnum = EntityEnum = {}));
80
81
  var VirtualEntityEnum;
81
82
  (function (VirtualEntityEnum) {
@@ -0,0 +1,11 @@
1
+ import { ICountryApiEntity } from "../../api";
2
+ export declare class CountryEntityModel implements ICountryApiEntity {
3
+ id: number;
4
+ name: string;
5
+ createdBy: number;
6
+ updatedBy: number;
7
+ createdOn: string;
8
+ updatedOn: string;
9
+ constructor(data?: ICountryApiEntity);
10
+ static fromApiEntity(apiEntity: ICountryApiEntity): CountryEntityModel;
11
+ }
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CountryEntityModel = void 0;
4
+ class CountryEntityModel {
5
+ constructor(data) {
6
+ this.id = 0;
7
+ this.name = "";
8
+ this.createdBy = 0;
9
+ this.updatedBy = 0;
10
+ this.createdOn = "";
11
+ this.updatedOn = "";
12
+ Object.assign(this, data);
13
+ }
14
+ static fromApiEntity(apiEntity) {
15
+ const entity = new CountryEntityModel(apiEntity);
16
+ Object.assign(entity, apiEntity);
17
+ return entity;
18
+ }
19
+ }
20
+ exports.CountryEntityModel = CountryEntityModel;
@@ -27,6 +27,7 @@ const reimbursement_entity_model_1 = require("./reimbursement.entity.model");
27
27
  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
+ const country_entity_model_1 = require("./country.entity.model");
30
31
  function mapToIndex(entityMap) {
31
32
  return Object.keys(entityMap).reduce((acc, key) => {
32
33
  // @ts-ignore
@@ -73,6 +74,7 @@ exports.entityEnumToEntityModel = {
73
74
  [entity_utils_interface_1.EntityEnum.TASK]: task_entity_model_1.TaskEntityModel.fromApiEntity,
74
75
  [entity_utils_interface_1.EntityEnum.BILLING_TIMESHEET]: billing_timesheet_entity_model_1.BillingTimesheetEntityModel.fromApiEntity,
75
76
  [entity_utils_interface_1.EntityEnum.TIMESHEET]: timesheet_entity_model_1.TimesheetEntityModel.fromApiEntity,
77
+ [entity_utils_interface_1.EntityEnum.COUNTRY]: country_entity_model_1.CountryEntityModel.fromApiEntity,
76
78
  };
77
79
  function entityMapToModels(entityMap) {
78
80
  for (const entityName in entityMap) {
@@ -106,9 +108,6 @@ function entityMapToEntityIndexMap(entityMap, entityRelationsFor) {
106
108
  }
107
109
  function parseEntitiesWithoutModels(json, baseEntity, entityMap = {}) {
108
110
  var _a;
109
- if (!(baseEntity in exports.entityEnumToEntityModel)) {
110
- throw new Error(`Unknown entity: ${baseEntity}`);
111
- }
112
111
  entityMap[baseEntity] = ((_a = json["baseEntities"]) !== null && _a !== void 0 ? _a : []);
113
112
  if (json["relatedEntities"]) {
114
113
  const relatedEntities = json["relatedEntities"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "law-common",
3
- "version": "10.21.1-beta.3",
3
+ "version": "10.21.1-beta.4",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [