ia-common 1.1.1-beta.3 → 1.1.1-beta.31
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/build/@constants.d.ts +1 -0
- package/build/@constants.js +17 -0
- package/build/src/@constants.d.ts +1 -0
- package/build/src/@constants.js +17 -0
- package/build/src/@enum.d.ts +1 -33
- package/build/src/@enum.js +1 -33
- package/build/src/constants/entity_constants.d.ts +1 -0
- package/build/src/constants/entity_constants.js +17 -0
- package/build/src/constants/index.d.ts +1 -0
- package/build/src/constants/index.js +17 -0
- package/build/src/enum/corporate-actions/corporate-actions-type.enum.js +0 -1
- package/build/src/enum/error.key.enum.d.ts +3 -1
- package/build/src/enum/error.key.enum.js +2 -0
- package/build/src/enum/index.d.ts +34 -0
- package/build/src/enum/index.js +50 -0
- package/build/src/enum/permission-actions.enum.d.ts +7 -0
- package/build/src/enum/permission-actions.enum.js +11 -0
- package/build/src/enum/user/user-role.enum.d.ts +2 -4
- package/build/src/enum/user/user-role.enum.js +6 -4
- package/build/src/interface/api/bank-details-create-dto..interface.d.ts +4 -3
- package/build/src/interface/api/bank-details-update.dto.interface.d.ts +1 -3
- package/build/src/interface/api/configuration-update-dto.interface.d.ts +1 -1
- package/build/src/interface/api/corporate-actions-create.dto.d.ts +1 -1
- package/build/src/interface/api/create-corporate-action-advice.interface.d.ts +5 -6
- package/build/src/interface/api/create-user-dto.interface.d.ts +1 -2
- package/build/src/interface/api/equity-advice-create-dto.interface.d.ts +1 -1
- package/build/src/interface/api/equity-advice-update-dto..d.ts +1 -1
- package/build/src/interface/api/get-corporate-actions.interface.d.ts +1 -1
- package/build/src/interface/api/get-corporate-actions.interface.js +1 -1
- package/build/src/interface/api/get-cron-job-by-date-range.interface.d.ts +1 -1
- package/build/src/interface/api/get-staff-members.interface.d.ts +1 -1
- package/build/src/interface/api/index.d.ts +2 -0
- package/build/src/interface/api/index.js +2 -0
- package/build/src/interface/api/login.interface.d.ts +0 -1
- package/build/src/interface/api/manual-trigger-cron-job.interface.d.ts +1 -1
- package/build/src/interface/api/mutual-fund-advice-create-dto.interface.d.ts +1 -1
- package/build/src/interface/api/mutual-funds-create-dto.interface.d.ts +1 -1
- package/build/src/interface/api/nfo-advice-update-dto.interface.d.ts +1 -1
- package/build/src/interface/api/organization-update-dto.interface.d.ts +1 -1
- package/build/src/interface/api/permission.create.dto.interface.d.ts +4 -1
- package/build/src/interface/api/permission.update.dto.interface.d.ts +5 -1
- package/build/src/interface/api/pricing-plan-create.dto.interface.d.ts +3 -8
- package/build/src/interface/api/pricing-plan-update-dto.interface.d.ts +2 -2
- package/build/src/interface/api/role-user-mapping-create-dto.interface.d.ts +7 -0
- package/build/src/interface/api/role-user-mapping-create-dto.interface.js +2 -0
- package/build/src/interface/api/role-user-mapping-delete-dto.interface.d.ts +3 -0
- package/build/src/interface/api/role-user-mapping-delete-dto.interface.js +2 -0
- package/build/src/interface/api/subscription-create.dto.interface.d.ts +7 -1
- package/build/src/interface/api/subscription-update.dto.interface.d.ts +4 -7
- package/build/src/interface/api/update-corporate-action-advice.interface.d.ts +4 -7
- package/build/src/interface/api/update-corporate-action.interface.d.ts +1 -1
- package/build/src/interface/api/update-pricing-plan-by-id.interface.d.ts +2 -2
- package/build/src/interface/corporate-actions/base-corporate-actions.interface.d.ts +2 -1
- package/build/src/interface/corporate-actions/buy-back-corporate-actions.interface.d.ts +1 -1
- package/build/src/interface/corporate-actions/ipo-corporate-action.interface.d.ts +1 -1
- package/build/src/interface/corporate-actions/split-bonus-corporate-action.interface.d.ts +1 -1
- package/build/src/interface/entity/advice-entity.interface.d.ts +1 -1
- package/build/src/interface/entity/advisor-user-mapping-entity.interface.d.ts +1 -1
- package/build/src/interface/entity/bank-details-entity.interface.d.ts +2 -2
- package/build/src/interface/entity/configurations-entity.interface.d.ts +1 -1
- package/build/src/interface/entity/corporate-action-advice-entity.interface.d.ts +4 -4
- package/build/src/interface/entity/cron-job-entity.interface.d.ts +1 -1
- package/build/src/interface/entity/entity-utils.interface.d.ts +6 -3
- package/build/src/interface/entity/entity-utils.interface.js +1 -0
- package/build/src/interface/entity/equity-advice-in-process-entity.interface.d.ts +1 -1
- package/build/src/interface/entity/index.d.ts +1 -0
- package/build/src/interface/entity/index.js +1 -0
- package/build/src/interface/entity/mutual-fund-advice-entity.interface.d.ts +1 -1
- package/build/src/interface/entity/mutual-funds-entity.interface.d.ts +1 -1
- package/build/src/interface/entity/nfo-advice-entity.interface.d.ts +1 -1
- package/build/src/interface/entity/nfo-entity.interface.d.ts +1 -1
- package/build/src/interface/entity/permission.entity.interface.d.ts +2 -1
- package/build/src/interface/entity/pricing-plan-entity.interface.d.ts +1 -1
- package/build/src/interface/entity/relation-config.interface.d.ts +1 -1
- package/build/src/interface/entity/role-user-mapping-entity.interface.d.ts +8 -0
- package/build/src/interface/entity/role-user-mapping-entity.interface.js +2 -0
- package/build/src/interface/entity/role.entity.interface.d.ts +0 -1
- package/build/src/interface/entity/subscription-entity.interface.d.ts +1 -1
- package/build/src/interface/entity/user-entity.interface.d.ts +0 -2
- package/build/src/model/bank-details-entity-model.d.ts +2 -2
- package/build/src/model/bank-details-entity-model.js +3 -3
- package/build/src/model/corporate-actions/bonus-corporate-action-model.d.ts +2 -1
- package/build/src/model/corporate-actions/bonus-corporate-action-model.js +2 -2
- package/build/src/model/corporate-actions/buy-back-corporate-action-model.d.ts +3 -1
- package/build/src/model/corporate-actions/buy-back-corporate-action-model.js +2 -2
- package/build/src/model/corporate-actions/corporate-action-model.d.ts +2 -1
- package/build/src/model/corporate-actions/corporate-action-model.js +4 -3
- package/build/src/model/corporate-actions/corporate-actions-advice-model.d.ts +4 -4
- package/build/src/model/corporate-actions/corporate-actions-advice-model.js +3 -3
- package/build/src/model/corporate-actions/delisting-corporate-action-model.d.ts +2 -1
- package/build/src/model/corporate-actions/delisting-corporate-action-model.js +2 -2
- package/build/src/model/corporate-actions/dividend-corporate-action-model.d.ts +2 -1
- package/build/src/model/corporate-actions/dividend-corporate-action-model.js +2 -2
- package/build/src/model/corporate-actions/fpo-corporate-action-model.d.ts +2 -1
- package/build/src/model/corporate-actions/fpo-corporate-action-model.js +2 -2
- package/build/src/model/corporate-actions/ipo-corporate-action-model.d.ts +3 -1
- package/build/src/model/corporate-actions/ipo-corporate-action-model.js +2 -2
- package/build/src/model/corporate-actions/ofs-corporate-action-model.d.ts +2 -1
- package/build/src/model/corporate-actions/ofs-corporate-action-model.js +2 -2
- package/build/src/model/corporate-actions/open-offer-corporate-action-model.d.ts +2 -1
- package/build/src/model/corporate-actions/open-offer-corporate-action-model.js +2 -2
- package/build/src/model/corporate-actions/right-issue-corporate-action-model.d.ts +2 -1
- package/build/src/model/corporate-actions/right-issue-corporate-action-model.js +2 -2
- package/build/src/model/corporate-actions/split-bonus-corporate-action-model.d.ts +3 -1
- package/build/src/model/corporate-actions/split-corporate-action-model.d.ts +2 -1
- package/build/src/model/corporate-actions/split-corporate-action-model.js +2 -2
- package/build/src/model/index.d.ts +1 -0
- package/build/src/model/index.js +1 -0
- package/build/src/model/interface/entity.model.interface.js +3 -0
- package/build/src/model/interface/pricing-plan-model.interface.d.ts +2 -2
- package/build/src/model/mutual-funds-entity.model.d.ts +1 -1
- package/build/src/model/mutual-funds-entity.model.js +2 -2
- package/build/src/model/nfo-advice-entity.model.d.ts +1 -1
- package/build/src/model/nfo-advice-entity.model.js +3 -3
- package/build/src/model/nfo-entity.model.d.ts +1 -1
- package/build/src/model/nfo-entity.model.js +2 -2
- package/build/src/model/organization-entity-model.d.ts +0 -1
- package/build/src/model/organization-entity-model.js +13 -13
- package/build/src/model/permission-entity-model.d.ts +3 -1
- package/build/src/model/permission-entity-model.js +3 -1
- package/build/src/model/pricing-plan-entity-model.d.ts +1 -1
- package/build/src/model/pricing-plan-entity-model.js +4 -4
- package/build/src/model/pricing-plan-model.d.ts +2 -2
- package/build/src/model/pricing-plan-model.js +4 -4
- package/build/src/model/role-entity-model.d.ts +0 -1
- package/build/src/model/role-entity-model.js +0 -1
- package/build/src/model/role-user-mapping-entity-model.d.ts +15 -0
- package/build/src/model/role-user-mapping-entity-model.js +26 -0
- package/build/src/model/user-entity-model.d.ts +1 -3
- package/build/src/model/user-entity-model.js +2 -13
- package/build/src/red-black-tree/js-cols.d.ts +2 -0
- package/build/src/red-black-tree/js-cols.js +12 -0
- package/build/src/utils/date-util.d.ts +1 -0
- package/build/src/utils/date-util.js +44 -0
- package/build/src/utils/helper.fn.utils.d.ts +47 -1
- package/build/src/utils/helper.fn.utils.js +150 -1
- package/build/src/utils/validate-utils.d.ts +1 -1
- package/package.json +6 -5
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { CorporateActionsStatus, CorporateActionsType } from "../../@enum";
|
|
2
1
|
import { ICorporateActionsEntity, ICorporateEntityOmitData, IOpenOfferCorporateActionCreateDtoData } from "../../@type";
|
|
2
|
+
import { CorporateActionsStatus } from "../../enum/corporate-actions/corporate-actions-status.enum";
|
|
3
|
+
import { CorporateActionsType } from "../../enum/corporate-actions/corporate-actions-type.enum";
|
|
3
4
|
export declare class OpenOfferCorporateActionModel implements IOpenOfferCorporateActionCreateDtoData, ICorporateEntityOmitData {
|
|
4
5
|
price: number;
|
|
5
6
|
startDate: number;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.OpenOfferCorporateActionModel = void 0;
|
|
4
|
-
const _enum_1 = require("../../@enum");
|
|
5
4
|
const _utils_1 = require("../../@utils");
|
|
5
|
+
const corporate_actions_type_enum_1 = require("../../enum/corporate-actions/corporate-actions-type.enum");
|
|
6
6
|
class OpenOfferCorporateActionModel {
|
|
7
7
|
constructor(entity) {
|
|
8
|
-
_utils_1.ValidateUtils.validateCorporateActionType(entity.type,
|
|
8
|
+
_utils_1.ValidateUtils.validateCorporateActionType(entity.type, corporate_actions_type_enum_1.CorporateActionsType.OPEN_OFFER);
|
|
9
9
|
Object.assign(this, Object.assign(Object.assign({}, entity), JSON.parse(entity.data)));
|
|
10
10
|
}
|
|
11
11
|
getCorporateActionEntity() {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { CorporateActionsStatus, CorporateActionsType } from "../../@enum";
|
|
2
1
|
import { ICorporateActionsEntity, ICorporateEntityOmitData, IRightIssueCorporateActionCreateDtoData } from "../../@type";
|
|
2
|
+
import { CorporateActionsStatus } from "../../enum/corporate-actions/corporate-actions-status.enum";
|
|
3
|
+
import { CorporateActionsType } from "../../enum/corporate-actions/corporate-actions-type.enum";
|
|
3
4
|
export declare class RightIssueCorporateActionModel implements IRightIssueCorporateActionCreateDtoData, ICorporateEntityOmitData {
|
|
4
5
|
price: number;
|
|
5
6
|
startDate: number;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RightIssueCorporateActionModel = void 0;
|
|
4
|
-
const _enum_1 = require("../../@enum");
|
|
5
4
|
const _utils_1 = require("../../@utils");
|
|
5
|
+
const corporate_actions_type_enum_1 = require("../../enum/corporate-actions/corporate-actions-type.enum");
|
|
6
6
|
class RightIssueCorporateActionModel {
|
|
7
7
|
constructor(entity) {
|
|
8
|
-
_utils_1.ValidateUtils.validateCorporateActionType(entity.type,
|
|
8
|
+
_utils_1.ValidateUtils.validateCorporateActionType(entity.type, corporate_actions_type_enum_1.CorporateActionsType.RIGHTS_ISSUE);
|
|
9
9
|
Object.assign(this, Object.assign(Object.assign({}, entity), JSON.parse(entity.data)));
|
|
10
10
|
}
|
|
11
11
|
getCorporateActionEntity() {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { CorporateActionsStatus, CorporateActionsType, OrderOfSplitAndBonusStock } from "../../@enum";
|
|
2
1
|
import { IBonusStockData, ICorporateActionsEntity, ICorporateEntityOmitData, ISplitBonusCorporateActionCreateDtoData, ISplitStockData } from "../../@type";
|
|
2
|
+
import { CorporateActionsStatus } from "../../enum/corporate-actions/corporate-actions-status.enum";
|
|
3
|
+
import { CorporateActionsType } from "../../enum/corporate-actions/corporate-actions-type.enum";
|
|
4
|
+
import { OrderOfSplitAndBonusStock } from "../../enum/corporate-actions/split-and-bonus-stock-order.enum";
|
|
3
5
|
export declare class SplitBonusCorporateActionModel implements ISplitBonusCorporateActionCreateDtoData, ICorporateEntityOmitData {
|
|
4
6
|
splitStock: ISplitStockData;
|
|
5
7
|
bonusStock: IBonusStockData;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { CorporateActionsStatus, CorporateActionsType } from "../../@enum";
|
|
2
1
|
import { ICorporateActionsEntity, ICorporateEntityOmitData, ISplitCorporateActionCreateDtoData } from "../../@type";
|
|
2
|
+
import { CorporateActionsStatus } from "../../enum/corporate-actions/corporate-actions-status.enum";
|
|
3
|
+
import { CorporateActionsType } from "../../enum/corporate-actions/corporate-actions-type.enum";
|
|
3
4
|
export declare class SplitCorporateActionModel implements ISplitCorporateActionCreateDtoData, ICorporateEntityOmitData {
|
|
4
5
|
currentFV: number;
|
|
5
6
|
newFV: number;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SplitCorporateActionModel = void 0;
|
|
4
|
-
const _enum_1 = require("../../@enum");
|
|
5
4
|
const _utils_1 = require("../../@utils");
|
|
5
|
+
const corporate_actions_type_enum_1 = require("../../enum/corporate-actions/corporate-actions-type.enum");
|
|
6
6
|
class SplitCorporateActionModel {
|
|
7
7
|
constructor(entity) {
|
|
8
|
-
_utils_1.ValidateUtils.validateCorporateActionType(entity.type,
|
|
8
|
+
_utils_1.ValidateUtils.validateCorporateActionType(entity.type, corporate_actions_type_enum_1.CorporateActionsType.SPLIT);
|
|
9
9
|
Object.assign(this, Object.assign(Object.assign({}, entity), JSON.parse(entity.data)));
|
|
10
10
|
}
|
|
11
11
|
getCorporateActionEntity() {
|
package/build/src/model/index.js
CHANGED
|
@@ -51,3 +51,4 @@ __exportStar(require("./configurations-entity-model"), exports);
|
|
|
51
51
|
__exportStar(require("./permission-entity-model"), exports);
|
|
52
52
|
__exportStar(require("./role-entity-model"), exports);
|
|
53
53
|
__exportStar(require("./role-permission-entity-model"), exports);
|
|
54
|
+
__exportStar(require("./role-user-mapping-entity-model"), exports);
|
|
@@ -20,6 +20,7 @@ const pricing_plan_entity_model_1 = require("../pricing-plan-entity-model");
|
|
|
20
20
|
const registration_entity_model_1 = require("../registration-entity-model");
|
|
21
21
|
const role_entity_model_1 = require("../role-entity-model");
|
|
22
22
|
const role_permission_entity_model_1 = require("../role-permission-entity-model");
|
|
23
|
+
const role_user_mapping_entity_model_1 = require("../role-user-mapping-entity-model");
|
|
23
24
|
const subscription_entity_model_1 = require("../subscription-entity-model");
|
|
24
25
|
const user_entity_model_1 = require("../user-entity-model");
|
|
25
26
|
function mapToIndex(entityMap) {
|
|
@@ -76,6 +77,7 @@ function parseEntities(json, baseEntity, entityModelMap) {
|
|
|
76
77
|
[_type_1.EntityEnum.ROLE]: role_entity_model_1.RoleEntityModel.fromEntity,
|
|
77
78
|
[_type_1.EntityEnum.PERMISSION]: permission_entity_model_1.PermissionEntityModel.fromEntity,
|
|
78
79
|
[_type_1.EntityEnum.ROLE_PERMISSION_MAPPING]: role_permission_entity_model_1.RolePermissionMappingEntityModel.fromEntity,
|
|
80
|
+
[_type_1.EntityEnum.ROLE_USER_MAPPING]: role_user_mapping_entity_model_1.RoleUserMappingEntityModel.fromEntity,
|
|
79
81
|
};
|
|
80
82
|
if (!(baseEntity in entityFromJsonMappings)) {
|
|
81
83
|
throw new Error(`Unknown entity: ${baseEntity}`);
|
|
@@ -114,6 +116,7 @@ exports.entityEnumToEntityModel = {
|
|
|
114
116
|
[_type_1.EntityEnum.ROLE]: role_entity_model_1.RoleEntityModel.fromEntity,
|
|
115
117
|
[_type_1.EntityEnum.PERMISSION]: permission_entity_model_1.PermissionEntityModel.fromEntity,
|
|
116
118
|
[_type_1.EntityEnum.ROLE_PERMISSION_MAPPING]: role_permission_entity_model_1.RolePermissionMappingEntityModel.fromEntity,
|
|
119
|
+
[_type_1.EntityEnum.ROLE_USER_MAPPING]: role_user_mapping_entity_model_1.RoleUserMappingEntityModel.fromEntity,
|
|
117
120
|
};
|
|
118
121
|
function parseEntitiesWithoutModels(json, baseEntity, entityMap = {}) {
|
|
119
122
|
var _a;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { IBillingCycleObj } from "../../interface/selected-billing-cycle.interface";
|
|
2
2
|
export interface IPricingPlanModel {
|
|
3
3
|
id: number;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
effectiveFrom: number;
|
|
5
|
+
effectiveTo: number;
|
|
6
6
|
basePrice: number;
|
|
7
7
|
billingCycle: {
|
|
8
8
|
[key: string]: IBillingCycleObj;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { MutualFundsType } from "../../@enum";
|
|
2
1
|
import { EntityEnum, IMutualFundsEntity } from "../../@type";
|
|
2
|
+
import { MutualFundsType } from "../enum";
|
|
3
3
|
import { BaseEntityModel } from "./base.entity.model";
|
|
4
4
|
export declare class MutualFundEntityModel extends BaseEntityModel<EntityEnum.MUTUAL_FUNDS> implements IMutualFundsEntity {
|
|
5
5
|
id: number;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MutualFundEntityModel = void 0;
|
|
4
|
-
const _enum_1 = require("../../@enum");
|
|
5
4
|
const _type_1 = require("../../@type");
|
|
5
|
+
const enum_1 = require("../enum");
|
|
6
6
|
const base_entity_model_1 = require("./base.entity.model");
|
|
7
7
|
class MutualFundEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
8
8
|
constructor() {
|
|
@@ -19,7 +19,7 @@ class MutualFundEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
19
19
|
this.fiveYearReturnRegular = 0;
|
|
20
20
|
this.fiveYearReturnDirect = 0;
|
|
21
21
|
this.dailyAUM = 0;
|
|
22
|
-
this.type =
|
|
22
|
+
this.type = enum_1.MutualFundsType.DEBT;
|
|
23
23
|
this.createdOn = 0;
|
|
24
24
|
this.updatedOn = 0;
|
|
25
25
|
this.createdBy = 0;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { NFOAdviceStatus, NFOAdviceTransactionType } from "../../@enum";
|
|
2
1
|
import { EntityEnum, INFOAdviceEntity } from "../../@type";
|
|
2
|
+
import { NFOAdviceStatus, NFOAdviceTransactionType } from "../enum";
|
|
3
3
|
import { BaseEntityModel } from "./base.entity.model";
|
|
4
4
|
export declare class NFOAdviceEntityModel extends BaseEntityModel<EntityEnum.NFO_ADVICE> implements INFOAdviceEntity {
|
|
5
5
|
id: number;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.NFOAdviceEntityModel = void 0;
|
|
4
|
-
const _enum_1 = require("../../@enum");
|
|
5
4
|
const _type_1 = require("../../@type");
|
|
5
|
+
const enum_1 = require("../enum");
|
|
6
6
|
const base_entity_model_1 = require("./base.entity.model");
|
|
7
7
|
class NFOAdviceEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
8
8
|
constructor() {
|
|
@@ -11,12 +11,12 @@ class NFOAdviceEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
11
11
|
this.nfoId = 0;
|
|
12
12
|
this.mutualFundName = "";
|
|
13
13
|
this.advisorOrgId = 0;
|
|
14
|
-
this.transactionType =
|
|
14
|
+
this.transactionType = enum_1.NFOAdviceTransactionType.AVOID;
|
|
15
15
|
this.rationale = "";
|
|
16
16
|
this.noteDocumentUrl = null;
|
|
17
17
|
this.videoUrl = null;
|
|
18
18
|
this.voiceUrl = null;
|
|
19
|
-
this.status =
|
|
19
|
+
this.status = enum_1.NFOAdviceStatus.ACTIVE;
|
|
20
20
|
this.createdOn = 0;
|
|
21
21
|
this.updatedOn = 0;
|
|
22
22
|
this.createdBy = 0;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { MutualFundsType } from "../../@enum";
|
|
2
1
|
import { EntityEnum, INFOEntity } from "../../@type";
|
|
2
|
+
import { MutualFundsType } from "../enum";
|
|
3
3
|
import { BaseEntityModel } from "./base.entity.model";
|
|
4
4
|
export declare class NFOEntityModel extends BaseEntityModel<EntityEnum.NFO> implements INFOEntity {
|
|
5
5
|
id: number;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.NFOEntityModel = void 0;
|
|
4
|
-
const _enum_1 = require("../../@enum");
|
|
5
4
|
const _type_1 = require("../../@type");
|
|
5
|
+
const enum_1 = require("../enum");
|
|
6
6
|
const base_entity_model_1 = require("./base.entity.model");
|
|
7
7
|
class NFOEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
8
8
|
constructor() {
|
|
9
9
|
super(_type_1.EntityEnum.NFO);
|
|
10
10
|
this.id = 0;
|
|
11
11
|
this.mutualFundName = "";
|
|
12
|
-
this.type =
|
|
12
|
+
this.type = enum_1.MutualFundsType.EQUITY;
|
|
13
13
|
this.startDateCode = 0;
|
|
14
14
|
this.endDateCode = 0;
|
|
15
15
|
this.risk = "";
|
|
@@ -54,7 +54,6 @@ export declare class OrganizationEntityModel extends BaseEntityModel<EntityEnum.
|
|
|
54
54
|
* Find organization by registrationId
|
|
55
55
|
*/
|
|
56
56
|
static findByRegistrationId(organizationEntities: IOrganizationEntity[], registrationId: number): IOrganizationEntity | undefined;
|
|
57
|
-
validateOwnersCountByOrganizationType(): void;
|
|
58
57
|
getUsersModels(): UserEntityModel[];
|
|
59
58
|
static relationConfigs: RelationConfigs<[
|
|
60
59
|
EntityEnum.USER
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.OrganizationEntityModel = void 0;
|
|
4
4
|
const _enum_1 = require("../@enum");
|
|
5
5
|
const relation_type_enum_1 = require("../enum/relation-type.enum");
|
|
6
|
-
const _model_1 = require("../@model");
|
|
7
6
|
const _type_1 = require("../@type");
|
|
8
7
|
const base_entity_model_1 = require("./base.entity.model");
|
|
9
8
|
class OrganizationEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
@@ -144,18 +143,19 @@ class OrganizationEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
144
143
|
// ): IOrganizationEntity {
|
|
145
144
|
// return OrganizationEntityModel.fromRegistrationModel(registrationEntity);
|
|
146
145
|
// }
|
|
147
|
-
validateOwnersCountByOrganizationType() {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
}
|
|
146
|
+
// validateOwnersCountByOrganizationType(): void {
|
|
147
|
+
// const noOfOwners = this.users?.filter(
|
|
148
|
+
// (user) => user.role === UserRoleEnum.ADVISOR
|
|
149
|
+
// ).length;
|
|
150
|
+
// if (this.type === OrganizationType.PARTNERSHIP && noOfOwners <= 1) {
|
|
151
|
+
// throw new AppBadRequestException({
|
|
152
|
+
// key: "organizationType",
|
|
153
|
+
// message: [
|
|
154
|
+
// "If the organization is a partnership, it must have a minimum of two owners.",
|
|
155
|
+
// ],
|
|
156
|
+
// });
|
|
157
|
+
// }
|
|
158
|
+
// }
|
|
159
159
|
getUsersModels() {
|
|
160
160
|
return this.users;
|
|
161
161
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import { PermissionActionGroup } from "../@enum";
|
|
1
2
|
import { EntityEnum, IPermissionEntity } from "../@type";
|
|
2
3
|
import { BaseEntityModel } from "./base.entity.model";
|
|
3
4
|
export declare class PermissionEntityModel extends BaseEntityModel<EntityEnum.PERMISSION> implements IPermissionEntity {
|
|
4
5
|
id: number;
|
|
5
6
|
name: string;
|
|
6
7
|
description?: string;
|
|
7
|
-
|
|
8
|
+
group: PermissionActionGroup;
|
|
9
|
+
priority: number;
|
|
8
10
|
createdOn: number;
|
|
9
11
|
updatedOn: number;
|
|
10
12
|
createdBy: number;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PermissionEntityModel = void 0;
|
|
4
|
+
const _enum_1 = require("../@enum");
|
|
4
5
|
const _type_1 = require("../@type");
|
|
5
6
|
const base_entity_model_1 = require("./base.entity.model");
|
|
6
7
|
class PermissionEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
@@ -9,7 +10,8 @@ class PermissionEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
9
10
|
this.id = 0;
|
|
10
11
|
this.name = "";
|
|
11
12
|
this.description = "";
|
|
12
|
-
this.
|
|
13
|
+
this.group = _enum_1.PermissionActionGroup.READ;
|
|
14
|
+
this.priority = 0;
|
|
13
15
|
this.createdOn = 0;
|
|
14
16
|
this.updatedOn = 0;
|
|
15
17
|
this.createdBy = 0;
|
|
@@ -2,8 +2,8 @@ import { PricingPlanStatus } from "../@enum";
|
|
|
2
2
|
import { EntityEnum, IBillingCycle, IGetPricingPlanByDateResponse, IPricingPlanEntity } from "../@type";
|
|
3
3
|
import { BaseEntityModel } from "./base.entity.model";
|
|
4
4
|
export declare class PricingPlanEntityModel extends BaseEntityModel<EntityEnum.PRICING_PLAN> implements IPricingPlanEntity {
|
|
5
|
-
id: number;
|
|
6
5
|
effectiveFrom: number;
|
|
6
|
+
id: number;
|
|
7
7
|
effectiveTo: number;
|
|
8
8
|
status: PricingPlanStatus;
|
|
9
9
|
createdBy: number;
|
|
@@ -20,8 +20,8 @@ class PricingPlanEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
20
20
|
toObject() {
|
|
21
21
|
const responseObj = {
|
|
22
22
|
id: this.id,
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
effectiveFrom: 0,
|
|
24
|
+
effectiveTo: 0,
|
|
25
25
|
basePrice: 0,
|
|
26
26
|
billingCycle: {},
|
|
27
27
|
};
|
|
@@ -36,8 +36,8 @@ class PricingPlanEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
36
36
|
key: billingArray.slice(3).join("-").toLowerCase().replace(/ /g, "-"),
|
|
37
37
|
};
|
|
38
38
|
});
|
|
39
|
-
responseObj.
|
|
40
|
-
responseObj.
|
|
39
|
+
responseObj.effectiveFrom = this.effectiveFrom;
|
|
40
|
+
responseObj.effectiveTo = this.effectiveTo;
|
|
41
41
|
responseObj.basePrice = this.basePrice;
|
|
42
42
|
return responseObj;
|
|
43
43
|
}
|
|
@@ -2,8 +2,8 @@ import { IGetPricingPlanByDateResponse, IPricingPlanModel, IBillingCycleObj, IPr
|
|
|
2
2
|
import { BaseEntityModel } from "./base.entity.model";
|
|
3
3
|
export declare class PricingPlanModel extends BaseEntityModel<EntityEnum.PRICING_PLAN> implements IPricingPlanModel {
|
|
4
4
|
id: number;
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
effectiveFrom: number;
|
|
6
|
+
effectiveTo: number;
|
|
7
7
|
basePrice: number;
|
|
8
8
|
billingCycle: {
|
|
9
9
|
[key: string]: IBillingCycleObj;
|
|
@@ -9,8 +9,8 @@ class PricingPlanModel extends base_entity_model_1.BaseEntityModel {
|
|
|
9
9
|
constructor(data) {
|
|
10
10
|
super(_type_1.EntityEnum.PRICING_PLAN);
|
|
11
11
|
this.id = 0;
|
|
12
|
-
this.
|
|
13
|
-
this.
|
|
12
|
+
this.effectiveFrom = 0;
|
|
13
|
+
this.effectiveTo = 0;
|
|
14
14
|
this.basePrice = 0;
|
|
15
15
|
this.billingCycle = {};
|
|
16
16
|
if (data)
|
|
@@ -75,8 +75,8 @@ class PricingPlanModel extends base_entity_model_1.BaseEntityModel {
|
|
|
75
75
|
exports.PricingPlanModel = PricingPlanModel;
|
|
76
76
|
// export class PricingPlanModel implements IPricingPlanModel {
|
|
77
77
|
// id: number;
|
|
78
|
-
//
|
|
79
|
-
//
|
|
78
|
+
// effectiveFrom: number;
|
|
79
|
+
// effectiveTo: number;
|
|
80
80
|
// basePrice: number;
|
|
81
81
|
// billingCycle: {
|
|
82
82
|
// [key: string]: IBillingCycleObj;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { EntityEnum } from "../@type";
|
|
2
|
+
import { IRoleUserMappingEntity } from "../interface/entity/role-user-mapping-entity.interface";
|
|
3
|
+
import { BaseEntityModel } from "./base.entity.model";
|
|
4
|
+
export declare class RoleUserMappingEntityModel extends BaseEntityModel<EntityEnum.ROLE_USER_MAPPING> implements IRoleUserMappingEntity {
|
|
5
|
+
id: number;
|
|
6
|
+
roleId: number;
|
|
7
|
+
userId: number;
|
|
8
|
+
createdOn: number;
|
|
9
|
+
updatedOn: number;
|
|
10
|
+
createdBy: number;
|
|
11
|
+
updatedBy: number;
|
|
12
|
+
constructor();
|
|
13
|
+
static fromEntity(entity: IRoleUserMappingEntity): RoleUserMappingEntityModel;
|
|
14
|
+
getRelationConfigs(): any;
|
|
15
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RoleUserMappingEntityModel = void 0;
|
|
4
|
+
const _type_1 = require("../@type");
|
|
5
|
+
const base_entity_model_1 = require("./base.entity.model");
|
|
6
|
+
class RoleUserMappingEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(_type_1.EntityEnum.ROLE_USER_MAPPING);
|
|
9
|
+
this.id = 0;
|
|
10
|
+
this.roleId = 0;
|
|
11
|
+
this.userId = 0;
|
|
12
|
+
this.createdOn = 0;
|
|
13
|
+
this.updatedOn = 0;
|
|
14
|
+
this.createdBy = 0;
|
|
15
|
+
this.updatedBy = 0;
|
|
16
|
+
}
|
|
17
|
+
static fromEntity(entity) {
|
|
18
|
+
const result = new RoleUserMappingEntityModel();
|
|
19
|
+
Object.assign(result, entity);
|
|
20
|
+
return result;
|
|
21
|
+
}
|
|
22
|
+
getRelationConfigs() {
|
|
23
|
+
return this.constructor.prototype.constructor.relationConfigs;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.RoleUserMappingEntityModel = RoleUserMappingEntityModel;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UserStatus } from "../@enum";
|
|
2
2
|
import { EntityEnum, IOrganizationEntity, IRegistrationEntity, IUserEntity } from "../@type";
|
|
3
3
|
import { BaseEntityModel } from "./base.entity.model";
|
|
4
4
|
export declare class UserEntityModel extends BaseEntityModel<EntityEnum.USER> implements IUserEntity {
|
|
@@ -12,7 +12,6 @@ export declare class UserEntityModel extends BaseEntityModel<EntityEnum.USER> im
|
|
|
12
12
|
isMobileVerified: boolean;
|
|
13
13
|
isAccountVerified: boolean;
|
|
14
14
|
requireNewPassword: boolean;
|
|
15
|
-
role: UserRoleEnum;
|
|
16
15
|
registrationId: number;
|
|
17
16
|
organizationId: number;
|
|
18
17
|
imageUrl: string | null;
|
|
@@ -28,5 +27,4 @@ export declare class UserEntityModel extends BaseEntityModel<EntityEnum.USER> im
|
|
|
28
27
|
static filterByOrganizationId(userEntities: IUserEntity[], organizationId: number): IUserEntity[];
|
|
29
28
|
static getUserEntityInstanceFromRegistrationEntityOrganizationEntity(registrationEntity: IRegistrationEntity, organizationEntity: IOrganizationEntity, hashedPassword: string): IUserEntity;
|
|
30
29
|
getRelationConfigs(): any;
|
|
31
|
-
validateUserRoleSuperAdmin(): void;
|
|
32
30
|
}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UserEntityModel = void 0;
|
|
4
4
|
const _enum_1 = require("../@enum");
|
|
5
|
-
const _model_1 = require("../@model");
|
|
6
5
|
const _type_1 = require("../@type");
|
|
7
6
|
const base_entity_model_1 = require("./base.entity.model");
|
|
8
7
|
class UserEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
@@ -18,7 +17,7 @@ class UserEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
18
17
|
this.isMobileVerified = false;
|
|
19
18
|
this.isAccountVerified = false;
|
|
20
19
|
this.requireNewPassword = false;
|
|
21
|
-
|
|
20
|
+
// role: UserRoleEnum = UserRoleEnum.ADVISOR;
|
|
22
21
|
this.registrationId = 0;
|
|
23
22
|
this.organizationId = 0;
|
|
24
23
|
this.imageUrl = null;
|
|
@@ -44,7 +43,7 @@ class UserEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
44
43
|
userEntity.isEmailVerified = false;
|
|
45
44
|
userEntity.isMobileVerified = false;
|
|
46
45
|
userEntity.status = _enum_1.UserStatus.REGISTRATION_APPROVED;
|
|
47
|
-
userEntity.role =
|
|
46
|
+
// userEntity.role = UserRoleEnum.OWNER;
|
|
48
47
|
userEntity.createdBy = registrationEntity.createdBy;
|
|
49
48
|
userEntity.updatedBy = registrationEntity.createdBy;
|
|
50
49
|
userEntity.updatedOn = Date.now();
|
|
@@ -62,16 +61,6 @@ class UserEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
62
61
|
getRelationConfigs() {
|
|
63
62
|
return this.constructor.prototype.constructor.relationConfigs;
|
|
64
63
|
}
|
|
65
|
-
validateUserRoleSuperAdmin() {
|
|
66
|
-
if (this.role !== _enum_1.UserRoleEnum.SUPERADMIN) {
|
|
67
|
-
throw new _model_1.AppBadRequestException({
|
|
68
|
-
key: "status",
|
|
69
|
-
message: [
|
|
70
|
-
`Only the SuperAdmin can update the status of ${_enum_1.OrganizationStatus.ACTIVE} and ${_enum_1.OrganizationStatus.ACCOUNT_SUSPENDED}.`,
|
|
71
|
-
],
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
64
|
}
|
|
76
65
|
exports.UserEntityModel = UserEntityModel;
|
|
77
66
|
// export class UserEntityModel implements IUserEntity {
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
|
+
// create a safe global reference
|
|
3
|
+
var __js_cols_global = typeof globalThis !== "undefined"
|
|
4
|
+
? globalThis
|
|
5
|
+
: typeof window !== "undefined"
|
|
6
|
+
? window
|
|
7
|
+
: typeof global !== "undefined"
|
|
8
|
+
? global
|
|
9
|
+
: this;
|
|
10
|
+
// reuse an existing global js_cols if present, otherwise create it
|
|
11
|
+
var js_cols = __js_cols_global.js_cols || {};
|
|
12
|
+
// Optionally set back the global for scripts that expect it
|
|
13
|
+
__js_cols_global.js_cols = js_cols;
|
|
2
14
|
//Copyright 2010 Thomas Stjernegaard Jeppesen. All Rights Reserved.
|
|
3
15
|
//Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
16
|
//you may not use this file except in compliance with the License.
|
|
@@ -19,5 +19,6 @@ export declare class DateUtil {
|
|
|
19
19
|
};
|
|
20
20
|
dateCodeFormatter(dateCode: string, formatter: string): string;
|
|
21
21
|
epochToDate(timestamp: number): Date;
|
|
22
|
+
getClosestEntityByDateCode<T extends Record<string, any>>(entities: T[], dateProperty: keyof T, targetDateCode: string): T | null;
|
|
22
23
|
}
|
|
23
24
|
export declare const dateUtil: DateUtil;
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.dateUtil = exports.DateUtil = void 0;
|
|
4
4
|
const date_fns_1 = require("date-fns");
|
|
5
|
+
const _enum_1 = require("../@enum");
|
|
6
|
+
const model_1 = require("../model");
|
|
5
7
|
class DateUtil {
|
|
6
8
|
constructor() {
|
|
7
9
|
this.convertMonthsToNumber = (months) => {
|
|
@@ -89,6 +91,48 @@ class DateUtil {
|
|
|
89
91
|
epochToDate(timestamp) {
|
|
90
92
|
return new Date(timestamp);
|
|
91
93
|
}
|
|
94
|
+
getClosestEntityByDateCode(entities, dateProperty, targetDateCode) {
|
|
95
|
+
// validate target date first
|
|
96
|
+
if (!DateUtil.isValidDate(targetDateCode)) {
|
|
97
|
+
throw new model_1.AppBadRequestException({
|
|
98
|
+
key: _enum_1.ErrorKeyEnum.DATE_CODE,
|
|
99
|
+
message: [`Invalid targetDateCode: ${targetDateCode}`],
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
if (!(entities === null || entities === void 0 ? void 0 : entities.length))
|
|
103
|
+
return null;
|
|
104
|
+
let closestPast = null;
|
|
105
|
+
let closestFuture = null;
|
|
106
|
+
for (const entity of entities) {
|
|
107
|
+
const rawDateCode = entity[dateProperty];
|
|
108
|
+
if (rawDateCode == null)
|
|
109
|
+
continue;
|
|
110
|
+
const entityDateCode = String(rawDateCode);
|
|
111
|
+
// validate entity date code
|
|
112
|
+
if (!DateUtil.isValidDate(entityDateCode)) {
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
115
|
+
// exact match
|
|
116
|
+
if (entityDateCode === targetDateCode) {
|
|
117
|
+
return entity;
|
|
118
|
+
}
|
|
119
|
+
// past date
|
|
120
|
+
if (entityDateCode < targetDateCode) {
|
|
121
|
+
if (!closestPast ||
|
|
122
|
+
entityDateCode > String(closestPast[dateProperty])) {
|
|
123
|
+
closestPast = entity;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
// future date
|
|
127
|
+
if (entityDateCode > targetDateCode) {
|
|
128
|
+
if (!closestFuture ||
|
|
129
|
+
entityDateCode < String(closestFuture[dateProperty])) {
|
|
130
|
+
closestFuture = entity;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return closestPast !== null && closestPast !== void 0 ? closestPast : closestFuture;
|
|
135
|
+
}
|
|
92
136
|
}
|
|
93
137
|
exports.DateUtil = DateUtil;
|
|
94
138
|
exports.dateUtil = new DateUtil();
|