law-common 10.28.1-beta.0 → 10.28.2-beta.0
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.
- package/dist/src/api/index.d.ts +1 -0
- package/dist/src/api/index.js +5 -0
- package/dist/src/api/interface/address-book.create.dto.interface.d.ts +19 -0
- package/dist/src/api/interface/address-book.create.dto.interface.js +2 -0
- package/dist/src/api/interface/timesheet.entity.response.interface.d.ts +0 -1
- package/dist/src/api/interface/timesheet.entity.response.interface.js +0 -4
- package/dist/src/entities/index.d.ts +3 -0
- package/dist/src/entities/index.js +3 -0
- package/dist/src/entities/interface/address-book.entity.interface.d.ts +11 -0
- package/dist/src/entities/interface/address-book.entity.interface.js +2 -0
- package/dist/src/entities/interface/entity.utils.interface.d.ts +7 -3
- package/dist/src/entities/interface/entity.utils.interface.js +1 -0
- package/dist/src/entities/model/address_book.model.d.ts +20 -0
- package/dist/src/entities/model/address_book.model.js +32 -0
- package/dist/src/entities/model/country.entity.model.d.ts +11 -0
- package/dist/src/entities/model/country.entity.model.js +21 -0
- package/dist/src/entities/model/entity.model.interface.d.ts +4 -5
- package/dist/src/entities/model/entity.model.interface.js +39 -39
- package/package.json +1 -1
package/dist/src/api/index.d.ts
CHANGED
|
@@ -48,3 +48,4 @@ export * from "./interface/work.from.home.create.dto.interface";
|
|
|
48
48
|
export * from "./interface/work.from.home.update.interface";
|
|
49
49
|
export * from "./interface/cron-job-manual-trigger.dto.interface";
|
|
50
50
|
export * from "./interface/cron-job.entity.response";
|
|
51
|
+
export * from "./interface/address-book.create.dto.interface";
|
package/dist/src/api/index.js
CHANGED
|
@@ -64,3 +64,8 @@ __exportStar(require("./interface/work.from.home.create.dto.interface"), exports
|
|
|
64
64
|
__exportStar(require("./interface/work.from.home.update.interface"), exports);
|
|
65
65
|
__exportStar(require("./interface/cron-job-manual-trigger.dto.interface"), exports);
|
|
66
66
|
__exportStar(require("./interface/cron-job.entity.response"), exports);
|
|
67
|
+
// export * from "./interface/to-do.entity.api";
|
|
68
|
+
// export * from "./interface/billing-reimbursement-expense.api";
|
|
69
|
+
// export * from "./interface/billing-reimbursement-expense-history.api";
|
|
70
|
+
// export * from "./interface/project-user-mapping.entity.api";
|
|
71
|
+
__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
|
+
}
|
|
@@ -64,6 +64,7 @@ export * from "./interface/billing_timesheet.entity.interface";
|
|
|
64
64
|
export * from "./interface/intermediary_bank.entity.interface";
|
|
65
65
|
export * from "./interface/holiday-list.entity.interface";
|
|
66
66
|
export * from "./interface/holiday.entity.interface";
|
|
67
|
+
export * from "./interface/address-book.entity.interface";
|
|
67
68
|
export * from "./model/leave.entity.model";
|
|
68
69
|
export * from "./model/leave_count.entity.model";
|
|
69
70
|
export * from "./model/holiday.entity.model";
|
|
@@ -97,8 +98,10 @@ export * from "./model/timesheet.entity.model";
|
|
|
97
98
|
export * from "./model/user.entity.model";
|
|
98
99
|
export * from "./model/client-affiliate.entity.model";
|
|
99
100
|
export * from "./model/billing-timesheet.entity.model";
|
|
101
|
+
export * from "./model/country.entity.model";
|
|
100
102
|
export * from "./interface/entity-audit-columns.interface";
|
|
101
103
|
export * from "./enums/billing-transaction-action.enum";
|
|
102
104
|
export * from "./enums/billing-transaction-status.enum";
|
|
103
105
|
export * from "./interface/billing-transaction-history.entity";
|
|
104
106
|
export * from "./model/billing-transaction.model";
|
|
107
|
+
export * from "./interface/address-book.entity.interface";
|
|
@@ -80,6 +80,7 @@ __exportStar(require("./interface/billing_timesheet.entity.interface"), exports)
|
|
|
80
80
|
__exportStar(require("./interface/intermediary_bank.entity.interface"), exports);
|
|
81
81
|
__exportStar(require("./interface/holiday-list.entity.interface"), exports);
|
|
82
82
|
__exportStar(require("./interface/holiday.entity.interface"), exports);
|
|
83
|
+
__exportStar(require("./interface/address-book.entity.interface"), exports);
|
|
83
84
|
__exportStar(require("./model/leave.entity.model"), exports);
|
|
84
85
|
__exportStar(require("./model/leave_count.entity.model"), exports);
|
|
85
86
|
__exportStar(require("./model/holiday.entity.model"), exports);
|
|
@@ -113,8 +114,10 @@ __exportStar(require("./model/timesheet.entity.model"), exports);
|
|
|
113
114
|
__exportStar(require("./model/user.entity.model"), exports);
|
|
114
115
|
__exportStar(require("./model/client-affiliate.entity.model"), exports);
|
|
115
116
|
__exportStar(require("./model/billing-timesheet.entity.model"), exports);
|
|
117
|
+
__exportStar(require("./model/country.entity.model"), exports);
|
|
116
118
|
__exportStar(require("./interface/entity-audit-columns.interface"), exports);
|
|
117
119
|
__exportStar(require("./enums/billing-transaction-action.enum"), exports);
|
|
118
120
|
__exportStar(require("./enums/billing-transaction-status.enum"), exports);
|
|
119
121
|
__exportStar(require("./interface/billing-transaction-history.entity"), exports);
|
|
120
122
|
__exportStar(require("./model/billing-transaction.model"), exports);
|
|
123
|
+
__exportStar(require("./interface/address-book.entity.interface"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IEntityAuditColumn } from "./entity-audit-columns.interface";
|
|
2
|
+
export interface IAddressBookEntity extends IEntityAuditColumn {
|
|
3
|
+
id: number;
|
|
4
|
+
organizationName: string;
|
|
5
|
+
contactDetails: string;
|
|
6
|
+
address?: string;
|
|
7
|
+
country: string;
|
|
8
|
+
notes?: string;
|
|
9
|
+
organizationId: number;
|
|
10
|
+
introducedBy?: number;
|
|
11
|
+
}
|
|
@@ -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";
|
|
@@ -11,6 +12,7 @@ import { BillingEntityModel } from "../model/billing.entity.model";
|
|
|
11
12
|
import { ClientAffiliateEntityModel } from "../model/client-affiliate.entity.model";
|
|
12
13
|
import { ClientEntityModel } from "../model/client.entity.model";
|
|
13
14
|
import { ConfigurationEntityModel } from "../model/configuration.model";
|
|
15
|
+
import { CountryEntityModel } from "../model/country.entity.model";
|
|
14
16
|
import { HolidayEntityModel } from "../model/holiday.entity.model";
|
|
15
17
|
import { LeaveEntityModel } from "../model/leave.entity.model";
|
|
16
18
|
import { LeaveCountVirtualEntityModel } from "../model/leave_count.entity.model";
|
|
@@ -21,6 +23,7 @@ import { ReimbursementEntityModel } from "../model/reimbursement.entity.model";
|
|
|
21
23
|
import { TaskEntityModel } from "../model/task.entity.model";
|
|
22
24
|
import { TimesheetEntityModel } from "../model/timesheet.entity.model";
|
|
23
25
|
import { UserEntityModel } from "../model/user.entity.model";
|
|
26
|
+
import { IAddressBookEntity } from "./address-book.entity.interface";
|
|
24
27
|
import { IAuditColumnEntity } from "./audit-column.entity.interface";
|
|
25
28
|
import { IBankEntity } from "./bank.entity.interface";
|
|
26
29
|
import { IBankHistoryEntity } from "./bank_history.entity.interface";
|
|
@@ -140,7 +143,8 @@ export declare enum EntityEnum {
|
|
|
140
143
|
HOLIDAY = "holiday",
|
|
141
144
|
HOLIDAY_LIST = "holiday_list",
|
|
142
145
|
CRON_JOBS = "cron_jobs",
|
|
143
|
-
TO_DO_LIST = "to_do_list"
|
|
146
|
+
TO_DO_LIST = "to_do_list",
|
|
147
|
+
ADDRESS_BOOK = "address_book"
|
|
144
148
|
}
|
|
145
149
|
export type EntityRelations = {
|
|
146
150
|
[K in EntityEnum | VirtualEntityEnum]: K;
|
|
@@ -159,7 +163,7 @@ export type IBaseEntityApiResponse<T> = {
|
|
|
159
163
|
[K in EntityEnum | VirtualEntityEnum]?: IBaseEntityApiResponse<EnumEntityType<K>>;
|
|
160
164
|
};
|
|
161
165
|
};
|
|
162
|
-
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.BILLING_TRANSACTION_HISTORY ? IBillingTransactionHistoryEntity : 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 EntityEnum.BANK_HISTORY ? IBankHistoryEntity : T extends VirtualEntityEnum.LEAVE_COUNT ? ILeaveCountVirtualEntity : T extends EntityEnum.LEAVE_HISTORY ? ILeaveHistoryEntity : T extends EntityEnum.WORK_FROM_HOME_HISTORY ? IWorkFromHomeHistoryEntity : T extends EntityEnum.TIMESHEET_HISTORY ? ITimesheetHistoryEntity : never) & {
|
|
166
|
+
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.BILLING_TRANSACTION_HISTORY ? IBillingTransactionHistoryEntity : 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 EntityEnum.BANK_HISTORY ? IBankHistoryEntity : T extends VirtualEntityEnum.LEAVE_COUNT ? ILeaveCountVirtualEntity : 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) & {
|
|
163
167
|
id: number;
|
|
164
168
|
};
|
|
165
169
|
export type EntityRelationConfig<T extends EntityEnum | VirtualEntityEnum> = {
|
|
@@ -282,7 +286,7 @@ export declare enum VirtualEntityEnum {
|
|
|
282
286
|
}
|
|
283
287
|
export type IHistoryConstraintSearchResponse<T> = IBaseResponse<IHistoryEntitySearchByConstraintResponse<T>[]>;
|
|
284
288
|
export type IHistoryConstraintSearchServiceResponse<T> = IHistoryEntitySearchByConstraintResponse<T>[];
|
|
285
|
-
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.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;
|
|
286
290
|
export type EntityMap = {
|
|
287
291
|
[key in EntityEnum | VirtualEntityEnum]: EnumToModel<key>[];
|
|
288
292
|
};
|
|
@@ -77,6 +77,7 @@ var EntityEnum;
|
|
|
77
77
|
EntityEnum["HOLIDAY_LIST"] = "holiday_list";
|
|
78
78
|
EntityEnum["CRON_JOBS"] = "cron_jobs";
|
|
79
79
|
EntityEnum["TO_DO_LIST"] = "to_do_list";
|
|
80
|
+
EntityEnum["ADDRESS_BOOK"] = "address_book";
|
|
80
81
|
})(EntityEnum || (exports.EntityEnum = EntityEnum = {}));
|
|
81
82
|
var VirtualEntityEnum;
|
|
82
83
|
(function (VirtualEntityEnum) {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { IAddressBookEntity } from "../interface/address-book.entity.interface";
|
|
2
|
+
import { EntityEnum } from "../interface/entity.utils.interface";
|
|
3
|
+
import { BaseEntityModel } from "./base.entity.model";
|
|
4
|
+
export declare class AddressBookEntityModel extends BaseEntityModel<EntityEnum.ADDRESS_BOOK> implements IAddressBookEntity {
|
|
5
|
+
id: number;
|
|
6
|
+
organizationName: string;
|
|
7
|
+
contactDetails: string;
|
|
8
|
+
address?: string | undefined;
|
|
9
|
+
country: string;
|
|
10
|
+
notes?: string | undefined;
|
|
11
|
+
organizationId: number;
|
|
12
|
+
introducedBy?: number | undefined;
|
|
13
|
+
createdOn: number;
|
|
14
|
+
updatedOn: number;
|
|
15
|
+
createdBy: number;
|
|
16
|
+
updatedBy: number;
|
|
17
|
+
static fromEntity(entity: IAddressBookEntity): AddressBookEntityModel;
|
|
18
|
+
static relationConfigs: never[];
|
|
19
|
+
getRelationConfigs(): any[];
|
|
20
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AddressBookEntityModel = void 0;
|
|
4
|
+
const entity_utils_interface_1 = require("../interface/entity.utils.interface");
|
|
5
|
+
const base_entity_model_1 = require("./base.entity.model");
|
|
6
|
+
class AddressBookEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.id = 0;
|
|
10
|
+
this.organizationName = "";
|
|
11
|
+
this.contactDetails = "";
|
|
12
|
+
this.address = "";
|
|
13
|
+
this.country = "";
|
|
14
|
+
this.notes = "";
|
|
15
|
+
this.organizationId = 0;
|
|
16
|
+
this.introducedBy = 0;
|
|
17
|
+
this.createdOn = 0;
|
|
18
|
+
this.updatedOn = 0;
|
|
19
|
+
this.createdBy = 0;
|
|
20
|
+
this.updatedBy = 0;
|
|
21
|
+
}
|
|
22
|
+
static fromEntity(entity) {
|
|
23
|
+
const result = new AddressBookEntityModel(entity_utils_interface_1.EntityEnum.ADDRESS_BOOK);
|
|
24
|
+
Object.assign(result, entity);
|
|
25
|
+
return result;
|
|
26
|
+
}
|
|
27
|
+
getRelationConfigs() {
|
|
28
|
+
return this.constructor.prototype.constructor.relationConfigs || [];
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.AddressBookEntityModel = AddressBookEntityModel;
|
|
32
|
+
AddressBookEntityModel.relationConfigs = [];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ICountryEntity } from "../interface/country.entity.interface";
|
|
2
|
+
export declare class CountryEntityModel implements ICountryEntity {
|
|
3
|
+
id: number;
|
|
4
|
+
name: string;
|
|
5
|
+
createdBy: number;
|
|
6
|
+
updatedBy: number;
|
|
7
|
+
createdOn: number;
|
|
8
|
+
updatedOn: number;
|
|
9
|
+
constructor(data?: ICountryEntity);
|
|
10
|
+
static fromApiEntity(apiEntity: ICountryEntity): CountryEntityModel;
|
|
11
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// import { ICountryApiEntity } from "../../api";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.CountryEntityModel = void 0;
|
|
5
|
+
class CountryEntityModel {
|
|
6
|
+
constructor(data) {
|
|
7
|
+
this.id = 0;
|
|
8
|
+
this.name = "";
|
|
9
|
+
this.createdBy = 0;
|
|
10
|
+
this.updatedBy = 0;
|
|
11
|
+
this.createdOn = 0;
|
|
12
|
+
this.updatedOn = 0;
|
|
13
|
+
Object.assign(this, data);
|
|
14
|
+
}
|
|
15
|
+
static fromApiEntity(apiEntity) {
|
|
16
|
+
const entity = new CountryEntityModel(apiEntity);
|
|
17
|
+
Object.assign(entity, apiEntity);
|
|
18
|
+
return entity;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.CountryEntityModel = CountryEntityModel;
|
|
@@ -5,13 +5,12 @@ export declare function getEntityIndexMap<T extends EntityEnum>(data: IBaseEntit
|
|
|
5
5
|
enumEntities: EntityEnum[];
|
|
6
6
|
}): EntityIndexMap;
|
|
7
7
|
export declare function populateRelationsFor(entityIndexMap: EntityIndexMap, enumEntities: EntityEnum[]): void;
|
|
8
|
-
export declare function parseEntities<T extends EnumEntityType<EntityEnum>>(json: IBaseEntityApiResponse<T>, baseEntity: EntityEnum, entityMap: EntityMap): EntityMap;
|
|
9
8
|
export declare const entityEnumToEntityModel: {
|
|
10
|
-
[E in EntityEnum | VirtualEntityEnum]?: (json:
|
|
11
|
-
createdOn: number;
|
|
12
|
-
updatedOn: number;
|
|
13
|
-
}) => EnumToModel<E>;
|
|
9
|
+
[E in EntityEnum | VirtualEntityEnum]?: (json: EnumEntityType<E>) => EnumToModel<E>;
|
|
14
10
|
};
|
|
11
|
+
export declare function entityMapToModels(entityMap: EntityMap): void;
|
|
12
|
+
export declare function parseEntities<T extends EnumEntityType<EntityEnum | VirtualEntityEnum>>(json: IBaseEntityApiResponse<T>, baseEntity: EntityEnum | VirtualEntityEnum, entityMap: EntityMap): EntityMap;
|
|
13
|
+
export declare function entityMapToEntityIndexMap(entityMap: EntityMap, entityRelationsFor: EntityEnum[]): EntityIndexMap;
|
|
15
14
|
export declare function parseEntitiesWithoutModels<T extends EnumEntityType<EntityEnum | VirtualEntityEnum>>(json: IBaseEntityApiResponse<T>, baseEntity: EntityEnum | VirtualEntityEnum, entityMap?: {
|
|
16
15
|
[E in EntityEnum | VirtualEntityEnum]?: IApiEntity<EnumEntityType<E>>[];
|
|
17
16
|
}): {
|
|
@@ -4,21 +4,22 @@ exports.entityEnumToEntityModel = void 0;
|
|
|
4
4
|
exports.mapToIndex = mapToIndex;
|
|
5
5
|
exports.getEntityIndexMap = getEntityIndexMap;
|
|
6
6
|
exports.populateRelationsFor = populateRelationsFor;
|
|
7
|
+
exports.entityMapToModels = entityMapToModels;
|
|
7
8
|
exports.parseEntities = parseEntities;
|
|
9
|
+
exports.entityMapToEntityIndexMap = entityMapToEntityIndexMap;
|
|
8
10
|
exports.parseEntitiesWithoutModels = parseEntitiesWithoutModels;
|
|
9
11
|
const entity_utils_interface_1 = require("../interface/entity.utils.interface");
|
|
10
12
|
const bank_entity_model_1 = require("./bank.entity.model");
|
|
11
13
|
const base_entity_model_1 = require("./base.entity.model");
|
|
12
14
|
const billing_reimbursement_expense_entity_model_1 = require("./billing-reimbursement-expense.entity.model");
|
|
13
15
|
const billing_timesheet_entity_model_1 = require("./billing-timesheet.entity.model");
|
|
14
|
-
const billing_transaction_model_1 = require("./billing-transaction.model");
|
|
15
16
|
const billing_entity_model_1 = require("./billing.entity.model");
|
|
16
17
|
const client_affiliate_entity_model_1 = require("./client-affiliate.entity.model");
|
|
17
18
|
const client_entity_model_1 = require("./client.entity.model");
|
|
18
|
-
const configuration_model_1 = require("./configuration.model");
|
|
19
19
|
const holiday_entity_model_1 = require("./holiday.entity.model");
|
|
20
20
|
const leave_entity_model_1 = require("./leave.entity.model");
|
|
21
21
|
const leave_count_entity_model_1 = require("./leave_count.entity.model");
|
|
22
|
+
const configuration_model_1 = require("./configuration.model");
|
|
22
23
|
const project_user_mapping_entity_model_1 = require("./project-user-mapping.entity.model");
|
|
23
24
|
const project_entity_model_1 = require("./project.entity.model");
|
|
24
25
|
const reimbursement_expense_entity_model_1 = require("./reimbursement-expense.entity.model");
|
|
@@ -26,6 +27,8 @@ const reimbursement_entity_model_1 = require("./reimbursement.entity.model");
|
|
|
26
27
|
const task_entity_model_1 = require("./task.entity.model");
|
|
27
28
|
const timesheet_entity_model_1 = require("./timesheet.entity.model");
|
|
28
29
|
const user_entity_model_1 = require("./user.entity.model");
|
|
30
|
+
const country_entity_model_1 = require("./country.entity.model");
|
|
31
|
+
const address_book_model_1 = require("./address_book.model");
|
|
29
32
|
function mapToIndex(entityMap) {
|
|
30
33
|
return Object.keys(entityMap).reduce((acc, key) => {
|
|
31
34
|
// @ts-ignore
|
|
@@ -53,41 +56,6 @@ function populateRelationsFor(entityIndexMap, enumEntities) {
|
|
|
53
56
|
base_entity_model_1.BaseEntityModel.populateRelationsForEntities(entityIndexMap, entity);
|
|
54
57
|
});
|
|
55
58
|
}
|
|
56
|
-
function parseEntities(json, baseEntity, entityMap) {
|
|
57
|
-
var _a;
|
|
58
|
-
const entityFromJsonMappings = {
|
|
59
|
-
[entity_utils_interface_1.EntityEnum.PROJECT]: project_entity_model_1.ProjectEntityModel.fromEntity,
|
|
60
|
-
[entity_utils_interface_1.EntityEnum.CLIENT]: client_entity_model_1.ClientEntityModel.fromEntity,
|
|
61
|
-
[entity_utils_interface_1.EntityEnum.BILLING]: billing_entity_model_1.BillingEntityModel.fromEntity,
|
|
62
|
-
[entity_utils_interface_1.EntityEnum.USER]: user_entity_model_1.UserEntityModel.fromEntity,
|
|
63
|
-
[entity_utils_interface_1.EntityEnum.PROJECT_USER_MAPPING]: project_user_mapping_entity_model_1.ProjectUserMappingEntityModel.fromEntity,
|
|
64
|
-
[entity_utils_interface_1.EntityEnum.REIMBURSEMENT]: reimbursement_entity_model_1.ReimbursementEntityModel.fromEntity,
|
|
65
|
-
[entity_utils_interface_1.EntityEnum.REIMBURSEMENT_EXPENSE]: reimbursement_expense_entity_model_1.ReimbursementExpenseEntityModel.fromEntity,
|
|
66
|
-
[entity_utils_interface_1.EntityEnum.BILLING_REIMBURSEMENT_EXPENSE]: billing_reimbursement_expense_entity_model_1.BillingReimbursementExpneseEntityModel.fromEntity,
|
|
67
|
-
[entity_utils_interface_1.EntityEnum.CLIENT_AFFILIATE]: client_affiliate_entity_model_1.ClientAffiliateEntityModel.fromEntity,
|
|
68
|
-
[entity_utils_interface_1.EntityEnum.BANK]: bank_entity_model_1.BankEntityModel.fromEntity,
|
|
69
|
-
[entity_utils_interface_1.EntityEnum.CONFIGURATION]: configuration_model_1.ConfigurationEntityModel.fromEntity,
|
|
70
|
-
[entity_utils_interface_1.EntityEnum.TASK]: task_entity_model_1.TaskEntityModel.fromEntity,
|
|
71
|
-
[entity_utils_interface_1.EntityEnum.BILLING_TIMESHEET]: billing_timesheet_entity_model_1.BillingTimesheetEntityModel.fromEntity,
|
|
72
|
-
[entity_utils_interface_1.EntityEnum.TIMESHEET]: timesheet_entity_model_1.TimesheetEntityModel.fromEntity,
|
|
73
|
-
[entity_utils_interface_1.EntityEnum.BILLING_TRANSACTION]: billing_transaction_model_1.BillingTransactionEntityModel.fromEntity,
|
|
74
|
-
};
|
|
75
|
-
if (!(baseEntity in entityFromJsonMappings)) {
|
|
76
|
-
throw new Error(`Unknown entity: ${baseEntity}`);
|
|
77
|
-
}
|
|
78
|
-
entityMap[baseEntity] = ((_a = json["baseEntities"]) !== null && _a !== void 0 ? _a : []).map(
|
|
79
|
-
// REVIEW: Needs to be fixed after audit column type conversion
|
|
80
|
-
(e) => entityFromJsonMappings[baseEntity](e));
|
|
81
|
-
if (json["relatedEntities"]) {
|
|
82
|
-
const relatedEntities = json["relatedEntities"];
|
|
83
|
-
for (const entityName in relatedEntities) {
|
|
84
|
-
parseEntities(
|
|
85
|
-
// @ts-ignore
|
|
86
|
-
relatedEntities[entityName], entityName, entityMap);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
return entityMap;
|
|
90
|
-
}
|
|
91
59
|
exports.entityEnumToEntityModel = {
|
|
92
60
|
[entity_utils_interface_1.EntityEnum.PROJECT]: project_entity_model_1.ProjectEntityModel.fromEntity,
|
|
93
61
|
[entity_utils_interface_1.EntityEnum.CLIENT]: client_entity_model_1.ClientEntityModel.fromEntity,
|
|
@@ -107,13 +75,45 @@ exports.entityEnumToEntityModel = {
|
|
|
107
75
|
[entity_utils_interface_1.EntityEnum.TASK]: task_entity_model_1.TaskEntityModel.fromEntity,
|
|
108
76
|
[entity_utils_interface_1.EntityEnum.BILLING_TIMESHEET]: billing_timesheet_entity_model_1.BillingTimesheetEntityModel.fromEntity,
|
|
109
77
|
[entity_utils_interface_1.EntityEnum.TIMESHEET]: timesheet_entity_model_1.TimesheetEntityModel.fromEntity,
|
|
110
|
-
[entity_utils_interface_1.EntityEnum.
|
|
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,
|
|
111
80
|
};
|
|
112
|
-
function
|
|
81
|
+
function entityMapToModels(entityMap) {
|
|
82
|
+
for (const entityName in entityMap) {
|
|
83
|
+
if (!(entityName in exports.entityEnumToEntityModel)) {
|
|
84
|
+
throw new Error(`Unknown entity: ${entityName}`);
|
|
85
|
+
}
|
|
86
|
+
entityMap[entityName] = entityMap[entityName].map((entity) =>
|
|
87
|
+
// @ts-ignore
|
|
88
|
+
exports.entityEnumToEntityModel[entityName](entity));
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function parseEntities(json, baseEntity, entityMap) {
|
|
113
92
|
var _a;
|
|
114
93
|
if (!(baseEntity in exports.entityEnumToEntityModel)) {
|
|
115
94
|
throw new Error(`Unknown entity: ${baseEntity}`);
|
|
116
95
|
}
|
|
96
|
+
entityMap[baseEntity] = ((_a = json["baseEntities"]) !== null && _a !== void 0 ? _a : []).map(
|
|
97
|
+
// @ts-ignore
|
|
98
|
+
(e) => exports.entityEnumToEntityModel[baseEntity](e));
|
|
99
|
+
if (json["relatedEntities"]) {
|
|
100
|
+
const relatedEntities = json["relatedEntities"];
|
|
101
|
+
for (const entityName in relatedEntities) {
|
|
102
|
+
parseEntities(
|
|
103
|
+
// @ts-ignore
|
|
104
|
+
relatedEntities[entityName], entityName, entityMap);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return entityMap;
|
|
108
|
+
}
|
|
109
|
+
function entityMapToEntityIndexMap(entityMap, entityRelationsFor) {
|
|
110
|
+
entityMapToModels(entityMap);
|
|
111
|
+
const entityIndexMap = mapToIndex(entityMap);
|
|
112
|
+
populateRelationsFor(entityIndexMap, entityRelationsFor);
|
|
113
|
+
return entityIndexMap;
|
|
114
|
+
}
|
|
115
|
+
function parseEntitiesWithoutModels(json, baseEntity, entityMap = {}) {
|
|
116
|
+
var _a;
|
|
117
117
|
entityMap[baseEntity] = ((_a = json["baseEntities"]) !== null && _a !== void 0 ? _a : []);
|
|
118
118
|
if (json["relatedEntities"]) {
|
|
119
119
|
const relatedEntities = json["relatedEntities"];
|