law-common 10.28.1 → 10.29.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 +0 -1
- package/dist/src/api/index.js +0 -5
- package/dist/src/api/interface/timesheet.entity.response.interface.d.ts +1 -5
- package/dist/src/entities/index.d.ts +0 -4
- package/dist/src/entities/index.js +0 -4
- package/dist/src/entities/interface/entity.utils.interface.d.ts +5 -9
- package/dist/src/entities/interface/entity.utils.interface.js +0 -1
- package/dist/src/entities/interface/rate.entity.interface.d.ts +1 -2
- package/dist/src/entities/model/entity.model.interface.d.ts +5 -4
- package/dist/src/entities/model/entity.model.interface.js +39 -37
- package/package.json +35 -35
- package/dist/src/api/interface/address-book.create.dto.interface.d.ts +0 -19
- package/dist/src/api/interface/address-book.create.dto.interface.js +0 -2
- package/dist/src/entities/interface/address-book.entity.interface.d.ts +0 -10
- package/dist/src/entities/interface/address-book.entity.interface.js +0 -2
- package/dist/src/entities/interface/audit-column.entity.interface.d.ts +0 -6
- package/dist/src/entities/interface/audit-column.entity.interface.js +0 -2
- package/dist/src/entities/model/country.entity.model.d.ts +0 -11
- package/dist/src/entities/model/country.entity.model.js +0 -21
package/dist/src/api/index.d.ts
CHANGED
|
@@ -48,4 +48,3 @@ 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,8 +64,3 @@ __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);
|
|
@@ -21,6 +21,7 @@ export type ITimesheetFlowConfig = {
|
|
|
21
21
|
permissions: string[];
|
|
22
22
|
isApplicable?: (data: ITimesheetFlowContextData) => boolean;
|
|
23
23
|
next: (data: ITimesheetFlowContextData) => TimesheetStatusEnum;
|
|
24
|
+
validActionPastThreshold?: boolean;
|
|
24
25
|
};
|
|
25
26
|
};
|
|
26
27
|
};
|
|
@@ -32,8 +33,3 @@ export type ITimesheetFlowContextData = {
|
|
|
32
33
|
dto: ITimesheetEntityUpdateDto;
|
|
33
34
|
timesheetEnterThresholdValue: number;
|
|
34
35
|
};
|
|
35
|
-
export type ITimesheetFlowAfterTimesheetEnterThreshold = {
|
|
36
|
-
[key in TimesheetStatusEnum]?: {
|
|
37
|
-
validActions: TimesheetActionEnum[];
|
|
38
|
-
};
|
|
39
|
-
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export * from "./enums/task.entity.enum";
|
|
2
2
|
export * from "./enums/user.entity.enum";
|
|
3
3
|
export * from "./enums/organization.entity.enum";
|
|
4
|
-
export * from "./interface/audit-column.entity.interface";
|
|
5
4
|
export * from "./interface/entity.utils.interface";
|
|
6
5
|
export * from "./interface/organization.entity.interface";
|
|
7
6
|
export * from "./interface/task.entity.interface";
|
|
@@ -64,7 +63,6 @@ export * from "./interface/billing_timesheet.entity.interface";
|
|
|
64
63
|
export * from "./interface/intermediary_bank.entity.interface";
|
|
65
64
|
export * from "./interface/holiday-list.entity.interface";
|
|
66
65
|
export * from "./interface/holiday.entity.interface";
|
|
67
|
-
export * from "./interface/address-book.entity.interface";
|
|
68
66
|
export * from "./model/leave.entity.model";
|
|
69
67
|
export * from "./model/leave_count.entity.model";
|
|
70
68
|
export * from "./model/holiday.entity.model";
|
|
@@ -98,10 +96,8 @@ export * from "./model/timesheet.entity.model";
|
|
|
98
96
|
export * from "./model/user.entity.model";
|
|
99
97
|
export * from "./model/client-affiliate.entity.model";
|
|
100
98
|
export * from "./model/billing-timesheet.entity.model";
|
|
101
|
-
export * from "./model/country.entity.model";
|
|
102
99
|
export * from "./interface/entity-audit-columns.interface";
|
|
103
100
|
export * from "./enums/billing-transaction-action.enum";
|
|
104
101
|
export * from "./enums/billing-transaction-status.enum";
|
|
105
102
|
export * from "./interface/billing-transaction-history.entity";
|
|
106
103
|
export * from "./model/billing-transaction.model";
|
|
107
|
-
export * from "./interface/address-book.entity.interface";
|
|
@@ -17,7 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./enums/task.entity.enum"), exports);
|
|
18
18
|
__exportStar(require("./enums/user.entity.enum"), exports);
|
|
19
19
|
__exportStar(require("./enums/organization.entity.enum"), exports);
|
|
20
|
-
__exportStar(require("./interface/audit-column.entity.interface"), exports);
|
|
21
20
|
__exportStar(require("./interface/entity.utils.interface"), exports);
|
|
22
21
|
__exportStar(require("./interface/organization.entity.interface"), exports);
|
|
23
22
|
__exportStar(require("./interface/task.entity.interface"), exports);
|
|
@@ -80,7 +79,6 @@ __exportStar(require("./interface/billing_timesheet.entity.interface"), exports)
|
|
|
80
79
|
__exportStar(require("./interface/intermediary_bank.entity.interface"), exports);
|
|
81
80
|
__exportStar(require("./interface/holiday-list.entity.interface"), exports);
|
|
82
81
|
__exportStar(require("./interface/holiday.entity.interface"), exports);
|
|
83
|
-
__exportStar(require("./interface/address-book.entity.interface"), exports);
|
|
84
82
|
__exportStar(require("./model/leave.entity.model"), exports);
|
|
85
83
|
__exportStar(require("./model/leave_count.entity.model"), exports);
|
|
86
84
|
__exportStar(require("./model/holiday.entity.model"), exports);
|
|
@@ -114,10 +112,8 @@ __exportStar(require("./model/timesheet.entity.model"), exports);
|
|
|
114
112
|
__exportStar(require("./model/user.entity.model"), exports);
|
|
115
113
|
__exportStar(require("./model/client-affiliate.entity.model"), exports);
|
|
116
114
|
__exportStar(require("./model/billing-timesheet.entity.model"), exports);
|
|
117
|
-
__exportStar(require("./model/country.entity.model"), exports);
|
|
118
115
|
__exportStar(require("./interface/entity-audit-columns.interface"), exports);
|
|
119
116
|
__exportStar(require("./enums/billing-transaction-action.enum"), exports);
|
|
120
117
|
__exportStar(require("./enums/billing-transaction-status.enum"), exports);
|
|
121
118
|
__exportStar(require("./interface/billing-transaction-history.entity"), exports);
|
|
122
119
|
__exportStar(require("./model/billing-transaction.model"), exports);
|
|
123
|
-
__exportStar(require("./interface/address-book.entity.interface"), exports);
|
|
@@ -11,7 +11,6 @@ import { BillingEntityModel } from "../model/billing.entity.model";
|
|
|
11
11
|
import { ClientAffiliateEntityModel } from "../model/client-affiliate.entity.model";
|
|
12
12
|
import { ClientEntityModel } from "../model/client.entity.model";
|
|
13
13
|
import { ConfigurationEntityModel } from "../model/configuration.model";
|
|
14
|
-
import { CountryEntityModel } from "../model/country.entity.model";
|
|
15
14
|
import { HolidayEntityModel } from "../model/holiday.entity.model";
|
|
16
15
|
import { LeaveEntityModel } from "../model/leave.entity.model";
|
|
17
16
|
import { LeaveCountVirtualEntityModel } from "../model/leave_count.entity.model";
|
|
@@ -22,8 +21,6 @@ import { ReimbursementEntityModel } from "../model/reimbursement.entity.model";
|
|
|
22
21
|
import { TaskEntityModel } from "../model/task.entity.model";
|
|
23
22
|
import { TimesheetEntityModel } from "../model/timesheet.entity.model";
|
|
24
23
|
import { UserEntityModel } from "../model/user.entity.model";
|
|
25
|
-
import { IAddressBookEntity } from "./address-book.entity.interface";
|
|
26
|
-
import { IAuditColumnEntity } from "./audit-column.entity.interface";
|
|
27
24
|
import { IBankEntity } from "./bank.entity.interface";
|
|
28
25
|
import { IBankHistoryEntity } from "./bank_history.entity.interface";
|
|
29
26
|
import { IBillingReimbursementExpenseEntity } from "./billing-reimbursement-expense.entity.interface";
|
|
@@ -66,8 +63,8 @@ export type IApiEntity<T> = Modify<T, {
|
|
|
66
63
|
createdOn: string;
|
|
67
64
|
updatedOn: string;
|
|
68
65
|
}>;
|
|
69
|
-
export type IEntityCreateDto<T> = Omit<T, "id" | keyof
|
|
70
|
-
export type IEntityUpdateDto<T> = Omit<Partial<T>, "id" | keyof
|
|
66
|
+
export type IEntityCreateDto<T> = Omit<T, "id" | keyof IEntityAuditColumn>;
|
|
67
|
+
export type IEntityUpdateDto<T> = Omit<Partial<T>, "id" | keyof IEntityAuditColumn>;
|
|
71
68
|
/**
|
|
72
69
|
* EntityEnum
|
|
73
70
|
*
|
|
@@ -142,8 +139,7 @@ export declare enum EntityEnum {
|
|
|
142
139
|
HOLIDAY = "holiday",
|
|
143
140
|
HOLIDAY_LIST = "holiday_list",
|
|
144
141
|
CRON_JOBS = "cron_jobs",
|
|
145
|
-
TO_DO_LIST = "to_do_list"
|
|
146
|
-
ADDRESS_BOOK = "address_book"
|
|
142
|
+
TO_DO_LIST = "to_do_list"
|
|
147
143
|
}
|
|
148
144
|
export type EntityRelations = {
|
|
149
145
|
[K in EntityEnum | VirtualEntityEnum]: K;
|
|
@@ -162,7 +158,7 @@ export type IBaseEntityApiResponse<T> = {
|
|
|
162
158
|
[K in EntityEnum | VirtualEntityEnum]?: IBaseEntityApiResponse<EnumEntityType<K>>;
|
|
163
159
|
};
|
|
164
160
|
};
|
|
165
|
-
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 :
|
|
161
|
+
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
162
|
id: number;
|
|
167
163
|
};
|
|
168
164
|
export type EntityRelationConfig<T extends EntityEnum | VirtualEntityEnum> = {
|
|
@@ -285,7 +281,7 @@ export declare enum VirtualEntityEnum {
|
|
|
285
281
|
}
|
|
286
282
|
export type IHistoryConstraintSearchResponse<T> = IBaseResponse<IHistoryEntitySearchByConstraintResponse<T>[]>;
|
|
287
283
|
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.
|
|
284
|
+
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
285
|
export type EntityMap = {
|
|
290
286
|
[key in EntityEnum | VirtualEntityEnum]: EnumToModel<key>[];
|
|
291
287
|
};
|
|
@@ -77,7 +77,6 @@ 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";
|
|
81
80
|
})(EntityEnum || (exports.EntityEnum = EntityEnum = {}));
|
|
82
81
|
var VirtualEntityEnum;
|
|
83
82
|
(function (VirtualEntityEnum) {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { CurrencyEnum, TimeUnitEnum } from "../../enums";
|
|
2
2
|
import { PartialBy } from "../../misc";
|
|
3
|
-
import { IAuditColumnEntity } from "./audit-column.entity.interface";
|
|
4
3
|
import { IEntityAuditColumn } from "./entity-audit-columns.interface";
|
|
5
4
|
import { IEntityCreateDto, IEntityFilterData, IEntityUpdateDto } from "./entity.utils.interface";
|
|
6
5
|
export interface IRateEntity extends IEntityAuditColumn {
|
|
@@ -14,6 +13,6 @@ export interface IRateEntityCreateDto extends IEntityCreateDto<IRateEntity> {
|
|
|
14
13
|
}
|
|
15
14
|
export interface IRateEntityUpdateDto extends IEntityUpdateDto<IRateEntity> {
|
|
16
15
|
}
|
|
17
|
-
export interface IRateEntityUpdateByDesignationCurrencyDto extends PartialBy<Omit<IRateEntity, "id" | keyof
|
|
16
|
+
export interface IRateEntityUpdateByDesignationCurrencyDto extends PartialBy<Omit<IRateEntity, "id" | keyof IEntityAuditColumn>, "unit"> {
|
|
18
17
|
}
|
|
19
18
|
export type IRateEntityFilterData = IEntityFilterData<IRateEntity>;
|
|
@@ -5,12 +5,13 @@ 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;
|
|
8
9
|
export declare const entityEnumToEntityModel: {
|
|
9
|
-
[E in EntityEnum | VirtualEntityEnum]?: (json: EnumEntityType<E
|
|
10
|
+
[E in EntityEnum | VirtualEntityEnum]?: (json: IApiEntity<EnumEntityType<E>> & {
|
|
11
|
+
createdOn: number;
|
|
12
|
+
updatedOn: number;
|
|
13
|
+
}) => EnumToModel<E>;
|
|
10
14
|
};
|
|
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;
|
|
14
15
|
export declare function parseEntitiesWithoutModels<T extends EnumEntityType<EntityEnum | VirtualEntityEnum>>(json: IBaseEntityApiResponse<T>, baseEntity: EntityEnum | VirtualEntityEnum, entityMap?: {
|
|
15
16
|
[E in EntityEnum | VirtualEntityEnum]?: IApiEntity<EnumEntityType<E>>[];
|
|
16
17
|
}): {
|
|
@@ -4,22 +4,21 @@ exports.entityEnumToEntityModel = void 0;
|
|
|
4
4
|
exports.mapToIndex = mapToIndex;
|
|
5
5
|
exports.getEntityIndexMap = getEntityIndexMap;
|
|
6
6
|
exports.populateRelationsFor = populateRelationsFor;
|
|
7
|
-
exports.entityMapToModels = entityMapToModels;
|
|
8
7
|
exports.parseEntities = parseEntities;
|
|
9
|
-
exports.entityMapToEntityIndexMap = entityMapToEntityIndexMap;
|
|
10
8
|
exports.parseEntitiesWithoutModels = parseEntitiesWithoutModels;
|
|
11
9
|
const entity_utils_interface_1 = require("../interface/entity.utils.interface");
|
|
12
10
|
const bank_entity_model_1 = require("./bank.entity.model");
|
|
13
11
|
const base_entity_model_1 = require("./base.entity.model");
|
|
14
12
|
const billing_reimbursement_expense_entity_model_1 = require("./billing-reimbursement-expense.entity.model");
|
|
15
13
|
const billing_timesheet_entity_model_1 = require("./billing-timesheet.entity.model");
|
|
14
|
+
const billing_transaction_model_1 = require("./billing-transaction.model");
|
|
16
15
|
const billing_entity_model_1 = require("./billing.entity.model");
|
|
17
16
|
const client_affiliate_entity_model_1 = require("./client-affiliate.entity.model");
|
|
18
17
|
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");
|
|
23
22
|
const project_user_mapping_entity_model_1 = require("./project-user-mapping.entity.model");
|
|
24
23
|
const project_entity_model_1 = require("./project.entity.model");
|
|
25
24
|
const reimbursement_expense_entity_model_1 = require("./reimbursement-expense.entity.model");
|
|
@@ -27,7 +26,6 @@ const reimbursement_entity_model_1 = require("./reimbursement.entity.model");
|
|
|
27
26
|
const task_entity_model_1 = require("./task.entity.model");
|
|
28
27
|
const timesheet_entity_model_1 = require("./timesheet.entity.model");
|
|
29
28
|
const user_entity_model_1 = require("./user.entity.model");
|
|
30
|
-
const country_entity_model_1 = require("./country.entity.model");
|
|
31
29
|
function mapToIndex(entityMap) {
|
|
32
30
|
return Object.keys(entityMap).reduce((acc, key) => {
|
|
33
31
|
// @ts-ignore
|
|
@@ -55,6 +53,41 @@ function populateRelationsFor(entityIndexMap, enumEntities) {
|
|
|
55
53
|
base_entity_model_1.BaseEntityModel.populateRelationsForEntities(entityIndexMap, entity);
|
|
56
54
|
});
|
|
57
55
|
}
|
|
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
|
+
}
|
|
58
91
|
exports.entityEnumToEntityModel = {
|
|
59
92
|
[entity_utils_interface_1.EntityEnum.PROJECT]: project_entity_model_1.ProjectEntityModel.fromEntity,
|
|
60
93
|
[entity_utils_interface_1.EntityEnum.CLIENT]: client_entity_model_1.ClientEntityModel.fromEntity,
|
|
@@ -74,44 +107,13 @@ exports.entityEnumToEntityModel = {
|
|
|
74
107
|
[entity_utils_interface_1.EntityEnum.TASK]: task_entity_model_1.TaskEntityModel.fromEntity,
|
|
75
108
|
[entity_utils_interface_1.EntityEnum.BILLING_TIMESHEET]: billing_timesheet_entity_model_1.BillingTimesheetEntityModel.fromEntity,
|
|
76
109
|
[entity_utils_interface_1.EntityEnum.TIMESHEET]: timesheet_entity_model_1.TimesheetEntityModel.fromEntity,
|
|
77
|
-
[entity_utils_interface_1.EntityEnum.
|
|
110
|
+
[entity_utils_interface_1.EntityEnum.BILLING_TRANSACTION]: billing_transaction_model_1.BillingTransactionEntityModel.fromEntity,
|
|
78
111
|
};
|
|
79
|
-
function
|
|
80
|
-
for (const entityName in entityMap) {
|
|
81
|
-
if (!(entityName in exports.entityEnumToEntityModel)) {
|
|
82
|
-
throw new Error(`Unknown entity: ${entityName}`);
|
|
83
|
-
}
|
|
84
|
-
entityMap[entityName] = entityMap[entityName].map((entity) =>
|
|
85
|
-
// @ts-ignore
|
|
86
|
-
exports.entityEnumToEntityModel[entityName](entity));
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
function parseEntities(json, baseEntity, entityMap) {
|
|
112
|
+
function parseEntitiesWithoutModels(json, baseEntity, entityMap = {}) {
|
|
90
113
|
var _a;
|
|
91
114
|
if (!(baseEntity in exports.entityEnumToEntityModel)) {
|
|
92
115
|
throw new Error(`Unknown entity: ${baseEntity}`);
|
|
93
116
|
}
|
|
94
|
-
entityMap[baseEntity] = ((_a = json["baseEntities"]) !== null && _a !== void 0 ? _a : []).map(
|
|
95
|
-
// @ts-ignore
|
|
96
|
-
(e) => exports.entityEnumToEntityModel[baseEntity](e));
|
|
97
|
-
if (json["relatedEntities"]) {
|
|
98
|
-
const relatedEntities = json["relatedEntities"];
|
|
99
|
-
for (const entityName in relatedEntities) {
|
|
100
|
-
parseEntities(
|
|
101
|
-
// @ts-ignore
|
|
102
|
-
relatedEntities[entityName], entityName, entityMap);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
return entityMap;
|
|
106
|
-
}
|
|
107
|
-
function entityMapToEntityIndexMap(entityMap, entityRelationsFor) {
|
|
108
|
-
entityMapToModels(entityMap);
|
|
109
|
-
const entityIndexMap = mapToIndex(entityMap);
|
|
110
|
-
populateRelationsFor(entityIndexMap, entityRelationsFor);
|
|
111
|
-
return entityIndexMap;
|
|
112
|
-
}
|
|
113
|
-
function parseEntitiesWithoutModels(json, baseEntity, entityMap = {}) {
|
|
114
|
-
var _a;
|
|
115
117
|
entityMap[baseEntity] = ((_a = json["baseEntities"]) !== null && _a !== void 0 ? _a : []);
|
|
116
118
|
if (json["relatedEntities"]) {
|
|
117
119
|
const relatedEntities = json["relatedEntities"];
|
package/package.json
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "law-common",
|
|
3
|
-
"version": "10.
|
|
4
|
-
"description": "",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"files": [
|
|
7
|
-
"dist/**/*"
|
|
8
|
-
],
|
|
9
|
-
"scripts": {
|
|
10
|
-
"clean": "rm -rf dist",
|
|
11
|
-
"build": "npm run clean && tsc",
|
|
12
|
-
"publish:beta": "npm version prerelease --preid beta && git push && npm run build && npm publish --tag beta",
|
|
13
|
-
"publish:patch": "npm version patch && git push && npm run build && npm publish",
|
|
14
|
-
"publish:minor": "npm version minor && git push && npm run build && npm publish",
|
|
15
|
-
"publish:major": "npm version major && git push && npm run build && npm publish",
|
|
16
|
-
"link": "npm run build && npm link",
|
|
17
|
-
"test": "jest"
|
|
18
|
-
},
|
|
19
|
-
"keywords": [],
|
|
20
|
-
"author": "",
|
|
21
|
-
"license": "ISC",
|
|
22
|
-
"devDependencies": {
|
|
23
|
-
"@types/jest": "^29.5.13",
|
|
24
|
-
"@types/node": "^22.6.1",
|
|
25
|
-
"jest": "^29.7.0",
|
|
26
|
-
"ts-jest": "^29.2.5",
|
|
27
|
-
"ts-node": "^10.9.2",
|
|
28
|
-
"typescript": "^5.6.2"
|
|
29
|
-
},
|
|
30
|
-
"dependencies": {
|
|
31
|
-
"@types/express": "^5.0.0",
|
|
32
|
-
"@types/multer": "^1.4.12",
|
|
33
|
-
"date-fns": "^4.1.0"
|
|
34
|
-
}
|
|
35
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "law-common",
|
|
3
|
+
"version": "10.29.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist/**/*"
|
|
8
|
+
],
|
|
9
|
+
"scripts": {
|
|
10
|
+
"clean": "rm -rf dist",
|
|
11
|
+
"build": "npm run clean && tsc",
|
|
12
|
+
"publish:beta": "npm version prerelease --preid beta && git push && npm run build && npm publish --tag beta",
|
|
13
|
+
"publish:patch": "npm version patch && git push && npm run build && npm publish",
|
|
14
|
+
"publish:minor": "npm version minor && git push && npm run build && npm publish",
|
|
15
|
+
"publish:major": "npm version major && git push && npm run build && npm publish",
|
|
16
|
+
"link": "npm run build && npm link",
|
|
17
|
+
"test": "jest"
|
|
18
|
+
},
|
|
19
|
+
"keywords": [],
|
|
20
|
+
"author": "",
|
|
21
|
+
"license": "ISC",
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@types/jest": "^29.5.13",
|
|
24
|
+
"@types/node": "^22.6.1",
|
|
25
|
+
"jest": "^29.7.0",
|
|
26
|
+
"ts-jest": "^29.2.5",
|
|
27
|
+
"ts-node": "^10.9.2",
|
|
28
|
+
"typescript": "^5.6.2"
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@types/express": "^5.0.0",
|
|
32
|
+
"@types/multer": "^1.4.12",
|
|
33
|
+
"date-fns": "^4.1.0"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -1,19 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { IEntityAuditColumn } from "./entity-audit-columns.interface";
|
|
2
|
-
export interface IAddressBookEntity extends IEntityAuditColumn {
|
|
3
|
-
id: number;
|
|
4
|
-
contactDetails: string;
|
|
5
|
-
address?: string;
|
|
6
|
-
country: string;
|
|
7
|
-
notes?: string;
|
|
8
|
-
organizationId: number;
|
|
9
|
-
introducedBy?: number;
|
|
10
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
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;
|