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
|
@@ -2,38 +2,112 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.OrganizationEntityModel = void 0;
|
|
4
4
|
const _enum_1 = require("../@enum");
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
5
|
+
const relation_type_enum_1 = require("../enum/relation-type.enum");
|
|
6
|
+
const _model_1 = require("../@model");
|
|
7
|
+
const _type_1 = require("../@type");
|
|
8
|
+
const base_entity_model_1 = require("./base.entity.model");
|
|
9
|
+
class OrganizationEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(_type_1.EntityEnum.ORGANIZATION);
|
|
12
|
+
this.id = 0;
|
|
13
|
+
this.name = "";
|
|
14
|
+
this.email = null;
|
|
15
|
+
this.contactNo = null;
|
|
16
|
+
this.type = "";
|
|
17
|
+
this.panNo = "";
|
|
18
|
+
this.panFilePath = "";
|
|
19
|
+
this.gstNo = null;
|
|
20
|
+
this.gstFilePath = null;
|
|
21
|
+
this.deed = null;
|
|
22
|
+
this.deedFilePath = "";
|
|
23
|
+
this.status = _enum_1.OrganizationStatus.REGISTRATION_APPROVED;
|
|
24
|
+
this.registrationId = 0;
|
|
25
|
+
this.sebiCertificate = "";
|
|
26
|
+
this.validateFrom = "";
|
|
27
|
+
this.validateTo = "";
|
|
28
|
+
this.createdOn = 0;
|
|
29
|
+
this.updatedOn = 0;
|
|
30
|
+
this.createdBy = 0;
|
|
31
|
+
this.updatedBy = 0;
|
|
32
|
+
this.remarks = "";
|
|
31
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Create model instance from entity
|
|
36
|
+
*/
|
|
37
|
+
static fromEntity(entity) {
|
|
38
|
+
const result = new OrganizationEntityModel();
|
|
39
|
+
Object.assign(result, entity);
|
|
40
|
+
return result;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Return relation configs (if any)
|
|
44
|
+
*/
|
|
45
|
+
getRelationConfigs() {
|
|
46
|
+
return this.constructor.prototype.constructor.relationConfigs;
|
|
47
|
+
}
|
|
48
|
+
static fromRegistrationModel(registrationEntityModel) {
|
|
49
|
+
const organizationModel = new OrganizationEntityModel();
|
|
50
|
+
organizationModel.name = "";
|
|
51
|
+
organizationModel.email = null;
|
|
52
|
+
organizationModel.contactNo = null;
|
|
53
|
+
organizationModel.type = "";
|
|
54
|
+
organizationModel.panNo = "";
|
|
55
|
+
organizationModel.panFilePath = "";
|
|
56
|
+
organizationModel.gstNo = null;
|
|
57
|
+
organizationModel.gstFilePath = null;
|
|
58
|
+
organizationModel.deed = null;
|
|
59
|
+
organizationModel.deedFilePath = "";
|
|
60
|
+
organizationModel.status = _enum_1.OrganizationStatus.REGISTRATION_APPROVED;
|
|
61
|
+
organizationModel.registrationId = registrationEntityModel.id;
|
|
62
|
+
organizationModel.sebiCertificate = "";
|
|
63
|
+
organizationModel.validateFrom = "";
|
|
64
|
+
organizationModel.validateTo = "";
|
|
65
|
+
organizationModel.createdBy = registrationEntityModel.createdBy;
|
|
66
|
+
organizationModel.createdOn = Date.now();
|
|
67
|
+
organizationModel.updatedBy = registrationEntityModel.createdBy;
|
|
68
|
+
organizationModel.updatedOn = Date.now();
|
|
69
|
+
organizationModel.remarks = "";
|
|
70
|
+
return organizationModel;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Convert model instance to plain entity
|
|
74
|
+
*/
|
|
75
|
+
toEntity() {
|
|
76
|
+
const entity = {
|
|
77
|
+
id: this.id,
|
|
78
|
+
name: this.name,
|
|
79
|
+
email: this.email,
|
|
80
|
+
contactNo: this.contactNo,
|
|
81
|
+
type: this.type,
|
|
82
|
+
panNo: this.panNo,
|
|
83
|
+
panFilePath: this.panFilePath,
|
|
84
|
+
gstNo: this.gstNo,
|
|
85
|
+
gstFilePath: this.gstFilePath,
|
|
86
|
+
deed: this.deed,
|
|
87
|
+
deedFilePath: this.deedFilePath,
|
|
88
|
+
status: this.status,
|
|
89
|
+
registrationId: this.registrationId,
|
|
90
|
+
sebiCertificate: this.sebiCertificate,
|
|
91
|
+
validateFrom: this.validateFrom,
|
|
92
|
+
validateTo: this.validateTo,
|
|
93
|
+
createdOn: this.createdOn,
|
|
94
|
+
updatedOn: this.updatedOn,
|
|
95
|
+
createdBy: this.createdBy,
|
|
96
|
+
updatedBy: this.updatedBy,
|
|
97
|
+
remarks: this.remarks,
|
|
98
|
+
};
|
|
99
|
+
return entity;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Utility getters for file/folder names
|
|
103
|
+
*/
|
|
32
104
|
getPanFolderName() {
|
|
33
|
-
|
|
105
|
+
var _a;
|
|
106
|
+
return (_a = this.panFilePath) === null || _a === void 0 ? void 0 : _a.split("/").slice(3, 5)[0];
|
|
34
107
|
}
|
|
35
108
|
getPanFileName() {
|
|
36
|
-
|
|
109
|
+
var _a;
|
|
110
|
+
return (_a = this.panFilePath) === null || _a === void 0 ? void 0 : _a.split("/").slice(3, 5)[1];
|
|
37
111
|
}
|
|
38
112
|
getGstFolderName() {
|
|
39
113
|
var _a;
|
|
@@ -59,8 +133,128 @@ class OrganizationEntityModel {
|
|
|
59
133
|
var _a;
|
|
60
134
|
return (_a = this.sebiCertificate) === null || _a === void 0 ? void 0 : _a.split("/").slice(3, 5)[1];
|
|
61
135
|
}
|
|
136
|
+
/**
|
|
137
|
+
* Find organization by registrationId
|
|
138
|
+
*/
|
|
62
139
|
static findByRegistrationId(organizationEntities, registrationId) {
|
|
63
|
-
return organizationEntities.find((organizationEntity) => organizationEntity.registrationId
|
|
140
|
+
return organizationEntities.find((organizationEntity) => organizationEntity.registrationId === registrationId);
|
|
141
|
+
}
|
|
142
|
+
// static getEmptyOrganzationEntityByRegistrationEntity(
|
|
143
|
+
// registrationEntity: IRegistrationEntity
|
|
144
|
+
// ): IOrganizationEntity {
|
|
145
|
+
// return OrganizationEntityModel.fromRegistrationModel(registrationEntity);
|
|
146
|
+
// }
|
|
147
|
+
validateOwnersCountByOrganizationType() {
|
|
148
|
+
var _a;
|
|
149
|
+
const noOfOwners = (_a = this.users) === null || _a === void 0 ? void 0 : _a.filter((user) => user.type === _enum_1.UserType.ADVISOR).length;
|
|
150
|
+
if (this.type === _enum_1.OrganizationType.PARTNERSHIP && noOfOwners <= 1) {
|
|
151
|
+
throw new _model_1.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
|
+
getUsersModels() {
|
|
160
|
+
return this.users;
|
|
64
161
|
}
|
|
65
162
|
}
|
|
66
163
|
exports.OrganizationEntityModel = OrganizationEntityModel;
|
|
164
|
+
OrganizationEntityModel.relationConfigs = [
|
|
165
|
+
{
|
|
166
|
+
name: _type_1.EntityEnum.USER,
|
|
167
|
+
relation: relation_type_enum_1.RelationType.MANY,
|
|
168
|
+
key: "users",
|
|
169
|
+
mapKeyConfig: {
|
|
170
|
+
relationKey: "organizationId",
|
|
171
|
+
key: "id",
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
];
|
|
175
|
+
// import { OrganizationStatus, OrganizationType } from "../@enum";
|
|
176
|
+
// import { IOrganizationEntity, IRegistrationEntity } from "../@type";
|
|
177
|
+
// export class OrganizationEntityModel implements IOrganizationEntity {
|
|
178
|
+
// id: number;
|
|
179
|
+
// name: string;
|
|
180
|
+
// email: string | null;
|
|
181
|
+
// contactNo: string | null;
|
|
182
|
+
// type: OrganizationType;
|
|
183
|
+
// panNo: string;
|
|
184
|
+
// panFilePath: string;
|
|
185
|
+
// gstNo: string | null;
|
|
186
|
+
// gstFilePath: string | null;
|
|
187
|
+
// deed: string | null;
|
|
188
|
+
// deedFilePath: string | null;
|
|
189
|
+
// status: OrganizationStatus;
|
|
190
|
+
// registrationId: number;
|
|
191
|
+
// sebiCertificate: string;
|
|
192
|
+
// validateFrom: string;
|
|
193
|
+
// validateTo: string;
|
|
194
|
+
// createdOn: Date;
|
|
195
|
+
// updatedOn: Date;
|
|
196
|
+
// createdBy: number;
|
|
197
|
+
// updatedBy: number;
|
|
198
|
+
// remarks: string;
|
|
199
|
+
// constructor(data: IOrganizationEntity) {
|
|
200
|
+
// Object.assign(this, data);
|
|
201
|
+
// }
|
|
202
|
+
// static getEntityInstanceByRegistrationEntity(
|
|
203
|
+
// registrationEntity: IRegistrationEntity
|
|
204
|
+
// ): IOrganizationEntity {
|
|
205
|
+
// const organizationEntity: IOrganizationEntity = {} as IOrganizationEntity;
|
|
206
|
+
// organizationEntity.name = "";
|
|
207
|
+
// organizationEntity.email = null;
|
|
208
|
+
// organizationEntity.contactNo = null;
|
|
209
|
+
// organizationEntity.type = "" as OrganizationType;
|
|
210
|
+
// organizationEntity.panNo = "";
|
|
211
|
+
// organizationEntity.panFilePath = "";
|
|
212
|
+
// organizationEntity.gstNo = null;
|
|
213
|
+
// organizationEntity.gstFilePath = null;
|
|
214
|
+
// organizationEntity.deed = null;
|
|
215
|
+
// organizationEntity.deedFilePath = "";
|
|
216
|
+
// organizationEntity.status = OrganizationStatus.REGISTRATION_APPROVED;
|
|
217
|
+
// organizationEntity.registrationId = registrationEntity.id;
|
|
218
|
+
// organizationEntity.sebiCertificate = "";
|
|
219
|
+
// organizationEntity.validateFrom = "";
|
|
220
|
+
// organizationEntity.validateTo = "";
|
|
221
|
+
// organizationEntity.createdBy = registrationEntity.createdBy;
|
|
222
|
+
// organizationEntity.createdOn = new Date();
|
|
223
|
+
// organizationEntity.updatedBy = registrationEntity.createdBy;
|
|
224
|
+
// organizationEntity.updatedOn = new Date();
|
|
225
|
+
// return organizationEntity;
|
|
226
|
+
// }
|
|
227
|
+
// getPanFolderName(): string {
|
|
228
|
+
// return this.panFilePath.split("/").slice(3, 5)[0];
|
|
229
|
+
// }
|
|
230
|
+
// getPanFileName(): string {
|
|
231
|
+
// return this.panFilePath.split("/").slice(3, 5)[1];
|
|
232
|
+
// }
|
|
233
|
+
// getGstFolderName(): string | undefined {
|
|
234
|
+
// return this.gstFilePath?.split("/").slice(3, 5)[0];
|
|
235
|
+
// }
|
|
236
|
+
// getGstFileName(): string | undefined {
|
|
237
|
+
// return this.gstFilePath?.split("/").slice(3, 5)[1];
|
|
238
|
+
// }
|
|
239
|
+
// getDeedFolderName(): string | undefined {
|
|
240
|
+
// return this.deedFilePath?.split("/").slice(3, 5)[0];
|
|
241
|
+
// }
|
|
242
|
+
// getDeedFileName(): string | undefined {
|
|
243
|
+
// return this.deedFilePath?.split("/").slice(3, 5)[1];
|
|
244
|
+
// }
|
|
245
|
+
// getSebiCertificateFolderName(): string | undefined {
|
|
246
|
+
// return this.sebiCertificate?.split("/").slice(3, 5)[0];
|
|
247
|
+
// }
|
|
248
|
+
// getSebiCertificateFileName(): string | undefined {
|
|
249
|
+
// return this.sebiCertificate?.split("/").slice(3, 5)[1];
|
|
250
|
+
// }
|
|
251
|
+
// static findByRegistrationId(
|
|
252
|
+
// organizationEntities: IOrganizationEntity[],
|
|
253
|
+
// registrationId: number
|
|
254
|
+
// ) {
|
|
255
|
+
// return organizationEntities.find(
|
|
256
|
+
// (organizationEntity) =>
|
|
257
|
+
// organizationEntity.registrationId == registrationId
|
|
258
|
+
// );
|
|
259
|
+
// }
|
|
260
|
+
// }
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import { PricingPlanStatus } from "../@enum";
|
|
2
|
-
import { IBillingCycle, IGetPricingPlanByDateResponse, IPricingPlanEntity } from "../@type";
|
|
3
|
-
|
|
2
|
+
import { EntityEnum, IBillingCycle, IGetPricingPlanByDateResponse, IPricingPlanEntity } from "../@type";
|
|
3
|
+
import { BaseEntityModel } from "./base.entity.model";
|
|
4
|
+
export declare class PricingPlanEntityModel extends BaseEntityModel<EntityEnum.PRICING_PLAN> implements IPricingPlanEntity {
|
|
4
5
|
id: number;
|
|
5
6
|
effectiveFrom: number;
|
|
6
7
|
effectiveTo: number;
|
|
7
8
|
status: PricingPlanStatus;
|
|
8
9
|
createdBy: number;
|
|
9
|
-
createdOn:
|
|
10
|
+
createdOn: number;
|
|
10
11
|
updatedBy: number;
|
|
11
|
-
updatedOn:
|
|
12
|
+
updatedOn: number;
|
|
12
13
|
basePrice: number;
|
|
13
14
|
billingCycle: string;
|
|
14
15
|
constructor(data: IPricingPlanEntity);
|
|
16
|
+
getRelationConfigs(): any;
|
|
17
|
+
static fromEntity(entity: IPricingPlanEntity): PricingPlanEntityModel;
|
|
15
18
|
toObject(): IGetPricingPlanByDateResponse;
|
|
16
19
|
static getBillingCycleString(billingCycle: IBillingCycle): string;
|
|
17
20
|
static validateNoOfMonthsByBillingCycle(billingCycle: IBillingCycle): void;
|
|
@@ -2,10 +2,21 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BillingCycleModel = exports.PricingPlanEntityModel = void 0;
|
|
4
4
|
const _model_1 = require("../@model");
|
|
5
|
-
|
|
5
|
+
const _type_1 = require("../@type");
|
|
6
|
+
const base_entity_model_1 = require("./base.entity.model");
|
|
7
|
+
class PricingPlanEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
6
8
|
constructor(data) {
|
|
9
|
+
super(_type_1.EntityEnum.PRICING_PLAN);
|
|
7
10
|
Object.assign(this, data);
|
|
8
11
|
}
|
|
12
|
+
getRelationConfigs() {
|
|
13
|
+
return this.constructor.prototype.constructor.relationConfigs;
|
|
14
|
+
}
|
|
15
|
+
static fromEntity(entity) {
|
|
16
|
+
const result = new PricingPlanEntityModel(entity);
|
|
17
|
+
Object.assign(result, entity);
|
|
18
|
+
return result;
|
|
19
|
+
}
|
|
9
20
|
toObject() {
|
|
10
21
|
const responseObj = {
|
|
11
22
|
id: this.id,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { IGetPricingPlanByDateResponse, IPricingPlanModel, IBillingCycleObj } from "../@type";
|
|
2
|
-
|
|
1
|
+
import { IGetPricingPlanByDateResponse, IPricingPlanModel, IBillingCycleObj, IPricingPlanEntity, EntityEnum } from "../@type";
|
|
2
|
+
import { BaseEntityModel } from "./base.entity.model";
|
|
3
|
+
export declare class PricingPlanModel extends BaseEntityModel<EntityEnum.PRICING_PLAN> implements IPricingPlanModel {
|
|
3
4
|
id: number;
|
|
4
5
|
effectiveFromDate: number;
|
|
5
6
|
effectiveToDate: number;
|
|
@@ -7,7 +8,8 @@ export declare class PricingPlanModel implements IPricingPlanModel {
|
|
|
7
8
|
billingCycle: {
|
|
8
9
|
[key: string]: IBillingCycleObj;
|
|
9
10
|
};
|
|
10
|
-
constructor(data
|
|
11
|
+
constructor(data?: IGetPricingPlanByDateResponse);
|
|
12
|
+
getRelationConfigs(): any;
|
|
11
13
|
getBillingCycleKeys(): string[];
|
|
12
14
|
validateBillingCycleKey(key: string): void;
|
|
13
15
|
getNoOfSubscriptionDays(type: string): number;
|
|
@@ -18,4 +20,5 @@ export declare class PricingPlanModel implements IPricingPlanModel {
|
|
|
18
20
|
fromDateCode: number;
|
|
19
21
|
toDateCode: number;
|
|
20
22
|
};
|
|
23
|
+
static fromEntity(entity: IPricingPlanEntity): PricingPlanModel;
|
|
21
24
|
}
|
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PricingPlanModel = void 0;
|
|
4
|
+
const _type_1 = require("../@type");
|
|
4
5
|
const _utils_1 = require("../@utils");
|
|
5
6
|
const app_badrequest_exception_1 = require("../exception/app-badrequest.exception");
|
|
6
|
-
|
|
7
|
+
const base_entity_model_1 = require("./base.entity.model");
|
|
8
|
+
class PricingPlanModel extends base_entity_model_1.BaseEntityModel {
|
|
7
9
|
constructor(data) {
|
|
8
|
-
|
|
10
|
+
super(_type_1.EntityEnum.PRICING_PLAN);
|
|
11
|
+
this.id = 0;
|
|
12
|
+
this.effectiveFromDate = 0;
|
|
13
|
+
this.effectiveToDate = 0;
|
|
14
|
+
this.basePrice = 0;
|
|
15
|
+
this.billingCycle = {};
|
|
16
|
+
if (data)
|
|
17
|
+
Object.assign(this, data);
|
|
18
|
+
}
|
|
19
|
+
getRelationConfigs() {
|
|
20
|
+
return this.constructor.prototype.constructor.relationConfigs;
|
|
9
21
|
}
|
|
10
22
|
getBillingCycleKeys() {
|
|
11
23
|
return Object.values(this.billingCycle).map((billingCycleObj) => billingCycleObj.key);
|
|
@@ -15,7 +27,7 @@ class PricingPlanModel {
|
|
|
15
27
|
throw new app_badrequest_exception_1.AppBadRequestException({
|
|
16
28
|
key: "type",
|
|
17
29
|
message: [
|
|
18
|
-
`subscription with type:'${key}' is wrong,type should be one of the ${this.getBillingCycleKeys()}`,
|
|
30
|
+
`subscription with type:'${key}' is wrong, type should be one of the ${this.getBillingCycleKeys()}`,
|
|
19
31
|
],
|
|
20
32
|
});
|
|
21
33
|
}
|
|
@@ -39,11 +51,11 @@ class PricingPlanModel {
|
|
|
39
51
|
}
|
|
40
52
|
validateGetToDateCode(fromDateCode, toDateCode, billingCycleKey) {
|
|
41
53
|
const calculatedToDateCode = this.getToDateCode(fromDateCode, billingCycleKey);
|
|
42
|
-
if (calculatedToDateCode
|
|
54
|
+
if (calculatedToDateCode !== Number(toDateCode)) {
|
|
43
55
|
throw new app_badrequest_exception_1.AppBadRequestException({
|
|
44
56
|
key: "to",
|
|
45
57
|
message: [
|
|
46
|
-
`calculated to Date:'${calculatedToDateCode}'
|
|
58
|
+
`calculated to Date:'${calculatedToDateCode}' does not match the to date you entered`,
|
|
47
59
|
],
|
|
48
60
|
});
|
|
49
61
|
}
|
|
@@ -52,10 +64,102 @@ class PricingPlanModel {
|
|
|
52
64
|
getFromToDateCode(billingCycleKey, offset = 0) {
|
|
53
65
|
const fromDateCode = Number(_utils_1.dateUtil.addNDaysToDateCode(_utils_1.dateUtil.getTodayCode(), offset));
|
|
54
66
|
const toDateCode = this.getToDateCode(fromDateCode, billingCycleKey);
|
|
55
|
-
return {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
67
|
+
return { fromDateCode, toDateCode };
|
|
68
|
+
}
|
|
69
|
+
static fromEntity(entity) {
|
|
70
|
+
const result = new PricingPlanModel();
|
|
71
|
+
Object.assign(result, entity);
|
|
72
|
+
return result;
|
|
59
73
|
}
|
|
60
74
|
}
|
|
61
75
|
exports.PricingPlanModel = PricingPlanModel;
|
|
76
|
+
// export class PricingPlanModel implements IPricingPlanModel {
|
|
77
|
+
// id: number;
|
|
78
|
+
// effectiveFromDate: number;
|
|
79
|
+
// effectiveToDate: number;
|
|
80
|
+
// basePrice: number;
|
|
81
|
+
// billingCycle: {
|
|
82
|
+
// [key: string]: IBillingCycleObj;
|
|
83
|
+
// };
|
|
84
|
+
// constructor(data: IGetPricingPlanByDateResponse) {
|
|
85
|
+
// Object.assign(this, data);
|
|
86
|
+
// }
|
|
87
|
+
// getBillingCycleKeys(): string[] {
|
|
88
|
+
// return Object.values(this.billingCycle).map(
|
|
89
|
+
// (billingCycleObj) => billingCycleObj.key
|
|
90
|
+
// );
|
|
91
|
+
// }
|
|
92
|
+
// validateBillingCycleKey(key: string): void {
|
|
93
|
+
// if (!this.getBillingCycleKeys().includes(key)) {
|
|
94
|
+
// throw new AppBadRequestException({
|
|
95
|
+
// key: "type",
|
|
96
|
+
// message: [
|
|
97
|
+
// `subscription with type:'${key}' is wrong,type should be one of the ${this.getBillingCycleKeys()}`,
|
|
98
|
+
// ],
|
|
99
|
+
// });
|
|
100
|
+
// }
|
|
101
|
+
// }
|
|
102
|
+
// getNoOfSubscriptionDays(type: string): number {
|
|
103
|
+
// this.validateBillingCycleKey(type);
|
|
104
|
+
// const billingCycleModel = this.getBillCycleByKey(type);
|
|
105
|
+
// return billingCycleModel!.noOfMonths * 30 - 1;
|
|
106
|
+
// }
|
|
107
|
+
// getBillCycleByKey(type: string): IBillingCycleObj {
|
|
108
|
+
// this.validateBillingCycleKey(type);
|
|
109
|
+
// return Object.values(this.billingCycle).filter(
|
|
110
|
+
// (billingCycleObj) => billingCycleObj.key === type
|
|
111
|
+
// )[0];
|
|
112
|
+
// }
|
|
113
|
+
// getToDateCode(fromDateCode: number, billingCycleKey: string): number {
|
|
114
|
+
// this.validateBillingCycleKey(billingCycleKey);
|
|
115
|
+
// const copyFromDateCode = fromDateCode;
|
|
116
|
+
// const newSubscriptionToDate = new Date(
|
|
117
|
+
// dateUtil.convertStringToDate(String(copyFromDateCode))
|
|
118
|
+
// );
|
|
119
|
+
// newSubscriptionToDate.setDate(
|
|
120
|
+
// newSubscriptionToDate.getDate() +
|
|
121
|
+
// this.getNoOfSubscriptionDays(billingCycleKey)
|
|
122
|
+
// );
|
|
123
|
+
// return Number(dateUtil.getDateCode(newSubscriptionToDate));
|
|
124
|
+
// }
|
|
125
|
+
// validateGetToDateCode(
|
|
126
|
+
// fromDateCode: number,
|
|
127
|
+
// toDateCode: number,
|
|
128
|
+
// billingCycleKey: string
|
|
129
|
+
// ) {
|
|
130
|
+
// const calculatedToDateCode = this.getToDateCode(
|
|
131
|
+
// fromDateCode,
|
|
132
|
+
// billingCycleKey
|
|
133
|
+
// );
|
|
134
|
+
// if (calculatedToDateCode != Number(toDateCode)) {
|
|
135
|
+
// throw new AppBadRequestException({
|
|
136
|
+
// key: "to",
|
|
137
|
+
// message: [
|
|
138
|
+
// `calculated to Date:'${calculatedToDateCode}' is not matches with to date you entered`,
|
|
139
|
+
// ],
|
|
140
|
+
// });
|
|
141
|
+
// }
|
|
142
|
+
// return calculatedToDateCode;
|
|
143
|
+
// }
|
|
144
|
+
// getFromToDateCode(
|
|
145
|
+
// billingCycleKey: string,
|
|
146
|
+
// offset = 0
|
|
147
|
+
// ): {
|
|
148
|
+
// fromDateCode: number;
|
|
149
|
+
// toDateCode: number;
|
|
150
|
+
// } {
|
|
151
|
+
// const fromDateCode = Number(
|
|
152
|
+
// dateUtil.addNDaysToDateCode(dateUtil.getTodayCode(), offset)
|
|
153
|
+
// );
|
|
154
|
+
// const toDateCode = this.getToDateCode(fromDateCode, billingCycleKey);
|
|
155
|
+
// return {
|
|
156
|
+
// fromDateCode,
|
|
157
|
+
// toDateCode,
|
|
158
|
+
// };
|
|
159
|
+
// }
|
|
160
|
+
// static fromEntity(entity: IPricingPlanEntity): PricingPlanModel {
|
|
161
|
+
// const result = new PricingPlanModel(EntityEnum.PRICING_PLAN);
|
|
162
|
+
// Object.assign(result, entity);
|
|
163
|
+
// return result;
|
|
164
|
+
// }
|
|
165
|
+
// }
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { RegistrationStatus } from "../@enum";
|
|
2
|
+
import { EntityEnum, IRegistrationEntity, IRegistrationEntityCreateDto, IUserEntity, IWithoutTokenRegistrationEntity } from "../@type";
|
|
3
|
+
import { BaseEntityModel } from "./base.entity.model";
|
|
4
|
+
import { OrganizationEntityModel } from "./organization-entity-model";
|
|
5
|
+
export declare class RegistrationEntityModel extends BaseEntityModel<EntityEnum.REGISTRATION> implements IRegistrationEntity {
|
|
6
|
+
id: number;
|
|
7
|
+
name: string;
|
|
8
|
+
contact: string;
|
|
9
|
+
email: string;
|
|
10
|
+
status: RegistrationStatus;
|
|
11
|
+
comments: string | null;
|
|
12
|
+
token: string | null;
|
|
13
|
+
createdOn: number;
|
|
14
|
+
updatedOn: number;
|
|
15
|
+
createdBy: number;
|
|
16
|
+
updatedBy: number;
|
|
17
|
+
constructor();
|
|
18
|
+
static fromEntity(entity: IRegistrationEntity): RegistrationEntityModel;
|
|
19
|
+
static getRegistrationEntityInstance(dto: IRegistrationEntityCreateDto, userEntity: IUserEntity): IRegistrationEntity;
|
|
20
|
+
static getRegistrationEntityWithouToken(registrationEntity: IRegistrationEntity): IWithoutTokenRegistrationEntity;
|
|
21
|
+
getRelationConfigs(): any;
|
|
22
|
+
toOrganizationModel(): OrganizationEntityModel;
|
|
23
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.RegistrationEntityModel = void 0;
|
|
15
|
+
const _enum_1 = require("../@enum");
|
|
16
|
+
const _type_1 = require("../@type");
|
|
17
|
+
const base_entity_model_1 = require("./base.entity.model");
|
|
18
|
+
const organization_entity_model_1 = require("./organization-entity-model");
|
|
19
|
+
class RegistrationEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
20
|
+
constructor() {
|
|
21
|
+
super(_type_1.EntityEnum.REGISTRATION);
|
|
22
|
+
this.id = 0;
|
|
23
|
+
this.name = "";
|
|
24
|
+
this.contact = "";
|
|
25
|
+
this.email = "";
|
|
26
|
+
this.status = _enum_1.RegistrationStatus.SETUP_DONE;
|
|
27
|
+
this.comments = null;
|
|
28
|
+
this.token = null;
|
|
29
|
+
this.createdOn = 0;
|
|
30
|
+
this.updatedOn = 0;
|
|
31
|
+
this.createdBy = 0;
|
|
32
|
+
this.updatedBy = 0;
|
|
33
|
+
}
|
|
34
|
+
static fromEntity(entity) {
|
|
35
|
+
const result = new RegistrationEntityModel();
|
|
36
|
+
Object.assign(result, entity);
|
|
37
|
+
return result;
|
|
38
|
+
}
|
|
39
|
+
static getRegistrationEntityInstance(dto, userEntity) {
|
|
40
|
+
var _a;
|
|
41
|
+
const entityInstance = Object.assign(Object.assign({}, dto), { id: 0, status: _enum_1.RegistrationStatus.REGISTRATION_APPROVED, token: null, comments: (_a = dto.comments) !== null && _a !== void 0 ? _a : null, createdBy: userEntity.id, updatedBy: userEntity.id, createdOn: Date.now(), updatedOn: Date.now() });
|
|
42
|
+
return entityInstance;
|
|
43
|
+
}
|
|
44
|
+
static getRegistrationEntityWithouToken(registrationEntity) {
|
|
45
|
+
const { token: _ } = registrationEntity, WithoutTokenRegistrationEntity = __rest(registrationEntity, ["token"]);
|
|
46
|
+
return WithoutTokenRegistrationEntity;
|
|
47
|
+
}
|
|
48
|
+
getRelationConfigs() {
|
|
49
|
+
return this.constructor.prototype.constructor.relationConfigs;
|
|
50
|
+
}
|
|
51
|
+
toOrganizationModel() {
|
|
52
|
+
return organization_entity_model_1.OrganizationEntityModel.fromRegistrationModel(this);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.RegistrationEntityModel = RegistrationEntityModel;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { SubscriptionStatus } from "../@enum";
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { EntityEnum, ISubscriptionEntity, ISubscriptionEntityCreateDto, IUserEntity } from "../@type";
|
|
3
|
+
import { BaseEntityModel } from "./base.entity.model";
|
|
4
|
+
export declare class SubscriptionEntityModel extends BaseEntityModel<EntityEnum.SUBSCRIPTION> implements ISubscriptionEntity {
|
|
4
5
|
id: number;
|
|
5
6
|
fromDateCode: number;
|
|
6
7
|
toDateCode: number;
|
|
@@ -14,12 +15,19 @@ export declare class SubscriptionEntityModel implements ISubscriptionEntity {
|
|
|
14
15
|
remarks: string;
|
|
15
16
|
registrationId: number;
|
|
16
17
|
pricingPlanId: number;
|
|
17
|
-
createdOn:
|
|
18
|
-
updatedOn:
|
|
18
|
+
createdOn: number;
|
|
19
|
+
updatedOn: number;
|
|
19
20
|
createdBy: number;
|
|
20
21
|
updatedBy: number;
|
|
21
|
-
constructor(
|
|
22
|
-
|
|
22
|
+
constructor();
|
|
23
|
+
/** -------------------- Static Mapper -------------------- */
|
|
24
|
+
static fromEntity(entity: ISubscriptionEntity): SubscriptionEntityModel;
|
|
25
|
+
/** -------------------- Factory Method -------------------- */
|
|
26
|
+
static getEntityInstanceByICreateSubscriptionRequestUserEntity(body: ISubscriptionEntityCreateDto, userEntity: IUserEntity, status: SubscriptionStatus, pricingPlanId: number): ISubscriptionEntity;
|
|
27
|
+
/** -------------------- Validation -------------------- */
|
|
23
28
|
validateAdvanceAmount(isAmountPaidValidation?: boolean): void;
|
|
24
|
-
|
|
29
|
+
/** -------------------- Helper -------------------- */
|
|
30
|
+
static filterByOrganizationId(subscriptionEntities: ISubscriptionEntity[], organizationId: number): ISubscriptionEntity[];
|
|
31
|
+
/** -------------------- Relation Config (if applicable) -------------------- */
|
|
32
|
+
getRelationConfigs(): any;
|
|
25
33
|
}
|