law-common 10.42.0 → 10.42.1-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 +2 -0
- package/dist/src/api/index.js +2 -0
- package/dist/src/api/interface/state.create.dto.interface.autocode.d.ts +0 -0
- package/dist/src/api/interface/state.create.dto.interface.autocode.js +4 -0
- package/dist/src/api/interface/state.create.dto.interface.d.ts +4 -0
- package/dist/src/api/interface/state.create.dto.interface.js +2 -0
- package/dist/src/api/interface/state.update.dto.interface.d.ts +3 -0
- package/dist/src/api/interface/state.update.dto.interface.js +2 -0
- package/dist/src/entities/enums/state_status_enum.autocode.d.ts +0 -0
- package/dist/src/entities/enums/state_status_enum.autocode.js +6 -0
- package/dist/src/entities/enums/state_status_enum.d.ts +5 -0
- package/dist/src/entities/enums/state_status_enum.js +9 -0
- package/dist/src/entities/index.d.ts +2 -0
- package/dist/src/entities/index.js +2 -2
- package/dist/src/entities/interface/entity.utils.interface.d.ts +6 -3
- package/dist/src/entities/interface/entity.utils.interface.js +1 -0
- package/dist/src/entities/interface/state.entity.interface.autocode.d.ts +0 -0
- package/dist/src/entities/interface/state.entity.interface.autocode.js +8 -0
- package/dist/src/entities/interface/state.entity.interface.d.ts +8 -0
- package/dist/src/entities/interface/state.entity.interface.js +2 -0
- package/dist/src/entities/model/entity.model.interface.d.ts +6 -4
- package/dist/src/entities/model/entity.model.interface.js +20 -2
- package/dist/src/entities/model/state.entity.model.d.ts +17 -0
- package/dist/src/entities/model/state.entity.model.js +29 -0
- package/package.json +37 -37
package/dist/src/api/index.d.ts
CHANGED
|
@@ -52,3 +52,5 @@ export * from "./interface/address-book.create.dto.interface";
|
|
|
52
52
|
export * from "./enums/crud.enum";
|
|
53
53
|
export * from "./interface/api.utils.interface";
|
|
54
54
|
export * from "./interface/address-book.update.dto.interface";
|
|
55
|
+
export * from "./interface/state.create.dto.interface";
|
|
56
|
+
export * from "./interface/state.update.dto.interface";
|
package/dist/src/api/index.js
CHANGED
|
@@ -72,3 +72,5 @@ __exportStar(require("./interface/address-book.create.dto.interface"), exports);
|
|
|
72
72
|
__exportStar(require("./enums/crud.enum"), exports);
|
|
73
73
|
__exportStar(require("./interface/api.utils.interface"), exports);
|
|
74
74
|
__exportStar(require("./interface/address-book.update.dto.interface"), exports);
|
|
75
|
+
__exportStar(require("./interface/state.create.dto.interface"), exports);
|
|
76
|
+
__exportStar(require("./interface/state.update.dto.interface"), exports);
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StateStatusEnum = void 0;
|
|
4
|
+
var StateStatusEnum;
|
|
5
|
+
(function (StateStatusEnum) {
|
|
6
|
+
StateStatusEnum["ACTIVE"] = "ACTIVE";
|
|
7
|
+
StateStatusEnum["DEACTIVE"] = "DEACTIVE";
|
|
8
|
+
StateStatusEnum["INACTIVE"] = "INACTIVE";
|
|
9
|
+
})(StateStatusEnum || (exports.StateStatusEnum = StateStatusEnum = {}));
|
|
@@ -105,3 +105,5 @@ export * from "./interface/billing-transaction-history.entity";
|
|
|
105
105
|
export * from "./model/billing-transaction.model";
|
|
106
106
|
export * from "./interface/address-book.entity.interface";
|
|
107
107
|
export * from "./enums/address_book_status_enum";
|
|
108
|
+
export * from "./interface/state.entity.interface";
|
|
109
|
+
export * from "./enums/state_status_enum";
|
|
@@ -121,5 +121,5 @@ __exportStar(require("./interface/billing-transaction-history.entity"), exports)
|
|
|
121
121
|
__exportStar(require("./model/billing-transaction.model"), exports);
|
|
122
122
|
__exportStar(require("./interface/address-book.entity.interface"), exports);
|
|
123
123
|
__exportStar(require("./enums/address_book_status_enum"), exports);
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
__exportStar(require("./interface/state.entity.interface"), exports);
|
|
125
|
+
__exportStar(require("./enums/state_status_enum"), exports);
|
|
@@ -20,6 +20,7 @@ import { ProjectUserMappingEntityModel } from "../model/project-user-mapping.ent
|
|
|
20
20
|
import { ProjectEntityModel } from "../model/project.entity.model";
|
|
21
21
|
import { ReimbursementExpenseEntityModel } from "../model/reimbursement-expense.entity.model";
|
|
22
22
|
import { ReimbursementEntityModel } from "../model/reimbursement.entity.model";
|
|
23
|
+
import { StateEntityModel } from "../model/state.entity.model";
|
|
23
24
|
import { TaskEntityModel } from "../model/task.entity.model";
|
|
24
25
|
import { TimesheetEntityModel } from "../model/timesheet.entity.model";
|
|
25
26
|
import { UserEntityModel } from "../model/user.entity.model";
|
|
@@ -55,6 +56,7 @@ import { IReimbursementEntity } from "./reimbursement.entity.interface";
|
|
|
55
56
|
import { IReimbursementExpenseEntity } from "./reimbursement_expense.entity.interface";
|
|
56
57
|
import { IRoleEntity } from "./role.entity.interface";
|
|
57
58
|
import { IRolePermissionMappingEntity } from "./role.permission.mapping.entity.interface";
|
|
59
|
+
import { IStateEntity } from "./state.entity.interface";
|
|
58
60
|
import { ITaskEntity } from "./task.entity.interface";
|
|
59
61
|
import { ITimesheetEntity } from "./timesheet.entity.interface";
|
|
60
62
|
import { ITimesheetHistoryEntity } from "./timesheet_history.entity.interface";
|
|
@@ -143,7 +145,8 @@ export declare enum EntityEnum {
|
|
|
143
145
|
HOLIDAY_LIST = "holiday_list",
|
|
144
146
|
CRON_JOBS = "cron_jobs",
|
|
145
147
|
TO_DO_LIST = "to_do_list",
|
|
146
|
-
ADDRESS_BOOK = "address_book"
|
|
148
|
+
ADDRESS_BOOK = "address_book",
|
|
149
|
+
STATE = "state"
|
|
147
150
|
}
|
|
148
151
|
export type EntityRelations = {
|
|
149
152
|
[K in EntityEnum | VirtualEntityEnum]: K;
|
|
@@ -162,7 +165,7 @@ export type IBaseEntityApiResponse<T> = {
|
|
|
162
165
|
[K in EntityEnum | VirtualEntityEnum]?: IBaseEntityApiResponse<EnumEntityType<K>>;
|
|
163
166
|
};
|
|
164
167
|
};
|
|
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 : T extends EntityEnum.ADDRESS_BOOK ? IAddressBookEntity : never) & {
|
|
168
|
+
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 : T extends EntityEnum.STATE ? IStateEntity : never) & {
|
|
166
169
|
id: number;
|
|
167
170
|
};
|
|
168
171
|
export type EntityRelationConfig<T extends EntityEnum | VirtualEntityEnum> = {
|
|
@@ -285,7 +288,7 @@ export declare enum VirtualEntityEnum {
|
|
|
285
288
|
}
|
|
286
289
|
export type IHistoryConstraintSearchResponse<T> = IBaseResponse<IHistoryEntitySearchByConstraintResponse<T>[]>;
|
|
287
290
|
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 : T extends EntityEnum.ADDRESS_BOOK ? AddressBookEntityModel : UserEntityModel;
|
|
291
|
+
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 : T extends EntityEnum.STATE ? StateEntityModel : UserEntityModel;
|
|
289
292
|
export type EntityMap = {
|
|
290
293
|
[key in EntityEnum | VirtualEntityEnum]: EnumToModel<key>[];
|
|
291
294
|
};
|
|
@@ -78,6 +78,7 @@ var EntityEnum;
|
|
|
78
78
|
EntityEnum["CRON_JOBS"] = "cron_jobs";
|
|
79
79
|
EntityEnum["TO_DO_LIST"] = "to_do_list";
|
|
80
80
|
EntityEnum["ADDRESS_BOOK"] = "address_book";
|
|
81
|
+
EntityEnum["STATE"] = "state";
|
|
81
82
|
})(EntityEnum || (exports.EntityEnum = EntityEnum = {}));
|
|
82
83
|
var VirtualEntityEnum;
|
|
83
84
|
(function (VirtualEntityEnum) {
|
|
File without changes
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { StateStatusEnum } from "../enums/state_status_enum";
|
|
2
|
+
import { IEntityAuditColumn } from "./entity-audit-columns.interface";
|
|
3
|
+
export interface IStateEntity extends IEntityAuditColumn {
|
|
4
|
+
id: number;
|
|
5
|
+
name: string;
|
|
6
|
+
code: string;
|
|
7
|
+
status: StateStatusEnum;
|
|
8
|
+
}
|
|
@@ -22,7 +22,8 @@ export declare class EntityModelRelationHelper {
|
|
|
22
22
|
entityMap: EntityMap;
|
|
23
23
|
entityModelMap: EntityMap;
|
|
24
24
|
entityModelIndexMap: EntityIndexMap;
|
|
25
|
-
constructor(entityMap: EntityMap);
|
|
25
|
+
constructor(entityMap: EntityMap, init?: boolean);
|
|
26
|
+
static getClone(entity: EntityModelRelationHelper): EntityModelRelationHelper;
|
|
26
27
|
private init;
|
|
27
28
|
private toEntityModelMap;
|
|
28
29
|
fromEntityToEntityModel<T extends EntityEnum | VirtualEntityEnum>(entity: EnumEntityType<T>, entityEnum: T): BaseEntityModel<T>;
|
|
@@ -32,11 +33,12 @@ export declare class EntityModelRelationHelper {
|
|
|
32
33
|
populateRelationsByEntityModel(entityModel: BaseEntityModel<EntityEnum | VirtualEntityEnum>): void;
|
|
33
34
|
addEntityModel<T extends EntityEnum | VirtualEntityEnum>(entityModel: BaseEntityModel<T>, config?: {
|
|
34
35
|
populateRelations?: boolean;
|
|
35
|
-
}):
|
|
36
|
+
}): EntityModelRelationHelper;
|
|
36
37
|
addEntity<T extends EntityEnum | VirtualEntityEnum>(entity: EnumEntityType<T>, entityEnum: T, config?: {
|
|
37
38
|
populateRelations?: boolean;
|
|
38
|
-
}):
|
|
39
|
+
}): EntityModelRelationHelper;
|
|
39
40
|
updateEntityModel<T extends EntityEnum | VirtualEntityEnum>(entityModel: BaseEntityModel<T>, config?: {
|
|
40
41
|
populateRelations?: boolean;
|
|
41
|
-
}):
|
|
42
|
+
}): EntityModelRelationHelper;
|
|
43
|
+
deleteById(entityEnum: EntityEnum, id: number): EntityModelRelationHelper;
|
|
42
44
|
}
|
|
@@ -31,6 +31,7 @@ const user_entity_model_1 = require("./user.entity.model");
|
|
|
31
31
|
const country_entity_model_1 = require("./country.entity.model");
|
|
32
32
|
const address_book_model_1 = require("./address_book.model");
|
|
33
33
|
const billing_transaction_model_1 = require("./billing-transaction.model");
|
|
34
|
+
const state_entity_model_1 = require("./state.entity.model");
|
|
34
35
|
function mapToIndex(entityMap) {
|
|
35
36
|
return Object.keys(entityMap).reduce((acc, key) => {
|
|
36
37
|
// @ts-ignore
|
|
@@ -80,6 +81,7 @@ exports.entityEnumToEntityModel = {
|
|
|
80
81
|
[entity_utils_interface_1.EntityEnum.COUNTRY]: country_entity_model_1.CountryEntityModel.fromApiEntity,
|
|
81
82
|
[entity_utils_interface_1.EntityEnum.ADDRESS_BOOK]: address_book_model_1.AddressBookEntityModel.fromEntity,
|
|
82
83
|
[entity_utils_interface_1.EntityEnum.BILLING_TRANSACTION]: billing_transaction_model_1.BillingTransactionEntityModel.fromEntity,
|
|
84
|
+
[entity_utils_interface_1.EntityEnum.STATE]: state_entity_model_1.StateEntityModel.fromEntity,
|
|
83
85
|
};
|
|
84
86
|
function entityMapToModels(entityMap) {
|
|
85
87
|
for (const entityName in entityMap) {
|
|
@@ -134,11 +136,18 @@ function removeEntityById(entityIndexMap, entity, id) {
|
|
|
134
136
|
}
|
|
135
137
|
}
|
|
136
138
|
class EntityModelRelationHelper {
|
|
137
|
-
constructor(entityMap) {
|
|
139
|
+
constructor(entityMap, init = true) {
|
|
138
140
|
this.entityMap = entityMap;
|
|
139
141
|
this.entityModelMap = {};
|
|
140
142
|
this.entityModelIndexMap = {};
|
|
141
|
-
|
|
143
|
+
if (init)
|
|
144
|
+
this.init();
|
|
145
|
+
}
|
|
146
|
+
static getClone(entity) {
|
|
147
|
+
const clone = new EntityModelRelationHelper(entity.entityMap, false);
|
|
148
|
+
clone.entityModelMap = Object.assign({}, entity.entityModelMap);
|
|
149
|
+
clone.entityModelIndexMap = Object.assign({}, entity.entityModelIndexMap);
|
|
150
|
+
return clone;
|
|
142
151
|
}
|
|
143
152
|
init() {
|
|
144
153
|
this.toEntityModelMap();
|
|
@@ -195,12 +204,14 @@ class EntityModelRelationHelper {
|
|
|
195
204
|
if (config.populateRelations) {
|
|
196
205
|
this.populateRelationsByEntityModel(entityModel);
|
|
197
206
|
}
|
|
207
|
+
return EntityModelRelationHelper.getClone(this);
|
|
198
208
|
}
|
|
199
209
|
addEntity(entity, entityEnum, config = { populateRelations: false }) {
|
|
200
210
|
if (!(entityEnum in exports.entityEnumToEntityModel)) {
|
|
201
211
|
throw new Error(`Unknown entity: ${entityEnum}`);
|
|
202
212
|
}
|
|
203
213
|
this.addEntityModel(this.fromEntityToEntityModel(entity, entityEnum), config);
|
|
214
|
+
return EntityModelRelationHelper.getClone(this);
|
|
204
215
|
}
|
|
205
216
|
updateEntityModel(entityModel, config = { populateRelations: false }) {
|
|
206
217
|
const entityEnum = entityModel.entityName;
|
|
@@ -210,6 +221,13 @@ class EntityModelRelationHelper {
|
|
|
210
221
|
if (config.populateRelations) {
|
|
211
222
|
this.populateRelationsByEntityModel(entityModel);
|
|
212
223
|
}
|
|
224
|
+
return EntityModelRelationHelper.getClone(this);
|
|
225
|
+
}
|
|
226
|
+
deleteById(entityEnum, id) {
|
|
227
|
+
if (this.entityModelIndexMap[entityEnum]) {
|
|
228
|
+
delete this.entityModelIndexMap[entityEnum][id];
|
|
229
|
+
}
|
|
230
|
+
return EntityModelRelationHelper.getClone(this);
|
|
213
231
|
}
|
|
214
232
|
}
|
|
215
233
|
exports.EntityModelRelationHelper = EntityModelRelationHelper;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { StateStatusEnum } from "../enums/state_status_enum";
|
|
2
|
+
import { EntityEnum } from "../interface/entity.utils.interface";
|
|
3
|
+
import { IStateEntity } from "../interface/state.entity.interface";
|
|
4
|
+
import { BaseEntityModel } from "./base.entity.model";
|
|
5
|
+
export declare class StateEntityModel extends BaseEntityModel<EntityEnum.STATE> implements IStateEntity {
|
|
6
|
+
id: number;
|
|
7
|
+
name: string;
|
|
8
|
+
code: string;
|
|
9
|
+
status: StateStatusEnum;
|
|
10
|
+
createdOn: number;
|
|
11
|
+
updatedOn: number;
|
|
12
|
+
createdBy: number;
|
|
13
|
+
updatedBy: number;
|
|
14
|
+
static fromEntity(entity: IStateEntity): StateEntityModel;
|
|
15
|
+
static relationConfigs: never[];
|
|
16
|
+
getRelationConfigs(): any[];
|
|
17
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StateEntityModel = void 0;
|
|
4
|
+
const state_status_enum_1 = require("../enums/state_status_enum");
|
|
5
|
+
const entity_utils_interface_1 = require("../interface/entity.utils.interface");
|
|
6
|
+
const base_entity_model_1 = require("./base.entity.model");
|
|
7
|
+
class StateEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.id = 0;
|
|
11
|
+
this.name = "";
|
|
12
|
+
this.code = "";
|
|
13
|
+
this.status = state_status_enum_1.StateStatusEnum.ACTIVE;
|
|
14
|
+
this.createdOn = 0;
|
|
15
|
+
this.updatedOn = 0;
|
|
16
|
+
this.createdBy = 0;
|
|
17
|
+
this.updatedBy = 0;
|
|
18
|
+
}
|
|
19
|
+
static fromEntity(entity) {
|
|
20
|
+
const result = new StateEntityModel(entity_utils_interface_1.EntityEnum.STATE);
|
|
21
|
+
Object.assign(result, entity);
|
|
22
|
+
return result;
|
|
23
|
+
}
|
|
24
|
+
getRelationConfigs() {
|
|
25
|
+
return this.constructor.prototype.constructor.relationConfigs || [];
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.StateEntityModel = StateEntityModel;
|
|
29
|
+
StateEntityModel.relationConfigs = [];
|
package/package.json
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "law-common",
|
|
3
|
-
"version": "10.42.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/lodash": "^4.17.21",
|
|
25
|
-
"@types/node": "^22.6.1",
|
|
26
|
-
"jest": "^29.7.0",
|
|
27
|
-
"ts-jest": "^29.2.5",
|
|
28
|
-
"ts-node": "^10.9.2",
|
|
29
|
-
"typescript": "^5.6.2"
|
|
30
|
-
},
|
|
31
|
-
"dependencies": {
|
|
32
|
-
"@types/express": "^5.0.0",
|
|
33
|
-
"@types/multer": "^1.4.12",
|
|
34
|
-
"date-fns": "^4.1.0",
|
|
35
|
-
"lodash": "4.17.21"
|
|
36
|
-
}
|
|
37
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "law-common",
|
|
3
|
+
"version": "10.42.1-beta.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/lodash": "^4.17.21",
|
|
25
|
+
"@types/node": "^22.6.1",
|
|
26
|
+
"jest": "^29.7.0",
|
|
27
|
+
"ts-jest": "^29.2.5",
|
|
28
|
+
"ts-node": "^10.9.2",
|
|
29
|
+
"typescript": "^5.6.2"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@types/express": "^5.0.0",
|
|
33
|
+
"@types/multer": "^1.4.12",
|
|
34
|
+
"date-fns": "^4.1.0",
|
|
35
|
+
"lodash": "4.17.21"
|
|
36
|
+
}
|
|
37
|
+
}
|