law-common 10.42.0 → 10.42.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/api/index.d.ts +2 -0
- package/dist/src/api/index.js +2 -0
- package/dist/src/api/interface/gst_rate.create.dto.interface.autocode.d.ts +0 -0
- package/dist/src/api/interface/gst_rate.create.dto.interface.autocode.js +4 -0
- package/dist/src/api/interface/gst_rate.create.dto.interface.d.ts +5 -0
- package/dist/src/api/interface/gst_rate.create.dto.interface.js +2 -0
- package/dist/src/api/interface/gst_rate.update.dto.interface.d.ts +3 -0
- package/dist/src/api/interface/gst_rate.update.dto.interface.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/gst_rate_status_enum.autocode.d.ts +0 -0
- package/dist/src/entities/enums/gst_rate_status_enum.autocode.js +6 -0
- package/dist/src/entities/enums/gst_rate_status_enum.d.ts +5 -0
- package/dist/src/entities/enums/gst_rate_status_enum.js +9 -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 +9 -3
- package/dist/src/entities/interface/entity.utils.interface.js +2 -0
- package/dist/src/entities/interface/gst_rate.entity.interface.autocode.d.ts +0 -0
- package/dist/src/entities/interface/gst_rate.entity.interface.autocode.js +8 -0
- package/dist/src/entities/interface/gst_rate.entity.interface.d.ts +8 -0
- package/dist/src/entities/interface/gst_rate.entity.interface.js +2 -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 +22 -2
- package/dist/src/entities/model/gst_rate.entity.model.d.ts +17 -0
- package/dist/src/entities/model/gst_rate.entity.model.js +29 -0
- 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
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IEntityCreateDto } from "../../entities";
|
|
2
|
+
import { IGstRateEntity } from "../../entities/interface/gst_rate.entity.interface";
|
|
3
|
+
export type IGstRateCreateExclude = "status";
|
|
4
|
+
export interface IGstRateCreateDto extends Omit<IEntityCreateDto<IGstRateEntity>, IGstRateCreateExclude> {
|
|
5
|
+
}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GSTRateStatusEnum = void 0;
|
|
4
|
+
var GSTRateStatusEnum;
|
|
5
|
+
(function (GSTRateStatusEnum) {
|
|
6
|
+
GSTRateStatusEnum["ACTIVE"] = "ACTIVE";
|
|
7
|
+
GSTRateStatusEnum["DEACTIVE"] = "DEACTIVE";
|
|
8
|
+
GSTRateStatusEnum["INACTIVE"] = "INACTIVE";
|
|
9
|
+
})(GSTRateStatusEnum || (exports.GSTRateStatusEnum = GSTRateStatusEnum = {}));
|
|
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);
|
|
@@ -13,6 +13,7 @@ import { ClientAffiliateEntityModel } from "../model/client-affiliate.entity.mod
|
|
|
13
13
|
import { ClientEntityModel } from "../model/client.entity.model";
|
|
14
14
|
import { ConfigurationEntityModel } from "../model/configuration.model";
|
|
15
15
|
import { CountryEntityModel } from "../model/country.entity.model";
|
|
16
|
+
import { GSTRateEntityModel } from "../model/gst_rate.entity.model";
|
|
16
17
|
import { HolidayEntityModel } from "../model/holiday.entity.model";
|
|
17
18
|
import { LeaveEntityModel } from "../model/leave.entity.model";
|
|
18
19
|
import { LeaveCountVirtualEntityModel } from "../model/leave_count.entity.model";
|
|
@@ -20,6 +21,7 @@ import { ProjectUserMappingEntityModel } from "../model/project-user-mapping.ent
|
|
|
20
21
|
import { ProjectEntityModel } from "../model/project.entity.model";
|
|
21
22
|
import { ReimbursementExpenseEntityModel } from "../model/reimbursement-expense.entity.model";
|
|
22
23
|
import { ReimbursementEntityModel } from "../model/reimbursement.entity.model";
|
|
24
|
+
import { StateEntityModel } from "../model/state.entity.model";
|
|
23
25
|
import { TaskEntityModel } from "../model/task.entity.model";
|
|
24
26
|
import { TimesheetEntityModel } from "../model/timesheet.entity.model";
|
|
25
27
|
import { UserEntityModel } from "../model/user.entity.model";
|
|
@@ -40,6 +42,7 @@ import { ICronJobsEntity } from "./cron-job.entity.interface";
|
|
|
40
42
|
import { IDesignationEntity } from "./designation.entity.interface";
|
|
41
43
|
import { IEntityAuditColumn } from "./entity-audit-columns.interface";
|
|
42
44
|
import { IExpenseTypeEntity } from "./expense_type.entity.interface";
|
|
45
|
+
import { IGstRateEntity } from "./gst_rate.entity.interface";
|
|
43
46
|
import { IHolidayListEntity } from "./holiday-list.entity.interface";
|
|
44
47
|
import { IHolidayEntity } from "./holiday.entity.interface";
|
|
45
48
|
import { IIndustryEntity } from "./industry.entity.interface";
|
|
@@ -55,6 +58,7 @@ import { IReimbursementEntity } from "./reimbursement.entity.interface";
|
|
|
55
58
|
import { IReimbursementExpenseEntity } from "./reimbursement_expense.entity.interface";
|
|
56
59
|
import { IRoleEntity } from "./role.entity.interface";
|
|
57
60
|
import { IRolePermissionMappingEntity } from "./role.permission.mapping.entity.interface";
|
|
61
|
+
import { IStateEntity } from "./state.entity.interface";
|
|
58
62
|
import { ITaskEntity } from "./task.entity.interface";
|
|
59
63
|
import { ITimesheetEntity } from "./timesheet.entity.interface";
|
|
60
64
|
import { ITimesheetHistoryEntity } from "./timesheet_history.entity.interface";
|
|
@@ -143,7 +147,9 @@ export declare enum EntityEnum {
|
|
|
143
147
|
HOLIDAY_LIST = "holiday_list",
|
|
144
148
|
CRON_JOBS = "cron_jobs",
|
|
145
149
|
TO_DO_LIST = "to_do_list",
|
|
146
|
-
ADDRESS_BOOK = "address_book"
|
|
150
|
+
ADDRESS_BOOK = "address_book",
|
|
151
|
+
STATE = "state",
|
|
152
|
+
GST_RATE = "gst_rate"
|
|
147
153
|
}
|
|
148
154
|
export type EntityRelations = {
|
|
149
155
|
[K in EntityEnum | VirtualEntityEnum]: K;
|
|
@@ -162,7 +168,7 @@ export type IBaseEntityApiResponse<T> = {
|
|
|
162
168
|
[K in EntityEnum | VirtualEntityEnum]?: IBaseEntityApiResponse<EnumEntityType<K>>;
|
|
163
169
|
};
|
|
164
170
|
};
|
|
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) & {
|
|
171
|
+
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 : T extends EntityEnum.GST_RATE ? IGstRateEntity : never) & {
|
|
166
172
|
id: number;
|
|
167
173
|
};
|
|
168
174
|
export type EntityRelationConfig<T extends EntityEnum | VirtualEntityEnum> = {
|
|
@@ -285,7 +291,7 @@ export declare enum VirtualEntityEnum {
|
|
|
285
291
|
}
|
|
286
292
|
export type IHistoryConstraintSearchResponse<T> = IBaseResponse<IHistoryEntitySearchByConstraintResponse<T>[]>;
|
|
287
293
|
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;
|
|
294
|
+
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 : T extends EntityEnum.GST_RATE ? GSTRateEntityModel : UserEntityModel;
|
|
289
295
|
export type EntityMap = {
|
|
290
296
|
[key in EntityEnum | VirtualEntityEnum]: EnumToModel<key>[];
|
|
291
297
|
};
|
|
@@ -78,6 +78,8 @@ 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";
|
|
82
|
+
EntityEnum["GST_RATE"] = "gst_rate";
|
|
81
83
|
})(EntityEnum || (exports.EntityEnum = EntityEnum = {}));
|
|
82
84
|
var VirtualEntityEnum;
|
|
83
85
|
(function (VirtualEntityEnum) {
|
|
File without changes
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { GSTRateStatusEnum } from "../enums/gst_rate_status_enum";
|
|
2
|
+
import { IEntityAuditColumn } from "./entity-audit-columns.interface";
|
|
3
|
+
export interface IGstRateEntity extends IEntityAuditColumn {
|
|
4
|
+
id: number;
|
|
5
|
+
code: string;
|
|
6
|
+
rate: number;
|
|
7
|
+
status: GSTRateStatusEnum;
|
|
8
|
+
}
|
|
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,8 @@ 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");
|
|
35
|
+
const gst_rate_entity_model_1 = require("./gst_rate.entity.model");
|
|
34
36
|
function mapToIndex(entityMap) {
|
|
35
37
|
return Object.keys(entityMap).reduce((acc, key) => {
|
|
36
38
|
// @ts-ignore
|
|
@@ -80,6 +82,8 @@ exports.entityEnumToEntityModel = {
|
|
|
80
82
|
[entity_utils_interface_1.EntityEnum.COUNTRY]: country_entity_model_1.CountryEntityModel.fromApiEntity,
|
|
81
83
|
[entity_utils_interface_1.EntityEnum.ADDRESS_BOOK]: address_book_model_1.AddressBookEntityModel.fromEntity,
|
|
82
84
|
[entity_utils_interface_1.EntityEnum.BILLING_TRANSACTION]: billing_transaction_model_1.BillingTransactionEntityModel.fromEntity,
|
|
85
|
+
[entity_utils_interface_1.EntityEnum.STATE]: state_entity_model_1.StateEntityModel.fromEntity,
|
|
86
|
+
[entity_utils_interface_1.EntityEnum.GST_RATE]: gst_rate_entity_model_1.GSTRateEntityModel.fromEntity,
|
|
83
87
|
};
|
|
84
88
|
function entityMapToModels(entityMap) {
|
|
85
89
|
for (const entityName in entityMap) {
|
|
@@ -134,11 +138,18 @@ function removeEntityById(entityIndexMap, entity, id) {
|
|
|
134
138
|
}
|
|
135
139
|
}
|
|
136
140
|
class EntityModelRelationHelper {
|
|
137
|
-
constructor(entityMap) {
|
|
141
|
+
constructor(entityMap, init = true) {
|
|
138
142
|
this.entityMap = entityMap;
|
|
139
143
|
this.entityModelMap = {};
|
|
140
144
|
this.entityModelIndexMap = {};
|
|
141
|
-
|
|
145
|
+
if (init)
|
|
146
|
+
this.init();
|
|
147
|
+
}
|
|
148
|
+
static getClone(entity) {
|
|
149
|
+
const clone = new EntityModelRelationHelper(entity.entityMap, false);
|
|
150
|
+
clone.entityModelMap = Object.assign({}, entity.entityModelMap);
|
|
151
|
+
clone.entityModelIndexMap = Object.assign({}, entity.entityModelIndexMap);
|
|
152
|
+
return clone;
|
|
142
153
|
}
|
|
143
154
|
init() {
|
|
144
155
|
this.toEntityModelMap();
|
|
@@ -195,12 +206,14 @@ class EntityModelRelationHelper {
|
|
|
195
206
|
if (config.populateRelations) {
|
|
196
207
|
this.populateRelationsByEntityModel(entityModel);
|
|
197
208
|
}
|
|
209
|
+
return EntityModelRelationHelper.getClone(this);
|
|
198
210
|
}
|
|
199
211
|
addEntity(entity, entityEnum, config = { populateRelations: false }) {
|
|
200
212
|
if (!(entityEnum in exports.entityEnumToEntityModel)) {
|
|
201
213
|
throw new Error(`Unknown entity: ${entityEnum}`);
|
|
202
214
|
}
|
|
203
215
|
this.addEntityModel(this.fromEntityToEntityModel(entity, entityEnum), config);
|
|
216
|
+
return EntityModelRelationHelper.getClone(this);
|
|
204
217
|
}
|
|
205
218
|
updateEntityModel(entityModel, config = { populateRelations: false }) {
|
|
206
219
|
const entityEnum = entityModel.entityName;
|
|
@@ -210,6 +223,13 @@ class EntityModelRelationHelper {
|
|
|
210
223
|
if (config.populateRelations) {
|
|
211
224
|
this.populateRelationsByEntityModel(entityModel);
|
|
212
225
|
}
|
|
226
|
+
return EntityModelRelationHelper.getClone(this);
|
|
227
|
+
}
|
|
228
|
+
deleteById(entityEnum, id) {
|
|
229
|
+
if (this.entityModelIndexMap[entityEnum]) {
|
|
230
|
+
delete this.entityModelIndexMap[entityEnum][id];
|
|
231
|
+
}
|
|
232
|
+
return EntityModelRelationHelper.getClone(this);
|
|
213
233
|
}
|
|
214
234
|
}
|
|
215
235
|
exports.EntityModelRelationHelper = EntityModelRelationHelper;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { GSTRateStatusEnum } from "../enums/gst_rate_status_enum";
|
|
2
|
+
import { EntityEnum } from "../interface/entity.utils.interface";
|
|
3
|
+
import { IGstRateEntity } from "../interface/gst_rate.entity.interface";
|
|
4
|
+
import { BaseEntityModel } from "./base.entity.model";
|
|
5
|
+
export declare class GSTRateEntityModel extends BaseEntityModel<EntityEnum.GST_RATE> implements IGstRateEntity {
|
|
6
|
+
id: number;
|
|
7
|
+
code: string;
|
|
8
|
+
rate: number;
|
|
9
|
+
status: GSTRateStatusEnum;
|
|
10
|
+
createdOn: number;
|
|
11
|
+
updatedOn: number;
|
|
12
|
+
createdBy: number;
|
|
13
|
+
updatedBy: number;
|
|
14
|
+
static fromEntity(entity: IGstRateEntity): GSTRateEntityModel;
|
|
15
|
+
static relationConfigs: never[];
|
|
16
|
+
getRelationConfigs(): any[];
|
|
17
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GSTRateEntityModel = void 0;
|
|
4
|
+
const gst_rate_status_enum_1 = require("../enums/gst_rate_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 GSTRateEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.id = 0;
|
|
11
|
+
this.code = "";
|
|
12
|
+
this.rate = 0;
|
|
13
|
+
this.status = gst_rate_status_enum_1.GSTRateStatusEnum.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 GSTRateEntityModel(entity_utils_interface_1.EntityEnum.GST_RATE);
|
|
21
|
+
Object.assign(result, entity);
|
|
22
|
+
return result;
|
|
23
|
+
}
|
|
24
|
+
getRelationConfigs() {
|
|
25
|
+
return this.constructor.prototype.constructor.relationConfigs || [];
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.GSTRateEntityModel = GSTRateEntityModel;
|
|
29
|
+
GSTRateEntityModel.relationConfigs = [];
|
|
@@ -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.
|
|
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.1",
|
|
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
|
+
}
|