ia-common 1.1.1-beta.1 → 1.1.1-beta.3
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 +3 -1
- package/build/src/@enum.js +3 -1
- package/build/src/enum/error.key.enum.d.ts +3 -0
- package/build/src/enum/error.key.enum.js +7 -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/enum/user/{user-type.enum.d.ts → user-role.enum.d.ts} +1 -1
- package/build/src/enum/user/user-role.enum.js +13 -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 +45 -55
- package/build/src/interface/api/index.js +45 -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/permission.create.dto.interface.d.ts +3 -0
- package/build/src/interface/api/permission.update.dto.interface.d.ts +3 -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/role-create-dto.interface.d.ts +3 -0
- package/build/src/interface/api/role-update-dto.interface.d.ts +3 -0
- package/build/src/interface/api/role.permission.mapping.create.dto.interface.d.ts +5 -0
- package/build/src/interface/api/role.permission.mapping.delete.dto.interface.d.ts +3 -0
- package/build/src/interface/api/role.permission.mapping.response.d.ts +5 -0
- package/build/src/interface/api/role.permission.mapping.update.dto.interface.d.ts +3 -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-bonus.interface.js +2 -0
- package/build/src/interface/corporate-actions/update-split-stock.interface.d.ts +6 -0
- package/build/src/interface/corporate-actions/update-split-stock.interface.js +2 -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 +54 -8
- package/build/src/interface/entity/entity-utils.interface.js +19 -16
- package/build/src/interface/entity/index.d.ts +5 -1
- package/build/src/interface/entity/index.js +5 -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-advice-entity.interface.js +2 -0
- 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/permission.entity.interface.d.ts +9 -0
- package/build/src/interface/entity/permission.entity.interface.js +2 -0
- 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/relation-config.interface.js +2 -0
- package/build/src/interface/entity/role.entity.interface.d.ts +9 -0
- package/build/src/interface/entity/role.entity.interface.js +2 -0
- package/build/src/interface/entity/role.permission.mapping.entity.interface.d.ts +8 -0
- package/build/src/interface/entity/role.permission.mapping.entity.interface.js +2 -0
- package/build/src/interface/entity/subscription-entity.interface.d.ts +2 -2
- package/build/src/interface/entity/user-entity.interface.d.ts +5 -4
- 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/equity-advice-entity-model.js +46 -46
- package/build/src/model/index.d.ts +19 -10
- package/build/src/model/index.js +19 -10
- package/build/src/model/interface/entity.model.interface.d.ts +35 -11
- package/build/src/model/interface/entity.model.interface.js +187 -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/permission-entity-model.d.ts +18 -0
- package/build/src/model/permission-entity-model.js +30 -0
- 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/role-entity-model.d.ts +15 -0
- package/build/src/model/role-entity-model.js +27 -0
- package/build/src/model/role-permission-entity-model.d.ts +15 -0
- package/build/src/model/role-permission-entity-model.js +26 -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 +15 -9
- package/build/src/model/user-entity-model.js +109 -12
- package/build/src/utils/helper.fn.utils.d.ts +70 -0
- package/build/src/utils/helper.fn.utils.js +98 -1
- package/package.json +1 -1
- package/build/src/enum/user/user-type.enum.js +0 -13
- 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-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-subscription.interface.d.ts +0 -11
- /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 → permission.create.dto.interface.js} +0 -0
- /package/build/src/interface/api/{create-split-stock.interface.js → permission.update.dto.interface.js} +0 -0
- /package/build/src/interface/api/{create-staff-dto.js → pricing-plan-create.dto.interface.js} +0 -0
- /package/build/src/interface/api/{create-subscription.interface.js → pricing-plan-update-dto.interface.js} +0 -0
- /package/build/src/interface/api/{update-advice.interface.js → registration-create-dto.interface.js} +0 -0
- /package/build/src/interface/api/{update-bank-details.interface.js → registration-update-dto.interface.js} +0 -0
- /package/build/src/interface/api/{update-bonus-stock.interface.js → role-create-dto.interface.js} +0 -0
- /package/build/src/interface/api/{update-buy-back.interface.js → role-update-dto.interface.js} +0 -0
- /package/build/src/interface/api/{update-configuration.interface.js → role.permission.mapping.create.dto.interface.js} +0 -0
- /package/build/src/interface/api/{update-delisting.interface.js → role.permission.mapping.delete.dto.interface.js} +0 -0
- /package/build/src/interface/api/{update-dividend.interface.js → role.permission.mapping.response.js} +0 -0
- /package/build/src/interface/api/{update-fpo.interface.js → role.permission.mapping.update.dto.interface.js} +0 -0
- /package/build/src/interface/api/{update-ipo.interface.js → subscription-create.dto.interface.js} +0 -0
- /package/build/src/interface/api/{update-nfo-advice.interface.js → subscription-update.dto.interface.js} +0 -0
- /package/build/src/interface/api/{update-ofs.interface.js → update-user-dto.interface.js} +0 -0
- /package/build/src/interface/{api/update-open-offer.interface.js → corporate-actions/create-bonus-stock.interface.js} +0 -0
- /package/build/src/interface/{api/update-organization.interface.js → corporate-actions/update-bonus-stock.interface.js} +0 -0
- /package/build/src/interface/{api/update-pricing-plan.interface.js → corporate-actions/update-buy-back.interface.js} +0 -0
- /package/build/src/interface/{api/update-registration.interface.js → corporate-actions/update-delisting.interface.js} +0 -0
- /package/build/src/interface/{api/update-right-issue.interface.js → corporate-actions/update-dividend.interface.js} +0 -0
- /package/build/src/interface/{api/update-split-bonus.interface.js → corporate-actions/update-fpo.interface.js} +0 -0
- /package/build/src/interface/{api/update-split-stock.interface.js → corporate-actions/update-ipo.interface.js} +0 -0
- /package/build/src/interface/{api/update-staff.dto.js → corporate-actions/update-ofs.interface.js} +0 -0
- /package/build/src/interface/{api/update-subscription.interface.js → corporate-actions/update-open-offer.interface.js} +0 -0
- /package/build/src/interface/{entity/nfp-advice-entity.interface.js → corporate-actions/update-right-issue.interface.js} +0 -0
|
@@ -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;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { EntityEnum } from "../@type";
|
|
2
|
+
import { IRoleEntity } from "../interface/entity/role.entity.interface";
|
|
3
|
+
import { BaseEntityModel } from "./base.entity.model";
|
|
4
|
+
export declare class RoleEntityModel extends BaseEntityModel<EntityEnum.ROLE> implements IRoleEntity {
|
|
5
|
+
id: number;
|
|
6
|
+
name: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
organizationId: number;
|
|
9
|
+
createdOn: number;
|
|
10
|
+
updatedOn: number;
|
|
11
|
+
createdBy: number;
|
|
12
|
+
updatedBy: number;
|
|
13
|
+
getRelationConfigs(): any;
|
|
14
|
+
static fromEntity(entity: IRoleEntity): RoleEntityModel;
|
|
15
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RoleEntityModel = void 0;
|
|
4
|
+
const _type_1 = require("../@type");
|
|
5
|
+
const base_entity_model_1 = require("./base.entity.model");
|
|
6
|
+
class RoleEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.id = 0;
|
|
10
|
+
this.name = "";
|
|
11
|
+
this.description = "";
|
|
12
|
+
this.organizationId = 0;
|
|
13
|
+
this.createdOn = 0;
|
|
14
|
+
this.updatedOn = 0;
|
|
15
|
+
this.createdBy = 0;
|
|
16
|
+
this.updatedBy = 0;
|
|
17
|
+
}
|
|
18
|
+
getRelationConfigs() {
|
|
19
|
+
return this.constructor.prototype.constructor.relationConfigs;
|
|
20
|
+
}
|
|
21
|
+
static fromEntity(entity) {
|
|
22
|
+
const result = new RoleEntityModel(_type_1.EntityEnum.ROLE);
|
|
23
|
+
Object.assign(result, entity);
|
|
24
|
+
return result;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.RoleEntityModel = RoleEntityModel;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { EntityEnum } from "../@type";
|
|
2
|
+
import { IRolePermissionMappingEntity } from "../interface/entity/role.permission.mapping.entity.interface";
|
|
3
|
+
import { BaseEntityModel } from "./base.entity.model";
|
|
4
|
+
export declare class RolePermissionMappingEntityModel extends BaseEntityModel<EntityEnum.ROLE_PERMISSION_MAPPING> implements IRolePermissionMappingEntity {
|
|
5
|
+
id: number;
|
|
6
|
+
roleId: number;
|
|
7
|
+
permissionId: number;
|
|
8
|
+
createdOn: number;
|
|
9
|
+
updatedOn: number;
|
|
10
|
+
createdBy: number;
|
|
11
|
+
updatedBy: number;
|
|
12
|
+
constructor();
|
|
13
|
+
static fromEntity(entity: IRolePermissionMappingEntity): RolePermissionMappingEntityModel;
|
|
14
|
+
getRelationConfigs(): any;
|
|
15
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RolePermissionMappingEntityModel = void 0;
|
|
4
|
+
const _type_1 = require("../@type");
|
|
5
|
+
const base_entity_model_1 = require("./base.entity.model");
|
|
6
|
+
class RolePermissionMappingEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(_type_1.EntityEnum.ROLE_PERMISSION_MAPPING);
|
|
9
|
+
this.id = 0;
|
|
10
|
+
this.roleId = 0;
|
|
11
|
+
this.permissionId = 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 RolePermissionMappingEntityModel();
|
|
19
|
+
Object.assign(result, entity);
|
|
20
|
+
return result;
|
|
21
|
+
}
|
|
22
|
+
getRelationConfigs() {
|
|
23
|
+
return this.constructor.prototype.constructor.relationConfigs;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.RolePermissionMappingEntityModel = RolePermissionMappingEntityModel;
|
|
@@ -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
|
}
|
|
@@ -1,17 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SubscriptionEntityModel = void 0;
|
|
4
|
+
const _enum_1 = require("../@enum");
|
|
4
5
|
const _model_1 = require("../@model");
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
const _type_1 = require("../@type");
|
|
7
|
+
const base_entity_model_1 = require("./base.entity.model");
|
|
8
|
+
class SubscriptionEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(_type_1.EntityEnum.SUBSCRIPTION);
|
|
11
|
+
this.id = 0;
|
|
12
|
+
this.fromDateCode = 0;
|
|
13
|
+
this.toDateCode = 0;
|
|
14
|
+
this.organizationId = 0;
|
|
15
|
+
this.type = "";
|
|
16
|
+
this.grossAmount = 0;
|
|
17
|
+
this.discount = "";
|
|
18
|
+
this.netAmount = 0;
|
|
19
|
+
this.amountPaid = 0;
|
|
20
|
+
this.status = _enum_1.SubscriptionStatus.PAYMENT_PENDING;
|
|
21
|
+
this.remarks = "";
|
|
22
|
+
this.registrationId = 0;
|
|
23
|
+
this.pricingPlanId = 0;
|
|
24
|
+
this.createdOn = 0;
|
|
25
|
+
this.updatedOn = 0;
|
|
26
|
+
this.createdBy = 0;
|
|
27
|
+
this.updatedBy = 0;
|
|
8
28
|
}
|
|
29
|
+
/** -------------------- Static Mapper -------------------- */
|
|
30
|
+
static fromEntity(entity) {
|
|
31
|
+
const result = new SubscriptionEntityModel();
|
|
32
|
+
Object.assign(result, entity);
|
|
33
|
+
return result;
|
|
34
|
+
}
|
|
35
|
+
/** -------------------- Factory Method -------------------- */
|
|
9
36
|
static getEntityInstanceByICreateSubscriptionRequestUserEntity(body, userEntity, status, pricingPlanId) {
|
|
10
37
|
var _a;
|
|
11
38
|
const subscriptionEntity = {};
|
|
12
39
|
subscriptionEntity.organizationId = userEntity.organizationId;
|
|
13
|
-
subscriptionEntity.fromDateCode = body.
|
|
14
|
-
subscriptionEntity.toDateCode = body.
|
|
40
|
+
subscriptionEntity.fromDateCode = body.fromDateCode;
|
|
41
|
+
subscriptionEntity.toDateCode = body.toDateCode;
|
|
15
42
|
subscriptionEntity.type = body.type;
|
|
16
43
|
subscriptionEntity.grossAmount = body.grossAmount;
|
|
17
44
|
subscriptionEntity.discount = body.discount;
|
|
@@ -20,20 +47,21 @@ class SubscriptionEntityModel {
|
|
|
20
47
|
subscriptionEntity.status = status;
|
|
21
48
|
subscriptionEntity.remarks = (_a = body.remarks) !== null && _a !== void 0 ? _a : "";
|
|
22
49
|
subscriptionEntity.createdBy = userEntity.id;
|
|
23
|
-
subscriptionEntity.createdOn =
|
|
50
|
+
subscriptionEntity.createdOn = 0;
|
|
24
51
|
subscriptionEntity.updatedBy = userEntity.id;
|
|
25
|
-
subscriptionEntity.updatedOn =
|
|
52
|
+
subscriptionEntity.updatedOn = 0;
|
|
26
53
|
subscriptionEntity.pricingPlanId = pricingPlanId;
|
|
27
54
|
subscriptionEntity.registrationId = userEntity.registrationId;
|
|
28
55
|
return subscriptionEntity;
|
|
29
56
|
}
|
|
57
|
+
/** -------------------- Validation -------------------- */
|
|
30
58
|
validateAdvanceAmount(isAmountPaidValidation = false) {
|
|
31
59
|
if (this.amountPaid > this.netAmount) {
|
|
32
60
|
if (isAmountPaidValidation) {
|
|
33
61
|
throw new _model_1.AppBadRequestException({
|
|
34
62
|
key: "amountPaid",
|
|
35
63
|
message: [
|
|
36
|
-
`
|
|
64
|
+
`Amount paid ${this.amountPaid} cannot exceed net amount ${this.netAmount}`,
|
|
37
65
|
],
|
|
38
66
|
});
|
|
39
67
|
}
|
|
@@ -41,14 +69,94 @@ class SubscriptionEntityModel {
|
|
|
41
69
|
throw new _model_1.AppBadRequestException({
|
|
42
70
|
key: "advanceAmount",
|
|
43
71
|
message: [
|
|
44
|
-
`
|
|
72
|
+
`Advance should not be greater than net amount '${this.netAmount}'`,
|
|
45
73
|
],
|
|
46
74
|
});
|
|
47
75
|
}
|
|
48
76
|
}
|
|
49
77
|
}
|
|
50
|
-
|
|
51
|
-
|
|
78
|
+
/** -------------------- Helper -------------------- */
|
|
79
|
+
static filterByOrganizationId(subscriptionEntities, organizationId) {
|
|
80
|
+
return subscriptionEntities.filter((entity) => entity.organizationId === organizationId);
|
|
81
|
+
}
|
|
82
|
+
/** -------------------- Relation Config (if applicable) -------------------- */
|
|
83
|
+
getRelationConfigs() {
|
|
84
|
+
return this.constructor.prototype.constructor.relationConfigs;
|
|
52
85
|
}
|
|
53
86
|
}
|
|
54
87
|
exports.SubscriptionEntityModel = SubscriptionEntityModel;
|
|
88
|
+
// export class SubscriptionEntityModel implements ISubscriptionEntity {
|
|
89
|
+
// id: number;
|
|
90
|
+
// fromDateCode: number;
|
|
91
|
+
// toDateCode: number;
|
|
92
|
+
// organizationId: number;
|
|
93
|
+
// type: string;
|
|
94
|
+
// grossAmount: number;
|
|
95
|
+
// discount: string;
|
|
96
|
+
// netAmount: number;
|
|
97
|
+
// amountPaid: number;
|
|
98
|
+
// status: SubscriptionStatus;
|
|
99
|
+
// remarks: string;
|
|
100
|
+
// registrationId: number;
|
|
101
|
+
// pricingPlanId: number;
|
|
102
|
+
// createdOn: Date;
|
|
103
|
+
// updatedOn: Date;
|
|
104
|
+
// createdBy: number;
|
|
105
|
+
// updatedBy: number;
|
|
106
|
+
// constructor(subscriptionEntity: ISubscriptionEntity) {
|
|
107
|
+
// Object.assign(this, subscriptionEntity);
|
|
108
|
+
// }
|
|
109
|
+
// static getEntityInstanceByICreateSubscriptionRequestUserEntity(
|
|
110
|
+
// body: ICreateSubscriptionRequest,
|
|
111
|
+
// userEntity: IUserEntity,
|
|
112
|
+
// status: SubscriptionStatus,
|
|
113
|
+
// pricingPlanId: number
|
|
114
|
+
// ) {
|
|
115
|
+
// const subscriptionEntity = {} as ISubscriptionEntity;
|
|
116
|
+
// subscriptionEntity.organizationId = userEntity.organizationId;
|
|
117
|
+
// subscriptionEntity.fromDateCode = body.from;
|
|
118
|
+
// subscriptionEntity.toDateCode = body.to;
|
|
119
|
+
// subscriptionEntity.type = body.type;
|
|
120
|
+
// subscriptionEntity.grossAmount = body.grossAmount;
|
|
121
|
+
// subscriptionEntity.discount = body.discount;
|
|
122
|
+
// subscriptionEntity.netAmount = body.netAmount;
|
|
123
|
+
// subscriptionEntity.amountPaid = body.amountPaid;
|
|
124
|
+
// subscriptionEntity.status = status;
|
|
125
|
+
// subscriptionEntity.remarks = body.remarks ?? "";
|
|
126
|
+
// subscriptionEntity.createdBy = userEntity.id;
|
|
127
|
+
// subscriptionEntity.createdOn = new Date();
|
|
128
|
+
// subscriptionEntity.updatedBy = userEntity.id;
|
|
129
|
+
// subscriptionEntity.updatedOn = new Date();
|
|
130
|
+
// subscriptionEntity.pricingPlanId = pricingPlanId;
|
|
131
|
+
// subscriptionEntity.registrationId = userEntity.registrationId;
|
|
132
|
+
// return subscriptionEntity;
|
|
133
|
+
// }
|
|
134
|
+
// validateAdvanceAmount(isAmountPaidValidation = false): void {
|
|
135
|
+
// if (this.amountPaid > this.netAmount) {
|
|
136
|
+
// if (isAmountPaidValidation) {
|
|
137
|
+
// throw new AppBadRequestException({
|
|
138
|
+
// key: "amountPaid",
|
|
139
|
+
// message: [
|
|
140
|
+
// `amount paid ${this.amountPaid} is not equal to net amount ${this.netAmount}`,
|
|
141
|
+
// ],
|
|
142
|
+
// });
|
|
143
|
+
// } else {
|
|
144
|
+
// throw new AppBadRequestException({
|
|
145
|
+
// key: "advanceAmount",
|
|
146
|
+
// message: [
|
|
147
|
+
// `advance should not greater than net amount:'${this.netAmount}'`,
|
|
148
|
+
// ],
|
|
149
|
+
// });
|
|
150
|
+
// }
|
|
151
|
+
// }
|
|
152
|
+
// }
|
|
153
|
+
// static filterByOrganizationId(
|
|
154
|
+
// subScriptionEntities: ISubscriptionEntity[],
|
|
155
|
+
// organizationId: number
|
|
156
|
+
// ): ISubscriptionEntity[] {
|
|
157
|
+
// return subScriptionEntities.filter(
|
|
158
|
+
// (subScriptionEntity) =>
|
|
159
|
+
// subScriptionEntity.organizationId === organizationId
|
|
160
|
+
// );
|
|
161
|
+
// }
|
|
162
|
+
// }
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { IRegistrationEntity, IUserEntity } from "../@type";
|
|
3
|
-
|
|
1
|
+
import { UserRoleEnum, UserStatus } from "../@enum";
|
|
2
|
+
import { EntityEnum, IOrganizationEntity, IRegistrationEntity, IUserEntity } from "../@type";
|
|
3
|
+
import { BaseEntityModel } from "./base.entity.model";
|
|
4
|
+
export declare class UserEntityModel extends BaseEntityModel<EntityEnum.USER> implements IUserEntity {
|
|
4
5
|
id: number;
|
|
5
6
|
firstname: string;
|
|
6
7
|
phone: string;
|
|
@@ -11,16 +12,21 @@ export declare class UserEntityModel implements IUserEntity {
|
|
|
11
12
|
isMobileVerified: boolean;
|
|
12
13
|
isAccountVerified: boolean;
|
|
13
14
|
requireNewPassword: boolean;
|
|
14
|
-
|
|
15
|
+
role: UserRoleEnum;
|
|
15
16
|
registrationId: number;
|
|
16
17
|
organizationId: number;
|
|
17
18
|
imageUrl: string | null;
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
documentUrls: string | null;
|
|
20
|
+
permissions?: string[];
|
|
21
|
+
createdOn: number;
|
|
22
|
+
updatedOn: number;
|
|
20
23
|
createdBy: number;
|
|
21
24
|
updatedBy: number;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
static
|
|
25
|
+
constructor();
|
|
26
|
+
static fromEntity(entity: IUserEntity): UserEntityModel;
|
|
27
|
+
static fromRegistrationEntityOrganizationEntity(registrationEntity: IRegistrationEntity, organizationEntity: IOrganizationEntity, hashPassword: string): IUserEntity;
|
|
25
28
|
static filterByOrganizationId(userEntities: IUserEntity[], organizationId: number): IUserEntity[];
|
|
29
|
+
static getUserEntityInstanceFromRegistrationEntityOrganizationEntity(registrationEntity: IRegistrationEntity, organizationEntity: IOrganizationEntity, hashedPassword: string): IUserEntity;
|
|
30
|
+
getRelationConfigs(): any;
|
|
31
|
+
validateUserRoleSuperAdmin(): void;
|
|
26
32
|
}
|