ia-common 1.1.1-beta.0 → 1.1.1-beta.2
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/src/@enum.d.ts +1 -0
- package/build/src/@enum.js +1 -0
- package/build/src/enum/relation-type.enum.d.ts +4 -0
- package/build/src/enum/relation-type.enum.js +8 -0
- package/build/src/interface/api/advior-user-interface.d.ts +4 -0
- package/build/src/interface/api/{create-bank-details.interface.d.ts → bank-details-create-dto..interface.d.ts} +5 -2
- package/build/src/interface/api/bank-details-update.dto.interface.d.ts +24 -0
- package/build/src/interface/api/configuration-update-dto.interface.d.ts +13 -0
- package/build/src/interface/api/configurations-create-dto.interface.d.ts +3 -0
- package/build/src/interface/api/corporate-actions-create.dto.d.ts +7 -0
- package/build/src/interface/api/corporate-actions-update.dto.d.ts +19 -0
- package/build/src/interface/api/create-bulk-advice-using-csv.interface.d.ts +3 -3
- package/build/src/interface/api/create-corporate-action-advice.interface.d.ts +1 -1
- package/build/src/interface/api/create-user-dto.interface.d.ts +17 -0
- package/build/src/interface/api/create-user-dto.interface.js +8 -0
- package/build/src/interface/api/delete-bank-details-by-id.interface.d.ts +1 -5
- package/build/src/interface/api/{create-advice.interface.d.ts → equity-advice-create-dto.interface.d.ts} +4 -4
- package/build/src/interface/api/{update-advice.interface.d.ts → equity-advice-update-dto..d.ts} +3 -3
- package/build/src/interface/api/get-advice-by-id.interface.d.ts +2 -2
- package/build/src/interface/api/get-advice-by-ids-status.inteface.d.ts +2 -2
- package/build/src/interface/api/get-organization-by-id.interface.d.ts +2 -3
- package/build/src/interface/api/get-registration-by-id.interface.d.ts +5 -5
- package/build/src/interface/api/get-registration-with-organization-owners.interface.d.ts +3 -3
- package/build/src/interface/api/get-user-entities-by-advisor-id-type.interface.d.ts +1 -2
- package/build/src/interface/api/get-user-entities-by-filter.interface.d.ts +3 -0
- package/build/src/interface/api/index.d.ts +37 -55
- package/build/src/interface/api/index.js +37 -55
- package/build/src/interface/api/mutual-fund-advice-create-dto.interface.d.ts +13 -0
- package/build/src/interface/api/mutual-fund-advice-update-dto.interface.d.ts +11 -0
- package/build/src/interface/api/mutual-funds-create-dto.interface.d.ts +8 -0
- package/build/src/interface/api/nfo-advice-create-dto.interface.d.ts +13 -0
- package/build/src/interface/api/nfo-advice-update-dto.interface.d.ts +10 -0
- package/build/src/interface/api/nfo-create-dto.interface.d.ts +3 -0
- package/build/src/interface/api/organization-create-dto.interface.d.ts +5 -0
- package/build/src/interface/api/organization-update-dto.interface.d.ts +31 -0
- package/build/src/interface/api/{create-pricing-plan.interface.d.ts → pricing-plan-create.dto.interface.d.ts} +7 -1
- package/build/src/interface/api/pricing-plan-update-dto.interface.d.ts +22 -0
- package/build/src/interface/api/registration-create-dto.interface.d.ts +7 -0
- package/build/src/interface/api/registration-update-dto.interface.d.ts +9 -0
- package/build/src/interface/api/subscription-create.dto.interface.d.ts +10 -0
- package/build/src/interface/api/subscription-update.dto.interface.d.ts +13 -0
- package/build/src/interface/api/update-corporate-action-advice.interface.d.ts +1 -1
- package/build/src/interface/api/update-user-dto.interface.d.ts +6 -0
- package/build/src/interface/corporate-actions/buy-back-corporate-actions.interface.d.ts +1 -2
- package/build/src/interface/corporate-actions/create-bonus-stock.interface.d.ts +4 -0
- package/build/src/interface/corporate-actions/delisting-corporate-actions.interface.d.ts +1 -2
- package/build/src/interface/corporate-actions/dividend-corporate-actions.interface.d.ts +1 -2
- package/build/src/interface/corporate-actions/fpo-corporate-actions.interface.d.ts +1 -2
- package/build/src/interface/corporate-actions/index.d.ts +12 -0
- package/build/src/interface/corporate-actions/index.js +12 -0
- package/build/src/interface/corporate-actions/ipo-corporate-action.interface.d.ts +1 -2
- package/build/src/interface/corporate-actions/ofs-corporate-actions.interface.d.ts +1 -2
- package/build/src/interface/corporate-actions/open-offer-corporate-actions.interface.d.ts +1 -2
- package/build/src/interface/corporate-actions/right-issues-corporate-actions.interface.d.ts +1 -2
- package/build/src/interface/corporate-actions/split-bonus-corporate-action.interface.d.ts +7 -2
- package/build/src/interface/corporate-actions/split-stock-corporate-actions.interface.d.ts +1 -2
- package/build/src/interface/corporate-actions/update-bonus-stock.interface.d.ts +6 -0
- package/build/src/interface/corporate-actions/update-buy-back.interface.d.ts +6 -0
- package/build/src/interface/corporate-actions/update-delisting.interface.d.ts +5 -0
- package/build/src/interface/corporate-actions/update-dividend.interface.d.ts +6 -0
- package/build/src/interface/corporate-actions/update-fpo.interface.d.ts +6 -0
- package/build/src/interface/corporate-actions/update-ipo.interface.d.ts +6 -0
- package/build/src/interface/corporate-actions/update-ofs.interface.d.ts +6 -0
- package/build/src/interface/corporate-actions/update-open-offer.interface.d.ts +6 -0
- package/build/src/interface/corporate-actions/update-right-issue.interface.d.ts +6 -0
- package/build/src/interface/corporate-actions/update-split-bonus.interface.d.ts +6 -0
- package/build/src/interface/corporate-actions/update-split-stock.interface.d.ts +6 -0
- package/build/src/interface/entity/advice-entity.interface.d.ts +2 -5
- package/build/src/interface/entity/advisor-user-mapping-entity.interface.d.ts +3 -1
- package/build/src/interface/entity/bank-details-entity.interface.d.ts +5 -2
- package/build/src/interface/entity/configurations-entity.interface.d.ts +2 -2
- package/build/src/interface/entity/corporate-action-advice-entity.interface.d.ts +2 -2
- package/build/src/interface/entity/corporate-actions-entity.interface.d.ts +2 -2
- package/build/src/interface/entity/cron-job-entity.interface.d.ts +2 -1
- package/build/src/interface/entity/entity-utils.interface.d.ts +45 -7
- package/build/src/interface/entity/entity-utils.interface.js +15 -15
- package/build/src/interface/entity/index.d.ts +2 -1
- package/build/src/interface/entity/index.js +2 -1
- package/build/src/interface/entity/mutual-fund-advice-entity.interface.d.ts +5 -5
- package/build/src/interface/entity/mutual-funds-entity.interface.d.ts +11 -11
- package/build/src/interface/entity/{nfp-advice-entity.interface.d.ts → nfo-advice-entity.interface.d.ts} +3 -3
- package/build/src/interface/entity/nfo-entity.interface.d.ts +2 -2
- package/build/src/interface/entity/organization-entity.interface.d.ts +2 -2
- package/build/src/interface/entity/pricing-plan-entity.interface.d.ts +3 -3
- package/build/src/interface/entity/registration-entity.d.ts +2 -2
- package/build/src/interface/entity/relation-config.interface.d.ts +16 -0
- package/build/src/interface/entity/subscription-entity.interface.d.ts +2 -2
- package/build/src/interface/entity/user-entity.interface.d.ts +2 -2
- package/build/src/interface/update-user-info.interface.d.ts +4 -0
- package/build/src/model/advisor-user-mapping-entity-model.d.ts +16 -0
- package/build/src/model/advisor-user-mapping-entity-model.js +28 -0
- package/build/src/model/bank-details-entity-model.d.ts +8 -5
- package/build/src/model/bank-details-entity-model.js +51 -3
- package/build/src/model/base.entity.model.d.ts +7 -10
- package/build/src/model/base.entity.model.js +13 -16
- package/build/src/model/configurations-entity-model.d.ts +9 -6
- package/build/src/model/configurations-entity-model.js +49 -5
- package/build/src/model/corporate-actions/bonus-corporate-action-model.d.ts +2 -2
- package/build/src/model/corporate-actions/buy-back-corporate-action-model.d.ts +4 -4
- package/build/src/model/corporate-actions/corporate-action-model.d.ts +12 -6
- package/build/src/model/corporate-actions/corporate-action-model.js +78 -5
- package/build/src/model/corporate-actions/corporate-actions-advice-model.d.ts +25 -0
- package/build/src/model/corporate-actions/corporate-actions-advice-model.js +37 -0
- package/build/src/model/corporate-actions/delisting-corporate-action-model.d.ts +4 -4
- package/build/src/model/corporate-actions/dividend-corporate-action-model.d.ts +4 -4
- package/build/src/model/corporate-actions/fpo-corporate-action-model.d.ts +4 -4
- package/build/src/model/corporate-actions/ipo-corporate-action-model.d.ts +4 -4
- package/build/src/model/corporate-actions/ofs-corporate-action-model.d.ts +4 -4
- package/build/src/model/corporate-actions/open-offer-corporate-action-model.d.ts +4 -4
- package/build/src/model/corporate-actions/right-issue-corporate-action-model.d.ts +4 -4
- package/build/src/model/corporate-actions/split-bonus-corporate-action-model.d.ts +4 -4
- package/build/src/model/corporate-actions/split-corporate-action-model.d.ts +4 -4
- package/build/src/model/cron-jobs-entity-model.d.ts +23 -0
- package/build/src/model/cron-jobs-entity-model.js +34 -0
- package/build/src/model/equity-advice-entity-model.d.ts +3 -3
- package/build/src/model/index.d.ts +8 -2
- package/build/src/model/index.js +8 -2
- package/build/src/model/interface/entity.model.interface.d.ts +35 -11
- package/build/src/model/interface/entity.model.interface.js +178 -14
- package/build/src/model/mutual-fund-advice-entity.model.d.ts +27 -0
- package/build/src/model/mutual-fund-advice-entity.model.js +39 -0
- package/build/src/model/mutual-funds-entity.model.d.ts +28 -0
- package/build/src/model/mutual-funds-entity.model.js +40 -0
- package/build/src/model/nfo-advice-entity.model.d.ts +22 -0
- package/build/src/model/nfo-advice-entity.model.js +34 -0
- package/build/src/model/nfo-entity.model.d.ts +21 -0
- package/build/src/model/nfo-entity.model.js +33 -0
- package/build/src/model/organization-entity-model.d.ts +34 -8
- package/build/src/model/organization-entity-model.js +223 -29
- package/build/src/model/pricing-plan-entity-model.d.ts +7 -4
- package/build/src/model/pricing-plan-entity-model.js +12 -1
- package/build/src/model/pricing-plan-model.d.ts +6 -3
- package/build/src/model/pricing-plan-model.js +113 -9
- package/build/src/model/registration-entity-model.d.ts +23 -0
- package/build/src/model/registration-entity-model.js +55 -0
- package/build/src/model/subscription-entity-model.d.ts +15 -7
- package/build/src/model/subscription-entity-model.js +119 -11
- package/build/src/model/user-entity-model.d.ts +12 -7
- package/build/src/model/user-entity-model.js +108 -11
- package/build/src/utils/helper.fn.utils.d.ts +69 -0
- package/build/src/utils/helper.fn.utils.js +89 -1
- package/package.json +1 -1
- package/build/src/interface/api/add-mutual-funds.interface.d.ts +0 -8
- package/build/src/interface/api/create-bonus-stock.interface.d.ts +0 -6
- package/build/src/interface/api/create-buy-back-interface.d.ts +0 -6
- package/build/src/interface/api/create-client.interface.d.ts +0 -12
- package/build/src/interface/api/create-delisting.interface.d.ts +0 -6
- package/build/src/interface/api/create-dividend-interface.d.ts +0 -6
- package/build/src/interface/api/create-fpo.interface.d.ts +0 -6
- package/build/src/interface/api/create-ipo.interface.d.ts +0 -6
- package/build/src/interface/api/create-mutual-fund-advice.interface.d.ts +0 -17
- package/build/src/interface/api/create-nfo-advice.interface.d.ts +0 -13
- package/build/src/interface/api/create-nfo.interface.d.ts +0 -12
- package/build/src/interface/api/create-ofs.interface.d.ts +0 -6
- package/build/src/interface/api/create-open-offer.interface.d.ts +0 -6
- package/build/src/interface/api/create-registration.interface.d.ts +0 -9
- package/build/src/interface/api/create-right-issue.interface.d.ts +0 -6
- package/build/src/interface/api/create-split-bonus-stock.interface.d.ts +0 -6
- package/build/src/interface/api/create-split-stock.interface.d.ts +0 -6
- package/build/src/interface/api/create-staff-dto.d.ts +0 -9
- package/build/src/interface/api/create-subscription.interface.d.ts +0 -18
- package/build/src/interface/api/update-bank-details.interface.d.ts +0 -18
- package/build/src/interface/api/update-bonus-stock.interface.d.ts +0 -6
- package/build/src/interface/api/update-buy-back.interface.d.ts +0 -6
- package/build/src/interface/api/update-configuration.interface.d.ts +0 -10
- package/build/src/interface/api/update-delisting.interface.d.ts +0 -5
- package/build/src/interface/api/update-dividend.interface.d.ts +0 -6
- package/build/src/interface/api/update-fpo.interface.d.ts +0 -6
- package/build/src/interface/api/update-ipo.interface.d.ts +0 -6
- package/build/src/interface/api/update-nfo-advice.interface.d.ts +0 -14
- package/build/src/interface/api/update-ofs.interface.d.ts +0 -6
- package/build/src/interface/api/update-open-offer.interface.d.ts +0 -6
- package/build/src/interface/api/update-organization.interface.d.ts +0 -23
- package/build/src/interface/api/update-pricing-plan.interface.d.ts +0 -13
- package/build/src/interface/api/update-registration.interface.d.ts +0 -8
- package/build/src/interface/api/update-registration.interface.js +0 -2
- package/build/src/interface/api/update-right-issue.interface.d.ts +0 -6
- package/build/src/interface/api/update-split-bonus.interface.d.ts +0 -6
- package/build/src/interface/api/update-split-stock.interface.d.ts +0 -6
- package/build/src/interface/api/update-staff.dto.d.ts +0 -9
- package/build/src/interface/api/update-staff.dto.js +0 -2
- package/build/src/interface/api/update-subscription.interface.d.ts +0 -11
- package/build/src/interface/api/update-subscription.interface.js +0 -2
- package/build/src/interface/entity/nfp-advice-entity.interface.js +0 -2
- /package/build/src/interface/api/{add-mutual-funds.interface.js → advior-user-interface.js} +0 -0
- /package/build/src/interface/api/{create-advice.interface.js → bank-details-create-dto..interface.js} +0 -0
- /package/build/src/interface/api/{create-bank-details.interface.js → bank-details-update.dto.interface.js} +0 -0
- /package/build/src/interface/api/{create-bonus-stock.interface.js → configuration-update-dto.interface.js} +0 -0
- /package/build/src/interface/api/{create-buy-back-interface.js → configurations-create-dto.interface.js} +0 -0
- /package/build/src/interface/api/{create-client.interface.js → corporate-actions-create.dto.js} +0 -0
- /package/build/src/interface/api/{create-delisting.interface.js → corporate-actions-update.dto.js} +0 -0
- /package/build/src/interface/api/{create-dividend-interface.js → equity-advice-create-dto.interface.js} +0 -0
- /package/build/src/interface/api/{create-fpo.interface.js → equity-advice-update-dto..js} +0 -0
- /package/build/src/interface/api/{create-ipo.interface.js → get-user-entities-by-filter.interface.js} +0 -0
- /package/build/src/interface/api/{create-mutual-fund-advice.interface.js → mutual-fund-advice-create-dto.interface.js} +0 -0
- /package/build/src/interface/api/{create-nfo-advice.interface.js → mutual-fund-advice-update-dto.interface.js} +0 -0
- /package/build/src/interface/api/{create-nfo.interface.js → mutual-funds-create-dto.interface.js} +0 -0
- /package/build/src/interface/api/{create-ofs.interface.js → nfo-advice-create-dto.interface.js} +0 -0
- /package/build/src/interface/api/{create-open-offer.interface.js → nfo-advice-update-dto.interface.js} +0 -0
- /package/build/src/interface/api/{create-pricing-plan.interface.js → nfo-create-dto.interface.js} +0 -0
- /package/build/src/interface/api/{create-registration.interface.js → organization-create-dto.interface.js} +0 -0
- /package/build/src/interface/api/{create-right-issue.interface.js → organization-update-dto.interface.js} +0 -0
- /package/build/src/interface/api/{create-split-bonus-stock.interface.js → pricing-plan-create.dto.interface.js} +0 -0
- /package/build/src/interface/api/{create-split-stock.interface.js → pricing-plan-update-dto.interface.js} +0 -0
- /package/build/src/interface/api/{create-staff-dto.js → registration-create-dto.interface.js} +0 -0
- /package/build/src/interface/api/{create-subscription.interface.js → registration-update-dto.interface.js} +0 -0
- /package/build/src/interface/api/{update-advice.interface.js → subscription-create.dto.interface.js} +0 -0
- /package/build/src/interface/api/{update-bank-details.interface.js → subscription-update.dto.interface.js} +0 -0
- /package/build/src/interface/api/{update-bonus-stock.interface.js → update-user-dto.interface.js} +0 -0
- /package/build/src/interface/{api/update-buy-back.interface.js → corporate-actions/create-bonus-stock.interface.js} +0 -0
- /package/build/src/interface/{api/update-configuration.interface.js → corporate-actions/update-bonus-stock.interface.js} +0 -0
- /package/build/src/interface/{api/update-delisting.interface.js → corporate-actions/update-buy-back.interface.js} +0 -0
- /package/build/src/interface/{api/update-dividend.interface.js → corporate-actions/update-delisting.interface.js} +0 -0
- /package/build/src/interface/{api/update-fpo.interface.js → corporate-actions/update-dividend.interface.js} +0 -0
- /package/build/src/interface/{api/update-ipo.interface.js → corporate-actions/update-fpo.interface.js} +0 -0
- /package/build/src/interface/{api/update-nfo-advice.interface.js → corporate-actions/update-ipo.interface.js} +0 -0
- /package/build/src/interface/{api → corporate-actions}/update-ofs.interface.js +0 -0
- /package/build/src/interface/{api → corporate-actions}/update-open-offer.interface.js +0 -0
- /package/build/src/interface/{api → corporate-actions}/update-right-issue.interface.js +0 -0
- /package/build/src/interface/{api → corporate-actions}/update-split-bonus.interface.js +0 -0
- /package/build/src/interface/{api → corporate-actions}/update-split-stock.interface.js +0 -0
- /package/build/src/interface/{api/update-organization.interface.js → entity/nfo-advice-entity.interface.js} +0 -0
- /package/build/src/interface/{api/update-pricing-plan.interface.js → entity/relation-config.interface.js} +0 -0
|
@@ -1,9 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseEntitiesWithoutModels = exports.entityEnumToEntityModel = exports.parseEntities = exports.populateRelationsFor = exports.
|
|
3
|
+
exports.EntityModelRelationHelper = exports.removeEntityById = exports.entityModelMapToEntityModelIndexMap = exports.entityMapToEntityModelMap = exports.parseEntitiesWithoutModels = exports.entityEnumToEntityModel = exports.parseEntities = exports.populateRelationsFor = exports.getEntityModelIndexMap = exports.mapToIndex = void 0;
|
|
4
4
|
const _type_1 = require("../../@type");
|
|
5
|
+
const advisor_user_mapping_entity_model_1 = require("../advisor-user-mapping-entity-model");
|
|
6
|
+
const bank_details_entity_model_1 = require("../bank-details-entity-model");
|
|
5
7
|
const base_entity_model_1 = require("../base.entity.model");
|
|
8
|
+
const configurations_entity_model_1 = require("../configurations-entity-model");
|
|
9
|
+
const corporate_action_model_1 = require("../corporate-actions/corporate-action-model");
|
|
10
|
+
const corporate_actions_advice_model_1 = require("../corporate-actions/corporate-actions-advice-model");
|
|
11
|
+
const cron_jobs_entity_model_1 = require("../cron-jobs-entity-model");
|
|
6
12
|
const equity_advice_entity_model_1 = require("../equity-advice-entity-model");
|
|
13
|
+
const mutual_fund_advice_entity_model_1 = require("../mutual-fund-advice-entity.model");
|
|
14
|
+
const mutual_funds_entity_model_1 = require("../mutual-funds-entity.model");
|
|
15
|
+
const nfo_advice_entity_model_1 = require("../nfo-advice-entity.model");
|
|
16
|
+
const nfo_entity_model_1 = require("../nfo-entity.model");
|
|
17
|
+
const organization_entity_model_1 = require("../organization-entity-model");
|
|
18
|
+
const pricing_plan_entity_model_1 = require("../pricing-plan-entity-model");
|
|
19
|
+
const registration_entity_model_1 = require("../registration-entity-model");
|
|
20
|
+
const subscription_entity_model_1 = require("../subscription-entity-model");
|
|
21
|
+
const user_entity_model_1 = require("../user-entity-model");
|
|
7
22
|
function mapToIndex(entityMap) {
|
|
8
23
|
return Object.keys(entityMap).reduce((acc, key) => {
|
|
9
24
|
// @ts-ignore
|
|
@@ -15,9 +30,11 @@ function mapToIndex(entityMap) {
|
|
|
15
30
|
}, {});
|
|
16
31
|
}
|
|
17
32
|
exports.mapToIndex = mapToIndex;
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
|
|
33
|
+
function getEntityModelIndexMap(data,
|
|
34
|
+
// baseEntity: T,
|
|
35
|
+
reusedConfig) {
|
|
36
|
+
const entityMap = data;
|
|
37
|
+
// parseEntities(data, baseEntity, entityMap);
|
|
21
38
|
const entityIndexMap = mapToIndex(entityMap);
|
|
22
39
|
if (reusedConfig) {
|
|
23
40
|
for (const entity of reusedConfig.enumEntities) {
|
|
@@ -27,22 +44,37 @@ function getEntityIndexMap(data, baseEntity, reusedConfig) {
|
|
|
27
44
|
}
|
|
28
45
|
return entityIndexMap;
|
|
29
46
|
}
|
|
30
|
-
exports.
|
|
31
|
-
function populateRelationsFor(
|
|
47
|
+
exports.getEntityModelIndexMap = getEntityModelIndexMap;
|
|
48
|
+
function populateRelationsFor(entityModelIndexMap, enumEntities) {
|
|
32
49
|
enumEntities.forEach((entity) => {
|
|
33
|
-
base_entity_model_1.BaseEntityModel.populateRelationsForEntities(
|
|
50
|
+
base_entity_model_1.BaseEntityModel.populateRelationsForEntities(entityModelIndexMap, entity);
|
|
34
51
|
});
|
|
35
52
|
}
|
|
36
53
|
exports.populateRelationsFor = populateRelationsFor;
|
|
37
|
-
function parseEntities(json, baseEntity,
|
|
54
|
+
function parseEntities(json, baseEntity, entityModelMap) {
|
|
38
55
|
var _a;
|
|
39
56
|
const entityFromJsonMappings = {
|
|
40
57
|
[_type_1.EntityEnum.EQUITY_ADVICE]: equity_advice_entity_model_1.EquityAdviceEntityModel.fromEntity,
|
|
58
|
+
[_type_1.EntityEnum.BANK_DETAIL]: bank_details_entity_model_1.BankDetailsEntityModel.fromEntity,
|
|
59
|
+
[_type_1.EntityEnum.PRICING_PLAN]: pricing_plan_entity_model_1.PricingPlanEntityModel.fromEntity,
|
|
60
|
+
[_type_1.EntityEnum.SUBSCRIPTION]: subscription_entity_model_1.SubscriptionEntityModel.fromEntity,
|
|
61
|
+
[_type_1.EntityEnum.ORGANIZATION]: organization_entity_model_1.OrganizationEntityModel.fromEntity,
|
|
62
|
+
[_type_1.EntityEnum.REGISTRATION]: registration_entity_model_1.RegistrationEntityModel.fromEntity,
|
|
63
|
+
[_type_1.EntityEnum.USER]: user_entity_model_1.UserEntityModel.fromEntity,
|
|
64
|
+
[_type_1.EntityEnum.ADVISOR_USER_MAPPING]: advisor_user_mapping_entity_model_1.AdvisorUserMappingEntityModel.fromEntity,
|
|
65
|
+
[_type_1.EntityEnum.MUTUAL_FUNDS]: mutual_funds_entity_model_1.MutualFundEntityModel.fromEntity,
|
|
66
|
+
[_type_1.EntityEnum.MUTUAL_FUND_ADVICE]: mutual_fund_advice_entity_model_1.MutualFundAdviceEntityModel.fromEntity,
|
|
67
|
+
[_type_1.EntityEnum.NFO]: nfo_entity_model_1.NFOEntityModel.fromEntity,
|
|
68
|
+
[_type_1.EntityEnum.NFO_ADVICE]: nfo_advice_entity_model_1.NFOAdviceEntityModel.fromEntity,
|
|
69
|
+
[_type_1.EntityEnum.CORPORATE_ACTIONS]: corporate_action_model_1.CorporateActionsEntityModel.fromEntity,
|
|
70
|
+
[_type_1.EntityEnum.CORPORATE_ACTIONS_ADVICE]: corporate_actions_advice_model_1.CorporateActionsAdviceEntityModel.fromEntity,
|
|
71
|
+
[_type_1.EntityEnum.CONFIGURATION]: configurations_entity_model_1.ConfigurationsEntityModel.fromEntity,
|
|
72
|
+
[_type_1.EntityEnum.CRON_JOBS]: cron_jobs_entity_model_1.CronJobsEntityModel.fromEntity,
|
|
41
73
|
};
|
|
42
74
|
if (!(baseEntity in entityFromJsonMappings)) {
|
|
43
75
|
throw new Error(`Unknown entity: ${baseEntity}`);
|
|
44
76
|
}
|
|
45
|
-
|
|
77
|
+
entityModelMap[baseEntity] = ((_a = json["baseEntities"]) !== null && _a !== void 0 ? _a : []).map(
|
|
46
78
|
// REVIEW: Needs to be fixed after audit column type conversion
|
|
47
79
|
(e) => entityFromJsonMappings[baseEntity](e));
|
|
48
80
|
if (json["relatedEntities"]) {
|
|
@@ -50,14 +82,29 @@ function parseEntities(json, baseEntity, entityMap) {
|
|
|
50
82
|
for (const entityName in relatedEntities) {
|
|
51
83
|
parseEntities(
|
|
52
84
|
// @ts-ignore
|
|
53
|
-
relatedEntities[entityName], entityName,
|
|
85
|
+
relatedEntities[entityName], entityName, entityModelMap);
|
|
54
86
|
}
|
|
55
87
|
}
|
|
56
|
-
return
|
|
88
|
+
return entityModelMap;
|
|
57
89
|
}
|
|
58
90
|
exports.parseEntities = parseEntities;
|
|
59
91
|
exports.entityEnumToEntityModel = {
|
|
60
92
|
[_type_1.EntityEnum.EQUITY_ADVICE]: equity_advice_entity_model_1.EquityAdviceEntityModel.fromEntity,
|
|
93
|
+
[_type_1.EntityEnum.BANK_DETAIL]: bank_details_entity_model_1.BankDetailsEntityModel.fromEntity,
|
|
94
|
+
[_type_1.EntityEnum.PRICING_PLAN]: pricing_plan_entity_model_1.PricingPlanEntityModel.fromEntity,
|
|
95
|
+
[_type_1.EntityEnum.SUBSCRIPTION]: subscription_entity_model_1.SubscriptionEntityModel.fromEntity,
|
|
96
|
+
[_type_1.EntityEnum.ORGANIZATION]: organization_entity_model_1.OrganizationEntityModel.fromEntity,
|
|
97
|
+
[_type_1.EntityEnum.REGISTRATION]: registration_entity_model_1.RegistrationEntityModel.fromEntity,
|
|
98
|
+
[_type_1.EntityEnum.USER]: user_entity_model_1.UserEntityModel.fromEntity,
|
|
99
|
+
[_type_1.EntityEnum.ADVISOR_USER_MAPPING]: advisor_user_mapping_entity_model_1.AdvisorUserMappingEntityModel.fromEntity,
|
|
100
|
+
[_type_1.EntityEnum.MUTUAL_FUNDS]: mutual_funds_entity_model_1.MutualFundEntityModel.fromEntity,
|
|
101
|
+
[_type_1.EntityEnum.MUTUAL_FUND_ADVICE]: mutual_fund_advice_entity_model_1.MutualFundAdviceEntityModel.fromEntity,
|
|
102
|
+
[_type_1.EntityEnum.NFO]: nfo_entity_model_1.NFOEntityModel.fromEntity,
|
|
103
|
+
[_type_1.EntityEnum.NFO_ADVICE]: nfo_advice_entity_model_1.NFOAdviceEntityModel.fromEntity,
|
|
104
|
+
[_type_1.EntityEnum.CORPORATE_ACTIONS]: corporate_action_model_1.CorporateActionsEntityModel.fromEntity,
|
|
105
|
+
[_type_1.EntityEnum.CORPORATE_ACTIONS_ADVICE]: corporate_actions_advice_model_1.CorporateActionsAdviceEntityModel.fromEntity,
|
|
106
|
+
[_type_1.EntityEnum.CONFIGURATION]: configurations_entity_model_1.ConfigurationsEntityModel.fromEntity,
|
|
107
|
+
[_type_1.EntityEnum.CRON_JOBS]: cron_jobs_entity_model_1.CronJobsEntityModel.fromEntity,
|
|
61
108
|
};
|
|
62
109
|
function parseEntitiesWithoutModels(json, baseEntity, entityMap = {}) {
|
|
63
110
|
var _a;
|
|
@@ -68,11 +115,128 @@ function parseEntitiesWithoutModels(json, baseEntity, entityMap = {}) {
|
|
|
68
115
|
if (json["relatedEntities"]) {
|
|
69
116
|
const relatedEntities = json["relatedEntities"];
|
|
70
117
|
for (const entityName in relatedEntities) {
|
|
71
|
-
parseEntitiesWithoutModels(
|
|
72
|
-
// @ts-ignore
|
|
73
|
-
relatedEntities[entityName], entityName, entityMap);
|
|
118
|
+
parseEntitiesWithoutModels(relatedEntities[entityName], entityName, entityMap);
|
|
74
119
|
}
|
|
75
120
|
}
|
|
76
121
|
return entityMap;
|
|
77
122
|
}
|
|
78
123
|
exports.parseEntitiesWithoutModels = parseEntitiesWithoutModels;
|
|
124
|
+
function entityMapToEntityModelMap(entityMap) {
|
|
125
|
+
var _a;
|
|
126
|
+
const entityModelMap = {};
|
|
127
|
+
for (const entityName in entityMap) {
|
|
128
|
+
if (!(entityName in exports.entityEnumToEntityModel)) {
|
|
129
|
+
throw new Error(`Unknown entity: ${entityName}`);
|
|
130
|
+
}
|
|
131
|
+
const entities = (_a = entityMap[entityName]) !== null && _a !== void 0 ? _a : [];
|
|
132
|
+
entityModelMap[entityName] = entities.map((entity) => exports.entityEnumToEntityModel[entityName](entity));
|
|
133
|
+
// entityMap[entityName as EntityEnum] = entityMap[
|
|
134
|
+
// entityName as EntityEnum
|
|
135
|
+
// ]?.map(
|
|
136
|
+
// (entity: any) =>
|
|
137
|
+
// // @ts-ignore
|
|
138
|
+
// entityEnumToEntityModel[entityName as EntityEnum]!(entity) as any
|
|
139
|
+
// );
|
|
140
|
+
}
|
|
141
|
+
return entityModelMap;
|
|
142
|
+
}
|
|
143
|
+
exports.entityMapToEntityModelMap = entityMapToEntityModelMap;
|
|
144
|
+
function entityModelMapToEntityModelIndexMap(entityModelMap, entityRelationsFor) {
|
|
145
|
+
const entityModelMapFromEntityMap = entityMapToEntityModelMap(entityModelMap);
|
|
146
|
+
const entityModelIndexMap = mapToIndex(entityModelMapFromEntityMap);
|
|
147
|
+
populateRelationsFor(entityModelIndexMap, entityRelationsFor);
|
|
148
|
+
return entityModelIndexMap;
|
|
149
|
+
}
|
|
150
|
+
exports.entityModelMapToEntityModelIndexMap = entityModelMapToEntityModelIndexMap;
|
|
151
|
+
function removeEntityById(entityModelIndexMap, entity, id) {
|
|
152
|
+
if (entityModelIndexMap[entity]) {
|
|
153
|
+
delete entityModelIndexMap[entity][id];
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
exports.removeEntityById = removeEntityById;
|
|
157
|
+
class EntityModelRelationHelper {
|
|
158
|
+
constructor(entityMap) {
|
|
159
|
+
this.entityMap = entityMap;
|
|
160
|
+
this.entityModelMap = {};
|
|
161
|
+
this.entityModelIndexMap = {};
|
|
162
|
+
this.init();
|
|
163
|
+
}
|
|
164
|
+
init() {
|
|
165
|
+
this.toEntityModelMap();
|
|
166
|
+
this.toEntityModelIndexMap();
|
|
167
|
+
}
|
|
168
|
+
toEntityModelMap() {
|
|
169
|
+
for (const entityName in this.entityMap) {
|
|
170
|
+
if (!(entityName in exports.entityEnumToEntityModel)) {
|
|
171
|
+
throw new Error(`Unknown entity: ${entityName}`);
|
|
172
|
+
}
|
|
173
|
+
// @ts-ignore
|
|
174
|
+
this.entityModelMap[entityName] = this.entityMap[entityName].map((entity) => exports.entityEnumToEntityModel[entityName](entity));
|
|
175
|
+
}
|
|
176
|
+
return this;
|
|
177
|
+
}
|
|
178
|
+
fromEntityToEntityModel(entity, entityEnum) {
|
|
179
|
+
if (!(entityEnum in exports.entityEnumToEntityModel)) {
|
|
180
|
+
throw new Error(`Unknown entity: ${entityEnum}`);
|
|
181
|
+
}
|
|
182
|
+
return exports.entityEnumToEntityModel[entityEnum](entity);
|
|
183
|
+
}
|
|
184
|
+
toEntityModelIndexMap() {
|
|
185
|
+
this.entityModelIndexMap = Object.keys(this.entityModelMap).reduce((acc, key) => {
|
|
186
|
+
// @ts-ignore
|
|
187
|
+
acc[key] = this.entityModelMap[key].reduce((innerAcc, entity) => {
|
|
188
|
+
innerAcc[entity.id] = entity;
|
|
189
|
+
return innerAcc;
|
|
190
|
+
}, {});
|
|
191
|
+
return acc;
|
|
192
|
+
}, {});
|
|
193
|
+
return this;
|
|
194
|
+
}
|
|
195
|
+
populateRelationsByEntityEnums(entityEnums) {
|
|
196
|
+
entityEnums.forEach((entityEnum) => {
|
|
197
|
+
this.populateRelationsByEntityEnum(entityEnum);
|
|
198
|
+
});
|
|
199
|
+
return this;
|
|
200
|
+
}
|
|
201
|
+
populateRelationsByEntityEnum(entityEnum) {
|
|
202
|
+
for (const key of Object.keys(this.entityModelIndexMap[entityEnum] || {})) {
|
|
203
|
+
const entityModel = this
|
|
204
|
+
.entityModelIndexMap[entityEnum][key];
|
|
205
|
+
entityModel.populateRelationsByIndex(this.entityModelIndexMap);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
populateRelationsByEntityModel(entityModel) {
|
|
209
|
+
entityModel.populateRelationsByIndex(this.entityModelIndexMap);
|
|
210
|
+
}
|
|
211
|
+
addEntityModel(entityModel, config = { populateRelations: false }) {
|
|
212
|
+
const entityEnum = entityModel.entityName;
|
|
213
|
+
this.entityModelIndexMap[entityEnum] =
|
|
214
|
+
this.entityModelIndexMap[entityEnum] || {};
|
|
215
|
+
// @ts-ignore
|
|
216
|
+
this.entityModelIndexMap[entityEnum][entityModel.id] =
|
|
217
|
+
// @ts-ignore
|
|
218
|
+
entityModel;
|
|
219
|
+
if (config.populateRelations) {
|
|
220
|
+
this.populateRelationsByEntityModel(entityModel);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
addEntity(entity, entityEnum, config = { populateRelations: false }) {
|
|
224
|
+
if (!(entityEnum in exports.entityEnumToEntityModel)) {
|
|
225
|
+
throw new Error(`Unknown entity: ${entityEnum}`);
|
|
226
|
+
}
|
|
227
|
+
this.addEntityModel(this.fromEntityToEntityModel(entity, entityEnum), config);
|
|
228
|
+
}
|
|
229
|
+
updateEntityModel(entityModel, config = { populateRelations: false }) {
|
|
230
|
+
const entityEnum = entityModel.entityName;
|
|
231
|
+
this.entityModelIndexMap[entityEnum] =
|
|
232
|
+
this.entityModelIndexMap[entityEnum] || {};
|
|
233
|
+
// @ts-ignore
|
|
234
|
+
this.entityModelIndexMap[entityEnum][entityModel.id] =
|
|
235
|
+
// @ts-ignore
|
|
236
|
+
entityModel;
|
|
237
|
+
if (config.populateRelations) {
|
|
238
|
+
this.populateRelationsByEntityModel(entityModel);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
exports.EntityModelRelationHelper = EntityModelRelationHelper;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { MutualFundAdviceDuration, MutualFundStatus, MutualFundTransactionType } from "../@enum";
|
|
2
|
+
import { EntityEnum, IMutualFundAdviceEntity } from "../@type";
|
|
3
|
+
import { BaseEntityModel } from "./base.entity.model";
|
|
4
|
+
export declare class MutualFundAdviceEntityModel extends BaseEntityModel<EntityEnum.MUTUAL_FUND_ADVICE> implements IMutualFundAdviceEntity {
|
|
5
|
+
id: number;
|
|
6
|
+
schemeName: string;
|
|
7
|
+
navRegular?: number | undefined;
|
|
8
|
+
navDirect: number | undefined;
|
|
9
|
+
transactionType: MutualFundTransactionType;
|
|
10
|
+
investmentDuration: MutualFundAdviceDuration;
|
|
11
|
+
switchFrom: string | null;
|
|
12
|
+
rationale?: string | undefined;
|
|
13
|
+
noteDocumentUrl: string | null;
|
|
14
|
+
videoUrl: string | null;
|
|
15
|
+
voiceUrl: string | null;
|
|
16
|
+
startDate: number;
|
|
17
|
+
endDate: number;
|
|
18
|
+
advisorOrgId: number;
|
|
19
|
+
status: MutualFundStatus;
|
|
20
|
+
createdOn: number;
|
|
21
|
+
updatedOn: number;
|
|
22
|
+
createdBy: number;
|
|
23
|
+
updatedBy: number;
|
|
24
|
+
constructor();
|
|
25
|
+
static fromEntity(entity: IMutualFundAdviceEntity): MutualFundAdviceEntityModel;
|
|
26
|
+
getRelationConfigs(): any;
|
|
27
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MutualFundAdviceEntityModel = void 0;
|
|
4
|
+
const _enum_1 = require("../@enum");
|
|
5
|
+
const _type_1 = require("../@type");
|
|
6
|
+
const base_entity_model_1 = require("./base.entity.model");
|
|
7
|
+
class MutualFundAdviceEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(_type_1.EntityEnum.MUTUAL_FUND_ADVICE);
|
|
10
|
+
this.id = 0;
|
|
11
|
+
this.schemeName = "";
|
|
12
|
+
this.navRegular = 0;
|
|
13
|
+
this.navDirect = 0;
|
|
14
|
+
this.transactionType = _enum_1.MutualFundTransactionType.BUY;
|
|
15
|
+
this.investmentDuration = _enum_1.MutualFundAdviceDuration.SHORT;
|
|
16
|
+
this.switchFrom = null;
|
|
17
|
+
this.rationale = "";
|
|
18
|
+
this.noteDocumentUrl = null;
|
|
19
|
+
this.videoUrl = null;
|
|
20
|
+
this.voiceUrl = null;
|
|
21
|
+
this.startDate = 0;
|
|
22
|
+
this.endDate = 0;
|
|
23
|
+
this.advisorOrgId = 0;
|
|
24
|
+
this.status = _enum_1.MutualFundStatus.ACTIVE;
|
|
25
|
+
this.createdOn = 0;
|
|
26
|
+
this.updatedOn = 0;
|
|
27
|
+
this.createdBy = 0;
|
|
28
|
+
this.updatedBy = 0;
|
|
29
|
+
}
|
|
30
|
+
static fromEntity(entity) {
|
|
31
|
+
const result = new MutualFundAdviceEntityModel();
|
|
32
|
+
Object.assign(result, entity);
|
|
33
|
+
return result;
|
|
34
|
+
}
|
|
35
|
+
getRelationConfigs() {
|
|
36
|
+
return this.constructor.prototype.constructor.relationConfigs;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.MutualFundAdviceEntityModel = MutualFundAdviceEntityModel;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { MutualFundsType } from "../../@enum";
|
|
2
|
+
import { EntityEnum, IMutualFundsEntity } from "../../@type";
|
|
3
|
+
import { BaseEntityModel } from "./base.entity.model";
|
|
4
|
+
export declare class MutualFundEntityModel extends BaseEntityModel<EntityEnum.MUTUAL_FUNDS> implements IMutualFundsEntity {
|
|
5
|
+
id: number;
|
|
6
|
+
schemeName: string;
|
|
7
|
+
risk: string;
|
|
8
|
+
navRegular: number;
|
|
9
|
+
navDirect: number;
|
|
10
|
+
oneYearReturnRegular: number;
|
|
11
|
+
oneYearReturnDirect: number;
|
|
12
|
+
threeYearReturnRegular: number;
|
|
13
|
+
threeYearReturnDirect: number;
|
|
14
|
+
fiveYearReturnRegular: number;
|
|
15
|
+
fiveYearReturnDirect: number;
|
|
16
|
+
dailyAUM: number;
|
|
17
|
+
type: MutualFundsType;
|
|
18
|
+
createdOn: number;
|
|
19
|
+
updatedOn: number;
|
|
20
|
+
createdBy: number;
|
|
21
|
+
updatedBy: number;
|
|
22
|
+
constructor();
|
|
23
|
+
/**
|
|
24
|
+
* Factory: Convert API entity → model
|
|
25
|
+
*/
|
|
26
|
+
static fromEntity(entity: IMutualFundsEntity): MutualFundEntityModel;
|
|
27
|
+
getRelationConfigs(): any;
|
|
28
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MutualFundEntityModel = void 0;
|
|
4
|
+
const _enum_1 = require("../../@enum");
|
|
5
|
+
const _type_1 = require("../../@type");
|
|
6
|
+
const base_entity_model_1 = require("./base.entity.model");
|
|
7
|
+
class MutualFundEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(_type_1.EntityEnum.MUTUAL_FUNDS);
|
|
10
|
+
this.id = 0;
|
|
11
|
+
this.schemeName = "";
|
|
12
|
+
this.risk = "";
|
|
13
|
+
this.navRegular = 0;
|
|
14
|
+
this.navDirect = 0;
|
|
15
|
+
this.oneYearReturnRegular = 0;
|
|
16
|
+
this.oneYearReturnDirect = 0;
|
|
17
|
+
this.threeYearReturnRegular = 0;
|
|
18
|
+
this.threeYearReturnDirect = 0;
|
|
19
|
+
this.fiveYearReturnRegular = 0;
|
|
20
|
+
this.fiveYearReturnDirect = 0;
|
|
21
|
+
this.dailyAUM = 0;
|
|
22
|
+
this.type = _enum_1.MutualFundsType.DEBT;
|
|
23
|
+
this.createdOn = 0;
|
|
24
|
+
this.updatedOn = 0;
|
|
25
|
+
this.createdBy = 0;
|
|
26
|
+
this.updatedBy = 0;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Factory: Convert API entity → model
|
|
30
|
+
*/
|
|
31
|
+
static fromEntity(entity) {
|
|
32
|
+
const result = new MutualFundEntityModel();
|
|
33
|
+
Object.assign(result, entity);
|
|
34
|
+
return result;
|
|
35
|
+
}
|
|
36
|
+
getRelationConfigs() {
|
|
37
|
+
return this.constructor.prototype.constructor.relationConfigs;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.MutualFundEntityModel = MutualFundEntityModel;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { NFOAdviceStatus, NFOAdviceTransactionType } from "../../@enum";
|
|
2
|
+
import { EntityEnum, INFOAdviceEntity } from "../../@type";
|
|
3
|
+
import { BaseEntityModel } from "./base.entity.model";
|
|
4
|
+
export declare class NFOAdviceEntityModel extends BaseEntityModel<EntityEnum.NFO_ADVICE> implements INFOAdviceEntity {
|
|
5
|
+
id: number;
|
|
6
|
+
nfoId: number;
|
|
7
|
+
mutualFundName: string;
|
|
8
|
+
advisorOrgId: number;
|
|
9
|
+
transactionType: NFOAdviceTransactionType;
|
|
10
|
+
rationale?: string | undefined;
|
|
11
|
+
noteDocumentUrl: string | null;
|
|
12
|
+
videoUrl: string | null;
|
|
13
|
+
voiceUrl: string | null;
|
|
14
|
+
status: NFOAdviceStatus;
|
|
15
|
+
createdOn: number;
|
|
16
|
+
updatedOn: number;
|
|
17
|
+
createdBy: number;
|
|
18
|
+
updatedBy: number;
|
|
19
|
+
constructor();
|
|
20
|
+
static fromEntity(entity: INFOAdviceEntity): NFOAdviceEntityModel;
|
|
21
|
+
getRelationConfigs(): any;
|
|
22
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NFOAdviceEntityModel = void 0;
|
|
4
|
+
const _enum_1 = require("../../@enum");
|
|
5
|
+
const _type_1 = require("../../@type");
|
|
6
|
+
const base_entity_model_1 = require("./base.entity.model");
|
|
7
|
+
class NFOAdviceEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(_type_1.EntityEnum.NFO_ADVICE);
|
|
10
|
+
this.id = 0;
|
|
11
|
+
this.nfoId = 0;
|
|
12
|
+
this.mutualFundName = "";
|
|
13
|
+
this.advisorOrgId = 0;
|
|
14
|
+
this.transactionType = _enum_1.NFOAdviceTransactionType.AVOID;
|
|
15
|
+
this.rationale = "";
|
|
16
|
+
this.noteDocumentUrl = null;
|
|
17
|
+
this.videoUrl = null;
|
|
18
|
+
this.voiceUrl = null;
|
|
19
|
+
this.status = _enum_1.NFOAdviceStatus.ACTIVE;
|
|
20
|
+
this.createdOn = 0;
|
|
21
|
+
this.updatedOn = 0;
|
|
22
|
+
this.createdBy = 0;
|
|
23
|
+
this.updatedBy = 0;
|
|
24
|
+
}
|
|
25
|
+
static fromEntity(entity) {
|
|
26
|
+
const result = new NFOAdviceEntityModel();
|
|
27
|
+
Object.assign(result, entity);
|
|
28
|
+
return result;
|
|
29
|
+
}
|
|
30
|
+
getRelationConfigs() {
|
|
31
|
+
return this.constructor.prototype.constructor.relationConfigs;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.NFOAdviceEntityModel = NFOAdviceEntityModel;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { MutualFundsType } from "../../@enum";
|
|
2
|
+
import { EntityEnum, INFOEntity } from "../../@type";
|
|
3
|
+
import { BaseEntityModel } from "./base.entity.model";
|
|
4
|
+
export declare class NFOEntityModel extends BaseEntityModel<EntityEnum.NFO> implements INFOEntity {
|
|
5
|
+
id: number;
|
|
6
|
+
mutualFundName: string;
|
|
7
|
+
type: MutualFundsType;
|
|
8
|
+
startDateCode: number;
|
|
9
|
+
endDateCode: number;
|
|
10
|
+
risk: string;
|
|
11
|
+
createdOn: number;
|
|
12
|
+
updatedOn: number;
|
|
13
|
+
createdBy: number;
|
|
14
|
+
updatedBy: number;
|
|
15
|
+
constructor();
|
|
16
|
+
/**
|
|
17
|
+
* Factory: Convert API response → model instance
|
|
18
|
+
*/
|
|
19
|
+
static fromEntity(entity: INFOEntity): NFOEntityModel;
|
|
20
|
+
getRelationConfigs(): any;
|
|
21
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NFOEntityModel = void 0;
|
|
4
|
+
const _enum_1 = require("../../@enum");
|
|
5
|
+
const _type_1 = require("../../@type");
|
|
6
|
+
const base_entity_model_1 = require("./base.entity.model");
|
|
7
|
+
class NFOEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(_type_1.EntityEnum.NFO);
|
|
10
|
+
this.id = 0;
|
|
11
|
+
this.mutualFundName = "";
|
|
12
|
+
this.type = _enum_1.MutualFundsType.EQUITY;
|
|
13
|
+
this.startDateCode = 0;
|
|
14
|
+
this.endDateCode = 0;
|
|
15
|
+
this.risk = "";
|
|
16
|
+
this.createdOn = 0;
|
|
17
|
+
this.updatedOn = 0;
|
|
18
|
+
this.createdBy = 0;
|
|
19
|
+
this.updatedBy = 0;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Factory: Convert API response → model instance
|
|
23
|
+
*/
|
|
24
|
+
static fromEntity(entity) {
|
|
25
|
+
const result = new NFOEntityModel();
|
|
26
|
+
Object.assign(result, entity);
|
|
27
|
+
return result;
|
|
28
|
+
}
|
|
29
|
+
getRelationConfigs() {
|
|
30
|
+
return this.constructor.prototype.constructor.relationConfigs;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.NFOEntityModel = NFOEntityModel;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { OrganizationStatus, OrganizationType } from "../@enum";
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { RegistrationEntityModel, UserEntityModel } from "../@model";
|
|
3
|
+
import { EntityEnum, EnumEntityType, IOrganizationEntity, RelationConfigs } from "../@type";
|
|
4
|
+
import { BaseEntityModel } from "./base.entity.model";
|
|
5
|
+
export declare class OrganizationEntityModel extends BaseEntityModel<EntityEnum.ORGANIZATION> implements IOrganizationEntity {
|
|
4
6
|
id: number;
|
|
5
7
|
name: string;
|
|
6
8
|
email: string | null;
|
|
@@ -17,20 +19,44 @@ export declare class OrganizationEntityModel implements IOrganizationEntity {
|
|
|
17
19
|
sebiCertificate: string;
|
|
18
20
|
validateFrom: string;
|
|
19
21
|
validateTo: string;
|
|
20
|
-
createdOn:
|
|
21
|
-
updatedOn:
|
|
22
|
+
createdOn: number;
|
|
23
|
+
updatedOn: number;
|
|
22
24
|
createdBy: number;
|
|
23
25
|
updatedBy: number;
|
|
24
26
|
remarks: string;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
users: UserEntityModel[];
|
|
28
|
+
constructor();
|
|
29
|
+
/**
|
|
30
|
+
* Create model instance from entity
|
|
31
|
+
*/
|
|
32
|
+
static fromEntity(entity: IOrganizationEntity): OrganizationEntityModel;
|
|
33
|
+
/**
|
|
34
|
+
* Return relation configs (if any)
|
|
35
|
+
*/
|
|
36
|
+
getRelationConfigs(): any;
|
|
37
|
+
static fromRegistrationModel(registrationEntityModel: RegistrationEntityModel): OrganizationEntityModel;
|
|
38
|
+
/**
|
|
39
|
+
* Convert model instance to plain entity
|
|
40
|
+
*/
|
|
41
|
+
toEntity(): IOrganizationEntity;
|
|
42
|
+
/**
|
|
43
|
+
* Utility getters for file/folder names
|
|
44
|
+
*/
|
|
45
|
+
getPanFolderName(): string | undefined;
|
|
46
|
+
getPanFileName(): string | undefined;
|
|
29
47
|
getGstFolderName(): string | undefined;
|
|
30
48
|
getGstFileName(): string | undefined;
|
|
31
49
|
getDeedFolderName(): string | undefined;
|
|
32
50
|
getDeedFileName(): string | undefined;
|
|
33
51
|
getSebiCertificateFolderName(): string | undefined;
|
|
34
52
|
getSebiCertificateFileName(): string | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* Find organization by registrationId
|
|
55
|
+
*/
|
|
35
56
|
static findByRegistrationId(organizationEntities: IOrganizationEntity[], registrationId: number): IOrganizationEntity | undefined;
|
|
57
|
+
validateOwnersCountByOrganizationType(): void;
|
|
58
|
+
getUsersModels(): UserEntityModel[];
|
|
59
|
+
static relationConfigs: RelationConfigs<[
|
|
60
|
+
EntityEnum.USER
|
|
61
|
+
], EnumEntityType<EntityEnum.ORGANIZATION>>;
|
|
36
62
|
}
|